diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-03 14:01:35 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-03 14:01:35 +0000 |
commit | e6f2eaf47a177a8eca054d1d70a1b6287e8c3521 (patch) | |
tree | c5719e819a9e37df4b54affd61438f382ec38a8f /modules.d/00systemd | |
parent | Adding upstream version 060+5. (diff) | |
download | dracut-e6f2eaf47a177a8eca054d1d70a1b6287e8c3521.tar.xz dracut-e6f2eaf47a177a8eca054d1d70a1b6287e8c3521.zip |
Adding upstream version 102.upstream/102
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'modules.d/00systemd')
-rwxr-xr-x | modules.d/00systemd/module-setup.sh | 105 |
1 files changed, 6 insertions, 99 deletions
diff --git a/modules.d/00systemd/module-setup.sh b/modules.d/00systemd/module-setup.sh index 9a13a1d..d173c99 100755 --- a/modules.d/00systemd/module-setup.sh +++ b/modules.d/00systemd/module-setup.sh @@ -23,8 +23,6 @@ installkernel() { # called by dracut install() { - local _mods - if [[ $prefix == /run/* ]]; then dfatal 'systemd does not work with a prefix, which contains "/run"!!' exit 1 @@ -38,10 +36,6 @@ install() { "$systemdutildir"/systemd-shutdown \ "$systemdutildir"/systemd-reply-password \ "$systemdutildir"/systemd-fsck \ - "$systemdutildir"/systemd-udevd \ - "$systemdutildir"/systemd-journald \ - "$systemdutildir"/systemd-sysctl \ - "$systemdutildir"/systemd-modules-load \ "$systemdutildir"/systemd-vconsole-setup \ "$systemdutildir"/systemd-volatile-root \ "$systemdutildir"/systemd-sysroot-fstab-check \ @@ -80,111 +74,35 @@ install() { "$systemdsystemunitdir"/paths.target \ "$systemdsystemunitdir"/umount.target \ "$systemdsystemunitdir"/sys-kernel-config.mount \ - "$systemdsystemunitdir"/modprobe@.service \ - "$systemdsystemunitdir"/kmod-static-nodes.service \ - "$systemdsystemunitdir"/systemd-tmpfiles-setup.service \ - "$systemdsystemunitdir"/systemd-tmpfiles-setup-dev.service \ - "$systemdsystemunitdir"/systemd-tmpfiles-setup-dev-early.service \ - "$systemdsystemunitdir"/systemd-ask-password-console.path \ - "$systemdsystemunitdir"/systemd-udevd-control.socket \ - "$systemdsystemunitdir"/systemd-udevd-kernel.socket \ - "$systemdsystemunitdir"/systemd-ask-password-plymouth.path \ - "$systemdsystemunitdir"/systemd-journald.socket \ - "$systemdsystemunitdir"/systemd-journald-audit.socket \ - "$systemdsystemunitdir"/systemd-ask-password-console.service \ - "$systemdsystemunitdir"/systemd-modules-load.service \ "$systemdsystemunitdir"/systemd-halt.service \ "$systemdsystemunitdir"/systemd-poweroff.service \ "$systemdsystemunitdir"/systemd-reboot.service \ "$systemdsystemunitdir"/systemd-kexec.service \ "$systemdsystemunitdir"/systemd-fsck@.service \ - "$systemdsystemunitdir"/systemd-udevd.service \ - "$systemdsystemunitdir"/systemd-udev-trigger.service \ - "$systemdsystemunitdir"/systemd-udev-settle.service \ - "$systemdsystemunitdir"/systemd-ask-password-plymouth.service \ - "$systemdsystemunitdir"/systemd-journald.service \ "$systemdsystemunitdir"/systemd-vconsole-setup.service \ "$systemdsystemunitdir"/systemd-volatile-root.service \ - "$systemdsystemunitdir"/systemd-sysctl.service \ - "$systemdsystemunitdir"/sysinit.target.wants/systemd-modules-load.service \ - "$systemdsystemunitdir"/sysinit.target.wants/systemd-ask-password-console.path \ - "$systemdsystemunitdir"/sysinit.target.wants/systemd-journald.service \ - "$systemdsystemunitdir"/sockets.target.wants/systemd-udevd-control.socket \ - "$systemdsystemunitdir"/sockets.target.wants/systemd-udevd-kernel.socket \ - "$systemdsystemunitdir"/sockets.target.wants/systemd-journald.socket \ - "$systemdsystemunitdir"/sockets.target.wants/systemd-journald-audit.socket \ - "$systemdsystemunitdir"/sockets.target.wants/systemd-journald-dev-log.socket \ - "$systemdsystemunitdir"/sysinit.target.wants/systemd-udevd.service \ - "$systemdsystemunitdir"/sysinit.target.wants/systemd-udev-trigger.service \ - "$systemdsystemunitdir"/sysinit.target.wants/kmod-static-nodes.service \ - "$systemdsystemunitdir"/sysinit.target.wants/systemd-tmpfiles-setup.service \ - "$systemdsystemunitdir"/sysinit.target.wants/systemd-tmpfiles-setup-dev.service \ - "$systemdsystemunitdir"/sysinit.target.wants/systemd-tmpfiles-setup-dev-early.service \ - "$systemdsystemunitdir"/sysinit.target.wants/systemd-sysctl.service \ "$systemdsystemunitdir"/ctrl-alt-del.target \ - "$systemdsystemunitdir"/reboot.target \ - "$systemdsystemunitdir"/systemd-reboot.service \ "$systemdsystemunitdir"/syslog.socket \ "$systemdsystemunitdir"/slices.target \ "$systemdsystemunitdir"/system.slice \ "$systemdsystemunitdir"/-.slice \ - "$tmpfilesdir"/systemd.conf \ - journalctl systemctl \ + systemctl \ echo swapoff \ - kmod insmod rmmod modprobe modinfo depmod lsmod \ mount umount reboot poweroff \ systemd-run systemd-escape \ - systemd-cgls systemd-tmpfiles \ - systemd-ask-password systemd-tty-ask-password-agent \ - /etc/udev/udev.hwdb - - inst_multiple -o \ - /usr/lib/modules-load.d/*.conf \ - /usr/lib/sysctl.d/*.conf - - modules_load_get() { - local _line i - for i in "$dracutsysrootdir$1"/*.conf; do - [[ -f $i ]] || continue - while read -r _line || [ -n "$_line" ]; do - case $_line in - \#*) ;; - - \;*) ;; - - *) - echo "$_line" - ;; - esac - done < "$i" - done - } - - mapfile -t _mods < <(modules_load_get /usr/lib/modules-load.d) - [[ ${#_mods[@]} -gt 0 ]] && hostonly='' instmods "${_mods[@]}" + systemd-cgls if [[ $hostonly ]]; then inst_multiple -H -o \ - /etc/systemd/journald.conf \ - /etc/systemd/journald.conf.d/*.conf \ /etc/systemd/system.conf \ /etc/systemd/system.conf.d/*.conf \ - "$systemdsystemconfdir"/modprobe@.service \ - "$systemdsystemconfdir/modprobe@.service.d/*.conf" \ /etc/hosts \ /etc/hostname \ /etc/nsswitch.conf \ /etc/machine-id \ /etc/machine-info \ /etc/vconsole.conf \ - /etc/locale.conf \ - /etc/modules-load.d/*.conf \ - /etc/sysctl.d/*.conf \ - /etc/sysctl.conf \ - /etc/udev/udev.conf - - mapfile -t _mods < <(modules_load_get /etc/modules-load.d) - [[ ${#_mods[@]} -gt 0 ]] && hostonly='' instmods "${_mods[@]}" + /etc/locale.conf fi if ! [[ -e "$initdir/etc/machine-id" ]]; then @@ -192,17 +110,14 @@ install() { chmod 444 "$initdir/etc/machine-id" fi - # install adm user/group for journald inst_multiple nologin { - grep '^systemd-journal:' "$dracutsysrootdir"/etc/passwd 2> /dev/null grep '^adm:' "$dracutsysrootdir"/etc/passwd 2> /dev/null # we don't use systemd-networkd, but the user is in systemd.conf tmpfiles snippet grep '^systemd-network:' "$dracutsysrootdir"/etc/passwd 2> /dev/null } >> "$initdir/etc/passwd" { - grep '^systemd-journal:' "$dracutsysrootdir"/etc/group 2> /dev/null grep '^wheel:' "$dracutsysrootdir"/etc/group 2> /dev/null grep '^adm:' "$dracutsysrootdir"/etc/group 2> /dev/null grep '^utmp:' "$dracutsysrootdir"/etc/group 2> /dev/null @@ -241,27 +156,19 @@ EOF for i in \ emergency.target \ - rescue.target \ - systemd-ask-password-console.service \ - systemd-ask-password-plymouth.service; do + rescue.target; do [[ -f "$systemdsystemunitdir"/$i ]] || continue $SYSTEMCTL -q --root "$initdir" add-wants "$i" systemd-vconsole-setup.service done mkdir -p "$initdir/etc/systemd" - # We must use a volatile journal, and we don't want rate-limiting - { - echo "[Journal]" - echo "Storage=volatile" - echo "RateLimitInterval=0" - echo "RateLimitBurst=0" - } >> "$initdir/etc/systemd/journald.conf" $SYSTEMCTL -q --root "$initdir" set-default multi-user.target # Install library file(s) _arch=${DRACUT_ARCH:-$(uname -m)} inst_libdir_file \ + {"tls/$_arch/",tls/,"$_arch/",}"libgcrypt.so*" \ + {"tls/$_arch/",tls/,"$_arch/",}"libkmod.so*" \ {"tls/$_arch/",tls/,"$_arch/",}"libnss_*" - } |