diff -urpa dracut-056.orig/dracut-init.sh dracut-056/dracut-init.sh --- dracut-056.orig/dracut-init.sh 2022-02-18 12:32:53.000000000 +0100 +++ dracut-056/dracut-init.sh 2022-08-30 01:20:04.811493149 +0200 @@ -1089,16 +1089,6 @@ fi is_qemu_virtualized() { # 0 if a virt environment was detected # 1 if a virt environment could not be detected - # 255 if any error was encountered - if type -P systemd-detect-virt > /dev/null 2>&1; then - if ! vm=$(systemd-detect-virt --vm > /dev/null 2>&1); then - return 255 - fi - [[ $vm == "qemu" ]] && return 0 - [[ $vm == "kvm" ]] && return 0 - [[ $vm == "bochs" ]] && return 0 - fi - for i in /sys/class/dmi/id/*_vendor; do [[ -f $i ]] || continue read -r vendor < "$i" diff -urpa dracut-056.orig/dracut-logger.sh dracut-056/dracut-logger.sh --- dracut-056.orig/dracut-logger.sh 2022-02-18 12:32:53.000000000 +0100 +++ dracut-056/dracut-logger.sh 2022-08-30 01:41:07.943471592 +0200 @@ -142,16 +142,7 @@ dlog_init() { fi if ((sysloglvl > 0)); then - if [[ -d /run/systemd/journal ]] \ - && type -P systemd-cat &> /dev/null \ - && systemctl --quiet is-active systemd-journald.socket &> /dev/null \ - && { echo "dracut-$DRACUT_VERSION" | systemd-cat -t 'dracut' &> /dev/null; }; then - readonly _systemdcatfile="$DRACUT_TMPDIR/systemd-cat" - mkfifo "$_systemdcatfile" - readonly _dlogfd=15 - systemd-cat -t 'dracut' --level-prefix=true < "$_systemdcatfile" & - exec 15> "$_systemdcatfile" - elif ! [[ -S /dev/log ]] && [[ -w /dev/log ]] || ! command -v logger > /dev/null; then + if ! [[ -S /dev/log ]] && [[ -w /dev/log ]] || ! command -v logger > /dev/null; then # We cannot log to syslog, so turn this facility off. kmsgloglvl=$sysloglvl sysloglvl=0 diff -urpa dracut-056.orig/dracut.sh dracut-056/dracut.sh --- dracut-056.orig/dracut.sh 2022-08-28 17:26:54.017178064 +0200 +++ dracut-056/dracut.sh 2022-08-30 01:40:33.614418115 +0200 @@ -1186,13 +1186,6 @@ if [[ -f $dracutbasedir/dracut-version.s . "$dracutbasedir"/dracut-version.sh fi -if systemd-detect-virt -c &> /dev/null; then - export DRACUT_NO_MKNOD=1 DRACUT_NO_XATTR=1 - if [[ $hostonly ]]; then - printf "%s\n" "dracut: WARNING: running in hostonly mode in a container!!" - fi -fi - if [[ -f $dracutbasedir/dracut-init.sh ]]; then # shellcheck source=./dracut-init.sh . "$dracutbasedir"/dracut-init.sh @@ -1284,19 +1277,6 @@ esac abs_outfile=$(readlink -f "$outfile") && outfile="$abs_outfile" -[[ -d $dracutsysrootdir$systemdutildir ]] \ - || systemdutildir=$(pkg-config systemd --variable=systemdutildir 2> /dev/null) - -if ! [[ -d $dracutsysrootdir$systemdutildir ]]; then - [[ -e $dracutsysrootdir/lib/systemd/systemd-udevd ]] && systemdutildir=/lib/systemd - [[ -e $dracutsysrootdir/usr/lib/systemd/systemd-udevd ]] && systemdutildir=/usr/lib/systemd -fi - -[[ -d $dracutsysrootdir$systemdutilconfdir ]] \ - || systemdutilconfdir=$(pkg-config systemd --variable=systemdutilconfdir 2> /dev/null) - -[[ -d $dracutsysrootdir$systemdutilconfdir ]] || systemdutilconfdir=/etc/systemd - if [[ $no_kernel != yes ]] && [[ -d $srcmods ]]; then if ! [[ -f $srcmods/modules.dep ]]; then if [[ -n "$(find "$srcmods" -name '*.ko*')" ]]; then @@ -1356,10 +1336,6 @@ if [[ ! $print_cmdline ]]; then esac if ! [[ -s $uefi_stub ]]; then - uefi_stub="$dracutsysrootdir${systemdutildir}/boot/efi/linux${EFI_MACHINE_TYPE_NAME}.efi.stub" - fi - - if ! [[ -s $uefi_stub ]]; then dfatal "Can't find a uefi stub '$uefi_stub' to create a UEFI executable" exit 1 fi @@ -1597,66 +1573,6 @@ for dev in "${!host_fs_types[@]}"; do fi done -[[ -d $dracutsysrootdir$dbus ]] \ - || dbus=$(pkg-config dbus --variable=dbus 2> /dev/null) - -[[ -d $dracutsysrootdir$dbus ]] || dbus=/usr/share/dbus-1 - -[[ -d $dracutsysrootdir$dbusconfdir ]] \ - || dbusconfdir=$(pkg-config dbus --variable=dbusconfdir 2> /dev/null) - -[[ -d $dracutsysrootdir$dbusconfdir ]] || dbusconfdir=/etc/dbus-1 - -[[ -d $dracutsysrootdir$dbusinterfaces ]] \ - || dbusinterfaces=$(pkg-config dbus --variable=dbusinterfaces 2> /dev/null) - -[[ -d $dracutsysrootdir$dbusinterfaces ]] || dbusinterfaces=${dbus}/interfaces - -[[ -d $dracutsysrootdir$dbusinterfacesconfdir ]] \ - || dbusinterfacesconfdir=$(pkg-config dbus --variable=dbusinterfacesconfdir 2> /dev/null) - -[[ -d $dracutsysrootdir$dbusinterfacesconfdir ]] || dbusinterfacesconfdir=${dbusconfdir}/interfaces - -[[ -d $dracutsysrootdir$dbusservices ]] \ - || dbusservices=$(pkg-config dbus --variable=dbusservices 2> /dev/null) - -[[ -d $dracutsysrootdir$dbusservices ]] || dbusservices=${dbus}/services - -[[ -d $dracutsysrootdir$dbusservicesconfdir ]] \ - || dbusservicesconfdir=$(pkg-config dbus --variable=dbusservicesconfdir 2> /dev/null) - -[[ -d $dracutsysrootdir$dbusservicesconfdir ]] || dbusservicesconfdir=${dbusconfdir}/services - -[[ -d $dracutsysrootdir$dbussession ]] \ - || dbussession=$(pkg-config dbus --variable=dbussession 2> /dev/null) - -[[ -d $dracutsysrootdir$dbussession ]] || dbussession=${dbus}/session.d - -[[ -d $dracutsysrootdir$dbussessionconfdir ]] \ - || dbussessionconfdir=$(pkg-config dbus --variable=dbussessionconfdir 2> /dev/null) - -[[ -d $dracutsysrootdir$dbussessionconfdir ]] || dbussessionconfdir=${dbusconfdir}/session.d - -[[ -d $dracutsysrootdir$dbussystem ]] \ - || dbussystem=$(pkg-config dbus --variable=dbussystem 2> /dev/null) - -[[ -d $dracutsysrootdir$dbussystem ]] || dbussystem=${dbus}/system.d - -[[ -d $dracutsysrootdir$dbussystemconfdir ]] \ - || dbussystemconfdir=$(pkg-config dbus --variable=dbussystemconfdir 2> /dev/null) - -[[ -d $dracutsysrootdir$dbussystemconfdir ]] || dbussystemconfdir=${dbusconfdir}/system.d - -[[ -d $dracutsysrootdir$dbussystemservices ]] \ - || dbussystemservices=$(pkg-config dbus --variable=dbussystemservices 2> /dev/null) - -[[ -d $dracutsysrootdir$dbussystemservices ]] || dbussystemservices=${dbus}/system-services - -[[ -d $dracutsysrootdir$dbussystemservicesconfdir ]] \ - || dbussystemservicesconfdir=$(pkg-config dbus --variable=dbussystemservicesconfdir 2> /dev/null) - -[[ -d $dracutsysrootdir$dbussystemservicesconfdir ]] || dbussystemservicesconfdir=${dbusconfdir}/system-services - [[ -d $dracutsysrootdir$udevdir ]] \ || udevdir="$(pkg-config udev --variable=udevdir 2> /dev/null)" if ! [[ -d $dracutsysrootdir$udevdir ]]; then @@ -1679,114 +1595,22 @@ fi [[ -d $dracutsysrootdir$udevrulesconfdir ]] || udevrulesconfdir=${udevconfdir}/rules.d -[[ -d $dracutsysrootdir$sysctld ]] \ - || sysctld=$(pkg-config systemd --variable=sysctld 2> /dev/null) - [[ -d $dracutsysrootdir$sysctld ]] || sysctld=/usr/lib/sysctl.d -[[ -d $dracutsysrootdir$sysctlconfdir ]] \ - || sysctlconfdir=$(pkg-config systemd --variable=sysctlconfdir 2> /dev/null) - [[ -d $dracutsysrootdir$sysctlconfdir ]] || sysctlconfdir=/etc/sysctl.d -[[ -d $dracutsysrootdir$environment ]] \ - || environment=$(pkg-config systemd --variable=environment 2> /dev/null) - [[ -d $dracutsysrootdir$environment ]] || environment=/usr/lib/environment.d -[[ -d $dracutsysrootdir$environmentconfdir ]] \ - || environmentconfdir=$(pkg-config systemd --variable=environmentconfdir 2> /dev/null) - [[ -d $dracutsysrootdir$environmentconfdir ]] || environmentconfdir=/etc/environment.d -[[ -d $dracutsysrootdir$systemdcatalog ]] \ - || systemdcatalog=$(pkg-config systemd --variable=systemdcatalog 2> /dev/null) - -[[ -d $dracutsysrootdir$systemdcatalog ]] || systemdcatalog=${systemdutildir}/catalog - -[[ -d $dracutsysrootdir$modulesload ]] \ - || modulesload=$(pkg-config systemd --variable=modulesload 2> /dev/null) - [[ -d $dracutsysrootdir$modulesload ]] || modulesload=/usr/lib/modules-load.d -[[ -d $dracutsysrootdir$modulesloadconfdir ]] \ - || modulesloadconfdir=$(pkg-config systemd --variable=modulesloadconfdir 2> /dev/null) - [[ -d $dracutsysrootdir$modulesloadconfdir ]] || modulesloadconfdir=/etc/modules-load.d -[[ -d $dracutsysrootdir$systemdnetwork ]] \ - || systemdnetwork=$(pkg-config systemd --variable=systemdnetwork 2> /dev/null) - -[[ -d $dracutsysrootdir$systemdnetwork ]] || systemdnetwork=${systemdutildir}/network - -[[ -d $dracutsysrootdir$systemdnetworkconfdir ]] \ - || systemdnetworkconfdir=$(pkg-config systemd --variable=systemdnetworkconfdir 2> /dev/null) - -[[ -d $dracutsysrootdir$systemdnetworkconfdir ]] || systemdnetworkconfdir=${systemdsystemconfdir}/network - -[[ -d $dracutsysrootdir$systemdntpunits ]] \ - || systemdntpunits=$(pkg-config systemd --variable=systemdntpunits 2> /dev/null) - -[[ -d $dracutsysrootdir$systemdntpunits ]] || systemdntpunits=${systemdutildir}/ntp-units.d - -[[ -d $dracutsysrootdir$systemdntpunitsconfdir ]] \ - || systemdntpunitsconfdir=$(pkg-config systemd --variable=systemdntpunitsconfdir 2> /dev/null) - -[[ -d $dracutsysrootdir$systemdntpunitsconfdir ]] || systemdntpunitsconfdir=${systemdsystemconfdir}/ntp-units.d - -[[ -d $dracutsysrootdir$systemdportable ]] \ - || systemdportable=$(pkg-config systemd --variable=systemdportable 2> /dev/null) - -[[ -d $dracutsysrootdir$systemdportable ]] || systemdportable=${systemdutildir}/portable - -[[ -d $dracutsysrootdir$systemdportableconfdir ]] \ - || systemdportableconfdir=$(pkg-config systemd --variable=systemdportableconfdir 2> /dev/null) - -[[ -d "$dracutsysrootdir$systemdportableconfdir" ]] || systemdportableconfdir=${systemdsystemconfdir}/portable - -[[ -d $dracutsysrootdir$systemdsystemunitdir ]] \ - || systemdsystemunitdir=$(pkg-config systemd --variable=systemdsystemunitdir 2> /dev/null) - -[[ -d "$dracutsysrootdir$systemdsystemunitdir" ]] || systemdsystemunitdir=${systemdutildir}/system - -[[ -d $dracutsysrootdir$systemduser ]] \ - || systemduser=$(pkg-config systemd --variable=systemduser 2> /dev/null) - -[[ -d $dracutsysrootdir$systemduser ]] || systemduser=${systemdutildir}/user - -[[ -d $dracutsysrootdir$systemduserconfdir ]] \ - || systemduserconfdir=$(pkg-config systemd --variable=systemduserconfdir 2> /dev/null) - -[[ -d $dracutsysrootdir$systemduserconfdir ]] || systemduserconfdir=${systemdsystemconfdir}/user - -[[ -d $dracutsysrootdir$systemdsystemconfdir ]] \ - || systemdsystemconfdir=$(pkg-config systemd --variable=systemdsystemconfdir 2> /dev/null) - -[[ -d $dracutsysrootdir$systemdsystemconfdir ]] || systemdsystemconfdir=/etc/systemd/system - -[[ -d $dracutsysrootdir$sysusers ]] \ - || sysusers=$(pkg-config systemd --variable=sysusers 2> /dev/null) - [[ -d $dracutsysrootdir$sysusers ]] || sysusers=/usr/lib/sysusers.d -[[ -d $dracutsysrootdir$sysusersconfdir ]] \ - || sysusersconfdir=$(pkg-config systemd --variable=sysusersconfdir 2> /dev/null) - [[ -d $dracutsysrootdir$sysusersconfdir ]] || sysusersconfdir=/etc/sysusers.d -[[ -d $dracutsysrootdir$tmpfilesdir ]] \ - || tmpfilesdir=$(pkg-config systemd --variable=tmpfilesdir 2> /dev/null) - -if ! [[ -d $dracutsysrootdir$tmpfilesdir ]]; then - [[ -d $dracutsysrootdir/lib/tmpfiles.d ]] && tmpfilesdir=/lib/tmpfiles.d - [[ -d $dracutsysrootdir/usr/lib/tmpfiles.d ]] && tmpfilesdir=/usr/lib/tmpfiles.d -fi - -[[ -d $dracutsysrootdir$tmpfilesconfdir ]] \ - || tmpfilesconfdir=$(pkg-config systemd --variable=tmpfilesconfdir 2> /dev/null) - -[[ -d $dracutsysrootdir$tmpfilesconfdir ]] || tmpfilesconfdir=/etc/tmpfiles.d - [[ -d $dracutsysrootdir$depmodd ]] \ || sysctld=$(pkg-config libkmod --variable=depmodd 2> /dev/null) @@ -1806,15 +1630,9 @@ export initdir dracutbasedir \ stdloglvl sysloglvl fileloglvl kmsgloglvl logfile \ debug host_fs_types host_devs swap_devs sshkey add_fstab \ DRACUT_VERSION udevdir udevconfdir udevrulesdir udevrulesconfdir \ - prefix filesystems drivers dbus dbusconfdir dbusinterfaces \ - dbusinterfacesconfdir dbusservices dbusservicesconfdir dbussession \ - dbussessionconfdir dbussystem dbussystemconfdir dbussystemservices \ - dbussystemservicesconfdir environment environmentconfdir modulesload \ + prefix filesystems drivers environment environmentconfdir modulesload \ modulesloadconfdir sysctl sysctlconfdir sysusers sysusersconfdir \ - systemdutildir systemdutilconfdir systemdcatalog systemdntpunits \ - systemdntpunitsconfdir systemdsystemunitdir systemdsystemconfdir \ - hostonly_cmdline loginstall tmpfilesdir tmpfilesconfdir depmodd \ - depmodconfdir + hostonly_cmdline loginstall depmodd depmodconfdir mods_to_load="" # check all our modules to see if they should be sourced. @@ -2042,17 +1860,6 @@ if [[ $kernel_only != yes ]]; then cat "$f" >> "${initdir}/etc/fstab" done - if [[ $dracutsysrootdir$systemdutildir ]]; then - if [[ -d ${initdir}/$systemdutildir ]]; then - mkdir -p "${initdir}"/etc/conf.d - { - printf "%s\n" "systemdutildir=\"$systemdutildir\"" - printf "%s\n" "systemdsystemunitdir=\"$systemdsystemunitdir\"" - printf "%s\n" "systemdsystemconfdir=\"$systemdsystemconfdir\"" - } > "${initdir}"/etc/conf.d/systemd.conf - fi - fi - if [[ $DRACUT_RESOLVE_LAZY ]] && [[ $DRACUT_INSTALL ]]; then dinfo "*** Resolving executable dependencies ***" find "$initdir" -type f -perm /0111 -not -path '*.ko' -print0 \ @@ -2587,25 +2394,4 @@ freeze_ok_for_fstype() { esac } -# We sync/fsfreeze only if we're operating on a live booted system. -# It's possible for e.g. `kernel` to be installed as an RPM BuildRequires or equivalent, -# and there's no reason to sync, and *definitely* no reason to fsfreeze. -# Another case where this happens is rpm-ostree, which performs its own sync/fsfreeze -# globally. See e.g. https://github.com/ostreedev/ostree/commit/8642ef5ab3fec3ac8eb8f193054852f83a8bc4d0 -if [[ -d $dracutsysrootdir/run/systemd/system ]]; then - if ! sync "$outfile" 2> /dev/null; then - dinfo "dracut: sync operation on newly created initramfs $outfile failed" - exit 1 - fi - - # use fsfreeze only if we're not writing to / - if [[ "$(stat -c %m -- "$outfile")" != "/" ]] && freeze_ok_for_fstype "$outfile"; then - FSFROZEN="$(dirname "$outfile")" - if ! (fsfreeze -f "${FSFROZEN}" 2> /dev/null && fsfreeze -u "${FSFROZEN}" 2> /dev/null); then - dinfo "dracut: warning: could not fsfreeze $(dirname "$outfile")" - fi - unset FSFROZEN - fi -fi - exit 0 diff -urpa dracut-056.orig/modules.d/01fips/fips.sh dracut-056/modules.d/01fips/fips.sh --- dracut-056.orig/modules.d/01fips/fips.sh 2022-02-18 12:32:53.000000000 +0100 +++ dracut-056/modules.d/01fips/fips.sh 2022-08-30 00:01:50.073198984 +0200 @@ -4,15 +4,9 @@ type getarg > /dev/null 2>&1 || . /lib/d # systemd lets stdout go to journal only, but the system # has to halt when the integrity check fails to satisfy FIPS. -if [ -z "$DRACUT_SYSTEMD" ]; then - fips_info() { - info "$*" - } -else - fips_info() { - echo "$*" >&2 - } -fi +fips_info() { + info "$*" +} mount_boot() { boot=$(getarg boot=) diff -urpa dracut-056.orig/modules.d/02caps/module-setup.sh dracut-056/modules.d/02caps/module-setup.sh --- dracut-056.orig/modules.d/02caps/module-setup.sh 2022-02-18 12:32:53.000000000 +0100 +++ dracut-056/modules.d/02caps/module-setup.sh 2022-08-29 23:46:09.489747726 +0200 @@ -14,12 +14,8 @@ depends() { # called by dracut install() { - if ! dracut_module_included "systemd"; then - inst_hook pre-pivot 00 "$moddir/caps.sh" - inst "$(find_binary capsh 2> /dev/null)" /usr/sbin/capsh - # capsh wants bash and we need bash also - inst /bin/bash - else - dwarning "caps: does not work with systemd in the initramfs" - fi + inst_hook pre-pivot 00 "$moddir/caps.sh" + inst "$(find_binary capsh 2> /dev/null)" /usr/sbin/capsh + # capsh wants bash and we need bash also + inst /bin/bash } diff -urpa dracut-056.orig/modules.d/04watchdog/module-setup.sh dracut-056/modules.d/04watchdog/module-setup.sh --- dracut-056.orig/modules.d/04watchdog/module-setup.sh 2022-02-18 12:32:53.000000000 +0100 +++ dracut-056/modules.d/04watchdog/module-setup.sh 2022-08-29 23:49:02.214014930 +0200 @@ -15,20 +15,17 @@ depends() { install() { # Do not add watchdog hooks if systemd module is included # In that case, systemd will manage watchdog kick - if ! dracut_module_included "systemd"; then - inst_hook cmdline 00 "$moddir/watchdog.sh" - inst_hook cmdline 50 "$moddir/watchdog.sh" - inst_hook pre-trigger 00 "$moddir/watchdog.sh" - inst_hook initqueue 00 "$moddir/watchdog.sh" - inst_hook mount 00 "$moddir/watchdog.sh" - inst_hook mount 50 "$moddir/watchdog.sh" - inst_hook mount 99 "$moddir/watchdog.sh" - inst_hook pre-pivot 00 "$moddir/watchdog.sh" - inst_hook pre-pivot 99 "$moddir/watchdog.sh" - inst_hook cleanup 00 "$moddir/watchdog.sh" - inst_hook cleanup 99 "$moddir/watchdog.sh" - fi - + inst_hook cmdline 00 "$moddir/watchdog.sh" + inst_hook cmdline 50 "$moddir/watchdog.sh" + inst_hook pre-trigger 00 "$moddir/watchdog.sh" + inst_hook initqueue 00 "$moddir/watchdog.sh" + inst_hook mount 00 "$moddir/watchdog.sh" + inst_hook mount 50 "$moddir/watchdog.sh" + inst_hook mount 99 "$moddir/watchdog.sh" + inst_hook pre-pivot 00 "$moddir/watchdog.sh" + inst_hook pre-pivot 99 "$moddir/watchdog.sh" + inst_hook cleanup 00 "$moddir/watchdog.sh" + inst_hook cleanup 99 "$moddir/watchdog.sh" inst_hook emergency 02 "$moddir/watchdog-stop.sh" inst_multiple -o wdctl } diff -urpa dracut-056.orig/modules.d/10i18n/console_init.sh dracut-056/modules.d/10i18n/console_init.sh --- dracut-056.orig/modules.d/10i18n/console_init.sh 2022-02-18 12:32:53.000000000 +0100 +++ dracut-056/modules.d/10i18n/console_init.sh 2022-08-30 01:27:10.881161304 +0200 @@ -1,11 +1,5 @@ #!/bin/sh -[ -n "$DRACUT_SYSTEMD" ] && exit 0 - -if [ -x "$systemdutildir"/systemd-vconsole-setup ]; then - "$systemdutildir"/systemd-vconsole-setup "$@" -fi - [ -e /etc/vconsole.conf ] && . /etc/vconsole.conf DEFAULT_FONT=eurlatgr diff -urpa dracut-056.orig/modules.d/10i18n/module-setup.sh dracut-056/modules.d/10i18n/module-setup.sh --- dracut-056.orig/modules.d/10i18n/module-setup.sh 2022-02-18 12:32:53.000000000 +0100 +++ dracut-056/modules.d/10i18n/module-setup.sh 2022-08-29 23:49:56.738099274 +0200 @@ -18,13 +18,6 @@ depends() { install() { declare -A KEYMAPS - if dracut_module_included "systemd"; then - unset FONT - unset KEYMAP - # shellcheck disable=SC1090 - [[ -f "$dracutsysrootdir"/etc/vconsole.conf ]] && . "$dracutsysrootdir"/etc/vconsole.conf - fi - KBDSUBDIRS=(consolefonts consoletrans keymaps unimaps) DEFAULT_FONT="${i18n_default_font:-eurlatgr}" I18N_CONF="/etc/locale.conf" @@ -121,11 +114,9 @@ install() { install_base() { inst_multiple setfont loadkeys kbd_mode stty - if ! dracut_module_included "systemd"; then - inst "${moddir}"/console_init.sh /lib/udev/console_init - inst_rules "${moddir}"/10-console.rules - inst_hook cmdline 20 "${moddir}/parse-i18n.sh" - fi + inst "${moddir}"/console_init.sh /lib/udev/console_init + inst_rules "${moddir}"/10-console.rules + inst_hook cmdline 20 "${moddir}/parse-i18n.sh" if [[ ${kbddir} != "/usr/share" ]]; then inst_dir /usr/share @@ -239,17 +230,11 @@ install() { inst_simple "${kbddir}"/unimaps/"${FONT_UNIMAP}".uni fi - if dracut_module_included "systemd" && [[ -f $dracutsysrootdir${I18N_CONF} ]]; then - inst_simple ${I18N_CONF} - else - mksubdirs "${initdir}"${I18N_CONF} - print_vars LC_ALL LANG >> "${initdir}"${I18N_CONF} - fi + mksubdirs "${initdir}"${I18N_CONF} + print_vars LC_ALL LANG >> "${initdir}"${I18N_CONF} - if ! dracut_module_included "systemd"; then - mksubdirs "${initdir}"${VCONFIG_CONF} - print_vars KEYMAP EXT_KEYMAPS UNICODE FONT FONT_MAP FONT_UNIMAP >> "${initdir}"${VCONFIG_CONF} - fi + mksubdirs "${initdir}"${VCONFIG_CONF} + print_vars KEYMAP EXT_KEYMAPS UNICODE FONT FONT_MAP FONT_UNIMAP >> "${initdir}"${VCONFIG_CONF} return 0 } @@ -278,11 +263,6 @@ install() { if checks; then install_base - # https://github.com/dracutdevs/dracut/issues/796 - if dracut_module_included "systemd" && [[ -f $dracutsysrootdir${VCONFIG_CONF} ]]; then - inst_simple ${VCONFIG_CONF} - fi - if [[ ${hostonly} ]] && ! [[ ${i18n_install_all} == "yes" ]]; then install_local_i18n || install_all_kbd else diff -urpa dracut-056.orig/modules.d/35network-legacy/module-setup.sh dracut-056/modules.d/35network-legacy/module-setup.sh --- dracut-056.orig/modules.d/35network-legacy/module-setup.sh 2022-02-18 12:32:53.000000000 +0100 +++ dracut-056/modules.d/35network-legacy/module-setup.sh 2022-08-29 23:48:24.023955850 +0200 @@ -22,12 +22,6 @@ installkernel() { install() { local _arch - #Adding default link - if dracut_module_included "systemd"; then - inst_multiple -o "${systemdutildir}/network/99-default.link" - [[ $hostonly ]] && inst_multiple -H -o "${systemdsystemconfdir}/network/*.link" - fi - inst_multiple ip dhclient sed awk grep pgrep tr expr inst_multiple -o arping arping2 diff -urpa dracut-056.orig/modules.d/35network-legacy/net-genrules.sh dracut-056/modules.d/35network-legacy/net-genrules.sh --- dracut-056.orig/modules.d/35network-legacy/net-genrules.sh 2022-02-18 12:32:53.000000000 +0100 +++ dracut-056/modules.d/35network-legacy/net-genrules.sh 2022-08-29 23:59:17.879964809 +0200 @@ -102,11 +102,8 @@ command -v fix_bootif > /dev/null || . / for iface in $IFACES; do if [ "$bootdev" = "$iface" ] || [ "$NEEDNET" = "1" ]; then - if [ -n "$netroot" ] && [ -n "$DRACUT_SYSTEMD" ]; then - echo "systemctl is-active initrd-root-device.target || [ -f /tmp/net.${iface}.did-setup ]" - else - echo "[ -f /tmp/net.${iface}.did-setup ]" - fi > "$hookdir"/initqueue/finished/wait-"$iface".sh + echo "[ -f /tmp/net.${iface}.did-setup ]" + > "$hookdir"/initqueue/finished/wait-"$iface".sh fi done # Default: We don't know the interface to use, handle all diff -urpa dracut-056.orig/modules.d/40network/module-setup.sh dracut-056/modules.d/40network/module-setup.sh --- dracut-056.orig/modules.d/40network/module-setup.sh 2022-02-18 12:32:53.000000000 +0100 +++ dracut-056/modules.d/40network/module-setup.sh 2022-08-29 23:39:01.349085410 +0200 @@ -9,23 +9,12 @@ check() { depends() { is_qemu_virtualized && echo -n "qemu-net " - for module in network-wicked network-manager network-legacy systemd-networkd; do - if dracut_module_included "$module"; then - network_handler="$module" - break - fi - done + if dracut_module_included "network-legacy"; then + network_handler="$module" + fi if [ -z "$network_handler" ]; then - if [[ -e $dracutsysrootdir$systemdsystemunitdir/wicked.service ]]; then - network_handler="network-wicked" - elif [[ -x $dracutsysrootdir/usr/libexec/nm-initrd-generator ]] || [[ -x $dracutsysrootdir/usr/lib/nm-initrd-generator ]]; then - network_handler="network-manager" - elif [[ -x $dracutsysrootdir$systemdutildir/systemd-networkd ]]; then - network_handler="systemd-networkd" - else - network_handler="network-legacy" - fi + network_handler="network-legacy" fi echo "kernel-network-modules $network_handler" return 0 diff -urpa dracut-056.orig/modules.d/40network/net-lib.sh dracut-056/modules.d/40network/net-lib.sh --- dracut-056.orig/modules.d/40network/net-lib.sh 2022-02-18 12:32:53.000000000 +0100 +++ dracut-056/modules.d/40network/net-lib.sh 2022-08-30 01:56:14.047883232 +0200 @@ -59,7 +59,7 @@ iface_name() { configured_ifaces() { local IFACES="" iface_id="" rv=1 [ -e "/tmp/net.ifaces" ] && read -r IFACES < /tmp/net.ifaces - if { pidof udevd || pidof systemd-udevd; } > /dev/null; then + if { pidof udevd; } > /dev/null; then for iface_id in $IFACES; do printf "%s\n" "$(iface_name "$iface_id")" rv=0 diff -urpa dracut-056.orig/modules.d/50plymouth/module-setup.sh dracut-056/modules.d/50plymouth/module-setup.sh --- dracut-056.orig/modules.d/50plymouth/module-setup.sh 2022-02-18 12:32:53.000000000 +0100 +++ dracut-056/modules.d/50plymouth/module-setup.sh 2022-08-29 23:49:11.145028746 +0200 @@ -44,8 +44,6 @@ install() { inst_multiple plymouthd plymouth plymouth-set-default-theme - if ! dracut_module_included "systemd"; then - inst_hook pre-trigger 10 "$moddir"/plymouth-pretrigger.sh - inst_hook pre-pivot 90 "$moddir"/plymouth-newroot.sh - fi + inst_hook pre-trigger 10 "$moddir"/plymouth-pretrigger.sh + inst_hook pre-pivot 90 "$moddir"/plymouth-newroot.sh } diff -urpa dracut-056.orig/modules.d/90btrfs/module-setup.sh dracut-056/modules.d/90btrfs/module-setup.sh --- dracut-056.orig/modules.d/90btrfs/module-setup.sh 2022-02-18 12:32:53.000000000 +0100 +++ dracut-056/modules.d/90btrfs/module-setup.sh 2022-08-29 23:45:54.430724429 +0200 @@ -43,9 +43,7 @@ install() { inst_rules 64-btrfs-dm.rules fi - if ! dracut_module_included "systemd"; then - inst_hook initqueue/timeout 10 "$moddir/btrfs_timeout.sh" - fi + inst_hook initqueue/timeout 10 "$moddir/btrfs_timeout.sh" inst_multiple -o btrfsck btrfs-zero-log inst "$(command -v btrfs)" /sbin/btrfs diff -urpa dracut-056.orig/modules.d/90crypt/crypt-lib.sh dracut-056/modules.d/90crypt/crypt-lib.sh --- dracut-056.orig/modules.d/90crypt/crypt-lib.sh 2022-02-18 12:32:53.000000000 +0100 +++ dracut-056/modules.d/90crypt/crypt-lib.sh 2022-08-30 00:31:11.632917988 +0200 @@ -105,30 +105,22 @@ ask_for_password() { { flock -s 9 - # Prompt for password with plymouth, if installed and running. - if type plymouth > /dev/null 2>&1 && plymouth --ping 2> /dev/null; then - plymouth ask-for-password \ - --prompt "$ply_prompt" --number-of-tries="$ply_tries" \ - --command="$ply_cmd" - ret=$? - else - if [ "$tty_echo_off" = yes ]; then - stty_orig="$(stty -g)" - stty -echo - fi + if [ "$tty_echo_off" = yes ]; then + stty_orig="$(stty -g)" + stty -echo + fi - local i=1 - while [ $i -le "$tty_tries" ]; do - [ -n "$tty_prompt" ] \ - && printf "%s" "$tty_prompt [$i/$tty_tries]:" >&2 - eval "$tty_cmd" && ret=0 && break - ret=$? - i=$((i + 1)) - [ -n "$tty_prompt" ] && printf '\n' >&2 - done + local i=1 + while [ $i -le "$tty_tries" ]; do + [ -n "$tty_prompt" ] \ + && printf "%s" "$tty_prompt [$i/$tty_tries]:" >&2 + eval "$tty_cmd" && ret=0 && break + ret=$? + i=$((i + 1)) + [ -n "$tty_prompt" ] && printf '\n' >&2 + done - [ "$tty_echo_off" = yes ] && stty "$stty_orig" - fi + [ "$tty_echo_off" = yes ] && stty "$stty_orig" } 9> /.console_lock [ $ret -ne 0 ] && echo "Wrong password" >&2 diff -urpa dracut-056.orig/modules.d/90crypt/crypt-run-generator.sh dracut-056/modules.d/90crypt/crypt-run-generator.sh --- dracut-056.orig/modules.d/90crypt/crypt-run-generator.sh 2022-02-18 12:32:53.000000000 +0100 +++ dracut-056/modules.d/90crypt/crypt-run-generator.sh 2022-08-30 00:00:07.766041555 +0200 @@ -11,7 +11,7 @@ crypttab_contains "$luks" "$dev" && exit allowdiscards="-" # parse for allow-discards -if [ -n "$DRACUT_SYSTEMD" ] || strstr "$(cryptsetup --help)" "allow-discards"; then +if strstr "$(cryptsetup --help)" "allow-discards"; then if discarduuids=$(getargs "rd.luks.allow-discards"); then discarduuids=$(str_replace "$discarduuids" 'luks-' '') if strstr " $discarduuids " " ${luks##luks-}"; then @@ -24,8 +24,4 @@ fi echo "$luks $dev - timeout=0,$allowdiscards" >> /etc/crypttab -if command -v systemctl > /dev/null; then - systemctl daemon-reload - systemctl start cryptsetup.target -fi exit 0 diff -urpa dracut-056.orig/modules.d/90crypt/module-setup.sh dracut-056/modules.d/90crypt/module-setup.sh --- dracut-056.orig/modules.d/90crypt/module-setup.sh 2022-08-28 19:27:11.079536407 +0200 +++ dracut-056/modules.d/90crypt/module-setup.sh 2022-08-30 01:50:10.450316831 +0200 @@ -4,7 +4,7 @@ check() { local fs # if cryptsetup is not installed, then we cannot support encrypted devices. - require_any_binary "$systemdutildir"/systemd-cryptsetup cryptsetup || return 1 + require_any_binary cryptsetup || return 1 [[ $hostonly ]] || [[ $mount_needs ]] && { for fs in "${host_fs_types[@]}"; do @@ -20,17 +20,6 @@ check() { depends() { local deps deps="dm rootfs-block" - if [[ $hostonly && -f "$dracutsysrootdir"/etc/crypttab ]]; then - if grep -q -e "fido2-device=" -e "fido2-cid=" "$dracutsysrootdir"/etc/crypttab; then - deps+=" fido2" - fi - if grep -q "pkcs11-uri" "$dracutsysrootdir"/etc/crypttab; then - deps+=" pkcs11" - fi - if grep -q "tpm2-device=" "$dracutsysrootdir"/etc/crypttab; then - deps+=" tpm2-tss" - fi - fi echo "$deps" return 0 } @@ -96,13 +85,11 @@ install() { fi inst_hook cmdline 30 "$moddir/parse-crypt.sh" - if ! dracut_module_included "systemd"; then - inst_multiple cryptsetup rmdir readlink umount - inst_script "$moddir"/cryptroot-ask.sh /sbin/cryptroot-ask - inst_script "$moddir"/probe-keydev.sh /sbin/probe-keydev - inst_hook cmdline 10 "$moddir/parse-keydev.sh" - inst_hook cleanup 30 "$moddir/crypt-cleanup.sh" - fi + inst_multiple cryptsetup rmdir readlink umount + inst_script "$moddir"/cryptroot-ask.sh /sbin/cryptroot-ask + inst_script "$moddir"/probe-keydev.sh /sbin/probe-keydev + inst_hook cmdline 10 "$moddir/parse-keydev.sh" + inst_hook cleanup 30 "$moddir/crypt-cleanup.sh" if [[ $hostonly ]] && [[ -f $dracutsysrootdir/etc/crypttab ]]; then # filter /etc/crypttab for the devices we need @@ -176,21 +163,5 @@ install() { inst_simple "$moddir/crypt-lib.sh" "/lib/dracut-crypt-lib.sh" inst_script "$moddir/crypt-run-generator.sh" "/sbin/crypt-run-generator" - if dracut_module_included "systemd"; then - # the cryptsetup targets are already pulled in by 00systemd, but not - # the enablement symlinks - inst_multiple -o \ - "$tmpfilesdir"/cryptsetup.conf \ - "$systemdutildir"/system-generators/systemd-cryptsetup-generator \ - "$systemdutildir"/systemd-cryptsetup \ - "$systemdsystemunitdir"/systemd-ask-password-console.path \ - "$systemdsystemunitdir"/systemd-ask-password-console.service \ - "$systemdsystemunitdir"/cryptsetup.target \ - "$systemdsystemunitdir"/sysinit.target.wants/cryptsetup.target \ - "$systemdsystemunitdir"/remote-cryptsetup.target \ - "$systemdsystemunitdir"/initrd-root-device.target.wants/remote-cryptsetup.target \ - systemd-ask-password systemd-tty-ask-password-agent - fi - dracut_need_initqueue } diff -urpa dracut-056.orig/modules.d/90crypt/parse-crypt.sh dracut-056/modules.d/90crypt/parse-crypt.sh --- dracut-056.orig/modules.d/90crypt/parse-crypt.sh 2022-02-18 12:32:53.000000000 +0100 +++ dracut-056/modules.d/90crypt/parse-crypt.sh 2022-08-30 01:48:49.594190856 +0200 @@ -36,12 +36,6 @@ else LUKS=$(getargs rd.luks.uuid -d rd_LUKS_UUID) tout=$(getarg rd.luks.key.tout) - if [ -e /etc/crypttab ]; then - while read -r _ _dev _ || [ -n "$_dev" ]; do - set_systemd_timeout_for_dev "$_dev" - done < /etc/crypttab - fi - if [ -n "$PARTUUID" ]; then for uuid in $PARTUUID; do @@ -58,28 +52,13 @@ else luksname="luks-$uuid" fi - if [ -z "$DRACUT_SYSTEMD" ]; then - { - printf -- 'ENV{ID_PART_ENTRY_UUID}=="*%s*", ' "$uuid" - printf -- 'RUN+="%s --settled --unique --onetime ' "$(command -v initqueue)" - printf -- '--name cryptroot-ask-%%k %s ' "$(command -v cryptroot-ask)" - # shellcheck disable=SC2016 - printf -- '$env{DEVNAME} %s %s %s"\n' "$luksname" "$is_keysource" "$tout" - } >> /etc/udev/rules.d/70-luks.rules.new - else - luksname=$(dev_unit_name "$luksname") - # shellcheck disable=SC1003 - luksname="$(str_replace "$luksname" '\' '\\')" - - if ! crypttab_contains "$uuid"; then - { - printf -- 'ENV{ID_PART_ENTRY_UUID}=="*%s*", ' "$uuid" - printf -- 'RUN+="%s --settled --unique --onetime ' "$(command -v initqueue)" - printf -- '--name systemd-cryptsetup-%%k %s start ' "$(command -v systemctl)" - printf -- 'systemd-cryptsetup@%s.service"\n' "$luksname" - } >> /etc/udev/rules.d/70-luks.rules.new - fi - fi + { + printf -- 'ENV{ID_PART_ENTRY_UUID}=="*%s*", ' "$uuid" + printf -- 'RUN+="%s --settled --unique --onetime ' "$(command -v initqueue)" + printf -- '--name cryptroot-ask-%%k %s ' "$(command -v cryptroot-ask)" + # shellcheck disable=SC2016 + printf -- '$env{DEVNAME} %s %s %s"\n' "$luksname" "$is_keysource" "$tout" + } >> /etc/udev/rules.d/70-luks.rules.new done elif [ -n "$SERIAL" ]; then @@ -98,28 +77,13 @@ else luksname="luks-$serialid" fi - if [ -z "$DRACUT_SYSTEMD" ]; then - { - printf -- 'ENV{ID_SERIAL_SHORT}=="*%s*", ' "$serialid" - printf -- 'RUN+="%s --settled --unique --onetime ' "$(command -v initqueue)" - printf -- '--name cryptroot-ask-%%k %s ' "$(command -v cryptroot-ask)" - # shellcheck disable=SC2016 - printf -- '$env{DEVNAME} %s %s %s"\n' "$luksname" "$is_keysource" "$tout" - } >> /etc/udev/rules.d/70-luks.rules.new - else - luksname=$(dev_unit_name "$luksname") - # shellcheck disable=SC1003 - luksname="$(str_replace "$luksname" '\' '\\')" - - if ! crypttab_contains "$serialid"; then - { - printf -- 'ENV{ID_SERIAL_SHORT}=="*%s*", ' "$serialid" - printf -- 'RUN+="%s --settled --unique --onetime ' "$(command -v initqueue)" - printf -- '--name systemd-cryptsetup-%%k %s start ' "$(command -v systemctl)" - printf -- 'systemd-cryptsetup@%s.service"\n' "$luksname" - } >> /etc/udev/rules.d/70-luks.rules.new - fi - fi + { + printf -- 'ENV{ID_SERIAL_SHORT}=="*%s*", ' "$serialid" + printf -- 'RUN+="%s --settled --unique --onetime ' "$(command -v initqueue)" + printf -- '--name cryptroot-ask-%%k %s ' "$(command -v cryptroot-ask)" + # shellcheck disable=SC2016 + printf -- '$env{DEVNAME} %s %s %s"\n' "$luksname" "$is_keysource" "$tout" + } >> /etc/udev/rules.d/70-luks.rules.new done elif [ -n "$LUKS" ]; then @@ -138,30 +102,14 @@ else luksname="luks-$luksid" fi - if [ -z "$DRACUT_SYSTEMD" ]; then - { - printf -- 'ENV{ID_FS_TYPE}=="crypto_LUKS", ' - printf -- 'ENV{ID_FS_UUID}=="*%s*", ' "$luksid" - printf -- 'RUN+="%s --settled --unique --onetime ' "$(command -v initqueue)" - printf -- '--name cryptroot-ask-%%k %s ' "$(command -v cryptroot-ask)" - # shellcheck disable=SC2016 - printf -- '$env{DEVNAME} %s %s %s"\n' "$luksname" "$is_keysource" "$tout" - } >> /etc/udev/rules.d/70-luks.rules.new - else - luksname=$(dev_unit_name "$luksname") - # shellcheck disable=SC1003 - luksname="$(str_replace "$luksname" '\' '\\')" - - if ! crypttab_contains "$luksid"; then - { - printf -- 'ENV{ID_FS_TYPE}=="crypto_LUKS", ' - printf -- 'ENV{ID_FS_UUID}=="*%s*", ' "$luksid" - printf -- 'RUN+="%s --settled --unique --onetime ' "$(command -v initqueue)" - printf -- '--name systemd-cryptsetup-%%k %s start ' "$(command -v systemctl)" - printf -- 'systemd-cryptsetup@%s.service"\n' "$luksname" - } >> /etc/udev/rules.d/70-luks.rules.new - fi - fi + { + printf -- 'ENV{ID_FS_TYPE}=="crypto_LUKS", ' + printf -- 'ENV{ID_FS_UUID}=="*%s*", ' "$luksid" + printf -- 'RUN+="%s --settled --unique --onetime ' "$(command -v initqueue)" + printf -- '--name cryptroot-ask-%%k %s ' "$(command -v cryptroot-ask)" + # shellcheck disable=SC2016 + printf -- '$env{DEVNAME} %s %s %s"\n' "$luksname" "$is_keysource" "$tout" + } >> /etc/udev/rules.d/70-luks.rules.new if [ $is_keysource -eq 0 ]; then uuid=$luksid @@ -175,21 +123,12 @@ else fi done elif getargbool 0 rd.auto; then - if [ -z "$DRACUT_SYSTEMD" ]; then - { - printf -- 'ENV{ID_FS_TYPE}=="crypto_LUKS", RUN+="%s ' "$(command -v initqueue)" - printf -- '--unique --settled --onetime --name cryptroot-ask-%%k ' - # shellcheck disable=SC2016 - printf -- '%s $env{DEVNAME} luks-$env{ID_FS_UUID} %s"\n' "$(command -v cryptroot-ask)" "$tout" - } >> /etc/udev/rules.d/70-luks.rules.new - else - { - printf -- 'ENV{ID_FS_TYPE}=="crypto_LUKS", RUN+="%s ' "$(command -v initqueue)" - printf -- '--unique --settled --onetime --name crypt-run-generator-%%k ' - # shellcheck disable=SC2016 - printf -- '%s $env{DEVNAME} luks-$env{ID_FS_UUID}"\n' "$(command -v crypt-run-generator)" - } >> /etc/udev/rules.d/70-luks.rules.new - fi + { + printf -- 'ENV{ID_FS_TYPE}=="crypto_LUKS", RUN+="%s ' "$(command -v initqueue)" + printf -- '--unique --settled --onetime --name cryptroot-ask-%%k ' + # shellcheck disable=SC2016 + printf -- '%s $env{DEVNAME} luks-$env{ID_FS_UUID} %s"\n' "$(command -v cryptroot-ask)" "$tout" + } >> /etc/udev/rules.d/70-luks.rules.new fi echo 'LABEL="luks_end"' >> /etc/udev/rules.d/70-luks.rules.new diff -urpa dracut-056.orig/modules.d/90dmsquash-live/dmsquash-live-root.sh dracut-056/modules.d/90dmsquash-live/dmsquash-live-root.sh --- dracut-056.orig/modules.d/90dmsquash-live/dmsquash-live-root.sh 2022-02-18 12:32:53.000000000 +0100 +++ dracut-056/modules.d/90dmsquash-live/dmsquash-live-root.sh 2022-08-30 00:32:12.334011986 +0200 @@ -40,18 +40,11 @@ if [ "$fs" = "iso9660" -o "$fs" = "udf" fi getarg rd.live.check -d check || check="" if [ -n "$check" ]; then - type plymouth > /dev/null 2>&1 && plymouth --hide-splash - if [ -n "$DRACUT_SYSTEMD" ]; then - p=$(dev_unit_name "$livedev") - systemctl start checkisomd5@"${p}".service - else - checkisomd5 --verbose "$livedev" - fi + checkisomd5 --verbose "$livedev" if [ $? -eq 1 ]; then die "CD check failed!" exit 1 fi - type plymouth > /dev/null 2>&1 && plymouth --show-splash fi ln -s "$livedev" /run/initramfs/livedev @@ -142,7 +135,6 @@ do_live_overlay() { fi if [ -n "$overlayfs" ]; then unset -v overlayfs - [ -n "$DRACUT_SYSTEMD" ] && reloadsysrootmountunit=":>/xor_overlayfs;" fi setup="yes" else @@ -151,9 +143,6 @@ do_live_overlay() { && [ -d /run/initramfs/overlayfs/ovlwork ]; then ln -s /run/initramfs/overlayfs/overlayfs /run/overlayfs${readonly_overlay:+-r} ln -s /run/initramfs/overlayfs/ovlwork /run/ovlwork${readonly_overlay:+-r} - if [ -z "$overlayfs" ] && [ -n "$DRACUT_SYSTEMD" ]; then - reloadsysrootmountunit=":>/xor_overlayfs;" - fi overlayfs="required" setup="yes" fi @@ -162,9 +151,6 @@ do_live_overlay() { && [ -d /run/initramfs/overlayfs$pathspec/../ovlwork ]; then ln -s /run/initramfs/overlayfs$pathspec /run/overlayfs${readonly_overlay:+-r} ln -s /run/initramfs/overlayfs$pathspec/../ovlwork /run/ovlwork${readonly_overlay:+-r} - if [ -z "$overlayfs" ] && [ -n "$DRACUT_SYSTEMD" ]; then - reloadsysrootmountunit=":>/xor_overlayfs;" - fi overlayfs="required" setup="yes" fi @@ -175,7 +161,6 @@ do_live_overlay() { die "OverlayFS is required but not available." exit 1 fi - [ -n "$DRACUT_SYSTEMD" ] && reloadsysrootmountunit=":>/xor_overlayfs;" m='OverlayFS is not available; using temporary Device-mapper overlay.' info "$m" unset -v overlayfs setup @@ -191,29 +176,12 @@ do_live_overlay() { m="$m"$'\n All root filesystem changes will be lost on shutdown.' m="$m"$'\n Press [Enter] to continue.' printf "\n\n\n\n%s\n\n\n" "${m}" > /dev/kmsg - if [ -n "$DRACUT_SYSTEMD" ]; then - if type plymouth > /dev/null 2>&1 && plymouth --ping; then - if getargbool 0 rhgb || getargbool 0 splash; then - m='>>>'$'\n''>>>'$'\n''>>>'$'\n\n\n'"$m" - m="${m%n.*}"$'n.\n\n\n''<<<'$'\n''<<<'$'\n''<<<' - plymouth display-message --text="${m}" - else - plymouth ask-question --prompt="${m}" --command=true - fi - else - m=">>>${m//.[[:space:]]/.} <<<" - systemd-ask-password --timeout=0 "${m}" - fi - else - type plymouth > /dev/null 2>&1 && plymouth --ping && plymouth --quit - read -s -r -p $'\n\n'"${m}" -n 1 _ - fi + read -s -r -p $'\n\n'"${m}" -n 1 _ fi if [ -n "$overlayfs" ]; then if [ -n "$readonly_overlay" ] && ! [ -h /run/overlayfs-r ]; then info "No persistent overlay found." unset -v readonly_overlay - [ -n "$DRACUT_SYSTEMD" ] && reloadsysrootmountunit="${reloadsysrootmountunit}:>/xor_readonly;" fi else dd if=/dev/null of=/overlay bs=1024 count=1 seek=$((overlay_size * 1024)) 2> /dev/null @@ -296,9 +264,6 @@ if [ -e "$SQUASHED" ]; then fi elif [ -d /run/initramfs/squashfs/proc ]; then FSIMG=$SQUASHED - if [ -z "$overlayfs" ] && [ -n "$DRACUT_SYSTEMD" ]; then - reloadsysrootmountunit=":>/xor_overlayfs;" - fi overlayfs="required" else die "Failed to find a root filesystem in $SQUASHED." @@ -384,16 +349,12 @@ if [ -n "$overlayfs" ]; then else ovlfs=lowerdir=/run/rootfsbase fi - if [ -z "$DRACUT_SYSTEMD" ]; then - printf 'mount -t overlay LiveOS_rootfs -o%s,%s %s\n' "$ROOTFLAGS" \ - "$ovlfs",upperdir=/run/overlayfs,workdir=/run/ovlwork \ - "$NEWROOT" > "$hookdir"/mount/01-$$-live.sh - fi + printf 'mount -t overlay LiveOS_rootfs -o%s,%s %s\n' "$ROOTFLAGS" \ + "$ovlfs",upperdir=/run/overlayfs,workdir=/run/ovlwork \ + "$NEWROOT" > "$hookdir"/mount/01-$$-live.sh else - if [ -z "$DRACUT_SYSTEMD" ]; then - [ -n "$ROOTFLAGS" ] && ROOTFLAGS="-o $ROOTFLAGS" - printf 'mount %s /dev/mapper/live-rw %s\n' "$ROOTFLAGS" "$NEWROOT" > "$hookdir"/mount/01-$$-live.sh - fi + [ -n "$ROOTFLAGS" ] && ROOTFLAGS="-o $ROOTFLAGS" + printf 'mount %s /dev/mapper/live-rw %s\n' "$ROOTFLAGS" "$NEWROOT" > "$hookdir"/mount/01-$$-live.sh fi [ -e "$SQUASHED" ] && umount -l /run/initramfs/squashfs diff -urpa dracut-056.orig/modules.d/90dmsquash-live/module-setup.sh dracut-056/modules.d/90dmsquash-live/module-setup.sh --- dracut-056.orig/modules.d/90dmsquash-live/module-setup.sh 2022-02-18 12:32:53.000000000 +0100 +++ dracut-056/modules.d/90dmsquash-live/module-setup.sh 2022-08-30 01:22:36.037730409 +0200 @@ -31,10 +31,6 @@ install() { inst_hook pre-pivot 20 "$moddir/apply-live-updates.sh" inst_script "$moddir/dmsquash-live-root.sh" "/sbin/dmsquash-live-root" inst_script "$moddir/iso-scan.sh" "/sbin/iso-scan" - if dracut_module_included "systemd-initrd"; then - inst_script "$moddir/dmsquash-generator.sh" "$systemdutildir"/system-generators/dracut-dmsquash-generator - inst_simple "$moddir/checkisomd5@.service" "/etc/systemd/system/checkisomd5@.service" - fi # should probably just be generally included inst_rules 60-cdrom_id.rules dracut_need_initqueue diff -urpa dracut-056.orig/modules.d/90kernel-modules/module-setup.sh dracut-056/modules.d/90kernel-modules/module-setup.sh --- dracut-056.orig/modules.d/90kernel-modules/module-setup.sh 2022-02-18 12:32:53.000000000 +0100 +++ dracut-056/modules.d/90kernel-modules/module-setup.sh 2022-08-29 23:47:25.754865711 +0200 @@ -152,8 +152,6 @@ install() { [[ -d /lib/modprobe.d ]] && inst_multiple -o "/lib/modprobe.d/*.conf" [[ -d /usr/lib/modprobe.d ]] && inst_multiple -o "/usr/lib/modprobe.d/*.conf" [[ $hostonly ]] && inst_multiple -H -o /etc/modprobe.d/*.conf /etc/modprobe.conf - if ! dracut_module_included "systemd"; then - inst_hook cmdline 01 "$moddir/parse-kernel.sh" - fi + inst_hook cmdline 01 "$moddir/parse-kernel.sh" inst_simple "$moddir/insmodpost.sh" /sbin/insmodpost.sh } diff -urpa dracut-056.orig/modules.d/90livenet/module-setup.sh dracut-056/modules.d/90livenet/module-setup.sh --- dracut-056.orig/modules.d/90livenet/module-setup.sh 2022-02-18 12:32:53.000000000 +0100 +++ dracut-056/modules.d/90livenet/module-setup.sh 2022-08-30 01:22:43.539742171 +0200 @@ -17,8 +17,5 @@ install() { inst_hook cmdline 29 "$moddir/parse-livenet.sh" inst_hook initqueue/online 95 "$moddir/fetch-liveupdate.sh" inst_script "$moddir/livenetroot.sh" "/sbin/livenetroot" - if dracut_module_included "systemd-initrd"; then - inst_script "$moddir/livenet-generator.sh" "$systemdutildir"/system-generators/dracut-livenet-generator - fi dracut_need_initqueue } diff -urpa dracut-056.orig/modules.d/90mdraid/module-setup.sh dracut-056/modules.d/90mdraid/module-setup.sh --- dracut-056.orig/modules.d/90mdraid/module-setup.sh 2022-02-18 12:32:53.000000000 +0100 +++ dracut-056/modules.d/90mdraid/module-setup.sh 2022-08-29 23:45:43.188707041 +0200 @@ -121,20 +121,6 @@ install() { inst_hook shutdown 30 "$moddir/md-shutdown.sh" inst_script "$moddir/mdraid-cleanup.sh" /sbin/mdraid-cleanup inst_script "$moddir/mdraid_start.sh" /sbin/mdraid_start - if dracut_module_included "systemd"; then - if [[ -e $dracutsysrootdir$systemdsystemunitdir/mdmon@.service ]]; then - inst_simple "$systemdsystemunitdir"/mdmon@.service - fi - if [[ -e $dracutsysrootdir$systemdsystemunitdir/mdadm-last-resort@.service ]]; then - inst_simple "$systemdsystemunitdir"/mdadm-last-resort@.service - fi - if [[ -e $dracutsysrootdir$systemdsystemunitdir/mdadm-last-resort@.timer ]]; then - inst_simple "$systemdsystemunitdir"/mdadm-last-resort@.timer - fi - if [[ -e $dracutsysrootdir$systemdsystemunitdir/mdadm-grow-continue@.service ]]; then - inst_simple "$systemdsystemunitdir"/mdadm-grow-continue@.service - fi - fi inst_hook pre-shutdown 30 "$moddir/mdmon-pre-shutdown.sh" dracut_need_initqueue } diff -urpa dracut-056.orig/modules.d/90multipath/module-setup.sh dracut-056/modules.d/90multipath/module-setup.sh --- dracut-056.orig/modules.d/90multipath/module-setup.sh 2022-02-18 12:32:53.000000000 +0100 +++ dracut-056/modules.d/90multipath/module-setup.sh 2022-08-29 23:46:41.394797087 +0200 @@ -132,17 +132,8 @@ install() { [[ $_conf ]] && echo "$_conf" >> "${initdir}/etc/cmdline.d/90multipath.conf" fi - if dracut_module_included "systemd"; then - if mpathconf_installed; then - inst_simple "${moddir}/multipathd-configure.service" "${systemdsystemunitdir}/multipathd-configure.service" - $SYSTEMCTL -q --root "$initdir" enable multipathd-configure.service - fi - inst_simple "${moddir}/multipathd.service" "${systemdsystemunitdir}/multipathd.service" - $SYSTEMCTL -q --root "$initdir" enable multipathd.service - else - inst_hook pre-trigger 02 "$moddir/multipathd.sh" - inst_hook cleanup 02 "$moddir/multipathd-stop.sh" - fi + inst_hook pre-trigger 02 "$moddir/multipathd.sh" + inst_hook cleanup 02 "$moddir/multipathd-stop.sh" inst_hook cleanup 80 "$moddir/multipathd-needshutdown.sh" inst_hook shutdown 20 "$moddir/multipath-shutdown.sh" diff -urpa dracut-056.orig/modules.d/91zipl/install_zipl_cmdline.sh dracut-056/modules.d/91zipl/install_zipl_cmdline.sh --- dracut-056.orig/modules.d/91zipl/install_zipl_cmdline.sh 2022-02-18 12:32:53.000000000 +0100 +++ dracut-056/modules.d/91zipl/install_zipl_cmdline.sh 2022-08-30 01:53:26.508622304 +0200 @@ -30,10 +30,6 @@ fi umount ${MNT} -if [ -f /etc/cmdline.d/99zipl.conf ]; then - systemctl restart dracut-cmdline.service - systemctl restart systemd-udev-trigger.service -fi : > /tmp/install.zipl.cmdline-done exit 0 diff -urpa dracut-056.orig/modules.d/95debug/module-setup.sh dracut-056/modules.d/95debug/module-setup.sh --- dracut-056.orig/modules.d/95debug/module-setup.sh 2022-02-18 12:32:53.000000000 +0100 +++ dracut-056/modules.d/95debug/module-setup.sh 2022-08-30 01:51:43.760462213 +0200 @@ -15,7 +15,7 @@ depends() { install() { inst_multiple -o ls ps grep more cat rm strace free showmount df du lsblk \ ping netstat rpcinfo vi scp ping6 ssh find \ - tcpdump cp dd less hostname mkdir systemd-analyze \ + tcpdump cp dd less hostname mkdir \ fsck fsck.ext2 fsck.ext4 fsck.ext3 fsck.ext4dev fsck.f2fs fsck.vfat e2fsck grep '^tcpdump:' "$dracutsysrootdir"/etc/passwd 2> /dev/null >> "$initdir/etc/passwd" diff -urpa dracut-056.orig/modules.d/95fcoe/cleanup-fcoe.sh dracut-056/modules.d/95fcoe/cleanup-fcoe.sh --- dracut-056.orig/modules.d/95fcoe/cleanup-fcoe.sh 2022-02-18 12:32:53.000000000 +0100 +++ dracut-056/modules.d/95fcoe/cleanup-fcoe.sh 2022-08-30 00:01:38.521181213 +0200 @@ -6,10 +6,8 @@ if [ -e /var/run/lldpad.pid ]; then lldpad -k # with systemd version 230, this is not necessary anymore # systemd commit cacf980ed44a28e276a6cc7f8fc41f991e2ab354 - if [ -z "$DRACUT_SYSTEMD" ]; then - # shellcheck disable=SC2174 - mkdir -m 0755 -p /run/initramfs/state/dev/shm - cp /dev/shm/lldpad.state /run/initramfs/state/dev/shm/ > /dev/null 2>&1 - echo "files /dev/shm/lldpad.state" >> /run/initramfs/rwtab - fi + # shellcheck disable=SC2174 + mkdir -m 0755 -p /run/initramfs/state/dev/shm + cp /dev/shm/lldpad.state /run/initramfs/state/dev/shm/ > /dev/null 2>&1 + echo "files /dev/shm/lldpad.state" >> /run/initramfs/rwtab fi diff -urpa dracut-056.orig/modules.d/95fstab-sys/mount-sys.sh dracut-056/modules.d/95fstab-sys/mount-sys.sh --- dracut-056.orig/modules.d/95fstab-sys/mount-sys.sh 2022-02-18 12:32:53.000000000 +0100 +++ dracut-056/modules.d/95fstab-sys/mount-sys.sh 2022-08-29 23:58:56.546931985 +0200 @@ -27,9 +27,7 @@ fstab_mount() { # systemd will mount and run fsck from /etc/fstab and we don't want to # run into a race condition. -if [ -z "$DRACUT_SYSTEMD" ]; then - [ -f /etc/fstab ] && fstab_mount /etc/fstab -fi +[ -f /etc/fstab ] && fstab_mount /etc/fstab # prefer $NEWROOT/etc/fstab.sys over local /etc/fstab.sys if [ -f "$NEWROOT"/etc/fstab.sys ]; then diff -urpa dracut-056.orig/modules.d/95iscsi/cleanup-iscsi.sh dracut-056/modules.d/95iscsi/cleanup-iscsi.sh --- dracut-056.orig/modules.d/95iscsi/cleanup-iscsi.sh 2022-02-18 12:32:53.000000000 +0100 +++ dracut-056/modules.d/95iscsi/cleanup-iscsi.sh 2022-08-30 00:02:04.813221666 +0200 @@ -1,5 +1,5 @@ #!/bin/sh -if [ -z "${DRACUT_SYSTEMD}" ] && { [ -e /sys/module/bnx2i ] || [ -e /sys/module/qedi ]; }; then +if { [ -e /sys/module/bnx2i ] || [ -e /sys/module/qedi ]; }; then killproc iscsiuio fi diff -urpa dracut-056.orig/modules.d/95iscsi/iscsiroot.sh dracut-056/modules.d/95iscsi/iscsiroot.sh --- dracut-056.orig/modules.d/95iscsi/iscsiroot.sh 2022-02-18 12:32:53.000000000 +0100 +++ dracut-056/modules.d/95iscsi/iscsiroot.sh 2022-08-30 00:04:28.936443406 +0200 @@ -37,8 +37,7 @@ iroot=${iroot#:} modprobe crc32c 2> /dev/null # start iscsiuio if needed -if [ -z "${DRACUT_SYSTEMD}" ] \ - && { [ -e /sys/module/bnx2i ] || [ -e /sys/module/qedi ]; } \ +if { [ -e /sys/module/bnx2i ] || [ -e /sys/module/qedi ]; } \ && ! [ -e /tmp/iscsiuio-started ]; then iscsiuio : > /tmp/iscsiuio-started @@ -159,11 +158,6 @@ handle_netroot() { mkdir -p /etc/iscsi ln -fs /run/initiatorname.iscsi /etc/iscsi/initiatorname.iscsi : > /tmp/iscsi_set_initiator - if [ -n "$DRACUT_SYSTEMD" ]; then - systemctl try-restart iscsid - # FIXME: iscsid is not yet ready, when the service is :-/ - sleep 1 - fi fi if [ -z "$iscsi_initiator" ]; then @@ -180,11 +174,6 @@ handle_netroot() { mkdir -p /etc/iscsi ln -fs /run/initiatorname.iscsi /etc/iscsi/initiatorname.iscsi : > /tmp/iscsi_set_initiator - if [ -n "$DRACUT_SYSTEMD" ]; then - systemctl try-restart iscsid - # FIXME: iscsid is not yet ready, when the service is :-/ - sleep 1 - fi fi if [ -z "$iscsi_target_port" ]; then @@ -204,17 +193,10 @@ handle_netroot() { if ! [ -e /etc/iscsi/initiatorname.iscsi ]; then mkdir -p /etc/iscsi ln -fs /run/initiatorname.iscsi /etc/iscsi/initiatorname.iscsi - if [ -n "$DRACUT_SYSTEMD" ]; then - systemctl try-restart iscsid - # FIXME: iscsid is not yet ready, when the service is :-/ - sleep 1 - fi fi - if [ -z "$DRACUT_SYSTEMD" ]; then - iscsid - sleep 2 - fi + iscsid + sleep 2 # FIXME $iscsi_protocol?? @@ -226,8 +208,7 @@ handle_netroot() { wait_for_dev -n /dev/root # install mount script - [ -z "$DRACUT_SYSTEMD" ] \ - && echo "iscsi_lun=$iscsi_lun . /bin/mount-lun.sh " > "$hookdir"/mount/01-$$-iscsi.sh + echo "iscsi_lun=$iscsi_lun . /bin/mount-lun.sh " > "$hookdir"/mount/01-$$-iscsi.sh fi if strglobin "$iscsi_target_ip" '*:*:*' && ! strglobin "$iscsi_target_ip" '['; then diff -urpa dracut-056.orig/modules.d/95iscsi/module-setup.sh dracut-056/modules.d/95iscsi/module-setup.sh --- dracut-056.orig/modules.d/95iscsi/module-setup.sh 2022-02-18 12:32:53.000000000 +0100 +++ dracut-056/modules.d/95iscsi/module-setup.sh 2022-08-30 01:38:50.480257424 +0200 @@ -190,14 +190,6 @@ install() { inst_multiple umount iscsi-iname iscsiadm iscsid inst_binary sort - inst_multiple -o \ - "$systemdsystemunitdir"/iscsid.socket \ - "$systemdsystemunitdir"/iscsid.service \ - "$systemdsystemunitdir"/iscsiuio.service \ - "$systemdsystemunitdir"/iscsiuio.socket \ - "$systemdsystemunitdir"/sockets.target.wants/iscsid.socket \ - "$systemdsystemunitdir"/sockets.target.wants/iscsiuio.socket - if [[ $hostonly ]]; then local -a _filenames @@ -218,74 +210,7 @@ install() { inst_hook cmdline 90 "$moddir/parse-iscsiroot.sh" inst_hook cleanup 90 "$moddir/cleanup-iscsi.sh" inst "$moddir/iscsiroot.sh" "/sbin/iscsiroot" - - if ! dracut_module_included "systemd"; then - inst "$moddir/mount-lun.sh" "/bin/mount-lun.sh" - else - inst_multiple -o \ - "$systemdsystemunitdir"/iscsi.service \ - "$systemdsystemunitdir"/iscsi-init.service \ - "$systemdsystemunitdir"/iscsid.service \ - "$systemdsystemunitdir"/iscsid.socket \ - "$systemdsystemunitdir"/iscsiuio.service \ - "$systemdsystemunitdir"/iscsiuio.socket \ - iscsiadm iscsid - - for i in \ - iscsid.socket \ - iscsiuio.socket; do - $SYSTEMCTL -q --root "$initdir" enable "$i" - done - - mkdir -p "${initdir}/$systemdsystemunitdir/iscsid.service.d" - { - echo "[Unit]" - echo "DefaultDependencies=no" - echo "Conflicts=shutdown.target" - echo "Before=shutdown.target" - } > "${initdir}/$systemdsystemunitdir/iscsid.service.d/dracut.conf" - - mkdir -p "${initdir}/$systemdsystemunitdir/iscsid.socket.d" - { - echo "[Unit]" - echo "DefaultDependencies=no" - echo "Conflicts=shutdown.target" - echo "Before=shutdown.target sockets.target" - } > "${initdir}/$systemdsystemunitdir/iscsid.socket.d/dracut.conf" - - mkdir -p "${initdir}/$systemdsystemunitdir/iscsiuio.service.d" - { - echo "[Unit]" - echo "DefaultDependencies=no" - echo "Conflicts=shutdown.target" - echo "Before=shutdown.target" - } > "${initdir}/$systemdsystemunitdir/iscsiuio.service.d/dracut.conf" - - mkdir -p "${initdir}/$systemdsystemunitdir/iscsiuio.socket.d" - { - echo "[Unit]" - echo "DefaultDependencies=no" - echo "Conflicts=shutdown.target" - echo "Before=shutdown.target sockets.target" - } > "${initdir}/$systemdsystemunitdir/iscsiuio.socket.d/dracut.conf" - - # Fedora 34 iscsid requires iscsi-shutdown.service - # which would terminate all iSCSI connections on switch root - cat > "${initdir}/$systemdsystemunitdir/iscsi-shutdown.service" << EOF -[Unit] -Description=Dummy iscsi-shutdown.service for the initrd -Documentation=man:iscsid(8) man:iscsiadm(8) -DefaultDependencies=no -Conflicts=shutdown.target -After=systemd-remount-fs.service network.target iscsid.service iscsiuio.service -Before=remote-fs-pre.target - -[Service] -Type=oneshot -RemainAfterExit=false -ExecStart=-/usr/bin/true -EOF - fi + inst "$moddir/mount-lun.sh" "/bin/mount-lun.sh" inst_dir /var/lib/iscsi mkdir -p "${initdir}/var/lib/iscsi/nodes" # Fedora 34 iscsid wants a non-empty /var/lib/iscsi/nodes directory diff -urpa dracut-056.orig/modules.d/95iscsi/parse-iscsiroot.sh dracut-056/modules.d/95iscsi/parse-iscsiroot.sh --- dracut-056.orig/modules.d/95iscsi/parse-iscsiroot.sh 2022-02-18 12:32:53.000000000 +0100 +++ dracut-056/modules.d/95iscsi/parse-iscsiroot.sh 2022-08-30 00:03:21.583339788 +0200 @@ -41,7 +41,6 @@ if [ "${root%%:*}" = "iscsi" ]; then netroot=$root # if root is not specified try to mount the whole iSCSI LUN printf 'ENV{DEVTYPE}!="partition", SYMLINK=="disk/by-path/*-iscsi-*-*", SYMLINK+="root"\n' >> /etc/udev/rules.d/99-iscsi-root.rules - [ -n "$DRACUT_SYSTEMD" ] && systemctl is-active systemd-udevd && udevadm control --reload-rules root=/dev/root write_fs_tab /dev/root @@ -58,7 +57,6 @@ done if [ "${root}" = "/dev/root" ] && getarg "netroot=dhcp"; then # if root is not specified try to mount the whole iSCSI LUN printf 'ENV{DEVTYPE}!="partition", SYMLINK=="disk/by-path/*-iscsi-*-*", SYMLINK+="root"\n' >> /etc/udev/rules.d/99-iscsi-root.rules - [ -n "$DRACUT_SYSTEMD" ] && systemctl is-active systemd-udevd && udevadm control --reload-rules fi if [ -n "$iscsiroot" ]; then @@ -84,7 +82,7 @@ if [ -n "$iscsi_firmware" ]; then modprobe -b -q iscsi_boot_sysfs 2> /dev/null modprobe -b -q iscsi_ibft # if no ip= is given, but firmware - echo "${DRACUT_SYSTEMD+systemctl is-active initrd-root-device.target || }[ -f '/tmp/iscsistarted-firmware' ]" > "$hookdir"/initqueue/finished/iscsi_started.sh + echo "[ -f '/tmp/iscsistarted-firmware' ]" > "$hookdir"/initqueue/finished/iscsi_started.sh initqueue --unique --online /sbin/iscsiroot online "iscsi:" "$NEWROOT" initqueue --unique --onetime --timeout /sbin/iscsiroot timeout "iscsi:" "$NEWROOT" initqueue --unique --onetime --settled /sbin/iscsiroot online "iscsi:" "'$NEWROOT'" @@ -110,11 +108,6 @@ if arg=$(getarg rd.iscsi.initiator -d is rm -f /etc/iscsi/initiatorname.iscsi mkdir -p /etc/iscsi ln -fs /run/initiatorname.iscsi /etc/iscsi/initiatorname.iscsi - if [ -n "$DRACUT_SYSTEMD" ]; then - systemctl try-restart iscsid - # FIXME: iscsid is not yet ready, when the service is :-/ - sleep 1 - fi fi # If not given on the cmdline and initiator-name available via iBFT @@ -126,11 +119,6 @@ if [ -z "$iscsi_initiator" ] && [ -f /sy mkdir -p /etc/iscsi ln -fs /run/initiatorname.iscsi /etc/iscsi/initiatorname.iscsi : > /tmp/iscsi_set_initiator - if [ -n "$DRACUT_SYSTEMD" ]; then - systemctl try-restart iscsid - # FIXME: iscsid is not yet ready, when the service is :-/ - sleep 1 - fi fi fi @@ -145,7 +133,7 @@ for nroot in $(getargs netroot); do type parse_iscsi_root > /dev/null 2>&1 || . /lib/net-lib.sh parse_iscsi_root "$nroot" || return 1 netroot_enc=$(str_replace "$nroot" '/' '\2f') - echo "${DRACUT_SYSTEMD+systemctl is-active initrd-root-device.target || }[ -f '/tmp/iscsistarted-$netroot_enc' ]" > "$hookdir"/initqueue/finished/iscsi_started.sh + echo "[ -f '/tmp/iscsistarted-$netroot_enc' ]" > "$hookdir"/initqueue/finished/iscsi_started.sh done # Done, all good! diff -urpa dracut-056.orig/modules.d/95nbd/module-setup.sh dracut-056/modules.d/95nbd/module-setup.sh --- dracut-056.orig/modules.d/95nbd/module-setup.sh 2022-02-18 12:32:53.000000000 +0100 +++ dracut-056/modules.d/95nbd/module-setup.sh 2022-08-30 01:22:13.502695076 +0200 @@ -32,8 +32,5 @@ install() { inst nbd-client inst_hook cmdline 90 "$moddir/parse-nbdroot.sh" inst_script "$moddir/nbdroot.sh" "/sbin/nbdroot" - if dracut_module_included "systemd-initrd"; then - inst_script "$moddir/nbd-generator.sh" "$systemdutildir"/system-generators/dracut-nbd-generator - fi dracut_need_initqueue } diff -urpa dracut-056.orig/modules.d/95nbd/nbdroot.sh dracut-056/modules.d/95nbd/nbdroot.sh --- dracut-056.orig/modules.d/95nbd/nbdroot.sh 2022-02-18 12:32:53.000000000 +0100 +++ dracut-056/modules.d/95nbd/nbdroot.sh 2022-08-30 01:41:57.958549518 +0200 @@ -101,27 +101,13 @@ if [ "$root" = "block:/dev/root" -o "$ro udevadm control --reload wait_for_dev -n /dev/root - if [ -z "$DRACUT_SYSTEMD" ]; then - type write_fs_tab > /dev/null 2>&1 || . /lib/fs-lib.sh + type write_fs_tab > /dev/null 2>&1 || . /lib/fs-lib.sh - write_fs_tab /dev/root "$nbdfstype" "$fsopts" + write_fs_tab /dev/root "$nbdfstype" "$fsopts" - printf '/bin/mount %s\n' \ - "$NEWROOT" \ - > "$hookdir"/mount/01-$$-nbd.sh - else - mkdir -p /run/systemd/system/sysroot.mount.d - cat << EOF > /run/systemd/system/sysroot.mount.d/dhcp.conf -[Mount] -Where=/sysroot -What=/dev/root -Type=$nbdfstype -Options=$fsopts -EOF - systemctl --no-block daemon-reload - fi - # if we're on systemd, use the nbd-generator script - # to create the /sysroot mount. + printf '/bin/mount %s\n' \ + "$NEWROOT" \ + > "$hookdir"/mount/01-$$-nbd.sh fi if ! [ "$nbdport" -gt 0 ] 2> /dev/null; then diff -urpa dracut-056.orig/modules.d/95resume/module-setup.sh dracut-056/modules.d/95resume/module-setup.sh --- dracut-056.orig/modules.d/95resume/module-setup.sh 2022-02-18 12:32:53.000000000 +0100 +++ dracut-056/modules.d/95resume/module-setup.sh 2022-08-29 23:50:05.938113509 +0200 @@ -40,15 +40,6 @@ install() { [[ $_resumeconf ]] && printf "%s\n" "$_resumeconf" >> "${initdir}/etc/cmdline.d/95resume.conf" fi - # if systemd is included and has the hibernate-resume tool, use it and nothing else - if dracut_module_included "systemd" && [[ -x $dracutsysrootdir$systemdutildir/systemd-hibernate-resume ]]; then - inst_multiple -o \ - "$systemdutildir"/system-generators/systemd-hibernate-resume-generator \ - "$systemdsystemunitdir"/systemd-hibernate-resume@.service \ - "$systemdutildir"/systemd-hibernate-resume - return 0 - fi - # Optional uswsusp support for _bin in /usr/sbin/resume /usr/lib/suspend/resume /usr/lib64/suspend/resume /usr/lib/uswsusp/resume /usr/lib64/uswsusp/resume; do [[ -x $dracutsysrootdir${_bin} ]] && { @@ -58,11 +49,7 @@ install() { } done - if ! dracut_module_included "systemd"; then - inst_hook cmdline 10 "$moddir/parse-resume.sh" - else - inst_script "$moddir/parse-resume.sh" /lib/dracut/parse-resume.sh - fi + inst_hook cmdline 10 "$moddir/parse-resume.sh" inst_script "$moddir/resume.sh" /lib/dracut/resume.sh } diff -urpa dracut-056.orig/modules.d/95rootfs-block/module-setup.sh dracut-056/modules.d/95rootfs-block/module-setup.sh --- dracut-056.orig/modules.d/95rootfs-block/module-setup.sh 2022-02-18 12:32:53.000000000 +0100 +++ dracut-056/modules.d/95rootfs-block/module-setup.sh 2022-08-29 23:46:22.156767313 +0200 @@ -77,11 +77,9 @@ install() { inst_multiple umount inst_multiple tr - if ! dracut_module_included "systemd"; then - inst_hook cmdline 95 "$moddir/parse-block.sh" - inst_hook pre-udev 30 "$moddir/block-genrules.sh" - inst_hook mount 99 "$moddir/mount-root.sh" - fi + inst_hook cmdline 95 "$moddir/parse-block.sh" + inst_hook pre-udev 30 "$moddir/block-genrules.sh" + inst_hook mount 99 "$moddir/mount-root.sh" inst_hook initqueue/timeout 99 "$moddir/rootfallback.sh" } diff -urpa dracut-056.orig/modules.d/95udev-rules/module-setup.sh dracut-056/modules.d/95udev-rules/module-setup.sh --- dracut-056.orig/modules.d/95udev-rules/module-setup.sh 2022-02-18 12:32:53.000000000 +0100 +++ dracut-056/modules.d/95udev-rules/module-setup.sh 2022-08-30 01:26:13.553071427 +0200 @@ -11,18 +11,13 @@ install() { inst_dir /etc/udev inst_multiple -o /etc/udev/udev.conf - [[ -d ${initdir}/$systemdutildir ]] || mkdir -p "${initdir}/$systemdutildir" - for _i in "${systemdutildir}"/systemd-udevd "${udevdir}"/udevd /sbin/udevd; do + for _i in /sbin/udevd; do [[ -x $dracutsysrootdir$_i ]] || continue inst "$_i" - - if ! [[ -f ${initdir}${systemdutildir}/systemd-udevd ]]; then - ln -fs "$_i" "${initdir}${systemdutildir}"/systemd-udevd - fi break done - if ! [[ -e ${initdir}${systemdutildir}/systemd-udevd ]]; then - derror "Cannot find [systemd-]udevd binary!" + if ! [[ -e /sbin/udevd ]]; then + derror "Cannot find udevd binary!" exit 1 fi diff -urpa dracut-056.orig/modules.d/98usrmount/module-setup.sh dracut-056/modules.d/98usrmount/module-setup.sh --- dracut-056.orig/modules.d/98usrmount/module-setup.sh 2022-02-18 12:32:53.000000000 +0100 +++ dracut-056/modules.d/98usrmount/module-setup.sh 2022-08-29 23:46:30.068779565 +0200 @@ -13,8 +13,6 @@ depends() { # called by dracut install() { - if ! dracut_module_included "systemd"; then - inst_hook pre-pivot 50 "$moddir/mount-usr.sh" - fi + inst_hook pre-pivot 50 "$moddir/mount-usr.sh" : } diff -urpa dracut-056.orig/modules.d/99base/dracut-dev-lib.sh dracut-056/modules.d/99base/dracut-dev-lib.sh --- dracut-056.orig/modules.d/99base/dracut-dev-lib.sh 2022-02-18 12:32:53.000000000 +0100 +++ dracut-056/modules.d/99base/dracut-dev-lib.sh 2022-08-30 01:48:05.734122524 +0200 @@ -25,11 +25,6 @@ str_replace() { dev_unit_name() { local dev="$1" - if command -v systemd-escape > /dev/null; then - systemd-escape -p -- "$dev" - return $? - fi - if [ "$dev" = "/" -o -z "$dev" ]; then printf -- "-" return 0 @@ -48,53 +43,6 @@ dev_unit_name() { printf -- "%s" "$dev" } -# set_systemd_timeout_for_dev [-n] [] -# Set 'rd.timeout' as the systemd timeout for -set_systemd_timeout_for_dev() { - local _name - local _needreload - local _noreload - local _timeout - - [ -z "$DRACUT_SYSTEMD" ] && return 0 - - if [ "$1" = "-n" ]; then - _noreload=1 - shift - fi - - if [ -n "$2" ]; then - _timeout="$2" - else - _timeout=$(getarg rd.timeout) - fi - - _timeout=${_timeout:-0} - - _name=$(dev_unit_name "$1") - if ! [ -L "${PREFIX}/etc/systemd/system/initrd.target.wants/${_name}.device" ]; then - [ -d "${PREFIX}"/etc/systemd/system/initrd.target.wants ] || mkdir -p "${PREFIX}"/etc/systemd/system/initrd.target.wants - ln -s ../"${_name}".device "${PREFIX}/etc/systemd/system/initrd.target.wants/${_name}.device" - type mark_hostonly > /dev/null 2>&1 && mark_hostonly /etc/systemd/system/initrd.target.wants/"${_name}".device - _needreload=1 - fi - - if ! [ -f "${PREFIX}/etc/systemd/system/${_name}.device.d/timeout.conf" ]; then - mkdir -p "${PREFIX}/etc/systemd/system/${_name}.device.d" - { - echo "[Unit]" - echo "JobTimeoutSec=$_timeout" - echo "JobRunningTimeoutSec=$_timeout" - } > "${PREFIX}/etc/systemd/system/${_name}.device.d/timeout.conf" - type mark_hostonly > /dev/null 2>&1 && mark_hostonly /etc/systemd/system/"${_name}".device.d/timeout.conf - _needreload=1 - fi - - if [ -z "$PREFIX" ] && [ "$_needreload" = 1 ] && [ -z "$_noreload" ]; then - /sbin/initqueue --onetime --unique --name daemon-reload systemctl daemon-reload - fi -} - # wait_for_dev [] # # Installs a initqueue-finished script, @@ -122,7 +70,6 @@ wait_for_dev() { printf 'warn "\"%s\" does not exist"\n' "$1" } >> "${PREFIX}$hookdir/emergency/80-${_name}.sh" - set_systemd_timeout_for_dev $_noreload "$@" } cancel_wait_for_dev() { @@ -130,10 +77,4 @@ cancel_wait_for_dev() { _name="$(str_replace "$1" '/' '\x2f')" rm -f -- "$hookdir/initqueue/finished/devexists-${_name}.sh" rm -f -- "$hookdir/emergency/80-${_name}.sh" - if [ -n "$DRACUT_SYSTEMD" ]; then - _name=$(dev_unit_name "$1") - rm -f -- "${PREFIX}/etc/systemd/system/initrd.target.wants/${_name}.device" - rm -f -- "${PREFIX}/etc/systemd/system/${_name}.device.d/timeout.conf" - /sbin/initqueue --onetime --unique --name daemon-reload systemctl daemon-reload - fi } diff -urpa dracut-056.orig/modules.d/99base/dracut-lib.sh dracut-056/modules.d/99base/dracut-lib.sh --- dracut-056.orig/modules.d/99base/dracut-lib.sh 2022-08-28 19:16:30.263174545 +0200 +++ dracut-056/modules.d/99base/dracut-lib.sh 2022-08-30 00:31:36.280956151 +0200 @@ -2,7 +2,6 @@ type wait_for_dev > /dev/null 2>&1 || . /lib/dracut-dev-lib.sh -export DRACUT_SYSTEMD export NEWROOT if [ -n "$NEWROOT" ]; then [ -d "$NEWROOT" ] || mkdir -p -m 0755 "$NEWROOT" @@ -63,33 +62,19 @@ trim() { printf "%s" "$var" } -if [ -z "$DRACUT_SYSTEMD" ]; then - - warn() { - check_quiet - echo "<28>dracut Warning: $*" > /dev/kmsg - echo "dracut Warning: $*" >&2 - } - - info() { - check_quiet - echo "<30>dracut: $*" > /dev/kmsg - if [ "$DRACUT_QUIET" != "yes" ]; then - echo "dracut: $*" >&2 - fi - } - -else - - warn() { - echo "Warning: $*" >&2 - } - - info() { - echo "$*" - } +warn() { + check_quiet + echo "<28>dracut Warning: $*" > /dev/kmsg + echo "dracut Warning: $*" >&2 +} -fi +info() { + check_quiet + echo "<30>dracut: $*" > /dev/kmsg + if [ "$DRACUT_QUIET" != "yes" ]; then + echo "dracut: $*" >&2 + fi +} vwarn() { while read -r line || [ -n "$line" ]; do @@ -464,10 +449,6 @@ die() { source_hook "shutdown-emergency" fi - if [ -n "$DRACUT_SYSTEMD" ]; then - systemctl --no-block --force halt - fi - exit 1 } @@ -924,43 +905,34 @@ fi _emergency_shell() { local _name="$1" - if [ -n "$DRACUT_SYSTEMD" ]; then - : > /.console_lock - echo "PS1=\"$_name:\\\${PWD}# \"" > /etc/profile - systemctl start dracut-emergency.service - rm -f -- /etc/profile - rm -f -- /.console_lock - else - debug_off - source_hook "$hook" - echo - /sbin/rdsosreport - echo 'You might want to save "/run/initramfs/rdsosreport.txt" to a USB stick or /boot' - echo 'after mounting them and attach it to a bug report.' - if ! RD_DEBUG='' getargbool 0 rd.debug -d -y rdinitdebug -d -y rdnetdebug; then - echo - echo 'To get more debug information in the report,' - echo 'reboot with "rd.debug" added to the kernel command line.' - fi - echo - echo 'Dropping to debug shell.' + debug_off + source_hook "$hook" + echo + /sbin/rdsosreport + echo 'You might want to save "/run/initramfs/rdsosreport.txt" to a USB stick or /boot' + echo 'after mounting them and attach it to a bug report.' + if ! RD_DEBUG='' getargbool 0 rd.debug -d -y rdinitdebug -d -y rdnetdebug; then echo - export PS1="$_name:\${PWD}# " - [ -e /.profile ] || : > /.profile - + echo 'To get more debug information in the report,' + echo 'reboot with "rd.debug" added to the kernel command line.' + fi + echo + echo 'Dropping to debug shell.' + echo + export PS1="$_name:\${PWD}# " + [ -e /.profile ] || : > /.profile _ctty="$(RD_DEBUG='' getarg rd.ctty=)" && _ctty="/dev/${_ctty##*/}" - if [ -z "$_ctty" ]; then - _ctty=console - while [ -f /sys/class/tty/$_ctty/active ]; do - _ctty=$(cat /sys/class/tty/$_ctty/active) - _ctty=${_ctty##* } # last one in the list - done - _ctty=/dev/$_ctty - fi - [ -c "$_ctty" ] || _ctty=/dev/tty1 - case "$(/usr/bin/setsid --help 2>&1)" in *--ctty*) CTTY="--ctty" ;; esac - setsid $CTTY /bin/sh -i -l 0<> $_ctty 1<> $_ctty 2<> $_ctty + if [ -z "$_ctty" ]; then + _ctty=console + while [ -f /sys/class/tty/$_ctty/active ]; do + _ctty=$(cat /sys/class/tty/$_ctty/active) + _ctty=${_ctty##* } # last one in the list + done + _ctty=/dev/$_ctty fi + [ -c "$_ctty" ] || _ctty=/dev/tty1 + case "$(/usr/bin/setsid --help 2>&1)" in *--ctty*) CTTY="--ctty" ;; esac + setsid $CTTY /bin/sh -i -l 0<> $_ctty 1<> $_ctty 2<> $_ctty } emergency_shell() { @@ -976,11 +948,6 @@ emergency_shell() { _rdshell_name=$2 action="Shutdown" hook="shutdown-emergency" - if type plymouth > /dev/null 2>&1; then - plymouth --hide-splash - elif [ -x /oldroot/bin/plymouth ]; then - /oldroot/bin/plymouth --hide-splash - fi shift 2 fi diff -urpa dracut-056.orig/modules.d/99base/init.sh dracut-056/modules.d/99base/init.sh --- dracut-056.orig/modules.d/99base/init.sh 2022-08-28 19:16:30.263174545 +0200 +++ dracut-056/modules.d/99base/init.sh 2022-08-30 01:26:56.596138918 +0200 @@ -141,7 +141,7 @@ getargbool 0 rd.udev.info -d -y rdudevin getargbool 0 rd.udev.debug -d -y rdudevdebug && UDEV_LOG=debug # start up udev and trigger cold plugs -UDEV_LOG=$UDEV_LOG "$systemdutildir"/systemd-udevd --daemon --resolve-names=never +UDEV_LOG=$UDEV_LOG /sbin/udevd --daemon --resolve-names=never UDEV_QUEUE_EMPTY="udevadm settle --timeout=0" diff -urpa dracut-056.orig/modules.d/99base/module-setup.sh dracut-056/modules.d/99base/module-setup.sh --- dracut-056.orig/modules.d/99base/module-setup.sh 2022-08-28 19:23:42.688085700 +0200 +++ dracut-056/modules.d/99base/module-setup.sh 2022-08-29 23:51:05.024204902 +0200 @@ -53,11 +53,8 @@ install() { inst_simple "$moddir/dracut-dev-lib.sh" "/lib/dracut-dev-lib.sh" mkdir -p "${initdir}"/var - if ! dracut_module_included "systemd"; then - inst_multiple switch_root || dfatal "Failed to install switch_root" - inst_hook cmdline 10 "$moddir/parse-root-opts.sh" - inst_multiple -o "$systemdutildir"/systemd-timestamp - fi + inst_multiple switch_root || dfatal "Failed to install switch_root" + inst_hook cmdline 10 "$moddir/parse-root-opts.sh" if [[ $realinitpath ]]; then for i in $realinitpath; do @@ -109,11 +106,8 @@ install() { if [[ -n ${host_devs[*]} ]]; then dracut_need_initqueue fi - if [[ -f $initdir/lib/dracut/need-initqueue ]] || ! dracut_module_included "systemd"; then + if [[ -f $initdir/lib/dracut/need-initqueue ]]; then ( - if dracut_module_included "systemd"; then - export DRACUT_SYSTEMD=1 - fi export PREFIX="$initdir" export hookdir=/lib/dracut/hooks