uawdijnntqw1x1x1
IP : 216.73.216.110
Hostname : 6.87.74.97.host.secureserver.net
Kernel : Linux 6.87.74.97.host.secureserver.net 4.18.0-553.83.1.el8_10.x86_64 #1 SMP Mon Nov 10 04:22:44 EST 2025 x86_64
Disable Function : None :)
OS : Linux
PATH:
/
home
/
emeraadmin
/
.razor
/
.
/
..
/
www
/
node_modules
/
parse-filepath
/
..
/
..
/
4d695
/
dracut.tar
/
/
dracut.conf.d/01-dist.conf000064400000001030151701010110011201 0ustar00# dracut config file customized for RedHat/Fedora. # i18n i18n_vars="/etc/sysconfig/keyboard:KEYTABLE-KEYMAP /etc/sysconfig/i18n:SYSFONT-FONT,FONTACM-FONT_MAP,FONT_UNIMAP" i18n_default_font="eurlatgr" i18n_install_all="yes" stdloglvl=3 sysloglvl=5 install_optional_items+=" vi /etc/virc ps grep cat rm " prefix="/" systemdutildir=/usr/lib/systemd systemdsystemunitdir=/usr/lib/systemd/system systemdsystemconfdir=/etc/systemd/system udevdir=/usr/lib/udev hostonly="yes" hostonly_cmdline="no" early_microcode="yes" reproducible="yes" dracut.conf.d/01-microcode.conf000064400000000026151701010110012206 0ustar00early_microcode="yes" dracut.conf.d/99-microcode-override.conf000064400000000425151701010110014047 0ustar00## Uncomment the following line in order to disable ## microcode_ctl module that is used for $fw_dir variable overriding. ## ## Please refer to /usr/share/doc/microcode_ctl/README.caveats ## for additional information. ## #omit_dracutmodules+=' microcode_ctl-fw_dir_override ' dracut.conf.d/02-rescue.conf000064400000000032151701010110011526 0ustar00dracut_rescue_image="yes" modules.d/00bash/module-setup.sh000075500000000551151701010110012461 0ustar00#!/bin/bash # called by dracut check() { require_binaries /bin/bash } # called by dracut depends() { return 0 } # called by dracut install() { # If another shell is already installed, do not use bash [[ -x $initdir/bin/sh ]] && return # Prefer bash as /bin/sh if it is available. inst /bin/bash && ln -sf bash "${initdir}/bin/sh" } modules.d/00systemd/module-setup.sh000075500000022232151701010110013234 0ustar00#!/bin/bash # called by dracut check() { [[ $mount_needs ]] && return 1 if require_binaries $systemdutildir/systemd; then SYSTEMD_VERSION=$($systemdutildir/systemd --version | { read a b a; echo $b; }) (( $SYSTEMD_VERSION >= 198 )) && return 0 return 255 fi return 1 } # called by dracut depends() { return 0 } installkernel() { hostonly='' instmods autofs4 ipv6 algif_hash hmac sha256 sg instmods -s efivarfs } # called by dracut install() { local _mods if [[ "$prefix" == /run/* ]]; then dfatal "systemd does not work with a prefix, which contains \"/run\"!!" exit 1 fi inst_multiple -o \ $systemdutildir/system-generators/systemd-debug-generator \ $systemdsystemunitdir/debug-shell.service inst_multiple -o \ $systemdutildir/systemd \ $systemdutildir/systemd-coredump \ $systemdutildir/systemd-cgroups-agent \ $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-sysroot-fstab-check \ $systemdutildir/system-generators/systemd-fstab-generator \ $systemdutildir/system-generators/systemd-gpt-auto-generator \ \ $systemdsystemunitdir/cryptsetup.target \ $systemdsystemunitdir/emergency.target \ $systemdsystemunitdir/sysinit.target \ $systemdsystemunitdir/basic.target \ $systemdsystemunitdir/halt.target \ $systemdsystemunitdir/kexec.target \ $systemdsystemunitdir/local-fs.target \ $systemdsystemunitdir/local-fs-pre.target \ $systemdsystemunitdir/remote-fs.target \ $systemdsystemunitdir/remote-fs-pre.target \ $systemdsystemunitdir/multi-user.target \ $systemdsystemunitdir/network.target \ $systemdsystemunitdir/network-pre.target \ $systemdsystemunitdir/network-online.target \ $systemdsystemunitdir/nss-lookup.target \ $systemdsystemunitdir/nss-user-lookup.target \ $systemdsystemunitdir/poweroff.target \ $systemdsystemunitdir/reboot.target \ $systemdsystemunitdir/rescue.target \ $systemdsystemunitdir/rpcbind.target \ $systemdsystemunitdir/shutdown.target \ $systemdsystemunitdir/final.target \ $systemdsystemunitdir/sigpwr.target \ $systemdsystemunitdir/sockets.target \ $systemdsystemunitdir/swap.target \ $systemdsystemunitdir/timers.target \ $systemdsystemunitdir/paths.target \ $systemdsystemunitdir/umount.target \ \ $systemdsystemunitdir/sys-kernel-config.mount \ \ $systemdsystemunitdir/kmod-static-nodes.service \ $systemdsystemunitdir/systemd-tmpfiles-setup.service \ $systemdsystemunitdir/systemd-tmpfiles-setup-dev.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-random-seed-load.service \ $systemdsystemunitdir/systemd-random-seed.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-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 \ echo swapoff \ kmod insmod rmmod modprobe modinfo depmod lsmod \ mount umount reboot poweroff \ systemd-run systemd-escape \ systemd-cgls systemd-tmpfiles \ /etc/udev/udev.hwdb \ ${NULL} inst_multiple -o \ /usr/lib/modules-load.d/*.conf \ /usr/lib/sysctl.d/*.conf modules_load_get() { local _line i for i in "$1"/*.conf; do [[ -f $i ]] || continue while read _line || [ -n "$_line" ]; do case $_line in \#*) ;; \;*) ;; *) echo $_line esac done < "$i" done } _mods=$(modules_load_get /usr/lib/modules-load.d) [[ $_mods ]] && hostonly='' instmods $_mods 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 \ /etc/hostname \ /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 \ ${NULL} _mods=$(modules_load_get /etc/modules-load.d) [[ $_mods ]] && hostonly='' instmods $_mods fi if ! [[ -e "$initdir/etc/machine-id" ]]; then > "$initdir/etc/machine-id" fi # install adm user/group for journald inst_multiple nologin grep '^systemd-journal:' /etc/passwd 2>/dev/null >> "$initdir/etc/passwd" grep '^adm:' /etc/passwd 2>/dev/null >> "$initdir/etc/passwd" grep '^systemd-journal:' /etc/group >> "$initdir/etc/group" grep '^wheel:' /etc/group >> "$initdir/etc/group" grep '^adm:' /etc/group >> "$initdir/etc/group" grep '^utmp:' /etc/group >> "$initdir/etc/group" grep '^root:' /etc/group >> "$initdir/etc/group" # we don't use systemd-networkd, but the user is in systemd.conf tmpfiles snippet grep '^systemd-network:' /etc/passwd 2>/dev/null >> "$initdir/etc/passwd" grep '^systemd-network:' /etc/group >> "$initdir/etc/group" ln_r $systemdutildir/systemd "/init" ln_r $systemdutildir/systemd "/sbin/init" inst_binary true ln_r $(find_binary true) "/usr/bin/loginctl" ln_r $(find_binary true) "/bin/loginctl" inst_rules \ 70-uaccess.rules \ 71-seat.rules \ 73-seat-late.rules \ 90-vconsole.rules \ 99-systemd.rules \ ${NULL} for i in \ emergency.target \ rescue.target \ systemd-ask-password-console.service \ systemd-ask-password-plymouth.service \ ; do systemctl -q --root "$initdir" add-wants "$i" systemd-vconsole-setup.service 2>/dev/null 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 } modules.d/00warpclock/module-setup.sh000064400000001226151701010110013526 0ustar00#!/bin/bash # -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- # ex: ts=8 sw=4 sts=4 et filetype=sh # called by dracut check() { # hwclock does not exist on S390(x), bail out silently then local _arch=$(uname -m) [ "$_arch" = "s390" -o "$_arch" = "s390x" ] && return 1 [ -e /etc/localtime -a -e /etc/adjtime ] || return 1 require_binaries /sbin/hwclock || return 1 return 255 } # called by dracut depends() { return 0 } # called by dracut install() { inst /usr/share/zoneinfo/UTC inst /etc/localtime inst /etc/adjtime inst_hook pre-trigger 00 "$moddir/warpclock.sh" inst /sbin/hwclock } modules.d/00warpclock/warpclock.sh000064400000000227151701010110013070 0ustar00#!/bin/sh if test -e /etc/adjtime ; then while read line ; do if test "$line" = LOCAL ; then hwclock --systz fi done < /etc/adjtime fi modules.d/01fips/fips-boot.sh000075500000000411151701010110011760 0ustar00#!/bin/sh if ! fipsmode=$(getarg fips) || [ $fipsmode = "0" ]; then rm -f -- /etc/modprobe.d/fips.conf >/dev/null 2>&1 elif getarg boot= >/dev/null; then . /sbin/fips.sh if mount_boot; then do_fips || die "FIPS integrity test failed" fi fi modules.d/01fips/fips-load-crypto.sh000064400000000321151701010110013247 0ustar00#!/bin/sh if ! fipsmode=$(getarg fips) || [ $fipsmode = "0" ]; then rm -f -- /etc/modprobe.d/fips.conf >/dev/null 2>&1 else . /sbin/fips.sh fips_load_crypto || die "FIPS integrity test failed" fi modules.d/01fips/fips-noboot.sh000075500000000364151701010110012324 0ustar00#!/bin/sh if ! fipsmode=$(getarg fips) || [ $fipsmode = "0" ]; then rm -f -- /etc/modprobe.d/fips.conf >/dev/null 2>&1 elif ! [ -f /tmp/fipsdone ]; then . /sbin/fips.sh mount_boot do_fips || die "FIPS integrity test failed" fi modules.d/01fips/fips.sh000075500000013035151701010110011025 0ustar00#!/bin/sh mount_boot() { boot=$(getarg boot=) if [ -n "$boot" ]; then case "$boot" in LABEL=*) boot="$(echo $boot | sed 's,/,\\x2f,g')" boot="/dev/disk/by-label/${boot#LABEL=}" ;; UUID=*) boot="/dev/disk/by-uuid/${boot#UUID=}" ;; PARTUUID=*) boot="/dev/disk/by-partuuid/${boot#PARTUUID=}" ;; PARTLABEL=*) boot="/dev/disk/by-partlabel/${boot#PARTLABEL=}" ;; /dev/*) ;; *) die "You have to specify boot=<boot device> as a boot option for fips=1" ;; esac if ! [ -e "$boot" ]; then udevadm trigger --action=add >/dev/null 2>&1 [ -z "$UDEVVERSION" ] && UDEVVERSION=$(udevadm --version | { read v _ ; echo $v ; }) i=0 while ! [ -e $boot ]; do if [ $UDEVVERSION -ge 143 ]; then udevadm settle --exit-if-exists=$boot else udevadm settle --timeout=30 fi [ -e $boot ] && break sleep 0.5 i=$(($i+1)) [ $i -gt 40 ] && break done fi [ -e "$boot" ] || return 1 mkdir /boot info "Mounting $boot as /boot" mount -oro "$boot" /boot || return 1 elif [ -d "$NEWROOT/boot" ]; then rm -fr -- /boot ln -sf "$NEWROOT/boot" /boot fi } do_rhevh_check() { KERNEL=$(uname -r) kpath=${1} # If we're on RHEV-H, the kernel is in /run/initramfs/live/vmlinuz0 HMAC_SUM_ORIG=$(cat $NEWROOT/boot/.vmlinuz-${KERNEL}.hmac | while read a b || [ -n "$a" ]; do printf "%s\n" $a; done) HMAC_SUM_CALC=$(sha512hmac $kpath | while read a b || [ -n "$a" ]; do printf "%s\n" $a; done || return 1) if [ -z "$HMAC_SUM_ORIG" ] || [ -z "$HMAC_SUM_CALC" ] || [ "${HMAC_SUM_ORIG}" != "${HMAC_SUM_CALC}" ]; then warn "HMAC sum mismatch" return 1 fi info "rhevh_check OK" return 0 } fips_load_crypto() { FIPSMODULES=$(cat /etc/fipsmodules) info "Loading and integrity checking all crypto modules" mv /etc/modprobe.d/fips.conf /etc/modprobe.d/fips.conf.bak for _module in $FIPSMODULES; do if [ "$_module" != "tcrypt" ]; then if ! modprobe "${_module}" 2>/tmp/fips.modprobe_err; then # check if kernel provides generic algo _found=0 while read _k _s _v || [ -n "$_k" ]; do [ "$_k" != "name" -a "$_k" != "driver" ] && continue [ "$_v" != "$_module" ] && continue _found=1 break done </proc/crypto [ "$_found" = "0" ] && cat /tmp/fips.modprobe_err >&2 && return 1 fi fi done mv /etc/modprobe.d/fips.conf.bak /etc/modprobe.d/fips.conf info "Self testing crypto algorithms" modprobe tcrypt || return 1 rmmod tcrypt } do_fips() { local _v local _s local _v local _module KERNEL=$(uname -r) info "Checking integrity of kernel" if [ -e "/run/initramfs/live/vmlinuz0" ]; then do_rhevh_check /run/initramfs/live/vmlinuz0 || return 1 elif [ -e "/run/initramfs/live/isolinux/vmlinuz0" ]; then do_rhevh_check /run/initramfs/live/isolinux/vmlinuz0 || return 1 else BOOT_IMAGE="$(getarg BOOT_IMAGE)" # On s390x, BOOT_IMAGE isn't a path but an integer representing the # entry number selected. Let's try the root of /boot first, and # otherwise fallback to trying to parse the BLS entries if it's a # BLS-based system. if [ "$(uname -m)" = s390x ]; then if [ -e "/boot/vmlinuz-${KERNEL}" ]; then BOOT_IMAGE="vmlinuz-${KERNEL}" elif [ -d /boot/loader/entries ]; then i=0 for bls in $(ls -d /boot/loader/entries/*.conf | sort -rV); do if [ $i -eq ${BOOT_IMAGE:-0} ] && [ -r "$bls" ]; then BOOT_IMAGE="$(grep -e '^linux' "$bls" | grep -o ' .*$')" BOOT_IMAGE=${BOOT_IMAGE:1} break fi ((i++)) done fi fi # Trim off any leading GRUB boot device (e.g. ($root) ) BOOT_IMAGE="$(echo "${BOOT_IMAGE}" | sed 's/^(.*)//')" BOOT_IMAGE_NAME="${BOOT_IMAGE##*/}" BOOT_IMAGE_PATH="${BOOT_IMAGE%${BOOT_IMAGE_NAME}}" if [ -z "$BOOT_IMAGE_NAME" ]; then BOOT_IMAGE_NAME="vmlinuz-${KERNEL}" elif ! [ -e "/boot/${BOOT_IMAGE_PATH}/${BOOT_IMAGE_NAME}" ]; then #if /boot is not a separate partition BOOT_IMAGE might start with /boot BOOT_IMAGE_PATH=${BOOT_IMAGE_PATH#"/boot"} #on some achitectures BOOT_IMAGE does not contain path to kernel #so if we can't find anything, let's treat it in the same way as if it was empty if ! [ -e "/boot/${BOOT_IMAGE_PATH}/${BOOT_IMAGE_NAME}" ]; then BOOT_IMAGE_NAME="vmlinuz-${KERNEL}" BOOT_IMAGE_PATH="" fi fi BOOT_IMAGE_HMAC="/boot/${BOOT_IMAGE_PATH}/.${BOOT_IMAGE_NAME}.hmac" if ! [ -e "${BOOT_IMAGE_HMAC}" ]; then warn "${BOOT_IMAGE_HMAC} does not exist" return 1 fi (cd "${BOOT_IMAGE_HMAC%/*}" && sha512hmac -c "${BOOT_IMAGE_HMAC}") || return 1 fi info "All initrd crypto checks done" > /tmp/fipsdone umount /boot >/dev/null 2>&1 return 0 } modules.d/01fips/module-setup.sh000075500000004621151701010110012510 0ustar00#!/bin/bash # called by dracut check() { return 0 } # called by dracut depends() { return 0 } # called by dracut installkernel() { local _fipsmodules _mod _bootfstype if [[ -f "${srcmods}/modules.fips" ]]; then _fipsmodules="$(cat "${srcmods}/modules.fips")" else _fipsmodules="" # Hashes: _fipsmodules+="sha1 sha224 sha256 sha384 sha512 " _fipsmodules+="sha3-224 sha3-256 sha3-384 sha3-512 " _fipsmodules+="crc32c crct10dif ghash " # Ciphers: _fipsmodules+="cipher_null des3_ede aes cfb dh ecdh " # Modes/templates: _fipsmodules+="ecb cbc ctr xts gcm ccm authenc hmac cmac " # Compression algs: _fipsmodules+="deflate lzo zlib " # PRNG algs: _fipsmodules+="ansi_cprng " # Misc: _fipsmodules+="aead cryptomgr tcrypt crypto_user " fi mkdir -m 0755 -p "${initdir}/etc/modprobe.d" for _mod in $_fipsmodules; do if hostonly='' instmods -c -s $_mod; then echo $_mod >> "${initdir}/etc/fipsmodules" echo "blacklist $_mod" >> "${initdir}/etc/modprobe.d/fips.conf" fi done # with hostonly_default_device fs module for /boot is not installed by default if [[ $hostonly ]] && [[ "$hostonly_default_device" == "no" ]]; then _bootfstype=$(find_mp_fstype /boot) if [[ -n "$_bootfstype" ]]; then hostonly='' instmods $_bootfstype else dwarning "Can't determine fs type for /boot, FIPS check may fail." fi fi } # called by dracut install() { local _dir inst_hook pre-trigger 01 "$moddir/fips-boot.sh" inst_hook pre-pivot 01 "$moddir/fips-noboot.sh" inst_hook pre-udev 01 "$moddir/fips-load-crypto.sh" inst_script "$moddir/fips.sh" /sbin/fips.sh inst_multiple sha512hmac rmmod insmod mount uname umount grep sort inst_simple /etc/system-fips [ -c ${initdir}/dev/random ] || mknod ${initdir}/dev/random c 1 8 \ || { dfatal "Cannot create /dev/random" dfatal "To create an initramfs with fips support, dracut has to run as root" return 1 } [ -c ${initdir}/dev/urandom ] || mknod ${initdir}/dev/urandom c 1 9 \ || { dfatal "Cannot create /dev/random" dfatal "To create an initramfs with fips support, dracut has to run as root" return 1 } } modules.d/01systemd-initrd/module-setup.sh000075500000003451151701010110014526 0ustar00#!/bin/bash # called by dracut check() { [[ $mount_needs ]] && return 1 if ! dracut_module_included "systemd"; then derror "systemd-initrd needs systemd in the initramfs" return 1 fi return 0 } # called by dracut depends() { echo "systemd" } installkernel() { return 0 } # called by dracut install() { local _mods inst_multiple -o \ $systemdsystemunitdir/initrd.target \ $systemdsystemunitdir/initrd-fs.target \ $systemdsystemunitdir/initrd-root-device.target \ $systemdsystemunitdir/initrd-root-fs.target \ $systemdsystemunitdir/initrd-switch-root.target \ $systemdsystemunitdir/initrd-switch-root.service \ $systemdsystemunitdir/initrd-cleanup.service \ $systemdsystemunitdir/initrd-udevadm-cleanup-db.service \ $systemdsystemunitdir/initrd-parse-etc.service systemctl -q --root "$initdir" set-default initrd.target local VERSION="" local PRETTY_NAME="" if [ -e /etc/os-release ]; then . /etc/os-release [[ -n ${VERSION} ]] && VERSION+=" " [[ -n ${PRETTY_NAME} ]] && PRETTY_NAME+=" " fi NAME=dracut ID=dracut VERSION+="dracut-$DRACUT_VERSION" PRETTY_NAME+="dracut-$DRACUT_VERSION (Initramfs)" VERSION_ID=$DRACUT_VERSION ANSI_COLOR="0;34" { echo NAME=\"$NAME\" echo VERSION=\"$VERSION\" echo ID=$ID echo VERSION_ID=$VERSION_ID echo PRETTY_NAME=\"$PRETTY_NAME\" echo ANSI_COLOR=\"$ANSI_COLOR\" } > $initdir/usr/lib/initrd-release echo dracut-$DRACUT_VERSION > $initdir/lib/dracut/dracut-$DRACUT_VERSION ln -sf ../usr/lib/initrd-release $initdir/etc/initrd-release ln -sf initrd-release $initdir/usr/lib/os-release ln -sf initrd-release $initdir/etc/os-release } modules.d/03modsign/load-modsign-keys.sh000075500000000352151701010110014111 0ustar00#!/bin/sh # # Licensed under the GPLv2 # # Copyright 2013 Red Hat, Inc. # Peter Jones <pjones@redhat.com> for x in /lib/modules/keys/* ; do [ "${x}" = "/lib/modules/keys/*" ] && break keyctl padd asymmetric "" @s < ${x} done modules.d/03modsign/module-setup.sh000075500000001330151701010110013203 0ustar00#!/bin/bash # # Licensed under the GPLv2 # # Copyright 2013 Red Hat, Inc. # Peter Jones <pjones@redhat.com> # called by dracut check() { require_binaries keyctl || return 1 # do not include module in hostonly mode, # if no keys are present if [[ $hostonly ]]; then x=$(echo /lib/modules/keys/*) [[ "${x}" = "/lib/modules/keys/*" ]] && return 255 fi return 0 } # called by dracut depends() { return 0 } # called by dracut install() { inst_dir /lib/modules/keys inst_binary keyctl inst_hook pre-trigger 01 "$moddir/load-modsign-keys.sh" for x in /lib/modules/keys/* ; do [[ "${x}" = "/lib/modules/keys/*" ]] && break inst_simple "${x}" done } modules.d/03rescue/module-setup.sh000075500000000571151701010110013037 0ustar00#!/bin/bash # called by dracut check() { # do not add this module by default return 255 } # called by dracut depends() { return 0 } # called by dracut install() { inst_multiple -o ps grep more cat rm strace free showmount \ ping netstat rpcinfo vi scp ping6 ssh \ fsck fsck.ext2 fsck.ext4 fsck.ext3 fsck.ext4dev fsck.f2fs fsck.vfat e2fsck } modules.d/04watchdog/module-setup.sh000075500000001754151701010110013356 0ustar00#!/bin/bash # called by dracut check() { return 255 } # called by dracut depends() { echo watchdog-modules return 0 } # called by dracut 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 emergency 02 "$moddir/watchdog-stop.sh" inst_multiple -o wdctl } modules.d/04watchdog/watchdog-stop.sh000075500000000075151701010110013511 0ustar00#!/bin/sh [ -c /dev/watchdog ] && printf 'V' > /dev/watchdog modules.d/04watchdog/watchdog.sh000075500000000365151701010110012530 0ustar00#!/bin/sh if [ -e /dev/watchdog ]; then if [ ! -e /tmp/watchdog_timeout ]; then wdctl -s 60 /dev/watchdog >/dev/null 2>&1 > /tmp/watchdog_timeout fi info "Triggering watchdog" >/dev/watchdog else modprobe ib700wdt modprobe i6300esb fi modules.d/04watchdog-modules/module-setup.sh000075500000003623151701010110015021 0ustar00#!/bin/bash # called by dracut check() { return 255 } # called by dracut depends() { return 0 } # called by dracut install() { return 0 } installkernel() { local -A _drivers local _alldrivers _wdtdrv _wdtppath _dir [[ -d /sys/class/watchdog/ ]] || return for _dir in /sys/class/watchdog/*; do [[ -d "$_dir" ]] || continue [[ -f "$_dir/state" ]] || continue # device/modalias will return driver of this device _wdtdrv=$(< "$_dir/device/modalias") # There can be more than one module represented by same # modalias. Currently load all of them. # TODO: Need to find a way to avoid any unwanted module # represented by modalias _wdtdrv=$(modprobe --set-version "$kernel" -R $_wdtdrv 2>/dev/null) if [[ $_wdtdrv ]]; then instmods $_wdtdrv for i in $_wdtdrv; do _drivers[$i]=1 done fi # however in some cases, we also need to check that if there is # a specific driver for the parent bus/device. In such cases # we also need to enable driver for parent bus/device. _wdtppath=$(readlink -f "$_dir/device") while [[ -d "$_wdtppath" ]] && [[ "$_wdtppath" != "/sys" ]]; do _wdtppath=$(readlink -f "$_wdtppath/..") [[ -f "$_wdtppath/modalias" ]] || continue _wdtdrv=$(< "$_wdtppath/modalias") _wdtdrv=$(modprobe --set-version "$kernel" -R $_wdtdrv 2>/dev/null) if [[ $_wdtdrv ]]; then instmods $_wdtdrv for i in $_wdtdrv; do _drivers[$i]=1 done fi done done # ensure that watchdog module is loaded as early as possible _alldrivers="${!_drivers[*]}" [[ $_alldrivers ]] && echo "rd.driver.pre=${_alldrivers// /,}" > ${initdir}/etc/cmdline.d/00-watchdog.conf return 0 } modules.d/05busybox/module-setup.sh000075500000001072151701010110013243 0ustar00#!/bin/bash # called by dracut check() { require_binaries busybox || return 1 return 255 } # called by dracut depends() { return 0 } # called by dracut install() { local _i _path _busybox local _progs=() _busybox=$(find_binary busybox) inst $_busybox /usr/bin/busybox for _i in $($_busybox --list); do [[ ${_i} == busybox ]] && continue _progs+=("${_i}") done for _i in "${_progs[@]}"; do _path=$(find_binary "$_i") [ -z "$_path" ] && continue ln_r /usr/bin/busybox $_path done } modules.d/06rngd/module-setup.sh000064400000002454151701010110012505 0ustar00#!/bin/bash # vim: set tabstop=8 shiftwidth=4 softtabstop=4 expandtab smarttab colorcolumn=80: # # Copyright (c) 2019 Red Hat, Inc. # Author: Renaud Métrich <rmetrich@redhat.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. # depends() { echo systemd return 0 } check() { # if there's no rngd binary, no go. require_binaries rngd || return 1 return 0 } install() { inst rngd inst_simple "${systemdsystemunitdir}/rngd.service" if [ -r /etc/sysconfig/rngd ]; then inst_simple "${moddir}/sysconfig" "/etc/sysconfig/rngd" fi # make sure dependant libs are installed too inst_libdir_file opensc-pkcs11.so systemctl -q --root "$initdir" add-wants sysinit.target rngd.service } modules.d/06rngd/sysconfig000064400000000072151701010110011447 0ustar00RNGD_ARGS="--fill-watermark=0 -x pkcs11 -x nist -x qrypt" modules.d/10i18n/10-console.rules000064400000000250151701010110012272 0ustar00# Console initialization - keyboard, font, etc. KERNEL=="tty0", RUN+="/sbin/initqueue --onetime --unique --name console_init_$name /lib/udev/console_init $root/$name" modules.d/10i18n/README000064400000010504151701010110010221 0ustar00dracut i18n module ------------------ INDEX 0. Introduction 1. Hostonly vs Generic 2. Configuration 2.1. Variables 2.2. Setting up mappings 2.3. Additional settings 3. Kernel parameters ~ 0. Introduction i18n module provides internationalization for initramfs at runtime. It is intended to be generic across different GNU/Linux distributions. i18n and keyboard settings are stored in different files among distributions. To deal with it avoiding hardcoding those differences in the installation script we handle it by mappings between variables used by dracut and the ones in the system. Package maintainer is expected to create those for his/her distribution and it's appreciated to share it with us, so we can include it in source package. 1. Hostonly vs Generic If you invoke dracut with '-H' option, i18n module install script will gather variables values from your configuration files using mappings provided in "/etc/dracut.conf.d/<foo>.conf". Those variables will be put in "etc/vconsole.conf" and "etc/locale.conf" files inside initramfs image. Next it will install only declared font, keymaps and so. When building generic image (dracut without '-H' option), install script copies all content of directories: consolefonts, consoletrans, unimaps and keymaps to image. Take into account that's about 4 MiB. 2. Configuration 2.1. Variables The following variables are used by i18n install script and at initramfs runtime: KEYMAP - keyboard translation table loaded by loadkeys KEYTABLE - base name for keyboard translation table; if UNICODE is true, Unicode version will be loaded. Overrides KEYMAP. EXT_KEYMAPS - list of extra keymaps to bo loaded (sep. by space) UNICODE - boolean, indicating UTF-8 mode FONT - console font FONT_MAP - see description of '-m' parameter in setfont manual FONT_UNIMAP - see description of '-u' parameter in setfont manual The following are appended to EXT_KEYMAPS only during build time: UNIKEYMAP GRP_TOGGLE They were used in 10redhat-i18n module, but not sure of its purpose. I'm leaving it in case... The following are taken from the environment: LANG LC_ALL If UNICODE variable is not provided, script indicates if UTF-8 should be used on the basis of LANG value (if it ends with ".utf8" or similar). 2.2. Setting up mappings Mappings between variables listed in 2.1. and the ones spread around your system are set up in /etc/dracut.conf.d/<foo>.conf. You need to assign mappings to i18n_vars. Here's an example: i18n_vars="/etc/conf.d/keymaps:KEYMAP,EXTENDED_KEYMAPS-EXT_KEYMAPS /etc/conf.d/consolefont:CONSOLEFONT-FONT,CONSOLETRANSLATION-FONT_MAP /etc/rc.conf:UNICODE" First we've got name of file in host file system tree. After colon there's mapping: <from>-<to>. If both variables have the same name you can enter just a single, but it's important to specify it! The module will source only variables you've listed. Below there's detailed description in BNF: <list> ::= <element> | <element> " " <list> <element> ::= <conf-file-name> ":" <map-list> <map-list> ::= <mapping> | <mapping> "," <map-list> <mapping> ::= <src-var> "-" <dst-var> | <src-var> We assume no whitespace are allowed between symbols. <conf-file-name> is a file holding <src-var> in your system. <src-var> is a variable holding value of meaning the same as <dst-var>. <dst-var> is a variable which will be set up inside initramfs. If <dst-var> has the same name as <src-var> we can omit <dst-var>. Example: /etc/conf.d/keymaps:KEYMAP,extended_keymaps-EXT_KEYMAPS <list> = /etc/conf.d/keymaps:KEYMAP,extended_keymaps-EXT_KEYMAPS <element> = /etc/conf.d/keymaps:KEYMAP,extended_keymaps-EXT_KEYMAPS <conf-file-name> = /etc/conf.d/keymaps <map-list> = KEYMAP,extended_keymaps-EXT_KEYMAPS <mapping> = KEYMAP <src-var> = KEYMAP <mapping> = extended_keymaps-EXT_KEYMAPS <src-var> = extended_keymaps <dst-var> = EXT_KEYMAPS 2.3. Additional settings If you encounter following error message: "Directories consolefonts, consoletrans, keymaps, unimaps not found.", you can provide path where those directories lie in your system by setting kbddir in configuration file (the same where you put mappings). 3. Kernel parameters If you create generic initramfs you can set up i18n by kernel parameters using variables listed in 2.1. (except of UNIKEYMAP and GRP_TOGGLE) The recommended minimum is: FONT and KEYMAP. modules.d/10i18n/console_init.sh000075500000003114151701010110012364 0ustar00#!/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=LatArCyrHeb-16 DEFAULT_KEYMAP=/etc/sysconfig/console/default.kmap set_keyboard() { local param [ "${UNICODE}" = 1 ] && param=-u || param=-a kbd_mode ${param} } set_terminal() { local dev=$1 if [ "${UNICODE}" = 1 ]; then printf '\033%%G' >&7 stty -F ${dev} iutf8 else printf '\033%%@' >&7 stty -F ${dev} -iutf8 fi } set_keymap() { local utf_switch if [ -z "${KEYMAP}" ]; then [ -f "${DEFAULT_KEYMAP}" ] && KEYMAP=${DEFAULT_KEYMAP} fi [ -n "${KEYMAP}" ] || return 1 [ "${UNICODE}" = 1 ] && utf_switch=-u loadkeys -q ${utf_switch} ${KEYMAP} ${EXT_KEYMAPS} } set_font() { local dev=$1; local trans=''; local uni='' [ -z "${FONT}" ] && FONT=${DEFAULT_FONT} [ -n "${FONT_MAP}" ] && trans="-m ${FONT_MAP}" [ -n "${FONT_UNIMAP}" ] && uni="-u ${FONT_UNIMAP}" setfont ${FONT} -C ${dev} ${trans} ${uni} } dev_close() { exec 6>&- exec 7>&- } dev_open() { local dev=$1 exec 6<${dev} && \ exec 7>>${dev} } dev=/dev/${1#/dev/} devname=${dev#/dev/} [ -c "${dev}" ] || { echo "Usage: $0 device" >&2 exit 1 } dev_open ${dev} for fd in 6 7; do if ! [ -t ${fd} ]; then echo "ERROR: File descriptor not opened: ${fd}" >&2 dev_close exit 1 fi done set_keyboard set_terminal ${dev} set_font ${dev} set_keymap dev_close modules.d/10i18n/module-setup.sh000075500000020164151701010110012326 0ustar00#!/bin/bash # called by dracut check() { [[ "$mount_needs" ]] && return 1 require_binaries setfont loadkeys kbd_mode || return 1 return 0 } # called by dracut depends() { return 0 } # called by dracut install() { if dracut_module_included "systemd"; then unset FONT unset KEYMAP [[ -f /etc/vconsole.conf ]] && . /etc/vconsole.conf fi KBDSUBDIRS=consolefonts,consoletrans,keymaps,unimaps DEFAULT_FONT="${i18n_default_font:-LatArCyrHeb-16}" I18N_CONF="/etc/locale.conf" VCONFIG_CONF="/etc/vconsole.conf" # This is from 10redhat-i18n. findkeymap () { local MAPS=$1 local MAPNAME=${1%.map*} local map [[ ! -f $MAPS ]] && \ MAPS=$(find ${kbddir}/keymaps -type f -name ${MAPNAME} -o -name ${MAPNAME}.map -o -name ${MAPNAME}.map.\*) for map in $MAPS; do KEYMAPS="$KEYMAPS $map" case $map in *.gz) cmd=zgrep;; *.bz2) cmd=bzgrep;; *) cmd=grep ;; esac for INCL in $($cmd "^include " $map | while read a a b || [ -n "$a" ]; do echo ${a//\"/}; done); do for FN in $(find ${kbddir}/keymaps -type f -name $INCL\*); do strstr "$KEYMAPS" "$FN" || findkeymap $FN done done done } # Function gathers variables from distributed files among the tree, maps to # specified names and prints the result in format "new-name=value". # # $@ = list in format specified below (BNF notation) # # <list> ::= <element> | <element> " " <list> # <element> ::= <conf-file-name> ":" <map-list> # <map-list> ::= <mapping> | <mapping> "," <map-list> # <mapping> ::= <src-var> "-" <dst-var> | <src-var> # # We assume no whitespace are allowed between symbols. # <conf-file-name> is a file holding <src-var> in your system. # <src-var> is a variable holding value of meaning the same as <dst-var>. # <dst-var> is a variable which will be set up inside initramfs. # If <dst-var> has the same name as <src-var> we can omit <dst-var>. # # Example: # /etc/conf.d/keymaps:KEYMAP,extended_keymaps-EXT_KEYMAPS # <list> = /etc/conf.d/keymaps:KEYMAP,extended_keymaps-EXT_KEYMAPS # <element> = /etc/conf.d/keymaps:KEYMAP,extended_keymaps-EXT_KEYMAPS # <conf-file-name> = /etc/conf.d/keymaps # <map-list> = KEYMAP,extended_keymaps-EXT_KEYMAPS # <mapping> = KEYMAP # <src-var> = KEYMAP # <mapping> = extended_keymaps-EXT_KEYMAPS # <src-var> = extended_keymaps # <dst-var> = EXT_KEYMAPS gather_vars() { local item map value for item in $@ do item=(${item/:/ }) for map in ${item[1]//,/ } do map=(${map//-/ }) if [[ -f "${item[0]}" ]]; then value=$(grep "^${map[0]}=" "${item[0]}") value=${value#*=} echo "${map[1]:-${map[0]}}=${value}" fi done done } 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 if [[ ${kbddir} != "/usr/share" ]]; then inst_dir /usr/share for _src in $(eval echo {${KBDSUBDIRS}}); do [ ! -e "${initdir}/usr/share/${_src}" ] && ln -s "${kbddir}/${_src}" "${initdir}/usr/share/${_src}" done fi } install_all_kbd() { local rel f for _src in $(eval echo ${kbddir}/{${KBDSUBDIRS}}); do inst_dir "$_src" $DRACUT_CP -L -t "${initdir}/${_src}" "$_src"/* done # remove unnecessary files rm -f -- "${initdir}${kbddir}/consoletrans/utflist" find "${initdir}${kbddir}/" -name README\* -delete find "${initdir}${kbddir}/" -name '*.gz' -print -quit \ | while read line || [ -n "$line" ]; do inst_multiple gzip done find "${initdir}${kbddir}/" -name '*.bz2' -print -quit \ | while read line || [ -n "$line" ]; do inst_multiple bzip2 done } install_local_i18n() { local map eval $(gather_vars ${i18n_vars}) [ -f $I18N_CONF ] && . $I18N_CONF [ -f $VCONFIG_CONF ] && . $VCONFIG_CONF shopt -q -s nocasematch if [[ ${UNICODE} ]] then if [[ ${UNICODE} = YES || ${UNICODE} = 1 ]] then UNICODE=1 elif [[ ${UNICODE} = NO || ${UNICODE} = 0 ]] then UNICODE=0 else UNICODE='' fi fi if [[ ! ${UNICODE} && ${LANG} =~ .*\.UTF-?8 ]] then UNICODE=1 fi shopt -q -u nocasematch # Gentoo user may have KEYMAP set to something like "-u pl2", KEYMAP=${KEYMAP#-* } # openSUSE user may have KEYMAP set to something like ".gz" KEYMAP=${KEYMAP/.gz/} # KEYTABLE is a bit special - it defines base keymap name and UNICODE # determines whether non-UNICODE or UNICODE version is used if [[ ${KEYTABLE} ]]; then if [[ ${UNICODE} == 1 ]]; then [[ ${KEYTABLE} =~ .*\.uni.* ]] || KEYTABLE=${KEYTABLE%.map*}.uni fi KEYMAP=${KEYTABLE} fi # I'm not sure of the purpose of UNIKEYMAP and GRP_TOGGLE. They were in # original redhat-i18n module. Anyway it won't hurt. EXT_KEYMAPS+=\ ${UNIKEYMAP}\ ${GRP_TOGGLE} [[ ${KEYMAP} ]] || { dinfo 'No KEYMAP configured.' return 1 } findkeymap ${KEYMAP} for map in ${EXT_KEYMAPS} do ddebug "Adding extra map: ${map}" findkeymap ${map} done for keymap in ${KEYMAPS}; do inst_opt_decompress ${keymap} done inst_opt_decompress ${kbddir}/consolefonts/${DEFAULT_FONT}.* if [[ ${FONT} ]] && [[ ${FONT} != ${DEFAULT_FONT} ]] then FONT=${FONT%.psf*} inst_opt_decompress ${kbddir}/consolefonts/${FONT}.* fi if [[ ${FONT_MAP} ]] then FONT_MAP=${FONT_MAP%.trans} # There are three different formats that setfont supports inst_simple ${kbddir}/consoletrans/${FONT_MAP} \ || inst_simple ${kbddir}/consoletrans/${FONT_MAP}.trans \ || inst_simple ${kbddir}/consoletrans/${FONT_MAP}_to_uni.trans \ || dwarn "Could not find FONT_MAP ${FONT_MAP}!" fi if [[ ${FONT_UNIMAP} ]] then FONT_UNIMAP=${FONT_UNIMAP%.uni} inst_simple ${kbddir}/unimaps/${FONT_UNIMAP}.uni fi if dracut_module_included "systemd" && [[ -f ${I18N_CONF} ]]; then inst_simple ${I18N_CONF} else mksubdirs ${initdir}${I18N_CONF} print_vars LC_ALL LANG >> ${initdir}${I18N_CONF} fi if dracut_module_included "systemd" && [[ -f ${VCONFIG_CONF} ]]; then inst_simple ${VCONFIG_CONF} else mksubdirs ${initdir}${VCONFIG_CONF} print_vars KEYMAP EXT_KEYMAPS UNICODE FONT FONT_MAP FONT_UNIMAP >> ${initdir}${VCONFIG_CONF} fi return 0 } checks() { for kbddir in ${kbddir} /usr/lib/kbd /lib/kbd /usr/share /usr/share/kbd do [[ -d "${kbddir}" ]] && \ for dir in ${KBDSUBDIRS//,/ } do [[ -d "${kbddir}/${dir}" ]] && continue false done && break kbddir='' done [[ -f $I18N_CONF && -f $VCONFIG_CONF ]] || \ [[ ! ${hostonly} || ${i18n_vars} ]] || { derror 'i18n_vars not set! Please set up i18n_vars in ' \ 'configuration file.' } return 0 } if checks; then install_base if [[ ${hostonly} ]] && ! [[ ${i18n_install_all} == "yes" ]]; then install_local_i18n || install_all_kbd else install_all_kbd fi fi } modules.d/10i18n/parse-i18n.sh000075500000002207151701010110011570 0ustar00#!/bin/sh inst_key_val() { local _value local _file local _default _file="$1"; shift _key="$1"; shift _default="$1"; shift _value="$(getarg $@)" [ -z "${_value}" ] && _value=$_default if [ -n "${_value}" ]; then printf '%s="%s"\n' ${_key} ${_value} >> $_file fi unset _file unset _value } inst_key_val /etc/vconsole.conf KEYMAP '' rd.vconsole.keymap KEYMAP -d KEYTABLE inst_key_val /etc/vconsole.conf FONT '' rd.vconsole.font FONT -d SYSFONT inst_key_val /etc/vconsole.conf FONT_MAP '' rd.vconsole.font.map FONT_MAP -d CONTRANS inst_key_val /etc/vconsole.conf FONT_UNIMAP '' rd.vconsole.font.unimap FONT_UNIMAP -d UNIMAP inst_key_val /etc/vconsole.conf UNICODE 1 rd.vconsole.font.unicode UNICODE vconsole.unicode inst_key_val /etc/vconsole.conf EXT_KEYMAP '' rd.vconsole.keymap.ext EXT_KEYMAP inst_key_val /etc/locale.conf LANG '' rd.locale.LANG LANG inst_key_val /etc/locale.conf LC_ALL '' rd.locale.LC_ALL LC_ALL if [ -f /etc/locale.conf ]; then . /etc/locale.conf export LANG export LC_ALL fi modules.d/30convertfs/convertfs.sh000075500000013623151701010110013152 0ustar00#!/bin/bash ROOT="$1" if [[ ! -d "$ROOT" ]]; then echo "Usage: $0 <rootdir>" exit 1 fi if [[ "$ROOT" -ef / ]]; then echo "Can't convert the running system." echo "Please boot with 'rd.convertfs' on the kernel command line," echo "to update with the help of the initramfs," echo "or run this script from a rescue system." exit 1 fi while [[ "$ROOT" != "${ROOT%/}" ]]; do ROOT=${ROOT%/} done if [ ! -L $ROOT/var/run -a -e $ROOT/var/run ]; then echo "Converting /var/run to symlink" mv -f $ROOT/var/run $ROOT/var/run.runmove~ ln -sfn ../run $ROOT/var/run fi if [ ! -L $ROOT/var/lock -a -e $ROOT/var/lock ]; then echo "Converting /var/lock to symlink" mv -f $ROOT/var/lock $ROOT/var/lock.lockmove~ ln -sfn ../run/lock $ROOT/var/lock fi needconvert() { for dir in "$ROOT/bin" "$ROOT/sbin" "$ROOT/lib" "$ROOT/lib64"; do if [[ -e "$dir" ]]; then [[ -L "$dir" ]] || return 0 fi done return 1 } if ! [ -e "$ROOT/usr/bin" ]; then echo "$ROOT/usr/bin does not exist!" echo "Make sure, the kernel command line has enough information" echo "to mount /usr (man dracut.cmdline)" exit 1 fi if ! needconvert; then echo "Your system is already converted." exit 0 fi testfile="$ROOT/.usrmovecheck$$" rm -f -- "$testfile" > "$testfile" if [[ ! -e "$testfile" ]]; then echo "Cannot write to $ROOT/" exit 1 fi rm -f -- "$testfile" testfile="$ROOT/usr/.usrmovecheck$$" rm -f -- "$testfile" > "$testfile" if [[ ! -e "$testfile" ]]; then echo "Cannot write to $ROOT/usr/" exit 1 fi rm -f -- "$testfile" find_mount() { local dev mnt etc wanted_dev wanted_dev="$(readlink -e -q $1)" while read dev mnt etc || [ -n "$dev" ]; do [ "$dev" = "$wanted_dev" ] && echo "$dev" && return 0 done < /proc/mounts return 1 } # usage: ismounted <mountpoint> # usage: ismounted /dev/<device> if command -v findmnt >/dev/null; then ismounted() { findmnt "$1" > /dev/null 2>&1 } else ismounted() { if [ -b "$1" ]; then find_mount "$1" > /dev/null && return 0 return 1 fi while read a m a || [ -n "$m" ]; do [ "$m" = "$1" ] && return 0 done < /proc/mounts return 1 } fi # clean up after ourselves no matter how we die. cleanup() { echo "Something failed. Move back to the original state" for dir in "$ROOT/bin" "$ROOT/sbin" "$ROOT/lib" "$ROOT/lib64" \ "$ROOT/usr/bin" "$ROOT/usr/sbin" "$ROOT/usr/lib" \ "$ROOT/usr/lib64"; do [[ -d "${dir}.usrmove-new" ]] && rm -fr -- "${dir}.usrmove-new" if [[ -d "${dir}.usrmove-old" ]]; then mv "$dir" "${dir}.del~" mv "${dir}.usrmove-old" "$dir" rm -fr -- "${dir}.del~" fi done } trap 'ret=$?; [[ $ret -ne 0 ]] && cleanup;exit $ret;' EXIT trap 'exit 1;' SIGINT ismounted "$ROOT/usr" || CP_HARDLINK="-l" set -e # merge / and /usr in new dir in /usr for dir in bin sbin lib lib64; do rm -rf -- "$ROOT/usr/${dir}.usrmove-new" [[ -L "$ROOT/$dir" ]] && continue [[ -d "$ROOT/$dir" ]] || continue echo "Make a copy of \`$ROOT/usr/$dir'." [[ -d "$ROOT/usr/$dir" ]] \ && cp -ax -l "$ROOT/usr/$dir" "$ROOT/usr/${dir}.usrmove-new" echo "Merge the copy with \`$ROOT/$dir'." [[ -d "$ROOT/usr/${dir}.usrmove-new" ]] \ || mkdir -p "$ROOT/usr/${dir}.usrmove-new" cp -axT $CP_HARDLINK --backup --suffix=.usrmove~ "$ROOT/$dir" "$ROOT/usr/${dir}.usrmove-new" echo "Clean up duplicates in \`$ROOT/usr/$dir'." # delete all symlinks that have been backed up find "$ROOT/usr/${dir}.usrmove-new" -type l -name '*.usrmove~' -delete || : # replace symlink with backed up binary find "$ROOT/usr/${dir}.usrmove-new" \ -name '*.usrmove~' \ -type f \ -exec bash -c 'p="{}";o=${p%%%%.usrmove~}; [[ -L "$o" ]] && mv -f "$p" "$o"' ';' || : done # switch over merged dirs in /usr for dir in bin sbin lib lib64; do [[ -d "$ROOT/usr/${dir}.usrmove-new" ]] || continue echo "Switch to new \`$ROOT/usr/$dir'." rm -fr -- "$ROOT/usr/${dir}.usrmove-old" mv "$ROOT/usr/$dir" "$ROOT/usr/${dir}.usrmove-old" mv "$ROOT/usr/${dir}.usrmove-new" "$ROOT/usr/$dir" done # replace dirs in / with links to /usr for dir in bin sbin lib lib64; do [[ -L "$ROOT/$dir" ]] && continue [[ -d "$ROOT/$dir" ]] || continue echo "Create \`$ROOT/$dir' symlink." rm -fr -- "$ROOT/${dir}.usrmove-old" || : mv "$ROOT/$dir" "$ROOT/${dir}.usrmove-old" ln -sfn usr/$dir "$ROOT/$dir" done echo "Clean up backup files." # everything seems to work; cleanup for dir in bin sbin lib lib64; do # if we get killed in the middle of "rm -rf", ensure not to leave # an incomplete directory, which is moved back by cleanup() [[ -d "$ROOT/usr/${dir}.usrmove-old" ]] \ && mv "$ROOT/usr/${dir}.usrmove-old" "$ROOT/usr/${dir}.usrmove-old~" [[ -d "$ROOT/${dir}.usrmove-old" ]] \ && mv "$ROOT/${dir}.usrmove-old" "$ROOT/${dir}.usrmove-old~" done for dir in bin sbin lib lib64; do [[ -d "$ROOT/usr/${dir}.usrmove-old~" ]] \ && rm -rf -- "$ROOT/usr/${dir}.usrmove-old~" || : [[ -d "$ROOT/${dir}.usrmove-old~" ]] \ && rm -rf -- "$ROOT/${dir}.usrmove-old~" || : done for dir in lib lib64; do [[ -d "$ROOT/$dir" ]] || continue for lib in "$ROOT"/usr/${dir}/lib*.so*.usrmove~; do [[ -f $lib ]] || continue mv $lib ${lib/.so/_so} done done set +e echo "Run ldconfig." ldconfig -r "$ROOT" . $ROOT/etc/selinux/config if [ -n "$(command -v setfiles)" ] && [ "$SELINUX" != "disabled" ] && [ -f /etc/selinux/${SELINUXTYPE}/contexts/files/file_contexts ]; then echo "Fixing SELinux labels" setfiles -r $ROOT -p /etc/selinux/${SELINUXTYPE}/contexts/files/file_contexts $ROOT/sbin $ROOT/bin $ROOT/lib $ROOT/lib64 $ROOT/usr/lib $ROOT/usr/lib64 $ROOT/etc/ld.so.cache $ROOT/var/cache/ldconfig || : fi echo "Done." exit 0 modules.d/30convertfs/do-convertfs.sh000075500000000302151701010110013540 0ustar00#!/bin/bash if getargbool 0 rd.convertfs; then if getargbool 0 rd.debug; then bash -x convertfs "$NEWROOT" 2>&1 | vinfo else convertfs "$NEWROOT" 2>&1 | vinfo fi fi modules.d/30convertfs/module-setup.sh000075500000000520151701010110013554 0ustar00#!/bin/bash # called by dracut check() { [[ $mount_needs ]] && return 1 return 255 } # called by dracut depends() { return 0 } # called by dracut install() { inst_multiple bash find ldconfig mv rm cp ln inst_hook pre-pivot 99 "$moddir/do-convertfs.sh" inst_script "$moddir/convertfs.sh" /usr/bin/convertfs } modules.d/45url-lib/module-setup.sh000075500000005753151701010110013134 0ustar00#!/bin/bash # module-setup for url-lib # called by dracut check() { require_binaries curl || return 1 return 255 } # called by dracut depends() { echo network return 0 } # called by dracut install() { local _dir _crt _found _lib _nssckbi _p11roots _p11root _p11item inst_simple "$moddir/url-lib.sh" "/lib/url-lib.sh" inst_multiple -o ctorrent inst_multiple curl # also install libs for curl https inst_libdir_file "libnsspem.so*" inst_libdir_file "libnsssysinit.so*" inst_libdir_file "libsoftokn3.so*" inst_libdir_file "libsqlite3.so*" for _dir in $libdirs; do [[ -d $_dir ]] || continue for _lib in $_dir/libcurl.so.*; do [[ -e $_lib ]] || continue [[ $_nssckbi ]] || _nssckbi=$(grep -F --binary-files=text -z libnssckbi $_lib) _crt=$(grep -F --binary-files=text -z .crt $_lib) [[ $_crt ]] || continue [[ $_crt == /*/* ]] || continue if ! inst "$_crt"; then dwarn "Couldn't install '$_crt' SSL CA cert bundle; HTTPS might not work." continue fi _found=1 done done # If we found no cert bundle files referenced in libcurl but we # *did* find a mention of libnssckbi (checked above), install it. # If its truly NSS libnssckbi, it includes its own trust bundle, # but if it's really p11-kit-trust.so, we need to find the dirs # where it will look for a trust bundle and install them too. if ! [[ $_found ]] && [[ $_nssckbi ]] ; then _found=1 inst_libdir_file "libnssckbi.so*" || _found= for _dir in $libdirs; do [[ -e $_dir/libnssckbi.so ]] || continue # this looks for directory-ish strings in the file for _p11roots in $(grep -o --binary-files=text "/[[:alpha:]][[:print:]]*" $_dir/libnssckbi.so) ; do # the string can be a :-separated list of dirs for _p11root in $(echo "$_p11roots" | tr ':' '\n') ; do # check if it's actually a directory (there are # several false positives in the results) [[ -d "$_p11root" ]] || continue # check if it has some specific subdirs that all # p11-kit trust dirs have [[ -d "${_p11root}/anchors" ]] || continue [[ -d "${_p11root}/blacklist" ]] || continue # so now we know it's really a p11-kit trust dir; # install everything in it for _p11item in $(find "$_p11root") ; do if ! inst "$_p11item" ; then dwarn "Couldn't install '$_p11item' from p11-kit trust dir '$_p11root'; HTTPS might not work." continue fi done done done done fi [[ $_found ]] || dwarn "Couldn't find SSL CA cert bundle or libnssckbi.so; HTTPS won't work." } modules.d/45url-lib/url-lib.sh000075500000011721151701010110012047 0ustar00#!/bin/sh # url-lib.sh - functions for handling URLs (file fetching etc.) # # Authors: # Will Woods <wwoods@redhat.com> type mkuniqdir >/dev/null 2>&1 || . /lib/dracut-lib.sh # fetch_url URL [OUTFILE] # fetch the given URL to a locally-visible location. # if OUTFILE is given, the URL will be fetched to that filename, # overwriting it if present. # If the URL is something mountable (e.g. nfs://) and no OUTFILE is given, # the server will be left mounted until pre-pivot. # the return values are as follows: # 0: success # 253: unknown error (file missing) # 254: unhandled URL scheme / protocol # 255: bad arguments / unparseable URLs # other: fetch command failure (whatever curl/mount/etc return) fetch_url() { local url="$1" outloc="$2" local handler="$(get_url_handler $url)" [ -n "$handler" ] || return 254 [ -n "$url" ] || return 255 "$handler" "$url" "$outloc" } # get_url_handler URL # returns the first HANDLERNAME corresponding to the URL's scheme get_url_handler() { local scheme="${1%%:*}" item="" for item in $url_handler_map; do [ "$scheme" = "${item%%:*}" ] && echo "${item#*:}" && return 0 done return 1 } # add_url_handler HANDLERNAME SCHEME [SCHEME...] # associate the named handler with the named scheme(s). add_url_handler() { local handler="$1"; shift local schemes="$@" scheme="" set -- for scheme in $schemes; do [ "$(get_url_handler $scheme)" = "$handler" ] && continue set -- "$@" "$scheme:$handler" done set -- $@ $url_handler_map # add new items to *front* of list url_handler_map="$@" } ### HTTP, HTTPS, FTP ################################################# export CURL_HOME="/run/initramfs/url-lib" mkdir -p $CURL_HOME curl_args="--globoff --location --retry 3 --fail --show-error" getargbool 0 rd.noverifyssl && curl_args="$curl_args --insecure" proxy=$(getarg proxy=) [ -n "$proxy" ] && curl_args="$curl_args --proxy $proxy" curl_fetch_url() { local url="$1" outloc="$2" echo "$url" > /proc/self/fd/0 if [ -n "$outloc" ]; then curl $curl_args --output - -- "$url" > "$outloc" || return $? else local outdir="$(mkuniqdir /tmp curl_fetch_url)" ( cd "$outdir"; curl $curl_args --remote-name "$url" || return $? ) outloc="$outdir/$(ls -A $outdir)" fi if ! [ -f "$outloc" ]; then warn "Downloading '$url' failed!" return 253 fi if [ -z "$2" ]; then echo "$outloc" ; fi } add_url_handler curl_fetch_url http https ftp tftp set_http_header() { echo "header = \"$1: $2\"" >> $CURL_HOME/.curlrc } ### TORRENT ########################################################## ctorrent_args="-E 0 -e 0" ctorrent_fetch_url() { local url="$1" outloc="$2" url=${url#*//} torrent_outloc="$outloc.torrent" echo "$url" > /proc/self/fd/0 if [ -n "$outloc" ]; then curl $curl_args --output - -- "$url" > "$torrent_outloc" || return $? else local outdir="$(mkuniqdir /tmp torrent_fetch_url)" ( cd "$outdir"; curl $curl_args --remote-name "$url" || return $? ) torrent_outloc="$outdir/$(ls -A $outdir)" outloc=${torrent_outloc%.*} fi if ! [ -f "$torrent_outloc" ]; then warn "Downloading '$url' failed!" return 253 fi ctorrent $ctorrent_args -s $outloc $torrent_outloc >&2 if ! [ -f "$outloc" ]; then warn "Torrent download of '$url' failed!" return 253 fi if [ -z "$2" ]; then echo "$outloc" ; fi } command -v ctorrent >/dev/null \ && add_url_handler ctorrent_fetch_url torrent ### NFS ############################################################## [ -e /lib/nfs-lib.sh ] && . /lib/nfs-lib.sh nfs_already_mounted() { local server="$1" path="$2" localdir="" s="" p="" cat /proc/mounts | while read src mnt rest || [ -n "$src" ]; do splitsep ":" "$src" s p p=${p%/} if [ "$server" = "$s" ]; then if [ "$path" = "$p" ]; then echo $mnt elif str_starts "$path" "$p"; then echo $mnt/${path#$p/} fi fi done } nfs_fetch_url() { local url="$1" outloc="$2" nfs="" server="" path="" options="" nfs_to_var "$url" || return 255 local filepath="${path%/*}" filename="${path##*/}" mntdir="" # skip mount if server:/filepath is already mounted mntdir=$(nfs_already_mounted "$server" "$filepath") if [ -z "$mntdir" ]; then local mntdir="$(mkuniqdir /run nfs_mnt)" mount_nfs "$nfs:$server:$filepath${options:+:$options}" "$mntdir" # lazy unmount during pre-pivot hook inst_hook --hook pre-pivot --name 99url-lib-umount-nfs-"$(basename "$mntdir")" umount -l -- "$mntdir" fi if [ -z "$outloc" ]; then outloc="$mntdir/$filename" else cp -f -- "$mntdir/$filename" "$outloc" || return $? fi [ -f "$outloc" ] || return 253 if [ -z "$2" ]; then echo "$outloc" ; fi } command -v nfs_to_var >/dev/null && add_url_handler nfs_fetch_url nfs nfs4 modules.d/50drm/module-setup.sh000075500000002514151701010110012334 0ustar00#!/bin/bash # called by dracut check() { return 255 } # called by dracut depends() { return 0 } # called by dracut installkernel() { local _modname # Include KMS capable drm drivers if [[ "$(uname -m)" == arm* || "$(uname -m)" == aarch64 ]]; then # arm/aarch64 specific modules needed by drm instmods \ "=drivers/gpu/drm/i2c" \ "=drivers/gpu/drm/panel" \ "=drivers/gpu/drm/bridge" \ "=drivers/video/backlight" \ ${NULL} fi instmods amdkfd hyperv_fb "=drivers/pwm" # if the hardware is present, include module even if it is not currently loaded, # as we could e.g. be in the installer; nokmsboot boot parameter will disable # loading of the driver if needed if [[ $hostonly ]]; then for i in /sys/bus/{pci/devices,virtio/devices,soc/devices/soc?}/*/modalias; do [[ -e $i ]] || continue if hostonly="" dracut_instmods --silent -s "drm_crtc_init|drm_dev_register" -S "iw_handler_get_spy" $(<$i); then if strstr "$(modinfo -F filename $(<$i) 2>/dev/null)" radeon.ko; then hostonly='' instmods amdkfd fi fi done else dracut_instmods -o -s "drm_crtc_init|drm_dev_register" "=drivers/gpu/drm" "=drivers/staging" fi } modules.d/50plymouth/module-setup.sh000075500000002334151701010110013433 0ustar00#!/bin/bash pkglib_dir() { local _dirs="/usr/lib/plymouth /usr/libexec/plymouth/" if find_binary dpkg-architecture &>/dev/null; then _dirs+=" /usr/lib/$(dpkg-architecture -qDEB_HOST_MULTIARCH)/plymouth" fi for _dir in $_dirs; do if [ -x $_dir/plymouth-populate-initrd ]; then echo $_dir return fi done } # called by dracut check() { [[ "$mount_needs" ]] && return 1 [ -z $(pkglib_dir) ] && return 1 require_binaries plymouthd plymouth plymouth-set-default-theme } # called by dracut depends() { echo drm } # called by dracut install() { PKGLIBDIR=$(pkglib_dir) if grep -q nash ${PKGLIBDIR}/plymouth-populate-initrd \ || [ ! -x ${PKGLIBDIR}/plymouth-populate-initrd ]; then . "$moddir"/plymouth-populate-initrd.sh else PLYMOUTH_POPULATE_SOURCE_FUNCTIONS="$dracutfunctions" \ ${PKGLIBDIR}/plymouth-populate-initrd -t "$initdir" fi inst_hook emergency 50 "$moddir"/plymouth-emergency.sh inst_multiple readlink 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 } modules.d/50plymouth/plymouth-emergency.sh000075500000000063151701010110014642 0ustar00#!/bin/sh plymouth --hide-splash 2>/dev/null || : modules.d/50plymouth/plymouth-newroot.sh000075500000000161151701010110014360 0ustar00#!/bin/sh if type plymouth >/dev/null 2>&1 && [ -z "$DRACUT_SYSTEMD" ]; then plymouth --newroot=$NEWROOT fi modules.d/50plymouth/plymouth-populate-initrd.sh000075500000002656151701010110016016 0ustar00#!/bin/bash PLYMOUTH_LOGO_FILE="/usr/share/pixmaps/system-logo-white.png" PLYMOUTH_THEME=$(plymouth-set-default-theme) inst_multiple plymouthd plymouth \ /etc/system-release test -e "${PLYMOUTH_LOGO_FILE}" && inst_simple "${PLYMOUTH_LOGO_FILE}" mkdir -m 0755 -p "${initdir}/usr/share/plymouth" inst_libdir_file "plymouth/text.so" "plymouth/details.so" if [[ $hostonly ]]; then inst_multiple \ "/usr/share/plymouth/themes/details/details.plymouth" \ "/usr/share/plymouth/themes/text/text.plymouth" \ if [[ -d /usr/share/plymouth/themes/${PLYMOUTH_THEME} ]]; then for x in "/usr/share/plymouth/themes/${PLYMOUTH_THEME}"/* ; do [[ -f "$x" ]] || break inst $x done fi if [ -L /usr/share/plymouth/themes/default.plymouth ]; then inst /usr/share/plymouth/themes/default.plymouth # Install plugin for this theme PLYMOUTH_PLUGIN=$(grep "^ModuleName=" /usr/share/plymouth/themes/default.plymouth | while read a b c || [ -n "$b" ]; do echo $b; done;) inst_libdir_file "plymouth/${PLYMOUTH_PLUGIN}.so" fi else for x in /usr/share/plymouth/themes/{text,details}/* ; do [[ -f "$x" ]] || continue THEME_DIR=$(dirname "$x") mkdir -m 0755 -p "${initdir}/$THEME_DIR" inst_multiple "$x" done ( cd ${initdir}/usr/share/plymouth/themes; ln -s text/text.plymouth default.plymouth 2>&1; ) fi modules.d/50plymouth/plymouth-pretrigger.sh000075500000002231151701010110015035 0ustar00#!/bin/sh if type plymouthd >/dev/null 2>&1 && [ -z "$DRACUT_SYSTEMD" ]; then if getargbool 1 plymouth.enable && getargbool 1 rd.plymouth -d -n rd_NO_PLYMOUTH; then # first trigger graphics subsystem udevadm trigger --action=add --attr-match=class=0x030000 >/dev/null 2>&1 # first trigger graphics and tty subsystem udevadm trigger --action=add \ --subsystem-match=graphics \ --subsystem-match=drm \ --subsystem-match=tty \ --subsystem-match=acpi \ >/dev/null 2>&1 udevadm settle --timeout=180 2>&1 | vinfo info "Starting plymouth daemon" mkdir -m 0755 /run/plymouth read consoledev rest < /sys/class/tty/console/active consoledev=${consoledev:-tty0} [ -x /lib/udev/console_init -a -e "/dev/$consoledev" ] && /lib/udev/console_init "/dev/$consoledev" plymouthd --attach-to-session --pid-file /run/plymouth/pid plymouth --show-splash 2>&1 | vinfo # reset tty after plymouth messed with it [ -x /lib/udev/console_init -a -e "/dev/$consoledev" ] && /lib/udev/console_init "/dev/$consoledev" fi fi modules.d/80lvmmerge/README.md000064400000004055151701010110011672 0ustar00# lvmmerge - dracut module ## Preparation - ensure that the lvm thin pool is big enough - backup any (most likely /boot and /boot/efi) device with: ``` # mkdir /restoredev # dev=<device>; umount $dev; dd if="$dev" of=/restoredev/$(systemd-escape -p "$dev"); mount $dev ``` - backup the MBR ``` # dev=<device>; dd if="$dev" of=/restoredev/$(systemd-escape -p "$dev") bs=446 count=1 # ls -l /dev/disk/by-path/virtio-pci-0000\:00\:07.0 lrwxrwxrwx. 1 root root 9 Jul 24 04:27 /dev/disk/by-path/virtio-pci-0000:00:07.0 -> ../../vda ``` - backup some partitions ``` # dev=/dev/disk/by-path/virtio-pci-0000:00:07.0 # dd if="$dev" of=/restoredev/$(systemd-escape -p "$dev") bs=446 count=1 # umount /boot/efi # dev=/dev/disk/by-partuuid/687177a8-86b3-4e37-a328-91d20db9563c # dd if="$dev" of=/restoredev/$(systemd-escape -p "$dev") # umount /boot # dev=/dev/disk/by-partuuid/4fdf99e9-4f28-4207-a26f-c76546824eaf # dd if="$dev" of=/restoredev/$(systemd-escape -p "$dev") ``` Final /restoredev ``` # ls -al /restoredev/ total 1253380 drwx------. 2 root root 250 Jul 24 04:38 . dr-xr-xr-x. 18 root root 242 Jul 24 04:32 .. -rw-------. 1 root root 209715200 Jul 24 04:34 dev-disk-by\x2dpartuuid-4fdf99e9\x2d4f28\x2d4207\x2da26f\x2dc76546824eaf -rw-------. 1 root root 1073741824 Jul 24 04:34 dev-disk-by\x2dpartuuid-687177a8\x2d86b3\x2d4e37\x2da328\x2d91d20db9563c -rw-------. 1 root root 446 Jul 24 04:38 dev-disk-by\x2dpath-virtio\x2dpci\x2d0000:00:07.0 ``` - make a thin snapshot ``` # lvm lvcreate -pr -s rhel/root --name reset ``` - mark the snapshot with a tag ``` # lvm lvchange --addtag reset rhel/reset ``` - remove /restoredev ``` # rm -fr /restoredev ``` ## Operation If a boot entry with ```rd.lvm.mergetags=<tag>``` is selected and there are LVs with ```<tag>``` dracut will - make a copy of the snapshot - merge it back to the original - rename the copy back to the name of the snapshot - if /restordev appears in the root, then it will restore the images found in that directory. This can be used to restore /boot and /boot/efi and the MBR of the boot device modules.d/80lvmmerge/lvmmerge.sh000075500000006017151701010110012570 0ustar00#!/bin/bash type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh do_merge() { sed -i -e 's/\(^[[:space:]]*\)locking_type[[:space:]]*=[[:space:]]*[[:digit:]]/\1locking_type = 1/' \ /etc/lvm/lvm.conf systemctl --no-block stop sysroot.mount swapoff -a umount -R /sysroot for tag in $(getargs rd.lvm.mergetags); do lvm vgs --noheadings -o vg_name | \ while read -r vg || [[ -n $vg ]]; do unset LVS declare -a LVS lvs=$(lvm lvs --noheadings -o lv_name "$vg") for lv in $lvs; do lvm lvchange -an "$vg/$lv" tags=$(trim "$(lvm lvs --noheadings -o lv_tags "$vg/$lv")") strstr ",${tags}," ",${tag}," || continue if ! lvm lvs --noheadings -o lv_name "${vg}/${lv}_dracutsnap" &>/dev/null; then info "Creating backup ${lv}_dracutsnap of ${vg}/${lv}" lvm lvcreate -pr -s "${vg}/${lv}" --name "${lv}_dracutsnap" fi lvm lvchange --addtag "$tag" "${vg}/${lv}_dracutsnap" info "Merging back ${vg}/${lv} to the original LV" lvm lvconvert --merge "${vg}/${lv}" LVS+=($lv) done systemctl --no-block stop sysroot.mount udevadm settle for ((i=0; i < 100; i++)); do lvm vgchange -an "$vg" && break sleep 0.5 done udevadm settle lvm vgchange -ay "$vg" udevadm settle for lv in "${LVS[@]}"; do info "Renaming ${lv}_dracutsnap backup to ${vg}/${lv}" lvm lvrename "$vg" "${lv}_dracutsnap" "${lv}" done udevadm settle done done systemctl --no-block reset-failed systemd-fsck-root systemctl --no-block start systemd-fsck-root systemctl --no-block reset-failed sysroot.mount systemctl --no-block start sysroot.mount for ((i=0; i < 100; i++)); do [[ -d /sysroot/dev ]] && break sleep 0.5 systemctl --no-block start sysroot.mount done if [[ -d /sysroot/restoredev ]]; then ( if cd /sysroot/restoredev; then # restore devices and partitions for i in *; do target=$(systemd-escape -pu "$i") if ! [[ -b $target ]]; then warn "Not restoring $target, as the device does not exist" continue fi # Just in case umount "$target" &> /dev/null info "Restoring $target" dd if="$i" of="$target" |& vinfo done fi ) mount -o remount,rw /sysroot rm -fr /sysroot/restoredev fi info "Rebooting" reboot } if getarg rd.lvm.mergetags; then do_merge fi modules.d/80lvmmerge/module-setup.sh000075500000000650151701010110013372 0ustar00#!/bin/bash # called by dracut check() { # No point trying to support lvm if the binaries are missing require_binaries lvm dd swapoff || return 1 return 255 } # called by dracut depends() { echo lvm dracut-systemd systemd return 0 } installkernel() { hostonly="" instmods dm-snapshot } # called by dracut install() { inst_multiple dd swapoff inst_hook cleanup 01 "$moddir/lvmmerge.sh" } modules.d/80lvmthinpool-monitor/module-setup.sh000075500000001100151701010110015603 0ustar00#!/bin/bash # called by dracut check() { # No point trying to support lvm if the binaries are missing require_binaries lvm sort tr awk || return 1 return 255 } # called by dracut depends() { echo lvm return 0 } # called by dracut install() { inst_multiple sort tr awk inst_script "$moddir/start-thinpool-monitor.sh" "/bin/start-thinpool-monitor" inst "$moddir/start-thinpool-monitor.service" "$systemdsystemunitdir/start-thinpool-monitor.service" systemctl -q --root "$initdir" add-wants initrd.target start-thinpool-monitor.service } modules.d/80lvmthinpool-monitor/start-thinpool-monitor.service000064400000000506151701010110020670 0ustar00[Unit] Description=Lvm thinpool monitor service Before=initrd.target After=initrd-fs.target Conflicts=shutdown.target emergency.target [Service] Type=forking ExecStart=/bin/start-thinpool-monitor PIDFile=/run/thinpool-moni.pid StandardInput=null StandardOutput=journal+console StandardError=journal+console KillSignal=SIGHUP modules.d/80lvmthinpool-monitor/start-thinpool-monitor.sh000075500000002402151701010110017642 0ustar00#!/bin/sh type getarg > /dev/null 2>&1 || . /lib/dracut-lib.sh LVS=$(getargs rd.lvm.lv -d rd_LVM_LV=) is_lvm2_thinp_device() { _device_path=$1 _lvm2_thin_device=$(lvm lvs -S 'lv_layout=sparse && lv_layout=thin' \ --nosuffix --noheadings -o vg_name,lv_name "$_device_path" 2> /dev/null) [ -n "$_lvm2_thin_device" ] && return $? } for LV in $LVS; do if is_lvm2_thinp_device "/dev/$LV"; then THIN_POOLS="$(lvm lvs -S 'lv_layout=sparse && lv_layout=thin' \ --nosuffix --noheadings -o vg_name,pool_lv "$LV" \ | awk '{printf("%s/%s",$1,$2);}') $THIN_POOLS" fi done THIN_POOLS=$(echo "$THIN_POOLS" | tr ' ' '\n' | sort -u | tr '\n' ' ') if [ -n "$THIN_POOLS" ]; then if [ -e "/etc/lvm/lvm.conf" ]; then # Use 'monitoring=0' to override the value in lvm.conf, in case # dmeventd monitoring been started after the calling. CONFIG="activation {monitoring=0}" else CONFIG="activation {monitoring=0 thin_pool_autoextend_threshold=70 thin_pool_autoextend_percent=20}" fi while true; do for THIN_POOL in $THIN_POOLS; do lvm lvextend --use-policies --config "$CONFIG" "$THIN_POOL" done sleep 5 done & echo $! > /run/thinpool-moni.pid fi modules.d/90btrfs/80-btrfs.rules000064400000000416151701010110012334 0ustar00SUBSYSTEM!="block", GOTO="btrfs_end" ACTION!="add|change", GOTO="btrfs_end" ENV{ID_FS_TYPE}!="btrfs", GOTO="btrfs_end" RUN+="/sbin/btrfs device scan $env{DEVNAME}" RUN+="/sbin/initqueue --finished --unique --name btrfs_finished /sbin/btrfs_finished" LABEL="btrfs_end" modules.d/90btrfs/btrfs_device_ready.sh000075500000000723151701010110014076 0ustar00#!/bin/sh type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh btrfs_check_complete() { local _rootinfo _dev _dev="${1:-/dev/root}" [ -e "$_dev" ] || return 0 _rootinfo=$(udevadm info --query=env "--name=$_dev" 2>/dev/null) if strstr "$_rootinfo" "ID_FS_TYPE=btrfs"; then info "Checking, if btrfs device complete" btrfs device ready "$_dev" >/dev/null 2>&1 return $? fi return 0 } btrfs_check_complete $1 exit $? modules.d/90btrfs/btrfs_finished.sh000075500000001125151701010110013241 0ustar00#!/bin/sh type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh btrfs_check_complete() { local _rootinfo _dev _dev="${1:-/dev/root}" [ -e "$_dev" ] || return 0 _rootinfo=$(udevadm info --query=env "--name=$_dev" 2>/dev/null) if strstr "$_rootinfo" "ID_FS_TYPE=btrfs"; then info "Checking, if btrfs device complete" unset __btrfs_mount mount -o ro "$_dev" /tmp >/dev/null 2>&1 __btrfs_mount=$? [ $__btrfs_mount -eq 0 ] && umount "$_dev" >/dev/null 2>&1 return $__btrfs_mount fi return 0 } btrfs_check_complete $1 exit $? modules.d/90btrfs/btrfs_timeout.sh000075500000000216151701010110013136 0ustar00#!/bin/sh type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh info "Scanning for all btrfs devices" /sbin/btrfs device scan >/dev/null 2>&1 modules.d/90btrfs/module-setup.sh000075500000002326151701010110012677 0ustar00#!/bin/bash # called by dracut check() { local _rootdev # if we don't have btrfs installed on the host system, # no point in trying to support it in the initramfs. require_binaries btrfs || return 1 [[ $hostonly ]] || [[ $mount_needs ]] && { for fs in "${host_fs_types[@]}"; do [[ "$fs" == "btrfs" ]] && return 0 done return 255 } return 0 } # called by dracut depends() { echo udev-rules return 0 } # called by dracut installkernel() { instmods btrfs # Make sure btfs can use fast crc32c implementations where available (bsc#1011554) instmods crc32c-intel } # called by dracut install() { if ! inst_rules 64-btrfs.rules; then inst_rules "$moddir/80-btrfs.rules" case "$(btrfs --help)" in *device\ ready*) inst_script "$moddir/btrfs_device_ready.sh" /sbin/btrfs_finished ;; *) inst_script "$moddir/btrfs_finished.sh" /sbin/btrfs_finished ;; esac fi if ! dracut_module_included "systemd"; then inst_hook initqueue/timeout 10 "$moddir/btrfs_timeout.sh" fi inst_multiple -o btrfsck btrfs-zero-log inst $(command -v btrfs) /sbin/btrfs } modules.d/90crypt/crypt-cleanup.sh000075500000000672151701010110013065 0ustar00#!/bin/sh # close everything which is not busy rm -f -- /etc/udev/rules.d/70-luks.rules >/dev/null 2>&1 if ! getarg rd.luks.uuid -d rd_LUKS_UUID >/dev/null 2>&1 && getargbool 1 rd.luks -d -n rd_NO_LUKS >/dev/null 2>&1; then while true; do local do_break="y" for i in /dev/mapper/luks-*; do cryptsetup luksClose $i >/dev/null 2>&1 && do_break=n done [ "$do_break" = "y" ] && break done fi modules.d/90crypt/crypt-lib.sh000075500000016743151701010110012212 0ustar00#!/bin/sh command -v getarg >/dev/null || . /lib/dracut-lib.sh # check if the crypttab contains an entry for a LUKS UUID crypttab_contains() { local luks="$1" local dev="$2" local l d rest if [ -f /etc/crypttab ]; then while read l d rest || [ -n "$l" ]; do strstr "${l##luks-}" "${luks##luks-}" && return 0 strstr "$d" "${luks##luks-}" && return 0 if [ -n "$dev" ]; then for _dev in $(devnames $d); do [ "$dev" -ef "$_dev" ] && return 0 done fi if [ -e /etc/block_uuid.map ]; then # search for line starting with $d _line=$(sed -n "\,^$d .*$,{p}" /etc/block_uuid.map) [ -z "$_line" ] && continue # get second column with uuid _uuid="$(echo $_line | sed 's,^.* \(.*$\),\1,')" strstr "$_uuid" "${luks##luks-}" && return 0 fi done < /etc/crypttab fi return 1 } # ask_for_password # # Wraps around plymouth ask-for-password and adds fallback to tty password ask # if plymouth is not present. # # --cmd command # Command to execute. Required. # --prompt prompt # Password prompt. Note that function already adds ':' at the end. # Recommended. # --tries n # How many times repeat command on its failure. Default is 3. # --ply-[cmd|prompt|tries] # Command/prompt/tries specific for plymouth password ask only. # --tty-[cmd|prompt|tries] # Command/prompt/tries specific for tty password ask only. # --tty-echo-off # Turn off input echo before tty command is executed and turn on after. # It's useful when password is read from stdin. ask_for_password() { local cmd; local prompt; local tries=3 local ply_cmd; local ply_prompt; local ply_tries=3 local tty_cmd; local tty_prompt; local tty_tries=3 local ret while [ $# -gt 0 ]; do case "$1" in --cmd) ply_cmd="$2"; tty_cmd="$2"; shift;; --ply-cmd) ply_cmd="$2"; shift;; --tty-cmd) tty_cmd="$2"; shift;; --prompt) ply_prompt="$2"; tty_prompt="$2"; shift;; --ply-prompt) ply_prompt="$2"; shift;; --tty-prompt) tty_prompt="$2"; shift;; --tries) ply_tries="$2"; tty_tries="$2"; shift;; --ply-tries) ply_tries="$2"; shift;; --tty-tries) tty_tries="$2"; shift;; --tty-echo-off) tty_echo_off=yes;; esac shift done { 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 local i=1 while [ $i -le $tty_tries ]; do [ -n "$tty_prompt" ] && \ printf "$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 } 9>/.console_lock [ $ret -ne 0 ] && echo "Wrong password" >&2 return $ret } # Try to mount specified device (by path, by UUID or by label) and check # the path with 'test'. # # example: # test_dev -f LABEL="nice label" /some/file1 test_dev() { local test_op=$1; local dev="$2"; local f="$3" local ret=1; local mount_point=$(mkuniqdir /mnt testdev) local path [ -n "$dev" -a -n "$*" ] || return 1 [ -d "$mount_point" ] || die 'Mount point does not exist!' if mount -r "$dev" "$mount_point" >/dev/null 2>&1; then test $test_op "${mount_point}/${f}" ret=$? umount "$mount_point" fi rmdir "$mount_point" return $ret } # match_dev devpattern dev # # Returns true if 'dev' matches 'devpattern'. Both 'devpattern' and 'dev' are # expanded to kernel names and then compared. If name of 'dev' is on list of # names of devices matching 'devpattern', the test is positive. 'dev' and # 'devpattern' may be anything which function 'devnames' recognizes. # # If 'devpattern' is empty or '*' then function just returns true. # # Example: # match_dev UUID=123 /dev/dm-1 # Returns true if /dev/dm-1 UUID starts with "123". match_dev() { [ -z "$1" -o "$1" = '*' ] && return 0 local devlist; local dev devlist="$(devnames "$1")" || return 255 dev="$(devnames "$2")" || return 255 strstr " $devlist " " $dev " } # getkey keysfile for_dev # # Reads file <keysfile> produced by probe-keydev and looks for first line to # which device <for_dev> matches. The successful result is printed in format # "<keydev>:<keypath>". When nothing found, just false is returned. # # Example: # getkey /tmp/luks.keys /dev/sdb1 # May print: # /dev/sdc1:/keys/some.key getkey() { local keys_file="$1"; local for_dev="$2" local luks_dev; local key_dev; local key_path [ -z "$keys_file" -o -z "$for_dev" ] && die 'getkey: wrong usage!' [ -f "$keys_file" ] || return 1 local IFS=: while read luks_dev key_dev key_path || [ -n "$luks_dev" ]; do if match_dev "$luks_dev" "$for_dev"; then echo "${key_dev}:${key_path}" return 0 fi done < "$keys_file" return 1 } # readkey keypath keydev device # # Mounts <keydev>, reads key from file <keypath>, optionally processes it (e.g. # if encrypted with GPG) and prints to standard output which is supposed to be # read by cryptsetup. <device> is just passed to helper function for # informational purpose. readkey() { local keypath="$1" local keydev="$2" local device="$3" # No mounting needed if the keyfile resides inside the initrd if [ "/" == "$keydev" ]; then local mntp=/ else # This creates a unique single mountpoint for *, or several for explicitly # given LUKS devices. It accomplishes unlocking multiple LUKS devices with # a single password entry. local mntp="/mnt/$(str_replace "keydev-$keydev-$keypath" '/' '-')" if [ ! -d "$mntp" ]; then mkdir "$mntp" mount -r "$keydev" "$mntp" || die 'Mounting rem. dev. failed!' fi fi case "${keypath##*.}" in gpg) if [ -f /lib/dracut-crypt-gpg-lib.sh ]; then . /lib/dracut-crypt-gpg-lib.sh gpg_decrypt "$mntp" "$keypath" "$keydev" "$device" else die "No GPG support to decrypt '$keypath' on '$keydev'." fi ;; img) if [ -f /lib/dracut-crypt-loop-lib.sh ]; then . /lib/dracut-crypt-loop-lib.sh loop_decrypt "$mntp" "$keypath" "$keydev" "$device" printf "%s\n" "umount \"$mntp\"; rmdir \"$mntp\";" > ${hookdir}/cleanup/"crypt-loop-cleanup-99-${mntp##*/}".sh return 0 else die "No loop file support to decrypt '$keypath' on '$keydev'." fi ;; *) cat "$mntp/$keypath" ;; esac # No unmounting if the keyfile resides inside the initrd if [ "/" != "$keydev" ]; then # General unmounting mechanism, modules doing custom cleanup should return earlier # and install a pre-pivot cleanup hook umount "$mntp" rmdir "$mntp" fi } modules.d/90crypt/crypt-run-generator.sh000075500000001402151701010110014216 0ustar00#!/bin/sh . /lib/dracut-lib.sh type crypttab_contains >/dev/null 2>&1 || . /lib/dracut-crypt-lib.sh dev=$1 luks=$2 crypttab_contains "$luks" "$dev" && exit 0 allowdiscards="-" # parse for allow-discards 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 allowdiscards="discard" fi elif getargbool 0 rd.luks.allow-discards; then allowdiscards="discard" fi 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 modules.d/90crypt/cryptroot-ask.sh000075500000011406151701010110013115 0ustar00#!/bin/sh PATH=/usr/sbin:/usr/bin:/sbin:/bin NEWROOT=${NEWROOT:-"/sysroot"} # do not ask, if we already have root [ -f $NEWROOT/proc ] && exit 0 . /lib/dracut-lib.sh # if device name is /dev/dm-X, convert to /dev/mapper/name if [ "${1##/dev/dm-}" != "$1" ]; then device="/dev/mapper/$(dmsetup info -c --noheadings -o name "$1")" else device="$1" fi # default luksname - luks-UUID luksname=$2 # number of tries numtries=${3:-10} # TODO: improve to support what cmdline does if [ -f /etc/crypttab ] && getargbool 1 rd.luks.crypttab -d -n rd_NO_CRYPTTAB; then while read name dev luksfile luksoptions || [ -n "$name" ]; do # ignore blank lines and comments if [ -z "$name" -o "${name#\#}" != "$name" ]; then continue fi # PARTUUID used in crypttab if [ "${dev%%=*}" = "PARTUUID" ]; then if [ "luks-${dev##PARTUUID=}" = "$luksname" ]; then luksname="$name" break fi # UUID used in crypttab elif [ "${dev%%=*}" = "UUID" ]; then if [ "luks-${dev##UUID=}" = "$luksname" ]; then luksname="$name" break fi # ID used in crypttab elif [ "${dev%%=*}" = "ID" ]; then if [ "luks-${dev##ID=}" = "$luksname" ]; then luksname="$name" break fi # path used in crypttab else cdev=$(readlink -f $dev) mdev=$(readlink -f $device) if [ "$cdev" = "$mdev" ]; then luksname="$name" break fi fi done < /etc/crypttab unset name dev fi # check if destination already exists [ -b /dev/mapper/$luksname ] && exit 0 # we already asked for this device asked_file=/tmp/cryptroot-asked-$luksname [ -f $asked_file ] && exit 0 # load dm_crypt if it is not already loaded [ -d /sys/module/dm_crypt ] || modprobe dm_crypt . /lib/dracut-crypt-lib.sh # # Open LUKS device # info "luksOpen $device $luksname $luksfile $luksoptions" OLD_IFS="$IFS" IFS=, set -- $luksoptions IFS="$OLD_IFS" while [ $# -gt 0 ]; do case $1 in noauto) # skip this exit 0 ;; swap) # skip this exit 0 ;; tmp) # skip this exit 0 ;; allow-discards) allowdiscards="--allow-discards" ;; header=*) cryptsetupopts="${cryptsetupopts} --${1}" ;; esac shift done # parse for allow-discards if strstr "$(cryptsetup --help)" "allow-discards"; then if discarduuids=$(getargs "rd.luks.allow-discards"); then discarduuids=$(str_replace "$discarduuids" 'luks-' '') if strstr " $discarduuids " " ${luksdev##luks-}"; then allowdiscards="--allow-discards" fi elif getargbool 0 rd.luks.allow-discards; then allowdiscards="--allow-discards" fi fi if strstr "$(cryptsetup --help)" "allow-discards"; then cryptsetupopts="$cryptsetupopts $allowdiscards" fi unset allowdiscards # fallback to passphrase ask_passphrase=1 if [ -n "$luksfile" -a "$luksfile" != "none" -a -e "$luksfile" ]; then if cryptsetup --key-file "$luksfile" $cryptsetupopts luksOpen "$device" "$luksname"; then ask_passphrase=0 fi else while [ -n "$(getarg rd.luks.key)" ]; do if tmp=$(getkey /tmp/luks.keys $device); then keydev="${tmp%%:*}" keypath="${tmp#*:}" else if [ $numtries -eq 0 ]; then warn "No key found for $device. Fallback to passphrase mode." break fi sleep 1 info "No key found for $device. Will try $numtries time(s) more later." initqueue --unique --onetime --settled \ --name cryptroot-ask-$luksname \ $(command -v cryptroot-ask) "$device" "$luksname" "$(($numtries-1))" exit 0 fi unset tmp info "Using '$keypath' on '$keydev'" readkey "$keypath" "$keydev" "$device" \ | cryptsetup -d - $cryptsetupopts luksOpen "$device" "$luksname" unset keypath keydev ask_passphrase=0 break done fi if [ $ask_passphrase -ne 0 ]; then luks_open="$(command -v cryptsetup) $cryptsetupopts luksOpen" _timeout=$(getargs "rd.luks.timeout") _timeout=${_timeout:-0} ask_for_password --ply-tries 5 \ --ply-cmd "$luks_open -T1 $device $luksname" \ --ply-prompt "Password ($device)" \ --tty-tries 1 \ --tty-cmd "$luks_open -T5 -t $_timeout $device $luksname" unset luks_open unset _timeout fi unset device luksname luksfile # mark device as asked >> $asked_file need_shutdown udevsettle exit 0 modules.d/90crypt/module-setup.sh000075500000011154151701010110012717 0ustar00#!/bin/bash # called by dracut check() { local _rootdev # if cryptsetup is not installed, then we cannot support encrypted devices. require_any_binary $systemdutildir/systemd-cryptsetup cryptsetup || return 1 [[ $hostonly ]] || [[ $mount_needs ]] && { for fs in "${host_fs_types[@]}"; do [[ $fs = "crypto_LUKS" ]] && return 0 done return 255 } return 0 } # called by dracut depends() { echo dm rootfs-block return 0 } # called by dracut installkernel() { hostonly="" instmods drbg arch=$(arch) [[ $arch == x86_64 ]] && arch=x86 [[ $arch == s390x ]] && arch=s390 instmods dm_crypt =crypto =drivers/crypto =arch/$arch/crypto } # called by dracut cmdline() { local dev UUID for dev in "${!host_fs_types[@]}"; do [[ "${host_fs_types[$dev]}" != "crypto_LUKS" ]] && continue UUID=$( blkid -u crypto -o export $dev \ | while read line || [ -n "$line" ]; do [[ ${line#UUID} = $line ]] && continue printf "%s" "${line#UUID=}" break done ) [[ ${UUID} ]] || continue printf "%s" " rd.luks.uuid=luks-${UUID}" done } # called by dracut install() { if [[ $hostonly_cmdline == "yes" ]]; then local _cryptconf=$(cmdline) [[ $_cryptconf ]] && printf "%s\n" "$_cryptconf" >> "${initdir}/etc/cmdline.d/90crypt.conf" 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 if [[ $hostonly ]] && [[ -f /etc/crypttab ]]; then # filter /etc/crypttab for the devices we need while read _mapper _dev _luksfile _luksoptions || [ -n "$_mapper" ]; do [[ $_mapper = \#* ]] && continue [[ $_dev ]] || continue [[ $_dev == PARTUUID=* ]] && \ _dev="/dev/disk/by-partuuid/${_dev#PARTUUID=}" [[ $_dev == UUID=* ]] && \ _dev="/dev/disk/by-uuid/${_dev#UUID=}" [[ $_dev == ID=* ]] && \ _dev="/dev/disk/by-id/${_dev#ID=}" echo "$_dev $(blkid $_dev -s UUID -o value)" >> "${initdir}/etc/block_uuid.map" # loop through the options to check for the force option luksoptions=${_luksoptions} OLD_IFS="${IFS}" IFS=, set -- ${luksoptions} IFS="${OLD_IFS}" while [ $# -gt 0 ]; do case $1 in force) forceentry="yes" break ;; esac shift done # include the entry regardless if [ "${forceentry}" = "yes" ]; then echo "$_mapper $_dev $_luksfile $_luksoptions" else for _hdev in "${!host_fs_types[@]}"; do [[ ${host_fs_types[$_hdev]} == "crypto_LUKS" ]] || continue if [[ $_hdev -ef $_dev ]] || [[ /dev/block/$_hdev -ef $_dev ]]; then echo "$_mapper $_dev $_luksfile $_luksoptions" break fi done fi done < /etc/crypttab > $initdir/etc/crypttab mark_hostonly /etc/crypttab fi inst_simple "$moddir/crypt-lib.sh" "/lib/dracut-crypt-lib.sh" if dracut_module_included "systemd"; then # the cryptsetup targets are already pulled in by 00systemd, but not # the enablement symlinks inst_multiple -o \ $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 inst_script "$moddir"/crypt-run-generator.sh /sbin/crypt-run-generator fi dracut_need_initqueue } modules.d/90crypt/parse-crypt.sh000075500000015741151701010110012553 0ustar00#!/bin/sh type crypttab_contains >/dev/null 2>&1 || . /lib/dracut-crypt-lib.sh _cryptgetargsname() { debug_off local _o _found _key unset _o unset _found CMDLINE=$(getcmdline) _key="$1" set -- for _o in $CMDLINE; do if [ "$_o" = "$_key" ]; then _found=1; elif [ "${_o%=*}" = "${_key%=}" ]; then [ -n "${_o%=*}" ] && set -- "$@" "${_o#*=}"; _found=1; fi done if [ -n "$_found" ]; then [ $# -gt 0 ] && printf '%s' "$*" return 0 fi return 1; } if ! getargbool 1 rd.luks -d -n rd_NO_LUKS; then info "rd.luks=0: removing cryptoluks activation" rm -f -- /etc/udev/rules.d/70-luks.rules else { echo 'SUBSYSTEM!="block", GOTO="luks_end"' echo 'ACTION!="add|change", GOTO="luks_end"' } > /etc/udev/rules.d/70-luks.rules.new PARTUUID=$(getargs rd.luks.partuuid -d rd_LUKS_PARTUUID) SERIAL=$(getargs rd.luks.serial -d rd_LUKS_SERIAL) 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 uuid=${uuid##luks-} if luksname=$(_cryptgetargsname "rd.luks.name=$uuid="); then luksname="${luksname#$uuid=}" 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)" printf -- '$env{DEVNAME} %s %s"\n' "$luksname" "$tout" } >> /etc/udev/rules.d/70-luks.rules.new else luksname=$(dev_unit_name "$luksname") 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 done elif [ -n "$SERIAL" ]; then for serialid in $SERIAL; do serialid=${serialid##luks-} if luksname=$(_cryptgetargsname "rd.luks.name=$serialid="); then luksname="${luksname#$serialid=}" 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)" printf -- '$env{DEVNAME} %s %s"\n' "$luksname" "$tout" } >> /etc/udev/rules.d/70-luks.rules.new else luksname=$(dev_unit_name "$luksname") 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 done elif [ -n "$LUKS" ]; then for luksid in $LUKS; do luksid=${luksid##luks-} if luksname=$(_cryptgetargsname "rd.luks.name=$luksid="); then luksname="${luksname#$luksid=}" 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)" printf -- '$env{DEVNAME} %s %s"\n' "$luksname" "$tout" } >> /etc/udev/rules.d/70-luks.rules.new else luksname=$(dev_unit_name "$luksname") 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 uuid=$luksid while [ "$uuid" != "${uuid#*-}" ]; do uuid=${uuid%%-*}${uuid#*-}; done printf -- '[ -e /dev/disk/by-id/dm-uuid-CRYPT-LUKS?-*%s*-* ] || exit 1\n' $uuid \ >> "$hookdir/initqueue/finished/90-crypt.sh" { printf -- '[ -e /dev/disk/by-uuid/*%s* ] || ' $luksid printf -- 'warn "crypto LUKS UUID "%s" not found"\n' $luksid } >> "$hookdir/emergency/90-crypt.sh" 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 ' 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 ' printf -- '%s $env{DEVNAME} luks-$env{ID_FS_UUID}"\n' "$(command -v crypt-run-generator)" } >> /etc/udev/rules.d/70-luks.rules.new fi fi echo 'LABEL="luks_end"' >> /etc/udev/rules.d/70-luks.rules.new mv /etc/udev/rules.d/70-luks.rules.new /etc/udev/rules.d/70-luks.rules fi modules.d/90crypt/parse-keydev.sh000075500000002541151701010110012673 0ustar00#!/bin/sh if getargbool 1 rd.luks -n rd_NO_LUKS && \ [ -n "$(getarg rd.luks.key)" ]; then exec 7>/etc/udev/rules.d/65-luks-keydev.rules echo 'SUBSYSTEM!="block", GOTO="luks_keydev_end"' >&7 echo 'ACTION!="add|change", GOTO="luks_keydev_end"' >&7 for arg in $(getargs rd.luks.key); do unset keypath keydev luksdev splitsep : "$arg" keypath keydev luksdev info "rd.luks.key: keypath='$keypath' keydev='$keydev' luksdev='$luksdev'" if [ -z "$keypath" ]; then warn 'keypath required!' continue fi # A keydev of '/' is treated as the initrd itself if [ "/" == "$keydev" ]; then [ -z "$luksdev" ] && luksdev='*' echo "$luksdev:$keydev:$keypath" >> /tmp/luks.keys continue elif [ -n "$keydev" ]; then udevmatch "$keydev" >&7 || { warn 'keydev incorrect!' continue } printf ', ' >&7 fi { printf -- 'RUN+="%s --unique --onetime ' $(command -v initqueue) printf -- '--name probe-keydev-%%k ' printf -- '%s /dev/%%k %s %s"\n' \ $(command -v probe-keydev) "${keypath}" "${luksdev}" } >&7 done unset arg keypath keydev luksdev echo 'LABEL="luks_keydev_end"' >&7 exec 7>&- fi modules.d/90crypt/probe-keydev.sh000075500000000576151701010110012676 0ustar00#!/bin/sh . /lib/dracut-crypt-lib.sh real_keydev="$1"; keypath="$2"; luksdev="$3" [ -z "$real_keydev" -o -z "$keypath" ] && die 'probe-keydev: wrong usage!' [ -z "$luksdev" ] && luksdev='*' info "Probing $real_keydev for $keypath..." test_dev -f "$real_keydev" "$keypath" || exit 1 info "Found $keypath on $real_keydev" echo "$luksdev:$real_keydev:$keypath" >> /tmp/luks.keys modules.d/90dm/11-dm.rules000064400000000216151701010110011064 0ustar00SUBSYSTEM!="block", GOTO="dm_end" KERNEL!="dm-[0-9]*", GOTO="dm_end" ACTION!="add|change", GOTO="dm_end" OPTIONS+="db_persist" LABEL="dm_end" modules.d/90dm/59-persistent-storage-dm.rules000064400000001235151701010110014742 0ustar00SUBSYSTEM!="block", GOTO="dm_end" ACTION!="add|change", GOTO="dm_end" # Also don't process disks that are slated to be a multipath device ENV{DM_MULTIPATH_DEVICE_PATH}=="1", GOTO="dm_end" KERNEL!="dm-[0-9]*", GOTO="dm_end" ACTION=="add", GOTO="dm_end" IMPORT{program}="/sbin/dmsetup info -c --nameprefixes --unquoted --rows --noheadings -o name,uuid,suspended,readonly,major,minor,open,tables_loaded,names_using_dev -j%M -m%m" ENV{DM_NAME}!="?*", GOTO="dm_end" ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}=="1", GOTO="dm_end" ENV{DM_UUID}=="CRYPT-TEMP-?*", GOTO="dm_end" ENV{DM_UUID}!="?*", ENV{DM_NAME}=="temporary-cryptsetup-?*", GOTO="dm_end" IMPORT BLKID LABEL="dm_end" modules.d/90dm/dm-pre-udev.sh000075500000000146151701010110011657 0ustar00#!/bin/sh strstr "$(cat /proc/misc)" device-mapper || modprobe dm_mod modprobe dm_mirror 2>/dev/null modules.d/90dm/dm-shutdown.sh000075500000002325151701010110012004 0ustar00#!/bin/sh _remove_dm() { local dev=$1 local s local devname for s in /sys/block/${dev}/holders/dm-* ; do [ -e ${s} ] || continue _remove_dm ${s##*/} done # multipath devices might have MD devices on top, # which are removed after this script. So do not # remove those to avoid spurious errors case $(cat /sys/block/${dev}/dm/uuid) in mpath-*) return 0 ;; *) devname=$(cat /sys/block/${dev}/dm/name) dmsetup -v --noudevsync remove "$devname" || return $? ;; esac return 0 } _do_dm_shutdown() { local ret=0 local final=$1 local dev info "Disassembling device-mapper devices" for dev in /sys/block/dm-* ; do [ -e ${dev} ] || continue if [ "x$final" != "x" ]; then _remove_dm ${dev##*/} || ret=$? else _remove_dm ${dev##*/} >/dev/null 2>&1 || ret=$? fi done if [ "x$final" != "x" ]; then info "dmsetup ls --tree" dmsetup ls --tree 2>&1 | vinfo fi return $ret } if command -v dmsetup >/dev/null && [ "x$(dmsetup status)" != "xNo devices found" ]; then _do_dm_shutdown $1 else : fi modules.d/90dm/module-setup.sh000075500000001755151701010110012164 0ustar00#!/bin/bash # called by dracut check() { require_binaries dmsetup || return 1 return 255 } # called by dracut depends() { return 0 } # called by dracut installkernel() { instmods =drivers/md dm_mod dm-cache dm-cache-mq dm-cache-cleaner } # called by dracut install() { modinfo -k $kernel dm_mod >/dev/null 2>&1 && \ inst_hook pre-udev 30 "$moddir/dm-pre-udev.sh" inst_multiple dmsetup inst_multiple -o dmeventd inst_libdir_file "libdevmapper-event.so*" inst_rules 10-dm.rules 13-dm-disk.rules 95-dm-notify.rules # Gentoo ebuild for LVM2 prior to 2.02.63-r1 doesn't install above rules # files, but provides the one below: inst_rules 64-device-mapper.rules # debian udev rules inst_rules 60-persistent-storage-dm.rules 55-dm.rules inst_rules "$moddir/11-dm.rules" inst_rules "$moddir/59-persistent-storage-dm.rules" prepare_udev_rules 59-persistent-storage-dm.rules inst_hook shutdown 25 "$moddir/dm-shutdown.sh" } modules.d/90dmraid/61-dmraid-imsm.rules000064400000001631151701010110013536 0ustar00# This file causes block devices with RAID (dmraid) signatures to # automatically cause dmraid_scan to be run. # See udev(8) for syntax SUBSYSTEM!="block", GOTO="dm_end" ACTION!="add|change", GOTO="dm_end" # Also don't process disks that are slated to be a multipath device ENV{DM_MULTIPATH_DEVICE_PATH}=="1", GOTO="dm_end" ENV{ID_FS_TYPE}=="linux_raid_member", GOTO="dm_end" ENV{ID_FS_TYPE}!="*_raid_member", GOTO="dm_end" ENV{ID_FS_TYPE}=="isw_raid_member", ENV{rd_NO_MDIMSM}!="?*", GOTO="dm_end" ENV{ID_FS_TYPE}=="ddf_raid_member", ENV{rd_NO_MDDDF}!="?*", GOTO="dm_end" ENV{rd_NO_DM}=="?*", GOTO="dm_end" OPTIONS:="nowatch" ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}=="1", GOTO="dm_end" PROGRAM=="/bin/sh -c 'for i in $sys/$devpath/holders/dm-[0-9]*; do [ -e $$i ] && exit 0; done; exit 1;' ", \ GOTO="dm_end" RUN+="/sbin/initqueue --onetime --unique --settled /sbin/dmraid_scan $env{DEVNAME}" LABEL="dm_end" modules.d/90dmraid/dmraid.sh000075500000002266151701010110011637 0ustar00#!/bin/sh type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh dev="$1" devenc=$(str_replace "$1" '/' '\2f') [ -e /tmp/dmraid.$devenc ] && exit 0 >/tmp/dmraid.$devenc DM_RAIDS=$(getargs rd.dm.uuid -d rd_DM_UUID=) if [ -n "$DM_RAIDS" ] || getargbool 0 rd.auto; then DM_CLEANUP="no" # run dmraid if udev has settled info "Scanning for dmraid devices $DM_RAIDS" SETS=$(dmraid -c -s) if [ "$SETS" = "no raid disks" -o "$SETS" = "no raid sets" ]; then return fi info "Found dmraid sets:" echo $SETS|vinfo if [ -n "$DM_RAIDS" ]; then # only activate specified DM RAIDS for r in $DM_RAIDS; do for s in $SETS; do if [ "${s##$r}" != "$s" ]; then info "Activating $s" dmraid -ay -i -p --rm_partitions "$s" 2>&1 | vinfo fi done done else # scan and activate all DM RAIDS for s in $SETS; do info "Activating $s" dmraid -ay -i -p --rm_partitions "$s" 2>&1 | vinfo [ -e "/dev/mapper/$s" ] && kpartx -a "/dev/mapper/$s" 2>&1 | vinfo udevsettle done fi need_shutdown fi modules.d/90dmraid/module-setup.sh000075500000004113151701010110013013 0ustar00#!/bin/bash # called by dracut check() { local _rootdev # if we don't have dmraid installed on the host system, no point # in trying to support it in the initramfs. require_binaries dmraid || return 1 [[ $hostonly ]] || [[ $mount_needs ]] && { for dev in "${!host_fs_types[@]}"; do [[ "${host_fs_types[$dev]}" != *_raid_member ]] && continue DEVPATH=$(get_devpath_block "$dev") for holder in "$DEVPATH"/holders/*; do [[ -e "$holder" ]] || continue [[ -e "$holder/dm" ]] && return 0 break done done return 255 } return 0 } # called by dracut depends() { echo dm rootfs-block return 0 } # called by dracut cmdline() { local _activated declare -A _activated for dev in "${!host_fs_types[@]}"; do local holder DEVPATH DM_NAME majmin [[ "${host_fs_types[$dev]}" != *_raid_member ]] && continue DEVPATH=$(get_devpath_block "$dev") for holder in "$DEVPATH"/holders/*; do [[ -e "$holder" ]] || continue dev="/dev/${holder##*/}" DM_NAME="$(dmsetup info -c --noheadings -o name "$dev" 2>/dev/null)" [[ ${DM_NAME} ]] && break done [[ ${DM_NAME} ]] || continue if ! [[ ${_activated[${DM_NAME}]} ]]; then printf "%s" " rd.dm.uuid=${DM_NAME}" _activated["${DM_NAME}"]=1 fi done } # called by dracut install() { local _i if [[ $hostonly_cmdline == "yes" ]]; then local _raidconf=$(cmdline) [[ $_raidconf ]] && printf "%s\n" "$_raidconf" >> "${initdir}/etc/cmdline.d/90dmraid.conf" fi inst_multiple dmraid inst_multiple -o kpartx inst $(command -v partx) /sbin/partx inst "$moddir/dmraid.sh" /sbin/dmraid_scan inst_rules 66-kpartx.rules 67-kpartx-compat.rules inst_libdir_file "libdmraid-events*.so*" inst_rules "$moddir/61-dmraid-imsm.rules" #inst "$moddir/dmraid-cleanup.sh" /sbin/dmraid-cleanup inst_hook pre-trigger 30 "$moddir/parse-dm.sh" } modules.d/90dmraid/parse-dm.sh000075500000001472151701010110012105 0ustar00#!/bin/sh # nodmraid for anaconda / rc.sysinit compatibility if ! getargbool 1 rd.dm -d -n rd_NO_DM || getarg "rd.dm=0" -d nodmraid; then info "rd.dm=0: removing DM RAID activation" udevproperty rd_NO_DM=1 fi if ! command -v mdadm >/dev/null \ || ! getargbool 1 rd.md.imsm -d -n rd_NO_MDIMSM -n noiswmd \ || ! getargbool 1 rd.md -d -n rd_NO_MD; then info "rd.md.imsm=0: no MD RAID for imsm/isw raids" udevproperty rd_NO_MDIMSM=1 fi if ! command -v mdadm >/dev/null \ || ! getargbool 1 rd.md.ddf -n rd_NO_MDDDF -n noddfmd \ || ! getargbool 1 rd.md -d -n rd_NO_MD; then info "rd.md.ddf=0: no MD RAID for SNIA ddf raids" udevproperty rd_NO_MDDDF=1 fi DM_RAIDS=$(getargs rd.dm.uuid -d rd_DM_UUID=) if [ -z "$DM_RAIDS" ] && ! getargbool 0 rd.auto; then udevproperty rd_NO_DM=1 fi modules.d/90kernel-modules/insmodpost.sh000075500000000301151701010110014250 0ustar00#!/bin/sh . /lib/dracut-lib.sh for modlist in $(getargs rd.driver.post -d rdinsmodpost=); do ( IFS=, for m in $modlist; do modprobe $m done ) done modules.d/90kernel-modules/module-setup.sh000075500000007351151701010110014510 0ustar00#!/bin/bash # called by dracut installkernel() { local _blockfuncs='ahci_platform_get_resources|ata_scsi_ioctl|scsi_add_host|blk_cleanup_queue|register_mtd_blktrans|scsi_esp_register|register_virtio_device|usb_stor_disconnect|mmc_add_host|sdhci_add_host|scsi_add_host_with_dma' find_kernel_modules_external () { local _OLDIFS local external_pattern="^/" [[ -f "$srcmods/modules.dep" ]] || return 0 _OLDIFS=$IFS IFS=: while read a rest; do [[ $a =~ $external_pattern ]] || continue printf "%s\n" "$a" done < "$srcmods/modules.dep" IFS=$_OLDIFS } is_block_dev() { [ -e /sys/dev/block/$1 ] && return 0 return 1 } install_block_modules () { hostonly='' instmods sr_mod sd_mod scsi_dh ata_piix instmods \ scsi_dh_rdac scsi_dh_emc scsi_dh_alua \ =ide nvme vmd nfit \ virtio_blk dracut_instmods -o -s "${_blockfuncs}" "=drivers" } if [[ -z $drivers ]]; then hostonly='' instmods \ hid_generic unix \ ehci-hcd ehci-pci ehci-platform \ ohci-hcd ohci-pci \ uhci-hcd \ xhci-hcd xhci-pci xhci-plat-hcd \ "=drivers/pinctrl" \ ${NULL} hostonly=$(optional_hostonly) instmods \ "=drivers/hid" \ "=drivers/tty/serial" \ "=drivers/input/serio" \ "=drivers/input/keyboard" \ "=drivers/usb/storage" \ "=drivers/pci/host" \ ${NULL} instmods \ yenta_socket \ atkbd i8042 usbhid firewire-ohci pcmcia hv-vmbus \ virtio virtio_ring virtio_pci virtio_scsi pci_hyperv \ "=drivers/pcmcia" if [[ "$(uname -m)" == arm* || "$(uname -m)" == aarch64 ]]; then # arm/aarch64 specific modules _blockfuncs+='|dw_mc_probe|dw_mci_pltfm_register' instmods \ "=drivers/clk" \ "=drivers/dma" \ "=drivers/extcon" \ "=drivers/gpio" \ "=drivers/hwspinlock" \ "=drivers/i2c/busses" \ "=drivers/mfd" \ "=drivers/mmc/core" \ "=drivers/phy" \ "=drivers/power" \ "=drivers/regulator" \ "=drivers/rpmsg" \ "=drivers/rtc" \ "=drivers/soc" \ "=drivers/usb/chipidea" \ "=drivers/usb/dwc2" \ "=drivers/usb/dwc3" \ "=drivers/usb/host" \ "=drivers/usb/misc" \ "=drivers/usb/musb" \ "=drivers/usb/phy" \ "=drivers/scsi/hisi_sas" \ ${NULL} fi find_kernel_modules_external | instmods if ! [[ $hostonly ]] || for_each_host_dev_and_slaves is_block_dev; then install_block_modules fi # if not on hostonly mode, install all known filesystems, # if the required list is not set via the filesystems variable if ! [[ $hostonly ]]; then if [[ -z $filesystems ]]; then dracut_instmods -o -P ".*/(kernel/fs/nfs|kernel/fs/nfsd|kernel/fs/lockd)/.*" '=fs' fi elif [[ "${host_fs_types[*]}" ]]; then hostonly='' instmods "${host_fs_types[@]}" fi fi : } # called by dracut install() { inst_multiple -o /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_simple "$moddir/insmodpost.sh" /sbin/insmodpost.sh } modules.d/90kernel-modules/parse-kernel.sh000075500000001631151701010110014450 0ustar00#!/bin/sh _modprobe_d=/etc/modprobe.d if [ -d /usr/lib/modprobe.d ] ; then _modprobe_d=/usr/lib/modprobe.d elif [ -d /lib/modprobe.d ] ; then _modprobe_d=/lib/modprobe.d elif [ ! -d $_modprobe_d ] ; then mkdir -p $_modprobe_d fi for i in $(getargs rd.driver.pre -d rdloaddriver=); do ( IFS=, for p in $i; do modprobe $p 2>&1 | vinfo done ) done [ -d /etc/modprobe.d ] || mkdir -p /etc/modprobe.d for i in $(getargs rd.driver.blacklist -d rdblacklist=); do ( IFS=, for p in $i; do echo "blacklist $p" >> $_modprobe_d/initramfsblacklist.conf done ) done for p in $(getargs rd.driver.post -d rdinsmodpost=); do echo "blacklist $p" >> $_modprobe_d/initramfsblacklist.conf _do_insmodpost=1 done [ -n "$_do_insmodpost" ] && initqueue --settled --unique --onetime insmodpost.sh unset _do_insmodpost _modprobe_d modules.d/90kernel-modules-extra/module-setup.sh000075500000011755151701010110015634 0ustar00#!/bin/bash # called by dracut # # Parses depmod configuration and calls instmods for out-of-tree kernel # modules found. Specifically, kernel modules inside directories that # come from the following places are included (if these kernel modules # are present in modules.dep): # - "search" configuration option; # - "override" configuration option (matching an exact file name constructed # by concatenating the provided directory and the kernel module name); # - "external" configuration option (if "external" is a part of "search" # configuration). # (See depmod.d(5) for details.) # # This module has the following variables available for configuration: # - "depmod_modules_dep" - Path to the modules.dep file # ("$srcmods/modules.dep" by default); # - "depmod_module_dir" - Directory containing kernel modules ("$srcmods" # by default); # - "depmod_configs" - array of depmod configuration paths to parse # (as supplied to depmod -C, ("/run/depmod.d/" # "/etc/depmod.d/" "/lib/depmod.d/") by default). installkernel() { : "${depmod_modules_dep:=$srcmods/modules.dep}" : "${depmod_module_dir:=$srcmods}" [[ -f "${depmod_modules_dep}" ]] || return 0 # Message printers with custom prefix local mod_name="kernel-modules-extra" prinfo() { dinfo " ${mod_name}: $*"; } prdebug() { ddebug " ${mod_name}: $*"; } # Escape a string for usage as a part of extended regular expression. # $1 - string to escape re_escape() { printf "%s" "$1" | sed 's/\([.+?^$\/\\|()\[]\|\]\)/\\\0/' } local OLDIFS local cfg local cfgs=() local search_list="" local overrides=() local external_dirs=() local e f ## Gathering and sorting configuration file list [ -n "${depmod_configs[@]-}" ] \ || depmod_configs=(/run/depmod.d/ /etc/depmod.d/ /lib/depmod.d/) for cfg in "${depmod_configs[@]}"; do [ -e "$cfg" ] || { prdebug "configuration source \"$cfg\" does not exist" continue } # '/' is used as a separator between configuration name and # configuration path if [ -d "$cfg" ]; then for f in "$cfg/"*; do [[ -e "$f" && ! -d "$f" ]] || { prdebug "configuration source" \ "\"$cfg\" is ignored" \ "(directory or doesn't exist)" continue } cfgs+=("$(basename "$f")/$f") done else cfgs+=("$(basename "$cfg")/$cfg") fi done OLDIFS="$IFS" IFS=$'\n' LANG=C cfgs=($(printf '%s\n' "${cfgs[@]}" \ | sort -u -k1,1 -t '/' | cut -f 2- -d '/')) IFS="$OLDIFS" ## Parse configurations for cfg in "${cfgs[@]}"; do prdebug "parsing configuration file \"$cfg\"" local k v mod kverpat path while read -r k v; do case "$k" in search) search_list="$search_list $v" prdebug "$cfg: added \"$v\" to the list of" \ "search directories" ;; override) # module_name kver_pattern dir read -r mod kverpat path <<<"$v" if [[ ! "$mod" || ! "$kverpat" || ! "$path" ]] then prinfo "$cfg: ignoring incorrect" \ "override option: \"$k $v\"" continue fi if [[ '*' = "$kverpat" \ || "$kernel" =~ "$kverpat" ]] then overrides+=("${path}/${mod}") prdebug "$cfg: added override" \ "\"${path}/${mod}\"" else prdebug "$cfg: override \"$v\" is" \ "ignored since \"$kverpat\"" \ "doesn't match \"$kernel\"" fi ;; external) # kverpat dir read -r kverpat path <<<"$v" if [[ ! "$kverpat" || ! "$path" ]]; then prinfo "$cfg: ignoring incorrect" \ "external option: \"$k $v\"" continue fi if [[ '*' = "$kverpat" \ || "$kernel" =~ "$kverpat" ]] then external_dirs+=("$path") prdebug "$cfg: added external" \ "directory \"$path\"" else prdebug "$cfg: external directory" \ "\"$path\" is ignored since" \ "\"$kverpat\" doesn't match " \ "\"$kernel\"" fi ;; '#'*|'') # comments and empty strings ;; include|make_map_files) # ignored by depmod ;; *) prinfo "$cfg: unknown depmod configuration" \ "option \"$k $v\"" ;; esac done < "$cfg" done # "updates built-in" is the default search list : "${search_list:=updates}" ## Build a list of regular expressions for grepping modules.dep local pathlist=() for f in "${overrides[@]}"; do pathlist+=("^$(re_escape "$f")") done for f in $(printf "%s" "$search_list"); do # Ignoring builtin modules [ "built-in" != "$f" ] || continue if [ "external" = "$f" ]; then for e in "${external_dirs[@]}"; do pathlist+=("$(re_escape "${e%/}")/[^:]+") done fi pathlist+=("$(re_escape "${f%/}")/[^:]+") done ## Filter modules.dep, canonicalise the resulting filenames and supply ## them to instmods. [ 0 -lt "${#pathlist[@]}" ] || return 0 printf "^%s\.ko(\.gz|\.bz2|\.xz)?:\n" "${pathlist[@]}" \ | (LANG=C grep -E -o -f - -- "$depmod_modules_dep" || exit 0) \ | tr -d ':' \ | (cd "$depmod_module_dir" || exit; xargs -r realpath -se --) \ | instmods || return 1 return 0 } modules.d/90lvm/64-lvm.rules000064400000001407151701010110011473 0ustar00# hacky rules to try to activate lvm when we get new block devs... # # Copyright 2008, Red Hat, Inc. # Jeremy Katz <katzj@redhat.com> SUBSYSTEM!="block", GOTO="lvm_end" ACTION!="add|change", GOTO="lvm_end" # Also don't process disks that are slated to be a multipath device ENV{DM_MULTIPATH_DEVICE_PATH}=="1", GOTO="lvm_end" KERNEL=="dm-[0-9]*", ACTION=="add", GOTO="lvm_end" ENV{ID_FS_TYPE}!="LVM?_member", GOTO="lvm_end" PROGRAM=="/bin/sh -c 'for i in $sys/$devpath/holders/dm-[0-9]*; do [ -e $$i ] && exit 0; done; exit 1;' ", \ GOTO="lvm_end" RUN+="/sbin/initqueue --settled --onetime --unique /sbin/lvm_scan" RUN+="/sbin/initqueue --timeout --name 51-lvm_scan --onetime --unique /sbin/lvm_scan --partial" RUN+="/bin/sh -c '>/tmp/.lvm_scan-%k;'" LABEL="lvm_end" modules.d/90lvm/lvm_scan.sh000075500000006707151701010110011543 0ustar00#!/bin/sh # run lvm scan if udev has settled extraargs="$@" type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh VGS=$(getargs rd.lvm.vg -d rd_LVM_VG=) LVS=$(getargs rd.lvm.lv -d rd_LVM_LV=) SNAPSHOT=$(getargs rd.lvm.snapshot -d rd_LVM_SNAPSHOT=) SNAPSIZE=$(getargs rd.lvm.snapsize -d rd_LVM_SNAPSIZE=) [ -d /etc/lvm ] || mkdir -m 0755 -p /etc/lvm # build a list of devices to scan lvmdevs=$( for f in /tmp/.lvm_scan-*; do [ -e "$f" ] || continue printf '%s' "${f##/tmp/.lvm_scan-} " done ) if [ ! -e /etc/lvm/lvm.conf ]; then { echo 'devices {'; printf ' filter = [ ' for dev in $lvmdevs; do printf '"a|^/dev/%s$|", ' $dev; done; echo '"r/.*/" ]'; echo '}'; # establish LVM locking if [ -n $SNAPSHOT ]; then echo 'global {'; echo ' locking_type = 1'; echo ' use_lvmetad = 0'; echo '}'; else echo 'global {'; echo ' locking_type = 4'; echo ' use_lvmetad = 0'; echo '}'; fi } > /etc/lvm/lvm.conf lvmwritten=1 fi check_lvm_ver() { maj=$1 min=$2 ver=$3 # --poll is supported since 2.2.57 [ $4 -lt $maj ] && return 1 [ $4 -gt $maj ] && return 0 [ $5 -lt $min ] && return 1 [ $5 -gt $min ] && return 0 [ $6 -ge $ver ] && return 0 return 1 } # hopefully this output format will never change, e.g.: # LVM version: 2.02.53(1) (2009-09-25) OLDIFS=$IFS IFS=. set $(lvm version 2>/dev/null) IFS=$OLDIFS maj=${1##*:} min=$2 sub=${3%% *} sub=${sub%%\(*}; lvm_ignorelockingfailure="--ignorelockingfailure" lvm_quirk_args="--ignorelockingfailure --ignoremonitoring" check_lvm_ver 2 2 57 $maj $min $sub && \ lvm_quirk_args="$lvm_quirk_args --poll n" if check_lvm_ver 2 2 65 $maj $min $sub; then lvm_quirk_args=" --sysinit $extraargs" fi if check_lvm_ver 2 2 221 $maj $min $sub; then lvm_quirk_args=" $extraargs" unset lvm_ignorelockingfailure fi unset extraargs export LVM_SUPPRESS_LOCKING_FAILURE_MESSAGES=1 if [ -n "$SNAPSHOT" ] ; then # HACK - this should probably be done elsewhere or turned into a function # Enable read-write LVM locking sed -i -e 's/\(^[[:space:]]*\)locking_type[[:space:]]*=[[:space:]]*[[:digit:]]/\1locking_type = 1/' ${initdir}/etc/lvm/lvm.conf # Expected SNAPSHOT format "<orig lv name>:<snap lv name>" ORIG_LV=${SNAPSHOT%%:*} SNAP_LV=${SNAPSHOT##*:} info "Removing existing LVM snapshot $SNAP_LV" lvm lvremove --force $SNAP_LV 2>&1| vinfo # Determine snapshot size if [ -z "$SNAPSIZE" ] ; then SNAPSIZE=$(lvm lvs --noheadings --units m --options lv_size $ORIG_LV) info "No LVM snapshot size provided, using size of $ORIG_LV ($SNAPSIZE)" fi info "Creating LVM snapshot $SNAP_LV ($SNAPSIZE)" lvm lvcreate -s -n $SNAP_LV -L $SNAPSIZE $ORIG_LV 2>&1| vinfo fi if [ -n "$LVS" ] ; then info "Scanning devices $lvmdevs for LVM logical volumes $LVS" lvm lvscan $lvm_ignorelockingfailure 2>&1 | vinfo for LV in $LVS; do lvm lvchange --yes -K -ay $lvm_quirk_args $LV 2>&1 | vinfo done fi if [ -z "$LVS" -o -n "$VGS" ]; then info "Scanning devices $lvmdevs for LVM volume groups $VGS" lvm vgscan $lvm_ignorelockingfailure 2>&1 | vinfo lvm vgchange -ay $lvm_quirk_args $VGS 2>&1 | vinfo fi if [ "$lvmwritten" ]; then rm -f -- /etc/lvm/lvm.conf fi unset lvmwritten udevadm settle need_shutdown modules.d/90lvm/module-setup.sh000075500000012277151701010110012363 0ustar00#!/bin/bash # called by dracut check() { # No point trying to support lvm if the binaries are missing require_binaries lvm || return 1 [[ $hostonly ]] || [[ $mount_needs ]] && { for fs in "${host_fs_types[@]}"; do [[ $fs = LVM*_member ]] && return 0 done return 255 } return 0 } # called by dracut depends() { # We depend on dm_mod being loaded echo rootfs-block dm return 0 } # called by dracut cmdline() { local _activated declare -A _activated for dev in "${!host_fs_types[@]}"; do [ -e /sys/block/${dev#/dev/}/dm/name ] || continue [ -e /sys/block/${dev#/dev/}/dm/uuid ] || continue uuid=$(</sys/block/${dev#/dev/}/dm/uuid) [[ "${uuid#LVM-}" == "$uuid" ]] && continue dev=$(</sys/block/${dev#/dev/}/dm/name) eval $(dmsetup splitname --nameprefixes --noheadings --rows "$dev" 2>/dev/null) [[ ${DM_VG_NAME} ]] && [[ ${DM_LV_NAME} ]] || return 1 if ! [[ ${_activated[${DM_VG_NAME}/${DM_LV_NAME}]} ]]; then printf " rd.lvm.lv=%s\n" "${DM_VG_NAME}/${DM_LV_NAME} " _activated["${DM_VG_NAME}/${DM_LV_NAME}"]=1 fi done } installkernel() { hostonly='' instmods dm-snapshot } # called by dracut install() { local _i inst lvm if [[ $hostonly_cmdline == "yes" ]]; then local _lvmconf=$(cmdline) [[ $_lvmconf ]] && printf "%s\n" "$_lvmconf" >> "${initdir}/etc/cmdline.d/90lvm.conf" fi inst_rules "$moddir/64-lvm.rules" if [[ $hostonly ]] || [[ $lvmconf = "yes" ]]; then if [ -f /etc/lvm/lvm.conf ]; then inst_simple -H /etc/lvm/lvm.conf # FIXME: near-term hack to establish read-only locking; # use command-line lvm.conf editor once it is available sed -i -e 's/\(^[[:space:]]*\)locking_type[[:space:]]*=[[:space:]]*[[:digit:]]/\1locking_type = 4/' ${initdir}/etc/lvm/lvm.conf sed -i -e 's/\(^[[:space:]]*\)use_lvmetad[[:space:]]*=[[:space:]]*[[:digit:]]/\1use_lvmetad = 0/' ${initdir}/etc/lvm/lvm.conf fi export LVM_SUPPRESS_FD_WARNINGS=1 # Also install any files needed for LVM system id support. if [ -f /etc/lvm/lvmlocal.conf ]; then inst_simple -H /etc/lvm/lvmlocal.conf fi eval $(lvm dumpconfig global/system_id_source &>/dev/null) if [ "$system_id_source" == "file" ]; then eval $(lvm dumpconfig global/system_id_file) if [ -f "$system_id_file" ]; then inst_simple -H $system_id_file fi fi unset LVM_SUPPRESS_FD_WARNINGS fi if ! [[ -e ${initdir}/etc/lvm/lvm.conf ]]; then mkdir -p "${initdir}/etc/lvm" { echo 'global {' echo 'locking_type = 4' echo 'use_lvmetad = 0' echo '}' } > "${initdir}/etc/lvm/lvm.conf" fi inst_rules 11-dm-lvm.rules 69-dm-lvm-metad.rules # Do not run lvmetad update via pvscan in udev rule - lvmetad is not running yet in dracut! if [[ -f ${initdir}/lib/udev/rules.d/69-dm-lvm-metad.rules ]]; then if grep -q SYSTEMD_WANTS ${initdir}/lib/udev/rules.d/69-dm-lvm-metad.rules; then sed -i -e 's/^ENV{SYSTEMD_ALIAS}=.*/# No LVM pvscan in dracut - lvmetad is not running yet/' \ ${initdir}/lib/udev/rules.d/69-dm-lvm-metad.rules sed -i -e 's/^ENV{ID_MODEL}=.*//' ${initdir}/lib/udev/rules.d/69-dm-lvm-metad.rules sed -i -e 's/^ENV{SYSTEMD_WANTS}=.*//' ${initdir}/lib/udev/rules.d/69-dm-lvm-metad.rules else sed -i -e 's/.*lvm pvscan.*/# No LVM pvscan for in dracut - lvmetad is not running yet/' \ ${initdir}/lib/udev/rules.d/69-dm-lvm-metad.rules fi fi # Gentoo ebuild for LVM2 prior to 2.02.63-r1 doesn't install above rules # files, but provides the one below: inst_rules 64-device-mapper.rules # debian udev rules inst_rules 56-lvm.rules 60-persistent-storage-lvm.rules inst_script "$moddir/lvm_scan.sh" /sbin/lvm_scan inst_hook cmdline 30 "$moddir/parse-lvm.sh" inst_libdir_file "libdevmapper-event-lvm*.so" if [[ $hostonly ]] && find_binary lvs &>/dev/null; then for dev in "${!host_fs_types[@]}"; do [ -e /sys/block/${dev#/dev/}/dm/name ] || continue dev=$(</sys/block/${dev#/dev/}/dm/name) eval $(dmsetup splitname --nameprefixes --noheadings --rows "$dev" 2>/dev/null) [[ ${DM_VG_NAME} ]] && [[ ${DM_LV_NAME} ]] || continue case "$(lvs --noheadings -o segtype ${DM_VG_NAME} 2>/dev/null)" in *thin*|*cache*|*era*) inst_multiple -o thin_dump thin_restore thin_check thin_repair \ cache_dump cache_restore cache_check cache_repair \ era_check era_dump era_invalidate era_restore break;; esac done fi if ! [[ $hostonly ]]; then inst_multiple -o thin_dump thin_restore thin_check thin_repair \ cache_dump cache_restore cache_check cache_repair \ era_check era_dump era_invalidate era_restore fi dracut_need_initqueue } modules.d/90lvm/parse-lvm.sh000075500000000747151701010110011645 0ustar00#!/bin/sh if [ -e /etc/lvm/lvm.conf ] && ! getargbool 1 rd.lvm.conf -d -n rd_NO_LVMCONF; then rm -f -- /etc/lvm/lvm.conf fi LV_DEVS="$(getargs rd.lvm.vg -d rd_LVM_VG=) $(getargs rd.lvm.lv -d rd_LVM_LV=)" if ! getargbool 1 rd.lvm -d -n rd_NO_LVM \ || ( [ -z "$LV_DEVS" ] && ! getargbool 0 rd.auto ); then info "rd.lvm=0: removing LVM activation" rm -f -- /etc/udev/rules.d/64-lvm*.rules else for dev in $LV_DEVS; do wait_for_dev -n "/dev/$dev" done fi modules.d/90mdraid/59-persistent-storage-md.rules000064400000001512151701010110015600 0ustar00SUBSYSTEM!="block", GOTO="md_end" ACTION!="add|change", GOTO="md_end" # Also don't process disks that are slated to be a multipath device ENV{DM_MULTIPATH_DEVICE_PATH}=="1", GOTO="md_end" KERNEL!="md[0-9]*|md_d[0-9]*|md/*", KERNEL!="md*", GOTO="md_end" # partitions have no md/{array_state,metadata_version} ENV{DEVTYPE}=="partition", GOTO="md_ignore_state" # container devices have a metadata version of e.g. 'external:ddf' and # never leave state 'inactive' ATTR{md/metadata_version}=="external:[A-Za-z]*", ATTR{md/array_state}=="inactive", GOTO="md_ignore_state" TEST!="md/array_state", GOTO="md_end" ATTR{md/array_state}=="|clear|inactive", GOTO="md_end" LABEL="md_ignore_state" IMPORT{program}="/sbin/mdadm --detail --export $tempnode" IMPORT BLKID OPTIONS+="link_priority=100" OPTIONS+="watch" OPTIONS+="db_persist" LABEL="md_end" modules.d/90mdraid/65-md-incremental-imsm.rules000064400000002657151701010110015212 0ustar00# This file causes block devices with Linux RAID (mdadm) signatures to # automatically cause mdadm to be run. # See udev(8) for syntax ACTION!="add|change", GOTO="md_end" SUBSYSTEM!="block", GOTO="md_end" ENV{rd_NO_MD}=="?*", GOTO="md_end" KERNEL=="md*", ENV{ID_FS_TYPE}!="linux_raid_member", GOTO="md_end" KERNEL=="md*", ACTION!="change", GOTO="md_end" # Also don't process disks that are slated to be a multipath device ENV{DM_MULTIPATH_DEVICE_PATH}=="1", GOTO="md_end" ENV{ID_FS_TYPE}=="ddf_raid_member|isw_raid_member|linux_raid_member", GOTO="md_try" GOTO="md_end" LABEL="md_try" ENV{ID_FS_TYPE}=="isw_raid_member", ENV{rd_NO_MDIMSM}=="?*", GOTO="md_end" ENV{ID_FS_TYPE}=="ddf_raid_member", ENV{rd_NO_MDDDF}=="?*", GOTO="md_end" # already done ? PROGRAM="/bin/sh -c 'for i in $sys/$devpath/holders/md[0-9_]*; do [ -e $$i ] && exit 0; done; exit 1;' ", \ GOTO="md_end" # for native arrays - array's uuid has to be specified # for containers - container's uuid has to be specified # TODO : how to get embedded array's uuid having container's component ? # # UUID CHECK ENV{DEVTYPE}!="partition", \ RUN+="/sbin/partx -d --nr 1-1024 $env{DEVNAME}" RUN+="/sbin/initqueue --timeout --name 50-mdraid_start --onetime --unique /sbin/mdraid_start" # # Incrementally build the md array; this will automatically assemble # any eventual containers as well (imsm, ddf) # LABEL="md_incremental" RUN+="/sbin/mdadm -I $env{DEVNAME}" LABEL="md_end" modules.d/90mdraid/md-noddf.sh000075500000000130151701010110012053 0ustar00#!/bin/sh info "rd.md.ddf=0: no MD RAID for SNIA ddf raids" udevproperty rd_NO_MDDDF=1 modules.d/90mdraid/md-noimsm.sh000075500000000132151701010110012265 0ustar00#!/bin/sh info "rd.md.imsm=0: no MD RAID for imsm/isw raids" udevproperty rd_NO_MDIMSM=1 modules.d/90mdraid/md-shutdown.sh000075500000000711151701010110012641 0ustar00#!/bin/sh _do_md_shutdown() { local ret local final=$1 info "Waiting for mdraid devices to be clean." mdadm -vv --wait-clean --scan| vinfo ret=$? info "Disassembling mdraid devices." mdadm -vv --stop --scan | vinfo ret=$(($ret+$?)) if [ "x$final" != "x" ]; then info "/proc/mdstat:" vinfo < /proc/mdstat fi return $ret } if command -v mdadm >/dev/null; then _do_md_shutdown $1 else : fi modules.d/90mdraid/mdmon-pre-shutdown.sh000075500000000345151701010110014142 0ustar00#!/bin/sh _do_mdmon_takeover() { local ret mdmon --takeover --all ret=$? [ $ret -eq 0 ] && info "Taking over mdmon processes." return $ret } if command -v mdmon >/dev/null; then _do_mdmon_takeover $1 fi modules.d/90mdraid/mdmon-pre-udev.sh000075500000000202151701010110013222 0ustar00#!/bin/sh # save state dir for mdmon/mdadm for the real root [ -d /run/mdadm ] || mkdir -m 0755 /run/mdadm # backward compat link modules.d/90mdraid/mdraid-cleanup.sh000075500000000755151701010110013265 0ustar00#!/bin/sh type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh containers="" for md in /dev/md[0-9_]*; do [ -b "$md" ] || continue udevinfo="$(udevadm info --query=env --name=$md)" strstr "$udevinfo" "DEVTYPE=partition" && continue if strstr "$udevinfo" "MD_LEVEL=container"; then containers="$containers $md" continue fi mdadm -S "$md" >/dev/null 2>&1 done for md in $containers; do mdadm -S "$md" >/dev/null 2>&1 done unset containers udevinfo modules.d/90mdraid/mdraid-needshutdown.sh000075500000000233151701010110014334 0ustar00#!/bin/sh type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh for md in /dev/md[0-9_]*; do [ -b "$md" ] || continue need_shutdown break done modules.d/90mdraid/mdraid-waitclean.sh000075500000001263151701010110013600 0ustar00#!/bin/sh if getargbool 0 rd.md.waitclean; then type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh containers="" for md in /dev/md[0-9_]*; do [ -b "$md" ] || continue udevinfo="$(udevadm info --query=env --name=$md)" strstr "$udevinfo" "DEVTYPE=partition" && continue if strstr "$udevinfo" "MD_LEVEL=container"; then containers="$containers $md" continue fi info "Waiting for $md to become clean" mdadm -W "$md" >/dev/null 2>&1 done for md in $containers; do info "Waiting for $md to become clean" mdadm -W "$md" >/dev/null 2>&1 done unset containers udevinfo fi modules.d/90mdraid/mdraid_start.sh000075500000003447151701010110013056 0ustar00#!/bin/sh type getargs >/dev/null 2>&1 || . /lib/dracut-lib.sh _md_start() { local _udevinfo local _path_s local _path_d local _md="$1" _udevinfo="$(udevadm info --query=env --name="${_md}")" strstr "$_udevinfo" "MD_LEVEL=container" && continue strstr "$_udevinfo" "DEVTYPE=partition" && continue _path_s="/sys/$(udevadm info -q path -n "${_md}")/md/array_state" [ ! -r "$_path_s" ] && continue # inactive ? [ "$(cat "$_path_s")" != "inactive" ] && continue mdadm -R "${_md}" 2>&1 | vinfo # still inactive ? [ "$(cat "$_path_s")" = "inactive" ] && continue _path_d="${_path_s%/*}/degraded" [ ! -r "$_path_d" ] && continue > $hookdir/initqueue/work } _md_force_run() { local _md local _UUID local _MD_UUID=$(getargs rd.md.uuid -d rd_MD_UUID=) [ -n "$_MD_UUID" ] || getargbool 0 rd.auto || return if [ -n "$_MD_UUID" ]; then _MD_UUID=$(str_replace "$_MD_UUID" "-" "") _MD_UUID=$(str_replace "$_MD_UUID" ":" "") for _md in /dev/md[0-9_]*; do [ -b "$_md" ] || continue _UUID=$( /sbin/mdadm -D --export "$_md" \ | while read line || [ -n "$line" ]; do str_starts "$line" "MD_UUID=" || continue printf "%s" "${line#MD_UUID=}" done ) [ -z "$_UUID" ] && continue _UUID=$(str_replace "$_UUID" ":" "") # check if we should handle this device strstr " $_MD_UUID " " $_UUID " || continue _md_start "${_md}" done else # try to force-run anything not running yet for _md in /dev/md[0-9_]*; do [ -b "$_md" ] || continue _md_start "${_md}" done fi } _md_force_run modules.d/90mdraid/module-setup.sh000075500000011077151701010110013022 0ustar00#!/bin/bash # called by dracut check() { local _rootdev # No mdadm? No mdraid support. require_binaries mdadm expr || return 1 [[ $hostonly ]] || [[ $mount_needs ]] && { for dev in "${!host_fs_types[@]}"; do [[ "${host_fs_types[$dev]}" != *_raid_member ]] && continue DEVPATH=$(get_devpath_block "$dev") for holder in "$DEVPATH"/holders/*; do [[ -e "$holder" ]] || continue [[ -e "$holder/md" ]] && return 0 break done done return 255 } return 0 } # called by dracut depends() { echo rootfs-block return 0 } # called by dracut installkernel() { instmods =drivers/md } # called by dracut cmdline() { local _activated dev line UUID declare -A _activated for dev in "${!host_fs_types[@]}"; do [[ "${host_fs_types[$dev]}" != *_raid_member ]] && continue UUID=$( /sbin/mdadm --examine --export $dev \ | while read line || [ -n "$line" ]; do [[ ${line#MD_UUID=} = $line ]] && continue printf "%s" "${line#MD_UUID=} " done ) [[ -z "$UUID" ]] && continue if ! [[ ${_activated[${UUID}]} ]]; then printf "%s" " rd.md.uuid=${UUID}" _activated["${UUID}"]=1 fi done } # called by dracut install() { local rule rule_path inst_multiple cat expr inst_multiple -o mdmon inst $(command -v partx) /sbin/partx inst $(command -v mdadm) /sbin/mdadm if [[ $hostonly_cmdline == "yes" ]]; then local _raidconf=$(cmdline) [[ $_raidconf ]] && printf "%s\n" "$_raidconf" >> "${initdir}/etc/cmdline.d/90mdraid.conf" fi # <mdadm-3.3 udev rule inst_rules 64-md-raid.rules # >=mdadm-3.3 udev rules inst_rules 63-md-raid-arrays.rules 64-md-raid-assembly.rules # remove incremental assembly from stock rules, so they don't shadow # 65-md-inc*.rules and its fine-grained controls, or cause other problems # when we explicitly don't want certain components to be incrementally # assembled for rule in 64-md-raid.rules 64-md-raid-assembly.rules; do rule_path="${initdir}${udevdir}/rules.d/${rule}" [ -f "${rule_path}" ] && sed -i -r \ -e '/(RUN|IMPORT\{program\})\+?="[[:alpha:]/]*mdadm[[:blank:]]+(--incremental|-I)[[:blank:]]+(--export )?(\$env\{DEVNAME\}|\$tempnode|\$devnode)/d' \ "${rule_path}" done inst_rules "$moddir/65-md-incremental-imsm.rules" inst_rules "$moddir/59-persistent-storage-md.rules" prepare_udev_rules 59-persistent-storage-md.rules # guard against pre-3.0 mdadm versions, that can't handle containers if ! mdadm -Q -e imsm /dev/null >/dev/null 2>&1; then inst_hook pre-trigger 30 "$moddir/md-noimsm.sh" fi if ! mdadm -Q -e ddf /dev/null >/dev/null 2>&1; then inst_hook pre-trigger 30 "$moddir/md-noddf.sh" fi if [[ $hostonly ]] || [[ $mdadmconf = "yes" ]]; then if [ -f /etc/mdadm.conf ]; then inst -H /etc/mdadm.conf else [ -f /etc/mdadm/mdadm.conf ] && inst -H /etc/mdadm/mdadm.conf /etc/mdadm.conf fi if [ -d /etc/mdadm.conf.d ]; then local f inst_dir /etc/mdadm.conf.d for f in /etc/mdadm.conf.d/*.conf; do [ -f "$f" ] || continue inst -H "$f" done fi fi inst_hook pre-udev 30 "$moddir/mdmon-pre-udev.sh" inst_hook pre-trigger 30 "$moddir/parse-md.sh" inst_hook pre-mount 10 "$moddir/mdraid-waitclean.sh" inst_hook cleanup 99 "$moddir/mdraid-needshutdown.sh" 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 $systemdsystemunitdir/mdmon@.service ]; then inst_simple $systemdsystemunitdir/mdmon@.service fi if [ -e $systemdsystemunitdir/mdadm-last-resort@.service ]; then inst_simple $systemdsystemunitdir/mdadm-last-resort@.service fi if [ -e $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 } modules.d/90mdraid/parse-md.sh000075500000005044151701010110012104 0ustar00#!/bin/sh MD_UUID=$(getargs rd.md.uuid -d rd_MD_UUID=) # normalize the uuid MD_UUID=$(str_replace "$MD_UUID" "-" "") MD_UUID=$(str_replace "$MD_UUID" ":" "") if ( ! [ -n "$MD_UUID" ] && ! getargbool 0 rd.auto ) || ! getargbool 1 rd.md -d -n rd_NO_MD; then info "rd.md=0: removing MD RAID activation" udevproperty rd_NO_MD=1 else # rewrite the md rules to only process the specified raid array if [ -n "$MD_UUID" ]; then for f in /etc/udev/rules.d/65-md-incremental*.rules; do [ -e "$f" ] || continue while read line || [ -n "$line" ]; do if [ "${line%%UUID CHECK}" != "$line" ]; then for uuid in $MD_UUID; do printf 'ENV{ID_FS_UUID}=="%s", GOTO="md_uuid_ok"\n' "$(expr substr $uuid 1 8)-$(expr substr $uuid 9 4)-$(expr substr $uuid 13 4)-$(expr substr $uuid 17 4)-$(expr substr $uuid 21 12)" done; printf 'IMPORT{program}="/sbin/mdadm --examine --export $tempnode"\n' for uuid in $MD_UUID; do printf 'ENV{MD_UUID}=="%s", GOTO="md_uuid_ok"\n' "$(expr substr $uuid 1 8):$(expr substr $uuid 9 8):$(expr substr $uuid 17 8):$(expr substr $uuid 25 8)" done; printf 'GOTO="md_end"\n' printf 'LABEL="md_uuid_ok"\n' else echo "$line" fi done < "${f}" > "${f}.new" mv "${f}.new" "$f" done for uuid in $MD_UUID; do uuid="$(expr substr $uuid 1 8):$(expr substr $uuid 9 8):$(expr substr $uuid 17 8):$(expr substr $uuid 25 8)" wait_for_dev "/dev/disk/by-id/md-uuid-${uuid}" done fi fi if [ -e /etc/mdadm.conf ] && getargbool 1 rd.md.conf -d -n rd_NO_MDADMCONF; then udevproperty rd_MDADMCONF=1 rm -f -- $hookdir/pre-pivot/*mdraid-cleanup.sh fi if ! getargbool 1 rd.md.conf -d -n rd_NO_MDADMCONF; then rm -f -- /etc/mdadm/mdadm.conf /etc/mdadm.conf ln -s $(command -v mdraid-cleanup) $hookdir/pre-pivot/31-mdraid-cleanup.sh 2>/dev/null fi # noiswmd nodmraid for anaconda / rc.sysinit compatibility # note nodmraid really means nobiosraid, so we don't want MDIMSM then either if ! getargbool 1 rd.md.imsm -d -n rd_NO_MDIMSM -n noiswmd -n nodmraid; then info "no MD RAID for imsm/isw raids" udevproperty rd_NO_MDIMSM=1 fi # same thing with ddf containers if ! getargbool 1 rd.md.ddf -n rd_NO_MDDDF -n noddfmd -n nodmraid; then info "no MD RAID for SNIA ddf raids" udevproperty rd_NO_MDDDF=1 fi modules.d/90multipath/module-setup.sh000075500000006611151701010110013567 0ustar00#!/bin/bash is_mpath() { local _dev=$1 [ -e /sys/dev/block/$_dev/dm/uuid ] || return 1 [[ $(cat /sys/dev/block/$_dev/dm/uuid) =~ mpath- ]] && return 0 return 1 } majmin_to_mpath_dev() { local _dev for i in /dev/mapper/*; do [[ $i == /dev/mapper/control ]] && continue _dev=$(get_maj_min $i) if [ "$_dev" = "$1" ]; then echo $i return fi done } # called by dracut check() { local _rootdev [[ $hostonly ]] || [[ $mount_needs ]] && { for_each_host_dev_and_slaves is_mpath || return 255 } # if there's no multipath binary, no go. require_binaries multipath || return 1 require_binaries kpartx || return 1 return 0 } # called by dracut depends() { echo rootfs-block echo dm return 0 } # called by dracut cmdline() { for m in scsi_dh_alua scsi_dh_emc scsi_dh_rdac dm_multipath; do if grep -m 1 -q "$m" /proc/modules ; then printf 'rd.driver.pre=%s ' "$m" fi done } # called by dracut installkernel() { local _ret local _arch=$(uname -m) local _funcs='scsi_register_device_handler|dm_dirty_log_type_register|dm_register_path_selector|dm_register_target' local _s390 if [ "$_arch" = "s390" -o "$_arch" = "s390x" ]; then _s390drivers="=drivers/s390/scsi" fi hostonly='' dracut_instmods -o -s "$_funcs" "=drivers/scsi" "=drivers/md" ${_s390drivers:+"$_s390drivers"} } # called by dracut install() { local _f _allow add_hostonly_mpath_conf() { is_mpath $1 && { local _dev _dev=$(majmin_to_mpath_dev $1) [ -z "$_dev" ] && return strstr "$_allow" "$_dev" && return _allow="$_allow --allow $_dev" } } inst_multiple -o \ dmsetup \ kpartx \ mpath_wait \ mpathconf \ mpathpersist \ multipath \ multipathd \ xdrgetprio \ xdrgetuid \ /etc/xdrdevices.conf \ /etc/multipath.conf \ /etc/multipath/* \ /etc/multipath/conf.d/* [[ $hostonly ]] && [[ $hostonly_mode = "strict" ]] && { for_each_host_dev_and_slaves_all add_hostonly_mpath_conf [ -n "$_allow" ] && mpathconf $_allow --outfile ${initdir}/etc/multipath.conf } inst $(command -v partx) /sbin/partx inst_libdir_file "libmultipath*" "multipath/*" inst_libdir_file 'libgcc_s.so*' if [[ $hostonly_cmdline ]] ; then local _conf=$(cmdline) [[ $_conf ]] && echo "$_conf" >> "${initdir}/etc/cmdline.d/90multipath.conf" fi if dracut_module_included "systemd"; then inst_simple "${moddir}/multipathd-configure.service" "${systemdsystemunitdir}/multipathd-configure.service" inst_simple "${moddir}/multipathd.service" "${systemdsystemunitdir}/multipathd.service" systemctl -q --root "$initdir" enable multipathd-configure.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 cleanup 80 "$moddir/multipathd-needshutdown.sh" inst_hook shutdown 20 "$moddir/multipath-shutdown.sh" inst_rules 40-multipath.rules 56-multipath.rules \ 62-multipath.rules 65-multipath.rules \ 66-kpartx.rules 67-kpartx-compat.rules \ 11-dm-mpath.rules 11-dm-parts.rules } modules.d/90multipath/multipath-shutdown.sh000075500000000254151701010110015021 0ustar00#!/bin/bash for i in $(multipath -l -v1); do if ! dmsetup table $i | sed -n '/.*queue_if_no_path.*/q1' ; then dmsetup message $i 0 fail_if_no_path fi done modules.d/90multipath/multipathd-configure.service000064400000001210151701010110016307 0ustar00[Unit] Description=Device-Mapper Multipath Default Configuration Before=iscsi.service iscsid.service lvm2-activation-early.service Wants=systemd-udev-trigger.service systemd-udev-settle.service local-fs-pre.target After=systemd-udev-trigger.service systemd-udev-settle.service Before=local-fs-pre.target multipathd.service DefaultDependencies=no Conflicts=shutdown.target ConditionKernelCommandLine=rd.multipath=default ConditionPathExists=!/etc/multipath.conf [Service] Type=oneshot ExecStartPre=-/usr/bin/mkdir -p /etc/multipath/multipath.conf.d ExecStart=/usr/sbin/mpathconf --enable --user_friendly_names n [Install] WantedBy=sysinit.target modules.d/90multipath/multipathd-needshutdown.sh000075500000000242151701010110016016 0ustar00#!/bin/sh for i in $(multipath -l -v1); do if $(dmsetup table $i | sed -n '/.*queue_if_no_path.*/q1') ; then need_shutdown break fi done modules.d/90multipath/multipathd-stop.sh000075500000000355151701010110014301 0ustar00#!/bin/sh if [ -e /etc/multipath.conf ]; then HARD="" while pidof multipathd >/dev/null 2>&1; do for pid in $(pidof multipathd); do kill $HARD $pid >/dev/null 2>&1 done HARD="-9" done fi modules.d/90multipath/multipathd.service000064400000001421151701010110014334 0ustar00[Unit] Description=Device-Mapper Multipath Device Controller Before=iscsi.service iscsid.service lvm2-activation-early.service Wants=systemd-udev-trigger.service systemd-udev-settle.service local-fs-pre.target After=systemd-udev-trigger.service systemd-udev-settle.service Before=local-fs-pre.target Before=initrd-cleanup.service DefaultDependencies=no Conflicts=shutdown.target Conflicts=initrd-cleanup.service ConditionKernelCommandLine=!nompath ConditionKernelCommandLine=!rd.multipath=0 ConditionKernelCommandLine=!rd_NO_MULTIPATH ConditionKernelCommandLine=!multipath=off [Service] Type=simple ExecStartPre=-/sbin/modprobe dm-multipath ExecStart=/sbin/multipathd -s -d ExecReload=/sbin/multipathd reconfigure ExecStop=/sbin/multipathd shutdown [Install] WantedBy=sysinit.target modules.d/90multipath/multipathd.sh000075500000000644151701010110013317 0ustar00#!/bin/sh if [ "$(getarg rd.multipath)" = "default" ] && [ ! -e /etc/multipath.conf ]; then mkdir -p /etc/multipath/multipath.conf.d mpathconf --enable --user_friendly_names n fi if getargbool 1 rd.multipath -d -n rd_NO_MULTIPATH && [ -e /etc/multipath.conf ]; then modprobe dm-multipath multipathd -B || multipathd need_shutdown else rm -- /etc/udev/rules.d/??-multipath.rules 2>/dev/null fi modules.d/90qemu/module-setup.sh000075500000002015151701010110012521 0ustar00#!/bin/bash # called by dracut check() { if [[ $hostonly ]] || [[ $mount_needs ]]; then if type -P systemd-detect-virt >/dev/null 2>&1; then vm=$(systemd-detect-virt --vm 2>/dev/null) (($? != 0)) && return 255 [[ $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 vendor < $i [[ "$vendor" == "QEMU" ]] && return 0 [[ "$vendor" == "Red Hat" ]] && return 0 [[ "$vendor" == "Bochs" ]] && return 0 done return 255 fi return 0 } # called by dracut installkernel() { # qemu specific modules hostonly='' instmods \ ata_piix ata_generic pata_acpi cdrom sr_mod ahci \ virtio_blk virtio virtio_ring virtio_pci \ virtio_scsi virtio_console virtio_rng virtio_mem \ spapr-vscsi \ qemu_fw_cfg } modules.d/91crypt-gpg/README000064400000005043151701010110011371 0ustar00# Directions for changing a system from password-based gpg keyfile # to smartcard-based gpg keyfile # Be sure that you meet the following requirements: # 1. GnuPG >= 2.1 installed with # * Smartcard support enabled (scdaemon must be built) # * Direct CCID access built into scdaemon # 2. A password-based gpg keyfile ${KEYFILE} (e.g. "keyfile.gpg"): # That is, a file containing the slot key for LUKS, which # has been encrypted symmetrically with GnuPG using # a password. # 3. Your public OpenPGP identity ${RECIPIENT} (e.g. "3A696356") # 4. An OpenPGP smartcard holding the decryption key associated # with your public identity # 5. A CCID smartcard reader # Notes: Requirement 4. and 5. can of course be one device, e.g. # a USB token with an integrated OpenPGP smartcard # Make a backup of your keyfile (assuming it lies on the boot partition) $ cp /boot/${KEYFILE} /safe/place/keyfile.bak.gpg # Change your keyfile from purely password-based to both # password-based and key-based (you can then decrypt the keyfile # with either method). As an example aes256 is chosen, the cipher # is not important to this guide, but do note that your kernel # must support it at boot time (be it built into the kernel image # or loaded as a module from the initramfs). $ cat /safe/place/keyfile.bak.gpg | gpg -d | gpg --encrypt --recipient ${RECIPIENT} --cipher-algo aes256 --armor -c > /safe/place/keyfile_sc.gpg # Verify that you can decrypt your new keyfile both with the password # and your smartcard. # (with smartcard inserted, you should be prompted for your PIN, unless # you already did so and have not yet timed out) $ gpg -d /safe/place/keyfile_sc.gpg # (with smartcard disconnected, you should be prompted for your password) $ gpg -d /safe/place/keyfile_sc.gpg # After verification, replace your old keyfile with your new one $ su -c 'cp /safe/place/keyfile_sc.gpg /boot/${KEYFILE}' # Export your public key to where crypt-gpg can find it $ gpg --armor --export-options export-minimal --export ${RECIPIENT} > /safe/place/crypt-public-key.gpg $ su -c 'cp /safe/place/crypt-public-key.gpg /etc/dracut.conf.d/crypt-public-key.gpg' # Rebuild your initramfs as usual # When booting with any of the requirements not met, crypt-gpg will default to password-based keyfile unlocking. # If all requirements are met and smartcard support is not disabled by setting the kernel option "rd.luks.smartcard=0" # crypt-gpg will try find and use a connected OpenPGP smartcard by prompting you for the PIN and then # unlocking the gpg keyfile with the smartcard. modules.d/91crypt-gpg/crypt-gpg-lib.sh000075500000005072151701010110013532 0ustar00#!/bin/sh command -v ask_for_password >/dev/null || . /lib/dracut-crypt-lib.sh # gpg_decrypt mnt_point keypath keydev device # # Decrypts symmetrically encrypted (password or OpenPGP smartcard) key to standard output. # # mnt_point - mount point where <keydev> is already mounted # keypath - GPG encrypted key path relative to <mnt_point> # keydev - device on which key resides; only to display in prompt # device - device to be opened by cryptsetup; only to display in prompt gpg_decrypt() { local mntp="$1" local keypath="$2" local keydev="$3" local device="$4" local gpghome=/tmp/gnupg local opts="--homedir $gpghome --no-mdc-warning --skip-verify --quiet" opts="$opts --logger-file /dev/null --batch --no-tty --passphrase-fd 0" mkdir -m 0700 -p "$gpghome" # Setup GnuPG home and gpg-agent for usage of OpenPGP smartcard. # This requires GnuPG >= 2.1, as it uses the new ,,pinentry-mode´´ # feature, which - when set to ,,loopback´´ - allows us to pipe # the smartcard's pin to GnuPG (instead of using a normal pinentry # program needed with GnuPG < 2.1), making for uncomplicated # integration with the existing codebase. local useSmartcard="0" local gpgMajorVersion="$(gpg --version | sed -n 1p | sed -n -r -e 's|.* ([0-9]*).*|\1|p')" local gpgMinorVersion="$(gpg --version | sed -n 1p | sed -n -r -e 's|.* [0-9]*\.([0-9]*).*|\1|p')" if [ "${gpgMajorVersion}" -ge 2 ] && [ "${gpgMinorVersion}" -ge 1 ] \ && [ -f /root/crypt-public-key.gpg ] && getargbool 1 rd.luks.smartcard ; then useSmartcard="1" echo "allow-loopback-pinentry" >> "$gpghome/gpg-agent.conf" GNUPGHOME="$gpghome" gpg-agent --quiet --daemon GNUPGHOME="$gpghome" gpg --quiet --no-tty --import < /root/crypt-public-key.gpg local smartcardSerialNumber="$(GNUPGHOME=$gpghome gpg --no-tty --card-status \ | sed -n -r -e 's|Serial number.*: ([0-9]*)|\1|p' | tr -d '\n')" if [ -n "${smartcardSerialNumber}" ]; then inputPrompt="PIN (OpenPGP card ${smartcardSerialNumber})" fi GNUPGHOME="$gpghome" gpg-connect-agent 1>/dev/null learn /bye opts="$opts --pinentry-mode=loopback" fi ask_for_password \ --cmd "gpg $opts --decrypt $mntp/$keypath" \ --prompt "${inputPrompt:-Password ($keypath on $keydev for $device)}" \ --tries 3 --tty-echo-off # Clean up the smartcard gpg-agent if [ "${useSmartcard}" == "1" ]; then GNUPGHOME="$gpghome" gpg-connect-agent 1>/dev/null killagent /bye fi rm -rf -- "$gpghome" } modules.d/91crypt-gpg/module-setup.sh000075500000002745151701010110013501 0ustar00#!/bin/bash # GPG support is optional # called by dracut check() { require_binaries gpg || return 1 if sc_requested; then if ! sc_supported; then dwarning "crypt-gpg: GnuPG >= 2.1 with scdaemon and libusb required for ccid smartcard support" return 1 fi return 0 fi return 255 } # called by dracut depends() { echo crypt } # called by dracut install() { inst_multiple gpg inst "$moddir/crypt-gpg-lib.sh" "/lib/dracut-crypt-gpg-lib.sh" if sc_requested; then inst_multiple gpg-agent inst_multiple gpg-connect-agent inst_multiple /usr/libexec/scdaemon cp "$(sc_public_key)" "${initdir}/root/" fi } sc_public_key() { echo -n "/etc/dracut.conf.d/crypt-public-key.gpg" } # CCID Smartcard support requires GnuPG >= 2.1 with scdaemon and libusb sc_supported() { local gpgMajor="$(gpg --version | sed -n 1p | sed -n -r -e 's|.* ([0-9]*).*|\1|p')" local gpgMinor="$(gpg --version | sed -n 1p | sed -n -r -e 's|.* [0-9]*\.([0-9]*).*|\1|p')" if [[ "${gpgMajor}" -gt 2 || "${gpgMajor}" -eq 2 && "${gpgMinor}" -ge 1 ]] && \ require_binaries gpg-agent && require_binaries gpg-connect-agent && require_binaries /usr/libexec/scdaemon && (ldd /usr/libexec/scdaemon | grep libusb > /dev/null); then return 0 else return 1 fi } sc_requested() { if [ -f "$(sc_public_key)" ]; then return 0 else return 1 fi } modules.d/91crypt-loop/crypt-loop-lib.sh000075500000002376151701010110014126 0ustar00#!/bin/sh command -v ask_for_password >/dev/null || . /lib/dracut-crypt-lib.sh # loop_decrypt mnt_point keypath keydev device # # Decrypts symmetrically encrypted key to standard output. # # mnt_point - mount point where <keydev> is already mounted # keypath - LUKS encrypted loop file path relative to <mnt_point> # keydev - device on which key resides; only to display in prompt # device - device to be opened by cryptsetup; only to display in prompt loop_decrypt() { local mntp="$1" local keypath="$2" local keydev="$3" local device="$4" local key="/dev/mapper/$(str_replace "loop-$keydev-$mntp-$keypath" '/' '-')" if [ ! -b $key ]; then local loopdev=$(losetup -f "${mntp}/${keypath}" --show) local opts="-d - luksOpen $loopdev ${key##*/}" ask_for_password \ --cmd "cryptsetup $opts" \ --prompt "Password ($keypath on $keydev for $device)" \ --tty-echo-off [ -b $key ] || die "Failed to unlock $keypath on $keydev for $device." printf "%s\n" "cryptsetup luksClose \"$key\"" > ${hookdir}/cleanup/"crypt-loop-cleanup-10-${key##*/}".sh printf "%s\n" "losetup -d \"$loopdev\"" > ${hookdir}/cleanup/"crypt-loop-cleanup-20-${loopdev##*/}".sh fi cat $key } modules.d/91crypt-loop/module-setup.sh000075500000000567151701010110013675 0ustar00#!/bin/bash # called by dracut check() { require_binaries losetup || return 1 return 255 } # called by dracut depends() { echo crypt } # called by dracut installkernel() { hostonly='' instmods loop } # called by dracut install() { inst_multiple losetup inst "$moddir/crypt-loop-lib.sh" "/lib/dracut-crypt-loop-lib.sh" dracut_need_initqueue } modules.d/95debug/module-setup.sh000075500000001046151701010110012650 0ustar00#!/bin/bash # called by dracut check() { # do not add this module by default return 255 } # called by dracut depends() { return 0 } # called by dracut install() { inst_multiple -o cat ls ps grep more cat rm strace free showmount \ ping netstat rpcinfo vi scp ping6 ssh find vi \ tcpdump cp less hostname mkdir systemd-analyze \ fsck fsck.ext2 fsck.ext4 fsck.ext3 fsck.ext4dev fsck.f2fs fsck.vfat e2fsck grep '^tcpdump:' /etc/passwd 2>/dev/null >> "$initdir/etc/passwd" } modules.d/95fstab-sys/module-setup.sh000075500000000461151701010110013475 0ustar00#!/bin/bash # called by dracut check() { test -f /etc/fstab.sys || [[ -n $add_fstab || -n $fstab_lines ]] } # called by dracut depends() { echo fs-lib } # called by dracut install() { [ -f /etc/fstab.sys ] && inst_simple /etc/fstab.sys inst_hook pre-pivot 00 "$moddir/mount-sys.sh" } modules.d/95fstab-sys/mount-sys.sh000075500000002405151701010110013030 0ustar00#!/bin/sh type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh type det_fs >/dev/null 2>&1 || . /lib/fs-lib.sh fstab_mount() { local _dev _mp _fs _opts _dump _pass _rest test -e "$1" || return 1 info "Mounting from $1" while read _dev _mp _fs _opts _dump _pass _rest || [ -n "$_dev" ]; do [ -z "${_dev%%#*}" ] && continue # Skip comment lines ismounted $_mp && continue # Skip mounted filesystem if [ "$_pass" -gt 0 ] && ! strstr "$_opts" _netdev; then fsck_single "$_dev" "$_fs" "$_opts" fi _fs=$(det_fs "$_dev" "$_fs") info "Mounting $_dev" if [ -d "$NEWROOT/$_mp" ]; then mount -v -t $_fs -o $_opts $_dev "$NEWROOT/$_mp" 2>&1 | vinfo else [ -d "$_mp" ] || mkdir -p "$_mp" mount -v -t $_fs -o $_opts $_dev $_mp 2>&1 | vinfo fi done < $1 return 0 } # 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 # prefer $NEWROOT/etc/fstab.sys over local /etc/fstab.sys if [ -f $NEWROOT/etc/fstab.sys ]; then fstab_mount $NEWROOT/etc/fstab.sys elif [ -f /etc/fstab.sys ]; then fstab_mount /etc/fstab.sys fi modules.d/95hwdb/module-setup.sh000075500000001057151701010110012510 0ustar00#!/bin/bash # This file is part of dracut. # SPDX-License-Identifier: GPL-2.0-or-later check() { return 255 } # called by dracut install() { local hwdb_bin # systemd-hwdb ships the file in /etc, with /usr/lib as an alternative. # Therefore consider this location as preferred for configuration. hwdb_bin="${udevdir}"/hwdb.bin if [[ ! -r "${hwdb_bin}" ]]; then hwdb_bin="${udevconfdir}"/hwdb.bin fi if [[ $hostonly ]]; then inst_multiple -H "${hwdb_bin}" else inst_multiple "${hwdb_bin}" fi } modules.d/95lunmask/fc_transport_scan_lun.sh000075500000001062151701010110015175 0ustar00#!/bin/bash # # fc_transport_lun_scan # # Selectively enable individual LUNs behind an FC remote port # # ACTION=="add", SUBSYSTEM=="fc_transport", ATTR{port_name}=="wwpn", \ # PROGRAM="fc_transport_lun_scan lun" # [ -z $DEVPATH ] && exit 1 if [ -n "$1" ] ; then LUN=$1 else LUN=- fi ID=${DEVPATH##*/rport-} HOST=${ID%%:*} CHANNEL=${ID%%-*} CHANNEL=${CHANNEL#*:} if [ -f /sys$DEVPATH/scsi_target_id ] ; then TARGET=$(cat /sys$DEVPATH/scsi_target_id) fi [ -z "$TARGET" ] && exit 1 echo $CHANNEL $TARGET $LUN > /sys/class/scsi_host/host$HOST/scan modules.d/95lunmask/module-setup.sh000075500000004316151701010110013237 0ustar00#!/bin/bash # -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- # ex: ts=8 sw=4 sts=4 et filetype=sh # called by dracut cmdline() { get_lunmask() { local _dev=$1 local _devpath=$(cd -P /sys/dev/block/$_dev ; echo $PWD) local _sdev _lun _rport _end_device _classdev _wwpn _sas_address [ "${_devpath#*/sd}" == "$_devpath" ] && return 1 _sdev="${_devpath%%/block/*}" _lun="${_sdev##*:}" # Check for FibreChannel _rport="${_devpath##*/rport-}" if [ "$_rport" != "$_devpath" ] ; then _rport="${_rport%%/*}" _classdev="/sys/class/fc_remote_ports/rport-${_rport}" [ -d "$_classdev" ] || return 1 _wwpn=$(cat ${_classdev}/port_name) echo "rd.lunmask=fc,${_wwpn},${_lun}" return 0 fi # Check for SAS _end_device="${_devpath##*/end_device-}" if [ "$_end_device" != "$_devpath" ] ; then _end_device="${_end_device%%/*}" _classdev="/sys/class/sas_device/end_device-${_end_device}" [ -e "$_classdev" ] || return 1 _sas_address=$(cat ${_classdev}/sas_address) echo "rd.lunmask=sas,${_sas_address},${_lun}" return 0 fi return 1 } [[ $hostonly ]] || [[ $mount_needs ]] && { for_each_host_dev_and_slaves_all get_lunmask } | sort | uniq } # called by dracut check() { [[ $hostonly ]] || [[ $mount_needs ]] && { [ -w /sys/module/scsi_mod/parameters/scan ] || return 255 scan_type=$(cat /sys/module/scsi_mod/parameters/scan) [ "$scan_type" = "manual" ] && return 0 return 255 } return 0 } # called by dracut depends() { return 0 } # called by dracut install() { inst_script "$moddir/fc_transport_scan_lun.sh" /usr/lib/udev/fc_transport_scan_lun.sh inst_script "$moddir/sas_transport_scan_lun.sh" /usr/lib/udev/sas_transport_scan_lun.sh inst_hook cmdline 30 "$moddir/parse-lunmask.sh" if [[ $hostonly_cmdline == "yes" ]] ; then local _lunmask for _lunmask in $(cmdline) ; do printf "%s\n" "$_lunmask" >> "${initdir}/etc/cmdline.d/95lunmask.conf" done fi } modules.d/95lunmask/parse-lunmask.sh000075500000002313151701010110013371 0ustar00#!/bin/sh # -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- # ex: ts=8 sw=4 sts=4 et filetype=sh create_udev_rule() { local transport=$1 local tgtid=$2 local lun=$3 local _rule=/etc/udev/rules.d/51-${transport}-lunmask-${tgtid}.rules local _cu_type _dev_type [ -e ${_rule} ] && return 0 if [ ! -f "$_rule" ] ; then if [ "$transport" = "fc" ] ; then cat > $_rule <<EOF ACTION=="add", SUBSYSTEM=="fc_remote_ports", ATTR{port_name}=="$tgtid", PROGRAM="fc_transport_scan_lun.sh $lun" EOF elif [ "$transport" = "sas" ] ; then cat > $_rule <<EOF ACTION=="add", SUBSYSTEM=="sas_device", ATTR{sas_address}=="$tgtid", PROGRAM="sas_transport_scan_lun.sh $lun" EOF fi fi } for lunmask_arg in $(getargs rd.lunmask); do ( local OLDIFS="$IFS" local IFS="," set $lunmask_arg IFS="$OLDIFS" if [ -d /sys/module/scsi_mod ] ; then printf "manual" > /sys/module/scsi_mod/parameters/scan elif [ ! -f /etc/modprobe.d/95lunmask.conf ] ; then echo "options scsi_mod scan=manual" > /etc/modprobe.d/95lunmask.conf fi create_udev_rule $1 $2 $3 ) done modules.d/95lunmask/sas_transport_scan_lun.sh000075500000001070151701010110015372 0ustar00#!/bin/bash # # sas_transport_lun_scan # # Selectively enable individual LUNs behind a SAS end device # # ACTION=="add", SUBSYSTEM=="sas_transport", ATTR{sas_address}=="sas_addr", \ # PROGRAM="sas_transport_lun_scan lun" # [ -z $DEVPATH ] && exit 1 if [ -n "$1" ] ; then LUN=$1 else LUN=- fi ID=${DEVPATH##*/end_device-} HOST=${ID%%:*} CHANNEL=${ID%%-*} CHANNEL=${CHANNEL#*:} if [ -f /sys$DEVPATH/scsi_target_id ] ; then TARGET=$(cat /sys$DEVPATH/scsi_target_id) fi [ -z "$TARGET" ] && exit 1 echo 0 $TARGET $LUN > /sys/class/scsi_host/host$HOST/scan modules.d/95nvmf/module-setup.sh000075500000004741151701010110012535 0ustar00#!/bin/bash # called by dracut check() { require_binaries nvme || return 1 [ -f /etc/nvme/hostnqn ] || return 255 [ -f /etc/nvme/hostid ] || return 255 is_nvmf() { local _dev=$1 local trtype [[ -L "/sys/dev/block/$_dev" ]] || return 0 cd -P "/sys/dev/block/$_dev" || return 0 if [ -f partition ] ; then cd .. fi for d in device/nvme* ; do [ -L "$d" ] || continue if readlink "$d" | grep -q nvme-fabrics ; then trtype=$(cat "$d"/transport) break fi done [[ "$trtype" == "fc" ]] || [[ "$trtype" == "tcp" ]] || [[ "$trtype" == "rdma" ]] } [[ $hostonly ]] || [[ $mount_needs ]] && { pushd . >/dev/null for_each_host_dev_and_slaves is_nvmf local _is_nvmf=$? popd >/dev/null [[ $_is_nvmf == 0 ]] || return 255 if [ ! -f /sys/class/fc/fc_udev_device/nvme_discovery ] ; then if [ ! -f /etc/nvme/discovery.conf ] ; then echo "No discovery arguments present" return 255 fi fi } return 0 } # called by dracut depends() { echo bash rootfs-block network return 0 } # called by dracut installkernel() { instmods nvme_fc lpfc qla2xxx hostonly="" instmods nvme_tcp nvme_fabrics } # called by dracut cmdline() { local _hostnqn local _hostid if [ -f /etc/nvme/hostnqn ] ; then _hostnqn=$(cat /etc/nvme/hostnqn) echo -n " nvmf.hostnqn=${_hostnqn}" fi if [ -f /etc/nvme/hostid ] ; then _hostid=$(cat /etc/nvme/hostid) echo -n " nvmf.hostid=${_hostid}" fi echo "" } # called by dracut install() { if [[ $hostonly_cmdline == "yes" ]]; then local _nvmf_args=$(cmdline) [[ "$_nvmf_args" ]] && printf "%s" "$_nvmf_args" >> "${initdir}/etc/cmdline.d/95nvmf-args.conf" fi inst_simple "/etc/nvme/hostnqn" inst_simple "/etc/nvme/hostid" inst_multiple ip sed inst_script "${moddir}/nvmf-autoconnect.sh" /sbin/nvmf-autoconnect.sh inst_multiple nvme inst_multiple -o \ "$systemdsystemunitdir/nvm*-connect@.service" \ "$systemdsystemunitdir/nvm*-connect.target" inst_hook cmdline 99 "$moddir/parse-nvmf-boot-connections.sh" inst_simple "/etc/nvme/discovery.conf" inst_rules /usr/lib/udev/rules.d/70-nvm*-autoconnect.rules inst_rules /usr/lib/udev/rules.d/71-nvmf-iopolicy-netapp.rules dracut_need_initqueue } modules.d/95nvmf/nvmf-autoconnect.sh000064400000000210151701010110013360 0ustar00#!/bin/bash [ -f /sys/class/fc/fc_udev_device/nvme_discovery ] || exit 1 echo add > /sys/class/fc/fc_udev_device/nvme_discovery exit 0 modules.d/95nvmf/parse-nvmf-boot-connections.sh000075500000007336151701010110015454 0ustar00#!/bin/sh # # Supported formats: # nvmf.hostnqn=<hostnqn> # nvmf.hostid=<hostid> # nvmf.discover=<transport>:<traddr>:<host-traddr>:<trsvcid> # # Examples: # nvmf.hostnqn=nqn.2014-08.org.nvmexpress:uuid:37303738-3034-584d-5137-333230423843 # nvmf.discover=rdma:192.168.1.3::4420 # nvme.discover=tcp:192.168.1.3::4420 # nvme.discover=tcp:192.168.1.3 # nvmf.discover=fc:auto # # Note: FC does autodiscovery, so typically there is no need to # specify any discover parameters for FC. # type is_ip >/dev/null 2>&1 || . /lib/net-lib.sh if getargbool 0 rd.nonvmf ; then warn "rd.nonvmf=0: skipping nvmf" return 0 fi initqueue --onetime modprobe --all -b -q nvme nvme_tcp nvme_core nvme_fabrics traddr="none" trtype="none" hosttraddr="none" trsvcid=4420 validate_ip_conn() { if ! getargbool 0 rd.neednet ; then warn "$trtype transport requires rd.neednet=1" return 1 fi local_address=$(ip -o route get to $traddr | sed -n 's/.*src \([0-9a-f.:]*\).*/\1/p') # confirm we got a local IP address if ! is_ip "$local_address" ; then warn "$traddr is an invalid address"; return 1 fi ifname=$(ip -o route get to $local_address | sed -n 's/.*dev \([^ ]*\).*/\1/p') if ip l show "$ifname" >/dev/null 2>&1 ; then warn "invalid network interface $ifname" return 1 fi # confirm there's a route to destination if ip route get "$traddr" >/dev/null 2>&1 ; then warn "no route to $traddr" return 1 fi } parse_nvmf_discover() { OLDIFS="$IFS" IFS=: set $1 IFS="$OLDIFS" case $# in 2) [ -n "$1" ] && trtype=$1 [ -n "$2" ] && traddr=$2 ;; 3) [ -n "$1" ] && trtype=$1 [ -n "$2" ] && traddr=$2 [ -n "$3" ] && hosttraddr=$3 ;; 4) [ -n "$1" ] && trtype=$1 [ -n "$2" ] && traddr=$2 [ -n "$3" ] && hosttraddr=$3 [ -n "$4" ] && trsvcid=$4 ;; *) warn "Invalid arguments for nvmf.discover=$1" return 1 ;; esac if [ "$traddr" = "none" ] ; then warn "traddr is mandatory for $trtype" return 1; fi if [ "$trtype" = "fc" ] ; then if [ "$hosttraddr" = "none" ] ; then warn "host traddr is mandatory for fc" return 1 fi elif [ "$trtype" != "rdma" ] && [ "$trtype" != "tcp" ] ; then warn "unsupported transport $trtype" return 1 fi if [ "$trtype" = "tcp" ]; then validate_ip_conn fi echo "--transport=$trtype --traddr=$traddr --host-traddr=$hosttraddr --trsvcid=$trsvcid" >> /etc/nvme/discovery.conf } nvmf_hostnqn=$(getarg nvmf.hostnqn=) if [ -n "$nvmf_hostnqn" ] ; then echo "$nvmf_hostnqn" > /etc/nvme/hostnqn fi nvmf_hostid=$(getarg nvmf.hostid=) if [ -n "$nvmf_hostid" ] ; then echo "$nvmf_hostid" > /etc/nvme/hostid fi for d in $(getargs nvmf.discover=); do parse_nvmf_discover "$d" done # Host NQN and host id are mandatory for NVMe-oF [ -f "/etc/nvme/hostnqn" ] || exit 0 [ -f "/etc/nvme/hostid" ] || exit 0 if [ -f "/etc/nvme/discovery.conf" ] ; then if [ "$trtype" = "tcp" ] ; then /sbin/initqueue --settled --onetime --unique --name nvme-discover /usr/sbin/nvme connect-all > /tmp/net.$ifname.did-setup else /sbin/initqueue --onetime --unique --name nvme-discover /usr/sbin/nvme connect-all fi else if [ "$trtype" = "tcp" ] ; then /sbin/initqueue --settled --onetime --unique /usr/sbin/nvme connect-all -t tcp -a $traddr -s $trsvcid > /tmp/net.$ifname.did-setup else /sbin/initqueue --finished --onetime --unique --name nvme-fc-autoconnect /sbin/nvmf-autoconnect.sh fi fi modules.d/95resume/module-setup.sh000075500000003600151701010110013060 0ustar00#!/bin/bash # called by dracut check() { # No point trying to support resume, if no swap partition exist [[ $hostonly ]] || [[ $mount_needs ]] && { for fs in "${host_fs_types[@]}"; do [[ $fs =~ ^(swap|swsuspend|swsupend)$ ]] && return 0 done return 255 } return 0 } # called by dracut cmdline() { local _resume for dev in "${!host_fs_types[@]}"; do [[ ${host_fs_types[$dev]} =~ ^(swap|swsuspend|swsupend)$ ]] || continue _resume=$(shorten_persistent_dev "$(get_persistent_dev "$dev")") [[ -n ${_resume} ]] && printf " resume=%s" "${_resume}" done } # called by dracut install() { local _bin if [[ $hostonly_cmdline == "yes" ]]; then local _resumeconf=$(cmdline) [[ $_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 $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/lib/uswsusp/resume do [[ -x "${_bin}" ]] && { inst "${_bin}" /usr/sbin/resume [[ $hostonly ]] && [[ -f /etc/suspend.conf ]] && inst -H /etc/suspend.conf break } 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_script "$moddir/resume.sh" /lib/dracut/resume.sh } modules.d/95resume/parse-resume.sh000075500000007047151701010110013056 0ustar00#!/bin/sh if resume=$(getarg resume=) && ! getarg noresume; then export resume echo "$resume" >/.resume else unset resume fi case "$resume" in LABEL=*) \ resume="$(echo $resume | sed 's,/,\\x2f,g')" resume="/dev/disk/by-label/${resume#LABEL=}" ;; UUID=*) \ resume="/dev/disk/by-uuid/${resume#UUID=}" ;; PARTUUID=*) \ resume="/dev/disk/by-partuuid/${resume#PARTUUID=}" ;; PARTLABEL=*) \ resume="/dev/disk/by-partlabel/${resume#PARTLABEL=}" ;; esac if splash=$(getarg splash=); then export splash else unset splash fi case "$splash" in quiet ) a_splash="-P splash=y" ;; * ) a_splash="-P splash=n" ;; esac if ! getarg noresume; then if [ -n "$resume" ]; then wait_for_dev /dev/resume { printf "KERNEL==\"%s\", ACTION==\"add|change\", SYMLINK+=\"resume\"\n" \ ${resume#/dev/}; printf "SYMLINK==\"%s\", ACTION==\"add|change\", SYMLINK+=\"resume\"\n" \ ${resume#/dev/}; } >> /etc/udev/rules.d/99-resume-link.rules { if [ -x /usr/sbin/resume ]; then printf -- 'KERNEL=="%s", ' "${resume#/dev/}" printf -- '%s' 'ACTION=="add|change", ENV{ID_FS_TYPE}=="suspend|swsuspend|swsupend",' printf -- " RUN+=\"/sbin/initqueue --finished --unique --name 00resume /usr/sbin/resume %s \'%s\'\"\n" \ "$a_splash" "$resume"; printf -- 'SYMLINK=="%s", ' "${resume#/dev/}" printf -- '%s' 'ACTION=="add|change", ENV{ID_FS_TYPE}=="suspend|swsuspend|swsupend",' printf -- " RUN+=\"/sbin/initqueue --finished --unique --name 00resume /usr/sbin/resume %s \'%s\'\"\n" \ "$a_splash" "$resume"; fi printf -- 'KERNEL=="%s", ' "${resume#/dev/}" printf -- '%s' 'ACTION=="add|change", ENV{ID_FS_TYPE}=="suspend|swsuspend|swsupend",' printf -- '%s\n' ' RUN+="/sbin/initqueue --finished --unique --name 00resume echo %M:%m > /sys/power/resume"' printf -- 'SYMLINK=="%s", ' "${resume#/dev/}" printf -- '%s' 'ACTION=="add|change", ENV{ID_FS_TYPE}=="suspend|swsuspend|swsupend",' printf -- '%s\n' ' RUN+="/sbin/initqueue --finished --unique --name 00resume echo %M:%m > /sys/power/resume"' } >> /etc/udev/rules.d/99-resume.rules printf '[ -e "%s" ] && { ln -fs "%s" /dev/resume 2> /dev/null; rm -f -- "$job" "%s/initqueue/timeout/resume.sh"; }\n' \ "$resume" "$resume" "$hookdir" >> $hookdir/initqueue/settled/resume.sh { printf -- "%s" 'warn "Cancelling resume operation. Device not found.";' printf -- ' cancel_wait_for_dev /dev/resume; rm -f -- "$job" "%s/initqueue/settled/resume.sh";\n' "$hookdir" } >> $hookdir/initqueue/timeout/resume.sh mv /lib/dracut/resume.sh /lib/dracut/hooks/pre-mount/10-resume.sh else { if [ -x /usr/sbin/resume ]; then printf -- '%s' 'SUBSYSTEM=="block", ACTION=="add|change", ENV{ID_FS_TYPE}=="suspend|swsuspend|swsupend",' printf -- ' RUN+="/sbin/initqueue --finished --unique --name 00resume /usr/sbin/resume %s $tempnode"\n' "$a_splash" fi printf -- '%s' 'SUBSYSTEM=="block", ACTION=="add|change", ENV{ID_FS_TYPE}=="suspend|swsuspend|swsupend",' printf -- '%s\n' ' RUN+="/sbin/initqueue --finished --unique --name 00resume echo %M:%m > /sys/power/resume"'; } >> /etc/udev/rules.d/99-resume.rules fi fi modules.d/95resume/resume.sh000075500000001060151701010110011733 0ustar00#!/bin/sh PATH=/usr/sbin:/usr/bin:/sbin:/bin [ -s /.resume -a -b "$resume" ] && { # First try user level resume; it offers splash etc case "$splash" in quiet ) a_splash="-P splash=y" ;; * ) a_splash="-P splash=n" ;; esac [ -x "$(command -v resume)" ] && command resume $a_splash "$resume" # parsing the output of ls is Bad, but until there is a better way... ls -lH "$resume" | ( read x x x x maj min x; echo "${maj%,}:$min"> /sys/power/resume) >/.resume } modules.d/95rootfs-block/block-genrules.sh000075500000000725151701010110014462 0ustar00#!/bin/sh if [ "${root%%:*}" = "block" ]; then { printf 'KERNEL=="%s", SYMLINK+="root"\n' \ ${root#block:/dev/} printf 'SYMLINK=="%s", SYMLINK+="root"\n' \ ${root#block:/dev/} } >> /etc/udev/rules.d/99-root.rules printf '[ -e "%s" ] && { ln -s "%s" /dev/root 2>/dev/null; rm "$job"; }\n' \ "${root#block:}" "${root#block:}" > $hookdir/initqueue/settled/blocksymlink.sh wait_for_dev "${root#block:}" fi modules.d/95rootfs-block/module-setup.sh000075500000004374151701010110014175 0ustar00#!/bin/bash # called by dracut check() { return 0 } # called by dracut depends() { echo fs-lib } cmdline_journal() { if [[ $hostonly ]]; then for dev in "${!host_fs_types[@]}"; do [[ ${host_fs_types[$dev]} = "reiserfs" ]] || [[ ${host_fs_types[$dev]} = "xfs" ]] || continue rootopts=$(find_dev_fsopts "$dev") if [[ ${host_fs_types[$dev]} = "reiserfs" ]]; then journaldev=$(fs_get_option $rootopts "jdev") elif [[ ${host_fs_types[$dev]} = "xfs" ]]; then journaldev=$(fs_get_option $rootopts "logdev") fi if [ -n "$journaldev" ]; then printf " root.journaldev=%s" "$journaldev" fi done fi return 0 } cmdline_rootfs() { local _dev=/dev/block/$(find_root_block_device) local _fstype _flags _subvol # "--no-hostonly-default-device" can result in empty root_devs if [ "${#root_devs[@]}" -eq 0 ]; then return fi if [ -e $_dev ]; then printf " root=%s" "$(shorten_persistent_dev "$(get_persistent_dev "$_dev")")" _fstype="$(find_mp_fstype /)" _flags="$(find_mp_fsopts /)" printf " rootfstype=%s" "$_fstype" if [[ $use_fstab != yes ]] && [[ $_fstype = btrfs ]]; then _subvol=$(findmnt -e -v -n -o FSROOT --target /) \ && _subvol=${_subvol#/} _flags="$_flags,${_subvol:+subvol=$_subvol}" fi printf " rootflags=%s" "${_flags#,}" fi } # called by dracut cmdline() { cmdline_rootfs cmdline_journal } # called by dracut install() { if [[ $hostonly_cmdline == "yes" ]]; then local _journaldev=$(cmdline_journal) [[ $_journaldev ]] && printf "%s\n" "$_journaldev" >> "${initdir}/etc/cmdline.d/95root-journaldev.conf" local _rootdev=$(cmdline_rootfs) [[ $_rootdev ]] && printf "%s\n" "$_rootdev" >> "${initdir}/etc/cmdline.d/95root-dev.conf" fi 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 initqueue/timeout 99 "$moddir/rootfallback.sh" } modules.d/95rootfs-block/mount-root.sh000075500000010506151701010110013667 0ustar00#!/bin/sh type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh type det_fs >/dev/null 2>&1 || . /lib/fs-lib.sh mount_root() { local _ret local _rflags_ro # sanity - determine/fix fstype rootfs=$(det_fs "${root#block:}" "$fstype") journaldev=$(getarg "root.journaldev=") if [ -n "$journaldev" ]; then case "$rootfs" in xfs) rflags="${rflags:+${rflags},}logdev=$journaldev" ;; reiserfs) fsckoptions="-j $journaldev $fsckoptions" rflags="${rflags:+${rflags},}jdev=$journaldev" ;; *);; esac fi _rflags_ro="$rflags,ro" _rflags_ro="${_rflags_ro##,}" while ! mount -t ${rootfs} -o "$_rflags_ro" "${root#block:}" "$NEWROOT"; do warn "Failed to mount -t ${rootfs} -o $_rflags_ro ${root#block:} $NEWROOT" fsck_ask_err done READONLY= fsckoptions= if [ -f "$NEWROOT"/etc/sysconfig/readonly-root ]; then . "$NEWROOT"/etc/sysconfig/readonly-root fi if getargbool 0 "readonlyroot=" -y readonlyroot; then READONLY=yes fi if getarg noreadonlyroot ; then READONLY=no fi if [ -f "$NEWROOT"/fastboot ] || getargbool 0 fastboot ; then fastboot=yes fi if ! getargbool 0 rd.skipfsck; then if [ -f "$NEWROOT"/fsckoptions ]; then fsckoptions=$(cat "$NEWROOT"/fsckoptions) fi if [ -f "$NEWROOT"/forcefsck ] || getargbool 0 forcefsck ; then fsckoptions="-f $fsckoptions" elif [ -f "$NEWROOT"/.autofsck ]; then [ -f "$NEWROOT"/etc/sysconfig/autofsck ] && \ . "$NEWROOT"/etc/sysconfig/autofsck if [ "$AUTOFSCK_DEF_CHECK" = "yes" ]; then AUTOFSCK_OPT="$AUTOFSCK_OPT -f" fi if [ -n "$AUTOFSCK_SINGLEUSER" ]; then warn "*** Warning -- the system did not shut down cleanly. " warn "*** Dropping you to a shell; the system will continue" warn "*** when you leave the shell." emergency_shell fi fsckoptions="$AUTOFSCK_OPT $fsckoptions" fi fi rootopts= if getargbool 1 rd.fstab -d -n rd_NO_FSTAB \ && ! getarg rootflags \ && [ -f "$NEWROOT/etc/fstab" ] \ && ! [ -L "$NEWROOT/etc/fstab" ]; then # if $NEWROOT/etc/fstab contains special mount options for # the root filesystem, # remount it with the proper options rootopts="defaults" while read dev mp fs opts dump fsck || [ -n "$dev" ]; do # skip comments [ "${dev%%#*}" != "$dev" ] && continue if [ "$mp" = "/" ]; then # sanity - determine/fix fstype rootfs=$(det_fs "${root#block:}" "$fs") rootopts=$opts rootfsck=$fsck break fi done < "$NEWROOT/etc/fstab" fi # we want rootflags (rflags) to take precedence so prepend rootopts to # them rflags="${rootopts},${rflags}" rflags="${rflags#,}" rflags="${rflags%,}" # backslashes are treated as escape character in fstab # esc_root=$(echo ${root#block:} | sed 's,\\,\\\\,g') # printf '%s %s %s %s 1 1 \n' "$esc_root" "$NEWROOT" "$rootfs" "$rflags" >/etc/fstab ran_fsck=0 if fsck_able "$rootfs" && \ [ "$rootfsck" != "0" -a -z "$fastboot" -a "$READONLY" != "yes" ] && \ ! strstr "${rflags}" _netdev && \ ! getargbool 0 rd.skipfsck; then umount "$NEWROOT" fsck_single "${root#block:}" "$rootfs" "$rflags" "$fsckoptions" _ret=$? ran_fsck=1 fi echo "${root#block:} $NEWROOT $rootfs ${rflags:-defaults} 0 $rootfsck" >> /etc/fstab if ! ismounted "$NEWROOT"; then info "Mounting ${root#block:} with -o ${rflags}" mount "$NEWROOT" 2>&1 | vinfo elif ! are_lists_eq , "$rflags" "$_rflags_ro" defaults; then info "Remounting ${root#block:} with -o ${rflags}" mount -o remount "$NEWROOT" 2>&1 | vinfo fi if ! getargbool 0 rd.skipfsck; then [ -f "$NEWROOT"/forcefsck ] && rm -f -- "$NEWROOT"/forcefsck 2>/dev/null [ -f "$NEWROOT"/.autofsck ] && rm -f -- "$NEWROOT"/.autofsck 2>/dev/null fi } if [ -n "$root" -a -z "${root%%block:*}" ]; then mount_root fi modules.d/95rootfs-block/parse-block.sh000075500000001634151701010110013750 0ustar00#!/bin/sh case "$root" in block:LABEL=*|LABEL=*) root="${root#block:}" root="$(echo $root | sed 's,/,\\x2f,g')" root="block:/dev/disk/by-label/${root#LABEL=}" rootok=1 ;; block:UUID=*|UUID=*) root="${root#block:}" root="${root#UUID=}" root="$(echo $root | tr "[:upper:]" "[:lower:]")" root="block:/dev/disk/by-uuid/${root#UUID=}" rootok=1 ;; block:PARTUUID=*|PARTUUID=*) root="${root#block:}" root="${root#PARTUUID=}" root="$(echo $root | tr "[:upper:]" "[:lower:]")" root="block:/dev/disk/by-partuuid/${root}" rootok=1 ;; block:PARTLABEL=*|PARTLABEL=*) root="${root#block:}" root="block:/dev/disk/by-partlabel/${root#PARTLABEL=}" rootok=1 ;; /dev/*) root="block:${root}" rootok=1 ;; esac [ "${root%%:*}" = "block" ] && wait_for_dev "${root#block:}" modules.d/95rootfs-block/rootfallback.sh000075500000002332151701010110014205 0ustar00#!/bin/sh type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh for root in $(getargs rootfallback=); do case "$root" in block:LABEL=*|LABEL=*) root="${root#block:}" root="$(echo $root | sed 's,/,\\x2f,g')" root="/dev/disk/by-label/${root#LABEL=}" ;; block:UUID=*|UUID=*) root="${root#block:}" root="${root#UUID=}" root="$(echo $root | tr "[:upper:]" "[:lower:]")" root="/dev/disk/by-uuid/${root#UUID=}" ;; block:PARTUUID=*|PARTUUID=*) root="${root#block:}" root="${root#PARTUUID=}" root="$(echo $root | tr "[:upper:]" "[:lower:]")" root="/dev/disk/by-partuuid/${root}" ;; block:PARTLABEL=*|PARTLABEL=*) root="${root#block:}" root="/dev/disk/by-partlabel/${root#PARTLABEL=}" ;; esac if ! [ -b "$root" ]; then warn "Could not find rootfallback $root" continue fi if mount "$root" /sysroot; then info "Mounted rootfallback $root" exit 0 else warn "Failed to mount rootfallback $root" exit 1 fi done [ -e "$job" ] && rm -f "$job" modules.d/95terminfo/module-setup.sh000075500000001020151701010110013375 0ustar00#!/bin/bash # called by dracut install() { local _terminfodir # terminfo bits make things work better if you fall into interactive mode for _terminfodir in /lib/terminfo /etc/terminfo /usr/share/terminfo; do [ -f ${_terminfodir}/l/linux ] && break done if [ -d ${_terminfodir} ]; then for i in "l/linux" "v/vt100" "v/vt102" "v/vt220"; do inst_dir "$_terminfodir/${i%/*}" $DRACUT_CP -L -t "${initdir}/${_terminfodir}/${i%/*}" "$_terminfodir/$i" done fi } modules.d/95udev-rules/59-persistent-storage.rules000064400000000423151701010110016042 0ustar00SUBSYSTEM!="block", GOTO="ps_end" ACTION!="add|change", GOTO="ps_end" # Also don't process disks that are slated to be a multipath device ENV{DM_MULTIPATH_DEVICE_PATH}=="1", GOTO="ps_end" KERNEL=="cciss[0-9]*", IMPORT BLKID KERNEL=="nbd[0-9]*", IMPORT BLKID LABEL="ps_end" modules.d/95udev-rules/61-persistent-storage.rules000064400000001773151701010110016044 0ustar00SUBSYSTEM!="block", GOTO="pss_end" ACTION!="add|change", GOTO="pss_end" # Also don't process disks that are slated to be a multipath device ENV{DM_MULTIPATH_DEVICE_PATH}=="1", GOTO="pss_end" ACTION=="change", KERNEL=="dm-[0-9]*", ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}!="1", GOTO="do_pss" KERNEL=="cciss[0-9]*", GOTO="do_pss" KERNEL=="nbd[0-9]*", GOTO="do_pss" KERNEL=="md[0-9]*|md_d[0-9]*|md/*", GOTO="do_pss" GOTO="pss_end" LABEL="do_pss" # by-path (parent device path) ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="", DEVPATH!="*/virtual/*", IMPORT PATH_ID ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="?*", SYMLINK+="disk/by-path/$env{ID_PATH}" ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="?*", SYMLINK+="disk/by-path/$env{ID_PATH}-part%n" # by-label/by-uuid links (filesystem metadata) ENV{ID_FS_USAGE}=="filesystem|other|crypto", ENV{ID_FS_UUID_ENC}=="?*", SYMLINK+="disk/by-uuid/$env{ID_FS_UUID_ENC}" ENV{ID_FS_USAGE}=="filesystem|other", ENV{ID_FS_LABEL_ENC}=="?*", SYMLINK+="disk/by-label/$env{ID_FS_LABEL_ENC}" LABEL="pss_end" modules.d/95udev-rules/load-modules.sh000075500000000116151701010110013614 0ustar00#!/bin/sh # Implement blacklisting for udev-loaded modules modprobe -b "$@" modules.d/95udev-rules/module-setup.sh000075500000006405151701010110013661 0ustar00#!/bin/bash # called by dracut install() { local _i # Fixme: would be nice if we didn't have to guess, which rules to grab.... # ultimately, /lib/initramfs/rules.d or somesuch which includes links/copies # of the rules we want so that we just copy those in would be best inst_multiple udevadm cat uname blkid 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 [ -x "$_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!" exit 1 fi inst_rules \ 40-redhat.rules \ 50-firmware.rules \ 50-udev.rules \ 50-udev-default.rules \ 55-scsi-sg3_id.rules \ 58-scsi-sg3_symlink.rules \ 59-scsi-sg3_utils.rules \ 60-block.rules \ 60-pcmcia.rules \ 60-persistent-storage.rules \ 61-persistent-storage-edd.rules \ 70-uaccess.rules \ 71-seat.rules \ 73-seat-late.rules \ 75-net-description.rules \ 80-drivers.rules 95-udev-late.rules \ 80-net-name-slot.rules\ 80-net-setup-link.rules \ 95-late.rules \ "$moddir/59-persistent-storage.rules" \ "$moddir/61-persistent-storage.rules" \ ${NULL} prepare_udev_rules 59-persistent-storage.rules 61-persistent-storage.rules # debian udev rules inst_rules 91-permissions.rules # eudev rules inst_rules 80-drivers-modprobe.rules if dracut_module_included "systemd"; then inst_multiple -o ${systemdutildir}/network/*.link [[ $hostonly ]] && inst_multiple -H -o /etc/systemd/network/*.link fi { for i in cdrom tape dialout floppy; do if ! grep -q "^$i:" "$initdir/etc/group" 2>/dev/null; then if ! grep "^$i:" /etc/group 2>/dev/null; then case $i in cdrom) echo "$i:x:11:";; dialout) echo "$i:x:18:";; floppy) echo "$i:x:19:";; tape) echo "$i:x:33:";; esac fi fi done } >> "$initdir/etc/group" inst_multiple -o \ ${udevdir}/ata_id \ ${udevdir}/cdrom_id \ ${udevdir}/create_floppy_devices \ ${udevdir}/edd_id \ ${udevdir}/firmware.sh \ ${udevdir}/firmware \ ${udevdir}/firmware.agent \ ${udevdir}/hotplug.functions \ ${udevdir}/fw_unit_symlinks.sh \ ${udevdir}/hid2hci \ ${udevdir}/path_id \ ${udevdir}/input_id \ ${udevdir}/scsi_id \ ${udevdir}/usb_id \ ${udevdir}/pcmcia-socket-startup \ ${udevdir}/pcmcia-check-broken-cis inst_multiple -o /etc/pcmcia/config.opts [ -f /etc/arch-release ] && \ inst_script "$moddir/load-modules.sh" /lib/udev/load-modules.sh inst_libdir_file "libnss_files*" } modules.d/95virtfs/module-setup.sh000075500000001712151701010110013077 0ustar00#!/bin/bash # called by dracut check() { [[ $hostonly ]] || [[ $mount_needs ]] && { for fs in "${host_fs_types[@]}"; do [[ "$fs" == "9p" ]] && return 0 done return 255 } if type -P systemd-detect-virt >/dev/null 2>&1; then vm=$(systemd-detect-virt --vm >/dev/null 2>&1) (($? != 0)) && return 255 [[ $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 vendor < $i [[ "$vendor" == "QEMU" ]] && return 0 [[ "$vendor" == "Bochs" ]] && return 0 done return 255 } # called by dracut depends() { return 0 } # called by dracut installkernel() { instmods 9p 9pnet_virtio virtio_pci } # called by dracut install() { inst_hook cmdline 95 "$moddir/parse-virtfs.sh" inst_hook mount 99 "$moddir/mount-virtfs.sh" } modules.d/95virtfs/mount-virtfs.sh000075500000003507151701010110013135 0ustar00#!/bin/sh type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh filter_rootopts() { rootopts=$1 # strip ro and rw options local OLDIFS="$IFS" IFS=, set -- $rootopts IFS="$OLDIFS" local v while [ $# -gt 0 ]; do case $1 in rw|ro);; defaults);; *) v="$v,${1}";; esac shift done rootopts=${v#,} echo $rootopts } mount_root() { local _ret rootfs="9p" rflags="trans=virtio,version=9p2000.L" modprobe 9pnet_virtio mount -t ${rootfs} -o "$rflags",ro "${root#virtfs:}" "$NEWROOT" rootopts= if getargbool 1 rd.fstab -n rd_NO_FSTAB \ && ! getarg rootflags \ && [ -f "$NEWROOT/etc/fstab" ] \ && ! [ -L "$NEWROOT/etc/fstab" ]; then # if $NEWROOT/etc/fstab contains special mount options for # the root filesystem, # remount it with the proper options rootopts="defaults" while read dev mp fs opts rest || [ -n "$dev" ]; do # skip comments [ "${dev%%#*}" != "$dev" ] && continue if [ "$mp" = "/" ]; then rootopts=$opts break fi done < "$NEWROOT/etc/fstab" rootopts=$(filter_rootopts $rootopts) fi # we want rootflags (rflags) to take precedence so prepend rootopts to # them; rflags is guaranteed to not be empty rflags="${rootopts:+"${rootopts},"}${rflags}" umount "$NEWROOT" info "Remounting ${root#virtfs:} with -o ${rflags}" mount -t ${rootfs} -o "$rflags" "${root#virtfs:}" "$NEWROOT" 2>&1 | vinfo [ -f "$NEWROOT"/forcefsck ] && rm -f -- "$NEWROOT"/forcefsck 2>/dev/null [ -f "$NEWROOT"/.autofsck ] && rm -f -- "$NEWROOT"/.autofsck 2>/dev/null } if [ -n "$root" -a -z "${root%%virtfs:*}" ]; then mount_root fi : modules.d/95virtfs/parse-virtfs.sh000075500000000135151701010110013077 0ustar00#!/bin/sh if [ "${root%%:*}" = "virtfs" ] ; then modprobe 9pnet_virtio rootok=1 fi modules.d/97biosdevname/module-setup.sh000075500000000437151701010110014063 0ustar00#!/bin/bash # called by dracut check() { [[ "$mount_needs" ]] && return 1 require_binaries biosdevname || return 1 return 0 } # called by dracut depends() { return 0 } # called by dracut install() { inst_multiple biosdevname inst_rules 71-biosdevname.rules } modules.d/97biosdevname/parse-biosdevname.sh000075500000000465151701010110015045 0ustar00#!/bin/sh if ! getargbool 1 biosdevname; then info "biosdevname=0: removing biosdevname network renaming" udevproperty UDEV_BIOSDEVNAME= rm -f -- /etc/udev/rules.d/71-biosdevname.rules else info "biosdevname=1: activating biosdevname network renaming" udevproperty UDEV_BIOSDEVNAME=1 fi modules.d/98dracut-systemd/dracut-pre-pivot.service.8000064400000003005151701010110016505 0ustar00'\" t .\" Title: dracut-pre-pivot.service .\" Author: [see the "AUTHORS" section] .\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/> .\" Date: 10/09/2018 .\" Manual: dracut .\" Source: dracut .\" Language: English .\" .TH "DRACUT\-PRE\-PIVOT\&" "8" "10/09/2018" "dracut" "dracut" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" dracut-pre-pivot.service \- runs the dracut hooks before switching root .SH "SYNOPSIS" .sp dracut\-pre\-pivot\&.service .SH "DESCRIPTION" .sp This service runs all dracut hooks before the system switched to the real root\&. .SH "AUTHORS" .sp Harald Hoyer .SH "SEE ALSO" .sp \fBdracut\&.bootup\fR(7) \fBdracut\fR(8) modules.d/98dracut-systemd/dracut-pre-pivot.service.8.asc000064400000000655151701010110017262 0ustar00DRACUT-PRE-PIVOT.SERVICE(8) =========================== :doctype: manpage :man source: dracut :man manual: dracut NAME ---- dracut-pre-pivot.service - runs the dracut hooks before switching root SYNOPSIS -------- dracut-pre-pivot.service DESCRIPTION ----------- This service runs all dracut hooks before the system switched to the real root. AUTHORS ------- Harald Hoyer SEE ALSO -------- *dracut.bootup*(7) *dracut*(8) modules.d/98dracut-systemd/dracut-pre-pivot.sh000075500000001577151701010110015330 0ustar00#!/bin/sh export DRACUT_SYSTEMD=1 if [ -f /dracut-state.sh ]; then . /dracut-state.sh 2>/dev/null fi type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh source_conf /etc/conf.d make_trace_mem "hook pre-pivot" '1:shortmem' '2+:mem' '3+:slab' # pre pivot scripts are sourced just before we doing cleanup and switch over # to the new root. getarg 'rd.break=pre-pivot' 'rdbreak=pre-pivot' && emergency_shell -n pre-pivot "Break pre-pivot" source_hook pre-pivot # pre pivot cleanup scripts are sourced just before we switch over to the new root. getarg 'rd.break=cleanup' 'rdbreak=cleanup' && emergency_shell -n cleanup "Break cleanup" source_hook cleanup _bv=$(getarg rd.break -d rdbreak) && [ -z "$_bv" ] && emergency_shell -n switch_root "Break before switch_root" unset _bv # remove helper symlink [ -h /dev/root ] && rm -f -- /dev/root [ -h /dev/nfs ] && rm -f -- /dev/nfs exit 0 modules.d/98dracut-systemd/dracut-pre-trigger.service000064400000001622151701010110016644 0ustar00# This file is part of dracut. # # See dracut.bootup(7) for details [Unit] Description=dracut pre-trigger hook Documentation=man:dracut-pre-trigger.service(8) DefaultDependencies=no Before=systemd-udev-trigger.service dracut-initqueue.service After=dracut-pre-udev.service systemd-udevd.service systemd-tmpfiles-setup-dev.service Wants=dracut-pre-udev.service systemd-udevd.service ConditionPathExists=/usr/lib/initrd-release ConditionDirectoryNotEmpty=|/lib/dracut/hooks/pre-trigger ConditionKernelCommandLine=|rd.break=pre-trigger Conflicts=shutdown.target emergency.target [Service] Environment=DRACUT_SYSTEMD=1 Environment=NEWROOT=/sysroot Type=oneshot ExecStart=-/bin/dracut-pre-trigger StandardInput=null StandardOutput=syslog StandardError=syslog+console KillMode=process RemainAfterExit=yes # Bash ignores SIGTERM, so we send SIGHUP instead, to ensure that bash # terminates cleanly. KillSignal=SIGHUP modules.d/98dracut-systemd/dracut-pre-trigger.service.8000064400000003016151701010110017011 0ustar00'\" t .\" Title: dracut-pre-trigger.service .\" Author: [see the "AUTHORS" section] .\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/> .\" Date: 10/09/2018 .\" Manual: dracut .\" Source: dracut .\" Language: English .\" .TH "DRACUT\-PRE\-TRIGGER" "8" "10/09/2018" "dracut" "dracut" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" dracut-pre-trigger.service \- runs the dracut hooks before udevd is triggered .SH "SYNOPSIS" .sp dracut\-pre\-trigger\&.service .SH "DESCRIPTION" .sp This service runs all dracut hooks before udevd is triggered in the initramfs\&. .SH "AUTHORS" .sp Harald Hoyer .SH "SEE ALSO" .sp \fBdracut\&.bootup\fR(7) \fBdracut\fR(8) modules.d/98dracut-systemd/dracut-pre-trigger.service.8.asc000064400000000670151701010110017561 0ustar00DRACUT-PRE-TRIGGER.SERVICE(8) ============================= :doctype: manpage :man source: dracut :man manual: dracut NAME ---- dracut-pre-trigger.service - runs the dracut hooks before udevd is triggered SYNOPSIS -------- dracut-pre-trigger.service DESCRIPTION ----------- This service runs all dracut hooks before udevd is triggered in the initramfs. AUTHORS ------- Harald Hoyer SEE ALSO -------- *dracut.bootup*(7) *dracut*(8) modules.d/98dracut-systemd/dracut-pre-trigger.sh000075500000000723151701010110015622 0ustar00#!/bin/sh export DRACUT_SYSTEMD=1 if [ -f /dracut-state.sh ]; then . /dracut-state.sh 2>/dev/null fi type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh source_conf /etc/conf.d make_trace_mem "hook pre-trigger" '1:shortmem' '2+:mem' '3+:slab' source_hook pre-trigger getarg 'rd.break=pre-trigger' 'rdbreak=pre-trigger' && emergency_shell -n pre-trigger "Break pre-trigger" udevadm control --reload >/dev/null 2>&1 || : export -p > /dracut-state.sh exit 0 modules.d/98dracut-systemd/dracut-pre-udev.service000064400000001741151701010110016146 0ustar00# This file is part of dracut. # # See dracut.bootup(7) for details [Unit] Description=dracut pre-udev hook Documentation=man:dracut-pre-udev.service(8) DefaultDependencies=no Before=systemd-udevd.service dracut-pre-trigger.service After=dracut-cmdline.service Wants=dracut-cmdline.service ConditionPathExists=/usr/lib/initrd-release ConditionDirectoryNotEmpty=|/lib/dracut/hooks/pre-udev ConditionKernelCommandLine=|rd.break=pre-udev ConditionKernelCommandLine=|rd.driver.blacklist ConditionKernelCommandLine=|rd.driver.pre ConditionKernelCommandLine=|rd.driver.post ConditionPathExistsGlob=|/etc/cmdline.d/*.conf Conflicts=shutdown.target emergency.target [Service] Environment=DRACUT_SYSTEMD=1 Environment=NEWROOT=/sysroot Type=oneshot ExecStart=-/bin/dracut-pre-udev StandardInput=null StandardOutput=syslog StandardError=syslog+console KillMode=process RemainAfterExit=yes # Bash ignores SIGTERM, so we send SIGHUP instead, to ensure that bash # terminates cleanly. KillSignal=SIGHUP modules.d/98dracut-systemd/dracut-pre-udev.service.8000064400000003001151701010110016303 0ustar00'\" t .\" Title: dracut-pre-udev.service .\" Author: [see the "AUTHORS" section] .\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/> .\" Date: 10/09/2018 .\" Manual: dracut .\" Source: dracut .\" Language: English .\" .TH "DRACUT\-PRE\-UDEV\&." "8" "10/09/2018" "dracut" "dracut" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" dracut-pre-udev.service \- runs the dracut hooks before udevd is started .SH "SYNOPSIS" .sp dracut\-pre\-udev\&.service .SH "DESCRIPTION" .sp This service runs all dracut hooks before udevd is started in the initramfs\&. .SH "AUTHORS" .sp Harald Hoyer .SH "SEE ALSO" .sp \fBdracut\&.bootup\fR(7) \fBdracut\fR(8) modules.d/98dracut-systemd/dracut-pre-udev.service.8.asc000064400000000650151701010110017057 0ustar00DRACUT-PRE-UDEV.SERVICE(8) ========================== :doctype: manpage :man source: dracut :man manual: dracut NAME ---- dracut-pre-udev.service - runs the dracut hooks before udevd is started SYNOPSIS -------- dracut-pre-udev.service DESCRIPTION ----------- This service runs all dracut hooks before udevd is started in the initramfs. AUTHORS ------- Harald Hoyer SEE ALSO -------- *dracut.bootup*(7) *dracut*(8) modules.d/98dracut-systemd/dracut-pre-udev.sh000075500000002605151701010110015123 0ustar00#!/bin/sh export DRACUT_SYSTEMD=1 if [ -f /dracut-state.sh ]; then . /dracut-state.sh 2>/dev/null fi type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh source_conf /etc/conf.d make_trace_mem "hook pre-udev" '1:shortmem' '2+:mem' '3+:slab' # pre pivot scripts are sourced just before we doing cleanup and switch over # to the new root. getarg 'rd.break=pre-udev' 'rdbreak=pre-udev' && emergency_shell -n pre-udev "Break pre-udev" source_hook pre-udev _modprobe_d=/etc/modprobe.d if [ -d /usr/lib/modprobe.d ] ; then _modprobe_d=/usr/lib/modprobe.d elif [ -d /lib/modprobe.d ] ; then _modprobe_d=/lib/modprobe.d elif [ ! -d $_modprobe_d ] ; then mkdir -p $_modprobe_d fi for i in $(getargs rd.driver.pre -d rdloaddriver=); do ( IFS=, for p in $i; do modprobe $p 2>&1 | vinfo done ) done [ -d /etc/modprobe.d ] || mkdir -p /etc/modprobe.d for i in $(getargs rd.driver.blacklist -d rdblacklist=); do ( IFS=, for p in $i; do echo "blacklist $p" >> $_modprobe_d/initramfsblacklist.conf done ) done for p in $(getargs rd.driver.post -d rdinsmodpost=); do echo "blacklist $p" >> $_modprobe_d/initramfsblacklist.conf _do_insmodpost=1 done [ -n "$_do_insmodpost" ] && initqueue --settled --unique --onetime insmodpost.sh unset _do_insmodpost _modprobe_d unset i export -p > /dracut-state.sh exit 0 modules.d/98dracut-systemd/dracut-shutdown-onfailure.service000064400000000465151701010110020256 0ustar00# This file is part of dracut. # # See dracut.bootup(7) for details [Unit] Description=Service executing upon dracut-shutdown failure to perform cleanup Documentation=man:dracut-shutdown.service(8) DefaultDependencies=no [Service] Type=oneshot ExecStart=-/bin/rm /run/initramfs/shutdown StandardError=null modules.d/98dracut-systemd/dracut-shutdown.service000064400000000670151701010110016272 0ustar00# This file is part of dracut. # # See dracut.bootup(7) for details [Unit] Description=Restore /run/initramfs on shutdown Documentation=man:dracut-shutdown.service(8) After=local-fs.target boot.mount boot.automount Wants=local-fs.target ConditionPathExists=!/run/initramfs/bin/sh OnFailure=dracut-shutdown-onfailure.service [Service] RemainAfterExit=yes Type=oneshot ExecStart=/bin/true ExecStop=/usr/lib/dracut/dracut-initramfs-restore modules.d/98dracut-systemd/dracut-shutdown.service.8000064400000007345151701010110016446 0ustar00'\" t .\" Title: dracut-shutdown.service .\" Author: [see the "AUTHORS" section] .\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/> .\" Date: 12/17/2025 .\" Manual: dracut .\" Source: dracut .\" Language: English .\" .TH "DRACUT\-SHUTDOWN\&.S" "8" "12/17/2025" "dracut" "dracut" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" dracut-shutdown.service \- unpack the initramfs to /run/initramfs .SH "SYNOPSIS" .sp dracut\-shutdown\&.service .SH "DESCRIPTION" .sp This service unpacks the initramfs image to /run/initramfs\&. systemd pivots into /run/initramfs at shutdown, so the root filesystem can be safely unmounted\&. .sp The following steps are executed during a shutdown: .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} systemd switches to the shutdown\&.target .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} systemd starts /lib/systemd/system/shutdown\&.target\&.wants/dracut\-shutdown\&.service .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} dracut\-shutdown\&.service executes /usr/lib/dracut/dracut\-initramfs\-restore which unpacks the initramfs to /run/initramfs .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} systemd finishes shutdown\&.target .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} systemd kills all processes .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} systemd tries to unmount everything and mounts the remaining read\-only .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} systemd checks, if there is a /run/initramfs/shutdown executable .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} if yes, it does a pivot_root to /run/initramfs and executes \&./shutdown\&. The old root is then mounted on /oldroot\&. /usr/lib/dracut/modules\&.d/99shutdown/shutdown\&.sh is the shutdown executable\&. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} shutdown will try to umount every /oldroot mount and calls the various shutdown hooks from the dracut modules .RE .sp This ensures, that all devices are disassembled and unmounted cleanly\&. .sp To debug the shutdown process, you can get a shell in the shutdown procedure by injecting "rd\&.break=pre\-shutdown rd\&.shell" or "rd\&.break=shutdown rd\&.shell"\&. .sp .if n \{\ .RS 4 .\} .nf # mkdir \-p /run/initramfs/etc/cmdline\&.d # echo "rd\&.break=pre\-shutdown rd\&.shell" > /run/initramfs/etc/cmdline\&.d/debug\&.conf # touch /run/initramfs/\&.need_shutdown .fi .if n \{\ .RE .\} .sp In case the unpack of the initramfs fails, dracut\-shutdown\-onfailure\&.service executes to make sure switch root doesn\(cqt happen, since it would result in switching to an incomplete initramfs\&. .SH "AUTHORS" .sp Harald Hoyer .SH "SEE ALSO" .sp \fBdracut\fR(8) modules.d/98dracut-systemd/dracut-shutdown.service.8.asc000064400000003530151701010110017203 0ustar00DRACUT-SHUTDOWN.SERVICE(8) =========================== :doctype: manpage :man source: dracut :man manual: dracut NAME ---- dracut-shutdown.service - unpack the initramfs to /run/initramfs SYNOPSIS -------- dracut-shutdown.service DESCRIPTION ----------- This service unpacks the initramfs image to /run/initramfs. systemd pivots into /run/initramfs at shutdown, so the root filesystem can be safely unmounted. The following steps are executed during a shutdown: * systemd switches to the shutdown.target * systemd starts /lib/systemd/system/shutdown.target.wants/dracut-shutdown.service * dracut-shutdown.service executes /usr/lib/dracut/dracut-initramfs-restore which unpacks the initramfs to /run/initramfs * systemd finishes shutdown.target * systemd kills all processes * systemd tries to unmount everything and mounts the remaining read-only * systemd checks, if there is a /run/initramfs/shutdown executable * if yes, it does a pivot_root to /run/initramfs and executes ./shutdown. The old root is then mounted on /oldroot. /usr/lib/dracut/modules.d/99shutdown/shutdown.sh is the shutdown executable. * shutdown will try to umount every /oldroot mount and calls the various shutdown hooks from the dracut modules This ensures, that all devices are disassembled and unmounted cleanly. To debug the shutdown process, you can get a shell in the shutdown procedure by injecting "rd.break=pre-shutdown rd.shell" or "rd.break=shutdown rd.shell". ---- # mkdir -p /run/initramfs/etc/cmdline.d # echo "rd.break=pre-shutdown rd.shell" > /run/initramfs/etc/cmdline.d/debug.conf # touch /run/initramfs/.need_shutdown ---- In case the unpack of the initramfs fails, dracut-shutdown-onfailure.service executes to make sure switch root doesn't happen, since it would result in switching to an incomplete initramfs. AUTHORS ------- Harald Hoyer SEE ALSO -------- *dracut*(8) modules.d/98dracut-systemd/dracut-tmpfiles.conf000064400000000207151701010110015523 0ustar00d /run/initramfs 0755 root root - d /run/initramfs/log 0755 root root - L /var/log - - - - ../run/initramfs/log modules.d/98dracut-systemd/emergency.service000064400000001264151701010110015115 0ustar00# This file is part of dracut. # # See dracut.bootup(7) for details [Unit] Description=Emergency Shell DefaultDependencies=no After=systemd-vconsole-setup.service Wants=systemd-vconsole-setup.service Conflicts=shutdown.target Before=shutdown.target [Service] Environment=HOME=/ Environment=DRACUT_SYSTEMD=1 Environment=NEWROOT=/sysroot WorkingDirectory=/ ExecStart=/bin/dracut-emergency ExecStopPost=-/usr/bin/systemctl --fail --no-block default Type=idle StandardInput=tty-force StandardOutput=inherit StandardError=inherit KillMode=process IgnoreSIGPIPE=no TasksMax=infinity # Bash ignores SIGTERM, so we send SIGHUP instead, to ensure that bash # terminates cleanly. KillSignal=SIGHUP modules.d/98dracut-systemd/module-setup.sh000075500000004030151701010110014531 0ustar00#!/bin/bash # called by dracut check() { [[ $mount_needs ]] && return 1 if ! dracut_module_included "systemd-initrd"; then derror "dracut-systemd needs systemd-initrd in the initramfs" return 1 fi return 0 } # called by dracut depends() { echo "systemd-initrd" return 0 } installkernel() { return 0 } # called by dracut install() { local _mods inst_script "$moddir/dracut-emergency.sh" /bin/dracut-emergency inst_simple "$moddir/emergency.service" ${systemdsystemunitdir}/emergency.service inst_simple "$moddir/dracut-emergency.service" ${systemdsystemunitdir}/dracut-emergency.service inst_simple "$moddir/emergency.service" ${systemdsystemunitdir}/rescue.service ln_r "${systemdsystemunitdir}/initrd.target" "${systemdsystemunitdir}/default.target" inst_script "$moddir/dracut-cmdline.sh" /bin/dracut-cmdline inst_script "$moddir/dracut-cmdline-ask.sh" /bin/dracut-cmdline-ask inst_script "$moddir/dracut-pre-udev.sh" /bin/dracut-pre-udev inst_script "$moddir/dracut-pre-trigger.sh" /bin/dracut-pre-trigger inst_script "$moddir/dracut-initqueue.sh" /bin/dracut-initqueue inst_script "$moddir/dracut-pre-mount.sh" /bin/dracut-pre-mount inst_script "$moddir/dracut-mount.sh" /bin/dracut-mount inst_script "$moddir/dracut-pre-pivot.sh" /bin/dracut-pre-pivot inst_script "$moddir/rootfs-generator.sh" $systemdutildir/system-generators/dracut-rootfs-generator mkdir -p "${initdir}/$systemdsystemunitdir/initrd.target.wants" for i in \ dracut-cmdline.service \ dracut-cmdline-ask.service \ dracut-initqueue.service \ dracut-mount.service \ dracut-pre-mount.service \ dracut-pre-pivot.service \ dracut-pre-trigger.service \ dracut-pre-udev.service \ ; do inst_simple "$moddir/${i}" "$systemdsystemunitdir/${i}" systemctl -q --root "$initdir" add-wants initrd.target "$i" done inst_simple "$moddir/dracut-tmpfiles.conf" "$tmpfilesdir/dracut-tmpfiles.conf" } modules.d/98dracut-systemd/rootfs-generator.sh000075500000010070151701010110015407 0ustar00#!/bin/sh type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh generator_wait_for_dev() { local _name local _timeout _name="$(str_replace "$1" '/' '\x2f')" _timeout=$(getarg rd.timeout) _timeout=${_timeout:-0} if ! [ -e "$hookdir/initqueue/finished/devexists-${_name}.sh" ]; then # If a LUKS device needs unlocking via systemd in the initrd, assume # it's for the root device. In that case, don't block on it if it's # after remote-fs-pre.target since the initqueue is ordered before it so # it will never actually show up (think Tang-pinned rootfs). cat > "$hookdir/initqueue/finished/devexists-${_name}.sh" << EOF if ! grep -q After=remote-fs-pre.target /run/systemd/generator/systemd-cryptsetup@*.service 2>/dev/null; then [ -e "$1" ] fi EOF { printf '[ -e "%s" ] || ' $1 printf 'warn "\"%s\" does not exist"\n' $1 } >> "$hookdir/emergency/80-${_name}.sh" fi _name=$(dev_unit_name "$1") if ! [ -L "$GENERATOR_DIR"/initrd.target.wants/${_name}.device ]; then [ -d "$GENERATOR_DIR"/initrd.target.wants ] || mkdir -p "$GENERATOR_DIR"/initrd.target.wants ln -s ../${_name}.device "$GENERATOR_DIR"/initrd.target.wants/${_name}.device fi if ! [ -f "$GENERATOR_DIR"/${_name}.device.d/timeout.conf ]; then mkdir -p "$GENERATOR_DIR"/${_name}.device.d { echo "[Unit]" echo "JobTimeoutSec=$_timeout" echo "JobRunningTimeoutSec=$_timeout" } > "$GENERATOR_DIR"/${_name}.device.d/timeout.conf fi } generator_mount_rootfs() { local _type=$2 local _flags=$3 local _name [ -z "$1" ] && return 0 _name=$(dev_unit_name "$1") [ -d "$GENERATOR_DIR" ] || mkdir -p "$GENERATOR_DIR" if ! [ -f "$GENERATOR_DIR"/sysroot.mount ]; then { echo "[Unit]" echo "Before=initrd-root-fs.target" echo "Requires=systemd-fsck@${_name}.service" echo "After=systemd-fsck@${_name}.service" echo "[Mount]" echo "Where=/sysroot" echo "What=$1" echo "Options=${_flags}" echo "Type=${_type}" } > "$GENERATOR_DIR"/sysroot.mount fi if ! [ -L "$GENERATOR_DIR"/initrd-root-fs.target.requires/sysroot.mount ]; then [ -d "$GENERATOR_DIR"/initrd-root-fs.target.requires ] || mkdir -p "$GENERATOR_DIR"/initrd-root-fs.target.requires ln -s ../sysroot.mount "$GENERATOR_DIR"/initrd-root-fs.target.requires/sysroot.mount fi } generator_fsck_after_pre_mount() { local _name [ -z "$1" ] && return 0 _name=$(dev_unit_name "$1") [ -d /run/systemd/generator/systemd-fsck@${_name}.service.d ] || mkdir -p /run/systemd/generator/systemd-fsck@${_name}.service.d if ! [ -f /run/systemd/generator/systemd-fsck@${_name}.service.d/after-pre-mount.conf ]; then { echo "[Unit]" echo "After=dracut-pre-mount.service" } > /run/systemd/generator/systemd-fsck@${_name}.service.d/after-pre-mount.conf fi } root=$(getarg root=) case "$root" in block:LABEL=*|LABEL=*) root="${root#block:}" root="$(echo $root | sed 's,/,\\x2f,g')" root="block:/dev/disk/by-label/${root#LABEL=}" rootok=1 ;; block:UUID=*|UUID=*) root="${root#block:}" root="block:/dev/disk/by-uuid/${root#UUID=}" rootok=1 ;; block:PARTUUID=*|PARTUUID=*) root="${root#block:}" root="block:/dev/disk/by-partuuid/${root#PARTUUID=}" rootok=1 ;; block:PARTLABEL=*|PARTLABEL=*) root="${root#block:}" root="block:/dev/disk/by-partlabel/${root#PARTLABEL=}" rootok=1 ;; /dev/nfs) # ignore legacy /dev/nfs ;; /dev/*) root="block:${root}" rootok=1 ;; esac GENERATOR_DIR="$1" if [ "$rootok" = "1" ]; then generator_wait_for_dev "${root#block:}" "$RDRETRY" generator_fsck_after_pre_mount "${root#block:}" strstr "$(cat /proc/cmdline)" 'root=' || generator_mount_rootfs "${root#block:}" "$(getarg rootfstype=)" "$(getarg rootflags=)" fi exit 0 modules.d/98dracut-systemd/dracut-cmdline-ask.service000064400000001517151701010110016607 0ustar00# This file is part of dracut. # # See dracut.bootup(7) for details [Unit] Description=dracut ask for additional cmdline parameters DefaultDependencies=no Before=dracut-cmdline.service After=systemd-journald.socket After=systemd-vconsole-setup.service Requires=systemd-vconsole-setup.service Wants=systemd-journald.socket ConditionPathExists=/usr/lib/initrd-release ConditionKernelCommandLine=|rd.cmdline=ask ConditionPathExistsGlob=|/etc/cmdline.d/*.conf Conflicts=shutdown.target emergency.target [Service] Environment=DRACUT_SYSTEMD=1 Environment=NEWROOT=/sysroot Type=oneshot ExecStart=-/bin/dracut-cmdline-ask StandardInput=tty StandardOutput=inherit StandardError=inherit RemainAfterExit=yes KillMode=process IgnoreSIGPIPE=no # Bash ignores SIGTERM, so we send SIGHUP instead, to ensure that bash # terminates cleanly. KillSignal=SIGHUP modules.d/98dracut-systemd/dracut-cmdline-ask.sh000075500000000642151701010110015562 0ustar00#!/bin/bash type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh getarg "rd.cmdline=ask" || exit 0 sleep 0.5 echo sleep 0.5 echo sleep 0.5 echo echo echo echo echo "Enter additional kernel command line parameter (end with ctrl-d or .)" while read -e -p "> " line || [ -n "$line" ]; do [[ "$line" == "." ]] && break [[ "$line" ]] && printf -- "%s\n" "$line" >> /etc/cmdline.d/99-cmdline-ask.conf done exit 0 modules.d/98dracut-systemd/dracut-cmdline.service000064400000001610151701010110016025 0ustar00# This file is part of dracut. # # See dracut.bootup(7) for details [Unit] Description=dracut cmdline hook Documentation=man:dracut-cmdline.service(8) DefaultDependencies=no Before=dracut-pre-udev.service After=systemd-journald.socket Wants=systemd-journald.socket ConditionPathExists=/usr/lib/initrd-release ConditionPathExistsGlob=|/etc/cmdline.d/*.conf ConditionDirectoryNotEmpty=|/lib/dracut/hooks/cmdline ConditionKernelCommandLine=|rd.break=cmdline ConditionKernelCommandLine=|resume ConditionKernelCommandLine=|noresume Conflicts=shutdown.target emergency.target [Service] Environment=DRACUT_SYSTEMD=1 Environment=NEWROOT=/sysroot Type=oneshot ExecStart=-/bin/dracut-cmdline StandardInput=null StandardOutput=syslog StandardError=syslog+console KillMode=process RemainAfterExit=yes # Bash ignores SIGTERM, so we send SIGHUP instead, to ensure that bash # terminates cleanly. KillSignal=SIGHUP modules.d/98dracut-systemd/dracut-cmdline.service.8000064400000003023151701010110016173 0ustar00'\" t .\" Title: dracut-cmdline.service .\" Author: [see the "AUTHORS" section] .\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/> .\" Date: 10/09/2018 .\" Manual: dracut .\" Source: dracut .\" Language: English .\" .TH "DRACUT\-CMDLINE\&.SE" "8" "10/09/2018" "dracut" "dracut" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" dracut-cmdline.service \- runs the dracut hooks to parse the kernel command line .SH "SYNOPSIS" .sp dracut\-cmdline\&.service .SH "DESCRIPTION" .sp This service runs all the dracut hooks to parse the kernel command line in the initramfs\&. .SH "AUTHORS" .sp Harald Hoyer .SH "SEE ALSO" .sp \fBdracut\&.bootup\fR(7) \fBdracut\fR(8) modules.d/98dracut-systemd/dracut-cmdline.service.8.asc000064400000000672151701010110016747 0ustar00DRACUT-CMDLINE.SERVICE(8) ========================= :doctype: manpage :man source: dracut :man manual: dracut NAME ---- dracut-cmdline.service - runs the dracut hooks to parse the kernel command line SYNOPSIS -------- dracut-cmdline.service DESCRIPTION ----------- This service runs all the dracut hooks to parse the kernel command line in the initramfs. AUTHORS ------- Harald Hoyer SEE ALSO -------- *dracut.bootup*(7) *dracut*(8) modules.d/98dracut-systemd/dracut-cmdline.sh000075500000005133151701010110015006 0ustar00#!/bin/sh if [ -f /dracut-state.sh ]; then . /dracut-state.sh 2>/dev/null fi type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh [ -f /usr/lib/initrd-release ] && . /usr/lib/initrd-release [ -n "$VERSION" ] && info "dracut-$VERSION" if ! getargbool 1 'rd.hostonly'; then [ -f /etc/cmdline.d/99-cmdline-ask.conf ] && mv /etc/cmdline.d/99-cmdline-ask.conf /tmp/99-cmdline-ask.conf remove_hostonly_files [ -f /tmp/99-cmdline-ask.conf ] && mv /tmp/99-cmdline-ask.conf /etc/cmdline.d/99-cmdline-ask.conf fi info "Using kernel command line parameters:" $(getcmdline) getargbool 0 rd.udev.log-priority=info -d rd.udev.info -d -n -y rdudevinfo && echo 'udev_log="info"' >> /etc/udev/udev.conf getargbool 0 rd.udev.log-priority=debug -d rd.udev.debug -d -n -y rdudevdebug && echo 'udev_log="debug"' >> /etc/udev/udev.conf source_conf /etc/conf.d # Get the "root=" parameter from the kernel command line, but differentiate # between the case where it was set to the empty string and the case where it # wasn't specified at all. if ! root="$(getarg root=)"; then root_unset='UNSET' fi rflags="$(getarg rootflags=)" getargbool 0 ro && rflags="${rflags},ro" getargbool 0 rw && rflags="${rflags},rw" rflags="${rflags#,}" fstype="$(getarg rootfstype=)" if [ -z "$fstype" ]; then fstype="auto" fi export root export rflags export fstype make_trace_mem "hook cmdline" '1+:mem' '1+:iomem' '3+:slab' # run scriptlets to parse the command line getarg 'rd.break=cmdline' -d 'rdbreak=cmdline' && emergency_shell -n cmdline "Break before cmdline" source_hook cmdline [ -f /lib/dracut/parse-resume.sh ] && . /lib/dracut/parse-resume.sh case "${root}${root_unset}" in block:LABEL=*|LABEL=*) root="${root#block:}" root="$(echo $root | sed 's,/,\\x2f,g')" root="block:/dev/disk/by-label/${root#LABEL=}" rootok=1 ;; block:UUID=*|UUID=*) root="${root#block:}" root="block:/dev/disk/by-uuid/${root#UUID=}" rootok=1 ;; block:PARTUUID=*|PARTUUID=*) root="${root#block:}" root="block:/dev/disk/by-partuuid/${root#PARTUUID=}" rootok=1 ;; block:PARTLABEL=*|PARTLABEL=*) root="${root#block:}" root="block:/dev/disk/by-partlabel/${root#PARTLABEL=}" rootok=1 ;; /dev/*) root="block:${root}" rootok=1 ;; UNSET|gpt-auto) # systemd's gpt-auto-generator handles this case. rootok=1 ;; esac [ -z "${root}${root_unset}" ] && die "Empty root= argument" [ -z "$rootok" ] && die "Don't know how to handle 'root=$root'" export root rflags fstype netroot NEWROOT export -p > /dracut-state.sh exit 0 modules.d/98dracut-systemd/dracut-emergency.service000064400000001251151701010110016371 0ustar00# This file is part of dracut. # # See dracut.bootup(7) for details [Unit] Description=Dracut Emergency Shell DefaultDependencies=no After=systemd-vconsole-setup.service Wants=systemd-vconsole-setup.service Conflicts=shutdown.target emergency.target [Service] Environment=HOME=/ Environment=DRACUT_SYSTEMD=1 Environment=NEWROOT=/sysroot WorkingDirectory=/ ExecStart=-/bin/dracut-emergency ExecStopPost=-/bin/rm -f -- /.console_lock Type=oneshot StandardInput=tty-force StandardOutput=inherit StandardError=inherit KillMode=process IgnoreSIGPIPE=no TasksMax=infinity # Bash ignores SIGTERM, so we send SIGHUP instead, to ensure that bash # terminates cleanly. KillSignal=SIGHUP modules.d/98dracut-systemd/dracut-emergency.sh000075500000002546151701010110015356 0ustar00#!/bin/sh export DRACUT_SYSTEMD=1 if [ -f /dracut-state.sh ]; then . /dracut-state.sh 2>/dev/null fi type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh source_conf /etc/conf.d type plymouth >/dev/null 2>&1 && plymouth quit export _rdshell_name="dracut" action="Boot" hook="emergency" _emergency_action=$(getarg rd.emergency) if getargbool 1 rd.shell -d -y rdshell || getarg rd.break -d rdbreak; then FSTXT="/run/dracut/fsck/fsck_help_$fstype.txt" source_hook "$hook" echo rdsosreport echo echo echo 'Entering emergency mode. Exit the shell to continue.' echo 'Type "journalctl" to view system logs.' 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.' echo echo [ -f "$FSTXT" ] && cat "$FSTXT" [ -f /etc/profile ] && . /etc/profile [ -z "$PS1" ] && export PS1="$_name:\${PWD}# " exec sh -i -l else export hook="shutdown-emergency" warn "$action has failed. To debug this issue add \"rd.shell rd.debug\" to the kernel command line." source_hook "$hook" [ -z "$_emergency_action" ] && _emergency_action=halt fi /bin/rm -f -- /.console_lock case "$_emergency_action" in reboot) reboot || exit 1;; poweroff) poweroff || exit 1;; halt) halt || exit 1;; esac exit 0 modules.d/98dracut-systemd/dracut-initqueue.service000064400000001465151701010110016432 0ustar00# This file is part of dracut. # # See dracut.bootup(7) for details [Unit] Description=dracut initqueue hook Documentation=man:dracut-initqueue.service(8) DefaultDependencies=no Before=remote-fs-pre.target Wants=remote-fs-pre.target After=systemd-udev-trigger.service Wants=systemd-udev-trigger.service ConditionPathExists=/usr/lib/initrd-release ConditionPathExists=|/lib/dracut/need-initqueue ConditionKernelCommandLine=|rd.break=initqueue Conflicts=shutdown.target emergency.target [Service] Environment=DRACUT_SYSTEMD=1 Environment=NEWROOT=/sysroot Type=oneshot ExecStart=-/bin/dracut-initqueue StandardInput=null StandardOutput=syslog StandardError=syslog+console KillMode=process RemainAfterExit=yes # Bash ignores SIGTERM, so we send SIGHUP instead, to ensure that bash # terminates cleanly. KillSignal=SIGHUP modules.d/98dracut-systemd/dracut-initqueue.service.8000064400000003016151701010110016572 0ustar00'\" t .\" Title: dracut-initqueue.service .\" Author: [see the "AUTHORS" section] .\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/> .\" Date: 10/09/2018 .\" Manual: dracut .\" Source: dracut .\" Language: English .\" .TH "DRACUT\-INITQUEUE\&." "8" "10/09/2018" "dracut" "dracut" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" dracut-initqueue.service \- runs the dracut main loop to find the real root .SH "SYNOPSIS" .sp dracut\-initqueue\&.service .SH "DESCRIPTION" .sp This service runs all the main loop of dracut in the initramfs to find the real root\&. .SH "AUTHORS" .sp Harald Hoyer .SH "SEE ALSO" .sp \fBdracut\&.bootup\fR(7) \fBdracut\fR(8) modules.d/98dracut-systemd/dracut-initqueue.service.8.asc000064400000000667151701010110017350 0ustar00DRACUT-INITQUEUE.SERVICE(8) =========================== :doctype: manpage :man source: dracut :man manual: dracut NAME ---- dracut-initqueue.service - runs the dracut main loop to find the real root SYNOPSIS -------- dracut-initqueue.service DESCRIPTION ----------- This service runs all the main loop of dracut in the initramfs to find the real root. AUTHORS ------- Harald Hoyer SEE ALSO -------- *dracut.bootup*(7) *dracut*(8) modules.d/98dracut-systemd/dracut-initqueue.sh000075500000004143151701010110015403 0ustar00#!/bin/sh export DRACUT_SYSTEMD=1 if [ -f /dracut-state.sh ]; then . /dracut-state.sh 2>/dev/null fi type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh source_conf /etc/conf.d make_trace_mem "hook initqueue" '1:shortmem' '2+:mem' '3+:slab' getarg 'rd.break=initqueue' -d 'rdbreak=initqueue' && emergency_shell -n initqueue "Break before initqueue" RDRETRY=$(getarg rd.retry -d 'rd_retry=') RDRETRY=${RDRETRY:-180} RDRETRY=$(($RDRETRY*2)) export RDRETRY main_loop=0 export main_loop while :; do check_finished && break udevadm settle --exit-if-exists=$hookdir/initqueue/work check_finished && break if [ -f $hookdir/initqueue/work ]; then rm -f -- "$hookdir/initqueue/work" fi for job in $hookdir/initqueue/*.sh; do [ -e "$job" ] || break job=$job . $job check_finished && break 2 done udevadm settle --timeout=0 >/dev/null 2>&1 || continue for job in $hookdir/initqueue/settled/*.sh; do [ -e "$job" ] || break job=$job . $job check_finished && break 2 done udevadm settle --timeout=0 >/dev/null 2>&1 || continue # no more udev jobs and queues empty. sleep 0.5 for i in /run/systemd/ask-password/ask.*; do [ -e "$i" ] && continue 2 done if [ $main_loop -gt $((2*$RDRETRY/3)) ]; then warn "dracut-initqueue timeout - starting timeout scripts" for job in $hookdir/initqueue/timeout/*.sh; do [ -e "$job" ] || break job=$job . $job udevadm settle --timeout=0 >/dev/null 2>&1 || main_loop=0 [ -f $hookdir/initqueue/work ] && main_loop=0 [ $main_loop -eq 0 ] && break done fi main_loop=$(($main_loop+1)) if [ $main_loop -gt $RDRETRY ]; then if ! [ -f /sysroot/etc/fstab ] || ! [ -e /sysroot/sbin/init ] ; then emergency_shell "Could not boot." fi warn "Not all disks have been found." warn "You might want to regenerate your initramfs." break fi done unset job unset queuetriggered unset main_loop unset RDRETRY export -p > /dracut-state.sh exit 0 modules.d/98dracut-systemd/dracut-mount.service000064400000001431151701010110015555 0ustar00# This file is part of dracut. # # See dracut.bootup(7) for details [Unit] Description=dracut mount hook Documentation=man:dracut-mount.service(8) After=initrd-root-fs.target initrd-parse-etc.service After=dracut-initqueue.service dracut-pre-mount.service ConditionPathExists=/usr/lib/initrd-release ConditionDirectoryNotEmpty=|/lib/dracut/hooks/mount ConditionKernelCommandLine=|rd.break=mount DefaultDependencies=no Conflicts=shutdown.target emergency.target [Service] Environment=DRACUT_SYSTEMD=1 Environment=NEWROOT=/sysroot Type=oneshot ExecStart=-/bin/dracut-mount StandardInput=null StandardOutput=syslog StandardError=syslog+console KillMode=process RemainAfterExit=yes # Bash ignores SIGTERM, so we send SIGHUP instead, to ensure that bash # terminates cleanly. KillSignal=SIGHUP modules.d/98dracut-systemd/dracut-mount.service.8000064400000002773151701010110015735 0ustar00'\" t .\" Title: dracut-mount.service .\" Author: [see the "AUTHORS" section] .\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/> .\" Date: 10/09/2018 .\" Manual: dracut .\" Source: dracut .\" Language: English .\" .TH "DRACUT\-MOUNT\&.SERV" "8" "10/09/2018" "dracut" "dracut" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" dracut-mount.service \- runs the dracut hooks after /sysroot is mounted .SH "SYNOPSIS" .sp dracut\-mount\&.service .SH "DESCRIPTION" .sp This service runs all dracut hooks after the real root is mounted on /sysroot\&. .SH "AUTHORS" .sp Harald Hoyer .SH "SEE ALSO" .sp \fBdracut\&.bootup\fR(7) \fBdracut\fR(8) modules.d/98dracut-systemd/dracut-mount.service.8.asc000064400000000640151701010110016471 0ustar00DRACUT-MOUNT.SERVICE(8) ======================= :doctype: manpage :man source: dracut :man manual: dracut NAME ---- dracut-mount.service - runs the dracut hooks after /sysroot is mounted SYNOPSIS -------- dracut-mount.service DESCRIPTION ----------- This service runs all dracut hooks after the real root is mounted on /sysroot. AUTHORS ------- Harald Hoyer SEE ALSO -------- *dracut.bootup*(7) *dracut*(8) modules.d/98dracut-systemd/dracut-mount.sh000075500000002034151701010110014532 0ustar00#!/bin/sh export DRACUT_SYSTEMD=1 if [ -f /dracut-state.sh ]; then . /dracut-state.sh 2>/dev/null fi type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh source_conf /etc/conf.d make_trace_mem "hook mount" '1:shortmem' '2+:mem' '3+:slab' getarg 'rd.break=mount' -d 'rdbreak=mount' && emergency_shell -n mount "Break mount" # mount scripts actually try to mount the root filesystem, and may # be sourced any number of times. As soon as one suceeds, no more are sourced. i=0 while :; do if ismounted "$NEWROOT"; then usable_root "$NEWROOT" && break; umount "$NEWROOT" fi for f in $hookdir/mount/*.sh; do [ -f "$f" ] && . "$f" if ismounted "$NEWROOT"; then usable_root "$NEWROOT" && break; warn "$NEWROOT has no proper rootfs layout, ignoring and removing offending mount hook" umount "$NEWROOT" rm -f -- "$f" fi done i=$(($i+1)) [ $i -gt 20 ] && emergency_shell "Can't mount root filesystem" done export -p > /dracut-state.sh exit 0 modules.d/98dracut-systemd/dracut-pre-mount.service000064400000001466151701010110016351 0ustar00# This file is part of dracut. # # See dracut.bootup(7) for details [Unit] Description=dracut pre-mount hook Documentation=man:dracut-pre-mount.service(8) DefaultDependencies=no Before=initrd-root-fs.target sysroot.mount systemd-fsck-root.service After=dracut-initqueue.service cryptsetup.target ConditionPathExists=/usr/lib/initrd-release ConditionDirectoryNotEmpty=|/lib/dracut/hooks/pre-mount ConditionKernelCommandLine=|rd.break=pre-mount Conflicts=shutdown.target emergency.target [Service] Environment=DRACUT_SYSTEMD=1 Environment=NEWROOT=/sysroot Type=oneshot ExecStart=-/bin/dracut-pre-mount StandardInput=null StandardOutput=syslog StandardError=syslog+console KillMode=process RemainAfterExit=yes # Bash ignores SIGTERM, so we send SIGHUP instead, to ensure that bash # terminates cleanly. KillSignal=SIGHUP modules.d/98dracut-systemd/dracut-pre-mount.service.8000064400000003012151701010110016504 0ustar00'\" t .\" Title: dracut-pre-mount.service .\" Author: [see the "AUTHORS" section] .\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/> .\" Date: 10/09/2018 .\" Manual: dracut .\" Source: dracut .\" Language: English .\" .TH "DRACUT\-PRE\-MOUNT\&" "8" "10/09/2018" "dracut" "dracut" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" dracut-pre-mount.service \- runs the dracut hooks before /sysroot is mounted .SH "SYNOPSIS" .sp dracut\-pre\-mount\&.service .SH "DESCRIPTION" .sp This service runs all dracut hooks before the real root is mounted on /sysroot\&. .SH "AUTHORS" .sp Harald Hoyer .SH "SEE ALSO" .sp \fBdracut\&.bootup\fR(7) \fBdracut\fR(8) modules.d/98dracut-systemd/dracut-pre-mount.service.8.asc000064400000000662151701010110017261 0ustar00DRACUT-PRE-MOUNT.SERVICE(8) =========================== :doctype: manpage :man source: dracut :man manual: dracut NAME ---- dracut-pre-mount.service - runs the dracut hooks before /sysroot is mounted SYNOPSIS -------- dracut-pre-mount.service DESCRIPTION ----------- This service runs all dracut hooks before the real root is mounted on /sysroot. AUTHORS ------- Harald Hoyer SEE ALSO -------- *dracut.bootup*(7) *dracut*(8) modules.d/98dracut-systemd/dracut-pre-mount.sh000075500000000766151701010110015330 0ustar00#!/bin/sh export DRACUT_SYSTEMD=1 if [ -f /dracut-state.sh ]; then . /dracut-state.sh 2>/dev/null fi type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh source_conf /etc/conf.d make_trace_mem "hook pre-mount" '1:shortmem' '2+:mem' '3+:slab' # pre pivot scripts are sourced just before we doing cleanup and switch over # to the new root. getarg 'rd.break=pre-mount' 'rdbreak=pre-mount' && emergency_shell -n pre-mount "Break pre-mount" source_hook pre-mount export -p > /dracut-state.sh exit 0 modules.d/98dracut-systemd/dracut-pre-pivot.service000064400000002145151701010110016343 0ustar00# This file is part of dracut. # # See dracut.bootup(7) for details [Unit] Description=dracut pre-pivot and cleanup hook Documentation=man:dracut-pre-pivot.service(8) DefaultDependencies=no After=initrd.target initrd-parse-etc.service sysroot.mount After=dracut-initqueue.service dracut-pre-mount.service dracut-mount.service Before=initrd-cleanup.service Wants=remote-fs.target After=remote-fs.target ConditionPathExists=/usr/lib/initrd-release ConditionDirectoryNotEmpty=|/lib/dracut/hooks/pre-pivot ConditionDirectoryNotEmpty=|/lib/dracut/hooks/cleanup ConditionKernelCommandLine=|rd.break=pre-pivot ConditionKernelCommandLine=|rd.break=cleanup ConditionKernelCommandLine=|rd.break ConditionPathExists=|/dev/root ConditionPathExists=|/dev/nfs Conflicts=shutdown.target emergency.target [Service] Environment=DRACUT_SYSTEMD=1 Environment=NEWROOT=/sysroot Type=oneshot ExecStart=-/bin/dracut-pre-pivot StandardInput=null StandardOutput=syslog StandardError=syslog+console KillMode=process RemainAfterExit=yes # Bash ignores SIGTERM, so we send SIGHUP instead, to ensure that bash # terminates cleanly. KillSignal=SIGHUP modules.d/98ecryptfs/README000064400000004447151701010110011332 0ustar00# Directions for creating the encrypted key that will be used to mount an # eCryptfs filesystem # Create the eCryptfs key (encrypted key type) # # The encrypted key type supports two formats: the 'default' format allows # to generate a random symmetric key of the length specified, the 'ecryptfs' # format generates an authentication token for the eCryptfs filesystem, # which contains a randomly generated key. Two requirements for the latter # format is that the key description must contain exactly 16 hexadecimal # characters and that the encrypted key length must be equal to 64. $ keyctl add encrypted 1000100010001000 "new ecryptfs trusted:kmk-trusted 64" @u 782117972 # Save the encrypted key $ su -c 'keyctl pipe `keyctl search @u encrypted 1000100010001000` > /etc/keys/ecryptfs-trusted.blob' # The eCryptfs key path name can be set in one of the following ways (specified in # the order in which the variable is overwritten): 1) use the default value: -------------------------------------------------------------------------- ECRYPTFSKEY="/etc/keys/ecryptfs-trusted.blob" -------------------------------------------------------------------------- 2) create the configuration file '/etc/sysconfig/ecryptfs' and set the ECRYPTFSKEY variable; 3) specify the eCryptfs key path name in the 'ecryptfskey=' parameter of the kernel command line. # The configuration file '/etc/sysconfig/ecryptfs' is also used to specify # more options for mounting the eCryptfs filesystem: ECRYPTFSSRCDIR: existent directory in the lower root filesystem; ECRYPTFSDSTDIR: mount point directory for the eCryptfs filesystem (the directory must be created in the root filesystem before rebooting the platform); ECRYPTFS_EXTRA_MOUNT_OPTS: extra mount options for the eCryptfs filesystem (the 'ecryptfs_sig' option is automatically added by the dracut script). # Example of the configuration file: ----------- '/etc/sysconfig/ecryptfs' (with default values) ----------- ECRYPTFS_KEY="/etc/keys/ecryptfs-trusted.blob" ECRYPTFSSRCDIR="/secret" ECRYPTFSDSTDIR="${ECRYPTFSSRCDIR}" ECRYPTFS_EXTRA_MOUNT_OPTS="" ----------------------------------------------------------------------- # If the variable ECRYPTFSDSTDIR is not specified in the configuration file, # its value will be equal to that of ECRYPTFSSRCDIR. modules.d/98ecryptfs/ecryptfs-mount.sh000075500000005266151701010110014010 0ustar00#!/bin/sh # Licensed under the GPLv2 # # Copyright (C) 2011 Politecnico di Torino, Italy # TORSEC group -- http://security.polito.it # Roberto Sassu <roberto.sassu@polito.it> ECRYPTFSCONFIG="${NEWROOT}/etc/sysconfig/ecryptfs" ECRYPTFSKEYTYPE="encrypted" ECRYPTFSKEYDESC="1000100010001000" ECRYPTFSKEYID="" ECRYPTFSSRCDIR="/secret" ECRYPTFS_EXTRA_MOUNT_OPTS="" load_ecryptfs_key() { # override the eCryptfs key path name from the 'ecryptfskey=' parameter in the kernel # command line ECRYPTFSKEYARG=$(getarg ecryptfskey=) [ $? -eq 0 ] && \ ECRYPTFSKEY=${ECRYPTFSKEYARG} # set the default value [ -z "${ECRYPTFSKEY}" ] && \ ECRYPTFSKEY="/etc/keys/ecryptfs-trusted.blob"; # set the eCryptfs key path name ECRYPTFSKEYPATH="${NEWROOT}${ECRYPTFSKEY}" # check for eCryptfs encrypted key's existence if [ ! -f "${ECRYPTFSKEYPATH}" ]; then if [ "${RD_DEBUG}" = "yes" ]; then info "eCryptfs: key file not found: ${ECRYPTFSKEYPATH}" fi return 1 fi # read the eCryptfs encrypted key blob KEYBLOB=$(cat ${ECRYPTFSKEYPATH}) # load the eCryptfs encrypted key blob ECRYPTFSKEYID=$(keyctl add ${ECRYPTFSKEYTYPE} ${ECRYPTFSKEYDESC} "load ${KEYBLOB}" @u) [ $? -eq 0 ] || { info "eCryptfs: failed to load the eCryptfs key: ${ECRYPTFSKEYDESC}"; return 1; } return 0 } unload_ecryptfs_key() { # unlink the eCryptfs encrypted key keyctl unlink ${ECRYPTFSKEYID} @u || { info "eCryptfs: failed to unlink the eCryptfs key: ${ECRYPTFSKEYDESC}"; return 1; } return 0 } mount_ecryptfs() { # read the configuration from the config file [ -f "${ECRYPTFSCONFIG}" ] && \ . ${ECRYPTFSCONFIG} # load the eCryptfs encrypted key load_ecryptfs_key || return 1 # set the default value for ECRYPTFSDSTDIR [ -z "${ECRYPTFSDSTDIR}" ] && \ ECRYPTFSDSTDIR=${ECRYPTFSSRCDIR} # set the eCryptfs filesystem mount point ECRYPTFSSRCMNT="${NEWROOT}${ECRYPTFSSRCDIR}" ECRYPTFSDSTMNT="${NEWROOT}${ECRYPTFSDSTDIR}" # build the mount options variable ECRYPTFS_MOUNT_OPTS="ecryptfs_sig=${ECRYPTFSKEYDESC}" [ ! -z "${ECRYPTFS_EXTRA_MOUNT_OPTS}" ] && \ ECRYPTFS_MOUNT_OPTS="${ECRYPTFS_MOUNT_OPTS},${ECRYPTFS_EXTRA_MOUNT_OPTS}" # mount the eCryptfs filesystem info "Mounting the configured eCryptfs filesystem" mount -i -t ecryptfs -o${ECRYPTFS_MOUNT_OPTS} ${ECRYPTFSSRCMNT} ${ECRYPTFSDSTMNT} >/dev/null || { info "eCryptfs: mount of the eCryptfs filesystem failed"; return 1; } # unload the eCryptfs encrypted key unload_ecryptfs_key || return 1 return 0 } mount_ecryptfs modules.d/98ecryptfs/module-setup.sh000075500000000424151701010110013423 0ustar00#!/bin/bash # called by dracut check() { return 255 } # called by dracut depends() { echo masterkey return 0 } # called by dracut installkernel() { instmods ecryptfs } # called by dracut install() { inst_hook pre-pivot 63 "$moddir/ecryptfs-mount.sh" } modules.d/98pollcdrom/module-setup.sh000075500000000307151701010110013557 0ustar00#!/bin/bash # called by dracut check() { return 255 } # called by dracut depends() { return 0 } # called by dracut install() { inst_hook initqueue/settled 99 "$moddir/pollcdrom.sh" } modules.d/98pollcdrom/pollcdrom.sh000075500000001173151701010110013131 0ustar00#!/bin/sh # # Licensed under the GPLv2 # # Copyright 2008-2012, Red Hat, Inc. # Harald Hoyer <harald@redhat.com> if [ ! -e /sys/module/block/parameters/events_dfl_poll_msecs ]; then # if the kernel does not support autopolling # then we have to do a # dirty hack for some cdrom drives, # which report no medium for quiet # some time. for cdrom in /sys/block/sr*; do [ -e "$cdrom" ] || continue # skip, if cdrom medium was already found strstr "$(udevadm info --query=env --path=${cdrom##/sys})" \ ID_CDROM_MEDIA && continue echo change > "$cdrom/uevent" done fi modules.d/98selinux/module-setup.sh000075500000000345151701010110013255 0ustar00#!/bin/bash # called by dracut check() { return 255 } # called by dracut depends() { return 0 } # called by dracut install() { inst_hook pre-pivot 50 "$moddir/selinux-loadpolicy.sh" inst_multiple setenforce } modules.d/98selinux/selinux-loadpolicy.sh000075500000004302151701010110014453 0ustar00#!/bin/sh # FIXME: load selinux policy. this should really be done after we switchroot rd_load_policy() { # If SELinux is disabled exit now getarg "selinux=0" > /dev/null && return 0 SELINUX="enforcing" [ -e "$NEWROOT/etc/selinux/config" ] && . "$NEWROOT/etc/selinux/config" # Check whether SELinux is in permissive mode permissive=0 getarg "enforcing=0" > /dev/null if [ $? -eq 0 -o "$SELINUX" = "permissive" ]; then permissive=1 fi # Attempt to load SELinux Policy if [ -x "$NEWROOT/usr/sbin/load_policy" -o -x "$NEWROOT/sbin/load_policy" ]; then local ret=0 local out info "Loading SELinux policy" mount -o bind /sys $NEWROOT/sys # load_policy does mount /proc and /sys/fs/selinux in # libselinux,selinux_init_load_policy() if [ -x "$NEWROOT/sbin/load_policy" ]; then out=$(LANG=C chroot "$NEWROOT" /sbin/load_policy -i 2>&1) ret=$? info $out else out=$(LANG=C chroot "$NEWROOT" /usr/sbin/load_policy -i 2>&1) ret=$? info $out fi umount $NEWROOT/sys/fs/selinux umount $NEWROOT/sys if [ "$SELINUX" = "disabled" ]; then return 0; fi if [ $ret -eq 0 -o $ret -eq 2 ]; then # If machine requires a relabel, force to permissive mode [ -e "$NEWROOT"/.autorelabel ] && LANG=C /usr/sbin/setenforce 0 mount --rbind /dev "$NEWROOT/dev" LANG=C chroot "$NEWROOT" /sbin/restorecon -R /dev umount -R "$NEWROOT/dev" return 0 fi warn "Initial SELinux policy load failed." if [ $ret -eq 3 -o $permissive -eq 0 ]; then warn "Machine in enforcing mode." warn "Not continuing" emergency_shell -n selinux exit 1 fi return 0 elif [ $permissive -eq 0 -a "$SELINUX" != "disabled" ]; then warn "Machine in enforcing mode and cannot execute load_policy." warn "To disable selinux, add selinux=0 to the kernel command line." warn "Not continuing" emergency_shell -n selinux exit 1 fi } rd_load_policy modules.d/98syslog/README000064400000001501151701010110010777 0ustar00Syslog support for dracut This module provides syslog functionality in the initrd. This is especially interesting when complex configuration being used to provide access to the device the rootfs resides on. When this module is installed into the ramfs it is triggered by the udev event from the nic being setup (online). Then if syslog is configured it is started and will forward all kernel messages to the given syslog server. The syslog implementation is detected automatically by finding the appropriate binary with the following order: rsyslogd syslogd syslog-ng Then if detected the syslog.conf is generated and syslog is started. Bootparameters: syslogserver=ip Where to syslog to sysloglevel=level What level has to be logged syslogtype=rsyslog|syslog|syslogng Don't auto detect syslog but set it modules.d/98syslog/module-setup.sh000075500000002221151701010110013101 0ustar00#!/bin/bash # called by dracut check() { # do not add this module by default return 255 } # called by dracut depends() { return 0 } # called by dracut install() { local _i local _installs if find_binary rsyslogd >/dev/null; then _installs="rsyslogd" inst_libdir_file rsyslog/lmnet.so rsyslog/imklog.so rsyslog/imuxsock.so rsyslog/imjournal.so elif find_binary syslogd >/dev/null; then _installs="syslogd" elif find_binary syslog-ng >/dev/null; then _installs="syslog-ng" else derror "Could not find any syslog binary although the syslogmodule" \ "is selected to be installed. Please check." fi if [ -n "$_installs" ]; then inst_multiple cat $_installs inst_hook cmdline 90 "$moddir/parse-syslog-opts.sh" inst_hook cleanup 99 "$moddir/syslog-cleanup.sh" inst_hook initqueue/online 70 "$moddir/rsyslogd-start.sh" inst_simple "$moddir/rsyslogd-stop.sh" /sbin/rsyslogd-stop mkdir -m 0755 -p ${initdir}/etc/templates inst_simple "${moddir}/rsyslog.conf" /etc/templates/rsyslog.conf fi dracut_need_initqueue } modules.d/98syslog/parse-syslog-opts.sh000075500000002202151701010110014070 0ustar00#!/bin/sh # Parses the syslog commandline options # #Bootparameters: #syslogserver=ip Where to syslog to #sysloglevel=level What level has to be logged #syslogtype=rsyslog|syslog|syslogng # Don't auto detect syslog but set it type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh detect_syslog() { syslogtype="" if [ -e /sbin/rsyslogd ]; then syslogtype="rsyslogd" elif [ -e /sbin/syslogd ]; then syslogtype="syslogd" elif [ -e /sbin/syslog-ng ]; then syslogtype="syslog-ng" else warn "Could not find any syslog binary although the syslogmodule is selected to be installed. Please check." fi echo "$syslogtype" [ -n "$syslogtype" ] } syslogserver=$(getarg syslog.server -d syslog) syslogfilters=$(getargs syslog.filter -d filter) syslogtype=$(getarg syslog.type -d syslogtype) [ -n "$syslogserver" ] && echo $syslogserver > /tmp/syslog.server [ -n "$syslogfilters" ] && echo "$syslogfilters" > /tmp/syslog.filters if [ -n "$syslogtype" ]; then echo "$syslogtype" > /tmp/syslog.type else syslogtype=$(detect_syslog) echo $syslogtype > /tmp/syslog.type fi modules.d/98syslog/rsyslog.conf000064400000001464151701010110012500 0ustar00#rsyslog v3 config file # if you experience problems, check # http://www.rsyslog.com/troubleshoot for assistance #### MODULES #### $ModLoad imuxsock.so # provides support for local system logging (e.g. via logger command) $ModLoad imklog.so # provides kernel logging support (previously done by rklogd) #$ModLoad immark.so # provides --MARK-- message capability # Provides UDP syslog reception #$ModLoad imudp.so #$UDPServerRun 514 # Provides TCP syslog reception #$ModLoad imtcp.so #$InputTCPServerRun 514 #### GLOBAL DIRECTIVES #### # Use default timestamp format $ActionFileDefaultTemplate RSYSLOG_TraditionalFileFormat # File syncing capability is disabled by default. This feature is usually not required, # not useful and an extreme performance hit #$ActionFileEnableSync on #### RULES #### modules.d/98syslog/rsyslogd-start.sh000075500000002321151701010110013460 0ustar00#!/bin/sh # Triggered by initqueue/online and starts rsyslogd with bootparameters type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh # prevent starting again if already running if [ -f /var/run/syslogd.pid ]; then read pid < /var/run/syslogd.pid kill -0 $pid && exit 0 fi rsyslog_config() { local server=$1 shift local syslog_template=$1 shift local filters=$* local filter= cat $syslog_template ( # disable shell expansion / globbing # since filters contain such characters set -f for filter in $filters; do echo "${filter} @${server}" done ) #echo "*.* /tmp/syslog" } [ -f /tmp/syslog.type ] && read type < /tmp/syslog.type [ -f /tmp/syslog.server ] && read server < /tmp/syslog.server [ -f /tmp/syslog.filters ] && read filters < /tmp/syslog.filters [ -z "$filters" ] && filters="kern.*" [ -f /tmp/syslog.conf ] && read conf < /tmp/syslog.conf [ -z "$conf" ] && conf="/etc/rsyslog.conf" && echo "$conf" > /tmp/syslog.conf if [ $type == "rsyslogd" ]; then template=/etc/templates/rsyslog.conf if [ -n "$server" ]; then rsyslog_config "$server" "$template" "$filters" > $conf rsyslogd -c3 fi fi modules.d/98syslog/rsyslogd-stop.sh000075500000000436151701010110013315 0ustar00#!/bin/sh type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh # Kills rsyslogd if [ -f /var/run/syslogd.pid ]; then read pid < /var/run/syslogd.pid kill $pid kill -0 $pid && kill -9 $pid else warn "rsyslogd-stop: Could not find a pid for rsyslogd. Won't kill it." fi modules.d/98syslog/syslog-cleanup.sh000075500000000627151701010110013433 0ustar00#!/bin/sh # Just cleans up a previously started syslogd type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh if [ -f /tmp/syslog.server ]; then read syslogtype < /tmp/syslog.type if command -v "${syslogtype}-stop" >/dev/null; then ${syslogtype}-stop else warn "syslog-cleanup: Could not find script to stop syslog of type \"$syslogtype\". Syslog will not be stopped." fi fimodules.d/98usrmount/module-setup.sh000075500000000446151701010110013464 0ustar00#!/bin/bash # called by dracut check() { [[ $mount_needs ]] && return 1 return 0 } # called by dracut depends() { echo 'fs-lib' } # called by dracut install() { if ! dracut_module_included "systemd"; then inst_hook pre-pivot 50 "$moddir/mount-usr.sh" fi : } modules.d/98usrmount/mount-usr.sh000075500000007026151701010110013013 0ustar00#!/bin/sh type info >/dev/null 2>&1 || . /lib/dracut-lib.sh type fsck_single >/dev/null 2>&1 || . /lib/fs-lib.sh filtersubvol() { local _oldifs _oldifs="$IFS" IFS="," set $* IFS="$_oldifs" while [ $# -gt 0 ]; do case $1 in subvol\=*) :;; *) printf '%s' "${1}," ;; esac shift done } fsck_usr() { local _dev=$1 local _fs=$2 local _fsopts=$3 local _fsckoptions if [ -f "$NEWROOT"/fsckoptions ]; then _fsckoptions=$(cat "$NEWROOT"/fsckoptions) fi if [ -f "$NEWROOT"/forcefsck ] || getargbool 0 forcefsck ; then _fsckoptions="-f $_fsckoptions" elif [ -f "$NEWROOT"/.autofsck ]; then [ -f "$NEWROOT"/etc/sysconfig/autofsck ] && . "$NEWROOT"/etc/sysconfig/autofsck if [ "$AUTOFSCK_DEF_CHECK" = "yes" ]; then AUTOFSCK_OPT="$AUTOFSCK_OPT -f" fi if [ -n "$AUTOFSCK_SINGLEUSER" ]; then warn "*** Warning -- the system did not shut down cleanly. " warn "*** Dropping you to a shell; the system will continue" warn "*** when you leave the shell." emergency_shell fi _fsckoptions="$AUTOFSCK_OPT $_fsckoptions" fi fsck_single "$_dev" "$_fs" "$_fsopts" "$_fsckoptions" } mount_usr() { local _dev _mp _fs _opts _rest _usr_found _ret _freq _passno # check, if we have to mount the /usr filesystem while read _dev _mp _fs _opts _freq _passno || [ -n "$_dev" ]; do [ "${_dev%%#*}" != "$_dev" ] && continue if [ "$_mp" = "/usr" ]; then case "$_dev" in LABEL=*) _dev="$(echo $_dev | sed 's,/,\\x2f,g')" _dev="/dev/disk/by-label/${_dev#LABEL=}" ;; UUID=*) _dev="${_dev#block:}" _dev="/dev/disk/by-uuid/${_dev#UUID=}" ;; esac if strstr "$_opts" "subvol=" && \ [ "${root#block:}" -ef $_dev ] && \ [ -n "$rflags" ]; then # for btrfs subvolumes we have to mount /usr with the same rflags rflags=$(filtersubvol "$rflags") rflags=${rflags%%,} _opts="${_opts:+${_opts},}${rflags}" elif getargbool 0 ro; then # if "ro" is specified, we want /usr to be mounted read-only _opts="${_opts:+${_opts},}ro" elif getargbool 0 rw; then # if "rw" is specified, we want /usr to be mounted read-write _opts="${_opts:+${_opts},}rw" fi echo "$_dev ${NEWROOT}${_mp} $_fs ${_opts} $_freq $_passno" _usr_found="1" break fi done < "$NEWROOT/etc/fstab" >> /etc/fstab if [ "$_usr_found" != "" ]; then # we have to mount /usr _fsck_ret=0 if ! getargbool 0 rd.skipfsck; then if [ "0" != "${_passno:-0}" ]; then fsck_usr "$_dev" "$_fs" "$_opts" _fsck_ret=$? [ $_fsck_ret -ne 255 ] && echo $_fsck_ret >/run/initramfs/usr-fsck fi fi info "Mounting /usr with -o $_opts" mount "$NEWROOT/usr" 2>&1 | vinfo if ! ismounted "$NEWROOT/usr"; then warn "Mounting /usr to $NEWROOT/usr failed" warn "*** Dropping you to a shell; the system will continue" warn "*** when you leave the shell." emergency_shell fi fi } if [ -f "$NEWROOT/etc/fstab" ]; then mount_usr fi modules.d/99base/dracut-lib.sh000075500000101730151701010110012104 0ustar00#!/bin/sh export DRACUT_SYSTEMD export NEWROOT if [ -n "$NEWROOT" ]; then [ -d $NEWROOT ] || mkdir -p -m 0755 $NEWROOT fi if ! [ -d /run/initramfs ]; then mkdir -p -m 0755 /run/initramfs/log ln -sfn /run/initramfs/log /var/log fi [ -d /run/lock ] || mkdir -p -m 0755 /run/lock [ -d /run/log ] || mkdir -p -m 0755 /run/log debug_off() { set +x } debug_on() { [ "$RD_DEBUG" = "yes" ] && set -x } # returns OK if $1 contains literal string $2 (and isn't empty) strstr() { [ "${1##*"$2"*}" != "$1" ] } # returns OK if $1 matches (completely) glob pattern $2 # An empty $1 will not be considered matched, even if $2 is * which technically # matches; as it would match anything, it's not an interesting case. strglob() { [ -n "$1" -a -z "${1##$2}" ] } # returns OK if $1 contains (anywhere) a match of glob pattern $2 # An empty $1 will not be considered matched, even if $2 is * which technically # matches; as it would match anything, it's not an interesting case. strglobin() { [ -n "$1" -a -z "${1##*$2*}" ] } # returns OK if $1 contains literal string $2 at the beginning, and isn't empty str_starts() { [ "${1#"$2"*}" != "$1" ] } # returns OK if $1 contains literal string $2 at the end, and isn't empty str_ends() { [ "${1%*"$2"}" != "$1" ] } trim() { local var="$*" var="${var#"${var%%[![:space:]]*}"}" # remove leading whitespace characters var="${var%"${var##*[![:space:]]}"}" # remove trailing whitespace characters 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 [ "$DRACUT_QUIET" != "yes" ] && \ echo "dracut: $*" >&2 } else warn() { echo "Warning: $*" >&2 } info() { echo "$*" } fi vwarn() { while read line || [ -n "$line" ]; do warn $line; done } vinfo() { while read line || [ -n "$line" ]; do info $line; done } # replaces all occurrences of 'search' in 'str' with 'replacement' # # str_replace str search replacement # # example: # str_replace ' one two three ' ' ' '_' str_replace() { local in="$1"; local s="$2"; local r="$3" local out='' while strstr "${in}" "$s"; do chop="${in%%"$s"*}" out="${out}${chop}$r" in="${in#*"$s"}" done echo "${out}${in}" } killall_proc_mountpoint() { local _pid local _t local _killed=0 for _pid in /proc/*; do _pid=${_pid##/proc/} case $_pid in *[!0-9]*) continue;; esac [ -e "/proc/$_pid/exe" ] || continue [ -e "/proc/$_pid/root" ] || continue if strstr "$(ls -l -- "/proc/$_pid" "/proc/$_pid/fd" 2>/dev/null)" "$1" ; then kill -9 "$_pid" _killed=1 fi done return $_killed } getcmdline() { local _line local _i local CMDLINE_ETC_D local CMDLINE_ETC local CMDLINE_PROC unset _line if [ -e /etc/cmdline ]; then while read -r _line || [ -n "$_line" ]; do CMDLINE_ETC="$CMDLINE_ETC $_line"; done </etc/cmdline; fi for _i in /etc/cmdline.d/*.conf; do [ -e "$_i" ] || continue while read -r _line || [ -n "$_line" ]; do CMDLINE_ETC_D="$CMDLINE_ETC_D $_line"; done <"$_i"; done if [ -e /proc/cmdline ]; then while read -r _line || [ -n "$_line" ]; do CMDLINE_PROC="$CMDLINE_PROC $_line" done </proc/cmdline; fi CMDLINE="$CMDLINE_ETC_D $CMDLINE_ETC $CMDLINE_PROC" printf "%s" "$CMDLINE" } _dogetarg() { local _o _val _doecho unset _val unset _o unset _doecho CMDLINE=$(getcmdline) for _o in $CMDLINE; do if [ "${_o%%=*}" = "${1%%=*}" ]; then if [ -n "${1#*=}" -a "${1#*=*}" != "${1}" ]; then # if $1 has a "=<value>", we want the exact match if [ "$_o" = "$1" ]; then _val="1"; unset _doecho fi continue fi if [ "${_o#*=}" = "$_o" ]; then # if cmdline argument has no "=<value>", we assume "=1" _val="1"; unset _doecho continue fi _val="${_o#*=}" _doecho=1 fi done if [ -n "$_val" ]; then [ "x$_doecho" != "x" ] && echo "$_val"; return 0; fi return 1; } getarg() { debug_off local _deprecated _newoption while [ $# -gt 0 ]; do case $1 in -d) _deprecated=1; shift;; -y) if _dogetarg $2 >/dev/null; then if [ "$_deprecated" = "1" ]; then [ -n "$_newoption" ] && warn "Kernel command line option '$2' is deprecated, use '$_newoption' instead." || warn "Option '$2' is deprecated." fi echo 1 debug_on return 0 fi _deprecated=0 shift 2;; -n) if _dogetarg $2 >/dev/null; then echo 0; if [ "$_deprecated" = "1" ]; then [ -n "$_newoption" ] && warn "Kernel command line option '$2' is deprecated, use '$_newoption=0' instead." || warn "Option '$2' is deprecated." fi debug_on return 1 fi _deprecated=0 shift 2;; *) if [ -z "$_newoption" ]; then _newoption="$1" fi if _dogetarg $1; then if [ "$_deprecated" = "1" ]; then [ -n "$_newoption" ] && warn "Kernel command line option '$1' is deprecated, use '$_newoption' instead." || warn "Option '$1' is deprecated." fi debug_on return 0; fi _deprecated=0 shift;; esac done debug_on return 1 } # getargbool <defaultval> <args...> # False if "getarg <args...>" returns "0", "no", or "off". # True if getarg returns any other non-empty string. # If not found, assumes <defaultval> - usually 0 for false, 1 for true. # example: getargbool 0 rd.info # true: rd.info, rd.info=1, rd.info=xxx # false: rd.info=0, rd.info=off, rd.info not present (default val is 0) getargbool() { local _b unset _b local _default _default="$1"; shift _b=$(getarg "$@") [ $? -ne 0 -a -z "$_b" ] && _b="$_default" if [ -n "$_b" ]; then [ $_b = "0" ] && return 1 [ $_b = "no" ] && return 1 [ $_b = "off" ] && return 1 fi return 0 } isdigit() { case "$1" in *[!0-9]*|"") return 1;; esac return 0 } # getargnum <defaultval> <minval> <maxval> <arg> # Will echo the arg if it's in range [minval - maxval]. # If it's not set or it's not valid, will set it <defaultval>. # Note all values are required to be >= 0 here. # <defaultval> should be with [minval -maxval]. getargnum() { local _b unset _b local _default _min _max _default="$1"; shift _min="$1"; shift _max="$1"; shift _b=$(getarg "$1") [ $? -ne 0 -a -z "$_b" ] && _b=$_default if [ -n "$_b" ]; then isdigit "$_b" && _b=$(($_b)) && \ [ $_b -ge $_min ] && [ $_b -le $_max ] && echo $_b && return fi echo $_default } _dogetargs() { debug_off local _o _found _key unset _o unset _found CMDLINE=$(getcmdline) _key="$1" set -- for _o in $CMDLINE; do if [ "$_o" = "$_key" ]; then _found=1; elif [ "${_o%%=*}" = "${_key%=}" ]; then [ -n "${_o%%=*}" ] && set -- "$@" "${_o#*=}"; _found=1; fi done if [ -n "$_found" ]; then [ $# -gt 0 ] && printf '%s' "$*" return 0 fi return 1; } getargs() { debug_off local _val _i _args _gfound _deprecated unset _val unset _gfound _newoption="$1" _args="$@" set -- for _i in $_args; do if [ "$_i" = "-d" ]; then _deprecated=1 continue fi _val="$(_dogetargs $_i)" if [ $? -eq 0 ]; then if [ "$_deprecated" = "1" ]; then [ -n "$_newoption" ] && warn "Option '$_i' is deprecated, use '$_newoption' instead." || warn "Option $_i is deprecated!" fi _gfound=1 fi [ -n "$_val" ] && set -- "$@" "$_val" _deprecated=0 done if [ -n "$_gfound" ]; then if [ $# -gt 0 ]; then printf '%s' "$*" fi debug_on return 0 fi debug_on return 1; } # Prints value of given option. If option is a flag and it's present, # it just returns 0. Otherwise 1 is returned. # $1 = options separated by commas # $2 = option we are interested in # # Example: # $1 = cipher=aes-cbc-essiv:sha256,hash=sha256,verify # $2 = hash # Output: # sha256 getoptcomma() { local line=",$1,"; local opt="$2"; local tmp case "${line}" in *,${opt}=*,*) tmp="${line#*,${opt}=}" echo "${tmp%%,*}" return 0 ;; *,${opt},*) return 0;; esac return 1 } # Splits given string 'str' with separator 'sep' into variables 'var1', 'var2', # 'varN'. If number of fields is less than number of variables, remaining are # not set. If number of fields is greater than number of variables, the last # variable takes remaining fields. In short - it acts similary to 'read'. # # splitsep sep str var1 var2 varN # # example: # splitsep ':' 'foo:bar:baz' v1 v2 # in result: # v1='foo', v2='bar:baz' # # TODO: ':' inside fields. splitsep() { debug_off local sep="$1"; local str="$2"; shift 2 local tmp while [ -n "$str" -a "$#" -gt 1 ]; do tmp="${str%%$sep*}" eval "$1='${tmp}'" str="${str#"$tmp"}" str="${str#$sep}" shift done [ -n "$str" -a -n "$1" ] && eval "$1='$str'" debug_on return 0 } setdebug() { [ -f /usr/lib/initrd-release ] || return if [ -z "$RD_DEBUG" ]; then if [ -e /proc/cmdline ]; then RD_DEBUG=no if getargbool 0 rd.debug -d -y rdinitdebug -d -y rdnetdebug; then RD_DEBUG=yes [ -n "$BASH" ] && \ export PS4='${BASH_SOURCE}@${LINENO}(${FUNCNAME[0]}): '; fi fi export RD_DEBUG fi debug_on } setdebug source_all() { local f local _dir _dir=$1; shift [ "$_dir" ] && [ -d "/$_dir" ] || return for f in "/$_dir"/*.sh; do [ -e "$f" ] && . "$f" "$@"; done } hookdir=/lib/dracut/hooks export hookdir source_hook() { local _dir _dir=$1; shift source_all "/lib/dracut/hooks/$_dir" "$@" } check_finished() { local f for f in $hookdir/initqueue/finished/*.sh; do [ "$f" = "$hookdir/initqueue/finished/*.sh" ] && return 0 { [ -e "$f" ] && ( . "$f" ) ; } || return 1 done return 0 } source_conf() { local f [ "$1" ] && [ -d "/$1" ] || return for f in "/$1"/*.conf; do [ -e "$f" ] && . "$f"; done } die() { { echo "<24>dracut: FATAL: $*"; echo "<24>dracut: Refusing to continue"; } > /dev/kmsg { echo "warn dracut: FATAL: \"$*\""; echo "warn dracut: Refusing to continue"; } >> $hookdir/emergency/01-die.sh [ -d /run/initramfs ] || mkdir -p -- /run/initramfs > /run/initramfs/.die if getargbool 0 "rd.shell"; then emergency_shell else source_hook "shutdown-emergency" fi if [ -n "$DRACUT_SYSTEMD" ]; then systemctl --no-block --force halt fi exit 1 } check_quiet() { if [ -z "$DRACUT_QUIET" ]; then DRACUT_QUIET="yes" getargbool 0 rd.info -d -y rdinfo && DRACUT_QUIET="no" getargbool 0 rd.debug -d -y rdinitdebug && DRACUT_QUIET="no" getarg quiet || DRACUT_QUIET="yes" a=$(getarg loglevel=) [ -n "$a" ] && [ $a -ge 28 ] && DRACUT_QUIET="yes" export DRACUT_QUIET fi } check_occurances() { # Count the number of times the character $ch occurs in $str # Return 0 if the count matches the expected number, 1 otherwise local str="$1" local ch="$2" local expected="$3" local count=0 while [ "${str#*$ch}" != "${str}" ]; do str="${str#*$ch}" count=$(( $count + 1 )) done [ $count -eq $expected ] } incol2() { debug_off local dummy check; local file="$1"; local str="$2"; [ -z "$file" ] && return 1; [ -z "$str" ] && return 1; while read dummy check restofline || [ -n "$check" ]; do if [ "$check" = "$str" ]; then debug_on return 0 fi done < $file debug_on return 1 } udevsettle() { [ -z "$UDEVVERSION" ] && export UDEVVERSION=$(udevadm --version | { read v _ ; echo $v ; }) if [ $UDEVVERSION -ge 143 ]; then udevadm settle --exit-if-exists=$hookdir/initqueue/work $settle_exit_if_exists else udevadm settle --timeout=30 fi } udevproperty() { [ -z "$UDEVVERSION" ] && export UDEVVERSION=$(udevadm --version | { read v _ ; echo $v ; }) if [ $UDEVVERSION -ge 143 ]; then for i in "$@"; do udevadm control --property=$i; done else for i in "$@"; do udevadm control --env=$i; done fi } find_mount() { local dev mnt etc wanted_dev wanted_dev="$(readlink -e -q $1)" while read dev mnt etc || [ -n "$dev" ]; do [ "$dev" = "$wanted_dev" ] && echo "$dev" && return 0 done < /proc/mounts return 1 } # usage: ismounted <mountpoint> # usage: ismounted /dev/<device> if command -v findmnt >/dev/null; then ismounted() { findmnt "$1" > /dev/null 2>&1 } else ismounted() { if [ -b "$1" ]; then find_mount "$1" > /dev/null && return 0 return 1 fi while read a m a || [ -n "$m" ]; do [ "$m" = "$1" ] && return 0 done < /proc/mounts return 1 } fi # root=nfs:[<server-ip>:]<root-dir>[:<nfs-options>] # root=nfs4:[<server-ip>:]<root-dir>[:<nfs-options>] nfsroot_to_var() { # strip nfs[4]: local arg="$@:" nfs="${arg%%:*}" arg="${arg##$nfs:}" # check if we have a server if strstr "$arg" ':/' ; then server="${arg%%:/*}" arg="/${arg##*:/}" fi path="${arg%%:*}" # rest are options options="${arg##$path}" # strip leading ":" options="${options##:}" # strip ":" options="${options%%:}" # Does it really start with '/'? [ -n "${path%%/*}" ] && path="error"; #Fix kernel legacy style separating path and options with ',' if [ "$path" != "${path#*,}" ] ; then options=${path#*,} path=${path%%,*} fi } # Create udev rule match for a device with its device name, or the udev property # ID_FS_UUID or ID_FS_LABEL # # example: # udevmatch LABEL=boot # prints: # ENV{ID_FS_LABEL}="boot" # # TODO: symlinks udevmatch() { case "$1" in UUID=????????-????-????-????-????????????|LABEL=*|PARTLABEL=*|PARTUUID=????????-????-????-????-????????????) printf 'ENV{ID_FS_%s}=="%s"' "${1%%=*}" "${1#*=}" ;; UUID=*) printf 'ENV{ID_FS_UUID}=="%s*"' "${1#*=}" ;; PARTUUID=*) printf 'ENV{ID_FS_PARTUUID}=="%s*"' "${1#*=}" ;; /dev/?*) printf -- 'KERNEL=="%s"' "${1#/dev/}" ;; *) return 255 ;; esac } # Prints unique path for potential file inside specified directory. It consists # of specified directory, prefix and number at the end which is incremented # until non-existing file is found. # # funiq dir prefix # # example: # # ls /mnt # cdrom0 cdrom1 # # # funiq /mnt cdrom # /mnt/cdrom2 funiq() { local dir="$1"; local prefix="$2" local i=0 [ -d "${dir}" ] || return 1 while [ -e "${dir}/${prefix}$i" ]; do i=$(($i+1)) || return 1 done echo "${dir}/${prefix}$i" } # Creates unique directory and prints its path. It's using funiq to generate # path. # # mkuniqdir subdir new_dir_name mkuniqdir() { local dir="$1"; local prefix="$2" local retdir; local retdir_new [ -d "${dir}" ] || mkdir -m 0755 -p "${dir}" || return 1 retdir=$(funiq "${dir}" "${prefix}") || return 1 until mkdir -m 0755 "${retdir}" 2>/dev/null; do retdir_new=$(funiq "${dir}" "${prefix}") || return 1 [ "$retdir_new" = "$retdir" ] && return 1 retdir="$retdir_new" done echo "${retdir}" } # Copy the contents of SRC into DEST, merging the contents of existing # directories (kinda like rsync, or cpio -p). # Creates DEST if it doesn't exist. Overwrites files with the same names. # # copytree SRC DEST copytree() { local src="$1" dest="$2" mkdir -p "$dest"; dest=$(readlink -e -q "$dest") ( cd "$src"; cp -af . -t "$dest" ) } # Evaluates command for UUIDs either given as arguments for this function or all # listed in /dev/disk/by-uuid. UUIDs doesn't have to be fully specified. If # beginning is given it is expanded to all matching UUIDs. To pass full UUID to # your command use '$___' as a place holder. Remember to escape '$'! # # foreach_uuid_until [ -p prefix ] command UUIDs # # prefix - string to put just before $___ # command - command to be evaluated # UUIDs - list of UUIDs separated by space # # The function returns after *first successful evaluation* of the given command # with status 0. If evaluation fails for every UUID function returns with # status 1. # # Example: # foreach_uuid_until "mount -U \$___ /mnt; echo OK; umount /mnt" \ # "01234 f512 a235567f-12a3-c123-a1b1-01234567abcb" foreach_uuid_until() ( cd /dev/disk/by-uuid [ "$1" = -p ] && local prefix="$2" && shift 2 local cmd="$1"; shift; local uuids_list="$*" local uuid; local full_uuid; local ___ [ -n "${cmd}" ] || return 1 for uuid in ${uuids_list:-*}; do for full_uuid in ${uuid}*; do [ -e "${full_uuid}" ] || continue ___="${prefix}${full_uuid}" eval ${cmd} && return 0 done done return 1 ) # Get kernel name for given device. Device may be the name too (then the same # is returned), a symlink (full path), UUID (prefixed with "UUID=") or label # (prefixed with "LABEL="). If just a beginning of the UUID is specified or # even an empty, function prints all device names which UUIDs match - every in # single line. # # NOTICE: The name starts with "/dev/". # # Example: # devnames UUID=123 # May print: # /dev/dm-1 # /dev/sdb1 # /dev/sdf3 devnames() { local dev="$1"; local d; local names case "$dev" in UUID=*) dev="$(foreach_uuid_until '! blkid -U $___' "${dev#UUID=}")" \ && return 255 [ -z "$dev" ] && return 255 ;; LABEL=*) dev="$(blkid -L "${dev#LABEL=}")" || return 255 ;; /dev/?*) ;; *) return 255 ;; esac for d in $dev; do names="$names $(readlink -e -q "$d")" || return 255 done echo "${names# }" } usable_root() { local _i [ -d "$1" ] || return 1 for _i in "$1"/usr/lib*/ld-*.so "$1"/lib*/ld-*.so; do [ -e "$_i" ] && return 0 done for _i in proc sys dev; do [ -e "$1"/$_i ] || return 1 done return 0 } inst_hook() { local _hookname _unique _name _job _exe while [ $# -gt 0 ]; do case "$1" in --hook) _hookname="/$2";shift;; --unique) _unique="yes";; --name) _name="$2";shift;; *) break;; esac shift done if [ -z "$_unique" ]; then _job="${_name}$$" else _job="${_name:-$1}" _job=${_job##*/} fi _exe=$1 shift [ -x "$_exe" ] || _exe=$(command -v $_exe) if [ -n "$onetime" ]; then { echo '[ -e "$_job" ] && rm -f -- "$_job"' echo "$_exe $@" } > "/tmp/$$-${_job}.sh" else echo "$_exe $@" > "/tmp/$$-${_job}.sh" fi mv -f "/tmp/$$-${_job}.sh" "$hookdir/${_hookname}/${_job}.sh" } # inst_mount_hook <mountpoint> <prio> <name> <script> # # Install a mount hook with priority <prio>, # which executes <script> as soon as <mountpoint> is mounted. inst_mount_hook() { local _prio="$2" _jobname="$3" _script="$4" local _hookname="mount-$(str_replace "$1" '/' '\\x2f')" [ -d "$hookdir/${_hookname}" ] || mkdir -p "$hookdir/${_hookname}" inst_hook --hook "$_hookname" --unique --name "${_prio}-${_jobname}" "$_script" } # add_mount_point <dev> <mountpoint> <filesystem> <fsopts> # # Mount <dev> on <mountpoint> with <filesystem> and <fsopts> # and call any mount hooks, as soon, as it is mounted add_mount_point() { local _dev="$1" _mp="$2" _fs="$3" _fsopts="$4" local _hookname="mount-$(str_replace "$2" '/' '\\x2f')" local _devname="dev-$(str_replace "$1" '/' '\\x2f')" echo "$_dev $_mp $_fs $_fsopts 0 0" >> /etc/fstab exec 7>/etc/udev/rules.d/99-mount-${_devname}.rules echo 'SUBSYSTEM!="block", GOTO="mount_end"' >&7 echo 'ACTION!="add|change", GOTO="mount_end"' >&7 if [ -n "$_dev" ]; then udevmatch "$_dev" >&7 || { warn "add_mount_point dev=$_dev incorrect!" continue } printf ', ' >&7 fi { printf -- 'RUN+="%s --unique --onetime ' $(command -v initqueue) printf -- '--name mount-%%k ' printf -- '%s %s"\n' "$(command -v mount_hook)" "${_mp}" } >&7 echo 'LABEL="mount_end"' >&7 exec 7>&- } # wait_for_mount <mountpoint> # # Installs a initqueue-finished script, # which will cause the main loop only to exit, # if <mountpoint> is mounted. wait_for_mount() { local _name _name="$(str_replace "$1" '/' '\\x2f')" printf '. /lib/dracut-lib.sh\nismounted "%s"\n' $1 \ >> "$hookdir/initqueue/finished/ismounted-${_name}.sh" { printf 'ismounted "%s" || ' $1 printf 'warn "\"%s\" is not mounted"\n' $1 } >> "$hookdir/emergency/90-${_name}.sh" } # get a systemd-compatible unit name from a path # (mimicks unit_name_from_path_instance()) 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 -- "-" exit 0 fi dev="${1%%/}" dev="${dev##/}" dev="$(str_replace "$dev" '\' '\x5c')" dev="$(str_replace "$dev" '-' '\x2d')" if [ "${dev##.}" != "$dev" ]; then dev="\x2e${dev##.}" fi dev="$(str_replace "$dev" '/' '-')" printf -- "%s" "$dev" } # set_systemd_timeout_for_dev <dev> # Set 'rd.timeout' as the systemd timeout for <dev> set_systemd_timeout_for_dev() { local _name local _needreload local _noreload local _timeout if [ "$1" = "-n" ]; then _noreload=1 shift fi _timeout=$(getarg rd.timeout) _timeout=${_timeout:-0} if [ -n "$DRACUT_SYSTEMD" ]; then _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 fi } # wait_for_dev <dev> # # Installs a initqueue-finished script, # which will cause the main loop only to exit, # if the device <dev> is recognized by the system. wait_for_dev() { local _name local _noreload if [ "$1" = "-n" ]; then _noreload=-n shift fi _name="$(str_replace "$1" '/' '\x2f')" type mark_hostonly >/dev/null 2>&1 && mark_hostonly "$hookdir/initqueue/finished/devexists-${_name}.sh" [ -e "${PREFIX}$hookdir/initqueue/finished/devexists-${_name}.sh" ] && return 0 printf '[ -e "%s" ]\n' $1 \ >> "${PREFIX}$hookdir/initqueue/finished/devexists-${_name}.sh" { printf '[ -e "%s" ] || ' $1 printf 'warn "\"%s\" does not exist"\n' $1 } >> "${PREFIX}$hookdir/emergency/80-${_name}.sh" set_systemd_timeout_for_dev $_noreload $1 } cancel_wait_for_dev() { local _name _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 } killproc() { debug_off local _exe="$(command -v $1)" local _sig=$2 local _i [ -x "$_exe" ] || return 1 for _i in /proc/[0-9]*; do [ "$_i" = "/proc/1" ] && continue if [ -e "$_i"/_exe ] && [ "$_i/_exe" -ef "$_exe" ] ; then kill $_sig ${_i##*/} fi done debug_on } need_shutdown() { >/run/initramfs/.need_shutdown } wait_for_loginit() { [ "$RD_DEBUG" = "yes" ] || return [ -e /run/initramfs/loginit.pipe ] || return debug_off echo "DRACUT_LOG_END" exec 0<>/dev/console 1<>/dev/console 2<>/dev/console # wait for loginit i=0 while [ $i -lt 10 ]; do if [ ! -e /run/initramfs/loginit.pipe ]; then j=$(jobs) [ -z "$j" ] && break [ -z "${j##*Running*}" ] || break fi sleep 0.1 i=$(($i+1)) done if [ $i -eq 10 ]; then kill %1 >/dev/null 2>&1 kill $(while read line || [ -n "$line" ];do echo $line;done</run/initramfs/loginit.pid) fi setdebug rm -f -- /run/initramfs/loginit.pipe /run/initramfs/loginit.pid } # pidof version for root if ! command -v pidof >/dev/null 2>/dev/null; then pidof() { debug_off local _cmd local _exe local _rl local _ret=1 local i _cmd="$1" if [ -z "$_cmd" ]; then debug_on return 1 fi _exe=$(command -v "$1") for i in /proc/*/exe; do [ -e "$i" ] || continue if [ -n "$_exe" ]; then [ "$i" -ef "$_exe" ] || continue else _rl=$(readlink -f "$i"); [ "${_rl%/$_cmd}" != "$_rl" ] || continue fi i=${i%/exe} echo ${i##/proc/} _ret=0 done debug_on return $_ret } 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.' 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 fi } emergency_shell() { local _ctty set +e local _rdshell_name="dracut" action="Boot" hook="emergency" local _emergency_action if [ "$1" = "-n" ]; then _rdshell_name=$2 shift 2 elif [ "$1" = "--shutdown" ]; then _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 echo ; echo warn "$*" echo _emergency_action=$(getarg rd.emergency) [ -z "$_emergency_action" ] \ && [ -e /run/initramfs/.die ] \ && _emergency_action=halt if getargbool 1 rd.shell -d -y rdshell || getarg rd.break -d rdbreak; then _emergency_shell $_rdshell_name else source_hook "$hook" warn "$action has failed. To debug this issue add \"rd.shell rd.debug\" to the kernel command line." [ -z "$_emergency_action" ] && _emergency_action=halt fi case "$_emergency_action" in reboot) reboot || exit 1;; poweroff) poweroff || exit 1;; halt) halt || exit 1;; esac } # Retain the values of these variables but ensure that they are unexported # This is a POSIX-compliant equivalent of bash's "export -n" export_n() { local var local val for var in "$@"; do eval val=\$$var unset $var [ -n "$val" ] && eval $var=\"$val\" done } # returns OK if list1 contains all elements of list2, i.e. checks if list2 is a # sublist of list1. An order and a duplication doesn't matter. # # $1 = separator # $2 = list1 # $3 = list2 # $4 = ignore values, separated by $1 listlist() { local _sep="$1" local _list="${_sep}${2}${_sep}" local _sublist="$3" [ -n "$4" ] && local _iglist="${_sep}${4}${_sep}" local IFS="$_sep" local _v [ "$_list" = "$_sublist" ] && return 0 for _v in $_sublist; do if [ -n "$_v" ] && ! ( [ -n "$_iglist" ] && strstr "$_iglist" "$_v" ) then strstr "$_list" "$_v" || return 1 fi done return 0 } # returns OK if both lists contain the same values. An order and a duplication # doesn't matter. # # $1 = separator # $2 = list1 # $3 = list2 # $4 = ignore values, separated by $1 are_lists_eq() { listlist "$1" "$2" "$3" "$4" && listlist "$1" "$3" "$2" "$4" } setmemdebug() { if [ -z "$DEBUG_MEM_LEVEL" ]; then export DEBUG_MEM_LEVEL=$(getargnum 0 0 5 rd.memdebug) fi } setmemdebug # parameters: func log_level prefix msg [trace_level:trace]... make_trace_mem() { local log_level prefix msg msg_printed local trace trace_level trace_in_higher_levels insert_trace msg=$1 shift prefix='[debug_mem]' log_level=$DEBUG_MEM_LEVEL if [ -z "$log_level" ] || [ "$log_level" -le 0 ]; then return fi msg=$(echo $msg) msg_printed=0 while [ $# -gt 0 ]; do trace=${1%%:*} trace_level=${trace%%+} [ "$trace" != "$trace_level" ] && trace_in_higher_levels="yes" trace=${1##*:} if [ -z "$trace_level" ]; then trace_level=0 fi insert_trace=0 if [ -n "$trace_in_higher_levels" ]; then if [ "$log_level" -ge "$trace_level" ]; then insert_trace=1 fi else if [ "$log_level" -eq "$trace_level" ]; then insert_trace=1 fi fi if [ $insert_trace -eq 1 ]; then if [ $msg_printed -eq 0 ]; then echo "$prefix $msg" msg_printed=1 fi show_memstats $trace fi shift done } # parameters: type show_memstats() { case $1 in shortmem) cat /proc/meminfo | grep -e "^MemFree" -e "^Cached" -e "^Slab" ;; mem) cat /proc/meminfo ;; slab) cat /proc/slabinfo ;; iomem) cat /proc/iomem ;; esac } remove_hostonly_files() { rm -fr /etc/cmdline /etc/cmdline.d/*.conf "$hookdir/initqueue/finished" if [ -f /lib/dracut/hostonly-files ]; then while read line || [ -n "$line" ]; do [ -e "$line" ] || [ -h "$line" ] || continue rm -f "$line" done < /lib/dracut/hostonly-files fi } modules.d/99base/init.sh000075500000027025151701010110011025 0ustar00#!/bin/sh # # Licensed under the GPLv2 # # Copyright 2008-2010, Red Hat, Inc. # Harald Hoyer <harald@redhat.com> # Jeremy Katz <katzj@redhat.com> export -p > /tmp/export.orig NEWROOT="/sysroot" [ -d $NEWROOT ] || mkdir -p -m 0755 $NEWROOT OLDPATH=$PATH PATH=/usr/sbin:/usr/bin:/sbin:/bin export PATH # mount some important things [ ! -d /proc/self ] && \ mount -t proc -o nosuid,noexec,nodev proc /proc >/dev/null if [ "$?" != "0" ]; then echo "Cannot mount proc on /proc! Compile the kernel with CONFIG_PROC_FS!" exit 1 fi [ ! -d /sys/kernel ] && \ mount -t sysfs -o nosuid,noexec,nodev sysfs /sys >/dev/null if [ "$?" != "0" ]; then echo "Cannot mount sysfs on /sys! Compile the kernel with CONFIG_SYSFS!" exit 1 fi RD_DEBUG="" . /lib/dracut-lib.sh setdebug if ! ismounted /dev; then mount -t devtmpfs -o mode=0755,noexec,nosuid,strictatime devtmpfs /dev >/dev/null fi if ! ismounted /dev; then echo "Cannot mount devtmpfs on /dev! Compile the kernel with CONFIG_DEVTMPFS!" exit 1 fi # prepare the /dev directory [ ! -h /dev/fd ] && ln -s /proc/self/fd /dev/fd >/dev/null 2>&1 [ ! -h /dev/stdin ] && ln -s /proc/self/fd/0 /dev/stdin >/dev/null 2>&1 [ ! -h /dev/stdout ] && ln -s /proc/self/fd/1 /dev/stdout >/dev/null 2>&1 [ ! -h /dev/stderr ] && ln -s /proc/self/fd/2 /dev/stderr >/dev/null 2>&1 if ! ismounted /dev/pts; then mkdir -m 0755 /dev/pts mount -t devpts -o gid=5,mode=620,noexec,nosuid devpts /dev/pts >/dev/null fi if ! ismounted /dev/shm; then mkdir -m 0755 /dev/shm mount -t tmpfs -o mode=1777,noexec,nosuid,nodev,strictatime tmpfs /dev/shm >/dev/null fi if ! ismounted /run; then mkdir -m 0755 /newrun if ! str_starts "$(readlink -f /bin/sh)" "/run/"; then mount -t tmpfs -o mode=0755,noexec,nosuid,nodev,strictatime tmpfs /newrun >/dev/null else # the initramfs binaries are located in /run, so don't mount it with noexec mount -t tmpfs -o mode=0755,nosuid,nodev,strictatime tmpfs /newrun >/dev/null fi cp -a /run/* /newrun >/dev/null 2>&1 mount --move /newrun /run rm -fr -- /newrun fi if command -v kmod >/dev/null 2>/dev/null; then kmod static-nodes --format=tmpfiles 2>/dev/null | \ while read type file mode a a a majmin || [ -n "$type" ]; do type=${type%\!} case $type in d) mkdir -m $mode -p $file ;; c) mknod -m $mode $file $type ${majmin%:*} ${majmin#*:} ;; esac done fi trap "emergency_shell Signal caught!" 0 export UDEVVERSION=$(udevadm --version | { read v _ ; echo $v ; }) if [ $UDEVVERSION -gt 166 ]; then # newer versions of udev use /run/udev/rules.d export UDEVRULESD=/run/udev/rules.d [ -d /run/udev ] || mkdir -p -m 0755 /run/udev [ -d $UDEVRULESD ] || mkdir -p -m 0755 $UDEVRULESD else mkdir -m 0755 /dev/.udev /dev/.udev/rules.d export UDEVRULESD=/dev/.udev/rules.d fi if [ "$RD_DEBUG" = "yes" ]; then mkfifo /run/initramfs/loginit.pipe loginit $DRACUT_QUIET </run/initramfs/loginit.pipe >/dev/console 2>&1 & exec >/run/initramfs/loginit.pipe 2>&1 else exec 0<>/dev/console 1<>/dev/console 2<>/dev/console fi [ -f /usr/lib/initrd-release ] && . /usr/lib/initrd-release [ -n "$VERSION_ID" ] && info "$NAME-$VERSION_ID" source_conf /etc/conf.d if getarg "rd.cmdline=ask"; then echo "Enter additional kernel command line parameter (end with ctrl-d or .)" while read -p "> " line || [ -n "$line" ]; do [ "$line" = "." ] && break echo "$line" >> /etc/cmdline.d/99-cmdline-ask.conf done fi if ! getargbool 1 'rd.hostonly'; then [ -f /etc/cmdline.d/99-cmdline-ask.conf ] && mv /etc/cmdline.d/99-cmdline-ask.conf /tmp/99-cmdline-ask.conf remove_hostonly_files [ -f /tmp/99-cmdline-ask.conf ] && mv /tmp/99-cmdline-ask.conf /etc/cmdline.d/99-cmdline-ask.conf fi # run scriptlets to parse the command line make_trace_mem "hook cmdline" '1+:mem' '1+:iomem' '3+:slab' getarg 'rd.break=cmdline' -d 'rdbreak=cmdline' && emergency_shell -n cmdline "Break before cmdline" source_hook cmdline [ -z "$root" ] && die "No or empty root= argument" [ -z "$rootok" ] && die "Don't know how to handle 'root=$root'" export root rflags fstype netroot NEWROOT # pre-udev scripts run before udev starts, and are run only once. make_trace_mem "hook pre-udev" '1:shortmem' '2+:mem' '3+:slab' getarg 'rd.break=pre-udev' -d 'rdbreak=pre-udev' && emergency_shell -n pre-udev "Break before pre-udev" source_hook pre-udev UDEV_LOG=err getargbool 0 rd.udev.info -d -y rdudevinfo && UDEV_LOG=info 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_QUEUE_EMPTY="udevadm settle --timeout=0" if [ $UDEVVERSION -lt 140 ]; then UDEV_QUEUE_EMPTY="udevadm settle --timeout=1" fi udevproperty "hookdir=$hookdir" make_trace_mem "hook pre-trigger" '1:shortmem' '2+:mem' '3+:slab' getarg 'rd.break=pre-trigger' -d 'rdbreak=pre-trigger' && emergency_shell -n pre-trigger "Break before pre-trigger" source_hook pre-trigger udevadm control --reload >/dev/null 2>&1 || : # then the rest udevadm trigger --type=subsystems --action=add >/dev/null 2>&1 udevadm trigger --type=devices --action=add >/dev/null 2>&1 make_trace_mem "hook initqueue" '1:shortmem' '2+:mem' '3+:slab' getarg 'rd.break=initqueue' -d 'rdbreak=initqueue' && emergency_shell -n initqueue "Break before initqueue" RDRETRY=$(getarg rd.retry -d 'rd_retry=') RDRETRY=${RDRETRY:-180} RDRETRY=$(($RDRETRY*2)) export RDRETRY main_loop=0 export main_loop while :; do check_finished && break udevsettle check_finished && break if [ -f $hookdir/initqueue/work ]; then rm -f -- $hookdir/initqueue/work fi for job in $hookdir/initqueue/*.sh; do [ -e "$job" ] || break job=$job . $job check_finished && break 2 done $UDEV_QUEUE_EMPTY >/dev/null 2>&1 || continue for job in $hookdir/initqueue/settled/*.sh; do [ -e "$job" ] || break job=$job . $job check_finished && break 2 done $UDEV_QUEUE_EMPTY >/dev/null 2>&1 || continue # no more udev jobs and queues empty. sleep 0.5 if [ $main_loop -gt $((2*$RDRETRY/3)) ]; then for job in $hookdir/initqueue/timeout/*.sh; do [ -e "$job" ] || break job=$job . $job udevadm settle --timeout=0 >/dev/null 2>&1 || main_loop=0 [ -f $hookdir/initqueue/work ] && main_loop=0 done fi main_loop=$(($main_loop+1)) [ $main_loop -gt $RDRETRY ] \ && { flock -s 9 ; emergency_shell "Could not boot."; } 9>/.console_lock done unset job unset queuetriggered unset main_loop unset RDRETRY # pre-mount happens before we try to mount the root filesystem, # and happens once. make_trace_mem "hook pre-mount" '1:shortmem' '2+:mem' '3+:slab' getarg 'rd.break=pre-mount' -d 'rdbreak=pre-mount' && emergency_shell -n pre-mount "Break pre-mount" source_hook pre-mount getarg 'rd.break=mount' -d 'rdbreak=mount' && emergency_shell -n mount "Break mount" # mount scripts actually try to mount the root filesystem, and may # be sourced any number of times. As soon as one suceeds, no more are sourced. _i_mount=0 while :; do if ismounted "$NEWROOT"; then usable_root "$NEWROOT" && break; umount "$NEWROOT" fi for f in $hookdir/mount/*.sh; do [ -f "$f" ] && . "$f" if ismounted "$NEWROOT"; then usable_root "$NEWROOT" && break; warn "$NEWROOT has no proper rootfs layout, ignoring and removing offending mount hook" umount "$NEWROOT" rm -f -- "$f" fi done _i_mount=$(($_i_mount+1)) [ $_i_mount -gt 20 ] \ && { flock -s 9 ; emergency_shell "Can't mount root filesystem"; } 9>/.console_lock done { printf "Mounted root filesystem " while read dev mp rest || [ -n "$dev" ]; do [ "$mp" = "$NEWROOT" ] && echo $dev; done < /proc/mounts } | vinfo # pre pivot scripts are sourced just before we doing cleanup and switch over # to the new root. make_trace_mem "hook pre-pivot" '1:shortmem' '2+:mem' '3+:slab' getarg 'rd.break=pre-pivot' -d 'rdbreak=pre-pivot' && emergency_shell -n pre-pivot "Break pre-pivot" source_hook pre-pivot make_trace_mem "hook cleanup" '1:shortmem' '2+:mem' '3+:slab' # pre pivot cleanup scripts are sourced just before we switch over to the new root. getarg 'rd.break=cleanup' -d 'rdbreak=cleanup' && emergency_shell -n cleanup "Break cleanup" source_hook cleanup # By the time we get here, the root filesystem should be mounted. # Try to find init. for i in "$(getarg real_init=)" "$(getarg init=)" $(getargs rd.distroinit=) /sbin/init; do [ -n "$i" ] || continue __p=$(readlink -f "${NEWROOT}/${i}") if [ -x "$__p" -o -x "${NEWROOT}/${__p}" ]; then INIT="$i" break fi done [ "$INIT" ] || { echo "Cannot find init!" echo "Please check to make sure you passed a valid root filesystem!" emergency_shell } if [ $UDEVVERSION -lt 168 ]; then # stop udev queue before killing it udevadm control --stop-exec-queue HARD="" while pidof udevd >/dev/null 2>&1; do for pid in $(pidof udevd); do kill $HARD $pid >/dev/null 2>&1 done HARD="-9" done else udevadm control --exit udevadm info --cleanup-db fi debug_off # Turn off debugging for this section # unexport some vars export_n root rflags fstype netroot NEWROOT export RD_TIMESTAMP # Clean up the environment for i in $(export -p); do i=${i#declare -x} i=${i#export} strstr "$i" "=" || continue i=${i%%=*} [ -z "$i" ] && continue case $i in root|PATH|HOME|TERM|PS4|RD_*) :;; *) unset "$i";; esac done . /tmp/export.orig 2>/dev/null || : rm -f -- /tmp/export.orig initargs="" read CLINE </proc/cmdline if getarg init= >/dev/null ; then ignoreargs="console BOOT_IMAGE" # only pass arguments after init= to the init CLINE=${CLINE#*init=} set -- $CLINE shift # clear out the rest of the "init=" arg for x in "$@"; do for s in $ignoreargs; do [ "${x%%=*}" = $s ] && continue 2 done initargs="$initargs $x" done unset CLINE else debug_off # Turn off debugging for this section set -- $CLINE for x in "$@"; do case "$x" in [0-9]|s|S|single|emergency|auto ) \ initargs="$initargs $x" ;; esac done fi debug_on if ! [ -d "$NEWROOT"/run ]; then NEWRUN=/dev/.initramfs mkdir -m 0755 "$NEWRUN" mount --rbind /run/initramfs "$NEWRUN" fi wait_for_loginit # remove helper symlink [ -h /dev/root ] && rm -f -- /dev/root bv=$(getarg rd.break -d rdbreak) && [ -z "$bv" ] && emergency_shell -n switch_root "Break before switch_root" unset bv info "Switching root" unset PS4 CAPSH=$(command -v capsh) SWITCH_ROOT=$(command -v switch_root) PATH=$OLDPATH export PATH if [ -f /etc/capsdrop ]; then . /etc/capsdrop info "Calling $INIT with capabilities $CAPS_INIT_DROP dropped." unset RD_DEBUG exec $CAPSH --drop="$CAPS_INIT_DROP" -- \ -c "exec switch_root \"$NEWROOT\" \"$INIT\" $initargs" || \ { warn "Command:" warn capsh --drop=$CAPS_INIT_DROP -- -c exec switch_root "$NEWROOT" "$INIT" $initargs warn "failed." emergency_shell } else unset RD_DEBUG exec $SWITCH_ROOT "$NEWROOT" "$INIT" $initargs || { warn "Something went very badly wrong in the initramfs. Please " warn "file a bug against dracut." emergency_shell } fi modules.d/99base/initqueue.sh000075500000002213151701010110012062 0ustar00#!/bin/sh # # Licensed under the GPLv2+ # # Copyright 2008-2010, Red Hat, Inc. # Harald Hoyer <harald@redhat.com> PATH=/usr/sbin:/usr/bin:/sbin:/bin type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh while [ $# -gt 0 ]; do case "$1" in --onetime) onetime="yes";; --online) qname="/online";; --settled) qname="/settled";; --finished) qname="/finished";; --timeout) qname="/timeout";; --unique) unique="yes";; --name) name="$2";shift;; --env) env="$2"; shift;; *) break;; esac shift done if [ -z "$unique" ]; then job="${name}$$" else job="${name:-$1}" job=${job##*/} fi exe=$1 shift [ -x "$exe" ] || exe=$(command -v $exe) if [ -z "$exe" ] ; then echo "Invalid command" exit 1 fi { [ -n "$onetime" ] && echo '[ -e "$job" ] && rm -f -- "$job"' [ -n "$env" ] && echo "$env" echo "$exe" "$@" } > "/tmp/$$-${job}.sh" mv -f "/tmp/$$-${job}.sh" "$hookdir/initqueue${qname}/${job}.sh" [ -z "$qname" ] && >> $hookdir/initqueue/work exit 0 modules.d/99base/loginit.sh000075500000000754151701010110011527 0ustar00#!/bin/sh # turn off debugging set +x QUIET=$1 printf -- "$$" > /run/initramfs/loginit.pid [ -e /dev/kmsg ] && exec 5>/dev/kmsg || exec 5>/dev/null exec 6>/run/initramfs/init.log while read line || [ -n "$line" ]; do if [ "$line" = "DRACUT_LOG_END" ]; then rm -f -- /run/initramfs/loginit.pipe exit 0 fi echo "<31>dracut: $line" >&5 # if "quiet" is specified we output to /dev/console [ -n "$QUIET" ] || echo "dracut: $line" echo "$line" >&6 done modules.d/99base/module-setup.sh000075500000010013151701010110012472 0ustar00#!/bin/bash # called by dracut check() { return 0 } # called by dracut depends() { echo udev-rules return 0 } # called by dracut install() { local _d inst_multiple mount mknod mkdir sleep chroot chown \ sed ls flock cp mv dmesg rm ln rmmod mkfifo umount readlink setsid inst $(command -v modprobe) /sbin/modprobe inst_multiple -o findmnt less kmod if [ ! -e "${initdir}/bin/sh" ]; then inst_multiple bash (ln -s bash "${initdir}/bin/sh" || :) fi #add common users in /etc/passwd, it will be used by nfs/ssh currently grep '^root:' "$initdir/etc/passwd" 2>/dev/null || echo 'root:x:0:0::/root:/bin/sh' >> "$initdir/etc/passwd" grep '^nobody:' /etc/passwd >> "$initdir/etc/passwd" # install our scripts and hooks inst_script "$moddir/init.sh" "/init" inst_script "$moddir/initqueue.sh" "/sbin/initqueue" inst_script "$moddir/loginit.sh" "/sbin/loginit" inst_script "$moddir/rdsosreport.sh" "/sbin/rdsosreport" [ -e "${initdir}/lib" ] || mkdir -m 0755 -p ${initdir}/lib mkdir -m 0755 -p ${initdir}/lib/dracut mkdir -m 0755 -p ${initdir}/lib/dracut/hooks mkdir -p ${initdir}/tmp inst_simple "$moddir/dracut-lib.sh" "/lib/dracut-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 if [[ $realinitpath ]]; then for i in $realinitpath; do echo "rd.distroinit=$i" done > "${initdir}/etc/cmdline.d/distroinit.conf" fi ln -fs /proc/self/mounts "$initdir/etc/mtab" if [[ $ro_mnt = yes ]]; then echo ro >> "${initdir}/etc/cmdline.d/base.conf" fi local VERSION="" local PRETTY_NAME="" if [ -e /etc/os-release ]; then . /etc/os-release [[ -n ${VERSION} ]] && VERSION+=" " [[ -n ${PRETTY_NAME} ]] && PRETTY_NAME+=" " fi NAME=dracut ID=dracut VERSION+="dracut-$DRACUT_VERSION" PRETTY_NAME+="dracut-$DRACUT_VERSION (Initramfs)" VERSION_ID=$DRACUT_VERSION ANSI_COLOR="0;31" [ -e "${initdir}/usr/lib" ] || mkdir -m 0755 -p ${initdir}/usr/lib { echo NAME=\"$NAME\" echo VERSION=\"$VERSION\" echo ID=$ID echo VERSION_ID=$VERSION_ID echo PRETTY_NAME=\"$PRETTY_NAME\" echo ANSI_COLOR=\"$ANSI_COLOR\" } > $initdir/usr/lib/initrd-release echo dracut-$DRACUT_VERSION > $initdir/lib/dracut/dracut-$DRACUT_VERSION ln -sf ../usr/lib/initrd-release $initdir/etc/initrd-release ln -sf initrd-release $initdir/usr/lib/os-release ln -sf initrd-release $initdir/etc/os-release ## save host_devs which we need bring up if [[ $hostonly_cmdline == "yes" ]]; then if [[ -n "${host_devs[@]}" ]]; then dracut_need_initqueue fi if [[ -f "$initdir/lib/dracut/need-initqueue" ]] || ! dracut_module_included "systemd"; then ( if dracut_module_included "systemd"; then DRACUT_SYSTEMD=1 fi PREFIX="$initdir" . "$moddir/dracut-lib.sh" for _dev in "${host_devs[@]}"; do for _dev2 in "${root_devs[@]}"; do [[ "$_dev" == "$_dev2" ]] && continue 2 done # We only actually wait for real devs - swap is only needed # for resume and udev rules generated when parsing resume= # argument take care of the waiting for us for _dev2 in "${swap_devs[@]}"; do [[ "$_dev" == "$_dev2" ]] && continue 2 done _pdev=$(get_persistent_dev $_dev) case "$_pdev" in /dev/?*) wait_for_dev $_pdev;; *) ;; esac done ) fi fi } modules.d/99base/parse-root-opts.sh000075500000000366151701010110013137 0ustar00#!/bin/sh root=$(getarg root=) rflags="$(getarg rootflags=)" getargbool 0 ro && rflags="${rflags},ro" getargbool 0 rw && rflags="${rflags},rw" rflags="${rflags#,}" fstype="$(getarg rootfstype=)" if [ -z "$fstype" ]; then fstype="auto" fi modules.d/99base/rdsosreport.sh000075500000002502151701010110012441 0ustar00#!/bin/sh echo 'Generating "/run/initramfs/rdsosreport.txt"' [ -d /run/initramfs ] || mkdir -p /run/initramfs exec >/run/initramfs/rdsosreport.txt 2>&1 PWFILTER='s/\(ftp:\/\/.*\):.*@/\1:*******@/g;s/\(cifs:\/\/.*\):.*@/\1:*******@/g;s/cifspass=[^ ]*/cifspass=*******/g;s/iscsi:.*@/iscsi:******@/g;s/rd.iscsi.password=[^ ]*/rd.iscsi.password=******/g;s/rd.iscsi.in.password=[^ ]*/rd.iscsi.in.password=******/g' set -x cat /lib/dracut/dracut-* cat /proc/cmdline | sed -e "$PWFILTER" [ -f /etc/cmdline ] && cat /etc/cmdline | sed -e "$PWFILTER" for _i in /etc/cmdline.d/*.conf; do [ -f "$_i" ] || break echo $_i cat $_i | sed -e "$PWFILTER" done cat /proc/self/mountinfo cat /proc/mounts blkid blkid -o udev ls -l /dev/disk/by* for _i in /etc/conf.d/*.conf; do [ -f "$_i" ] || break echo $_i cat $_i | sed -e "$PWFILTER" done if command -v lvm >/dev/null 2>/dev/null; then lvm pvdisplay lvm vgdisplay lvm lvdisplay fi command -v dmsetup >/dev/null 2>/dev/null && dmsetup ls --tree cat /proc/mdstat command -v ip >/dev/null 2>/dev/null && ip addr if command -v journalctl >/dev/null 2>/dev/null; then journalctl -ab --no-pager -o short-monotonic | sed -e "$PWFILTER" else dmesg | sed -e "$PWFILTER" [ -f /run/initramfs/init.log ] && cat /run/initramfs/init.log | sed -e "$PWFILTER" fi modules.d/99fs-lib/fs-lib.sh000075500000014355151701010110011502 0ustar00#!/bin/sh type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh fsck_ask_reboot() { info "note - fsck suggests reboot, if you" info "leave shell, booting will continue normally" emergency_shell -n "(reboot ?)" } fsck_ask_err() { warn "*** An error occurred during the file system check." warn "*** Dropping you to a shell; the system will try" warn "*** to mount the filesystem(s), when you leave the shell." emergency_shell -n "(Repair filesystem)" } # inherits: _ret _drv _out fsck_tail() { [ $_ret -gt 0 ] && warn "$_drv returned with $_ret" if [ $_ret -ge 4 ]; then [ -n "$_out" ] && echo "$_out"|vwarn fsck_ask_err else [ -n "$_out" ] && echo "$_out"|vinfo [ $_ret -ge 2 ] && fsck_ask_reboot fi } # note: this function sets _drv of the caller fsck_able() { case "$1" in xfs) # { # type xfs_db && # type xfs_repair && # type xfs_check && # type mount && # type umount # } >/dev/null 2>&1 && # _drv="_drv=none fsck_drv_xfs" && # return 0 return 1 ;; ext?) type e2fsck >/dev/null 2>&1 && _drv="fsck_drv_com e2fsck" && return 0 ;; f2fs) type fsck.f2fs >/dev/null 2>&1 && _drv="fsck_drv_com fsck.f2fs" && return 0 ;; jfs) type jfs_fsck >/dev/null 2>&1 && _drv="fsck_drv_com jfs_fsck" && return 0 ;; reiserfs) type reiserfsck >/dev/null 2>&1 && _drv="fsck_drv_com reiserfsck" && return 0 ;; btrfs) # type btrfsck >/dev/null 2>&1 && # _drv="_drv=none fsck_drv_btrfs" && # return 0 return 1 ;; nfs*) # nfs can be a nop, returning success _drv=":" && return 0 ;; *) type fsck >/dev/null 2>&1 && _drv="fsck_drv_std fsck" && return 0 ;; esac return 1 } # note: all drivers inherit: _drv _fop _dev fsck_drv_xfs() { # xfs fsck is not necessary... Either it mounts or not return 0 } fsck_drv_btrfs() { # btrfs fsck is not necessary... Either it mounts or not return 0 } # common code for checkers that follow usual subset of options and return codes fsck_drv_com() { local _drv="$1" local _ret local _out if ! strglobin "$_fop" "-[ynap]"; then _fop="-a ${_fop}" fi info "issuing $_drv $_fop $_dev" # we enforce non-interactive run, so $() is fine _out=$($_drv $_fop "$_dev") _ret=$? fsck_tail return $_ret } # code for generic fsck, if the filesystem checked is "unknown" to us fsck_drv_std() { local _ret local _out unset _out info "issuing fsck $_fop $_dev" # note, we don't enforce -a here, thus fsck is being run (in theory) # interactively; otherwise some tool might complain about lack of terminal # (and using -a might not be safe) fsck $_fop "$_dev" >/dev/console 2>&1 _ret=$? fsck_tail return $_ret } # checks single filesystem, relying on specific "driver"; we don't rely on # automatic checking based on fstab, so empty one is passed; # takes 4 arguments - device, filesystem, filesystem options, additional fsck options; # first 2 arguments are mandatory (fs may be auto or "") # returns 255 if filesystem wasn't checked at all (e.g. due to lack of # necessary tools or insufficient options) fsck_single() { local FSTAB_FILE=/etc/fstab.empty local _dev="$1" local _fs="${2:-auto}" local _fsopts="$3" local _fop="$4" local _drv [ $# -lt 2 ] && return 255 # if UUID= marks more than one device, take only the first one [ -e "$_dev" ] || _dev=$(devnames "$_dev"| while read line || [ -n "$line" ]; do if [ -n "$line" ]; then echo $line; break;fi;done) [ -e "$_dev" ] || return 255 _fs=$(det_fs "$_dev" "$_fs") fsck_able "$_fs" || return 255 info "Checking $_fs: $_dev" export FSTAB_FILE eval "$_drv" return $? } # takes list of filesystems to check in parallel; we don't rely on automatic # checking based on fstab, so empty one is passed fsck_batch() { local FSTAB_FILE=/etc/fstab.empty local _drv=fsck local _dev local _ret local _out [ $# -eq 0 ] || ! type fsck >/dev/null 2>&1 && return 255 info "Checking filesystems (fsck -M -T -a):" for _dev in "$@"; do info " $_dev" done export FSTAB_FILE _out="$(fsck -M -T "$@" -- -a)" _ret=$? fsck_tail return $_ret } # verify supplied filesystem type: # if user provided the fs and we couldn't find it, assume user is right # if we found the fs, assume we're right det_fs() { local _dev="$1" local _orig="${2:-auto}" local _fs _fs=$(udevadm info --query=env --name="$_dev" | \ while read line || [ -n "$line" ]; do if str_starts $line "ID_FS_TYPE="; then echo ${line#ID_FS_TYPE=} break fi done) _fs=${_fs:-auto} if [ "$_fs" = "auto" ]; then _fs="$_orig" fi echo "$_fs" } write_fs_tab() { local _o local _rw local _root local _rootfstype local _rootflags local _fspassno _fspassno="0" _root="$1" _rootfstype="$2" _rootflags="$3" [ -z "$_rootfstype" ] && _rootfstype=$(getarg rootfstype=) [ -z "$_rootflags" ] && _rootflags=$(getarg rootflags=) [ -z "$_rootfstype" ] && _rootfstype="auto" if [ -z "$_rootflags" ]; then _rootflags="ro,x-initrd.mount" else _rootflags="ro,$_rootflags,x-initrd.mount" fi _rw=0 CMDLINE=$(getcmdline) for _o in $CMDLINE; do case $_o in rw) _rw=1;; ro) _rw=0;; esac done if [ "$_rw" = "1" ]; then _rootflags="$_rootflags,rw" if ! getargbool 0 rd.skipfsck; then _fspassno="1" fi fi echo "$_root /sysroot $_rootfstype $_rootflags $_fspassno 0" >> /etc/fstab if type systemctl >/dev/null 2>/dev/null; then systemctl daemon-reload systemctl --no-block start initrd-root-fs.target fi } modules.d/99fs-lib/module-setup.sh000075500000003272151701010110012745 0ustar00#!/bin/bash # called by dracut check() { return 0 } # called by dracut depends() { return 0 } echo_fs_helper() { local dev=$1 fs=$2 case "$fs" in xfs) echo -n " xfs_db xfs_repair xfs_check xfs_metadump " ;; ext?) echo -n " e2fsck " ;; jfs) echo -n " jfs_fsck " ;; reiserfs) echo -n " reiserfsck " ;; btrfs) echo -n " btrfsck " ;; esac echo -n " fsck.$fs " return 0 } include_fs_helper_modules() { local dev=$1 fs=$2 case "$fs" in xfs|btrfs|ext4) instmods crc32c ;; f2fs) instmods crc32 ;; esac } # called by dracut installkernel() { # xfs/btrfs/ext4 need crc32c, f2fs needs crc32 if [[ $hostonly ]]; then for_each_host_dev_fs include_fs_helper_modules : else instmods crc32c crc32 fi } # called by dracut install() { local _helpers inst "$moddir/fs-lib.sh" "/lib/fs-lib.sh" > ${initdir}/etc/fstab.empty [[ "$nofscks" = "yes" ]] && return if [[ "$fscks" = "${fscks#*[^ ]*}" ]]; then _helpers="\ umount mount /sbin/fsck* xfs_db xfs_check xfs_repair xfs_metadump e2fsck jfs_fsck reiserfsck btrfsck " if [[ $hostonly ]]; then _helpers="umount mount " _helpers+=$(for_each_host_dev_fs echo_fs_helper) fi else _helpers="$fscks" fi if [[ "$_helpers" == *e2fsck* ]] && [ -e /etc/e2fsck.conf ]; then inst_simple /etc/e2fsck.conf fi inst_multiple -o $_helpers fsck } modules.d/99memstrack/memstrack-report.sh000075500000000712151701010110014427 0ustar00#!/usr/bin/bash . /lib/dracut-lib.sh if ! [ "$DEBUG_MEM_LEVEL" -ge 4 ]; then return 0 fi if type -P systemctl >/dev/null; then systemctl stop memstrack.service else get_pid_of_tracer () { local _user _pid _rest read _user _pid _rest <<< $(ps aux | grep [m]emstrack | head -1) echo $_pid } kill -s INT $(get_pid_of_tracer) while [[ -n $(get_pid_of_tracer) ]]; do sleep 1 done fi cat /.memstrack modules.d/99memstrack/memstrack-start.sh000075500000003416151701010110014255 0ustar00#!/bin/sh # Mount kernel debug fs so debug tools can work. # memdebug=4 and memdebug=5 requires debug fs to be mounted. # And there is no need to umount it. type getargnum >/dev/null 2>&1 || . /lib/dracut-lib.sh # "sys/kernel/tracing" has the priority if exists. get_trace_base() { # trace access through debugfs would be obsolete if "/sys/kernel/tracing" is available. if [ -d "/sys/kernel/tracing" ]; then echo "/sys/kernel" else echo "/sys/kernel/debug" fi } is_debugfs_ready() { [ -f "$(get_trace_base)/tracing/trace" ] } prepare_debugfs() { local trace_base trace_base=$(get_trace_base) # old debugfs interface case. if ! [ -d "$trace_base/tracing" ]; then mount none -t debugfs $trace_base # new tracefs interface case. elif ! [ -f "$trace_base/tracing/trace" ]; then mount none -t tracefs "$trace_base/tracing" fi if ! [ -f "$trace_base/tracing/trace" ]; then echo "WARN: failed to mount debugfs" return 1 fi } if ! is_debugfs_ready ; then prepare_debugfs fi if [ -n "$DEBUG_MEM_LEVEL" ]; then if [ "$DEBUG_MEM_LEVEL" -ge 5 ]; then echo "memstrack - will report kernel module memory usage summary and top allocation stack" memstrack --report module_summary,module_top --notui --throttle 80 -o /.memstrack & elif [ "$DEBUG_MEM_LEVEL" -ge 4 ]; then echo "memstrack - will report memory usage summary" memstrack --report module_summary --notui --throttle 80 -o /.memstrack & else exit 0; fi fi PID=$! RET=$? if [ $RET -ne 0 ]; then echo "Failed to start memstrack, exit status: $RET" exit $RET fi # Wait a second for memstrack to setup everything, avoid missing any event sleep 1 echo $PID > /run/memstrack.pid disown modules.d/99memstrack/memstrack.service000064400000000502151701010110014136 0ustar00[Unit] Description=Memstrack Anylazing Service DefaultDependencies=no Before=dracut-cmdline.service systemd-udevd.service local-fs-pre.target IgnoreOnIsolate=true [Service] Type=simple ExecStart=/bin/memstrack-start PIDFile=/run/memstrack.pid StandardInput=null StandardOutput=syslog+console StandardError=syslog+console modules.d/99memstrack/module-setup.sh000075500000001160151701010110013551 0ustar00#!/usr/bin/bash check() { if find_binary memstrack >/dev/null; then dinfo "memstrack is available" return 0 fi dinfo "memstrack is not available" dinfo "If you need to use rd.memdebug>=4, please install memstrack" return 1 } depends() { return 0 } install() { inst "/bin/memstrack" "/bin/memstrack" inst "$moddir/memstrack-start.sh" "/bin/memstrack-start" inst_hook cleanup 99 "$moddir/memstrack-report.sh" inst "$moddir/memstrack.service" "$systemdsystemunitdir/memstrack.service" systemctl -q --root "$initdir" add-wants initrd.target memstrack.service } modules.d/99shutdown/module-setup.sh000075500000001111151701010110013432 0ustar00#!/bin/bash # called by dracut check() { return 0 } # called by dracut depends() { echo base return 0 } # called by dracut install() { local _d inst_multiple umount poweroff reboot halt losetup stat sleep inst_multiple -o kexec inst "$moddir/shutdown.sh" "$prefix/shutdown" [ -e "${initdir}/lib" ] || mkdir -m 0755 -p ${initdir}/lib mkdir -m 0755 -p ${initdir}/lib/dracut mkdir -m 0755 -p ${initdir}/lib/dracut/hooks for _d in $hookdirs shutdown shutdown-emergency; do mkdir -m 0755 -p ${initdir}/lib/dracut/hooks/$_d done } modules.d/99shutdown/shutdown.sh000075500000006066151701010110012700 0ustar00#!/bin/sh # # Licensed under the GPLv2 # # Copyright 2011, Red Hat, Inc. # Harald Hoyer <harald@redhat.com> ACTION="$1" [ -w /dev/console ] && exec </dev/console >>/dev/console 2>>/dev/console export TERM=linux export PATH=/usr/sbin:/usr/bin:/sbin:/bin . /lib/dracut-lib.sh if [ "$(stat -c '%T' -f /)" = "tmpfs" ]; then mount -o remount,rw / fi mkdir /oldsys for i in sys proc run dev; do mkdir /oldsys/$i mount --move /oldroot/$i /oldsys/$i done # if "kexec" was installed after creating the initramfs, we try to copy it from the real root # libz normally is pulled in via kmod/modprobe and udevadm if [ "$ACTION" = "kexec" ] && ! command -v kexec >/dev/null 2>&1; then for p in /usr/sbin /usr/bin /sbin /bin; do cp -a /oldroot/${p}/kexec $p >/dev/null 2>&1 && break done hash kexec fi trap "emergency_shell --shutdown shutdown Signal caught!" 0 getarg 'rd.break=pre-shutdown' && emergency_shell --shutdown pre-shutdown "Break before pre-shutdown" source_hook pre-shutdown warn "Killing all remaining processes" killall_proc_mountpoint /oldroot || sleep 0.2 umount_a() { local _did_umount="n" while read a mp a || [ -n "$mp" ]; do if strstr "$mp" oldroot; then if umount "$mp"; then _did_umount="y" warn "Unmounted $mp." fi fi done </proc/mounts losetup -D [ "$_did_umount" = "y" ] && return 0 return 1 } _cnt=0 while [ $_cnt -le 40 ]; do umount_a 2>/dev/null || break _cnt=$(($_cnt+1)) done [ $_cnt -ge 40 ] && umount_a if strstr "$(cat /proc/mounts)" "/oldroot"; then warn "Cannot umount /oldroot" for _pid in /proc/*; do _pid=${_pid##/proc/} case $_pid in *[!0-9]*) continue;; esac [ $_pid -eq $$ ] && continue [ -e "/proc/$_pid/exe" ] || continue [ -e "/proc/$_pid/root" ] || continue if strstr "$(ls -l /proc/$_pid /proc/$_pid/fd 2>/dev/null)" "oldroot"; then warn "Blocking umount of /oldroot [$_pid] $(cat /proc/$_pid/cmdline)" else warn "Still running [$_pid] $(cat /proc/$_pid/cmdline)" fi ls -l "/proc/$_pid/exe" 2>&1 | vwarn ls -l "/proc/$_pid/fd" 2>&1 | vwarn done fi _check_shutdown() { local __f local __s=0 for __f in $hookdir/shutdown/*.sh; do [ -e "$__f" ] || continue ( . "$__f" $1 ) if [ $? -eq 0 ]; then rm -f -- $__f else __s=1 fi done return $__s } _cnt=0 while [ $_cnt -le 40 ]; do _check_shutdown && break _cnt=$(($_cnt+1)) done [ $_cnt -ge 40 ] && _check_shutdown final getarg 'rd.break=shutdown' && emergency_shell --shutdown shutdown "Break before shutdown" case "$ACTION" in reboot|poweroff|halt) $ACTION -f -d -n warn "$ACTION failed!" ;; kexec) kexec -e warn "$ACTION failed!" reboot -f -d -n ;; *) warn "Shutdown called with argument '$ACTION'. Rebooting!" reboot -f -d -n ;; esac emergency_shell --shutdown shutdown modules.d/02systemd-networkd/module-setup.sh000075500000004277151701010110015102 0ustar00#!/bin/bash # called by dracut check() { [[ $mount_needs ]] && return 1 if ! dracut_module_included "systemd"; then derror "systemd-networkd needs systemd in the initramfs" return 1 fi return 255 } # called by dracut depends() { echo "systemd kernel-network-modules" } installkernel() { return 0 } # called by dracut install() { inst_multiple -o \ $systemdutildir/systemd-networkd \ $systemdutildir/systemd-networkd-wait-online \ $systemdsystemunitdir/systemd-networkd-wait-online.service \ $systemdsystemunitdir/systemd-networkd.service \ $systemdsystemunitdir/systemd-networkd.socket \ $systemdutildir/network/99-default.link \ networkctl ip #hostnamectl timedatectl # $systemdutildir/systemd-timesyncd \ # $systemdutildir/systemd-timedated \ # $systemdutildir/systemd-hostnamed \ # $systemdutildir/systemd-resolvd \ # $systemdutildir/systemd-resolve-host \ # $systemdsystemunitdir/systemd-resolved.service \ # $systemdsystemunitdir/systemd-hostnamed.service \ # $systemdsystemunitdir/systemd-timesyncd.service \ # $systemdsystemunitdir/systemd-timedated.service \ # $systemdsystemunitdir/time-sync.target \ # /etc/systemd/resolved.conf \ # inst_dir /var/lib/systemd/clock grep '^systemd-network:' /etc/passwd 2>/dev/null >> "$initdir/etc/passwd" grep '^systemd-network:' /etc/group >> "$initdir/etc/group" # grep '^systemd-timesync:' /etc/passwd 2>/dev/null >> "$initdir/etc/passwd" # grep '^systemd-timesync:' /etc/group >> "$initdir/etc/group" _arch=$(uname -m) inst_libdir_file {"tls/$_arch/",tls/,"$_arch/",}"libnss_dns.so.*" \ {"tls/$_arch/",tls/,"$_arch/",}"libnss_mdns4_minimal.so.*" \ {"tls/$_arch/",tls/,"$_arch/",}"libnss_myhostname.so.*" \ {"tls/$_arch/",tls/,"$_arch/",}"libnss_resolve.so.*" for i in \ systemd-networkd-wait-online.service \ systemd-networkd.service \ systemd-networkd.socket # systemd-timesyncd.service do systemctl -q --root "$initdir" enable "$i" done } modules.d/35network-legacy/dhclient-script.sh000075500000022236151701010110015164 0ustar00#!/bin/sh PATH=/usr/sbin:/usr/bin:/sbin:/bin type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh type ip_to_var >/dev/null 2>&1 || . /lib/net-lib.sh # We already need a set netif here netif=$interface setup_interface() { ip=$new_ip_address mtu=$new_interface_mtu mask=$new_subnet_mask bcast=$new_broadcast_address gw=${new_routers%%,*} domain=$new_domain_name search=$(printf -- "$new_domain_search") namesrv=$new_domain_name_servers hostname=$new_host_name [ -n "$new_dhcp_lease_time" ] && lease_time=$new_dhcp_lease_time [ -n "$new_max_life" ] && lease_time=$new_max_life preferred_lft=$lease_time [ -n "$new_preferred_life" ] && preferred_lft=$new_preferred_life [ -f /tmp/net.$netif.override ] && . /tmp/net.$netif.override # Taken from debian dhclient-script: # The 576 MTU is only used for X.25 and dialup connections # where the admin wants low latency. Such a low MTU can cause # problems with UDP traffic, among other things. As such, # disallow MTUs from 576 and below by default, so that broken # MTUs are ignored, but higher stuff is allowed (1492, 1500, etc). if [ -n "$mtu" ] && [ $mtu -gt 576 ] ; then if ! ip link set $netif mtu $mtu ; then ip link set $netif down ip link set $netif mtu $mtu linkup $netif fi fi ip addr add $ip${mask:+/$mask} ${bcast:+broadcast $bcast} dev $netif \ ${lease_time:+valid_lft $lease_time} \ ${preferred_lft:+preferred_lft ${preferred_lft}} if [ -n "$gw" ] ; then if [ "$mask" = "255.255.255.255" ] ; then # point-to-point connection => set explicit route to gateway echo ip route add $gw dev $netif > /tmp/net.$netif.gw fi echo "$gw" | { IFS=' ' read -r main_gw other_gw echo ip route replace default via $main_gw dev $netif >> /tmp/net.$netif.gw if [ -n "$other_gw" ] ; then for g in $other_gw; do echo ip route add default via $g dev $netif >> /tmp/net.$netif.gw done fi } fi if getargbool 1 rd.peerdns; then [ -n "${search}${domain}" ] && echo "search $search $domain" > /tmp/net.$netif.resolv.conf if [ -n "$namesrv" ] ; then for s in $namesrv; do echo nameserver $s done fi >> /tmp/net.$netif.resolv.conf fi # Note: hostname can be fqdn OR short hostname, so chop off any # trailing domain name and explicity add any domain if set. [ -n "$hostname" ] && echo "echo ${hostname%.$domain}${domain:+.$domain} > /proc/sys/kernel/hostname" > /tmp/net.$netif.hostname } setup_interface6() { domain=$new_domain_name search=$(printf -- "$new_dhcp6_domain_search") namesrv=$new_dhcp6_name_servers hostname=$new_host_name [ -n "$new_dhcp_lease_time" ] && lease_time=$new_dhcp_lease_time [ -n "$new_max_life" ] && lease_time=$new_max_life preferred_lft=$lease_time [ -n "$new_preferred_life" ] && preferred_lft=$new_preferred_life [ -f /tmp/net.$netif.override ] && . /tmp/net.$netif.override ip -6 addr add ${new_ip6_address}/${new_ip6_prefixlen} \ dev ${netif} scope global \ ${lease_time:+valid_lft $lease_time} \ ${preferred_lft:+preferred_lft ${preferred_lft}} if getargbool 1 rd.peerdns; then [ -n "${search}${domain}" ] && echo "search $search $domain" > /tmp/net.$netif.resolv.conf if [ -n "$namesrv" ] ; then for s in $namesrv; do echo nameserver $s done fi >> /tmp/net.$netif.resolv.conf fi # Note: hostname can be fqdn OR short hostname, so chop off any # trailing domain name and explicity add any domain if set. [ -n "$hostname" ] && echo "echo ${hostname%.$domain}${domain:+.$domain} > /proc/sys/kernel/hostname" > /tmp/net.$netif.hostname } parse_option_121() { while [ $# -ne 0 ]; do mask="$1" shift # Is the destination a multicast group? if [ $1 -ge 224 -a $1 -lt 240 ]; then multicast=1 else multicast=0 fi # Parse the arguments into a CIDR net/mask string if [ $mask -gt 24 ]; then destination="$1.$2.$3.$4/$mask" shift; shift; shift; shift elif [ $mask -gt 16 ]; then destination="$1.$2.$3.0/$mask" shift; shift; shift elif [ $mask -gt 8 ]; then destination="$1.$2.0.0/$mask" shift; shift elif [ $mask -gt 0 ]; then destination="$1.0.0.0/$mask" shift else destination="0.0.0.0/$mask" fi # Read the gateway gateway="$1.$2.$3.$4" shift; shift; shift; shift # Multicast routing on Linux # - If you set a next-hop address for a multicast group, this breaks with Cisco switches # - If you simply leave it link-local and attach it to an interface, it works fine. if [ $multicast -eq 1 -o "$gateway" = "0.0.0.0" ]; then temp_result="$destination dev $interface" else temp_result="$destination via $gateway dev $interface" fi echo "/sbin/ip route add $temp_result" done } case $reason in PREINIT) echo "dhcp: PREINIT $netif up" linkup $netif ;; PREINIT6) echo "dhcp: PREINIT6 $netif up" linkup $netif wait_for_ipv6_dad_link $netif ;; BOUND) echo "dhcp: BOND setting $netif" unset layer2 if [ -f /sys/class/net/$netif/device/layer2 ]; then read layer2 < /sys/class/net/$netif/device/layer2 fi if [ "$layer2" != "0" ]; then if command -v arping2 >/dev/null; then if arping2 -q -C 1 -c 2 -I $netif -0 $new_ip_address ; then warn "Duplicate address detected for $new_ip_address while doing dhcp. retrying" exit 1 fi else if ! arping -f -q -D -c 2 -I $netif $new_ip_address ; then warn "Duplicate address detected for $new_ip_address while doing dhcp. retrying" exit 1 fi fi fi unset layer2 setup_interface set | while read line || [ -n "$line" ]; do [ "${line#new_}" = "$line" ] && continue echo "$line" done >/tmp/dhclient.$netif.dhcpopts { echo '. /lib/net-lib.sh' echo "setup_net $netif" if [ -n "$new_classless_static_routes" ]; then OLDIFS="$IFS" IFS=".$IFS" parse_option_121 $new_classless_static_routes IFS="$OLDIFS" fi echo "source_hook initqueue/online $netif" [ -e /tmp/net.$netif.manualup ] || echo "/sbin/netroot $netif" echo "rm -f -- $hookdir/initqueue/setup_net_$netif.sh" } > $hookdir/initqueue/setup_net_$netif.sh echo "[ -f /tmp/net.$netif.did-setup ]" > $hookdir/initqueue/finished/dhclient-$netif.sh >/tmp/net.$netif.up if [ -e /sys/class/net/${netif}/address ]; then > /tmp/net.$(cat /sys/class/net/${netif}/address).up fi ;; RENEW|REBIND) unset lease_time [ -n "$new_dhcp_lease_time" ] && lease_time=$new_dhcp_lease_time [ -n "$new_max_life" ] && lease_time=$new_max_life preferred_lft=$lease_time [ -n "$new_preferred_life" ] && preferred_lft=$new_preferred_life ip -4 addr change ${new_ip_address}/${new_subnet_mask} broadcast ${new_broadcast_address} dev ${interface} \ ${lease_time:+valid_lft $lease_time} ${preferred_lft:+preferred_lft ${preferred_lft}} \ >/dev/null 2>&1 ;; BOUND6) echo "dhcp: BOND6 setting $netif" setup_interface6 set | while read line || [ -n "$line" ]; do [ "${line#new_}" = "$line" ] && continue echo "$line" done >/tmp/dhclient.$netif.dhcpopts { echo '. /lib/net-lib.sh' echo "setup_net $netif" echo "source_hook initqueue/online $netif" [ -e /tmp/net.$netif.manualup ] || echo "/sbin/netroot $netif" echo "rm -f -- $hookdir/initqueue/setup_net_$netif.sh" } > $hookdir/initqueue/setup_net_$netif.sh echo "[ -f /tmp/net.$netif.did-setup ]" > $hookdir/initqueue/finished/dhclient-$netif.sh >/tmp/net.$netif.up if [ -e /sys/class/net/${netif}/address ]; then > /tmp/net.$(cat /sys/class/net/${netif}/address).up fi ;; RENEW6|REBIND6) unset lease_time [ -n "$new_dhcp_lease_time" ] && lease_time=$new_dhcp_lease_time [ -n "$new_max_life" ] && lease_time=$new_max_life preferred_lft=$lease_time [ -n "$new_preferred_life" ] && preferred_lft=$new_preferred_life ip -6 addr change ${new_ip6_address}/${new_ip6_prefixlen} dev ${interface} scope global \ ${lease_time:+valid_lft $lease_time} ${preferred_lft:+preferred_lft ${preferred_lft}} \ >/dev/null 2>&1 ;; *) echo "dhcp: $reason";; esac exit 0 modules.d/35network-legacy/dhclient.conf000064400000000457151701010110014173 0ustar00 option classless-static-routes code 121 = array of unsigned integer 8; send dhcp-client-identifier = hardware; request subnet-mask, broadcast-address, time-offset, routers, domain-name, domain-name-servers, domain-search, host-name, root-path, interface-mtu, classless-static-routes; modules.d/35network-legacy/ifup.sh000075500000036267151701010110013044 0ustar00#!/bin/sh # # We don't need to check for ip= errors here, that is handled by the # cmdline parser script # # without $2 means this is for real netroot case # or it is for manually bring up network ie. for kdump scp vmcore PATH=/usr/sbin:/usr/bin:/sbin:/bin type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh type ip_to_var >/dev/null 2>&1 || . /lib/net-lib.sh # Huh? No $1? [ -z "$1" ] && exit 1 # $netif reads easier than $1 netif=$1 # loopback is always handled the same way if [ "$netif" = "lo" ] ; then ip link set lo up ip addr add 127.0.0.1/8 dev lo exit 0 fi # Run dhclient do_dhcp() { # dhclient-script will mark the netif up and generate the online # event for nfsroot # XXX add -V vendor class and option parsing per kernel local _COUNT=0 local _timeout=$(getargs rd.net.timeout.dhcp=) local _DHCPRETRY=$(getargs rd.net.dhcp.retry=) _DHCPRETRY=${_DHCPRETRY:-1} [ -e /tmp/dhclient.$netif.pid ] && return 0 if ! iface_has_carrier $netif; then warn "No carrier detected on interface $netif" return 1 fi if [ ! -e /run/NetworkManager/conf.d/10-dracut-dhclient.conf ]; then mkdir -p /run/NetworkManager/conf.d echo '[main]' > /run/NetworkManager/conf.d/10-dracut-dhclient.conf echo 'dhcp=dhclient' >>/run/NetworkManager/conf.d/10-dracut-dhclient.conf fi while [ $_COUNT -lt $_DHCPRETRY ]; do info "Starting dhcp for interface $netif" dhclient "$@" \ ${_timeout:+--timeout $_timeout} \ -q \ -1 \ -cf /etc/dhclient.conf \ -pf /tmp/dhclient.$netif.pid \ -lf /tmp/dhclient.$netif.lease \ $netif \ && return 0 _COUNT=$(($_COUNT+1)) [ $_COUNT -lt $_DHCPRETRY ] && sleep 1 done warn "dhcp for interface $netif failed" # nuke those files since we failed; we might retry dhcp again if it's e.g. # `ip=dhcp,dhcp6` and we check for the PID file at the top rm -f /tmp/dhclient.$netif.{pid,lease} return 1 } load_ipv6() { [ -d /proc/sys/net/ipv6 ] && return modprobe ipv6 i=0 while [ ! -d /proc/sys/net/ipv6 ]; do i=$(($i+1)) [ $i -gt 10 ] && break sleep 0.1 done } do_ipv6auto() { local ret load_ipv6 echo 0 > /proc/sys/net/ipv6/conf/$netif/forwarding echo 1 > /proc/sys/net/ipv6/conf/$netif/accept_ra echo 1 > /proc/sys/net/ipv6/conf/$netif/accept_redirects linkup $netif wait_for_ipv6_auto $netif ret=$? [ -n "$hostname" ] && echo "echo $hostname > /proc/sys/kernel/hostname" > /tmp/net.$netif.hostname return $ret } # Handle static ip configuration do_static() { strglobin $ip '*:*:*' && load_ipv6 if ! iface_has_carrier "$netif"; then warn "No carrier detected on interface $netif" return 1 elif ! linkup "$netif"; then warn "Could not bring interface $netif up!" return 1 fi ip route get "$ip" 2>/dev/null | { read a rest if [ "$a" = "local" ]; then warn "Not assigning $ip to interface $netif, cause it is already assigned!" return 1 fi return 0 } || return 1 [ -n "$macaddr" ] && ip link set address $macaddr dev $netif [ -n "$mtu" ] && ip link set mtu $mtu dev $netif if strglobin $ip '*:*:*'; then # note no ip addr flush for ipv6 ip addr add $ip/$mask ${srv:+peer $srv} dev $netif echo 0 > /proc/sys/net/ipv6/conf/$netif/forwarding echo 1 > /proc/sys/net/ipv6/conf/$netif/accept_ra echo 1 > /proc/sys/net/ipv6/conf/$netif/accept_redirects wait_for_ipv6_dad $netif else if [ -z "$srv" ]; then if command -v arping2 >/dev/null; then if arping2 -q -C 1 -c 2 -I $netif -0 $ip ; then warn "Duplicate address detected for $ip for interface $netif." return 1 fi else if ! arping -f -q -D -c 2 -I $netif $ip ; then warn "Duplicate address detected for $ip for interface $netif." return 1 fi fi fi ip addr flush dev $netif ip addr add $ip/$mask ${srv:+peer $srv} brd + dev $netif fi [ -n "$gw" ] && echo ip route replace default via $gw dev $netif > /tmp/net.$netif.gw [ -n "$hostname" ] && echo "echo $hostname > /proc/sys/kernel/hostname" > /tmp/net.$netif.hostname return 0 } get_vid() { case "$1" in vlan*) echo ${1#vlan} ;; *.*) echo ${1##*.} ;; esac } # check, if we need VLAN's for this interface if [ -z "$DO_VLAN_PHY" ] && [ -e /tmp/vlan.${netif}.phy ]; then unset DO_VLAN NO_AUTO_DHCP=yes DO_VLAN_PHY=yes ifup "$netif" modprobe -b -q 8021q for i in /tmp/vlan.*.${netif}; do [ -e "$i" ] || continue unset vlanname unset phydevice . "$i" if [ -n "$vlanname" ]; then linkup "$phydevice" ip link add dev "$vlanname" link "$phydevice" type vlan id "$(get_vid $vlanname)" ifup "$vlanname" fi done exit 0 fi # Check, if interface is VLAN interface if ! [ -e /tmp/vlan.${netif}.phy ]; then for i in /tmp/vlan.${netif}.*; do [ -e "$i" ] || continue export DO_VLAN=yes break done fi # bridge this interface? if [ -z "$NO_BRIDGE_MASTER" ]; then for i in /tmp/bridge.*.info; do [ -e "$i" ] || continue unset bridgeslaves unset bridgename . "$i" for ethname in $bridgeslaves ; do [ "$netif" != "$ethname" ] && continue NO_BRIDGE_MASTER=yes NO_AUTO_DHCP=yes ifup $ethname linkup $ethname if [ ! -e /tmp/bridge.$bridgename.up ]; then ip link add name $bridgename type bridge echo 0 > /sys/devices/virtual/net/$bridgename/bridge/forward_delay > /tmp/bridge.$bridgename.up fi ip link set dev $ethname master $bridgename ifup $bridgename exit 0 done done fi # enslave this interface to bond? if [ -z "$NO_BOND_MASTER" ]; then for i in /tmp/bond.*.info; do [ -e "$i" ] || continue unset bondslaves unset bondname . "$i" for slave in $bondslaves ; do [ "$netif" != "$slave" ] && continue # already setup [ -e /tmp/bond.$bondname.up ] && exit 0 # wait for all slaves to show up for slave in $bondslaves ; do # try to create the slave (maybe vlan or bridge) NO_BOND_MASTER=yes NO_AUTO_DHCP=yes ifup $slave if ! ip link show dev $slave >/dev/null 2>&1; then # wait for the last slave to show up exit 0 fi done modprobe -q -b bonding echo "+$bondname" > /sys/class/net/bonding_masters 2>/dev/null ip link set $bondname down # Stolen from ifup-eth # add the bits to setup driver parameters here for arg in $bondoptions ; do key=${arg%%=*}; value=${arg##*=}; # %{value:0:1} is replaced with non-bash specific construct if [ "${key}" = "arp_ip_target" -a "${#value}" != "0" -a "+${value%%+*}" != "+" ]; then OLDIFS=$IFS; IFS=','; for arp_ip in $value; do echo +$arp_ip > /sys/class/net/${bondname}/bonding/$key done IFS=$OLDIFS; else echo $value > /sys/class/net/${bondname}/bonding/$key fi done linkup $bondname for slave in $bondslaves ; do cat /sys/class/net/$slave/address > /tmp/net.${bondname}.${slave}.hwaddr ip link set $slave down echo "+$slave" > /sys/class/net/$bondname/bonding/slaves linkup $slave done # Set mtu on bond master [ -n "$bondmtu" ] && ip link set mtu $bondmtu dev $bondname # add the bits to setup the needed post enslavement parameters for arg in $bondoptions ; do key=${arg%%=*}; value=${arg##*=}; if [ "${key}" = "primary" ]; then echo $value > /sys/class/net/${bondname}/bonding/$key fi done > /tmp/bond.$bondname.up NO_BOND_MASTER=yes ifup $bondname exit $? done done fi if [ -z "$NO_TEAM_MASTER" ]; then for i in /tmp/team.*.info; do [ -e "$i" ] || continue unset teammaster unset teamslaves . "$i" for slave in $teamslaves ; do [ "$netif" != "$slave" ] && continue [ -e /tmp/team.$teammaster.up ] && exit 0 # wait for all slaves to show up for slave in $teamslaves ; do # try to create the slave (maybe vlan or bridge) NO_TEAM_MASTER=yes NO_AUTO_DHCP=yes ifup $slave if ! ip link show dev $slave >/dev/null 2>&1; then # wait for the last slave to show up exit 0 fi done if [ ! -e /tmp/team.$teammaster.up ] ; then # We shall only bring up those _can_ come up # in case of some slave is gone in active-backup mode working_slaves="" for slave in $teamslaves ; do teamdctl ${teammaster} port present ${slave} 2>/dev/null \ && continue ip link set dev $slave up 2>/dev/null if wait_for_if_up $slave; then working_slaves="$working_slaves$slave " fi done # Do not add slaves now teamd -d -U -n -N -t $teammaster -f /etc/teamd/${teammaster}.conf for slave in $working_slaves; do # team requires the slaves to be down before joining team ip link set dev $slave down ( unset TEAM_PORT_CONFIG _hwaddr=$(cat /sys/class/net/$slave/address) _subchannels=$(iface_get_subchannels "$slave") if [ -n "$_hwaddr" ] && [ -e "/etc/sysconfig/network-scripts/mac-${_hwaddr}.conf" ]; then . "/etc/sysconfig/network-scripts/mac-${_hwaddr}.conf" elif [ -n "$_subchannels" ] && [ -e "/etc/sysconfig/network-scripts/ccw-${_subchannels}.conf" ]; then . "/etc/sysconfig/network-scripts/ccw-${_subchannels}.conf" elif [ -e "/etc/sysconfig/network-scripts/ifcfg-${slave}" ]; then . "/etc/sysconfig/network-scripts/ifcfg-${slave}" fi if [ -n "${TEAM_PORT_CONFIG}" ]; then /usr/bin/teamdctl ${teammaster} port config update ${slave} "${TEAM_PORT_CONFIG}" fi ) teamdctl $teammaster port add $slave done ip link set dev $teammaster up > /tmp/team.$teammaster.up NO_TEAM_MASTER=yes ifup $teammaster exit $? fi done done fi # all synthetic interfaces done.. now check if the interface is available if ! ip link show dev $netif >/dev/null 2>&1; then exit 1 fi # disable manual ifup while netroot is set for simplifying our logic # in netroot case we prefer netroot to bringup $netif automaticlly [ -n "$2" -a "$2" = "-m" ] && [ -z "$netroot" ] && manualup="$2" if [ -n "$manualup" ]; then >/tmp/net.$netif.manualup rm -f /tmp/net.${netif}.did-setup else [ -e /tmp/net.${netif}.did-setup ] && exit 0 [ -z "$DO_VLAN" ] && \ [ -e /sys/class/net/$netif/address ] && \ [ -e /tmp/net.$(cat /sys/class/net/$netif/address).did-setup ] && exit 0 fi # No ip lines default to dhcp ip=$(getarg ip) if [ -z "$NO_AUTO_DHCP" ] && [ -z "$ip" ]; then if [ "$netroot" = "dhcp6" ]; then do_dhcp -6 else do_dhcp -4 fi for s in $(getargs nameserver); do [ -n "$s" ] || continue echo nameserver $s >> /tmp/net.$netif.resolv.conf done fi # Specific configuration, spin through the kernel command line # looking for ip= lines for p in $(getargs ip=); do ip_to_var $p # skip ibft [ "$autoconf" = "ibft" ] && continue case "$dev" in ??:??:??:??:??:??) # MAC address _dev=$(iface_for_mac $dev) [ -n "$_dev" ] && dev="$_dev" ;; ??-??-??-??-??-??) # MAC address in BOOTIF form _dev=$(iface_for_mac $(fix_bootif $dev)) [ -n "$_dev" ] && dev="$_dev" ;; esac # If this option isn't directed at our interface, skip it if [ -n "$dev" ]; then if [ "$dev" != "$netif" ]; then [ ! -e "/sys/class/net/$dev" ] \ && warn "Network interface '$dev' does not exist!" continue fi else iface_is_enslaved "$netif" && continue fi # Store config for later use for i in ip srv gw mask hostname macaddr mtu dns1 dns2; do eval '[ "$'$i'" ] && echo '$i'="$'$i'"' done > /tmp/net.$netif.override for autoopt in $(str_replace "$autoconf" "," " "); do case $autoopt in dhcp|on|any) do_dhcp -4 ;; dhcp6) load_ipv6 do_dhcp -6 ;; auto6) do_ipv6auto ;; either6) do_ipv6auto || do_dhcp -6 ;; *) do_static ;; esac done ret=$? # setup nameserver for s in "$dns1" "$dns2" $(getargs nameserver); do [ -n "$s" ] || continue echo nameserver $s >> /tmp/net.$netif.resolv.conf done if [ $ret -eq 0 ]; then > /tmp/net.${netif}.up if [ -z "$DO_VLAN" ] && [ -e /sys/class/net/${netif}/address ]; then > /tmp/net.$(cat /sys/class/net/${netif}/address).up fi # and finally, finish interface set up if there isn't already a script # to do so (which is the case in the dhcp path) if [ ! -e $hookdir/initqueue/setup_net_$netif.sh ]; then setup_net $netif source_hook initqueue/online $netif if [ -z "$manualup" ]; then /sbin/netroot $netif fi fi exit $ret fi done # no ip option directed at our interface? if [ -z "$NO_AUTO_DHCP" ] && [ ! -e /tmp/net.${netif}.up ]; then if [ -e /tmp/net.bootdev ]; then BOOTDEV=$(cat /tmp/net.bootdev) if [ "$netif" = "$BOOTDEV" ] || [ "$BOOTDEV" = "$(cat /sys/class/net/${netif}/address)" ]; then load_ipv6 do_dhcp fi else if getargs 'ip=dhcp6'; then load_ipv6 do_dhcp -6 fi if getargs 'ip=dhcp'; then do_dhcp -4 fi fi fi exit 0 modules.d/35network-legacy/kill-dhclient.sh000075500000000374151701010110014612 0ustar00#!/bin/sh for f in /tmp/dhclient.*.pid; do [ -e $f ] || continue read PID < $f; kill $PID >/dev/null 2>&1 done sleep 0.1 for f in /tmp/dhclient.*.pid; do [ -e $f ] || continue read PID < $f; kill -9 $PID >/dev/null 2>&1 done modules.d/35network-legacy/module-setup.sh000075500000005500151701010110014506 0ustar00#!/bin/bash # called by dracut check() { local _program require_binaries ip dhclient sed awk grep || return 1 require_any_binary arping arping2 || return 1 return 255 } # called by dracut depends() { return 0 } # called by dracut installkernel() { return 0 } # called by dracut install() { local _arch _i _dir inst_multiple ip dhclient sed awk grep inst_multiple -o arping arping2 strstr "$(arping 2>&1)" "ARPing 2" && mv "$initdir/bin/arping" "$initdir/bin/arping2" inst_multiple -o ping ping6 inst_multiple -o teamd teamdctl teamnl inst_simple /etc/libnl/classid inst_script "$moddir/ifup.sh" "/sbin/ifup" inst_script "$moddir/dhclient-script.sh" "/sbin/dhclient-script" inst_simple -H "/etc/dhclient.conf" cat "$moddir/dhclient.conf" >> "${initdir}/etc/dhclient.conf" inst_hook pre-udev 60 "$moddir/net-genrules.sh" inst_hook cmdline 92 "$moddir/parse-ibft.sh" inst_hook cmdline 95 "$moddir/parse-vlan.sh" inst_hook cmdline 96 "$moddir/parse-bond.sh" inst_hook cmdline 96 "$moddir/parse-team.sh" inst_hook cmdline 97 "$moddir/parse-bridge.sh" inst_hook cmdline 98 "$moddir/parse-ip-opts.sh" inst_hook cmdline 99 "$moddir/parse-ifname.sh" inst_hook cleanup 10 "$moddir/kill-dhclient.sh" # install all config files for teaming unset TEAM_MASTER unset TEAM_CONFIG unset TEAM_PORT_CONFIG unset HWADDR unset SUBCHANNELS for i in /etc/sysconfig/network-scripts/ifcfg-*; do [ -e "$i" ] || continue case "$i" in *~ | *.bak | *.orig | *.rpmnew | *.rpmorig | *.rpmsave) continue ;; esac ( . "$i" if ! [ "${ONBOOT}" = "no" -o "${ONBOOT}" = "NO" ] \ && [ -n "${TEAM_MASTER}${TEAM_CONFIG}${TEAM_PORT_CONFIG}" ]; then if [ -n "$TEAM_CONFIG" ] && [ -n "$DEVICE" ]; then mkdir -p $initdir/etc/teamd printf -- "%s" "$TEAM_CONFIG" > "$initdir/etc/teamd/${DEVICE}.conf" elif [ -n "$TEAM_PORT_CONFIG" ]; then inst_simple "$i" HWADDR="$(echo $HWADDR | sed 'y/ABCDEF/abcdef/')" if [ -n "$HWADDR" ]; then ln_r "$i" "/etc/sysconfig/network-scripts/mac-${HWADDR}.conf" fi SUBCHANNELS="$(echo $SUBCHANNELS | sed 'y/ABCDEF/abcdef/')" if [ -n "$SUBCHANNELS" ]; then ln_r "$i" "/etc/sysconfig/network-scripts/ccw-${SUBCHANNELS}.conf" fi fi fi ) done _arch=$(uname -m) inst_libdir_file {"tls/$_arch/",tls/,"$_arch/",}"libnss_dns.so.*" \ {"tls/$_arch/",tls/,"$_arch/",}"libnss_mdns4_minimal.so.*" dracut_need_initqueue } modules.d/35network-legacy/net-genrules.sh000075500000010015151701010110014470 0ustar00#!/bin/sh getargbool 0 rd.neednet && NEEDNET=1 # Don't continue if we don't need network if [ -z "$netroot" ] && [ ! -e "/tmp/net.ifaces" ] && [ "$NEEDNET" != "1" ]; then return fi command -v fix_bootif >/dev/null || . /lib/net-lib.sh # Write udev rules { # bridge: attempt only the defined interface for i in /tmp/bridge.*.info; do [ -e "$i" ] || continue unset bridgeslaves unset bridgename . "$i" RAW_IFACES="$RAW_IFACES $bridgeslaves" MASTER_IFACES="$MASTER_IFACES $bridgename" done # bond: attempt only the defined interface (override bridge defines) for i in /tmp/bond.*.info; do [ -e "$i" ] || continue unset bondslaves unset bondname . "$i" # It is enough to fire up only one RAW_IFACES="$RAW_IFACES $bondslaves" MASTER_IFACES="$MASTER_IFACES ${bondname}" done for i in /tmp/team.*.info; do [ -e "$i" ] || continue unset teamslaves unset teammaster . "$i" RAW_IFACES="$RAW_IFACES ${teamslaves}" MASTER_IFACES="$MASTER_IFACES ${teammaster}" done for i in /tmp/vlan.*.phy; do [ -e "$i" ] || continue unset phydevice . "$i" RAW_IFACES="$RAW_IFACES $phydevice" for j in /tmp/vlan.*.${phydevice}; do [ -e "$j" ] || continue unset vlanname . "$j" MASTER_IFACES="$MASTER_IFACES ${vlanname}" done done MASTER_IFACES="$(trim "$MASTER_IFACES")" RAW_IFACES="$(trim "$RAW_IFACES")" if [ -z "$IFACES" ]; then [ -e /tmp/net.ifaces ] && read IFACES < /tmp/net.ifaces fi if [ -e /tmp/net.bootdev ]; then bootdev=$(cat /tmp/net.bootdev) fi ifup='/sbin/ifup $env{INTERFACE}' runcmd="RUN+=\"/sbin/initqueue --name ifup-\$env{INTERFACE} --unique --onetime $ifup\"" # We have some specific interfaces to handle if [ -n "${RAW_IFACES}${IFACES}" ]; then echo 'SUBSYSTEM!="net", GOTO="net_end"' echo 'ACTION!="add|change|move", GOTO="net_end"' for iface in $IFACES $RAW_IFACES; do case "$iface" in ??:??:??:??:??:??) # MAC address cond="ATTR{address}==\"$iface\"" echo "$cond, $runcmd, GOTO=\"net_end\"" ;; ??-??-??-??-??-??) # MAC address in BOOTIF form cond="ATTR{address}==\"$(fix_bootif $iface)\"" echo "$cond, $runcmd, GOTO=\"net_end\"" ;; *) # an interface name cond="ENV{INTERFACE}==\"$iface\"" echo "$cond, $runcmd, GOTO=\"net_end\"" cond="NAME==\"$iface\"" echo "$cond, $runcmd, GOTO=\"net_end\"" ;; esac # The GOTO prevents us from trying to ifup the same device twice done echo 'LABEL="net_end"' 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 fi done # Default: We don't know the interface to use, handle all # Fixme: waiting for the interface as well. else cond='ACTION=="add", SUBSYSTEM=="net", ENV{DEVTYPE}!="wlan|wwan"' # if you change the name of "91-default-net.rules", also change modules.d/80cms/cmssetup.sh echo "$cond, $runcmd" > /etc/udev/rules.d/91-default-net.rules if [ "$NEEDNET" = "1" ]; then echo 'for i in /tmp/net.*.did-setup; do [ -f "$i" ] && exit 0; done; exit 1' >$hookdir/initqueue/finished/wait-network.sh fi fi # if you change the name of "90-net.rules", also change modules.d/80cms/cmssetup.sh } > /etc/udev/rules.d/90-net.rules modules.d/35network-legacy/parse-bond.sh000075500000003727151701010110014126 0ustar00#!/bin/sh # # Format: # bond=<bondname>[:<bondslaves>[:<options>[:<mtu>]]] # # bondslaves is a comma-separated list of physical (ethernet) interfaces # options is a comma-separated list on bonding options (modinfo bonding for details) in format compatible with initscripts # if options include multi-valued arp_ip_target option, then its values should be separated by semicolon. # # bond without parameters assumes bond=bond0:eth0,eth1:mode=balance-rr # # if the mtu is specified, it will be set on the bond master # # We translate list of slaves to space-separated here to make it easier to loop over them in ifup # Ditto for bonding options parsebond() { local v=${1}: set -- while [ -n "$v" ]; do set -- "$@" "${v%%:*}" v=${v#*:} done case $# in 0) bondname=bond0; bondslaves="eth0 eth1" ;; 1) bondname=$1; bondslaves="eth0 eth1" ;; 2) bondname=$1; bondslaves=$(str_replace "$2" "," " ") ;; 3) bondname=$1; bondslaves=$(str_replace "$2" "," " "); bondoptions=$(str_replace "$3" "," " ") ;; 4) bondname=$1; bondslaves=$(str_replace "$2" "," " "); bondoptions=$(str_replace "$3" "," " "); bondmtu=$4;; *) die "bond= requires zero to four parameters" ;; esac } # Parse bond for bondname, bondslaves, bondmode, bondoptions and bondmtu for bond in $(getargs bond=); do unset bondname unset bondslaves unset bondoptions unset bondmtu if [ "$bond" != "bond" ]; then parsebond "$bond" fi # Simple default bond if [ -z "$bondname" ]; then bondname=bond0 bondslaves="eth0 eth1" fi # Make it suitable for initscripts export bondoptions=$(str_replace "$bondoptions" ";" ",") echo "bondname=$bondname" > /tmp/bond.${bondname}.info echo "bondslaves=\"$bondslaves\"" >> /tmp/bond.${bondname}.info echo "bondoptions=\"$bondoptions\"" >> /tmp/bond.${bondname}.info echo "bondmtu=\"$bondmtu\"" >> /tmp/bond.${bondname}.info done modules.d/35network-legacy/parse-bridge.sh000075500000002144151701010110014430 0ustar00#!/bin/sh # # Format: # bridge=<bridgename>:<bridgeslaves> # # <bridgeslaves> is a comma-separated list of physical (ethernet) interfaces # bridge without parameters assumes bridge=br0:eth0 # parsebridge() { local v=${1}: set -- while [ -n "$v" ]; do set -- "$@" "${v%%:*}" v=${v#*:} done case $# in 0) bridgename=br0; bridgeslaves=$iface ;; 1) die "bridge= requires two parameters" ;; 2) bridgename=$1; bridgeslaves=$(str_replace "$2" "," " ") ;; *) die "bridge= requires two parameters" ;; esac } # Parse bridge for bridgename and bridgeslaves for bridge in $(getargs bridge=); do unset bridgename unset bridgeslaves iface=eth0 # Read bridge= parameters if they exist if [ "$bridge" != "bridge" ]; then parsebridge $bridge fi # Simple default bridge if [ -z "$bridgename" ]; then bridgename=br0 bridgeslaves=$iface fi echo "bridgename=$bridgename" > /tmp/bridge.${bridgename}.info echo "bridgeslaves=\"$bridgeslaves\"" >> /tmp/bridge.${bridgename}.info done modules.d/35network-legacy/parse-ibft.sh000075500000000433151701010110014117 0ustar00#!/bin/sh command -v getarg >/dev/null || . /lib/dracut-lib.sh command -v ibft_to_cmdline >/dev/null || . /lib/net-lib.sh if getargbool 0 rd.iscsi.ibft -d "ip=ibft"; then modprobe -b -q iscsi_boot_sysfs 2>/dev/null modprobe -b -q iscsi_ibft ibft_to_cmdline fi modules.d/35network-legacy/parse-ifname.sh000075500000001050151701010110014426 0ustar00#!/bin/sh # # Format: # ifname=<interface>:<mac> # # Note letters in the macaddress must be lowercase! # # Examples: # ifname=eth0:4a:3f:4c:04:f8:d7 # # Note when using ifname= to get persistent interface names, you must specify # an ifname= argument for each interface used in an ip= or fcoe= argument # check if there are any ifname parameters if ! getarg ifname= >/dev/null ; then return fi command -v parse_ifname_opts >/dev/null || . /lib/net-lib.sh # Check ifname= lines for p in $(getargs ifname=); do parse_ifname_opts $p done modules.d/35network-legacy/parse-ip-opts.sh000075500000011526151701010110014573 0ustar00#!/bin/sh # # Format: # ip=[dhcp|on|any] # # ip=<interface>:[dhcp|on|any][:[<mtu>][:<macaddr>]] # # ip=<client-IP-number>:<server-IP-number>:<gateway-IP-number>:<netmask>:<client-hostname>:<interface>:{dhcp|on|any|none|off}[:[<mtu>][:<macaddr>]] # # When supplying more than only ip= line, <interface> is mandatory and # bootdev= must contain the name of the primary interface to use for # routing,dns,dhcp-options,etc. # command -v getarg >/dev/null || . /lib/dracut-lib.sh if [ -n "$netroot" ] && [ -z "$(getarg ip=)" ] && [ -z "$(getarg BOOTIF=)" ]; then # No ip= argument(s) for netroot provided, defaulting to DHCP return; fi # Count ip= lines to decide whether we need bootdev= or not if [ -z "$NEEDBOOTDEV" ] ; then count=0 for p in $(getargs ip=); do case "$p" in ibft) continue;; esac count=$(( $count + 1 )) done [ $count -gt 1 ] && NEEDBOOTDEV=1 fi unset count # If needed, check if bootdev= contains anything usable BOOTDEV=$(getarg bootdev=) if [ -n "$NEEDBOOTDEV" ] && getargbool 1 rd.neednet; then #[ -z "$BOOTDEV" ] && warn "Please supply bootdev argument for multiple ip= lines" echo "rd.neednet=1" > /etc/cmdline.d/dracut-neednet.conf info "Multiple ip= arguments: assuming rd.neednet=1" else unset NEEDBOOTDEV fi # Check ip= lines # XXX Would be nice if we could errorcheck ip addresses here as well for p in $(getargs ip=); do ip_to_var $p # make first device specified the BOOTDEV if [ -n "$NEEDBOOTDEV" ] && [ -z "$BOOTDEV" ] && [ -n "$dev" ]; then BOOTDEV="$dev" info "Setting bootdev to '$BOOTDEV'" fi # skip ibft since we did it above [ "$autoconf" = "ibft" ] && continue # Empty autoconf defaults to 'dhcp' if [ -z "$autoconf" ] ; then warn "Empty autoconf values default to dhcp" autoconf="dhcp" fi # Error checking for autoconf in combination with other values for autoopt in $(str_replace "$autoconf" "," " "); do case $autoopt in error) die "Error parsing option 'ip=$p'";; bootp|rarp|both) die "Sorry, ip=$autoopt is currenty unsupported";; none|off) [ -z "$ip" ] && \ die "For argument 'ip=$p'\nValue '$autoopt' without static configuration does not make sense" [ -z "$mask" ] && \ die "Sorry, automatic calculation of netmask is not yet supported" ;; auto6);; either6);; dhcp|dhcp6|on|any) \ [ -n "$NEEDBOOTDEV" ] && [ -z "$dev" ] && \ die "Sorry, 'ip=$p' does not make sense for multiple interface configurations" [ -n "$ip" ] && \ die "For argument 'ip=$p'\nSorry, setting client-ip does not make sense for '$autoopt'" ;; *) die "For argument 'ip=$p'\nSorry, unknown value '$autoopt'";; esac done if [ -n "$dev" ] ; then # We don't like duplicate device configs if [ -n "$IFACES" ] ; then for i in $IFACES ; do [ "$dev" = "$i" ] && die "For argument 'ip=$p'\nDuplication configurations for '$dev'" done fi # IFACES list for later use IFACES="$IFACES $dev" # Interface should exist if [ ! -e "/sys/class/net/$dev" ]; then warn "Network interface '$dev' does not exist" fi fi # Do we need to check for specific options? if [ -n "$NEEDDHCP" ] || [ -n "$DHCPORSERVER" ] ; then # Correct device? (Empty is ok as well) [ "$dev" = "$BOOTDEV" ] || continue # Server-ip is there? [ -n "$DHCPORSERVER" ] && [ -n "$srv" ] && continue # dhcp? (It's simpler to check for a set ip. Checks above ensure that if # ip is there, we're static [ -z "$ip" ] && continue # Not good! die "Server-ip or dhcp for netboot needed, but current arguments say otherwise" fi if str_starts "$dev" "enx" && [ ${#dev} -eq 15 ]; then printf -- "ifname=%s:%s:%s:%s:%s:%s:%s\n" \ "$dev" \ "${dev:3:2}" \ "${dev:5:2}" \ "${dev:7:2}" \ "${dev:9:2}" \ "${dev:11:2}" \ "${dev:13:2}" >> /etc/cmdline.d/80-enx.conf fi done # put BOOTIF in IFACES to make sure it comes up if getargbool 1 "rd.bootif" && BOOTIF="$(getarg BOOTIF=)"; then BOOTDEV=$(fix_bootif $BOOTIF) IFACES="$BOOTDEV $IFACES" fi # This ensures that BOOTDEV is always first in IFACES if [ -n "$BOOTDEV" ] && [ -n "$IFACES" ] ; then IFACES="${IFACES%$BOOTDEV*} ${IFACES#*$BOOTDEV}" IFACES="$BOOTDEV $IFACES" fi # Store BOOTDEV and IFACES for later use [ -n "$BOOTDEV" ] && echo $BOOTDEV > /tmp/net.bootdev [ -n "$IFACES" ] && echo $IFACES > /tmp/net.ifaces modules.d/35network-legacy/parse-team.sh000075500000003100151701010110014113 0ustar00#!/bin/sh # # Format: # team=<teammaster>:<teamslaves>[:<teamrunner>] # # teamslaves is a comma-separated list of physical (ethernet) interfaces # teamrunner is the runner type to be used (see teamd.conf(5)); defaults to activebackup # # team without parameters assumes team=team0:eth0,eth1:activebackup # parseteam() { local v=${1}: set -- while [ -n "$v" ]; do set -- "$@" "${v%%:*}" v=${v#*:} done case $# in 0) teammaster=team0; teamslaves="eth0 eth1"; teamrunner="activebackup" ;; 1) teammaster=$1; teamslaves="eth0 eth1"; teamrunner="activebackup" ;; 2) teammaster=$1; teamslaves=$(str_replace "$2" "," " "); teamrunner="activebackup" ;; 3) teammaster=$1; teamslaves=$(str_replace "$2" "," " "); teamrunner=$3 ;; *) die "team= requires zero to three parameters" ;; esac return 0 } for team in $(getargs team); do [ "$team" = "team" ] && continue unset teammaster unset teamslaves unset teamrunner parseteam "$team" || continue echo "teammaster=$teammaster" > /tmp/team.${teammaster}.info echo "teamslaves=\"$teamslaves\"" >> /tmp/team.${teammaster}.info echo "teamrunner=\"$teamrunner\"" >> /tmp/team.${teammaster}.info if ! [ -e /etc/teamd/${teammaster}.conf ]; then warn "Team master $teammaster specified, but no /etc/teamd/$teammaster.conf present. Using $teamrunner." mkdir -p /etc/teamd printf -- "%s" "{\"runner\": {\"name\": \"$teamrunner\"}, \"link_watch\": {\"name\": \"ethtool\"}}" > "/tmp/${teammaster}.conf" fi done modules.d/35network-legacy/parse-vlan.sh000075500000001226151701010110014134 0ustar00#!/bin/sh # # Format: # vlan=<vlanname>:<phydevice> # parsevlan() { local v=${1}: set -- while [ -n "$v" ]; do set -- "$@" "${v%%:*}" v=${v#*:} done unset vlanname phydevice case $# in 2) vlanname=$1; phydevice=$2 ;; *) die "vlan= requires two parameters" ;; esac } for vlan in $(getargs vlan=); do unset vlanname unset phydevice if [ ! "$vlan" = "vlan" ]; then parsevlan "$vlan" fi echo "phydevice=\"$phydevice\"" > /tmp/vlan.${phydevice}.phy { echo "vlanname=\"$vlanname\"" echo "phydevice=\"$phydevice\"" } > /tmp/vlan.${vlanname}.${phydevice} done modules.d/35network-manager/module-setup.sh000075500000003065151701010110014660 0ustar00#!/bin/bash # called by dracut check() { local _program require_binaries sed grep || return 1 # do not add this module by default return 255 } # called by dracut depends() { return 0 } # called by dracut installkernel() { return 0 } # called by dracut install() { local _nm_version _nm_version=$(NetworkManager --version) # We don't need `ip` but having it is *really* useful for people debugging # in an emergency shell. inst_multiple ip sed grep inst NetworkManager inst /usr/libexec/nm-initrd-generator inst_multiple -o teamd dhclient inst_hook cmdline 99 "$moddir/nm-config.sh" inst_hook initqueue/settled 99 "$moddir/nm-run.sh" inst_rules 85-nm-unmanaged.rules inst_libdir_file "NetworkManager/$_nm_version/libnm-device-plugin-team.so" inst_simple "$moddir/nm-lib.sh" "/lib/nm-lib.sh" if [[ -x "$initdir/usr/sbin/dhclient" ]]; then inst /usr/libexec/nm-dhcp-helper elif ! [[ -e "$initdir/etc/machine-id" ]]; then # The internal DHCP client silently fails if we # have no machine-id systemd-machine-id-setup --root="$initdir" fi # We don't install the ifcfg files from the host automatically. # But the user might choose to include them, so we pull in the machinery to read them. inst_libdir_file "NetworkManager/$_nm_version/libnm-settings-plugin-ifcfg-rh.so" _arch=${DRACUT_ARCH:-$(uname -m)} inst_libdir_file {"tls/$_arch/",tls/,"$_arch/",}"libnss_dns.so.*" \ {"tls/$_arch/",tls/,"$_arch/",}"libnss_mdns4_minimal.so.*" } modules.d/35network-manager/nm-config.sh000075500000000324151701010110014105 0ustar00#!/bin/sh type nm_generate_connections >/dev/null 2>&1 || . /lib/nm-lib.sh if [ -n "$netroot" ] || [ -e /tmp/net.ifaces ]; then echo rd.neednet >> /etc/cmdline.d/35-neednet.conf fi nm_generate_connections modules.d/35network-manager/nm-lib.sh000064400000001173151701010110013406 0ustar00#!/bin/bash type getcmdline >/dev/null 2>&1 || . /lib/dracut-lib.sh nm_generate_connections() { rm -f /run/NetworkManager/system-connections/* /usr/libexec/nm-initrd-generator -- $(getcmdline) if getargbool 0 rd.neednet; then for i in /usr/lib/NetworkManager/system-connections/* \ /run/NetworkManager/system-connections/* \ /etc/NetworkManager/system-connections/* \ /etc/sysconfig/network-scripts/ifcfg-*; do [ -f "$i" ] || continue echo '[ -f /tmp/nm.done ]' >$hookdir/initqueue/finished/nm.sh break done fi } modules.d/35network-manager/nm-run.sh000075500000002005151701010110013442 0ustar00#!/bin/sh for i in /usr/lib/NetworkManager/system-connections/* \ /run/NetworkManager/system-connections/* \ /etc/NetworkManager/system-connections/* \ /etc/sysconfig/network-scripts/ifcfg-*; do [ -f "$i" ] || continue if getargbool 0 rd.debug -d -y rdinitdebug -d -y rdnetdebug; then /usr/sbin/NetworkManager --configure-and-quit=initrd --debug --log-level=trace else /usr/sbin/NetworkManager --configure-and-quit=initrd --no-daemon fi if [ -s /run/NetworkManager/initrd/hostname ]; then cat /run/NetworkManager/initrd/hostname > /proc/sys/kernel/hostname fi break done for _i in /sys/class/net/* do state=/run/NetworkManager/devices/$(cat $_i/ifindex) grep -q connection-uuid= $state 2>/dev/null || continue ifname=${_i##*/} sed -n 's/root-path/new_root_path/p;s/next-server/new_next_server/p;s/dhcp-bootfile/filename/p' <$state >/tmp/dhclient.$ifname.dhcpopts source_hook initqueue/online $ifname /sbin/netroot $ifname done > /tmp/nm.done modules.d/40network/dhcp-root.sh000075500000001460151701010110012515 0ustar00#!/bin/sh # This script is sourced, so root should be set. But let's be paranoid [ -z "$root" ] && root=$(getarg root=) if [ -z "$netroot" ]; then for netroot in $(getargs netroot=); do [ "$netroot" = "dhcp" ] && break [ "$netroot" = "dhcp6" ] && break done [ "$netroot" = "dhcp" ] || [ "$netroot" = "dhcp6" ] || unset netroot fi if [ "$root" = "dhcp" ] || [ "$root" = "dhcp6" ] || [ "$netroot" = "dhcp" ] || [ "$netroot" = "dhcp6" ]; then # Tell ip= checker that we need dhcp NEEDDHCP="1" # Done, all good! rootok=1 if [ "$netroot" != "dhcp" ] && [ "$netroot" != "dhcp6" ]; then netroot=$root fi # Shut up init error check [ -z "$root" ] && root="dhcp" echo '[ -d $NEWROOT/proc -o -e /dev/root ]' > $hookdir/initqueue/finished/dhcp.sh fi modules.d/40network/ifname-genrules.sh000075500000002137151701010110013701 0ustar00#!/bin/sh # if there are no ifname parameters, just use NAME=KERNEL if ! getarg ifname= >/dev/null ; then return fi command -v parse_ifname_opts >/dev/null || . /lib/net-lib.sh { for p in $(getargs ifname=); do parse_ifname_opts $p if [ -f /tmp/ifname-$ifname_mac ]; then read oldif < /tmp/ifname-$ifname_mac fi if [ -f /tmp/ifname-$ifname_if ]; then read oldmac < /tmp/ifname-$ifname_if fi if [ -n "$oldif" -a -n "$oldmac" -a "$oldif" = "$ifname_if" -a "$oldmac" = "$ifname_mac" ]; then # skip same ifname= declaration continue fi [ -n "$oldif" ] && warn "Multiple interface names specified for MAC $ifname_mac: $oldif" [ -n "$oldmac" ] && warn "Multiple MAC specified for $ifname_if: $oldmac" printf 'SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="%s", ATTR{type}=="1", NAME="%s"\n' "$ifname_mac" "$ifname_if" echo $ifname_if > /tmp/ifname-$ifname_mac echo $ifname_mac > /tmp/ifname-$ifname_if done } >> /etc/udev/rules.d/80-ifname.rules modules.d/40network/module-setup.sh000075500000001240151701010110013235 0ustar00#!/bin/bash # called by dracut check() { return 255 } # called by dracut depends() { echo -n "kernel-network-modules " if ! dracut_module_included "network-legacy" && [ -x "/usr/libexec/nm-initrd-generator" ] ; then echo "network-manager" else echo "network-legacy" fi return 0 } # called by dracut installkernel() { return 0 } # called by dracut install() { local _arch _i _dir inst_script "$moddir/netroot.sh" "/sbin/netroot" inst_simple "$moddir/net-lib.sh" "/lib/net-lib.sh" inst_hook pre-udev 50 "$moddir/ifname-genrules.sh" inst_hook cmdline 91 "$moddir/dhcp-root.sh" dracut_need_initqueue } modules.d/40network/net-lib.sh000075500000062135151701010110012156 0ustar00#!/bin/sh is_ip() { echo "$1" | { IFS=. read a b c d test "$a" -ge 0 -a "$a" -le 255 \ -a "$b" -ge 0 -a "$b" -le 255 \ -a "$c" -ge 0 -a "$c" -le 255 \ -a "$d" -ge 0 -a "$d" -le 255 \ 2> /dev/null } && return 0 return 1 } get_ip() { local iface="$1" ip="" ip=$(ip -o -f inet addr show $iface) ip=${ip%%/*} ip=${ip##* } echo $ip } iface_for_remote_addr() { set -- $(ip -o route get to $1) echo $5 } iface_for_ip() { set -- $(ip -o addr show to $1) echo $2 } iface_for_mac() { local interface="" mac="$(echo $1 | sed 'y/ABCDEF/abcdef/')" for interface in /sys/class/net/*; do if [ $(cat $interface/address) = "$mac" ]; then echo ${interface##*/} fi done } # get the iface name for the given identifier - either a MAC, IP, or iface name iface_name() { case $1 in ??:??:??:??:??:??|??-??-??-??-??-??) iface_for_mac $1 ;; *:*:*|*.*.*.*) iface_for_ip $1 ;; *) echo $1 ;; esac } # list the configured interfaces configured_ifaces() { local IFACES="" iface_id="" rv=1 [ -e "/tmp/net.ifaces" ] && read IFACES < /tmp/net.ifaces if { pidof udevd || pidof systemd-udevd; } > /dev/null; then for iface_id in $IFACES; do echo $(iface_name $iface_id) rv=0 done else warn "configured_ifaces called before udev is running" echo $IFACES [ -n "$IFACES" ] && rv=0 fi return $rv } all_ifaces_up() { local iface="" IFACES="" [ -e "/tmp/net.ifaces" ] && read IFACES < /tmp/net.ifaces for iface in $IFACES; do [ -e /tmp/net.$iface.up ] || return 1 done } all_ifaces_setup() { local iface="" IFACES="" [ -e "/tmp/net.ifaces" ] && read IFACES < /tmp/net.ifaces for iface in $IFACES; do [ -e /tmp/net.$iface.did-setup ] || return 1 done } get_netroot_ip() { local prefix="" server="" rest="" splitsep "$1" ":" prefix server rest case $server in [0-9]*\.[0-9]*\.[0-9]*\.[0-9]*) echo "$server"; return 0 ;; esac return 1 } ip_is_local() { strstr "$(ip route get $1 2>/dev/null)" " via " } ifdown() { local netif="$1" # ip down/flush ensures that routing info goes away as well ip link set $netif down ip addr flush dev $netif echo "#empty" > /etc/resolv.conf rm -f -- /tmp/net.$netif.did-setup [ -z "$DO_VLAN" ] && \ [ -e /sys/class/net/$netif/address ] && \ rm -f -- /tmp/net.$(cat /sys/class/net/$netif/address).did-setup # TODO: send "offline" uevent? } setup_net() { local netif="$1" f="" gw_ip="" netroot_ip="" iface="" IFACES="" local _p [ -e /tmp/net.$netif.did-setup ] && return [ -z "$DO_VLAN" ] && \ [ -e /sys/class/net/$netif/address ] && \ [ -e /tmp/net.$(cat /sys/class/net/$netif/address).did-setup ] && return [ -e "/tmp/net.ifaces" ] && read IFACES < /tmp/net.ifaces [ -z "$IFACES" ] && IFACES="$netif" # run the scripts written by ifup [ -e /tmp/net.$netif.hostname ] && . /tmp/net.$netif.hostname [ -e /tmp/net.$netif.override ] && . /tmp/net.$netif.override [ -e /tmp/dhclient.$netif.dhcpopts ] && . /tmp/dhclient.$netif.dhcpopts # set up resolv.conf [ -e /tmp/net.$netif.resolv.conf ] && \ awk '!array[$0]++' /tmp/net.$netif.resolv.conf > /etc/resolv.conf [ -e /tmp/net.$netif.gw ] && . /tmp/net.$netif.gw # add static route for _p in $(getargs rd.route); do route_to_var "$_p" || continue [ -n "$route_dev" ] && [ "$route_dev" != "$netif" ] && continue ip route add "$route_mask" ${route_gw:+via "$route_gw"} ${route_dev:+dev "$route_dev"} if strstr "$route_mask" ":"; then printf -- "%s\n" "$route_mask ${route_gw:+via $route_gw} ${route_dev:+dev $route_dev}" \ > /tmp/net.route6."$netif" else printf -- "%s\n" "$route_mask ${route_gw:+via $route_gw} ${route_dev:+dev $route_dev}" \ > /tmp/net.route."$netif" fi done # If a static route was necessary to reach the gateway, the # first gateway setup call will have failed with # RTNETLINK answers: Network is unreachable # Replace the default route again after static routes to cover # this scenario. [ -e /tmp/net.$netif.gw ] && . /tmp/net.$netif.gw # Handle STP Timeout: arping the default gateway. # (or the root server, if a) it's local or b) there's no gateway.) # Note: This assumes that if no router is present the # root server is on the same subnet. # Get DHCP-provided router IP, or the cmdline-provided "gw=" argument [ -n "$new_routers" ] && gw_ip=${new_routers%%,*} [ -n "$gw" ] && gw_ip=$gw # Get the "netroot" IP (if there's an IP address in there) netroot_ip=$(get_netroot_ip $netroot) # try netroot if it's local (or there's no gateway) if ip_is_local $netroot_ip || [ -z "$gw_ip" ]; then dest="$netroot_ip" else dest="$gw_ip" fi unset layer2 if [ -f /sys/class/net/$netif/device/layer2 ]; then read layer2 < /sys/class/net/$netif/device/layer2 fi if [ "$layer2" != "0" ] && [ -n "$dest" ] && ! strstr "$dest" ":"; then if command -v arping2 >/dev/null; then arping2 -q -C 1 -c 60 -I $netif $dest || info "Resolving $dest via ARP on $netif failed" else arping -q -f -w 60 -I $netif $dest || info "Resolving $dest via ARP on $netif failed" fi fi unset layer2 > /tmp/net.$netif.did-setup [ -z "$DO_VLAN" ] && \ [ -e /sys/class/net/$netif/address ] && \ > /tmp/net.$(cat /sys/class/net/$netif/address).did-setup } save_netinfo() { local netif="$1" IFACES="" f="" i="" [ -e /tmp/net.ifaces ] && read IFACES < /tmp/net.ifaces # Add $netif to the front of IFACES (if it's not there already). set -- "$netif" for i in $IFACES; do [ "$i" != "$netif" ] && set -- "$@" "$i"; done IFACES="$*" for i in $IFACES; do for f in /tmp/dhclient.$i.*; do [ -f $f ] && cp -f $f /tmp/net.${f#/tmp/dhclient.} done done echo $IFACES > /tmp/.net.ifaces.new mv /tmp/.net.ifaces.new /tmp/net.ifaces } set_ifname() { local name="$1" mac="$2" num=-1 n="" # if it's already set, return the existing name for n in $(getargs ifname=); do strstr "$n" "$mac" && echo ${n%%:*} && return done # otherwise, pick a new name and use that while :; do num=$(($num+1)); [ -e /sys/class/net/$name$num ] && continue for n in $(getargs ifname=); do [ "$name$num" = "${n%%:*}" ] && continue 2 done break done echo "ifname=$name$num:$mac" >> /etc/cmdline.d/45-ifname.conf echo "$name$num" } # pxelinux provides macaddr '-' separated, but we need ':' fix_bootif() { local macaddr=${1} local IFS='-' macaddr=$(printf '%s:' ${macaddr}) macaddr=${macaddr%:} # strip hardware type field from pxelinux [ -n "${macaddr%??:??:??:??:??:??}" ] && macaddr=${macaddr#??:} # return macaddr with lowercase alpha characters expected by udev echo $macaddr | sed 'y/ABCDEF/abcdef/' } ibft_to_cmdline() { local iface="" modprobe -q iscsi_ibft ( for iface in /sys/firmware/ibft/ethernet*; do local mac="" dev="" local dhcp="" ip="" gw="" mask="" hostname="" local dns1 dns2 [ -e ${iface}/mac ] || continue mac=$(read a < ${iface}/mac; echo $a) [ -z "$mac" ] && continue dev=$(set_ifname ibft $mac) [ -e /tmp/net.${dev}.has_ibft_config ] && continue [ -e ${iface}/flags ] && flags=$(read a < ${iface}/flags; echo $a) # Skip invalid interfaces (( $flags & 1 )) || continue # Skip interfaces not used for booting unless using multipath if ! getargbool 0 rd.iscsi.mp ; then (( $flags & 2 )) || continue fi [ -e ${iface}/dhcp ] && dhcp=$(read a < ${iface}/dhcp; echo $a) [ -e ${iface}/origin ] && origin=$(read a < ${iface}/origin; echo $a) [ -e ${iface}/ip-addr ] && ip=$(read a < ${iface}/ip-addr; echo $a) if [ -n "$ip" ] ; then case "$ip" in *.*.*.*) family=ipv4 ;; *:*) family=ipv6 ;; esac fi if [ -n "$dhcp" ] || [ "$origin" -eq 3 ]; then if [ "$family" = "ipv6" ] ; then echo "ip=$dev:dhcp6" else echo "ip=$dev:dhcp" fi elif [ -e ${iface}/ip-addr ]; then # skip not assigned ip adresses [ "$ip" = "0.0.0.0" ] && continue [ -e ${iface}/gateway ] && gw=$(read a < ${iface}/gateway; echo $a) [ "$gateway" = "0.0.0.0" ] && unset $gateway [ -e ${iface}/subnet-mask ] && mask=$(read a < ${iface}/subnet-mask; echo $a) [ -e ${iface}/prefix-len ] && prefix=$(read a < ${iface}/prefix-len; echo $a) [ -e ${iface}/primary-dns ] && dns1=$(read a < ${iface}/primary-dns; echo $a) [ "$dns1" = "0.0.0.0" ] && unset $dns1 [ -e ${iface}/secondary-dns ] && dns2=$(read a < ${iface}/secondary-dns; echo $a) [ "$dns2" = "0.0.0.0" ] && unset $dns2 [ -e ${iface}/hostname ] && hostname=$(read a < ${iface}/hostname; echo $a) if [ "$family" = "ipv6" ] ; then if [ -n "$ip" ] ; then ip="[$ip]" [ -n "$prefix" ] || prefix=64 ip="[${ip}/${prefix}]" mask= fi if [ -n "$gw" ] ; then gw="[${gw}]" fi fi if [ -n "$ip" ] && [ -n "$mask" -o -n "$prefix" ]; then echo "ip=$ip::$gw:$mask:$hostname:$dev:none${dns1:+:$dns1}${dns2:+:$dns2}" else warn "${iface} does not contain a valid iBFT configuration" warn "ip-addr=$ip" warn "gateway=$gw" warn "subnet-mask=$mask" warn "hostname=$hostname" fi else info "${iface} does not contain a valid iBFT configuration" ls -l ${iface} | vinfo fi if [ -e ${iface}/vlan ]; then vlan=$(read a < ${iface}/vlan; echo $a) if [ "$vlan" -ne "0" ]; then case "$vlan" in [0-9]*) echo "vlan=$dev.$vlan:$dev" echo $mac > /tmp/net.${dev}.${vlan}.has_ibft_config ;; *) echo "vlan=$vlan:$dev" echo $mac > /tmp/net.${vlan}.has_ibft_config ;; esac else echo $mac > /tmp/net.${dev}.has_ibft_config fi else echo $mac > /tmp/net.${dev}.has_ibft_config fi done ) >> /etc/cmdline.d/40-ibft.conf } parse_iscsi_root() { local v v=${1#iscsi:} # extract authentication info case "$v" in *@*:*:*:*:*) authinfo=${v%%@*} v=${v#*@} # allow empty authinfo to allow having an @ in iscsi_target_name like this: # netroot=iscsi:@192.168.1.100::3260::iqn.2009-01.com.example:testdi@sk if [ -n "$authinfo" ]; then OLDIFS="$IFS" IFS=: set $authinfo IFS="$OLDIFS" if [ $# -gt 4 ]; then warn "Wrong authentication info in iscsi: parameter!" return 1 fi iscsi_username=$1 iscsi_password=$2 if [ $# -gt 2 ]; then iscsi_in_username=$3 iscsi_in_password=$4 fi fi ;; esac # extract target ip case "$v" in [[]*[]]:*) iscsi_target_ip=${v#[[]} iscsi_target_ip=${iscsi_target_ip%%[]]*} v=${v#[[]$iscsi_target_ip[]]:} ;; *) iscsi_target_ip=${v%%[:]*} v=${v#$iscsi_target_ip:} ;; esac unset iscsi_target_name # extract target name case "$v" in *:iqn.*) iscsi_target_name=iqn.${v##*:iqn.} v=${v%:iqn.*}: ;; *:eui.*) iscsi_target_name=eui.${v##*:eui.} v=${v%:eui.*}: ;; *:naa.*) iscsi_target_name=naa.${v##*:naa.} v=${v%:naa.*}: ;; esac # parse the rest OLDIFS="$IFS" IFS=: set $v IFS="$OLDIFS" iscsi_protocol=$1; shift # ignored iscsi_target_port=$1; shift if [ -n "$iscsi_target_name" ]; then if [ $# -eq 3 ]; then iscsi_iface_name=$1; shift fi if [ $# -eq 2 ]; then iscsi_netdev_name=$1; shift fi iscsi_lun=$1; shift if [ $# -ne 0 ]; then warn "Invalid parameter in iscsi: parameter!" return 1 fi return 0 fi if [ $# -gt 3 ] && [ -n "$1$2" ]; then if [ -z "$3" ] || [ "$3" -ge 0 ] 2>/dev/null ; then iscsi_iface_name=$1; shift iscsi_netdev_name=$1; shift fi fi iscsi_lun=$1; shift iscsi_target_name=$(printf "%s:" "$@") iscsi_target_name=${iscsi_target_name%:} } ip_to_var() { local v=${1}: local i set -- while [ -n "$v" ]; do if [ "${v#\[*:*:*\]:}" != "$v" ]; then # handle IPv6 address i="${v%%\]:*}" i="${i##\[}" set -- "$@" "$i" v=${v#\[$i\]:} else set -- "$@" "${v%%:*}" v=${v#*:} fi done unset ip srv gw mask hostname dev autoconf macaddr mtu dns1 dns2 if [ $# -eq 0 ]; then autoconf="error" return 0 fi if [ $# -eq 1 ]; then # format: ip={dhcp|on|any|dhcp6|auto6|either6} # or # ip=<ipv4-address> means anaconda-style static config argument cluster autoconf="$1" if strglob "$autoconf" "*.*.*.*"; then # ip=<ipv4-address> means anaconda-style static config argument cluster: # ip=<ip> gateway=<gw> netmask=<nm> hostname=<host> mtu=<mtu> # ksdevice={link|bootif|ibft|<MAC>|<ifname>} ip="$autoconf" gw=$(getarg gateway=) mask=$(getarg netmask=) hostname=$(getarg hostname=) dev=$(getarg ksdevice=) autoconf="none" mtu=$(getarg mtu=) # handle special values for ksdevice case "$dev" in bootif|BOOTIF) dev=$(fix_bootif $(getarg BOOTIF=)) ;; link) dev="" ;; # FIXME: do something useful with this ibft) dev="" ;; # ignore - ibft is handled elsewhere esac fi return 0 fi if [ "$2" = "dhcp" -o "$2" = "on" -o "$2" = "any" -o "$2" = "dhcp6" -o "$2" = "auto6" -o "$2" = "either6" ]; then # format: ip=<interface>:{dhcp|on|any|dhcp6|auto6}[:[<mtu>][:<macaddr>]] [ -n "$1" ] && dev="$1" [ -n "$2" ] && autoconf="$2" [ -n "$3" ] && mtu=$3 if [ -z "$5" ]; then macaddr="$4" else macaddr="${4}:${5}:${6}:${7}:${8}:${9}" fi return 0 fi # format: ip=<client-IP>:[<peer>]:<gateway-IP>:<netmask>:<client_hostname>:<interface>:{none|off|dhcp|on|any|dhcp6|auto6|ibft}:[:[<mtu>][:<macaddr>]] [ -n "$1" ] && ip=$1 [ -n "$2" ] && srv=$2 [ -n "$3" ] && gw=$3 [ -n "$4" ] && mask=$4 [ -n "$5" ] && hostname=$5 [ -n "$6" ] && dev=$6 [ -n "$7" ] && autoconf=$7 case "$8" in [0-9a-fA-F]*:*|[0-9]*.[0-9]*.[0-9]*.[0-9]*) dns1="$8" [ -n "$9" ] && dns2="$9" ;; [0-9]*) mtu="$8" if [ -n "${9}" -a -z "${10}" ]; then macaddr="${9}" elif [ -n "${9}" -a -n "${10}" -a -n "${11}" -a -n "${12}" -a -n "${13}" -a -n "${14}" ]; then macaddr="${9}:${10}:${11}:${12}:${13}:${14}" fi ;; *) if [ -n "${9}" -a -z "${10}" ]; then macaddr="${9}" elif [ -n "${9}" -a -n "${10}" -a -n "${11}" -a -n "${12}" -a -n "${13}" -a -n "${14}" ]; then macaddr="${9}:${10}:${11}:${12}:${13}:${14}" fi ;; esac return 0 } route_to_var() { local v=${1}: local i set -- while [ -n "$v" ]; do if [ "${v#\[*:*:*\]:}" != "$v" ]; then # handle IPv6 address i="${v%%\]:*}" i="${i##\[}" set -- "$@" "$i" v=${v#\[$i\]:} else set -- "$@" "${v%%:*}" v=${v#*:} fi done unset route_mask route_gw route_dev case $# in 2) [ -n "$1" ] && route_mask="$1"; [ -n "$2" ] && route_gw="$2" return 0;; 3) [ -n "$1" ] && route_mask="$1"; [ -n "$2" ] && route_gw="$2"; [ -n "$3" ] && route_dev="$3" return 0;; *) return 1;; esac } parse_ifname_opts() { local IFS=: set $1 case $# in 7) ifname_if=$1 # udev requires MAC addresses to be lower case ifname_mac=$(echo $2:$3:$4:$5:$6:$7 | sed 'y/ABCDEF/abcdef/') ;; 21) ifname_if=$1 # udev requires MAC addresses to be lower case ifname_mac=$(echo $2:$3:$4:$5:$6:$7:$8:$9:${10}:${11}:${12}:${13}:${14}:${15}:${16}:${17}:${18}:${19}:${20}:${21} | sed 'y/ABCDEF/abcdef/') ;; *) die "Invalid arguments for ifname=" ;; esac case $ifname_if in eth[0-9]|eth[0-9][0-9]|eth[0-9][0-9][0-9]|eth[0-9][0-9][0-9][0-9]) warn "ifname=$ifname_if uses the kernel name space for interfaces" warn "This can fail for multiple network interfaces and is discouraged!" warn "Please use a custom name like \"netboot\" or \"bluesocket\"" warn "or use biosdevname and no ifname= at all." ;; esac } # some network driver need long time to initialize, wait before it's ready. wait_for_if_link() { local cnt=0 local li local timeout="$(getargs rd.net.timeout.iflink=)" timeout=${timeout:-60} timeout=$(($timeout*10)) while [ $cnt -lt $timeout ]; do li=$(ip -o link show dev $1 2>/dev/null) [ -n "$li" ] && return 0 sleep 0.1 cnt=$(($cnt+1)) done return 1 } wait_for_if_up() { local cnt=0 local li local timeout="$(getargs rd.net.timeout.ifup=)" timeout=${timeout:-20} timeout=$(($timeout*10)) while [ $cnt -lt $timeout ]; do li=$(ip -o link show up dev $1) if [ -n "$li" ]; then case "$li" in *\<UP*) return 0;; *\<*,UP\>*) return 0;; *\<*,UP,*\>*) return 0;; esac fi if strstr "$li" "LOWER_UP" \ && strstr "$li" "state UNKNOWN" \ && ! strstr "$li" "DORMANT"; then return 0 fi sleep 0.1 cnt=$(($cnt+1)) done return 1 } wait_for_route_ok() { local cnt=0 local timeout="$(getargs rd.net.timeout.route=)" timeout=${timeout:-20} timeout=$(($timeout*10)) while [ $cnt -lt $timeout ]; do li=$(ip route show) [ -n "$li" ] && [ -z "${li##*$1*}" ] && return 0 sleep 0.1 cnt=$(($cnt+1)) done return 1 } wait_for_ipv6_dad_link() { local cnt=0 local timeout="$(getargs rd.net.timeout.ipv6dad=)" timeout=${timeout:-50} timeout=$(($timeout*10)) while [ $cnt -lt $timeout ]; do [ -n "$(ip -6 addr show dev "$1" scope link)" ] \ && [ -z "$(ip -6 addr show dev "$1" scope link tentative)" ] \ && return 0 [ -n "$(ip -6 addr show dev "$1" scope link dadfailed)" ] \ && return 1 sleep 0.1 cnt=$(($cnt+1)) done return 1 } wait_for_ipv6_dad() { local cnt=0 local timeout="$(getargs rd.net.timeout.ipv6dad=)" timeout=${timeout:-50} timeout=$(($timeout*10)) while [ $cnt -lt $timeout ]; do [ -n "$(ip -6 addr show dev "$1")" ] \ && [ -z "$(ip -6 addr show dev "$1" tentative)" ] \ && [ -n "$(ip -6 route list proto ra dev "$1" | grep ^default)" ] \ && return 0 [ -n "$(ip -6 addr show dev "$1" dadfailed)" ] \ && return 1 sleep 0.1 cnt=$(($cnt+1)) done return 1 } wait_for_ipv6_auto() { local cnt=0 local timeout="$(getargs rd.net.timeout.ipv6auto=)" timeout=${timeout:-40} timeout=$(($timeout*10)) while [ $cnt -lt $timeout ]; do [ -z "$(ip -6 addr show dev "$1" tentative)" ] \ && [ -n "$(ip -6 route list proto ra dev "$1" | grep ^default)" ] \ && return 0 sleep 0.1 cnt=$(($cnt+1)) done return 1 } linkup() { wait_for_if_link $1 2>/dev/null\ && ip link set $1 up 2>/dev/null\ && wait_for_if_up $1 2>/dev/null } type hostname >/dev/null 2>&1 || \ hostname() { cat /proc/sys/kernel/hostname } iface_has_carrier() { local cnt=0 local interface="$1" flags="" [ -n "$interface" ] || return 2 interface="/sys/class/net/$interface" [ -d "$interface" ] || return 2 local timeout="$(getargs rd.net.timeout.carrier=)" timeout=${timeout:-10} timeout=$(($timeout*10)) linkup "$1" li=$(ip -o link show up dev $1) strstr "$li" "NO-CARRIER" && _no_carrier_flag=1 while [ $cnt -lt $timeout ]; do if [ -n "$_no_carrier_flag" ]; then li=$(ip -o link show up dev $1) # NO-CARRIER flag was cleared strstr "$li" "NO-CARRIER" || return 0 elif ! [ -e "$interface/carrier" ]; then # sysfs not available and "NO-CARRIER" not displayed return 0 fi # double check the syscfs carrier flag [ -e "$interface/carrier" ] && [ "$(cat $interface/carrier)" = 1 ] && return 0 sleep 0.1 cnt=$(($cnt+1)) done return 1 } iface_has_link() { iface_has_carrier "$@" } iface_is_enslaved() { local _li _li=$(ip -o link show dev $1) strstr "$_li" " master " || return 1 return 0 } find_iface_with_link() { local iface_path="" iface="" for iface_path in /sys/class/net/*; do iface=${iface_path##*/} str_starts "$iface" "lo" && continue if iface_has_link $iface; then echo "$iface" return 0 fi done return 1 } is_persistent_ethernet_name() { local _netif="$1" local _name_assign_type="0" [ -f "/sys/class/net/$_netif/name_assign_type" ] \ && _name_assign_type=$(cat "/sys/class/net/$_netif/name_assign_type") # NET_NAME_ENUM 1 [ "$_name_assign_type" = "1" ] && return 1 # NET_NAME_PREDICTABLE 2 [ "$_name_assign_type" = "2" ] && return 0 case "$_netif" in # udev persistent interface names eno[0-9]|eno[0-9][0-9]|eno[0-9][0-9][0-9]*) ;; ens[0-9]|ens[0-9][0-9]|ens[0-9][0-9][0-9]*) ;; enp[0-9]s[0-9]*|enp[0-9][0-9]s[0-9]*|enp[0-9][0-9][0-9]*s[0-9]*) ;; enP*p[0-9]s[0-9]*|enP*p[0-9][0-9]s[0-9]*|enP*p[0-9][0-9][0-9]*s[0-9]*) ;; # biosdevname em[0-9]|em[0-9][0-9]|em[0-9][0-9][0-9]*) ;; p[0-9]p[0-9]*|p[0-9][0-9]p[0-9]*|p[0-9][0-9][0-9]*p[0-9]*) ;; *) return 1 esac return 0 } is_kernel_ethernet_name() { local _netif="$1" local _name_assign_type="1" if [ -e "/sys/class/net/$_netif/name_assign_type" ]; then _name_assign_type=$(cat "/sys/class/net/$_netif/name_assign_type") case "$_name_assign_type" in 2|3|4) # NET_NAME_PREDICTABLE 2 # NET_NAME_USER 3 # NET_NAME_RENAMED 4 return 1 ;; 1|*) # NET_NAME_ENUM 1 return 0 ;; esac fi # fallback to error prone manual name check case "$_netif" in eth[0-9]|eth[0-9][0-9]|eth[0-9][0-9][0-9]*) return 0 ;; *) return 1 esac } iface_get_subchannels() { local _netif local _subchannels _netif="$1" _subchannels=$({ for i in /sys/class/net/$_netif/device/cdev[0-9]*; do [ -e $i ] || continue channel=$(readlink -f $i) printf -- "%s" "${channel##*/}," done }) [ -n "$_subchannels" ] || return 1 printf -- "%s" ${_subchannels%,} } modules.d/40network/netroot.sh000075500000005165151701010110012316 0ustar00#!/bin/sh PATH=/usr/sbin:/usr/bin:/sbin:/bin command -v getarg >/dev/null || . /lib/dracut-lib.sh command -v setup_net >/dev/null || . /lib/net-lib.sh # Huh? Empty $1? [ -z "$1" ] && exit 1 # [ ! -z $2 ] means this is for manually bringing up network # instead of real netroot; If It's called without $2, then there's # no sense in doing something if no (net)root info is available # or root is already there [ -d $NEWROOT/proc ] && exit 0 if [ -z "$netroot" ]; then netroot=$(getarg netroot=) fi [ -z "$netroot" ] && exit 1 # Set or override primary interface netif=$1 [ -e "/tmp/net.bootdev" ] && read netif < /tmp/net.bootdev case "$netif" in ??:??:??:??:??:??) # MAC address for i in /sys/class/net/*/address; do mac=$(cat $i) if [ "$mac" = "$netif" ]; then i=${i%/address} netif=${i##*/} break fi done esac # Figure out the handler for root=dhcp by recalling all netroot cmdline # handlers when this is not called from manually network bringing up. if [ -z "$2" ]; then if getarg "root=dhcp" || getarg "netroot=dhcp" || getarg "root=dhcp6" || getarg "netroot=dhcp6"; then # Load dhcp options [ -e /tmp/dhclient.$netif.dhcpopts ] && . /tmp/dhclient.$netif.dhcpopts # If we have a specific bootdev with no dhcpoptions or empty root-path, # we die. Otherwise we just warn if [ -z "$new_root_path" ] ; then [ -n "$BOOTDEV" ] && die "No dhcp root-path received for '$BOOTDEV'" warn "No dhcp root-path received for '$netif' trying other interfaces if available" exit 1 fi rm -f -- $hookdir/initqueue/finished/dhcp.sh # Set netroot to new_root_path, so cmdline parsers don't call netroot=$new_root_path # FIXME! unset rootok for f in $hookdir/cmdline/90*.sh; do [ -f "$f" ] && . "$f"; done else rootok="1" fi # Check: do we really know how to handle (net)root? [ -z "$root" ] && die "No or empty root= argument" [ -z "$rootok" ] && die "Don't know how to handle 'root=$root'" handler=${netroot%%:*} handler=${handler%%4} handler=$(command -v ${handler}root) if [ -z "$netroot" ] || [ ! -e "$handler" ] ; then die "No handler for netroot type '$netroot'" fi fi # Source netroot hooks before we start the handler source_hook netroot $netif # Run the handler; don't store the root, it may change from device to device # XXX other variables to export? [ -n "$handler" ] && "$handler" "$netif" "$netroot" "$NEWROOT" save_netinfo $netif exit 0 modules.d/45ifcfg/module-setup.sh000075500000000441151701010110012631 0ustar00#!/bin/bash # called by dracut check() { [[ -d /etc/sysconfig/network-scripts ]] && return 0 return 255 } # called by dracut depends() { echo "network" return 0 } # called by dracut install() { inst_binary sort inst_hook pre-pivot 85 "$moddir/write-ifcfg.sh" } modules.d/45ifcfg/write-ifcfg.sh000075500000021242151701010110012416 0ustar00#!/bin/sh # NFS root might have reached here before /tmp/net.ifaces was written type is_persistent_ethernet_name >/dev/null 2>&1 || . /lib/net-lib.sh udevadm settle --timeout=30 mkdir -m 0755 -p /tmp/ifcfg/ mkdir -m 0755 -p /tmp/ifcfg-leases/ get_config_line_by_subchannel() { local CHANNEL local line CHANNELS="$1" while read line || [ -n "$line" ]; do if strstr "$line" "$CHANNELS"; then echo $line return 0 fi done < /etc/ccw.conf return 1 } print_s390() { local _netif local SUBCHANNELS local OPTIONS local NETTYPE local CONFIG_LINE local i local channel local OLD_IFS _netif="$1" # if we find ccw channel, then use those, instead of # of the MAC SUBCHANNELS=$({ for i in /sys/class/net/$_netif/device/cdev[0-9]*; do [ -e $i ] || continue channel=$(readlink -f $i) printf '%s' "${channel##*/}," done }) [ -n "$SUBCHANNELS" ] || return 1 SUBCHANNELS=${SUBCHANNELS%,} echo "SUBCHANNELS=\"${SUBCHANNELS}\"" CONFIG_LINE=$(get_config_line_by_subchannel $SUBCHANNELS) [ $? -ne 0 -o -z "$CONFIG_LINE" ] && return 0 OLD_IFS=$IFS IFS="," set -- $CONFIG_LINE IFS=$OLD_IFS NETTYPE=$1 shift SUBCHANNELS="$1" OPTIONS="" shift while [ $# -gt 0 ]; do case $1 in *=*) OPTIONS="$OPTIONS $1";; esac shift done OPTIONS=${OPTIONS## } echo "NETTYPE=\"${NETTYPE}\"" echo "OPTIONS=\"${OPTIONS}\"" return 0 } hw_bind() { local _netif="$1" local _macaddr="$2" [ -n "$_macaddr" ] \ && echo "MACADDR=\"$_macaddr\"" print_s390 "$_netif" \ && return 0 [ -n "$_macaddr" ] && return 0 is_persistent_ethernet_name "$_netif" && return 0 [ -f "/sys/class/net/$_netif/addr_assign_type" ] \ && [ "$(cat "/sys/class/net/$_netif/addr_assign_type")" != "0" ] \ && return 1 [ -f "/sys/class/net/$_netif/address" ] \ || return 1 echo "HWADDR=\"$(cat /sys/class/net/$_netif/address)\"" } interface_bind() { local _netif="$1" local _macaddr="$2" if [ ! -e "/sys/class/net/$_netif" ]; then derror "Cannot find network interface '$_netif'!" return 1 fi # see, if we can bind it to some hw parms if hw_bind "$_netif" "$_macaddr"; then # only print out DEVICE, if it's user assigned is_kernel_ethernet_name "$_netif" && return 0 fi echo "DEVICE=\"$_netif\"" } for netup in /tmp/net.*.did-setup ; do [ -f $netup ] || continue netif=${netup%%.did-setup} netif=${netif##*/net.} strglobin "$netif" ":*:*:*:*:" && continue [ -e /tmp/ifcfg/ifcfg-$netif ] && continue unset bridge unset bond unset bondslaves unset bondname unset bondoptions unset bridgename unset bridgeslaves unset team unset uuid unset ip unset gw unset mtu unset mask unset macaddr unset slave unset ethname unset vlan unset vlanname unset phydevice [ -e /tmp/bond.${netif}.info ] && . /tmp/bond.${netif}.info [ -e /tmp/bridge.${netif}.info ] && . /tmp/bridge.${netif}.info [ -e /tmp/team.${netif}.info ] && . /tmp/team.${netif}.info uuid=$(cat /proc/sys/kernel/random/uuid) if [ "$netif" = "$bridgename" ]; then bridge=yes elif [ "$netif" = "$teammaster" ]; then team=yes elif [ "$netif" = "$bondname" ]; then # $netif can't be bridge and bond at the same time bond=yes fi for i in /tmp/vlan.${netif}.*; do [ ! -e "$i" ] && continue . "$i" vlan=yes break done # skip team interfaces for now, the host config must be in sync [ "$netif" = "$teammaster" ] && continue { echo "# Generated by dracut initrd" echo "NAME=\"$netif\"" [ -z "$vlan" ] && interface_bind "$netif" "$macaddr" echo "ONBOOT=yes" echo "NETBOOT=yes" echo "UUID=\"$uuid\"" strstr "$(ip -6 addr show dev $netif)" 'inet6' && echo "IPV6INIT=yes" if [ -f /tmp/dhclient.$netif.lease ]; then [ -f /tmp/dhclient.$netif.dhcpopts ] && . /tmp/dhclient.$netif.dhcpopts if [ -f /tmp/net.$netif.has_ibft_config ]; then echo "BOOTPROTO=ibft" else echo "BOOTPROTO=dhcp" fi cp /tmp/dhclient.$netif.lease /tmp/ifcfg-leases/dhclient-$uuid-$netif.lease else # If we've booted with static ip= lines, the override file is there [ -e /tmp/net.$netif.override ] && . /tmp/net.$netif.override if strglobin "$ip" '*:*:*'; then echo "IPV6INIT=yes" echo "IPV6_AUTOCONF=no" echo "IPV6ADDR=\"$ip/$mask\"" else if [ -f /tmp/net.$netif.has_ibft_config ]; then echo "BOOTPROTO=ibft" else echo "BOOTPROTO=none" echo "IPADDR=\"$ip\"" if strstr "$mask" "."; then echo "NETMASK=\"$mask\"" else echo "PREFIX=\"$mask\"" fi fi fi if strglobin "$gw" '*:*:*'; then echo "IPV6_DEFAULTGW=\"$gw\"" elif [ -n "$gw" ]; then echo "GATEWAY=\"$gw\"" fi fi [ -n "$mtu" ] && echo "MTU=\"$mtu\"" } > /tmp/ifcfg/ifcfg-$netif # bridge needs different things written to ifcfg if [ -z "$bridge" ] && [ -z "$bond" ] && [ -z "$vlan" ] && [ -z "$team" ]; then # standard interface echo "TYPE=Ethernet" >> /tmp/ifcfg/ifcfg-$netif fi if [ -n "$vlan" ] ; then { echo "TYPE=Vlan" echo "DEVICE=\"$netif\"" echo "VLAN=yes" echo "PHYSDEV=\"$phydevice\"" } >> /tmp/ifcfg/ifcfg-$netif fi if [ -n "$bond" ] ; then # bond interface { # This variable is an indicator of a bond interface for initscripts echo "BONDING_OPTS=\"$bondoptions\"" echo "NAME=\"$netif\"" echo "TYPE=Bond" } >> /tmp/ifcfg/ifcfg-$netif for slave in $bondslaves ; do # write separate ifcfg file for the raw eth interface ( echo "# Generated by dracut initrd" echo "NAME=\"$slave\"" echo "TYPE=Ethernet" echo "ONBOOT=yes" echo "NETBOOT=yes" echo "SLAVE=yes" echo "MASTER=\"$netif\"" echo "UUID=\"$(cat /proc/sys/kernel/random/uuid)\"" unset macaddr [ -e /tmp/net.$slave.override ] && . /tmp/net.$slave.override interface_bind "$slave" "$macaddr" ) >> /tmp/ifcfg/ifcfg-$slave done fi if [ -n "$bridge" ] ; then # bridge { echo "TYPE=Bridge" echo "NAME=\"$netif\"" } >> /tmp/ifcfg/ifcfg-$netif for slave in $bridgeslaves ; do # write separate ifcfg file for the raw eth interface ( echo "# Generated by dracut initrd" echo "NAME=\"$slave\"" echo "TYPE=Ethernet" echo "ONBOOT=yes" echo "NETBOOT=yes" echo "BRIDGE=\"$bridgename\"" echo "UUID=\"$(cat /proc/sys/kernel/random/uuid)\"" unset macaddr [ -e /tmp/net.$slave.override ] && . /tmp/net.$slave.override interface_bind "$slave" "$macaddr" ) >> /tmp/ifcfg/ifcfg-$slave done fi i=1 for ns in $(getargs nameserver) $dns1 $dns2; do echo "DNS${i}=\"${ns}\"" >> /tmp/ifcfg/ifcfg-$netif i=$((i+1)) done [ -f /tmp/net.route6."$netif" ] && cp /tmp/net.route6."$netif" /tmp/ifcfg/route6-"$netif" [ -f /tmp/net.route."$netif" ] && cp /tmp/net.route."$netif" /tmp/ifcfg/route-"$netif" done # Pass network opts mkdir -m 0755 -p /run/initramfs/state/etc/sysconfig/network-scripts mkdir -m 0755 -p /run/initramfs/state/var/lib/dhclient echo "files /etc/sysconfig/network-scripts" >> /run/initramfs/rwtab echo "files /var/lib/dhclient" >> /run/initramfs/rwtab { cp /tmp/net.* /run/initramfs/ for i in /tmp/net.*.resolv.conf; do [ -f "$i" ] && cat "$i" done | sort -u > /run/initramfs/state/etc/resolv.conf [ -s /run/initramfs/state/etc/resolv.conf ] || rm -f /run/initramfs/state/etc/resolv.conf copytree /tmp/ifcfg /run/initramfs/state/etc/sysconfig/network-scripts cp /tmp/ifcfg-leases/* /run/initramfs/state/var/lib/dhclient } > /dev/null 2>&1 modules.d/90kernel-network-modules/module-setup.sh000075500000002614151701010110016174 0ustar00#!/bin/bash # called by dracut check() { return 255 } # called by dracut depends() { return 0 } # called by dracut installkernel() { # Include wired net drivers, excluding wireless local _arch=$(uname -m) local _net_symbols='eth_type_trans|register_virtio_device|usbnet_open' local _unwanted_drivers='/(wireless|isdn|uwb|net/ethernet|net/phy|net/team)/' local _net_drivers if [ "$_arch" = "s390" -o "$_arch" = "s390x" ]; then dracut_instmods -o -P ".*${_unwanted_drivers}.*" -s "$_net_symbols" "=drivers/s390/net" fi if [[ $hostonly_mode == 'strict' ]] && [[ -n ${hostonly_nics+x} ]]; then for _nic in $hostonly_nics; do _net_drivers=$(get_dev_module /sys/class/net/$_nic) if ! [[ $_net_drivers ]]; then derror "--hostonly-nics contains invalid NIC '$_nic'" continue fi hostonly="" instmods $_net_drivers done return 0 fi dracut_instmods -o -P ".*${_unwanted_drivers}.*" -s "$_net_symbols" "=drivers/net" #instmods() will take care of hostonly instmods \ =drivers/net/phy \ =drivers/net/team \ =drivers/net/ethernet \ ecb arc4 bridge stp llc ipv6 bonding 8021q ipvlan macvlan af_packet virtio_net xennet hostonly="" instmods iscsi_ibft crc32c iscsi_boot_sysfs } # called by dracut install() { return 0 } modules.d/90qemu-net/module-setup.sh000075500000001442151701010110013310 0ustar00#!/bin/bash # called by dracut check() { if [[ $hostonly ]] || [[ $mount_needs ]]; then if type -P systemd-detect-virt >/dev/null 2>&1; then vm=$(systemd-detect-virt --vm >/dev/null 2>&1) (($? != 0)) && return 255 [[ $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 vendor < $i [[ "$vendor" == "QEMU" ]] && return 0 [[ "$vendor" == "Bochs" ]] && return 0 done return 255 fi return 0 } # called by dracut installkernel() { # qemu specific modules hostonly='' instmods virtio_net e1000 8139cp pcnet32 e100 ne2k_pci } modules.d/95cifs/cifs-lib.sh000075500000001711151701010110011552 0ustar00#!/bin/sh # cifs_to_var CIFSROOT # use CIFSROOT to set $server, $path, and $options. # CIFSROOT is something like: cifs://[<username>[:<password>]]@<host>/<path> # NETIF is used to get information from DHCP options, if needed. type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh cifs_to_var() { local cifsuser; local cifspass # Check required arguments server=${1##cifs://} cifsuser=${server%@*} cifspass=${cifsuser#*:} if [ "$cifspass" != "$cifsuser" ]; then cifsuser=${cifsuser%:*} else cifspass=$(getarg cifspass) fi if [ "$cifsuser" != "$server" ]; then server="${server#*@}" else cifsuser=$(getarg cifsuser) fi path=${server#*/} server=${server%/*} if [ ! "$cifsuser" -o ! "$cifspass" ]; then die "For CIFS support you need to specify a cifsuser and cifspass either in the cifsuser and cifspass commandline parameters or in the root= CIFS URL." fi options="user=$cifsuser,pass=$cifspass" } modules.d/95cifs/cifsroot.sh000075500000001141151701010110011707 0ustar00#!/bin/sh type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh . /lib/cifs-lib.sh [ "$#" = 3 ] || exit 1 # root is in the form root=cifs://user:pass@[server]/[folder] either from # cmdline or dhcp root-path netif="$1" root="$2" NEWROOT="$3" cifs_to_var $root echo server: $server echo path: $path echo options: $options mount.cifs //$server/$path $NEWROOT -o $options && { [ -e /dev/root ] || ln -s null /dev/root ; } # inject new exit_if_exists echo 'settle_exit_if_exists="--exit-if-exists=/dev/root"; rm -f -- "$job"' > $hookdir/initqueue/cifs.sh # force udevsettle to break > $hookdir/initqueue/work modules.d/95cifs/module-setup.sh000075500000002363151701010110012511 0ustar00#!/bin/bash # called by dracut check() { # If our prerequisites are not met, fail anyways. require_binaries mount.cifs || return 1 [[ $hostonly ]] || [[ $mount_needs ]] && { for fs in "${host_fs_types[@]}"; do [[ "$fs" == "cifs" ]] && return 0 done return 255 } return 0 } # called by dracut depends() { # We depend on network modules being loaded echo network } # called by dracut installkernel() { instmods cifs ipv6 # hash algos instmods md4 md5 sha256 # ciphers instmods aes arc4 des ecb # macs instmods hmac cmac } # called by dracut install() { local _i local _nsslibs inst_multiple -o mount.cifs inst_multiple /etc/services /etc/nsswitch.conf /etc/protocols inst_libdir_file 'libcap-ng.so*' _nsslibs=$(sed -e '/^#/d' -e 's/^.*://' -e 's/\[NOTFOUND=return\]//' /etc/nsswitch.conf \ | tr -s '[:space:]' '\n' | sort -u | tr -s '[:space:]' '|') _nsslibs=${_nsslibs#|} _nsslibs=${_nsslibs%|} inst_libdir_file -n "$_nsslibs" 'libnss_*.so*' inst_hook cmdline 90 "$moddir/parse-cifsroot.sh" inst "$moddir/cifsroot.sh" "/sbin/cifsroot" inst "$moddir/cifs-lib.sh" "/lib/cifs-lib.sh" dracut_need_initqueue } modules.d/95cifs/parse-cifsroot.sh000075500000002236151701010110013025 0ustar00#!/bin/sh # # root=cifs://[user:pass@]<server>/<folder> # # This syntax can come from DHCP root-path as well. # # If a username or password are not specified as part of the root, then they # will be pulled from cifsuser and cifspass on the kernel command line, # respectively. # type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh . /lib/cifs-lib.sh # This script is sourced, so root should be set. But let's be paranoid [ -z "$root" ] && root=$(getarg root=) if [ -z "$netroot" ]; then for netroot in $(getargs netroot=); do [ "${netroot%%:*}" = "cifs" ] && break done [ "${netroot%%:*}" = "cifs" ] || unset netroot fi # Root takes precedence over netroot if [ "${root%%:*}" = "cifs" ] ; then if [ -n "$netroot" ] ; then warn "root takes precedence over netroot. Ignoring netroot" fi netroot=$root unset root fi # If it's not cifs we don't continue [ "${netroot%%:*}" = "cifs" ] || return # Check required arguments cifs_to_var $netroot # If we don't have a server, we need dhcp if [ -z "$server" ] ; then DHCPORSERVER="1" fi; # Done, all good! rootok=1 echo '[ -e $NEWROOT/proc ]' > $hookdir/initqueue/finished/cifsroot.sh modules.d/95fcoe/cleanup-fcoe.sh000075500000001040151701010110012406 0ustar00#!/bin/sh # -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- # ex: ts=8 sw=4 sts=4 et filetype=sh 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 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 fi modules.d/95fcoe/fcoe-edd.sh000075500000002212151701010110011515 0ustar00#!/bin/sh dcb="$1" _modprobe_r_edd="0" check_edd() { local cnt=0 [ -d /sys/firmware/edd ] && return 0 _modprobe_r_edd="1" modprobe edd || return $? while [ $cnt -lt 600 ]; do [ -d /sys/firmware/edd ] && return 0 cnt=$(($cnt+1)) sleep 0.1 done return 1 } check_edd || exit 1 for disk in /sys/firmware/edd/int13_*; do [ -d "$disk" ] || continue if [ -e "${disk}/pci_dev/driver" ]; then driver=$(readlink "${disk}/pci_dev/driver") driver=${driver##*/} fi # i40e uses dev_port 1 for a virtual fcoe function if [ "${driver}" = "i40e" ]; then dev_port=1 fi for nic in "${disk}"/pci_dev/net/*; do [ -d "$nic" ] || continue if [ -n "${dev_port}" -a -e "${nic}/dev_port" ]; then if [ "$(cat ${nic}/dev_port)" -ne "${dev_port}" ]; then continue fi fi if [ -e ${nic}/address ]; then fcoe_interface=${nic##*/} if ! [ -e "/tmp/.fcoe-$fcoe_interface" ]; then /sbin/fcoe-up "$fcoe_interface" "$dcb" > "/tmp/.fcoe-$fcoe_interface" fi fi done done [ "$_modprobe_r_edd" = "1" ] && modprobe -r edd unset _modprobe_r_edd modules.d/95fcoe/fcoe-genrules.sh000075500000002264151701010110012614 0ustar00#!/bin/sh # We use (fcoe_interface or fcoe_mac) and fcoe_dcb as set by parse-fcoe.sh # If neither mac nor interface are set we don't continue [ -z "$fcoe_interface" -a -z "$fcoe_mac" ] && return # Write udev rules { if [ -n "$fcoe_mac" ] ; then printf 'ACTION=="add", SUBSYSTEM=="net", ATTR{address}=="%s", RUN+="/sbin/initqueue --onetime --unique --name fcoe-up-$env{INTERFACE} /sbin/fcoe-up $env{INTERFACE} %s %s"\n' "$fcoe_mac" "$fcoe_dcb" "$fcoe_mode" printf 'ACTION=="add", SUBSYSTEM=="net", ATTR{address}=="%s", RUN+="/sbin/initqueue --onetime --timeout --unique --name fcoe-timeout-$env{INTERFACE} /sbin/fcoe-up $env{INTERFACE} %s %s"\n' "$fcoe_mac" "$fcoe_dcb" "$fcoe_mode" else printf 'ACTION=="add", SUBSYSTEM=="net", NAME=="%s", RUN+="/sbin/initqueue --onetime --unique --name fcoe-up-$env{INTERFACE} /sbin/fcoe-up $env{INTERFACE} %s %s"\n' "$fcoe_interface" "$fcoe_dcb" "$fcoe_mode" printf 'ACTION=="add", SUBSYSTEM=="net", NAME=="%s", RUN+="/sbin/initqueue --onetime --timeout --unique --name fcoe-timeout-$env{INTERFACE} /sbin/fcoe-up $env{INTERFACE} %s %s"\n' "$fcoe_interface" "$fcoe_dcb" "$fcoe_mode" fi } >> /etc/udev/rules.d/92-fcoe.rules modules.d/95fcoe/fcoe-up.sh000075500000004743151701010110011420 0ustar00#!/bin/sh # # We get called like this: # fcoe-up <network-device> <dcb|nodcb> <fabric|vn2vn> # # Note currently only nodcb is supported, the dcb option is reserved for # future use. PATH=/usr/sbin:/usr/bin:/sbin:/bin type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh type ip_to_var >/dev/null 2>&1 || . /lib/net-lib.sh # Huh? Missing arguments ?? [ -z "$1" -o -z "$2" ] && exit 1 netif=$1 dcb=$2 mode=$3 vlan="yes" iflink=$(cat /sys/class/net/$netif/iflink) ifindex=$(cat /sys/class/net/$netif/ifindex) if [ "$iflink" != "$ifindex" ] ; then # Skip VLAN devices exit 0 fi ip link set dev $netif up linkup "$netif" # Some fcoemon implementations expect --syslog=true syslogopt="--syslog" if fcoemon -h|grep syslog|grep -q yes; then fcoemonyes="$syslogopt=yes" fi netdriver=$(readlink -f /sys/class/net/$netif/device/driver) netdriver=${netdriver##*/} write_fcoemon_cfg() { [ -f /etc/fcoe/cfg-$netif ] && return echo FCOE_ENABLE=\"yes\" > /etc/fcoe/cfg-$netif if [ "$dcb" = "dcb" ]; then echo DCB_REQUIRED=\"yes\" >> /etc/fcoe/cfg-$netif else echo DCB_REQUIRED=\"no\" >> /etc/fcoe/cfg-$netif fi if [ "$vlan" = "yes" ]; then echo AUTO_VLAN=\"yes\" >> /etc/fcoe/cfg-$netif else echo AUTO_VLAN=\"no\" >> /etc/fcoe/cfg-$netif fi if [ "$mode" = "vn2vn" ] ; then echo MODE=\"vn2vn\" >> /etc/fcoe/cfg-$netif else echo MODE=\"fabric\" >> /etc/fcoe/cfg-$netif fi } if [ "$netdriver" = "bnx2x" ]; then # If driver is bnx2x, do not use /sys/module/fcoe/parameters/create but fipvlan modprobe 8021q udevadm settle --timeout=30 # Sleep for 13 s to allow dcb negotiation sleep 13 fipvlan "$netif" -c -s need_shutdown exit fi if [ "$dcb" = "dcb" ]; then # wait for lldpad to be ready i=0 while [ $i -lt 60 ]; do lldptool -p && break info "Waiting for lldpad to be ready" sleep 1 i=$(($i+1)) done while [ $i -lt 60 ]; do dcbtool sc "$netif" dcb on && break info "Retrying to turn dcb on" sleep 1 i=$(($i+1)) done while [ $i -lt 60 ]; do dcbtool sc "$netif" pfc e:1 a:1 w:1 && break info "Retrying to turn dcb on" sleep 1 i=$(($i+1)) done while [ $i -lt 60 ]; do dcbtool sc "$netif" app:fcoe e:1 a:1 w:1 && break info "Retrying to turn fcoe on" sleep 1 i=$(($i+1)) done sleep 1 fi write_fcoemon_cfg fcoemon $syslogopt need_shutdown modules.d/95fcoe/lldpad.sh000075500000000730151701010110011312 0ustar00#!/bin/bash if ! getargbool 1 rd.fcoe -d -n rd.nofcoe ; then info "rd.fcoe=0: skipping lldpad activation" return 0 fi # Note lldpad will stay running after switchroot, the system initscripts # are to kill it and start a new lldpad to take over. Data is transfered # between the 2 using a shm segment lldpad -d # wait for lldpad to be ready i=0 while [ $i -lt 60 ]; do lldptool -p && break info "Waiting for lldpad to be ready" sleep 1 i=$(($i+1)) done modules.d/95fcoe/module-setup.sh000075500000006534151701010110012505 0ustar00#!/bin/bash # called by dracut check() { is_fcoe() { block_is_fcoe $1 || return 1 } [[ $hostonly ]] || [[ $mount_needs ]] && { for_each_host_dev_and_slaves is_fcoe || return 255 } require_binaries dcbtool fipvlan lldpad ip readlink fcoemon fcoeadm || return 1 return 0 } # called by dracut depends() { echo network rootfs-block return 0 } # called by dracut installkernel() { instmods fcoe libfcoe 8021q edd bnx2fc } get_vlan_parent() { local link=$1 [ -d $link ] || return read iflink < $link/iflink for if in /sys/class/net/* ; do read idx < $if/ifindex if [ $idx -eq $iflink ] ; then echo ${if##*/} fi done } # called by dracut cmdline() { { for c in /sys/bus/fcoe/devices/ctlr_* ; do [ -L $c ] || continue read enabled < $c/enabled read mode < $c/mode [ $enabled -eq 0 ] && continue if [ $mode = "VN2VN" ] ; then mode="vn2vn" else mode="fabric" fi d=$(cd -P $c; echo $PWD) i=${d%/*} ifname=${i##*/} read mac < ${i}/address s=$(dcbtool gc ${i##*/} dcb 2>/dev/null | sed -n 's/^DCB State:\t*\(.*\)/\1/p') if [ -z "$s" ] ; then p=$(get_vlan_parent ${i}) if [ "$p" ] ; then s=$(dcbtool gc ${p} dcb 2>/dev/null | sed -n 's/^DCB State:\t*\(.*\)/\1/p') ifname=${p##*/} fi fi if [ "$s" = "on" ] ; then dcb="dcb" else dcb="nodcb" fi # Some Combined Network Adapters(CNAs) implement DCB in firmware. # Do not run software-based DCB or LLDP on CNAs that implement DCB. # If the network interface provides hardware DCB/DCBX capabilities, # DCB_REQUIRED in "/etc/fcoe/cfg-xxx" is expected to set to "no". # # Force "nodcb" if there's any DCB_REQUIRED="no"(child or vlan parent). grep -q "^[[:blank:]]*DCB_REQUIRED=\"no\"" /etc/fcoe/cfg-${i##*/} &>/dev/null [ $? -eq 0 ] && dcb="nodcb" if [ "$p" ] ; then grep -q "^[[:blank:]]*DCB_REQUIRED=\"no\"" /etc/fcoe/cfg-${p} &>/dev/null [ $? -eq 0 ] && dcb="nodcb" fi echo "ifname=${ifname}:${mac}" echo "fcoe=${ifname}:${dcb}:${mode}" done } | sort | uniq } # called by dracut install() { inst_multiple ip dcbtool fipvlan lldpad readlink lldptool fcoemon fcoeadm if [ -e "/etc/hba.conf" ]; then inst_libdir_file 'libhbalinux.so*' inst_simple "/etc/hba.conf" fi mkdir -m 0755 -p "$initdir/var/lib/lldpad" mkdir -m 0755 -p "$initdir/etc/fcoe" if [[ $hostonly_cmdline == "yes" ]] ; then local _fcoeconf=$(cmdline) [[ $_fcoeconf ]] && printf "%s\n" "$_fcoeconf" >> "${initdir}/etc/cmdline.d/95fcoe.conf" fi inst_multiple /etc/fcoe/cfg-* inst "$moddir/fcoe-up.sh" "/sbin/fcoe-up" inst "$moddir/fcoe-edd.sh" "/sbin/fcoe-edd" inst "$moddir/fcoe-genrules.sh" "/sbin/fcoe-genrules.sh" inst_hook pre-trigger 03 "$moddir/lldpad.sh" inst_hook cmdline 99 "$moddir/parse-fcoe.sh" inst_hook cleanup 90 "$moddir/cleanup-fcoe.sh" inst_hook shutdown 40 "$moddir/stop-fcoe.sh" dracut_need_initqueue } modules.d/95fcoe/parse-fcoe.sh000075500000003766151701010110012112 0ustar00#!/bin/sh # # Supported formats: # fcoe=<networkdevice>:<dcb|nodcb>:<fabric|vn2vn> # fcoe=<macaddress>:<dcb|nodcb>:<fabric|vn2vn> # # Note currently only nodcb is supported, the dcb option is reserved for # future use. # # Note letters in the macaddress must be lowercase! # # Examples: # fcoe=eth0:nodcb:vn2vn # fcoe=4a:3f:4c:04:f8:d7:nodcb:fabric if ! getargbool 1 rd.fcoe -d -n rd.nofcoe ; then info "rd.fcoe=0: skipping fcoe" return 0 fi [ -z "$fcoe" ] && fcoe=$(getarg fcoe=) # If it's not set we don't continue [ -z "$fcoe" ] && return [ -e /sys/bus/fcoe/ctlr_create ] || modprobe -b -a fcoe || modprobe -b -a libfcoe || die "FCoE requested but kernel/initrd does not support FCoE" initqueue --onetime modprobe -b -q bnx2fc parse_fcoe_opts() { local OLDIFS="$IFS" local IFS=: set $fcoe IFS="$OLDIFS" case $# in 2) fcoe_interface=$1 fcoe_dcb=$2 fcoe_mode="fabric" return 0 ;; 3) fcoe_interface=$1 fcoe_dcb=$2 fcoe_mode=$3 return 0 ;; 7) fcoe_mac=$1:$2:$3:$4:$5:$6 fcoe_dcb=$7 fcoe_mode="fabric" return 0 ;; 8) fcoe_mac=$1:$2:$3:$4:$5:$6 fcoe_dcb=$7 fcoe_mode=$8 return 0 ;; *) warn "Invalid arguments for fcoe=$fcoe" return 1 ;; esac } parse_fcoe_opts if [ "$fcoe_interface" = "edd" ]; then if [ "$fcoe_dcb" != "nodcb" -a "$fcoe_dcb" != "dcb" ] ; then warn "Invalid FCoE DCB option: $fcoe_dcb" fi /sbin/initqueue --settled --unique /sbin/fcoe-edd $fcoe_dcb else for fcoe in $(getargs fcoe=); do unset fcoe_mac unset fcoe_interface parse_fcoe_opts if [ "$fcoe_dcb" != "nodcb" -a "$fcoe_dcb" != "dcb" ] ; then warn "Invalid FCoE DCB option: $fcoe_dcb" fi . $(command -v fcoe-genrules.sh) done fi modules.d/95fcoe/stop-fcoe.sh000075500000000157151701010110011754 0ustar00#!/bin/bash for f in /sys/bus/fcoe/devices/ctlr_* ; do [ -e $f ] || continue echo 0 > $f/enabled done modules.d/95fcoe-uefi/module-setup.sh000075500000000766151701010110013434 0ustar00#!/bin/bash # called by dracut check() { is_fcoe() { block_is_fcoe $1 || return 1 } [[ $hostonly ]] || [[ $mount_needs ]] && { for_each_host_dev_and_slaves is_fcoe || return 255 [ -d /sys/firmware/efi ] || return 255 } require_binaries dcbtool fipvlan lldpad ip readlink || return 1 return 0 } # called by dracut depends() { echo fcoe uefi-lib return 0 } # called by dracut install() { inst_hook cmdline 20 "$moddir/parse-uefifcoe.sh" } modules.d/95fcoe-uefi/parse-uefifcoe.sh000075500000001630151701010110013675 0ustar00#!/bin/bash command -v getarg >/dev/null || . /lib/dracut-lib.sh command -v get_fcoe_boot_mac >/dev/null || . /lib/uefi-lib.sh command -v set_ifname >/dev/null || . /lib/net-lib.sh print_fcoe_uefi_conf() { local mac dev vlan mac=$(get_fcoe_boot_mac "$1") [ -z "$mac" ] && return 1 dev=$(set_ifname fcoe "$mac") vlan=$(get_fcoe_boot_vlan "$1") || return 1 case "$vlan" in "0") ;; '') return 1 ;; [0-9]*) printf "%s\n" "vlan=$dev.$vlan:$dev" dev="$dev.$vlan" ;; *) printf "%s\n" "vlan=$vlan:$dev" dev="$vlan" ;; esac # fcoe=eth0:nodcb printf "fcoe=%s\n" "$dev:nodcb" return 0 } for i in /sys/firmware/efi/vars/FcoeBootDevice-*/data; do [ -e "$i" ] || continue print_fcoe_uefi_conf $i > /etc/cmdline.d/40-fcoe-uefi.conf && break done modules.d/95iscsi/cleanup-iscsi.sh000075500000000130151701010110013001 0ustar00#!/bin/sh [ -z "${DRACUT_SYSTEMD}" ] && [ -e /sys/module/bnx2i ] && killproc iscsiuio modules.d/95iscsi/iscsiroot.sh000075500000024610151701010110012271 0ustar00#!/bin/sh # # This implementation is incomplete: Discovery mode is not implemented and # the argument handling doesn't follow currently agreed formats. This is mainly # because rfc4173 does not say anything about iscsi_initiator but open-iscsi's # iscsistart needs this. # type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh type parse_iscsi_root >/dev/null 2>&1 || . /lib/net-lib.sh type write_fs_tab >/dev/null 2>&1 || . /lib/fs-lib.sh PATH=/usr/sbin:/usr/bin:/sbin:/bin # Huh? Empty $1? [ -z "$1" ] && exit 1 # Huh? Empty $2? [ -z "$2" ] && exit 1 # Huh? Empty $3? This isn't really necessary, since NEWROOT isn't # used here. But let's be consistent [ -z "$3" ] && exit 1 # root is in the form root=iscsi:[<servername>]:[<protocol>]:[<port>]:[<LUN>]:<targetname> netif="$1" iroot="$2" # If it's not iscsi we don't continue [ "${iroot%%:*}" = "iscsi" ] || exit 1 iroot=${iroot#iscsi} iroot=${iroot#:} # XXX modprobe crc32c should go in the cmdline parser, but I haven't yet # figured out a way how to check whether this is built-in or not modprobe crc32c 2>/dev/null if [ -z "${DRACUT_SYSTEMD}" ] && [ -e /sys/module/bnx2i ] && ! [ -e /tmp/iscsiuio-started ]; then iscsiuio > /tmp/iscsiuio-started fi handle_firmware() { local ifaces retry # Depending on the 'ql4xdisablesysfsboot' qla4xxx # will be autostarting sessions without presenting # them via the firmware interface. # In these cases 'iscsiadm -m fw' will fail, but # the iSCSI sessions will still be present. if ! iscsiadm -m fw; then warn "iscsiadm: Could not get list of targets from firmware." else ifaces=$(set -- /sys/firmware/ibft/ethernet*; echo $#) retry=$(cat /tmp/session-retry) if [ $retry -lt $ifaces ]; then retry=$((retry+1)) echo $retry > /tmp/session-retry return 1 else rm /tmp/session-retry fi if ! iscsiadm -m fw -l; then warn "iscsiadm: Log-in to iscsi target failed" else need_shutdown fi fi [ -d /sys/class/iscsi_session ] || return 1 echo 'started' > "/tmp/iscsistarted-iscsi:" echo 'started' > "/tmp/iscsistarted-firmware" return 0 } handle_netroot() { local iscsi_initiator iscsi_target_name iscsi_target_ip iscsi_target_port local iscsi_target_group iscsi_protocol iscsirw iscsi_lun local iscsi_username iscsi_password local iscsi_in_username iscsi_in_password local iscsi_iface_name iscsi_netdev_name local iscsi_param param local p found local login_retry_max_seen= # override conf settings by command line options arg=$(getarg rd.iscsi.initiator -d iscsi_initiator=) [ -n "$arg" ] && iscsi_initiator=$arg arg=$(getarg rd.iscsi.target.group -d iscsi_target_group=) [ -n "$arg" ] && iscsi_target_group=$arg arg=$(getarg rd.iscsi.username -d iscsi_username=) [ -n "$arg" ] && iscsi_username=$arg arg=$(getarg rd.iscsi.password -d iscsi_password) [ -n "$arg" ] && iscsi_password=$arg arg=$(getarg rd.iscsi.in.username -d iscsi_in_username=) [ -n "$arg" ] && iscsi_in_username=$arg arg=$(getarg rd.iscsi.in.password -d iscsi_in_password=) [ -n "$arg" ] && iscsi_in_password=$arg for p in $(getargs rd.iscsi.param -d iscsi_param); do [ "${p%=*}" = node.session.initial_login_retry_max ] && \ login_retry_max_seen=yes iscsi_param="$iscsi_param $p" done # this sets iscsi_target_name and possibly overwrites most # parameters read from the command line above parse_iscsi_root "$1" || return 1 # Bail out early, if there is no route to the destination if is_ip "$iscsi_target_ip" && [ "$netif" != "timeout" ] && ! all_ifaces_setup && getargbool 1 rd.iscsi.testroute; then ip route get "$iscsi_target_ip" >/dev/null 2>&1 || return 0 fi #limit iscsistart login retries if [ "$login_retry_max_seen" != yes ]; then retries=$(getargnum 3 0 10000 rd.iscsi.login_retry_max) if [ $retries -gt 0 ]; then iscsi_param="${iscsi_param% } node.session.initial_login_retry_max=$retries" fi fi # XXX is this needed? getarg ro && iscsirw=ro getarg rw && iscsirw=rw fsopts=${fsopts:+$fsopts,}${iscsirw} if [ -z "$iscsi_initiator" ] && [ -f /sys/firmware/ibft/initiator/initiator-name ] && ! [ -f /tmp/iscsi_set_initiator ]; then iscsi_initiator=$(while read line || [ -n "$line" ]; do echo $line;done < /sys/firmware/ibft/initiator/initiator-name) echo "InitiatorName=$iscsi_initiator" > /run/initiatorname.iscsi rm -f /etc/iscsi/initiatorname.iscsi 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 [ -f /run/initiatorname.iscsi ] && . /run/initiatorname.iscsi [ -f /etc/initiatorname.iscsi ] && . /etc/initiatorname.iscsi [ -f /etc/iscsi/initiatorname.iscsi ] && . /etc/iscsi/initiatorname.iscsi iscsi_initiator=$InitiatorName fi if [ -z "$iscsi_initiator" ]; then iscsi_initiator=$(iscsi-iname) echo "InitiatorName=$iscsi_initiator" > /run/initiatorname.iscsi rm -f /etc/iscsi/initiatorname.iscsi 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 iscsi_target_port=3260 fi if [ -z "$iscsi_target_group" ]; then iscsi_target_group=1 fi if [ -z "$iscsi_lun" ]; then iscsi_lun=0 fi echo "InitiatorName=$iscsi_initiator" > /run/initiatorname.iscsi ln -fs /run/initiatorname.iscsi /dev/.initiatorname.iscsi 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 # FIXME $iscsi_protocol?? if [ "$root" = "dhcp" ] || [ "$netroot" = "dhcp" ]; then # if root is not specified try to mount the whole iSCSI LUN printf 'SYMLINK=="disk/by-path/*-iscsi-*-%s", SYMLINK+="root"\n' "$iscsi_lun" >> /etc/udev/rules.d/99-iscsi-root.rules udevadm control --reload write_fs_tab /dev/root 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 fi targets=$(iscsiadm -m discovery -t st -p $iscsi_target_ip:${iscsi_target_port:+$iscsi_target_port} | sed 's/^.*iqn/iqn/') [ -z "$targets" ] && echo "Target discovery to $iscsi_target_ip:${iscsi_target_port:+$iscsi_target_port} failed with status $?" && return 1 found= for target in $targets; do if [ "$target" = "$iscsi_target_name" ]; then if [ -n "$iscsi_iface_name" ]; then iscsiadm -m iface -I $iscsi_iface_name --op=new EXTRA=" ${iscsi_netdev_name:+--name=iface.net_ifacename --value=$iscsi_netdev_name} " EXTRA="$EXTRA ${iscsi_initiator:+--name=iface.initiatorname --value=$iscsi_initiator} " fi [ -n "$iscsi_param" ] && for param in $iscsi_param; do EXTRA="$EXTRA --name=${param%=*} --value=${param#*=}"; done CMD="iscsiadm -m node -T $target \ ${iscsi_iface_name:+-I $iscsi_iface_name} \ -p $iscsi_target_ip${iscsi_target_port:+:$iscsi_target_port}" __op="--op=update \ --name=node.startup --value=onboot \ ${iscsi_username:+ --name=node.session.auth.username --value=$iscsi_username} \ ${iscsi_password:+ --name=node.session.auth.password --value=$iscsi_password} \ ${iscsi_in_username:+--name=node.session.auth.username_in --value=$iscsi_in_username} \ ${iscsi_in_password:+--name=node.session.auth.password_in --value=$iscsi_in_password} \ $EXTRA \ $NULL" $CMD $__op if [ "$netif" != "timeout" ]; then $CMD --login fi found=yes break fi done if [ "$netif" = "timeout" ]; then iscsiadm -m node -L onboot || : elif [ "$found" != yes ]; then warn "iSCSI target \"$iscsi_target_name\" not found on portal $iscsi_target_ip:$iscsi_target_port" return 1 fi > $hookdir/initqueue/work netroot_enc=$(str_replace "$1" '/' '\2f') echo 'started' > "/tmp/iscsistarted-iscsi:${netroot_enc}" return 0 } ret=0 if [ "$netif" != "timeout" ] && getargbool 0 rd.iscsi.waitnet; then all_ifaces_setup || exit 0 fi if [ "$netif" = "timeout" ] && all_ifaces_setup; then # s.th. went wrong and the timeout script hits # restart systemctl restart iscsid # damn iscsid is not ready after unit says it's ready sleep 2 fi if getargbool 0 rd.iscsi.firmware -d -y iscsi_firmware ; then if [ "$netif" = "timeout" ] || [ "$netif" = "online" ] || [ "$netif" = "dummy" ]; then [ -f /tmp/session-retry ] || echo 1 > /tmp/session-retry handle_firmware ret=$? fi fi if ! [ "$netif" = "online" ]; then # loop over all netroot parameter if nroot=$(getarg netroot) && [ "$nroot" != "dhcp" ]; then for nroot in $(getargs netroot); do [ "${nroot%%:*}" = "iscsi" ] || continue nroot="${nroot##iscsi:}" if [ -n "$nroot" ]; then handle_netroot "$nroot" ret=$(($ret + $?)) fi done else if [ -n "$iroot" ]; then handle_netroot "$iroot" ret=$? fi fi fi need_shutdown # now we have a root filesystem somewhere in /dev/sd* # let the normal block handler handle root= exit $ret modules.d/95iscsi/module-setup.sh000075500000022216151701010110012676 0ustar00#!/bin/bash # called by dracut check() { local _rootdev # If our prerequisites are not met, fail anyways. require_binaries iscsi-iname iscsiadm iscsid || return 1 # If hostonly was requested, fail the check if we are not actually # booting from root. is_iscsi() { local _dev=$1 [[ -L "/sys/dev/block/$_dev" ]] || return cd "$(readlink -f "/sys/dev/block/$_dev")" until [[ -d sys || -d iscsi_session ]]; do cd .. done [[ -d iscsi_session ]] } [[ $hostonly ]] || [[ $mount_needs ]] && { pushd . >/dev/null for_each_host_dev_and_slaves is_iscsi || return 255 popd >/dev/null } return 0 } get_ibft_mod() { local ibft_mac=$1 local iface_mac iface_mod # Return the iSCSI offload module for a given MAC address for iface_desc in $(iscsiadm -m iface | cut -f 2 -d ' '); do iface_mod=${iface_desc%%,*} iface_mac=${iface_desc#*,} iface_mac=${iface_mac%%,*} if [ "$ibft_mac" = "$iface_mac" ] ; then echo $iface_mod return 0 fi done } install_ibft() { # When iBFT / iscsi_boot is detected: # - Use 'ip=ibft' to set up iBFT network interface # Note: bnx2i is using a different MAC address of iSCSI offloading # so the 'ip=ibft' parameter must not be set # - specify firmware booting cmdline parameter for d in /sys/firmware/* ; do if [ -d ${d}/ethernet0 ] ; then read ibft_mac < ${d}/ethernet0/mac ibft_mod=$(get_ibft_mod $ibft_mac) fi if [ -z "$ibft_mod" ] && [ -d ${d}/ethernet1 ] ; then read ibft_mac < ${d}/ethernet1/mac ibft_mod=$(get_ibft_mod $ibft_mac) fi if [ -d ${d}/initiator ] ; then if [ ${d##*/} = "ibft" ] && [ "$ibft_mod" != "bnx2i" ] ; then echo -n "rd.iscsi.ibft=1 " fi echo -n "rd.iscsi.firmware=1" fi done } install_iscsiroot() { local devpath=$1 local scsi_path iscsi_lun session c d conn host flash local iscsi_session iscsi_address iscsi_port iscsi_targetname iscsi_tpgt local bootproto scsi_path=${devpath%%/block*} [ "$scsi_path" = "$devpath" ] && return 1 iscsi_lun=${scsi_path##*:} [ "$iscsi_lun" = "$scsi_path" ] && return 1 session=${devpath%%/target*} [ "$session" = "$devpath" ] && return 1 iscsi_session=${session##*/} [ "$iscsi_session" = "$session" ] && return 1 host=${session%%/session*} [ "$host" = "$session" ] && return 1 iscsi_host=${host##*/} for flash in ${host}/flashnode_sess-* ; do [ -f "$flash" ] || continue [ ! -e "$flash/is_boot_target" ] && continue is_boot=$(cat $flash/is_boot_target) if [ $is_boot -eq 1 ] ; then # qla4xxx flashnode session; skip iBFT discovery iscsi_initiator=$(cat /sys/class/iscsi_host/${iscsi_host}/initiatorname) echo "rd.iscsi.initiator=${iscsi_initiator}" return; fi done for d in ${session}/* ; do case $d in *connection*) c=${d##*/} conn=${d}/iscsi_connection/${c} if [ -d ${conn} ] ; then iscsi_address=$(cat ${conn}/persistent_address) iscsi_port=$(cat ${conn}/persistent_port) fi ;; *session) if [ -d ${d}/${iscsi_session} ] ; then iscsi_initiator=$(cat ${d}/${iscsi_session}/initiatorname) iscsi_targetname=$(cat ${d}/${iscsi_session}/targetname) fi ;; esac done [ -z "$iscsi_address" ] && return local_address=$(ip -o route get to $iscsi_address | sed -n 's/.*src \([0-9a-f.:]*\).*/\1/p') ifname=$(ip -o route get to $iscsi_address | sed -n 's/.*dev \([^ ]*\).*/\1/p') # follow ifcfg settings for boot protocol for _path in \ "/etc/sysconfig/network-scripts/ifcfg-$ifname" \ "/etc/sysconfig/network/ifcfg-$ifname" \ ; do [ -r "$_path" ] && bootproto=$(sed -n "s/BOOTPROTO='\?\([[:alpha:]]*6\?\)4\?/\1/p" "$_path") done if [ $bootproto ]; then printf 'ip=%s:%s ' ${ifname} ${bootproto} else printf 'ip=%s:static ' ${ifname} fi if [ -e /sys/class/net/$ifname/address ] ; then ifmac=$(cat /sys/class/net/$ifname/address) printf 'ifname=%s:%s ' ${ifname} ${ifmac} fi if [ -n "$iscsi_address" -a -n "$iscsi_targetname" ] ; then if [ -n "$iscsi_port" -a "$iscsi_port" -eq 3260 ] ; then iscsi_port= fi if [ -n "$iscsi_lun" -a "$iscsi_lun" -eq 0 ] ; then iscsi_lun= fi # In IPv6 case rd.iscsi.initatior= must pass address in [] brackets case "$iscsi_address" in *:*) iscsi_address="[$iscsi_address]" ;; esac # Must be two separate lines, so that "sort | uniq" commands later # can sort out rd.iscsi.initiator= duplicates echo "rd.iscsi.initiator=${iscsi_initiator}" echo "netroot=iscsi:${iscsi_address}::${iscsi_port}:${iscsi_lun}:${iscsi_targetname}" echo "rd.neednet=1" fi return 0 } install_softiscsi() { [ -d /sys/firmware/ibft ] && return 0 is_softiscsi() { local _dev=$1 local iscsi_dev [[ -L "/sys/dev/block/$_dev" ]] || return iscsi_dev=$(cd -P /sys/dev/block/$_dev; echo $PWD) install_iscsiroot $iscsi_dev } for_each_host_dev_and_slaves_all is_softiscsi || return 255 return 0 } # called by dracut depends() { echo network rootfs-block } # called by dracut installkernel() { local _arch=$(uname -m) local _funcs='iscsi_register_transport' instmods bnx2i qla4xxx cxgb3i cxgb4i be2iscsi qedi hostonly="" instmods iscsi_tcp iscsi_ibft crc32c iscsi_boot_sysfs if [ "$_arch" = "s390" -o "$_arch" = "s390x" ]; then _s390drivers="=drivers/s390/scsi" fi dracut_instmods -o -s ${_funcs} =drivers/scsi ${_s390drivers:+"$_s390drivers"} } # called by dracut cmdline() { local _iscsiconf=$(install_ibft) { if [ "$_iscsiconf" ] ; then echo ${_iscsiconf} else install_softiscsi fi } | sort | uniq } # called by dracut install() { inst_multiple -o iscsiuio inst_libdir_file 'libgcc_s.so*' inst_multiple umount iscsi-iname iscsiadm iscsid 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 inst_dir $(/usr/bin/find /etc/iscsi) else inst_simple /etc/iscsi/iscsid.conf fi # Detect iBFT and perform mandatory steps if [[ $hostonly_cmdline == "yes" ]] ; then local _iscsiconf=$(cmdline) [[ $_iscsiconf ]] && printf "%s\n" "$_iscsiconf" >> "${initdir}/etc/cmdline.d/95iscsi.conf" fi 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/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 for i in \ iscsid.service \ iscsiuio.service \ ; do systemctl -q --root "$initdir" add-wants basic.target "$i" done # Make sure iscsid is started after dracut-cmdline and ready for the initqueue mkdir -p "${initdir}/$systemdsystemunitdir/iscsid.service.d" ( echo "[Unit]" echo "After=dracut-cmdline.service" echo "Before=dracut-initqueue.service" ) > "${initdir}/$systemdsystemunitdir/iscsid.service.d/dracut.conf" # The iscsi deamon does not need to wait for any storage inside initrd 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.socket.d" ( echo "[Unit]" echo "DefaultDependencies=no" echo "Conflicts=shutdown.target" echo "Before=shutdown.target sockets.target" ) > "${initdir}/$systemdsystemunitdir/iscsiuio.socket.d/dracut.conf" fi inst_dir /var/lib/iscsi dracut_need_initqueue } modules.d/95iscsi/mount-lun.sh000075500000000514151701010110012206 0ustar00#!/bin/sh if [ -z $iscsi_lun ]; then iscsi_lun=0 fi NEWROOT=${NEWROOT:-"/sysroot"} for disk in /dev/disk/by-path/*-iscsi-*-$iscsi_lun; do if mount -t ${fstype:-auto} -o "$rflags" $disk $NEWROOT; then if [ ! -d $NEWROOT/proc ]; then umount $disk continue fi break fi done modules.d/95iscsi/parse-iscsiroot.sh000075500000013723151701010110013404 0ustar00#!/bin/sh # # Preferred format: # root=iscsi:[<servername>]:[<protocol>]:[<port>]:[<LUN>]:<targetname> # [root=*] netroot=iscsi:[<servername>]:[<protocol>]:[<port>]:[<LUN>]:<targetname> # # Legacy formats: # [net]root=[iscsi] iscsiroot=[<servername>]:[<protocol>]:[<port>]:[<LUN>]:<targetname> # [net]root=[iscsi] iscsi_firmware # # root= takes precedence over netroot= if root=iscsi[...] # # This script is sourced, so root should be set. But let's be paranoid [ -z "$root" ] && root=$(getarg root=) if [ -z "$netroot" ]; then for nroot in $(getargs netroot=); do [ "${nroot%%:*}" = "iscsi" ] && break done if [ "${nroot%%:*}" = "iscsi" ]; then netroot="$nroot" else for nroot in $(getargs netroot=); do [ "${nroot%%:*}" = "dhcp" ] && break done netroot="$nroot" fi fi [ -z "$iscsiroot" ] && iscsiroot=$(getarg iscsiroot=) [ -z "$iscsi_firmware" ] && getargbool 0 rd.iscsi.firmware -y iscsi_firmware && iscsi_firmware="1" [ -n "$iscsiroot" ] && [ -n "$iscsi_firmware" ] && die "Mixing iscsiroot and iscsi_firmware is dangerous" type write_fs_tab >/dev/null 2>&1 || . /lib/fs-lib.sh # Root takes precedence over netroot if [ "${root%%:*}" = "iscsi" ] ; then if [ -n "$netroot" ] ; then echo "Warning: root takes precedence over netroot. Ignoring netroot" fi 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 fi # If it's not empty or iscsi we don't continue for nroot in $(getargs netroot); do [ "${nroot%%:*}" = "iscsi" ] || continue netroot="$nroot" break done # Root takes precedence over netroot 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 [ -z "$netroot" ] && netroot=$root # @deprecated echo "Warning: Argument iscsiroot is deprecated and might be removed in a future" echo "release. See 'man dracut.kernel' for more information." # Accept iscsiroot argument? [ -z "$netroot" ] || [ "$netroot" = "iscsi" ] || \ die "Argument iscsiroot only accepted for empty root= or [net]root=iscsi" # Override root with iscsiroot content? [ -z "$netroot" ] || [ "$netroot" = "iscsi" ] && netroot=iscsi:$iscsiroot fi # iscsi_firmware does not need argument checking if [ -n "$iscsi_firmware" ]; then if [ "$root" != "dhcp" ] && [ "$netroot" != "dhcp" ]; then [ -z "$netroot" ] && netroot=iscsi: fi 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 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'" fi # ISCSI actually supported? if ! [ -e /sys/module/iscsi_tcp ]; then modprobe -b -q iscsi_tcp || die "iscsiroot requested but kernel/initrd does not support iscsi" fi modprobe --all -b -q qla4xxx cxgb3i cxgb4i bnx2i be2iscsi if [ -n "$netroot" ] && [ "$root" != "/dev/root" ] && [ "$root" != "dhcp" ]; then if ! getargbool 1 rd.neednet >/dev/null || ! getarg "ip="; then initqueue --unique --onetime --settled /sbin/iscsiroot dummy "'$netroot'" "'$NEWROOT'" fi fi if arg=$(getarg rd.iscsi.initiator -d iscsi_initiator=) && [ -n "$arg" ] && ! [ -f /run/initiatorname.iscsi ] ; then iscsi_initiator=$arg echo "InitiatorName=$iscsi_initiator" > /run/initiatorname.iscsi ln -fs /run/initiatorname.iscsi /dev/.initiatorname.iscsi 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 if [ -z $iscsi_initiator ] && [ -f /sys/firmware/ibft/initiator/initiator-name ] && ! [ -f /tmp/iscsi_set_initiator ]; then iscsi_initiator=$(while read line || [ -n "$line" ]; do echo $line;done < /sys/firmware/ibft/initiator/initiator-name) if [ -n "$iscsi_initiator" ]; then echo "InitiatorName=$iscsi_initiator" > /run/initiatorname.iscsi rm -f /etc/iscsi/initiatorname.iscsi 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 if [ -z "$netroot" ] || ! [ "${netroot%%:*}" = "iscsi" ]; then return 1 fi initqueue --unique --onetime --timeout /sbin/iscsiroot timeout "$netroot" "$NEWROOT" for nroot in $(getargs netroot); do [ "${nroot%%:*}" = "iscsi" ] || continue 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 done # Done, all good! rootok=1 # Shut up init error check [ -z "$root" ] && root="iscsi" modules.d/95nbd/module-setup.sh000075500000002000151701010110012314 0ustar00#!/bin/bash # called by dracut check() { local _rootdev # if an nbd device is not somewhere in the chain of devices root is # mounted on, fail the hostonly check. [[ $hostonly ]] || [[ $mount_needs ]] && { is_nbd() { [[ -b /dev/block/$1 && $1 == 43:* ]] ;} _rootdev=$(find_root_block_device) [[ -b /dev/block/$_rootdev ]] || return 1 check_block_and_slaves is_nbd "$_rootdev" || return 255 } require_binaries nbd-client || return 1 return 0 } # called by dracut depends() { # We depend on network modules being loaded echo network rootfs-block } # called by dracut installkernel() { instmods nbd } # called by dracut 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 } modules.d/95nbd/nbd-generator.sh000075500000002200151701010110012422 0ustar00#!/bin/sh type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh [ -z "$root" ] && root=$(getarg root=) [ "${root%%:*}" = "nbd" ] || exit 0 GENERATOR_DIR="$2" [ -z "$GENERATOR_DIR" ] && exit 1 [ -d "$GENERATOR_DIR" ] || mkdir "$GENERATOR_DIR" ROOTFLAGS="$(getarg rootflags)" nroot=${root#nbd:} nbdserver=${nroot%%:*}; nroot=${nroot#*:} nbdport=${nroot%%:*}; nroot=${nroot#*:} nbdfstype=${nroot%%:*}; nroot=${nroot#*:} nbdflags=${nroot%%:*} if [ "$nbdflags" = "$nbdfstype" ]; then unset nbdflags fi if [ "$nbdfstype" = "$nbdport" ]; then unset nbdfstype fi [ -n "$nbdflags" ] && ROOTFLAGS="$nbdflags" if getarg "ro"; then if [ -n "$ROOTFLAGS" ]; then ROOTFLAGS="$ROOTFLAGS,ro" else ROOTFLAGS="ro" fi fi if [ -n "$nbdfstype" ]; then ROOTFSTYPE="$nbdfstype" else ROOTFSTYPE=$(getarg rootfstype=) || unset ROOTFSTYPE fi { echo "[Unit]" echo "Before=initrd-root-fs.target" echo "[Mount]" echo "Where=/sysroot" echo "What=/dev/root" [ -n "$ROOTFSTYPE" ] && echo "Type=${ROOTFSTYPE}" [ -n "$ROOTFLAGS" ] && echo "Options=${ROOTFLAGS}" } > "$GENERATOR_DIR"/sysroot.mount exit 0 modules.d/95nbd/nbdroot.sh000075500000007264151701010110011361 0ustar00#!/bin/sh type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh PATH=/usr/sbin:/usr/bin:/sbin:/bin # Huh? Empty $1? [ -z "$1" ] && exit 1 # Huh? Empty $2? [ -z "$2" ] && exit 1 # Huh? Empty $3? [ -z "$3" ] && exit 1 # root is in the form root=nbd:srv:port[:fstype[:rootflags[:nbdopts]]] netif="$1" nroot="$2" NEWROOT="$3" # If it's not nbd we don't continue [ "${nroot%%:*}" = "nbd" ] || return nroot=${nroot#nbd:} nbdserver=${nroot%%:*}; nroot=${nroot#*:} nbdport=${nroot%%:*}; nroot=${nroot#*:} nbdfstype=${nroot%%:*}; nroot=${nroot#*:} nbdflags=${nroot%%:*} nbdopts=${nroot#*:} if [ "$nbdopts" = "$nbdflags" ]; then unset nbdopts fi if [ "$nbdflags" = "$nbdfstype" ]; then unset nbdflags fi if [ "$nbdfstype" = "$nbdport" ]; then unset nbdfstype fi if [ -z "$nbdfstype" ]; then nbdfstype=auto fi # look through the NBD options and pull out the ones that need to # go before the host etc. Append a ',' so we know we terminate the loop nbdopts=${nbdopts}, while [ -n "$nbdopts" ]; do f=${nbdopts%%,*} nbdopts=${nbdopts#*,} if [ -z "$f" ]; then break fi if [ -z "${f%bs=*}" -o -z "${f%timeout=*}" ]; then preopts="$preopts $f" continue fi opts="$opts $f" done # look through the flags and see if any are overridden by the command line nbdflags=${nbdflags}, while [ -n "$nbdflags" ]; do f=${nbdflags%%,*} nbdflags=${nbdflags#*,} if [ -z "$f" ]; then break fi if [ "$f" = "ro" -o "$f" = "rw" ]; then nbdrw=$f continue fi fsopts=${fsopts:+$fsopts,}$f done getarg ro && nbdrw=ro getarg rw && nbdrw=rw fsopts=${fsopts:+$fsopts,}${nbdrw} # XXX better way to wait for the device to be made? i=0 while [ ! -b /dev/nbd0 ]; do [ $i -ge 20 ] && exit 1 if [ $UDEVVERSION -ge 143 ]; then udevadm settle --exit-if-exists=/dev/nbd0 else sleep 0.1 fi i=$(($i + 1)) done # If we didn't get a root= on the command line, then we need to # add the udev rules for mounting the nbd0 device if [ "$root" = "block:/dev/root" -o "$root" = "dhcp" ]; then printf 'KERNEL=="nbd0", ENV{DEVTYPE}!="partition", ENV{ID_FS_TYPE}=="?*", SYMLINK+="root"\n' >> /etc/udev/rules.d/99-nbd-root.rules udevadm control --reload type write_fs_tab >/dev/null 2>&1 || . /lib/fs-lib.sh write_fs_tab /dev/root "$nbdfstype" "$fsopts" wait_for_dev -n /dev/root if [ -z "$DRACUT_SYSTEMD" ]; then printf '/bin/mount %s\n' \ "$NEWROOT" \ > $hookdir/mount/01-$$-nbd.sh fi fi if strstr "$(nbd-client --help 2>&1)" "systemd-mark"; then preopts="--systemd-mark $preopts" fi if [ "$nbdport" -gt 0 ] 2>/dev/null; then if [ -z "$DRACUT_SYSTEMD" ]; then nbd-client "$nbdserver" $nbdport /dev/nbd0 $preopts $opts || exit 1 else systemd-run --no-block --service-type=forking --quiet \ --description="nbd nbd0" \ -p 'DefaultDependencies=no' \ -p 'KillMode=none' \ --unit="nbd0" -- nbd-client "$nbdserver" $nbdport /dev/nbd0 $preopts $opts >/dev/null 2>&1 || exit 1 fi else if [ -z "$DRACUT_SYSTEMD" ]; then nbd-client -name "$nbdport" "$nbdserver" /dev/nbd0 $preopts $opts || exit 1 else systemd-run --no-block --service-type=forking --quiet \ --description="nbd nbd0" \ -p 'DefaultDependencies=no' \ -p 'KillMode=none' \ --unit="nbd0" -- nbd-client -name "$nbdport" "$nbdserver" /dev/nbd0 $preopts $opts >/dev/null 2>&1 || exit 1 fi fi # NBD doesn't emit uevents when it gets connected, so kick it echo change > /sys/block/nbd0/uevent udevadm settle need_shutdown exit 0 modules.d/95nbd/parse-nbdroot.sh000075500000003334151701010110012463 0ustar00#!/bin/sh # # Preferred format: # root=nbd:srv:port/exportname[:fstype[:rootflags[:nbdopts]]] # [root=*] netroot=nbd:srv:port/exportname[:fstype[:rootflags[:nbdopts]]] # # nbdopts is a comma separated list of options to give to nbd-client # # root= takes precedence over netroot= if root=nbd[...] # # Sadly there's no easy way to split ':' separated lines into variables netroot_to_var() { local v=${1}: set -- while [ -n "$v" ]; do set -- "$@" "${v%%:*}" v=${v#*:} done unset server port server=$2; port=$3; } # This script is sourced, so root should be set. But let's be paranoid [ -z "$root" ] && root=$(getarg root=) if [ -z "$netroot" ]; then for netroot in $(getargs netroot=); do [ "${netroot%%:*}" = "nbd" ] && break done [ "${netroot%%:*}" = "nbd" ] || unset netroot fi # Root takes precedence over netroot if [ "${root%%:*}" = "nbd" ] ; then if [ -n "$netroot" ] ; then warn "root takes precedence over netroot. Ignoring netroot" fi netroot=$root unset root fi # If it's not nbd we don't continue [ "${netroot%%:*}" = "nbd" ] || return if [ -n "${DRACUT_SYSTEMD}" ] && [ "$root" = "dhcp" ]; then echo "root=$netroot" > /etc/cmdline.d/root.conf systemctl --no-block daemon-reload fi # Check required arguments netroot_to_var $netroot [ -z "$server" ] && die "Argument server for nbdroot is missing" [ -z "$port" ] && die "Argument port for nbdroot is missing" # NBD actually supported? incol2 /proc/devices nbd || modprobe nbd || die "nbdroot requested but kernel/initrd does not support nbd" # Done, all good! rootok=1 # Shut up init error check if [ -z "$root" ]; then root=block:/dev/root wait_for_dev -n /dev/root fi modules.d/95nfs/module-setup.sh000075500000010454151701010110012353 0ustar00#!/bin/bash # called by dracut check() { # If our prerequisites are not met, fail anyways. require_any_binary rpcbind portmap || return 1 require_binaries rpc.statd mount.nfs mount.nfs4 umount || return 1 [[ $hostonly ]] || [[ $mount_needs ]] && { for fs in "${host_fs_types[@]}"; do [[ "$fs" == "nfs" ]] && return 0 [[ "$fs" == "nfs3" ]] && return 0 [[ "$fs" == "nfs4" ]] && return 0 done return 255 } return 0 } # called by dracut depends() { # We depend on network modules being loaded echo network } # called by dracut installkernel() { hostonly='' instmods =net/sunrpc =fs/nfs ipv6 nfs_acl nfs_layout_nfsv41_files } cmdline() { local nfs_device local nfs_options local nfs_root local nfs_address local lookup local ifname ### nfsroot= ### nfs_device=$(findmnt -t nfs4 -n -o SOURCE /) if [ -n "$nfs_device" ];then nfs_root="root=nfs4:$nfs_device" else nfs_device=$(findmnt -t nfs -n -o SOURCE /) [ -z "$nfs_device" ] && return nfs_root="root=nfs:$nfs_device" fi nfs_options=$(findmnt -t nfs4,nfs -n -o OPTIONS /) [ -n "$nfs_options" ] && nfs_root="$nfs_root:$nfs_options" echo "$nfs_root" ### ip= ### if [[ $nfs_device = [0-9]*\.[0-9]*\.[0-9]*.[0-9]* ]] || [[ $nfs_device = \[.*\] ]]; then nfs_address="${nfs_device%%:*}" else lookup=$(host "${nfs_device%%:*}"| grep " address " | head -n1) nfs_address=${lookup##* } fi ifname=$(ip -o route get to $nfs_address | sed -n 's/.*dev \([^ ]*\).*/\1/p') if [ -d /sys/class/net/$ifname/bonding ]; then dinfo "Found bonded interface '${ifname}'. Make sure to provide an appropriate 'bond=' cmdline." return elif [ -e /sys/class/net/$ifname/address ] ; then ifmac=$(cat /sys/class/net/$ifname/address) printf 'ifname=%s:%s ' ${ifname} ${ifmac} fi printf 'ip=%s:static\n' ${ifname} } # called by dracut install() { local _i local _nsslibs inst_multiple -o portmap rpcbind rpc.statd mount.nfs \ mount.nfs4 umount rpc.idmapd sed /etc/netconfig chmod "$tmpfilesdir/rpcbind.conf" inst_multiple /etc/services /etc/nsswitch.conf /etc/rpc /etc/protocols /etc/idmapd.conf if [[ $hostonly_cmdline == "yes" ]]; then local _netconf="$(cmdline)" [[ $_netconf ]] && printf "%s\n" "$_netconf" >> "${initdir}/etc/cmdline.d/95nfs.conf" fi if [ -f /lib/modprobe.d/nfs.conf ]; then inst_multiple /lib/modprobe.d/nfs.conf else [ -d $initdir/etc/modprobe.d/ ] || mkdir $initdir/etc/modprobe.d echo "alias nfs4 nfs" > $initdir/etc/modprobe.d/nfs.conf fi inst_libdir_file 'libnfsidmap_nsswitch.so*' 'libnfsidmap/*.so' 'libnfsidmap*.so*' _nsslibs=$(sed -e '/^#/d' -e 's/^.*://' -e 's/\[NOTFOUND=return\]//' /etc/nsswitch.conf \ | tr -s '[:space:]' '\n' | sort -u | tr -s '[:space:]' '|') _nsslibs=${_nsslibs#|} _nsslibs=${_nsslibs%|} inst_libdir_file -n "$_nsslibs" 'libnss_*.so*' inst_hook cmdline 90 "$moddir/parse-nfsroot.sh" inst_hook pre-udev 99 "$moddir/nfs-start-rpc.sh" inst_hook cleanup 99 "$moddir/nfsroot-cleanup.sh" inst "$moddir/nfsroot.sh" "/sbin/nfsroot" inst "$moddir/nfs-lib.sh" "/lib/nfs-lib.sh" mkdir -m 0755 -p "$initdir/var/lib/nfs/rpc_pipefs" mkdir -m 0770 -p "$initdir/var/lib/rpcbind" [ -d "$dracutsysrootdir/var/lib/nfs/statd/sm" ] && \ mkdir -m 0700 -p "$initdir/var/lib/nfs/statd" && \ mkdir -m 0755 -p "$initdir/var/lib/nfs/statd/sm" && \ chown -R rpcuser:rpcuser "$initdir/var/lib/nfs/statd" [ -d "$dracutsysrootdir/var/lib/nfs/sm" ] && \ mkdir -m 0755 -p "$initdir/var/lib/nfs/sm" && chown -R rpcuser:rpcuser "$initdir/var/lib/nfs/sm" # Rather than copy the passwd file in, just set a user for rpcbind # We'll save the state and restart the daemon from the root anyway grep -E '^nfsnobody:|^rpc:|^rpcuser:' /etc/passwd >> "$initdir/etc/passwd" grep -E '^nogroup:|^rpc:|^nobody:' /etc/group >> "$initdir/etc/group" # rpc user needs to be able to write to this directory to save the warmstart # file chmod 770 "$initdir/var/lib/rpcbind" grep -q '^rpc:' /etc/passwd \ && grep -q '^rpc:' /etc/group dracut_need_initqueue } modules.d/95nfs/nfs-lib.sh000075500000011044151701010110011256 0ustar00#!/bin/sh type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh . /lib/net-lib.sh # TODO: make these things not pollute the calling namespace # nfs_to_var NFSROOT [NETIF] # use NFSROOT to set $nfs, $server, $path, and $options. # NFSROOT is something like: nfs[4]:<server>:/<path>[:<options>|,<options>] # NETIF is used to get information from DHCP options, if needed. nfs_to_var() { # Unfortunately, there's multiple styles of nfs "URL" in use, so we need # extra functions to parse them into $nfs, $server, $path, and $options. # FIXME: local netif=${2:-$netif}? case "$1" in nfs://*) rfc2224_nfs_to_var "$1" ;; nfs:*[*) anaconda_nfsv6_to_var "$1" ;; nfs:*:*:/*) anaconda_nfs_to_var "$1" ;; *) nfsroot_to_var "$1" ;; esac # if anything's missing, try to fill it in from DHCP options if [ -z "$server" ] || [ -z "$path" ]; then nfsroot_from_dhcp $2; fi # if there's a "%s" in the path, replace it with the hostname/IP if strstr "$path" "%s"; then local node="" read node < /proc/sys/kernel/hostname [ "$node" = "(none)" ] && node=$(get_ip $2) path=${path%%%s*}$node${path#*%s} # replace only the first %s fi } # root=nfs:[<server-ip>:]<root-dir>[:<nfs-options>] # root=nfs4:[<server-ip>:]<root-dir>[:<nfs-options>] nfsroot_to_var() { # strip nfs[4]: local arg="$@:" nfs="${arg%%:*}" arg="${arg##$nfs:}" # check if we have a server if strstr "$arg" ':/' ; then server="${arg%%:/*}" arg="/${arg##*:/}" fi path="${arg%%:*}" # rest are options options="${arg##$path}" # strip leading ":" options="${options##:}" # strip ":" options="${options%%:}" # Does it really start with '/'? [ -n "${path%%/*}" ] && path="error"; #Fix kernel legacy style separating path and options with ',' if [ "$path" != "${path#*,}" ] ; then options=${path#*,} path=${path%%,*} fi } # RFC2224: nfs://<server>[:<port>]/<path> rfc2224_nfs_to_var() { nfs="nfs" server="${1#nfs://}" path="/${server#*/}" server="${server%%/*}" server="${server%%:}" # anaconda compat (nfs://<server>:/<path>) local port="${server##*:}" [ "$port" != "$server" ] && options="port=$port" } # Anaconda-style path with options: nfs:<options>:<server>:/<path> # (without mount options, anaconda is the same as dracut) anaconda_nfs_to_var() { nfs="nfs" options="${1#nfs:}" server="${options#*:}" server="${server%:/*}" options="${options%%:*}" path="/${1##*:/}" } # IPv6 nfs path will be treated separately anaconda_nfsv6_to_var() { nfs="nfs" path="$1" options="${path#*:/}" path="/${options%%:*}" server="${1#*nfs:}" if str_starts $server '['; then server="${server%:/*}" options="${options#*:*}" else server="${server%:/*}" options="${server%%:*}" server="${server#*:}" fi } # nfsroot_from_dhcp NETIF # fill in missing server/path from DHCP options. nfsroot_from_dhcp() { local f for f in /tmp/net.$1.override /tmp/dhclient.$1.dhcpopts; do [ -f $f ] && . $f done [ -n "$new_root_path" ] && nfsroot_to_var "$nfs:$new_root_path" [ -z "$path" ] && [ "$(getarg root=)" = "/dev/nfs" ] && path=/tftpboot/%s [ -z "$server" ] && server=$srv [ -z "$server" ] && server=$new_next_server [ -z "$server" ] && server=$new_dhcp_server_identifier [ -z "$server" ] && server=${new_root_path%%:*} } # Look through $options, fix "rw"/"ro", move "lock"/"nolock" to $nfslock munge_nfs_options() { local f="" flags="" nfsrw="ro" OLDIFS="$IFS" IFS=, for f in $options; do case $f in ro|rw) nfsrw=$f ;; lock|nolock) nfslock=$f ;; *) flags=${flags:+$flags,}$f ;; esac done IFS="$OLDIFS" # Override rw/ro if set on cmdline getarg ro >/dev/null && nfsrw=ro getarg rw >/dev/null && nfsrw=rw options=$nfsrw${flags:+,$flags} } # mount_nfs NFSROOT MNTDIR [NETIF] mount_nfs() { local nfsroot="$1" mntdir="$2" netif="$3" local nfs="" server="" path="" options="" nfs_to_var "$nfsroot" $netif munge_nfs_options if [ "$nfs" = "nfs4" ]; then options=$options${nfslock:+,$nfslock} else # NFSv{2,3} doesn't support using locks as it requires a helper to # transfer the rpcbind state to the new root [ "$nfslock" = "lock" ] \ && warn "Locks unsupported on NFSv{2,3}, using nolock" 1>&2 options=$options,nolock fi mount -t $nfs -o$options "$server:$path" "$mntdir" } modules.d/95nfs/nfs-start-rpc.sh000075500000001546151701010110012435 0ustar00#!/bin/sh if modprobe sunrpc || strstr "$(cat /proc/filesystems)" rpc_pipefs; then [ ! -d /var/lib/nfs/rpc_pipefs/nfs ] && \ mount -t rpc_pipefs rpc_pipefs /var/lib/nfs/rpc_pipefs # Start rpcbind or rpcbind # FIXME occasionally saw 'rpcbind: fork failed: No such device' -- why? command -v portmap >/dev/null && [ -z "$(pidof portmap)" ] && portmap if command -v rpcbind >/dev/null && [ -z "$(pidof rpcbind)" ]; then mkdir -p /run/rpcbind rpcbind fi # Start rpc.statd as mount won't let us use locks on a NFSv4 # filesystem without talking to it. NFSv4 does locks internally, # rpc.lockd isn't needed [ -z "$(pidof rpc.statd)" ] && rpc.statd [ -z "$(pidof rpc.idmapd)" ] && rpc.idmapd else warn 'Kernel module "sunrpc" not in the initramfs, or support for filesystem "rpc_pipefs" missing!' fi modules.d/95nfs/nfsroot-cleanup.sh000075500000001515151701010110013045 0ustar00#!/bin/sh type incol2 >/dev/null 2>&1 || . /lib/dracut-lib.sh [ -f /tmp/nfs.rpc_pipefs_path ] && rpcpipefspath=`cat /tmp/nfs.rpc_pipefs_path` [ -z "$rpcpipefspath" ] && rpcpipefspath=var/lib/nfs/rpc_pipefs pid=$(pidof rpc.statd) [ -n "$pid" ] && kill $pid pid=$(pidof rpc.idmapd) [ -n "$pid" ] && kill $pid pid=$(pidof rpcbind) [ -n "$pid" ] && kill $pid if incol2 /proc/mounts /var/lib/nfs/rpc_pipefs; then # try to create the destination directory [ -d $NEWROOT/$rpcpipefspath ] || \ mkdir -m 0755 -p $NEWROOT/$rpcpipefspath 2>/dev/null if [ -d $NEWROOT/$rpcpipefspath ]; then # mount --move does not seem to work??? mount --bind /var/lib/nfs/rpc_pipefs $NEWROOT/$rpcpipefspath umount /var/lib/nfs/rpc_pipefs 2>/dev/null else umount /var/lib/nfs/rpc_pipefs 2>/dev/null fi fi modules.d/95nfs/nfsroot.sh000075500000001313151701010110011414 0ustar00#!/bin/sh type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh . /lib/nfs-lib.sh [ "$#" = 3 ] || exit 1 # root is in the form root=nfs[4]:[server:]path[:options], either from # cmdline or dhcp root-path netif="$1" root="$2" NEWROOT="$3" nfs_to_var $root $netif [ -z "$server" ] && die "Required parameter 'server' is missing" mount_nfs $root $NEWROOT $netif && { [ -e /dev/root ] || ln -s null /dev/root ; [ -e /dev/nfs ] || ln -s null /dev/nfs; } [ -f $NEWROOT/etc/fstab ] && cat $NEWROOT/etc/fstab > /dev/null # inject new exit_if_exists echo 'settle_exit_if_exists="--exit-if-exists=/dev/root"; rm -- "$job"' > $hookdir/initqueue/nfs.sh # force udevsettle to break > $hookdir/initqueue/work need_shutdown modules.d/95nfs/parse-nfsroot.sh000075500000006405151701010110012533 0ustar00#!/bin/sh # # Preferred format: # root=nfs[4]:[server:]path[:options] # # This syntax can come from DHCP root-path as well. # # Legacy format: # root=/dev/nfs nfsroot=[server:]path[,options] # # In Legacy root=/dev/nfs mode, if the 'nfsroot' parameter is not given # on the command line or is empty, the dhcp root-path is used as # [server:]path[:options] or the default "/tftpboot/%s" will be used. # # If server is unspecified it will be pulled from one of the following # sources, in order: # static ip= option on kernel command line # DHCP next-server option # DHCP server-id option # DHCP root-path option # # NFSv4 is only used if explicitly requested with nfs4: prefix, otherwise # NFSv3 is used. # type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh # This script is sourced, so root should be set. But let's be paranoid [ -z "$root" ] && root=$(getarg root=) [ -z "$nfsroot" ] && nfsroot=$(getarg nfsroot=) [ -n "$netroot" ] && oldnetroot="$netroot" # netroot= cmdline argument must be ignored, but must be used if # we're inside netroot to parse dhcp root-path if [ -n "$netroot" ] ; then for n in $(getargs netroot=); do [ "$n" = "$netroot" ] && break done if [ "$n" = "$netroot" ]; then #warn "Ignoring netroot argument for NFS" netroot=$root fi else netroot=$root; fi # LEGACY: nfsroot= is valid only if root=/dev/nfs if [ -n "$nfsroot" ] ; then # @deprecated warn "Argument nfsroot is deprecated and might be removed in a future release. See 'man dracut.kernel' for more information." if [ "$(getarg root=)" != "/dev/nfs" ]; then die "Argument nfsroot only accepted for legacy root=/dev/nfs" fi netroot=nfs:$nfsroot; fi case "$netroot" in /dev/nfs) netroot=nfs;; /dev/*) if [ -n "$oldnetroot" ]; then netroot="$oldnetroot" else unset netroot fi return ;; # LEGACY: root=<server-ip>:/<path [0-9]*:/*|[0-9]*\.[0-9]*\.[0-9]*[!:]|/*) netroot=nfs:$netroot;; esac # Continue if nfs case "${netroot%%:*}" in nfs|nfs4|/dev/nfs);; *) if [ -n "$oldnetroot" ]; then netroot="$oldnetroot" else unset netroot fi return ;; esac # Check required arguments if nfsdomain=$(getarg rd.nfs.domain -d rd_NFS_DOMAIN); then if [ -f /etc/idmapd.conf ]; then sed -i -e \ "s/^[[:space:]#]*Domain[[:space:]]*=.*/Domain = $nfsdomain/g" \ /etc/idmapd.conf fi # and even again after the sed, in case it was not yet specified echo "Domain = $nfsdomain" >> /etc/idmapd.conf fi nfsroot_to_var $netroot [ "$path" = "error" ] && die "Argument nfsroot must contain a valid path!" # Set fstype, might help somewhere fstype=${nfs#/dev/} # Rewrite root so we don't have to parse this uglyness later on again netroot="$fstype:$server:$path:$options" # If we don't have a server, we need dhcp if [ -z "$server" ] ; then DHCPORSERVER="1" fi; # Done, all good! rootok=1 # Shut up init error check or make sure that block parser wont get # confused by having /dev/nfs[4] root="$fstype" echo '[ -e $NEWROOT/proc ]' > $hookdir/initqueue/finished/nfsroot.sh mkdir -p /var/lib/rpcbind chown rpc:rpc /var/lib/rpcbind chmod 770 /var/lib/rpcbind modules.d/95ssh-client/module-setup.sh000075500000004023151701010110013631 0ustar00#!/bin/bash # fixme: assume user is root # called by dracut check() { [[ $mount_needs ]] && return 1 # If our prerequisites are not met, fail. require_binaries ssh scp || return 1 if [[ $sshkey ]]; then [ ! -f $sshkey ] && { derror "ssh key: $sshkey is not found!" return 1 } fi return 255 } # called by dracut depends() { # We depend on network modules being loaded echo network } inst_sshenv() { if [ -d /root/.ssh ]; then inst_dir /root/.ssh chmod 700 ${initdir}/root/.ssh fi # Copy over ssh key and knowhosts if needed [[ $sshkey ]] && { inst_simple $sshkey [[ -f /root/.ssh/known_hosts ]] && inst_simple /root/.ssh/known_hosts [[ -f /etc/ssh/ssh_known_hosts ]] && inst_simple /etc/ssh/ssh_known_hosts } # Copy over root and system-wide ssh configs. [[ -f /root/.ssh/config ]] && inst_simple /root/.ssh/config if [[ -f /etc/ssh/ssh_config ]]; then inst_simple /etc/ssh/ssh_config sed -i -e 's/\(^[[:space:]]*\)ProxyCommand/\1# ProxyCommand/' ${initdir}/etc/ssh/ssh_config while read key val || [ -n "$key" ]; do if [[ $key == "GlobalKnownHostsFile" ]]; then inst_simple "$val" # Copy customized UserKnowHostsFile elif [[ $key == "UserKnownHostsFile" ]]; then # Make sure that ~/foo will be copied as /root/foo in kdump's initramfs if str_starts "$val" "~/"; then val="/root/${val#"~/"}" fi inst_simple "$val" fi done < /etc/ssh/ssh_config fi return 0 } # called by dracut install() { local _nsslibs inst_multiple ssh scp inst_sshenv _nsslibs=$(sed -e '/^#/d' -e 's/^.*://' -e 's/\[NOTFOUND=return\]//' /etc/nsswitch.conf \ | tr -s '[:space:]' '\n' | sort -u | tr -s '[:space:]' '|') _nsslibs=${_nsslibs#|} _nsslibs=${_nsslibs%|} inst_libdir_file -n "$_nsslibs" 'libnss_*.so*' } modules.d/99uefi-lib/module-setup.sh000075500000000324151701010110013260 0ustar00#!/bin/bash # called by dracut check() { return 255 } # called by dracut depends() { echo bash return 0 } # called by dracut install() { inst_simple "$moddir/uefi-lib.sh" "/lib/uefi-lib.sh" } modules.d/99uefi-lib/uefi-lib.sh000075500000011205151701010110012331 0ustar00#!/bin/bash # # Copyright 2013 Red Hat, Inc. All rights reserved. # Copyright 2013 Harald Hoyer <harald@redhat.com> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. # getbyte () { local IFS= LC_CTYPE=C res c read -r -n 1 -d '' c res=$? # the single quote in the argument of the printf # yields the numeric value of $c (ASCII since LC_CTYPE=C) [[ -n $c ]] && c=$(printf '%u' "'$c") || c=0 printf "$c" return $res } getword () { local b1 b2 val b1=$(getbyte) || return 1 b2=$(getbyte) || return 1 (( val = b2 * 256 + b1 )) echo $val return 0 } # Acpi(PNP0A08,0x0)/Pci(0x3,0x0)/Pci(0x0,0x0)/MAC(90E2BA265ED4,0x0)/Vlan(172)/Fibre(0x4EA06104A0CC0050,0x0) uefi_device_path() { local IFS= LC_CTYPE=C res tt len type hextype first first=1 while :; do type=$(getbyte) || return 1 subtype=$(getbyte) || return 1 len=$(getword) || return 1 hextype=$(printf "%02x%02x" "$type" "$subtype") if [[ $first == 1 ]]; then first=0 elif [[ $hextype != "7fff" ]]; then printf "/" fi case $hextype in 0101) # PCI tt=$(getword) printf "PCI(0x%x,0x%x)" $(($tt / 256)) $(($tt & 255)) ;; 0201) # ACPI printf "Acpi(0x%x,0x%x)" $(($(getword) + $(getword) * 65536)) $(($(getword) + $(getword) * 65536)) ;; 0303) # FIBRE getword &>/dev/null getword &>/dev/null printf "Fibre(0x%x%x%x%x%x%x%x%x,0x%x)" \ $(getbyte) $(getbyte) $(getbyte) $(getbyte) \ $(getbyte) $(getbyte) $(getbyte) $(getbyte) \ $(( $(getword) + $(getword) * 65536 + 4294967296 * ( $(getword) + $(getword) * 65536 ) )) ;; 030b) # MAC printf "MAC(%02x%02x%02x%02x%02x%02x," $(getbyte) $(getbyte) $(getbyte) $(getbyte) $(getbyte) $(getbyte) read -r -N 26 tt || return 1 printf "0x%x)" $(getbyte) ;; 0314) # VLAN printf "VLAN(%d)" $(getword) ;; 7fff) # END printf "\n" return 0 ;; *) printf "Unknown(Type:%d SubType:%d len=%d)" "$type" "$subtype" "$len" read -r -N $(($len-4)) tt || return 1 ;; esac done } get_fcoe_boot_mac() { data=${1:-/sys/firmware/efi/vars/FcoeBootDevice-a0ebca23-5f9c-447a-a268-22b6c158c2ac/data} [ -f $data ] || return 1 local IFS= LC_CTYPE=C tt len type hextype first=1 while :; do type=$(getbyte) || return 1 subtype=$(getbyte) || return 1 len=$(getword) || return 1 hextype=$(printf "%02x%02x" "$type" "$subtype") case $hextype in 030b) # MAC printf "%02x:%02x:%02x:%02x:%02x:%02x" $(getbyte) $(getbyte) $(getbyte) $(getbyte) $(getbyte) $(getbyte) read -r -N 27 tt || return 1 ;; 7fff) # END return 0 ;; *) read -r -N $(($len-4)) tt || return 1 ;; esac done < $data } get_fcoe_boot_vlan() { data=${1:-/sys/firmware/efi/vars/FcoeBootDevice-a0ebca23-5f9c-447a-a268-22b6c158c2ac/data} [ -f $data ] || return 1 local IFS= LC_CTYPE=C tt len type hextype first=1 while :; do type=$(getbyte) || return 1 subtype=$(getbyte) || return 1 len=$(getword) || return 1 hextype=$(printf "%02x%02x" "$type" "$subtype") case $hextype in 0314) # VLAN printf "%d" $(getword) ;; 7fff) # END return 0 ;; *) read -r -N $(($len-4)) tt || return 1 ;; esac done < $data } modules.d/99squash/.shchkdir000064400000000000151701010110011675 0ustar00modules.d/99squash/init-squash.sh000075500000002176151701010110012721 0ustar00#!/bin/sh PATH=/bin:/sbin [ -e /proc/self/mounts ] \ || (mkdir -p /proc && mount -t proc -o nosuid,noexec,nodev proc /proc) grep -q '^sysfs /sys sysfs' /proc/self/mounts \ || (mkdir -p /sys && mount -t sysfs -o nosuid,noexec,nodev sysfs /sys) grep -q '^devtmpfs /dev devtmpfs' /proc/self/mounts \ || (mkdir -p /dev && mount -t devtmpfs -o mode=755,noexec,nosuid,strictatime devtmpfs /dev) grep -q '^tmpfs /run tmpfs' /proc/self/mounts \ || (mkdir -p /run && mount -t tmpfs -o mode=755,noexec,nosuid,strictatime tmpfs /run) # Load required modules modprobe loop modprobe squashfs modprobe overlay # Mount the squash image mount -t ramfs ramfs /squash mkdir -p /squash/root /squash/overlay/upper /squash/overlay/work mount -t squashfs -o ro,loop /squash-root.img /squash/root # Setup new root overlay mkdir /newroot mount -t overlay overlay -o lowerdir=/squash/root,upperdir=/squash/overlay/upper,workdir=/squash/overlay/work/ /newroot/ # Move all mount points to new root to prepare chroot mount --move /squash /newroot/squash # Jump to new root and clean setup files SYSTEMD_IN_INITRD=lenient exec switch_root /newroot /init modules.d/99squash/module-setup.sh000064400000004114151701010110013066 0ustar00#!/bin/bash check() { require_binaries mksquashfs unsquashfs || return 1 for i in CONFIG_SQUASHFS CONFIG_BLK_DEV_LOOP CONFIG_OVERLAY_FS ; do if ! check_kernel_config $i; then dinfo "dracut-squash module requires kernel configuration $i (y or m)" return 1 fi done return 255 } depends() { echo "systemd-initrd" return 0 } installpost() { local _busybox _busybox=$(find_binary busybox) # Move everything under $initdir except $squash_dir # itself into squash image for i in "$initdir"/*; do [[ "$squash_dir" == "$i"/* ]] || mv "$i" "$squash_dir"/ done # Create mount points for squash loader mkdir -p "$initdir"/squash/ mkdir -p "$squash_dir"/squash/ # Copy dracut spec files out side of the squash image # so dracut rebuild and lsinitrd can work mkdir -p "$initdir/usr/lib/dracut/" for file in "$squash_dir"/usr/lib/dracut/*; do [[ -f $file ]] || continue cp "$file" "$initdir/${file#$squash_dir}" done # Install required modules and binaries for the squash image init script. if [[ $_busybox ]]; then inst "$_busybox" /usr/bin/busybox for _i in sh echo mount modprobe mkdir switch_root grep umount; do ln_r /usr/bin/busybox /usr/bin/$_i done else DRACUT_RESOLVE_DEPS=1 inst_multiple sh mount modprobe mkdir switch_root grep umount # libpthread workaround: pthread_cancel wants to dlopen libgcc_s.so inst_libdir_file -o "libgcc_s.so*" # FIPS workaround for Fedora/RHEL: libcrypto needs libssl when FIPS is enabled [[ $DRACUT_FIPS_MODE ]] && inst_libdir_file -o "libssl.so*" fi hostonly="" instmods "loop" "squashfs" "overlay" dracut_kernel_post # Install squash image init script. ln_r /usr/bin /bin ln_r /usr/sbin /sbin inst_simple "$moddir"/init-squash.sh /init # make sure that library links are correct and up to date for squash loader build_ld_cache } install() { if [[ $DRACUT_SQUASH_POST_INST ]]; then installpost fi } modules.d/99earlykdump/early-kdump.sh000075500000003572151701010110013560 0ustar00#! /bin/sh KEXEC=/sbin/kexec standard_kexec_args="-p" EARLY_KDUMP_INITRD="" EARLY_KDUMP_KERNEL="" EARLY_KDUMP_CMDLINE="" EARLY_KDUMP_KERNELVER="" EARLY_KEXEC_ARGS="" . /etc/sysconfig/kdump . /lib/dracut-lib.sh . /lib/kdump-lib.sh . /lib/kdump-logger.sh #initiate the kdump logger dlog_init if [ $? -ne 0 ]; then echo "failed to initiate the kdump logger." exit 1 fi prepare_parameters() { EARLY_KDUMP_CMDLINE=$(prepare_cmdline "${KDUMP_COMMANDLINE}" "${KDUMP_COMMANDLINE_REMOVE}" "${KDUMP_COMMANDLINE_APPEND}") EARLY_KDUMP_KERNEL="/boot/kernel-earlykdump" EARLY_KDUMP_INITRD="/boot/initramfs-earlykdump" } early_kdump_load() { check_kdump_feasibility if [ $? -ne 0 ]; then return 1 fi if is_fadump_capable; then dwarn "WARNING: early kdump doesn't support fadump." return 1 fi check_current_kdump_status if [ $? == 0 ]; then return 1 fi prepare_parameters EARLY_KEXEC_ARGS=$(prepare_kexec_args "${KEXEC_ARGS}") # Here, only output the messages, but do not save these messages # to a file because the target disk may not be mounted yet, the # earlykdump is too early. ddebug "earlykdump: $KEXEC ${EARLY_KEXEC_ARGS} $standard_kexec_args \ --command-line=$EARLY_KDUMP_CMDLINE --initrd=$EARLY_KDUMP_INITRD \ $EARLY_KDUMP_KERNEL" $KEXEC ${EARLY_KEXEC_ARGS} $standard_kexec_args \ --command-line="$EARLY_KDUMP_CMDLINE" \ --initrd=$EARLY_KDUMP_INITRD $EARLY_KDUMP_KERNEL if [ $? == 0 ]; then dinfo "kexec: loaded early-kdump kernel" return 0 else derror "kexec: failed to load early-kdump kernel" return 1 fi } set_early_kdump() { if getargbool 0 rd.earlykdump; then dinfo "early-kdump is enabled." early_kdump_load else dinfo "early-kdump is disabled." fi return 0 } set_early_kdump modules.d/99earlykdump/module-setup.sh000075500000003310151701010110013737 0ustar00#!/bin/bash . /etc/sysconfig/kdump KDUMP_KERNEL="" KDUMP_INITRD="" check() { if [ ! -f /etc/sysconfig/kdump ] || [ ! -f /lib/kdump/kdump-lib.sh ]\ || [ -n "${IN_KDUMP}" ] then return 1 fi return 255 } depends() { echo "base shutdown" return 0 } prepare_kernel_initrd() { . /lib/kdump/kdump-lib.sh prepare_kdump_bootinfo # $kernel is a variable from dracut if [ "$KDUMP_KERNELVER" != $kernel ]; then dwarn "Using kernel version '$KDUMP_KERNELVER' for early kdump," \ "but the initramfs is generated for kernel version '$kernel'" fi } install() { prepare_kernel_initrd if [ ! -f "$KDUMP_KERNEL" ]; then derror "Could not find required kernel for earlykdump," \ "earlykdump will not work!" return 1 fi if [ ! -f "$KDUMP_INITRD" ]; then derror "Could not find required kdump initramfs for earlykdump," \ "please ensure kdump initramfs is generated first," \ "earlykdump will not work!" return 1 fi inst_multiple tail find cut dirname hexdump inst_simple "/etc/sysconfig/kdump" inst_binary "/usr/sbin/kexec" inst_binary "/usr/bin/gawk" "/usr/bin/awk" inst_binary "/usr/bin/logger" "/usr/bin/logger" inst_binary "/usr/bin/printf" "/usr/bin/printf" inst_script "/lib/kdump/kdump-lib.sh" "/lib/kdump-lib.sh" inst_script "/lib/kdump/kdump-logger.sh" "/lib/kdump-logger.sh" inst_hook cmdline 00 "$moddir/early-kdump.sh" inst_binary "$KDUMP_KERNEL" inst_binary "$KDUMP_INITRD" ln_r "$KDUMP_KERNEL" "/boot/kernel-earlykdump" ln_r "$KDUMP_INITRD" "/boot/initramfs-earlykdump" chmod -x "${initdir}/$KDUMP_KERNEL" } modules.d/99kdumpbase/kdump-capture.service000064400000001661151701010110014725 0ustar00# This file is part of systemd. # # systemd is free software; you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation; either version 2.1 of the License, or # (at your option) any later version. [Unit] Description=Kdump Vmcore Save Service After=initrd.target initrd-parse-etc.service sysroot.mount After=dracut-initqueue.service dracut-pre-mount.service dracut-mount.service dracut-pre-pivot.service Before=initrd-cleanup.service ConditionPathExists=/etc/initrd-release OnFailure=emergency.target OnFailureJobMode=isolate [Service] Environment=DRACUT_SYSTEMD=1 Environment=NEWROOT=/sysroot Type=oneshot ExecStart=/bin/kdump.sh StandardInput=null StandardOutput=syslog StandardError=syslog+console KillMode=process RemainAfterExit=yes # Bash ignores SIGTERM, so we send SIGHUP instead, to ensure that bash # terminates cleanly. KillSignal=SIGHUP modules.d/99kdumpbase/kdump-emergency.service000064400000001611151701010110015233 0ustar00# This file is part of systemd. # # systemd is free software; you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation; either version 2.1 of the License, or # (at your option) any later version. # This service will be placed in kdump initramfs and replace both the systemd # emergency service and dracut emergency shell. IOW, any emergency will be # kick this service and in turn isolating to kdump error handler. [Unit] Description=Kdump Emergency DefaultDependencies=no IgnoreOnIsolate=yes [Service] ExecStart=/usr/bin/systemctl --no-block isolate kdump-error-handler.service Type=oneshot StandardInput=tty-force StandardOutput=inherit StandardError=inherit KillMode=process IgnoreSIGPIPE=no # Bash ignores SIGTERM, so we send SIGHUP instead, to ensure that bash # terminates cleanly. KillSignal=SIGHUP modules.d/99kdumpbase/kdump-emergency.target000064400000000703151701010110015062 0ustar00# This file is part of systemd. # # systemd is free software; you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation; either version 2.1 of the License, or # (at your option) any later version. [Unit] Description=Emergency Mode Documentation=man:systemd.special(7) Requires=emergency.service After=emergency.service AllowIsolate=yes IgnoreOnIsolate=yes modules.d/99kdumpbase/kdump-error-handler.service000064400000001646151701010110016031 0ustar00# This file is part of systemd. # # systemd is free software; you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation; either version 2.1 of the License, or # (at your option) any later version. # This service will run the real kdump error handler code. Executing the # failure action configured in kdump.conf [Unit] Description=Kdump Error Handler DefaultDependencies=no After=systemd-vconsole-setup.service Wants=systemd-vconsole-setup.service AllowIsolate=yes [Service] Environment=HOME=/ Environment=DRACUT_SYSTEMD=1 Environment=NEWROOT=/sysroot WorkingDirectory=/ ExecStart=/bin/kdump-error-handler.sh Type=oneshot StandardInput=tty-force StandardOutput=inherit StandardError=inherit KillMode=process IgnoreSIGPIPE=no # Bash ignores SIGTERM, so we send SIGHUP instead, to ensure that bash # terminates cleanly. KillSignal=SIGHUP modules.d/99kdumpbase/kdump-error-handler.sh000075500000000221151701010110014772 0ustar00#!/bin/sh . /lib/kdump-lib-initramfs.sh set -o pipefail export PATH=$PATH:$KDUMP_SCRIPT_DIR get_kdump_confs do_failure_action do_final_action modules.d/99kdumpbase/kdump.sh000075500000017603151701010110012244 0ustar00#!/bin/sh # continue here only if we have to save dump. if [ -f /etc/fadump.initramfs ] && [ ! -f /proc/device-tree/rtas/ibm,kernel-dump ] && [ ! -f /proc/device-tree/ibm,opal/dump/mpipl-boot ]; then exit 0 fi . /lib/dracut-lib.sh . /lib/kdump-lib-initramfs.sh set -o pipefail DUMP_RETVAL=0 export PATH=$PATH:$KDUMP_SCRIPT_DIR do_dump() { local _ret eval $DUMP_INSTRUCTION _ret=$? if [ $_ret -ne 0 ]; then derror "saving vmcore failed" fi return $_ret } do_kdump_pre() { local _ret if [ -n "$KDUMP_PRE" ]; then "$KDUMP_PRE" _ret=$? if [ $_ret -ne 0 ]; then derror "$KDUMP_PRE exited with $_ret status" return $_ret fi fi # if any script fails, it just raises warning and continues if [ -d /etc/kdump/pre.d ]; then for file in /etc/kdump/pre.d/*; do "$file" _ret=$? if [ $_ret -ne 0 ]; then derror "$file exited with $_ret status" fi done fi return 0 } do_kdump_post() { local _ret if [ -d /etc/kdump/post.d ]; then for file in /etc/kdump/post.d/*; do "$file" "$1" _ret=$? if [ $_ret -ne 0 ]; then derror "$file exited with $_ret status" fi done fi if [ -n "$KDUMP_POST" ]; then "$KDUMP_POST" "$1" _ret=$? if [ $_ret -ne 0 ]; then derror "$KDUMP_POST exited with $_ret status" fi fi } add_dump_code() { DUMP_INSTRUCTION=$1 } dump_raw() { local _raw=$1 [ -b "$_raw" ] || return 1 dinfo "saving to raw disk $_raw" if ! $(echo -n $CORE_COLLECTOR|grep -q makedumpfile); then _src_size=`ls -l /proc/vmcore | cut -d' ' -f5` _src_size_mb=$(($_src_size / 1048576)) monitor_dd_progress $_src_size_mb & fi dinfo "saving vmcore" $CORE_COLLECTOR /proc/vmcore | dd of=$_raw bs=$DD_BLKSIZE >> /tmp/dd_progress_file 2>&1 || return 1 sync dinfo "saving vmcore complete" return 0 } dump_ssh() { local _ret=0 local _exitcode=0 _exitcode2=0 local _opt="-i $1 -o BatchMode=yes -o StrictHostKeyChecking=yes" local _dir="$KDUMP_PATH/$HOST_IP-$DATEDIR" local _host=$2 local _vmcore="vmcore" local _ipv6_addr="" _username="" dinfo "saving to $_host:$_dir" cat /var/lib/random-seed > /dev/urandom ssh -q $_opt $_host mkdir -p $_dir || return 1 save_vmcore_dmesg_ssh ${DMESG_COLLECTOR} ${_dir} "${_opt}" $_host save_opalcore_ssh ${_dir} "${_opt}" $_host dinfo "saving vmcore" if is_ipv6_address "$_host"; then _username=${_host%@*} _ipv6_addr="[${_host#*@}]" fi if [ "${CORE_COLLECTOR%%[[:blank:]]*}" = "scp" ]; then if [ -n "$_username" ] && [ -n "$_ipv6_addr" ]; then scp -q $_opt /proc/vmcore "$_username@$_ipv6_addr:$_dir/vmcore-incomplete" else scp -q $_opt /proc/vmcore "$_host:$_dir/vmcore-incomplete" fi _exitcode=$? else $CORE_COLLECTOR /proc/vmcore | ssh $_opt $_host "umask 0077 && dd bs=512 of=$_dir/vmcore-incomplete" _exitcode=$? _vmcore="vmcore.flat" fi if [ $_exitcode -eq 0 ]; then ssh $_opt $_host "mv $_dir/vmcore-incomplete $_dir/$_vmcore" _exitcode2=$? if [ $_exitcode2 -ne 0 ]; then derror "moving vmcore failed, _exitcode:$_exitcode2" else dinfo "saving vmcore complete" fi else derror "saving vmcore failed, _exitcode:$_exitcode" fi dinfo "saving the $KDUMP_LOG_FILE to $_host:$_dir/" save_log if [ -n "$_username" ] && [ -n "$_ipv6_addr" ]; then scp -q $_opt $KDUMP_LOG_FILE "$_username@$_ipv6_addr:$_dir/" else scp -q $_opt $KDUMP_LOG_FILE "$_host:$_dir/" fi _ret=$? if [ $_ret -ne 0 ]; then derror "saving log file failed, _exitcode:$_ret" fi if [ $_exitcode -ne 0 ] || [ $_exitcode2 -ne 0 ];then return 1 fi return 0 } save_opalcore_ssh() { local _path=$1 local _opts="$2" local _location=$3 local _user_name="" _ipv6addr="" ddebug "_path=$_path _opts=$_opts _location=$_location" if [ ! -f $OPALCORE ]; then # Check if we are on an old kernel that uses a different path if [ -f /sys/firmware/opal/core ]; then OPALCORE="/sys/firmware/opal/core" else return 0 fi fi if is_ipv6_address "$_host"; then _user_name=${_location%@*} _ipv6addr="[${_location#*@}]" fi dinfo "saving opalcore:$OPALCORE to $_location:$_path" if [ -n "$_user_name" ] && [ -n "$_ipv6addr" ]; then scp $_opts $OPALCORE $_user_name@$_ipv6addr:$_path/opalcore-incomplete else scp $_opts $OPALCORE $_location:$_path/opalcore-incomplete fi if [ $? -ne 0 ]; then derror "saving opalcore failed" return 1 fi ssh $_opts $_location mv $_path/opalcore-incomplete $_path/opalcore dinfo "saving opalcore complete" return 0 } save_vmcore_dmesg_ssh() { local _dmesg_collector=$1 local _path=$2 local _opts="$3" local _location=$4 dinfo "saving vmcore-dmesg.txt to $_location:$_path" $_dmesg_collector /proc/vmcore | ssh $_opts $_location "umask 0077 && dd of=$_path/vmcore-dmesg-incomplete.txt" _exitcode=$? if [ $_exitcode -eq 0 ]; then ssh -q $_opts $_location mv $_path/vmcore-dmesg-incomplete.txt $_path/vmcore-dmesg.txt dinfo "saving vmcore-dmesg.txt complete" else derror "saving vmcore-dmesg.txt failed" fi } get_host_ip() { local _host if is_nfs_dump_target || is_ssh_dump_target then kdumpnic=$(getarg kdumpnic=) [ -z "$kdumpnic" ] && derror "failed to get kdumpnic!" && return 1 _host=`ip addr show dev $kdumpnic|grep '[ ]*inet'` [ $? -ne 0 ] && derror "wrong kdumpnic: $kdumpnic" && return 1 _host=`echo $_host | head -n 1 | cut -d' ' -f2` _host="${_host%%/*}" [ -z "$_host" ] && derror "wrong kdumpnic: $kdumpnic" && return 1 HOST_IP=$_host fi return 0 } read_kdump_conf() { if [ ! -f "$KDUMP_CONF" ]; then derror "$KDUMP_CONF not found" return fi get_kdump_confs # rescan for add code for dump target while read config_opt config_val; do # remove inline comments after the end of a directive. case "$config_opt" in dracut_args) config_val=$(get_dracut_args_target "$config_val") if [ -n "$config_val" ]; then config_val=$(get_mntpoint_from_target "$config_val") add_dump_code "dump_fs $config_val" fi ;; ext[234]|xfs|btrfs|minix|nfs) config_val=$(get_mntpoint_from_target "$config_val") add_dump_code "dump_fs $config_val" ;; raw) add_dump_code "dump_raw $config_val" ;; ssh) add_dump_code "dump_ssh $SSH_KEY_LOCATION $config_val" ;; esac done <<< "$(read_strip_comments $KDUMP_CONF)" } fence_kdump_notify() { if [ -n "$FENCE_KDUMP_NODES" ]; then $FENCE_KDUMP_SEND $FENCE_KDUMP_ARGS $FENCE_KDUMP_NODES & fi } read_kdump_conf fence_kdump_notify get_host_ip if [ $? -ne 0 ]; then derror "get_host_ip exited with non-zero status!" exit 1 fi if [ -z "$DUMP_INSTRUCTION" ]; then add_dump_code "dump_fs $NEWROOT" fi do_kdump_pre if [ $? -ne 0 ]; then derror "kdump_pre script exited with non-zero status!" do_final_action # During systemd service to reboot the machine, stop this shell script running exit 1 fi make_trace_mem "kdump saving vmcore" '1:shortmem' '2+:mem' '3+:slab' do_dump DUMP_RETVAL=$? do_kdump_post $DUMP_RETVAL if [ $? -ne 0 ]; then derror "kdump_post script exited with non-zero status!" fi if [ $DUMP_RETVAL -ne 0 ]; then exit 1 fi do_final_action modules.d/99kdumpbase/module-setup.sh000075500000106015151701010110013543 0ustar00#!/bin/bash _save_kdump_netifs() { local _name if [[ -n $2 ]]; then _name=$2 else _name=$1 fi unique_netifs[$1]=$_name } _get_kdump_netifs() { echo -n "${!unique_netifs[@]}" } kdump_module_init() { if ! [[ -d "${initdir}/tmp" ]]; then mkdir -p "${initdir}/tmp" fi . /lib/kdump/kdump-lib.sh } check() { [[ $debug ]] && set -x #kdumpctl sets this explicitly if [ -z "$IN_KDUMP" ] || [ ! -f /etc/kdump.conf ] then return 1 fi return 0 } depends() { local _dep="base shutdown" kdump_module_init add_opt_module() { [[ " $omit_dracutmodules " != *\ $1\ * ]] && _dep="$_dep $1" } if is_squash_available; then add_opt_module squash else dwarning "Required modules to build a squashed kdump image is missing!" fi add_opt_module watchdog-modules if is_wdt_active; then add_opt_module watchdog fi if is_ssh_dump_target; then _dep="$_dep ssh-client" fi if is_lvm2_thinp_dump_target; then if grep -q lvmthinpool-monitor <<< $(dracut --list-modules); then add_opt_module lvmthinpool-monitor else dwarning "Required lvmthinpool-monitor modules is missing! Please upgrade dracut >= 057." fi fi if [ "$(uname -m)" = "s390x" ]; then _dep="$_dep znet" fi if [ -n "$( find /sys/devices -name drm )" ] || [ -d /sys/module/hyperv_fb ]; then add_opt_module drm fi if is_generic_fence_kdump || is_pcs_fence_kdump; then _dep="$_dep network" fi echo $_dep } kdump_is_bridge() { [ -d /sys/class/net/"$1"/bridge ] } kdump_is_bond() { [ -d /sys/class/net/"$1"/bonding ] } kdump_is_team() { [ -f /usr/bin/teamnl ] && teamnl $1 ports &> /dev/null } kdump_is_vlan() { [ -f /proc/net/vlan/"$1" ] } # $1: netdev name source_ifcfg_file() { local ifcfg_file ifcfg_file=$(get_ifcfg_filename $1) if [ -f "${ifcfg_file}" ]; then . ${ifcfg_file} else dwarning "The ifcfg file of $1 is not found!" fi } add_dns_netdev() { local _server _route _server=$1 _route=`/sbin/ip -o route get to $_server 2>&1` # No netdev to add if DNS server is unreachable if [ $? -ne 0 ]; then echo "DNS server $_server unreachable" return fi _netdev=$(get_ip_route_field "$_route" "dev") _save_kdump_netifs "$_netdev" "$(kdump_setup_ifname $_netdev)" } # $1: netdev name kdump_setup_dns() { local _nameserver _dns local _dnsfile=${initdir}/etc/cmdline.d/42dns.conf source_ifcfg_file $1 [ -n "$DNS1" ] && echo "nameserver=$DNS1" > "$_dnsfile" && add_dns_netdev "$DNS1" [ -n "$DNS2" ] && echo "nameserver=$DNS2" >> "$_dnsfile" && add_dns_netdev "$DNS2" while read content; do _nameserver=$(echo $content | grep ^nameserver) [ -z "$_nameserver" ] && continue _dns=$(echo $_nameserver | cut -d' ' -f2) [ -z "$_dns" ] && continue if [ ! -f $_dnsfile ] || [ ! $(cat $_dnsfile | grep -q $_dns) ]; then echo "nameserver=$_dns" >> "$_dnsfile" add_dns_netdev "$_dns" fi done < "/etc/resolv.conf" } # $1: repeat times # $2: string to be repeated # $3: separator repeatedly_join_str() { local _count="$1" local _str="$2" local _separator="$3" local i _res if [[ "$_count" -le 0 ]]; then echo -n "" return fi i=0 _res="$_str" ((_count--)) while [[ "$i" -lt "$_count" ]]; do ((i++)) _res="${_res}${_separator}${_str}" done echo -n "$_res" } # $1: prefix # $2: ipv6_flag="-6" indicates it's IPv6 # Given a prefix, calculate the netmask (equivalent of "ipcalc -m") # by concatenating three parts, # 1) the groups with all bits set 1 # 2) a group with partial bits set to 0 # 3) the groups with all bits set to 0 cal_netmask_by_prefix() { local _prefix="$1" local _ipv6_flag="$2" _ipv6 local _bits_per_octet=8 local _count _res _octets_per_group _octets_total _seperator _total_groups local _max_group_value _max_group_value_repr _bits_per_group _tmp _zero_bits if [[ "$_ipv6_flag" == "-6" ]]; then _ipv6=1 else _ipv6=0 fi if [[ "$_prefix" -lt 0 || "$_prefix" -gt 128 ]] || \ ( ((!_ipv6)) && [[ "$_prefix" -gt 32 ]] ); then derror "Bad prefix:$_prefix for calculating netmask" exit 1 fi if ((_ipv6)); then _octets_per_group=2 _octets_total=16 _seperator=":" else _octets_per_group=1 _octets_total=4 _seperator="." fi _total_groups=$((_octets_total/_octets_per_group)) _bits_per_group=$((_octets_per_group * _bits_per_octet)) _max_group_value=$(((1 << _bits_per_group) - 1)) if ((_ipv6)); then _max_group_value_repr=$(printf "%x" $_max_group_value) else _max_group_value_repr="$_max_group_value" fi _count=$((_prefix/_octets_per_group/_bits_per_octet)) _first_part=$(repeatedly_join_str "$_count" "$_max_group_value_repr" "$_seperator") _res="$_first_part" _tmp=$((_octets_total*_bits_per_octet-_prefix)) _zero_bits=$(expr $_tmp % $_bits_per_group) if [[ "$_zero_bits" -ne 0 ]]; then _second_part=$((_max_group_value >> _zero_bits << _zero_bits)) if ((_ipv6)); then _second_part=$(printf "%x" $_second_part) fi ((_count++)) if [[ -z "$_first_part" ]]; then _res="$_second_part" else _res="${_first_part}${_seperator}${_second_part}" fi fi _count=$((_total_groups-_count)) if [[ "$_count" -eq 0 ]]; then echo -n "$_res" return fi if ((_ipv6)) && [[ "$_count" -gt 1 ]] ; then # use condensed notion for IPv6 _third_part=":" else _third_part=$(repeatedly_join_str "$_count" "0" "$_seperator") fi if [[ -z "$_res" ]] && ((!_ipv6)) ; then echo -n "${_third_part}" else echo -n "${_res}${_seperator}${_third_part}" fi } #$1: netdev name #$2: srcaddr #if it use static ip echo it, or echo null kdump_static_ip() { local _netdev="$1" _srcaddr="$2" kdumpnic="$3" _ipv6_flag local _netmask _gateway _ipaddr _target _nexthop _prefix _ipaddr=$(ip addr show dev $_netdev permanent | awk "/ $_srcaddr\/.* /{print \$2}") if is_ipv6_address $_srcaddr; then _ipv6_flag="-6" fi if [ -n "$_ipaddr" ]; then _gateway=$(ip $_ipv6_flag route list dev $_netdev | \ awk '/^default /{print $3}' | head -n 1) if [ "x" != "x"$_ipv6_flag ]; then # _ipaddr="2002::56ff:feb6:56d5/64", _netmask is the number after "/" _netmask=${_ipaddr#*\/} _srcaddr="[$_srcaddr]" _gateway="[$_gateway]" else _prefix=$(cut -d'/' -f2 <<< "$_ipaddr") _netmask=$(cal_netmask_by_prefix "$_prefix" "$_ipv6_flag") if [[ "$?" -ne 0 ]]; then derror "Failed to calculate netmask for $_ipaddr" exit 1 fi fi echo -n "${_srcaddr}::${_gateway}:${_netmask}::" fi /sbin/ip $_ipv6_flag route show | grep -v default | grep ".*via.* $_netdev " |\ while read _route; do _target=`echo $_route | cut -d ' ' -f1` _nexthop=`echo $_route | cut -d ' ' -f3` if [ "x" != "x"$_ipv6_flag ]; then _target="[$_target]" _nexthop="[$_nexthop]" fi echo "rd.route=$_target:$_nexthop:$kdumpnic" done >> ${initdir}/etc/cmdline.d/45route-static.conf } kdump_get_mac_addr() { cat /sys/class/net/$1/address } #Bonding or team master modifies the mac address #of its slaves, we should use perm address kdump_get_perm_addr() { local addr=$(ethtool -P $1 | sed -e 's/Permanent address: //') if [ -z "$addr" ] || [ "$addr" = "00:00:00:00:00:00" ] then derror "Can't get the permanent address of $1" else echo "$addr" fi } # Prefix kernel assigned names with "kdump-". EX: eth0 -> kdump-eth0 # Because kernel assigned names are not persistent between 1st and 2nd # kernel. We could probably end up with eth0 being eth1, eth0 being # eth1, and naming conflict happens. kdump_setup_ifname() { local _ifname # If ifname already has 'kdump-' prefix, we must be switching from # fadump to kdump. Skip prefixing 'kdump-' in this case as adding # another prefix may truncate the ifname. Since an ifname with # 'kdump-' is already persistent, this should be fine. if [[ $1 =~ ^eth.* ]] && [[ ! $1 =~ ^kdump-* ]]; then _ifname="kdump-$1" else _ifname="$1" fi echo "$_ifname" } kdump_install_nm_netif_allowlist() { local _netif _except_netif _netif_allowlist _netif_allowlist_nm_conf for _netif in $1; do _per_mac=$(kdump_get_perm_addr "$_netif") if [[ "$_per_mac" != 'not set' ]]; then _except_netif="mac:$_per_mac" else _except_netif="interface-name:${unique_netifs[${_netif}]}" fi _netif_allowlist="${_netif_allowlist}except:${_except_netif};" done _netif_allowlist_nm_conf=${initdir}/tmp/netif_allowlist_nm_conf cat << EOF > "$_netif_allowlist_nm_conf" [device-others] match-device=${_netif_allowlist} managed=false EOF inst "$_netif_allowlist_nm_conf" "/etc/NetworkManager/conf.d/10-kdump-netif_allowlist.conf" rm -f "$_netif_allowlist_nm_conf" } _get_nic_driver() { ethtool -i "$1" | sed -n -E "s/driver: (.*)/\1/p" } _get_hpyerv_physical_driver() { local _physical_nic _physical_nic=$(find /sys/class/net/"$1"/ -name 'lower_*' | sed -En "s/\/.*lower_(.*)/\1/p") [[ -n $_physical_nic ]] || return _get_nic_driver "$_physical_nic" } kdump_install_nic_driver() { local _netif _driver _drivers _drivers=() for _netif in $1; do [[ $_netif == lo ]] && continue _driver=$(_get_nic_driver "$_netif") if [[ -z $_driver ]]; then derror "Failed to get the driver of $_netif" exit 1 fi if [[ $_driver == "802.1Q VLAN Support" ]]; then # ethtool somehow doesn't return the driver name for a VLAN NIC _driver=8021q elif [[ $_driver == "team" ]]; then # install the team mode drivers like team_mode_roundrobin.ko as well _driver='=drivers/net/team' elif [[ $_driver == "hv_netvsc" ]]; then # A Hyper-V VM may have accelerated networking # https://learn.microsoft.com/en-us/azure/virtual-network/accelerated-networking-overview # Install the driver of physical NIC as well _drivers+=("$(_get_hpyerv_physical_driver "$_netif")") fi _drivers+=("$_driver") done [[ -n ${_drivers[*]} ]] || return instmods "${_drivers[@]}" } kdump_setup_bridge() { local _netdev=$1 local _brif _dev _mac _kdumpdev for _dev in `ls /sys/class/net/$_netdev/brif/`; do _kdumpdev="" if kdump_is_bond "$_dev"; then kdump_setup_bond "$_dev" elif kdump_is_team "$_dev"; then kdump_setup_team "$_dev" elif kdump_is_vlan "$_dev"; then kdump_setup_vlan "$_dev" else _mac=$(kdump_get_mac_addr $_dev) _kdumpdev=$(kdump_setup_ifname $_dev) echo -n " ifname=$_kdumpdev:$_mac" >> ${initdir}/etc/cmdline.d/41bridge.conf fi _save_kdump_netifs "$_dev" "$_kdumpdev" [[ -z $_kdumpdev ]] && _kdumpdev=$_dev _brif+="$_kdumpdev," done echo " bridge=$_netdev:$(echo $_brif | sed -e 's/,$//')" >> ${initdir}/etc/cmdline.d/41bridge.conf } kdump_setup_bond() { local _netdev=$1 local _dev _mac _slaves _kdumpdev for _dev in `cat /sys/class/net/$_netdev/bonding/slaves`; do _mac=$(kdump_get_perm_addr $_dev) _kdumpdev=$(kdump_setup_ifname $_dev) _save_kdump_netifs "$_dev" "$_kdumpdev" echo -n " ifname=$_kdumpdev:$_mac" >> ${initdir}/etc/cmdline.d/42bond.conf _slaves+="$_kdumpdev," done echo -n " bond=$_netdev:$(echo $_slaves | sed 's/,$//')" >> ${initdir}/etc/cmdline.d/42bond.conf # Get bond options specified in ifcfg source_ifcfg_file $_netdev bondoptions=":$(echo $BONDING_OPTS | xargs echo | tr " " ",")" echo "$bondoptions" >> ${initdir}/etc/cmdline.d/42bond.conf } kdump_setup_team() { local _netdev=$1 local _dev _mac _slaves _kdumpdev for _dev in `teamnl $_netdev ports | awk -F':' '{print $2}'`; do _mac=$(kdump_get_perm_addr $_dev) _kdumpdev=$(kdump_setup_ifname $_dev) _save_kdump_netifs "$_dev" "$_kdumpdev" echo -n " ifname=$_kdumpdev:$_mac" >> ${initdir}/etc/cmdline.d/44team.conf _slaves+="$_kdumpdev," done echo " team=$_netdev:$(echo $_slaves | sed -e 's/,$//')" >> ${initdir}/etc/cmdline.d/44team.conf #Buggy version teamdctl outputs to stderr! #Try to use the latest version of teamd. teamdctl "$_netdev" config dump > ${initdir}/tmp/$$-$_netdev.conf if [ $? -ne 0 ] then derror "teamdctl failed." exit 1 fi inst_dir /etc/teamd inst_simple ${initdir}/tmp/$$-$_netdev.conf "/etc/teamd/$_netdev.conf" rm -f ${initdir}/tmp/$$-$_netdev.conf } kdump_setup_vlan() { local _netdev=$1 local _phydev="$(awk '/^Device:/{print $2}' /proc/net/vlan/"$_netdev")" local _netmac="$(kdump_get_mac_addr $_phydev)" local _kdumpdev #Just support vlan over bond and team if kdump_is_bridge "$_phydev"; then derror "Vlan over bridge is not supported!" exit 1 elif kdump_is_bond "$_phydev"; then kdump_setup_bond "$_phydev" echo " vlan=$(kdump_setup_ifname $_netdev):$_phydev" > ${initdir}/etc/cmdline.d/43vlan.conf else _kdumpdev="$(kdump_setup_ifname $_phydev)" echo " vlan=$(kdump_setup_ifname $_netdev):$_kdumpdev ifname=$_kdumpdev:$_netmac" > ${initdir}/etc/cmdline.d/43vlan.conf fi _save_kdump_netifs "$_phydev" "$_kdumpdev" } # find online znet device # return ifname (_netdev) # code reaped from the list_configured function of # https://github.com/hreinecke/s390-tools/blob/master/zconf/znetconf find_online_znet_device() { local CCWGROUPBUS_DEVICEDIR="/sys/bus/ccwgroup/devices" local NETWORK_DEVICES d ifname ONLINE [ ! -d "$CCWGROUPBUS_DEVICEDIR" ] && return NETWORK_DEVICES=$(find $CCWGROUPBUS_DEVICEDIR) for d in $NETWORK_DEVICES do [ ! -f "$d/online" ] && continue read ONLINE < $d/online if [ $ONLINE -ne 1 ]; then continue fi # determine interface name, if there (only for qeth and if # device is online) if [ -f $d/if_name ] then read ifname < $d/if_name elif [ -d $d/net ] then ifname=$(ls $d/net/) fi [ -n "$ifname" ] && break done echo -n "$ifname" } # setup s390 znet cmdline # $1: netdev name kdump_setup_znet() { local _options="" local _netdev=$1 source_ifcfg_file $_netdev [[ -z "$NETTYPE" ]] && return [[ -z "$SUBCHANNELS" ]] && return for i in $OPTIONS; do _options=${_options},$i done echo rd.znet=${NETTYPE},${SUBCHANNELS}${_options} rd.znet_ifname=$(kdump_setup_ifname $_netdev):${SUBCHANNELS} > ${initdir}/etc/cmdline.d/30znet.conf } _get_nic_driver() { ethtool -i "$1" | sed -n -E "s/driver: (.*)/\1/p" } _rename_hypver_netdev() { local _udev_rule_dir _udev_rule_dir=${initdir}/etc/udev/rules.d mkdir -p "$_udev_rule_dir" printf 'SUBSYSTEM=="net", ACTION=="add", DRIVERS=="hv_netvsc", ATTR{address}=="%s", ATTR{type}=="1", NAME="%s"\n' "$2" "$1" > "${_udev_rule_dir}/80-hv_netvsc-ifname.rules" } # Setup dracut to bringup a given network interface kdump_setup_netdev() { local _netdev=$1 _srcaddr=$2 local _static _proto _ip_conf _ip_opts _ifname_opts kdumpnic local _netmac=$(kdump_get_mac_addr $_netdev) local _znet_netdev kdumpnic=$(kdump_setup_ifname $_netdev) _znet_netdev=$(find_online_znet_device) if [[ -n "$_znet_netdev" ]]; then $(kdump_setup_znet "$_znet_netdev") if [[ $? != 0 ]]; then derror "Failed to set up znet" exit 1 fi fi _static=$(kdump_static_ip $_netdev $_srcaddr $kdumpnic) if [ -n "$_static" ]; then _proto=none elif is_ipv6_address $_srcaddr; then _proto=auto6 else _proto=dhcp fi _ip_conf="${initdir}/etc/cmdline.d/40ip.conf" _ip_opts=" ip=${_static}$kdumpnic:${_proto}" # dracut doesn't allow duplicated configuration for same NIC, even they're exactly the same. # so we have to avoid adding duplicates # We should also check /proc/cmdline for existing ip=xx arg. # For example, iscsi boot will specify ip=xxx arg in cmdline. if [ ! -f $_ip_conf ] || ! grep -q $_ip_opts $_ip_conf &&\ ! grep -q "ip=[^[:space:]]*$_netdev" /proc/cmdline; then echo "$_ip_opts" >> $_ip_conf fi if kdump_is_bridge "$_netdev"; then kdump_setup_bridge "$_netdev" elif kdump_is_bond "$_netdev"; then kdump_setup_bond "$_netdev" elif kdump_is_team "$_netdev"; then kdump_setup_team "$_netdev" elif kdump_is_vlan "$_netdev"; then kdump_setup_vlan "$_netdev" else if [[ $(_get_nic_driver "$1") != hv_netvsc ]]; then _ifname_opts=" ifname=$kdumpnic:$_netmac" echo "$_ifname_opts" >> $_ip_conf else _rename_hypver_netdev "$kdumpnic" "$_netmac" fi fi _save_kdump_netifs "$_netdev" "$_kdumpdev" kdump_setup_dns "$_netdev" if [ ! -f ${initdir}/etc/cmdline.d/50neednet.conf ]; then # network-manager module needs this parameter echo "rd.neednet" >> ${initdir}/etc/cmdline.d/50neednet.conf fi } get_ip_route_field() { if `echo $1 | grep -q $2`; then echo ${1##*$2} | cut -d ' ' -f1 fi } #Function:kdump_install_net #$1: config values of net line in kdump.conf #$2: srcaddr of network device kdump_install_net() { local _server _netdev _srcaddr _route _serv_tmp local config_val="$1" _server=$(get_remote_host $config_val) if is_hostname $_server; then _serv_tmp=`getent ahosts $_server | grep -v : | head -n 1` if [ -z "$_serv_tmp" ]; then _serv_tmp=`getent ahosts $_server | head -n 1` fi _server=`echo $_serv_tmp | cut -d' ' -f1` fi _route=`/sbin/ip -o route get to $_server 2>&1` [ $? != 0 ] && echo "Bad kdump location: $config_val" && exit 1 #the field in the ip output changes if we go to another subnet _srcaddr=$(get_ip_route_field "$_route" "src") _netdev=$(get_ip_route_field "$_route" "dev") kdump_setup_netdev "${_netdev}" "${_srcaddr}" #save netdev used for kdump as cmdline # Whoever calling kdump_install_net() is setting up the default gateway, # ie. bootdev/kdumpnic. So don't override the setting if calling # kdump_install_net() for another time. For example, after setting eth0 as # the default gate way for network dump, eth1 in the fence kdump path will # call kdump_install_net again and we don't want eth1 to be the default # gateway. if [ ! -f ${initdir}/etc/cmdline.d/60kdumpnic.conf ] && [ ! -f ${initdir}/etc/cmdline.d/70bootdev.conf ]; then echo "kdumpnic=$(kdump_setup_ifname $_netdev)" > ${initdir}/etc/cmdline.d/60kdumpnic.conf echo "bootdev=$(kdump_setup_ifname $_netdev)" > ${initdir}/etc/cmdline.d/70bootdev.conf fi } # install etc/kdump/pre.d and /etc/kdump/post.d kdump_install_pre_post_conf() { if [ -d /etc/kdump/pre.d ]; then for file in /etc/kdump/pre.d/*; do if [ -x "$file" ]; then dracut_install $file elif [ $file != "/etc/kdump/pre.d/*" ]; then echo "$file is not executable" fi done fi if [ -d /etc/kdump/post.d ]; then for file in /etc/kdump/post.d/*; do if [ -x "$file" ]; then dracut_install $file elif [ $file != "/etc/kdump/post.d/*" ]; then echo "$file is not executable" fi done fi } default_dump_target_install_conf() { local _target _fstype local _mntpoint _save_path is_user_configured_dump_target && return _save_path=$(get_bind_mount_source $(get_save_path)) _target=$(get_target_from_path $_save_path) _mntpoint=$(get_mntpoint_from_target $_target) _fstype=$(get_fs_type_from_target $_target) if is_fs_type_nfs $_fstype; then kdump_install_net "$_target" _fstype="nfs" else _target=$(kdump_get_persistent_dev $_target) fi echo "$_fstype $_target" >> ${initdir}/tmp/$$-kdump.conf # don't touch the path under root mount if [ "$_mntpoint" != "/" ]; then _save_path=${_save_path##"$_mntpoint"} fi #erase the old path line, then insert the parsed path sed -i "/^path/d" ${initdir}/tmp/$$-kdump.conf echo "path $_save_path" >> ${initdir}/tmp/$$-kdump.conf } #install kdump.conf and what user specifies in kdump.conf kdump_install_conf() { local _opt _val _pdev sed -ne '/^#/!p' /etc/kdump.conf > ${initdir}/tmp/$$-kdump.conf while read _opt _val; do # remove inline comments after the end of a directive. case "$_opt" in raw) _pdev=$(persistent_policy="by-id" kdump_get_persistent_dev $_val) sed -i -e "s#^$_opt[[:space:]]\+$_val#$_opt $_pdev#" ${initdir}/tmp/$$-kdump.conf ;; ext[234]|xfs|btrfs|minix) _pdev=$(kdump_get_persistent_dev $_val) sed -i -e "s#^$_opt[[:space:]]\+$_val#$_opt $_pdev#" ${initdir}/tmp/$$-kdump.conf ;; ssh|nfs) kdump_install_net "$_val" ;; dracut_args) if [[ $(get_dracut_args_fstype "$_val") = nfs* ]] ; then kdump_install_net "$(get_dracut_args_target "$_val")" fi ;; kdump_pre|kdump_post|extra_bins) dracut_install $_val ;; core_collector) dracut_install "${_val%%[[:blank:]]*}" ;; esac done <<< "$(read_strip_comments /etc/kdump.conf)" kdump_install_pre_post_conf default_dump_target_install_conf kdump_configure_fence_kdump "${initdir}/tmp/$$-kdump.conf" inst "${initdir}/tmp/$$-kdump.conf" "/etc/kdump.conf" rm -f ${initdir}/tmp/$$-kdump.conf } # Default sysctl parameters should suffice for kdump kernel. # Remove custom configurations sysctl.conf & sysctl.d/* remove_sysctl_conf() { # As custom configurations like vm.min_free_kbytes can lead # to OOM issues in kdump kernel, avoid them rm -f "${initdir}/etc/sysctl.conf" rm -rf "${initdir}/etc/sysctl.d" rm -rf "${initdir}/run/sysctl.d" rm -rf "${initdir}/usr/lib/sysctl.d" } kdump_iscsi_get_rec_val() { local result # The open-iscsi 742 release changed to using flat files in # /var/lib/iscsi. result=$(/sbin/iscsiadm --show -m session -r ${1} | grep "^${2} = ") result=${result##* = } echo $result } kdump_get_iscsi_initiator() { local _initiator local initiator_conf="/etc/iscsi/initiatorname.iscsi" [ -f "$initiator_conf" ] || return 1 while read _initiator; do [ -z "${_initiator%%#*}" ] && continue # Skip comment lines case $_initiator in InitiatorName=*) initiator=${_initiator#InitiatorName=} echo "rd.iscsi.initiator=${initiator}" return 0;; *) ;; esac done < ${initiator_conf} return 1 } # Figure out iBFT session according to session type is_ibft() { [ "$(kdump_iscsi_get_rec_val $1 "node.discovery_type")" = fw ] } kdump_setup_iscsi_device() { local path=$1 local tgt_name; local tgt_ipaddr; local username; local password; local userpwd_str; local username_in; local password_in; local userpwd_in_str; local netdev local srcaddr local idev local netroot_str ; local initiator_str; local netroot_conf="${initdir}/etc/cmdline.d/50iscsi.conf" local initiator_conf="/etc/iscsi/initiatorname.iscsi" dinfo "Found iscsi component $1" # Check once before getting explicit values, so we can bail out early, # e.g. in case of pure-hardware(all-offload) iscsi. if ! /sbin/iscsiadm -m session -r ${path} &>/dev/null ; then return 1 fi if is_ibft ${path}; then return fi # Remove software iscsi cmdline generated by 95iscsi, # and let kdump regenerate here. rm -f ${initdir}/etc/cmdline.d/95iscsi.conf tgt_name=$(kdump_iscsi_get_rec_val ${path} "node.name") tgt_ipaddr=$(kdump_iscsi_get_rec_val ${path} "node.conn\[0\].address") # get and set username and password details username=$(kdump_iscsi_get_rec_val ${path} "node.session.auth.username") [ "$username" == "<empty>" ] && username="" password=$(kdump_iscsi_get_rec_val ${path} "node.session.auth.password") [ "$password" == "<empty>" ] && password="" username_in=$(kdump_iscsi_get_rec_val ${path} "node.session.auth.username_in") [ -n "$username" ] && userpwd_str="$username:$password" # get and set incoming username and password details [ "$username_in" == "<empty>" ] && username_in="" password_in=$(kdump_iscsi_get_rec_val ${path} "node.session.auth.password_in") [ "$password_in" == "<empty>" ] && password_in="" [ -n "$username_in" ] && userpwd_in_str=":$username_in:$password_in" netdev=$(/sbin/ip route get to ${tgt_ipaddr} | \ sed 's|.*dev \(.*\).*|\1|g') srcaddr=$(echo $netdev | awk '{ print $3; exit }') netdev=$(echo $netdev | awk '{ print $1; exit }') kdump_setup_netdev $netdev $srcaddr # prepare netroot= command line # FIXME: Do we need to parse and set other parameters like protocol, port # iscsi_iface_name, netdev_name, LUN etc. if is_ipv6_address $tgt_ipaddr; then tgt_ipaddr="[$tgt_ipaddr]" fi netroot_str="netroot=iscsi:${userpwd_str}${userpwd_in_str}@$tgt_ipaddr::::$tgt_name" [[ -f $netroot_conf ]] || touch $netroot_conf # If netroot target does not exist already, append. if ! grep -q $netroot_str $netroot_conf; then echo $netroot_str >> $netroot_conf dinfo "Appended $netroot_str to $netroot_conf" fi # Setup initator initiator_str=$(kdump_get_iscsi_initiator) [ $? -ne "0" ] && derror "Failed to get initiator name" && return 1 # If initiator details do not exist already, append. if ! grep -q "$initiator_str" $netroot_conf; then echo "$initiator_str" >> $netroot_conf dinfo "Appended "$initiator_str" to $netroot_conf" fi } kdump_check_iscsi_targets () { # If our prerequisites are not met, fail anyways. type -P iscsistart >/dev/null || return 1 kdump_check_setup_iscsi() { local _dev _dev=$1 [[ -L /sys/dev/block/$_dev ]] || return cd "$(readlink -f /sys/dev/block/$_dev)" until [[ -d sys || -d iscsi_session ]]; do cd .. done [[ -d iscsi_session ]] && kdump_setup_iscsi_device "$PWD" } [[ $hostonly ]] || [[ $mount_needs ]] && { for_each_host_dev_and_slaves_all kdump_check_setup_iscsi } } # hostname -a is deprecated, do it by ourself get_alias() { local ips local entries local alias_set ips=$(hostname -I) for ip in $ips do # in /etc/hosts, alias can come at the 2nd column entries=$(grep $ip /etc/hosts | awk '{ $1=""; print $0 }') if [ $? -eq 0 ]; then alias_set="$alias_set $entries" fi done echo $alias_set } is_localhost() { local hostnames=$(hostname -A) local shortnames=$(hostname -A -s) local aliasname=$(get_alias) local nodename=$1 hostnames="$hostnames $shortnames $aliasname" for name in ${hostnames}; do if [ "$name" == "$nodename" ]; then return 0 fi done return 1 } # retrieves fence_kdump nodes from Pacemaker cluster configuration get_pcs_fence_kdump_nodes() { local nodes # get cluster nodes from cluster cib, get interface and ip address nodelist=`pcs cluster cib | xmllint --xpath "/cib/status/node_state/@uname" -` # nodelist is formed as 'uname="node1" uname="node2" ... uname="nodeX"' # we need to convert each to node1, node2 ... nodeX in each iteration for node in ${nodelist}; do # convert $node from 'uname="nodeX"' to 'nodeX' eval $node nodename=$uname # Skip its own node name if [ "$nodename" = `hostname` -o "$nodename" = `hostname -s` ]; then continue fi nodes="$nodes $nodename" done echo $nodes } # retrieves fence_kdump args from config file get_pcs_fence_kdump_args() { if [ -f $FENCE_KDUMP_CONFIG_FILE ]; then . $FENCE_KDUMP_CONFIG_FILE echo $FENCE_KDUMP_OPTS fi } get_generic_fence_kdump_nodes() { local filtered local nodes nodes=$(get_option_value "fence_kdump_nodes") for node in ${nodes}; do # Skip its own node name if is_localhost $node; then continue fi filtered="$filtered $node" done echo $filtered } # setup fence_kdump in cluster # setup proper network and install needed files kdump_configure_fence_kdump () { local kdump_cfg_file=$1 local nodes local args if is_generic_fence_kdump; then nodes=$(get_generic_fence_kdump_nodes) elif is_pcs_fence_kdump; then nodes=$(get_pcs_fence_kdump_nodes) # set appropriate options in kdump.conf echo "fence_kdump_nodes $nodes" >> ${kdump_cfg_file} args=$(get_pcs_fence_kdump_args) if [ -n "$args" ]; then echo "fence_kdump_args $args" >> ${kdump_cfg_file} fi else # fence_kdump not configured return 1 fi # setup network for each node for node in ${nodes}; do kdump_install_net $node done dracut_install /etc/hosts dracut_install /etc/nsswitch.conf dracut_install $FENCE_KDUMP_SEND } # Install a random seed used to feed /dev/urandom # By the time kdump service starts, /dev/uramdom is already fed by systemd kdump_install_random_seed() { local poolsize=`cat /proc/sys/kernel/random/poolsize` if [ ! -d ${initdir}/var/lib/ ]; then mkdir -p ${initdir}/var/lib/ fi dd if=/dev/urandom of=${initdir}/var/lib/random-seed \ bs=$poolsize count=1 2> /dev/null } remove_cpu_online_rule() { local file=${initdir}/usr/lib/udev/rules.d/40-redhat.rules sed -i '/SUBSYSTEM=="cpu"/d' $file } kdump_install_systemd_conf() { local failure_action=$(get_option_value "failure_action") # Kdump turns out to require longer default systemd mount timeout # than 1st kernel(90s by default), we use default 300s for kdump. grep -r "^[[:space:]]*DefaultTimeoutStartSec=" ${initdir}/etc/systemd/system.conf* &>/dev/null if [ $? -ne 0 ]; then mkdir -p ${initdir}/etc/systemd/system.conf.d echo "[Manager]" > ${initdir}/etc/systemd/system.conf.d/kdump.conf echo "DefaultTimeoutStartSec=300s" >> ${initdir}/etc/systemd/system.conf.d/kdump.conf fi # Forward logs to console directly, and don't read Kmsg, this avoids # unneccessary memory consumption and make console output more useful. # Only do so for non fadump image. mkdir -p ${initdir}/etc/systemd/journald.conf.d echo "[Journal]" > ${initdir}/etc/systemd/journald.conf.d/kdump.conf echo "Storage=volatile" >> ${initdir}/etc/systemd/journald.conf.d/kdump.conf echo "ReadKMsg=no" >> ${initdir}/etc/systemd/journald.conf.d/kdump.conf echo "ForwardToConsole=yes" >> ${initdir}/etc/systemd/journald.conf.d/kdump.conf } install() { declare -A unique_netifs local arch _netifs kdump_module_init kdump_install_conf remove_sysctl_conf # Onlining secondary cpus breaks kdump completely on KVM on Power hosts # Though we use maxcpus=1 by default but 40-redhat.rules will bring up all # possible cpus by default. (rhbz1270174 rhbz1266322) # Thus before we get the kernel fix and the systemd rule fix let's remove # the cpu online rule in kdump initramfs. arch=$(uname -m) if [[ "$arch" = "ppc64le" ]] || [[ "$arch" = "ppc64" ]]; then remove_cpu_online_rule fi if is_ssh_dump_target; then kdump_install_random_seed fi dracut_install -o /etc/adjtime /etc/localtime inst "$moddir/monitor_dd_progress" "/kdumpscripts/monitor_dd_progress" chmod +x ${initdir}/kdumpscripts/monitor_dd_progress inst "/bin/dd" "/bin/dd" inst "/bin/tail" "/bin/tail" inst "/bin/date" "/bin/date" inst "/bin/sync" "/bin/sync" inst "/bin/cut" "/bin/cut" inst "/bin/head" "/bin/head" inst "/sbin/makedumpfile" "/sbin/makedumpfile" inst "/sbin/vmcore-dmesg" "/sbin/vmcore-dmesg" inst "/usr/bin/printf" "/sbin/printf" inst "/usr/bin/logger" "/sbin/logger" inst "/usr/bin/chmod" "/sbin/chmod" inst "/lib/kdump/kdump-lib.sh" "/lib/kdump-lib.sh" inst "/lib/kdump/kdump-lib-initramfs.sh" "/lib/kdump-lib-initramfs.sh" inst "/lib/kdump/kdump-logger.sh" "/lib/kdump-logger.sh" inst "$moddir/kdump.sh" "/usr/bin/kdump.sh" inst "$moddir/kdump-capture.service" "$systemdsystemunitdir/kdump-capture.service" systemctl -q --root "$initdir" add-wants initrd.target kdump-capture.service inst "$moddir/kdump-error-handler.sh" "/usr/bin/kdump-error-handler.sh" inst "$moddir/kdump-error-handler.service" "$systemdsystemunitdir/kdump-error-handler.service" # Replace existing emergency service and emergency target cp "$moddir/kdump-emergency.service" "$initdir/$systemdsystemunitdir/emergency.service" cp "$moddir/kdump-emergency.target" "$initdir/$systemdsystemunitdir/emergency.target" # Also redirect dracut-emergency to kdump error handler ln_r "$systemdsystemunitdir/emergency.service" "$systemdsystemunitdir/dracut-emergency.service" # Check for all the devices and if any device is iscsi, bring up iscsi # target. Ideally all this should be pushed into dracut iscsi module # at some point of time. kdump_check_iscsi_targets _netifs=$(_get_kdump_netifs) if [[ -n "$_netifs" ]]; then kdump_install_nm_netif_allowlist "$_netifs" kdump_install_nic_driver "$_netifs" fi kdump_install_systemd_conf # For the lvm type target under kdump, in /etc/lvm/lvm.conf we can # safely replace "reserved_memory=XXXX"(default value is 8192) with # "reserved_memory=1024" to lower memory pressure under kdump. We do # it unconditionally here, if "/etc/lvm/lvm.conf" doesn't exist, it # actually does nothing. sed -i -e \ 's/\(^[[:space:]]*reserved_memory[[:space:]]*=\)[[:space:]]*[[:digit:]]*/\1 1024/' \ ${initdir}/etc/lvm/lvm.conf &>/dev/null # Skip initrd-cleanup.service and initrd-parse-etc.service becasue we don't # need to switch root. Instead of removing them, we use ConditionPathExists # to check if /proc/vmcore exists to determine if we are in kdump. sed -i '/\[Unit\]/a ConditionPathExists=!\/proc\/vmcore' \ "${initdir}/${systemdsystemunitdir}/initrd-cleanup.service" &> /dev/null sed -i '/\[Unit\]/a ConditionPathExists=!\/proc\/vmcore' \ "${initdir}/${systemdsystemunitdir}/initrd-parse-etc.service" &> /dev/null # Save more memory by dropping switch root capability dracut_no_switch_root } modules.d/99kdumpbase/monitor_dd_progress000064400000000742151701010110014566 0ustar00#!/bin/sh SRC_FILE_MB=$1 while true do DD_PID=`pidof dd` if [ -n "$DD_PID" ]; then break fi done while true do sleep 5 if [ ! -d /proc/$DD_PID ]; then break fi kill -s USR1 $DD_PID CURRENT_SIZE=`tail -n 1 /tmp/dd_progress_file | sed "s/[^0-9].*//g"` [ -n "$CURRENT_SIZE" ] && { CURRENT_MB=$(($CURRENT_SIZE / 1048576)) echo -e "Copied $CURRENT_MB MB / $SRC_FILE_MB MB\r" } done rm -f /tmp/dd_progress_file modules.d/99microcode_ctl-fw_dir_override/module-setup.sh000075500000010022151701010110017535 0ustar00#!/bin/bash # Hack in additional firmware directories for supported caveats. # # SPDX-License-Identifier: CC0-1.0 check() { return 0 } install() { local FW_DIR=/lib/firmware local DATA_DIR=/usr/share/microcode_ctl/ucode_with_caveats local CFG_DIR="/etc/microcode_ctl/ucode_with_caveats" local check_caveats=/usr/libexec/microcode_ctl/check_caveats local fw_path_para=$(< /sys/module/firmware_class/parameters/path) local verbose_opt local cc_out local path local ignored local do_skip_host_only local p verbose_opt= [ 4 -gt "$stdloglvl" ] || verbose_opt="-v" # HACK: we override external fw_dir variable in order to get # an additional ucode based on the kernel version. dinfo " microcode_ctl module: mangling fw_dir" [ -z "$fw_dir_l" ] || { dinfo " microcode_ctl: avoid touching fw_dir as" \ "it has been changed (fw_dir_l is '$fw_dir_l')" return 0 } # Reset fw_dir to avoid inclusion of kernel-version-specific directories # populated with microcode for the late load, only in case it is set # to the default value to avoid meddling with user-enforced changes. # The second variant has been introduced in dracut-057~5. [ \( "x$fw_dir" != \ "x/lib/firmware/updates /lib/firmware /lib/firmware/$kernel" \) -a \ \( "x$fw_dir" != \ "x${fw_path_para:+$fw_path_para }/lib/firmware/updates/$kernel /lib/firmware/updates /lib/firmware/$kernel /lib/firmware" \) ] || { fw_dir="/lib/firmware/updates /lib/firmware" dinfo " microcode_ctl: reset fw_dir to \"${fw_dir}\"" } fw_dir_add="" while read -d $'\n' -r i; do dinfo " microcode_ctl: processing data directory " \ "\"$DATA_DIR/$i\"..." if [ "x" != "x$hostonly" ]; then do_skip_host_only=0 local sho_overrides=" $CFG_DIR/skip-host-only-check $CFG_DIR/skip-host-only-check-$i $FW_DIR/$kernel/skip-host-only-check $FW_DIR/$kernel/skip-host-only-check-$i" for p in $(echo "$sho_overrides"); do [ -e "$p" ] || continue do_skip_host_only=1 dinfo " microcode_ctl: $i; skipping" \ "Host-Only check, since \"$p\" exists." break done else do_skip_host_only=1 fi match_model_opt="" [ 1 = "$do_skip_host_only" ] || match_model_opt="-m" if ! cc_out=$($check_caveats -e -k "$kernel" -c "$i" \ $verbose_opt $match_model_opt) then dinfo " microcode_ctl: kernel version \"$kernel\"" \ "failed early load check for \"$i\", skipping" continue fi path=$(printf "%s" "$cc_out" | sed -n 's/^paths //p') [ -n "$path" ] || { ignored=$(printf "%s" "$cc_out" | \ sed -n 's/^skip_cfgs //p') if [ -n "$ignored" ]; then dinfo " microcode_ctl: configuration" \ "\"$i\" is ignored" else dinfo " microcode_ctl: no microcode paths" \ "are associated with \"$i\", skipping" fi continue } dinfo " microcode_ctl: $i: caveats check for kernel" \ "version \"$kernel\" passed, adding" \ "\"$DATA_DIR/$i\" to fw_dir variable" if [ 0 -eq "$do_skip_host_only" ]; then fw_dir_add="$DATA_DIR/$i " else fw_dir_add="$DATA_DIR/$i $fw_dir_add" fi # The list of directories is reverse-sorted in order to preserve the # "last wins" policy in case of presence of multiple microcode # revisions. # # In case of hostonly == 0, all microcode revisions will be included, # but since the microcode search is done with the "first wins" policy # by the (early) microcode loading code, the correct microcode revision # still has to be picked. # # Note that dracut without patch [1] puts only the last directory # in the early cpio; we try to address this by putting only the last # matching caveat in the search path, but that workaround works only # for host-only mode; non-host-only mode early cpio generation is still # broken without that patch. # # [1] https://github.com/dracutdevs/dracut/commit/c44d2252bb4b done <<-EOF $(find "$DATA_DIR" -maxdepth 1 -mindepth 1 -type d -printf "%f\n" \ | LC_ALL=C sort) EOF fw_dir="${fw_dir_add}${fw_dir}" dinfo " microcode_ctl: final fw_dir: \"${fw_dir}\"" } modules.d/71prefixdevname/module-setup.sh000075500000000365151701010110014414 0ustar00#!/bin/bash # Make sure we always include generated link files in initrd check() { return 0 } install() { if dracut_module_included "systemd"; then inst_multiple -H -o /etc/systemd/network/71-net-ifnames-prefix-*.link fi } modules.d/71prefixdevname-tools/module-setup.sh000075500000000313151701010110015543 0ustar00#!/bin/bash # Include the prefixdevname tools only if this was explicitely requested check() { return 255 } install() { inst /usr/lib/udev/prefixdevname inst_rules 71-prefixdevname.rules } dracut-functions.sh000075500000052214151701010110010362 0ustar00#!/bin/bash # # functions used by dracut and other tools. # # Copyright 2005-2009 Red Hat, Inc. All rights reserved. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. # export LC_MESSAGES=C # is_func <command> # Check whether $1 is a function. is_func() { [[ "$(type -t "$1")" = "function" ]] } # Generic substring function. If $2 is in $1, return 0. strstr() { [[ $1 = *"$2"* ]]; } # Generic glob matching function. If glob pattern $2 matches anywhere in $1, OK strglobin() { [[ $1 = *$2* ]]; } # Generic glob matching function. If glob pattern $2 matches all of $1, OK strglob() { [[ $1 = $2 ]]; } # returns OK if $1 contains literal string $2 at the beginning, and isn't empty str_starts() { [ "${1#"$2"*}" != "$1" ]; } # returns OK if $1 contains literal string $2 at the end, and isn't empty str_ends() { [ "${1%*"$2"}" != "$1" ]; } # find a binary. If we were not passed the full path directly, # search in the usual places to find the binary. find_binary() { if [[ -z ${1##/*} ]]; then if [[ -x $1 ]] || { [[ "$1" == *.so* ]] && ldd "$1" &>/dev/null; }; then printf "%s\n" "$1" return 0 fi fi type -P "${1##*/}" } ldconfig_paths() { ldconfig -pN 2>/dev/null | grep -E -v '/(lib|lib64|usr/lib|usr/lib64)/[^/]*$' | sed -n 's,.* => \(.*\)/.*,\1,p' | sort | uniq } # Version comparision function. Assumes Linux style version scheme. # $1 = version a # $2 = comparision op (gt, ge, eq, le, lt, ne) # $3 = version b vercmp() { local _n1=(${1//./ }) _op=$2 _n2=(${3//./ }) _i _res for ((_i=0; ; _i++)) do if [[ ! ${_n1[_i]}${_n2[_i]} ]]; then _res=0 elif ((${_n1[_i]:-0} > ${_n2[_i]:-0})); then _res=1 elif ((${_n1[_i]:-0} < ${_n2[_i]:-0})); then _res=2 else continue fi break done case $_op in gt) ((_res == 1));; ge) ((_res != 2));; eq) ((_res == 0));; le) ((_res != 1));; lt) ((_res == 2));; ne) ((_res != 0));; esac } # Create all subdirectories for given path without creating the last element. # $1 = path mksubdirs() { [[ -e ${1%/*} ]] || mkdir -m 0755 -p -- "${1%/*}" } # Function prints global variables in format name=value line by line. # $@ = list of global variables' name print_vars() { local _var _value for _var in "$@" do eval printf -v _value "%s" \""\$$_var"\" [[ ${_value} ]] && printf '%s="%s"\n' "$_var" "$_value" done } # normalize_path <path> # Prints the normalized path, where it removes any duplicated # and trailing slashes. # Example: # $ normalize_path ///test/test// # /test/test normalize_path() { shopt -q -s extglob set -- "${1//+(\/)//}" shopt -q -u extglob printf "%s\n" "${1%/}" } # convert_abs_rel <from> <to> # Prints the relative path, when creating a symlink to <to> from <from>. # Example: # $ convert_abs_rel /usr/bin/test /bin/test-2 # ../../bin/test-2 # $ ln -s $(convert_abs_rel /usr/bin/test /bin/test-2) /usr/bin/test convert_abs_rel() { local __current __absolute __abssize __cursize __newpath local -i __i __level set -- "$(normalize_path "$1")" "$(normalize_path "$2")" # corner case #1 - self looping link [[ "$1" == "$2" ]] && { printf "%s\n" "${1##*/}"; return; } # corner case #2 - own dir link [[ "${1%/*}" == "$2" ]] && { printf ".\n"; return; } IFS="/" __current=($1) IFS="/" __absolute=($2) __abssize=${#__absolute[@]} __cursize=${#__current[@]} while [[ "${__absolute[__level]}" == "${__current[__level]}" ]] do (( __level++ )) if (( __level > __abssize || __level > __cursize )) then break fi done for ((__i = __level; __i < __cursize-1; __i++)) do if ((__i > __level)) then __newpath=$__newpath"/" fi __newpath=$__newpath".." done for ((__i = __level; __i < __abssize; __i++)) do if [[ -n $__newpath ]] then __newpath=$__newpath"/" fi __newpath=$__newpath${__absolute[__i]} done printf "%s\n" "$__newpath" } # get_fs_env <device> # Get and the ID_FS_TYPE variable from udev for a device. # Example: # $ get_fs_env /dev/sda2 # ext4 get_fs_env() { local evalstr local found [[ $1 ]] || return unset ID_FS_TYPE ID_FS_TYPE=$(blkid -u filesystem -o export -- "$1" \ | while read line || [ -n "$line" ]; do if [[ "$line" == TYPE\=* ]]; then printf "%s" "${line#TYPE=}"; exit 0; fi done) if [[ $ID_FS_TYPE ]]; then printf "%s" "$ID_FS_TYPE" return 0 fi return 1 } # get_maj_min <device> # Prints the major and minor of a device node. # Example: # $ get_maj_min /dev/sda2 # 8:2 get_maj_min() { local _majmin local _out if [[ $get_maj_min_cache_file ]]; then _out="$(grep -m1 -oP "^$1 \K\S+$" "$get_maj_min_cache_file")" fi if ! [[ "$_out" ]]; then _majmin="$(stat -L -c '%t:%T' "$1" 2>/dev/null)" _out="$(printf "%s" "$((0x${_majmin%:*})):$((0x${_majmin#*:}))")" if [[ $get_maj_min_cache_file ]]; then echo "$1 $_out" >> "$get_maj_min_cache_file" fi fi echo -n "$_out" } # get_devpath_block <device> # get the DEVPATH in /sys of a block device get_devpath_block() { local _majmin _i _majmin=$(get_maj_min "$1") for _i in /sys/block/*/dev /sys/block/*/*/dev; do [[ -e "$_i" ]] || continue if [[ "$_majmin" == "$(<"$_i")" ]]; then printf "%s" "${_i%/dev}" return 0 fi done return 1 } # get a persistent path from a device get_persistent_dev() { local i _tmp _dev _pol _dev=$(get_maj_min "$1") [ -z "$_dev" ] && return if [[ -n "$persistent_policy" ]]; then _pol="/dev/disk/${persistent_policy}/*" else _pol= fi for i in \ $_pol \ /dev/mapper/* \ /dev/disk/by-uuid/* \ /dev/disk/by-label/* \ /dev/disk/by-partuuid/* \ /dev/disk/by-partlabel/* \ /dev/disk/by-id/* \ /dev/disk/by-path/* \ ; do [[ -e "$i" ]] || continue [[ $i == /dev/mapper/control ]] && continue [[ $i == /dev/mapper/mpath* ]] && continue _tmp=$(get_maj_min "$i") if [ "$_tmp" = "$_dev" ]; then printf -- "%s" "$i" return fi done printf -- "%s" "$1" } expand_persistent_dev() { local _dev=$1 case "$_dev" in LABEL=*) _dev="/dev/disk/by-label/${_dev#LABEL=}" ;; UUID=*) _dev="${_dev#UUID=}" _dev="${_dev,,}" _dev="/dev/disk/by-uuid/${_dev}" ;; PARTUUID=*) _dev="${_dev#PARTUUID=}" _dev="${_dev,,}" _dev="/dev/disk/by-partuuid/${_dev}" ;; PARTLABEL=*) _dev="/dev/disk/by-partlabel/${_dev#PARTLABEL=}" ;; esac printf "%s" "$_dev" } shorten_persistent_dev() { local _dev="$1" case "$_dev" in /dev/disk/by-uuid/*) printf "%s" "UUID=${_dev##*/}";; /dev/disk/by-label/*) printf "%s" "LABEL=${_dev##*/}";; /dev/disk/by-partuuid/*) printf "%s" "PARTUUID=${_dev##*/}";; /dev/disk/by-partlabel/*) printf "%s" "PARTLABEL=${_dev##*/}";; *) printf "%s" "$_dev";; esac } # find_block_device <mountpoint> # Prints the major and minor number of the block device # for a given mountpoint. # Unless $use_fstab is set to "yes" the functions # uses /proc/self/mountinfo as the primary source of the # information and only falls back to /etc/fstab, if the mountpoint # is not found there. # Example: # $ find_block_device /usr # 8:4 find_block_device() { local _dev _majmin _find_mpt _find_mpt="$1" if [[ $use_fstab != yes ]]; then [[ -d $_find_mpt/. ]] findmnt -e -v -n -o 'MAJ:MIN,SOURCE' --target "$_find_mpt" | { \ while read _majmin _dev || [ -n "$_dev" ]; do if [[ -b $_dev ]]; then if ! [[ $_majmin ]] || [[ $_majmin == 0:* ]]; then _majmin=$(get_maj_min $_dev) fi if [[ $_majmin ]]; then printf "%s\n" "$_majmin" else printf "%s\n" "$_dev" fi return 0 fi if [[ $_dev = *:* ]]; then printf "%s\n" "$_dev" return 0 fi done; return 1; } && return 0 fi # fall back to /etc/fstab findmnt -e --fstab -v -n -o 'MAJ:MIN,SOURCE' --target "$_find_mpt" | { \ while read _majmin _dev || [ -n "$_dev" ]; do if ! [[ $_dev ]]; then _dev="$_majmin" unset _majmin fi if [[ -b $_dev ]]; then [[ $_majmin ]] || _majmin=$(get_maj_min $_dev) if [[ $_majmin ]]; then printf "%s\n" "$_majmin" else printf "%s\n" "$_dev" fi return 0 fi if [[ $_dev = *:* ]]; then printf "%s\n" "$_dev" return 0 fi done; return 1; } && return 0 return 1 } # find_mp_fstype <mountpoint> # Echo the filesystem type for a given mountpoint. # /proc/self/mountinfo is taken as the primary source of information # and /etc/fstab is used as a fallback. # No newline is appended! # Example: # $ find_mp_fstype /;echo # ext4 find_mp_fstype() { local _fs if [[ $use_fstab != yes ]]; then findmnt -e -v -n -o 'FSTYPE' --target "$1" | { \ while read _fs || [ -n "$_fs" ]; do [[ $_fs ]] || continue [[ $_fs = "autofs" ]] && continue printf "%s" "$_fs" return 0 done; return 1; } && return 0 fi findmnt --fstab -e -v -n -o 'FSTYPE' --target "$1" | { \ while read _fs || [ -n "$_fs" ]; do [[ $_fs ]] || continue [[ $_fs = "autofs" ]] && continue printf "%s" "$_fs" return 0 done; return 1; } && return 0 return 1 } # find_dev_fstype <device> # Echo the filesystem type for a given device. # /proc/self/mountinfo is taken as the primary source of information # and /etc/fstab is used as a fallback. # No newline is appended! # Example: # $ find_dev_fstype /dev/sda2;echo # ext4 find_dev_fstype() { local _find_dev _fs _find_dev="$1" if ! [[ "$_find_dev" = /dev* ]]; then [[ -b "/dev/block/$_find_dev" ]] && _find_dev="/dev/block/$_find_dev" fi if [[ $use_fstab != yes ]]; then findmnt -e -v -n -o 'FSTYPE' --source "$_find_dev" | { \ while read _fs || [ -n "$_fs" ]; do [[ $_fs ]] || continue [[ $_fs = "autofs" ]] && continue printf "%s" "$_fs" return 0 done; return 1; } && return 0 fi findmnt --fstab -e -v -n -o 'FSTYPE' --source "$_find_dev" | { \ while read _fs || [ -n "$_fs" ]; do [[ $_fs ]] || continue [[ $_fs = "autofs" ]] && continue printf "%s" "$_fs" return 0 done; return 1; } && return 0 return 1 } # find_mp_fsopts <mountpoint> # Echo the filesystem options for a given mountpoint. # /proc/self/mountinfo is taken as the primary source of information # and /etc/fstab is used as a fallback. # No newline is appended! # Example: # $ find_mp_fsopts /;echo # rw,relatime,discard,data=ordered find_mp_fsopts() { if [[ $use_fstab != yes ]]; then findmnt -e -v -n -o 'OPTIONS' --target "$1" 2>/dev/null && return 0 fi findmnt --fstab -e -v -n -o 'OPTIONS' --target "$1" } # find_dev_fsopts <device> # Echo the filesystem options for a given device. # /proc/self/mountinfo is taken as the primary source of information # and /etc/fstab is used as a fallback. # Example: # $ find_dev_fsopts /dev/sda2 # rw,relatime,discard,data=ordered find_dev_fsopts() { local _find_dev _opts _find_dev="$1" if ! [[ "$_find_dev" = /dev* ]]; then [[ -b "/dev/block/$_find_dev" ]] && _find_dev="/dev/block/$_find_dev" fi if [[ $use_fstab != yes ]]; then findmnt -e -v -n -o 'OPTIONS' --source "$_find_dev" 2>/dev/null && return 0 fi findmnt --fstab -e -v -n -o 'OPTIONS' --source "$_find_dev" } # finds the major:minor of the block device backing the root filesystem. find_root_block_device() { find_block_device /; } # for_each_host_dev_fs <func> # Execute "<func> <dev> <filesystem>" for every "<dev> <fs>" pair found # in ${host_fs_types[@]} for_each_host_dev_fs() { local _func="$1" local _dev local _ret=1 [[ "${#host_fs_types[@]}" ]] || return 2 for _dev in "${!host_fs_types[@]}"; do $_func "$_dev" "${host_fs_types[$_dev]}" && _ret=0 done return $_ret } host_fs_all() { printf "%s\n" "${host_fs_types[@]}" } # Walk all the slave relationships for a given block device. # Stop when our helper function returns success # $1 = function to call on every found block device # $2 = block device in major:minor format check_block_and_slaves() { local _x [[ -b /dev/block/$2 ]] || return 1 # Not a block device? So sorry. if ! lvm_internal_dev $2; then "$1" $2 && return; fi check_vol_slaves "$@" && return 0 if [[ -f /sys/dev/block/$2/../dev ]] && [[ /sys/dev/block/$2/../subsystem -ef /sys/class/block ]]; then check_block_and_slaves $1 $(<"/sys/dev/block/$2/../dev") && return 0 fi [[ -d /sys/dev/block/$2/slaves ]] || return 1 for _x in /sys/dev/block/$2/slaves/*; do [[ -f $_x/dev ]] || continue [[ $_x/subsystem -ef /sys/class/block ]] || continue check_block_and_slaves $1 $(<"$_x/dev") && return 0 done return 1 } check_block_and_slaves_all() { local _x _ret=1 [[ -b /dev/block/$2 ]] || return 1 # Not a block device? So sorry. if ! lvm_internal_dev $2 && "$1" $2; then _ret=0 fi check_vol_slaves_all "$@" && return 0 if [[ -f /sys/dev/block/$2/../dev ]] && [[ /sys/dev/block/$2/../subsystem -ef /sys/class/block ]]; then check_block_and_slaves_all $1 $(<"/sys/dev/block/$2/../dev") && _ret=0 fi [[ -d /sys/dev/block/$2/slaves ]] || return 1 for _x in /sys/dev/block/$2/slaves/*; do [[ -f $_x/dev ]] || continue [[ $_x/subsystem -ef /sys/class/block ]] || continue check_block_and_slaves_all $1 $(<"$_x/dev") && _ret=0 done return $_ret } # for_each_host_dev_and_slaves <func> # Execute "<func> <dev>" for every "<dev>" found # in ${host_devs[@]} and their slaves for_each_host_dev_and_slaves_all() { local _func="$1" local _dev local _ret=1 [[ "${host_devs[@]}" ]] || return 2 for _dev in "${host_devs[@]}"; do [[ -b "$_dev" ]] || continue if check_block_and_slaves_all $_func $(get_maj_min $_dev); then _ret=0 fi done return $_ret } for_each_host_dev_and_slaves() { local _func="$1" local _dev [[ "${host_devs[@]}" ]] || return 2 for _dev in "${host_devs[@]}"; do [[ -b "$_dev" ]] || continue check_block_and_slaves $_func $(get_maj_min $_dev) && return 0 done return 1 } # ugly workaround for the lvm design # There is no volume group device, # so, there are no slave devices for volume groups. # Logical volumes only have the slave devices they really live on, # but you cannot create the logical volume without the volume group. # And the volume group might be bigger than the devices the LV needs. check_vol_slaves() { local _lv _vg _pv _dm _majmin _majmin="$2" _lv="/dev/block/$_majmin" _dm=/sys/dev/block/$_majmin/dm [[ -f $_dm/uuid && $(<$_dm/uuid) =~ LVM-* ]] || return 1 _vg=$(dmsetup splitname --noheadings -o vg_name $(<"$_dm/name") ) # strip space _vg="${_vg//[[:space:]]/}" if [[ $_vg ]]; then for _pv in $(lvm vgs --noheadings -o pv_name "$_vg" 2>/dev/null) do check_block_and_slaves $1 $(get_maj_min $_pv) && return 0 done fi return 1 } check_vol_slaves_all() { local _lv _vg _pv _majmin _majmin="$2" _lv="/dev/block/$_majmin" _dm="/sys/dev/block/$_majmin/dm" [[ -f $_dm/uuid && $(<$_dm/uuid) =~ LVM-* ]] || return 1 _vg=$(dmsetup splitname --noheadings -o vg_name $(<"$_dm/name") ) # strip space _vg="${_vg//[[:space:]]/}" if [[ $_vg ]]; then for _pv in $(lvm vgs --noheadings -o pv_name "$_vg" 2>/dev/null) do check_block_and_slaves_all $1 $(get_maj_min $_pv) done return 0 fi return 1 } # fs_get_option <filesystem options> <search for option> # search for a specific option in a bunch of filesystem options # and return the value fs_get_option() { local _fsopts=$1 local _option=$2 local OLDIFS="$IFS" IFS=, set -- $_fsopts IFS="$OLDIFS" while [ $# -gt 0 ]; do case $1 in $_option=*) echo ${1#${_option}=} break esac shift done } check_kernel_config() { local _config_opt="$1" local _config_file [[ -f /boot/config-$kernel ]] \ && _config_file="/boot/config-$kernel" [[ -f /lib/modules/$kernel/config ]] \ && _config_file="/lib/modules/$kernel/config" # no kernel config file, so return true [[ $_config_file ]] || return 0 grep -q -F "${_config_opt}=" "$_config_file" && return 0 return 1 } # get_cpu_vendor # Only two values are returned: AMD or Intel get_cpu_vendor () { if grep -qE AMD /proc/cpuinfo; then printf "AMD" fi if grep -qE Intel /proc/cpuinfo; then printf "Intel" fi } # get_host_ucode # Get the hosts' ucode file based on the /proc/cpuinfo get_ucode_file () { local family=`grep -E "cpu family" /proc/cpuinfo | head -1 | sed s/.*:\ //` local model=`grep -E "model" /proc/cpuinfo |grep -v name | head -1 | sed s/.*:\ //` local stepping=`grep -E "stepping" /proc/cpuinfo | head -1 | sed s/.*:\ //` if [[ "$(get_cpu_vendor)" == "AMD" ]]; then if [[ $family -ge 21 ]]; then printf "microcode_amd_fam%xh.bin" $family else printf "microcode_amd.bin" fi fi if [[ "$(get_cpu_vendor)" == "Intel" ]]; then # The /proc/cpuinfo are in decimal. printf "%02x-%02x-%02x" ${family} ${model} ${stepping} fi } # Get currently loaded modules # sorted, and delimited by newline get_loaded_kernel_modules () { local modules=( ) while read _module _size _used _used_by; do modules+=( "$_module" ) done <<< "$(lsmod | sed -n '1!p')" printf '%s\n' "${modules[@]}" | sort } # Not every device in /dev/mapper should be examined. # If it is an LVM device, touch only devices which have /dev/VG/LV symlink. lvm_internal_dev() { local dev_dm_dir=/sys/dev/block/$1/dm [[ ! -f $dev_dm_dir/uuid || $(<$dev_dm_dir/uuid) != LVM-* ]] && return 1 # Not an LVM device local DM_VG_NAME DM_LV_NAME DM_LV_LAYER eval $(dmsetup splitname --nameprefixes --noheadings --rows "$(<$dev_dm_dir/name)" 2>/dev/null) [[ ${DM_VG_NAME} ]] && [[ ${DM_LV_NAME} ]] || return 0 # Better skip this! [[ ${DM_LV_LAYER} ]] || [[ ! -L /dev/${DM_VG_NAME}/${DM_LV_NAME} ]] } btrfs_devs() { local _mp="$1" btrfs device usage "$_mp" \ | while read _dev _rest; do str_starts "$_dev" "/" || continue _dev=${_dev%,} printf -- "%s\n" "$_dev" done } # block_is_nbd <maj:min> # Check whether $1 is an nbd device block_is_nbd() { [[ -b /dev/block/$1 && $1 == 43:* ]] } # block_is_iscsi <maj:min> # Check whether $1 is an nbd device block_is_iscsi() { local _dir local _dev=$1 [[ -L "/sys/dev/block/$_dev" ]] || return _dir="$(readlink -f "/sys/dev/block/$_dev")" || return until [[ -d "$_dir/sys" || -d "$_dir/iscsi_session" ]]; do _dir="$_dir/.." done [[ -d "$_dir/iscsi_session" ]] } # block_is_fcoe <maj:min> # Check whether $1 is an FCoE device # Will not work for HBAs that hide the ethernet aspect # completely and present a pure FC device block_is_fcoe() { local _dir local _dev=$1 [[ -L "/sys/dev/block/$_dev" ]] || return _dir="$(readlink -f "/sys/dev/block/$_dev")" until [[ -d "$_dir/sys" ]]; do _dir="$_dir/.." if [[ -d "$_dir/subsystem" ]]; then subsystem=$(basename $(readlink $_dir/subsystem)) [[ $subsystem == "fcoe" ]] && return 0 fi done return 1 } # block_is_netdevice <maj:min> # Check whether $1 is a net device block_is_netdevice() { block_is_nbd "$1" || block_is_iscsi "$1" || block_is_fcoe "$1" }dracut-init.sh000075500000104533151701010110007317 0ustar00#!/bin/bash # # functions used only by dracut and dracut modules # # Copyright 2005-2009 Red Hat, Inc. All rights reserved. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. # export LC_MESSAGES=C if [[ "$EUID" = "0" ]]; then export DRACUT_CP="cp --reflink=auto --sparse=auto --preserve=mode,timestamps,xattr,links -dfr" else export DRACUT_CP="cp --reflink=auto --sparse=auto --preserve=mode,timestamps,links -dfr" fi # is_func <command> # Check whether $1 is a function. is_func() { [[ "$(type -t "$1")" = "function" ]] } if ! [[ $dracutbasedir ]]; then dracutbasedir=${BASH_SOURCE[0]%/*} [[ $dracutbasedir = dracut-functions* ]] && dracutbasedir="." [[ $dracutbasedir ]] || dracutbasedir="." dracutbasedir="$(readlink -f $dracutbasedir)" fi if ! is_func dinfo >/dev/null 2>&1; then . "$dracutbasedir/dracut-logger.sh" dlog_init fi if ! [[ $initdir ]]; then dfatal "initdir not set" exit 1 fi if ! [[ -d $initdir ]]; then mkdir -p "$initdir" fi if ! [[ $kernel ]]; then kernel=$(uname -r) export kernel fi srcmods="/lib/modules/$kernel/" [[ $drivers_dir ]] && { if ! command -v kmod &>/dev/null && vercmp "$(modprobe --version | cut -d' ' -f3)" lt 3.7; then dfatal 'To use --kmoddir option module-init-tools >= 3.7 is required.' exit 1 fi srcmods="$drivers_dir" } export srcmods [[ $DRACUT_FIRMWARE_PATH ]] || export DRACUT_FIRMWARE_PATH="/lib/firmware/updates:/lib/firmware:/lib/firmware/$kernel" # export standard hookdirs [[ $hookdirs ]] || { hookdirs="cmdline pre-udev pre-trigger netroot " hookdirs+="initqueue initqueue/settled initqueue/online initqueue/finished initqueue/timeout " hookdirs+="pre-mount pre-pivot cleanup mount " hookdirs+="emergency shutdown-emergency pre-shutdown shutdown " export hookdirs } DRACUT_LDD=${DRACUT_LDD:-ldd} DRACUT_TESTBIN=${DRACUT_TESTBIN:-/bin/sh} DRACUT_LDCONFIG=${DRACUT_LDCONFIG:-ldconfig} . $dracutbasedir/dracut-functions.sh # Detect lib paths if ! [[ $libdirs ]] ; then if [[ "$(ldd /bin/sh)" == */lib64/* ]] &>/dev/null \ && [[ -d /lib64 ]]; then libdirs+=" /lib64" [[ -d /usr/lib64 ]] && libdirs+=" /usr/lib64" else libdirs+=" /lib" [[ -d /usr/lib ]] && libdirs+=" /usr/lib" fi libdirs+=" $(ldconfig_paths)" export libdirs fi # helper function for check() in module-setup.sh # to check for required installed binaries # issues a standardized warning message require_binaries() { local _module_name="${moddir##*/}" local _ret=0 if [[ "$1" = "-m" ]]; then _module_name="$2" shift 2 fi for cmd in "$@"; do if ! find_binary "$cmd" &>/dev/null; then dinfo "dracut module '${_module_name#[0-9][0-9]}' will not be installed, because command '$cmd' could not be found!" ((_ret++)) fi done return $_ret } require_any_binary() { local _module_name="${moddir##*/}" local _ret=1 if [[ "$1" = "-m" ]]; then _module_name="$2" shift 2 fi for cmd in "$@"; do if find_binary "$cmd" &>/dev/null; then _ret=0 break fi done if (( $_ret != 0 )); then dinfo "$_module_name: Could not find any command of '$@'!" return 1 fi return 0 } dracut_need_initqueue() { >"$initdir/lib/dracut/need-initqueue" } dracut_module_included() { [[ " $mods_to_load $modules_loaded " == *\ $*\ * ]] } dracut_no_switch_root() { >"$initdir/lib/dracut/no-switch-root" } dracut_module_path() { echo ${dracutbasedir}/modules.d/??${1} | { read a b; echo "$a"; } } if ! [[ $DRACUT_INSTALL ]]; then DRACUT_INSTALL=$(find_binary dracut-install) fi if ! [[ $DRACUT_INSTALL ]] && [[ -x $dracutbasedir/dracut-install ]]; then DRACUT_INSTALL=$dracutbasedir/dracut-install elif ! [[ $DRACUT_INSTALL ]] && [[ -x $dracutbasedir/install/dracut-install ]]; then DRACUT_INSTALL=$dracutbasedir/install/dracut-install fi if ! [[ -x $DRACUT_INSTALL ]]; then dfatal "dracut-install not found!" exit 10 fi if [[ $hostonly == "-h" ]]; then if ! [[ $DRACUT_KERNEL_MODALIASES ]] || ! [[ -f "$DRACUT_KERNEL_MODALIASES" ]]; then export DRACUT_KERNEL_MODALIASES="${DRACUT_TMPDIR}/modaliases" $DRACUT_INSTALL ${srcmods:+--kerneldir "$srcmods"} --modalias > "$DRACUT_KERNEL_MODALIASES" fi fi [[ $DRACUT_RESOLVE_LAZY ]] || export DRACUT_RESOLVE_DEPS=1 inst_dir() { [[ -e ${initdir}/"$1" ]] && return 0 # already there $DRACUT_INSTALL ${initdir:+-D "$initdir"} -d "$@" (($? != 0)) && derror FAILED: $DRACUT_INSTALL ${initdir:+-D "$initdir"} -d "$@" || : } inst() { local _hostonly_install if [[ "$1" == "-H" ]]; then _hostonly_install="-H" shift fi [[ -e ${initdir}/"${2:-$1}" ]] && return 0 # already there $DRACUT_INSTALL ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} ${_hostonly_install:+-H} "$@" (($? != 0)) && derror FAILED: $DRACUT_INSTALL ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} ${_hostonly_install:+-H} "$@" || : } inst_simple() { local _hostonly_install if [[ "$1" == "-H" ]]; then _hostonly_install="-H" shift fi [[ -e ${initdir}/"${2:-$1}" ]] && return 0 # already there [[ -e $1 ]] || return 1 # no source $DRACUT_INSTALL ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${_hostonly_install:+-H} "$@" (($? != 0)) && derror FAILED: $DRACUT_INSTALL ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${_hostonly_install:+-H} "$@" || : } inst_symlink() { local _hostonly_install if [[ "$1" == "-H" ]]; then _hostonly_install="-H" shift fi [[ -e ${initdir}/"${2:-$1}" ]] && return 0 # already there [[ -L $1 ]] || return 1 $DRACUT_INSTALL ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} ${_hostonly_install:+-H} "$@" (($? != 0)) && derror FAILED: $DRACUT_INSTALL ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} ${_hostonly_install:+-H} "$@" || : } inst_multiple() { local _ret $DRACUT_INSTALL ${initdir:+-D "$initdir"} -a ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} "$@" _ret=$? (($_ret != 0)) && derror FAILED: $DRACUT_INSTALL ${initdir:+-D "$initdir"} -a ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} ${_hostonly_install:+-H} "$@" || : return $_ret } dracut_install() { inst_multiple "$@" } dracut_instmods() { local _silent=0; local i; [[ $no_kernel = yes ]] && return for i in "$@"; do [[ $i == "--silent" ]] && _silent=1 done $DRACUT_INSTALL \ ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${hostonly:+-H} ${omit_drivers:+-N "$omit_drivers"} ${srcmods:+--kerneldir "$srcmods"} -m "$@" (($? != 0)) && (($_silent == 0)) && derror FAILED: $DRACUT_INSTALL ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${hostonly:+-H} ${omit_drivers:+-N "$omit_drivers"} ${srcmods:+--kerneldir "$srcmods"} -m "$@" || : } inst_library() { local _hostonly_install if [[ "$1" == "-H" ]]; then _hostonly_install="-H" shift fi [[ -e ${initdir}/"${2:-$1}" ]] && return 0 # already there [[ -e $1 ]] || return 1 # no source $DRACUT_INSTALL ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} ${_hostonly_install:+-H} "$@" (($? != 0)) && derror FAILED: $DRACUT_INSTALL ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} ${_hostonly_install:+-H} "$@" || : } inst_binary() { $DRACUT_INSTALL ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} "$@" (($? != 0)) && derror FAILED: $DRACUT_INSTALL ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} "$@" || : } inst_script() { $DRACUT_INSTALL ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} "$@" (($? != 0)) && derror FAILED: $DRACUT_INSTALL ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} "$@" || : } inst_fsck_help() { local _helper="/run/dracut/fsck/fsck_help_$1.txt" $DRACUT_INSTALL ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} "$2" $_helper (($? != 0)) && derror $DRACUT_INSTALL ${initdir:+-D "$initdir"} ${loginstall:+-L "$loginstall"} ${DRACUT_RESOLVE_DEPS:+-l} ${DRACUT_FIPS_MODE:+-f} "$2" $_helper || : } # Use with form hostonly="$(optional_hostonly)" inst_xxxx <args> # If hosotnly mode is set to "strict", hostonly restrictions will still # be applied, else will ignore hostonly mode and try to install all # given modules. optional_hostonly() { if [[ $hostonly_mode = "strict" ]]; then printf -- "$hostonly" else printf "" fi } mark_hostonly() { for i in "$@"; do echo "$i" >> "$initdir/lib/dracut/hostonly-files" done } # find symlinks linked to given library file # $1 = library file # Function searches for symlinks by stripping version numbers appended to # library filename, checks if it points to the same target and finally # prints the list of symlinks to stdout. # # Example: # rev_lib_symlinks libfoo.so.8.1 # output: libfoo.so.8 libfoo.so # (Only if libfoo.so.8 and libfoo.so exists on host system.) rev_lib_symlinks() { [[ ! $1 ]] && return 0 local fn="$1" orig="$(readlink -f "$1")" links='' [[ ${fn} == *.so.* ]] || return 1 until [[ ${fn##*.} == so ]]; do fn="${fn%.*}" [[ -L ${fn} && $(readlink -f "${fn}") == ${orig} ]] && links+=" ${fn}" done echo "${links}" } # attempt to install any programs specified in a udev rule inst_rule_programs() { local _prog _bin for _prog in $(sed -nr 's/.*PROGRAM==?"([^ "]+).*/\1/p' "$1"); do _bin="" if [ -x ${udevdir}/$_prog ]; then _bin=${udevdir}/$_prog elif [[ "${_prog/\$env\{/}" == "$_prog" ]]; then _bin=$(find_binary "$_prog") || { dinfo "Skipping program $_prog using in udev rule ${1##*/} as it cannot be found" continue; } fi [[ $_bin ]] && inst_binary "$_bin" done for _prog in $(sed -nr 's/.*RUN[+=]=?"([^ "]+).*/\1/p' "$1"); do _bin="" if [ -x ${udevdir}/$_prog ]; then _bin=${udevdir}/$_prog elif [[ "${_prog/\$env\{/}" == "$_prog" ]] && [[ "${_prog}" != "/sbin/initqueue" ]]; then _bin=$(find_binary "$_prog") || { dinfo "Skipping program $_prog using in udev rule ${1##*/} as it cannot be found" continue; } fi [[ $_bin ]] && inst_binary "$_bin" done for _prog in $(sed -nr 's/.*IMPORT\{program\}==?"([^ "]+).*/\1/p' "$1"); do _bin="" if [ -x ${udevdir}/$_prog ]; then _bin=${udevdir}/$_prog elif [[ "${_prog/\$env\{/}" == "$_prog" ]]; then _bin=$(find_binary "$_prog") || { dinfo "Skipping program $_prog using in udev rule ${1##*/} as it cannot be found" continue; } fi [[ $_bin ]] && dracut_install "$_bin" done } # attempt to install any programs specified in a udev rule inst_rule_group_owner() { local i for i in $(sed -nr 's/.*OWNER=?"([^ "]+).*/\1/p' "$1"); do if ! grep -Eq "^$i:" "$initdir/etc/passwd" 2>/dev/null; then grep -E "^$i:" /etc/passwd 2>/dev/null >> "$initdir/etc/passwd" fi done for i in $(sed -nr 's/.*GROUP=?"([^ "]+).*/\1/p' "$1"); do if ! grep -Eq "^$i:" "$initdir/etc/group" 2>/dev/null; then grep -E "^$i:" /etc/group 2>/dev/null >> "$initdir/etc/group" fi done } inst_rule_initqueue() { if grep -q -F initqueue "$1"; then dracut_need_initqueue fi } # udev rules always get installed in the same place, so # create a function to install them to make life simpler. inst_rules() { local _target=/etc/udev/rules.d _rule _found inst_dir "${udevdir}/rules.d" inst_dir "$_target" for _rule in "$@"; do if [ "${_rule#/}" = "$_rule" ]; then for r in ${udevdir}/rules.d ${hostonly:+/etc/udev/rules.d}; do [[ -e $r/$_rule ]] || continue _found="$r/$_rule" inst_rule_programs "$_found" inst_rule_group_owner "$_found" inst_rule_initqueue "$_found" inst_simple "$_found" done fi for r in '' $dracutbasedir/rules.d/; do # skip rules without an absolute path [[ "${r}$_rule" != /* ]] && continue [[ -f ${r}$_rule ]] || continue _found="${r}$_rule" inst_rule_programs "$_found" inst_rule_group_owner "$_found" inst_rule_initqueue "$_found" inst_simple "$_found" "$_target/${_found##*/}" done [[ $_found ]] || dinfo "Skipping udev rule: $_rule" done } inst_rules_wildcard() { local _target=/etc/udev/rules.d _rule _found inst_dir "${udevdir}/rules.d" inst_dir "$_target" for _rule in ${udevdir}/rules.d/$1 ${dracutbasedir}/rules.d/$1 ; do [[ -e $_rule ]] || continue inst_rule_programs "$_rule" inst_rule_group_owner "$_rule" inst_rule_initqueue "$_rule" inst_simple "$_rule" _found=$_rule done if [[ -n ${hostonly} ]] ; then for _rule in ${_target}/$1 ; do [[ -f $_rule ]] || continue inst_rule_programs "$_rule" inst_rule_group_owner "$_rule" inst_rule_initqueue "$_rule" inst_simple "$_rule" _found=$_rule done fi [[ $_found ]] || dinfo "Skipping udev rule: $_rule" } # make sure that library links are correct and up to date build_ld_cache() { for f in "$dracutsysrootdir"/etc/ld.so.conf "$dracutsysrootdir"/etc/ld.so.conf.d/*; do [[ -f $f ]] && inst_simple "${f#$dracutsysrootdir}" done if ! ldconfig -r "$initdir" -f /etc/ld.so.conf; then if [[ $EUID == 0 ]]; then derror "ldconfig exited ungracefully" else derror "ldconfig might need uid=0 (root) for chroot()" fi fi } prepare_udev_rules() { [ -z "$UDEVVERSION" ] && export UDEVVERSION=$(udevadm --version | { read v _ ; echo $v ; }) for f in "$@"; do f="${initdir}/etc/udev/rules.d/$f" [ -e "$f" ] || continue while read line || [ -n "$line" ]; do if [ "${line%%IMPORT PATH_ID}" != "$line" ]; then if [ $UDEVVERSION -ge 174 ]; then printf '%sIMPORT{builtin}="path_id"\n' "${line%%IMPORT PATH_ID}" else printf '%sIMPORT{program}="path_id %%p"\n' "${line%%IMPORT PATH_ID}" fi elif [ "${line%%IMPORT BLKID}" != "$line" ]; then if [ $UDEVVERSION -ge 176 ]; then printf '%sIMPORT{builtin}="blkid"\n' "${line%%IMPORT BLKID}" else printf '%sIMPORT{program}="/sbin/blkid -o udev -p $tempnode"\n' "${line%%IMPORT BLKID}" fi else echo "$line" fi done < "${f}" > "${f}.new" mv "${f}.new" "$f" done } # install function specialized for hooks # $1 = type of hook, $2 = hook priority (lower runs first), $3 = hook # All hooks should be POSIX/SuS compliant, they will be sourced by init. inst_hook() { if ! [[ -f $3 ]]; then dfatal "Cannot install a hook ($3) that does not exist." dfatal "Aborting initrd creation." exit 1 elif ! [[ "$hookdirs" == *$1* ]]; then dfatal "No such hook type $1. Aborting initrd creation." exit 1 fi inst_simple "$3" "/lib/dracut/hooks/${1}/${2}-${3##*/}" } # install any of listed files # # If first argument is '-d' and second some destination path, first accessible # source is installed into this path, otherwise it will installed in the same # path as source. If none of listed files was installed, function return 1. # On first successful installation it returns with 0 status. # # Example: # # inst_any -d /bin/foo /bin/bar /bin/baz # # Lets assume that /bin/baz exists, so it will be installed as /bin/foo in # initramfs. inst_any() { local to f [[ $1 = '-d' ]] && to="$2" && shift 2 for f in "$@"; do [[ -e $f ]] || continue [[ $to ]] && inst "$f" "$to" && return 0 inst "$f" && return 0 done return 1 } # inst_libdir_file [-n <pattern>] <file> [<file>...] # Install a <file> located on a lib directory to the initramfs image # -n <pattern> install matching files inst_libdir_file() { local _files if [[ "$1" == "-n" ]]; then local _pattern=$2 shift 2 for _dir in $libdirs; do for _i in "$@"; do for _f in "$_dir"/$_i; do [[ "$_f" =~ $_pattern ]] || continue [[ -e "$_f" ]] && _files+="$_f " done done done else for _dir in $libdirs; do for _i in "$@"; do for _f in "$_dir"/$_i; do [[ -e "$_f" ]] && _files+="$_f " done done done fi [[ $_files ]] && inst_multiple $_files } # install function decompressing the target and handling symlinks # $@ = list of compressed (gz or bz2) files or symlinks pointing to such files # # Function install targets in the same paths inside overlay but decompressed # and without extensions (.gz, .bz2). inst_decompress() { local _src _cmd for _src in $@ do case ${_src} in *.gz) _cmd='gzip -f -d' ;; *.bz2) _cmd='bzip2 -d' ;; *) return 1 ;; esac inst_simple ${_src} # Decompress with chosen tool. We assume that tool changes name e.g. # from 'name.gz' to 'name'. ${_cmd} "${initdir}${_src}" done } # It's similar to above, but if file is not compressed, performs standard # install. # $@ = list of files inst_opt_decompress() { local _src for _src in $@; do inst_decompress "${_src}" || inst "${_src}" done } # module_check <dracut module> # execute the check() function of module-setup.sh of <dracut module> # or the "check" script, if module-setup.sh is not found # "check $hostonly" is called module_check() { local _moddir=$(echo ${dracutbasedir}/modules.d/??${1} | { read a b; echo "$a"; }) local _ret local _forced=0 local _hostonly=$hostonly [ $# -eq 2 ] && _forced=$2 [[ -d $_moddir ]] || return 1 if [[ ! -f $_moddir/module-setup.sh ]]; then # if we do not have a check script, we are unconditionally included [[ -x $_moddir/check ]] || return 0 [ $_forced -ne 0 ] && unset hostonly $_moddir/check $hostonly _ret=$? else unset check depends cmdline install installkernel check() { true; } . $_moddir/module-setup.sh is_func check || return 0 [ $_forced -ne 0 ] && unset hostonly moddir=$_moddir check $hostonly _ret=$? unset check depends cmdline install installkernel fi hostonly=$_hostonly return $_ret } # module_check_mount <dracut module> # execute the check() function of module-setup.sh of <dracut module> # or the "check" script, if module-setup.sh is not found # "mount_needs=1 check 0" is called module_check_mount() { local _moddir=$(echo ${dracutbasedir}/modules.d/??${1} | { read a b; echo "$a"; }) local _ret mount_needs=1 [[ -d $_moddir ]] || return 1 if [[ ! -f $_moddir/module-setup.sh ]]; then # if we do not have a check script, we are unconditionally included [[ -x $_moddir/check ]] || return 0 mount_needs=1 $_moddir/check 0 _ret=$? else unset check depends cmdline install installkernel check() { false; } . $_moddir/module-setup.sh moddir=$_moddir check 0 _ret=$? unset check depends cmdline install installkernel fi unset mount_needs return $_ret } # module_depends <dracut module> # execute the depends() function of module-setup.sh of <dracut module> # or the "depends" script, if module-setup.sh is not found module_depends() { local _moddir=$(echo ${dracutbasedir}/modules.d/??${1} | { read a b; echo "$a"; }) local _ret [[ -d $_moddir ]] || return 1 if [[ ! -f $_moddir/module-setup.sh ]]; then # if we do not have a check script, we have no deps [[ -x $_moddir/check ]] || return 0 $_moddir/check -d return $? else unset check depends cmdline install installkernel depends() { true; } . $_moddir/module-setup.sh moddir=$_moddir depends _ret=$? unset check depends cmdline install installkernel return $_ret fi } # module_cmdline <dracut module> # execute the cmdline() function of module-setup.sh of <dracut module> # or the "cmdline" script, if module-setup.sh is not found module_cmdline() { local _moddir=$(echo ${dracutbasedir}/modules.d/??${1} | { read a b; echo "$a"; }) local _ret [[ -d $_moddir ]] || return 1 if [[ ! -f $_moddir/module-setup.sh ]]; then [[ -x $_moddir/cmdline ]] && . "$_moddir/cmdline" return $? else unset check depends cmdline install installkernel cmdline() { true; } . $_moddir/module-setup.sh moddir=$_moddir cmdline _ret=$? unset check depends cmdline install installkernel return $_ret fi } # module_install <dracut module> # execute the install() function of module-setup.sh of <dracut module> # or the "install" script, if module-setup.sh is not found module_install() { local _moddir=$(echo ${dracutbasedir}/modules.d/??${1} | { read a b; echo "$a"; }) local _ret [[ -d $_moddir ]] || return 1 if [[ ! -f $_moddir/module-setup.sh ]]; then [[ -x $_moddir/install ]] && . "$_moddir/install" return $? else unset check depends cmdline install installkernel install() { true; } . $_moddir/module-setup.sh moddir=$_moddir install _ret=$? unset check depends cmdline install installkernel return $_ret fi } # module_installkernel <dracut module> # execute the installkernel() function of module-setup.sh of <dracut module> # or the "installkernel" script, if module-setup.sh is not found module_installkernel() { local _moddir=$(echo ${dracutbasedir}/modules.d/??${1} | { read a b; echo "$a"; }) local _ret [[ -d $_moddir ]] || return 1 if [[ ! -f $_moddir/module-setup.sh ]]; then [[ -x $_moddir/installkernel ]] && . "$_moddir/installkernel" return $? else unset check depends cmdline install installkernel installkernel() { true; } . $_moddir/module-setup.sh moddir=$_moddir installkernel _ret=$? unset check depends cmdline install installkernel return $_ret fi } # check_mount <dracut module> # check_mount checks, if a dracut module is needed for the given # device and filesystem types in "${host_fs_types[@]}" check_mount() { local _mod=$1 local _moddir=$(echo ${dracutbasedir}/modules.d/??${1} | { read a b; echo "$a"; }) local _ret local _moddep [ "${#host_fs_types[@]}" -le 0 ] && return 1 # If we are already scheduled to be loaded, no need to check again. [[ " $mods_to_load " == *\ $_mod\ * ]] && return 0 [[ " $mods_checked_as_dep " == *\ $_mod\ * ]] && return 1 # This should never happen, but... [[ -d $_moddir ]] || return 1 [[ $2 ]] || mods_checked_as_dep+=" $_mod " if [[ " $omit_dracutmodules " == *\ $_mod\ * ]]; then return 1 fi if [[ " $dracutmodules $add_dracutmodules $force_add_dracutmodules" == *\ $_mod\ * ]]; then module_check_mount $_mod; ret=$? # explicit module, so also accept ret=255 [[ $ret = 0 || $ret = 255 ]] || return 1 else # module not in our list if [[ $dracutmodules = all ]]; then # check, if we can and should install this module module_check_mount $_mod || return 1 else # skip this module return 1 fi fi for _moddep in $(module_depends $_mod); do # handle deps as if they were manually added [[ " $dracutmodules " == *\ $_mod\ * ]] \ && [[ " $dracutmodules " != *\ $_moddep\ * ]] \ && dracutmodules+=" $_moddep " [[ " $add_dracutmodules " == *\ $_mod\ * ]] \ && [[ " $add_dracutmodules " != *\ $_moddep\ * ]] \ && add_dracutmodules+=" $_moddep " [[ " $force_add_dracutmodules " == *\ $_mod\ * ]] \ && [[ " $force_add_dracutmodules " != *\ $_moddep\ * ]] \ && force_add_dracutmodules+=" $_moddep " # if a module we depend on fail, fail also if ! check_module $_moddep; then derror "dracut module '$_mod' depends on '$_moddep', which can't be installed" return 1 fi done [[ " $mods_to_load " == *\ $_mod\ * ]] || \ mods_to_load+=" $_mod " return 0 } # check_module <dracut module> [<use_as_dep>] # check if a dracut module is to be used in the initramfs process # if <use_as_dep> is set, then the process also keeps track # that the modules were checked for the dependency tracking process check_module() { local _mod=$1 local _moddir=$(echo ${dracutbasedir}/modules.d/??${1} | { read a b; echo "$a"; }) local _ret local _moddep # If we are already scheduled to be loaded, no need to check again. [[ " $mods_to_load " == *\ $_mod\ * ]] && return 0 [[ " $mods_checked_as_dep " == *\ $_mod\ * ]] && return 1 # This should never happen, but... [[ -d $_moddir ]] || return 1 [[ $2 ]] || mods_checked_as_dep+=" $_mod " if [[ " $omit_dracutmodules " == *\ $_mod\ * ]]; then dinfo "dracut module '$_mod' will not be installed, because it's in the list to be omitted!" return 1 fi if [[ " $dracutmodules $add_dracutmodules $force_add_dracutmodules" == *\ $_mod\ * ]]; then if [[ " $dracutmodules $force_add_dracutmodules " == *\ $_mod\ * ]]; then module_check $_mod 1; ret=$? else module_check $_mod 0; ret=$? fi # explicit module, so also accept ret=255 [[ $ret = 0 || $ret = 255 ]] || return 1 else # module not in our list if [[ $dracutmodules = all ]]; then # check, if we can and should install this module module_check $_mod; ret=$? if [[ $ret != 0 ]]; then [[ $2 ]] && return 1 [[ $ret != 255 ]] && return 1 fi else # skip this module return 1 fi fi for _moddep in $(module_depends $_mod); do # handle deps as if they were manually added [[ " $dracutmodules " == *\ $_mod\ * ]] \ && [[ " $dracutmodules " != *\ $_moddep\ * ]] \ && dracutmodules+=" $_moddep " [[ " $add_dracutmodules " == *\ $_mod\ * ]] \ && [[ " $add_dracutmodules " != *\ $_moddep\ * ]] \ && add_dracutmodules+=" $_moddep " [[ " $force_add_dracutmodules " == *\ $_mod\ * ]] \ && [[ " $force_add_dracutmodules " != *\ $_moddep\ * ]] \ && force_add_dracutmodules+=" $_moddep " # if a module we depend on fail, fail also if ! check_module $_moddep; then derror "dracut module '$_mod' depends on '$_moddep', which can't be installed" return 1 fi done [[ " $mods_to_load " == *\ $_mod\ * ]] || \ mods_to_load+=" $_mod " return 0 } # for_each_module_dir <func> # execute "<func> <dracut module> 1" for_each_module_dir() { local _modcheck local _mod local _moddir local _func _func=$1 for _moddir in "$dracutbasedir/modules.d"/[0-9][0-9]*; do [[ -d $_moddir ]] || continue; [[ -e $_moddir/install || -e $_moddir/installkernel || \ -e $_moddir/module-setup.sh ]] || continue _mod=${_moddir##*/}; _mod=${_mod#[0-9][0-9]} $_func $_mod 1 done # Report any missing dracut modules, the user has specified _modcheck="$add_dracutmodules $force_add_dracutmodules" [[ $dracutmodules != all ]] && _modcheck="$_modcheck $dracutmodules" for _mod in $_modcheck; do [[ " $mods_to_load " == *\ $_mod\ * ]] && continue [[ " $force_add_dracutmodules " != *\ $_mod\ * ]] \ && [[ " $dracutmodules " != *\ $_mod\ * ]] \ && [[ " $omit_dracutmodules " == *\ $_mod\ * ]] \ && continue derror "dracut module '$_mod' cannot be found or installed." [[ " $force_add_dracutmodules " == *\ $_mod\ * ]] && exit 1 [[ " $dracutmodules " == *\ $_mod\ * ]] && exit 1 [[ " $add_dracutmodules " == *\ $_mod\ * ]] && exit 1 done } # Install a single kernel module along with any firmware it may require. # $1 = full path to kernel module to install install_kmod_with_fw() { # no need to go further if the module is already installed [[ -e "${initdir}/lib/modules/$kernel/${1##*/lib/modules/$kernel/}" ]] \ && return 0 if [[ $omit_drivers ]]; then local _kmod=${1##*/} _kmod=${_kmod%.ko*} _kmod=${_kmod/-/_} if [[ "$_kmod" =~ $omit_drivers ]]; then dinfo "Omitting driver $_kmod" return 0 fi if [[ "${1##*/lib/modules/$kernel/}" =~ $omit_drivers ]]; then dinfo "Omitting driver $_kmod" return 0 fi fi if [[ $silent_omit_drivers ]]; then local _kmod=${1##*/} _kmod=${_kmod%.ko*} _kmod=${_kmod/-/_} [[ "$_kmod" =~ $silent_omit_drivers ]] && return 0 [[ "${1##*/lib/modules/$kernel/}" =~ $silent_omit_drivers ]] && return 0 fi inst_simple "$1" "/lib/modules/$kernel/${1##*/lib/modules/$kernel/}" ret=$? (($ret != 0)) && return $ret local _modname=${1##*/} _fwdir _found _fw _modname=${_modname%.ko*} for _fw in $(modinfo -k $kernel -F firmware $1 2>/dev/null); do _found='' for _fwdir in $fw_dir; do [[ -d $_fwdir && -f $_fwdir/$_fw ]] || continue inst_simple "$_fwdir/$_fw" "/lib/firmware/$_fw" _found=yes done if [[ $_found != yes ]]; then if ! [[ -d $(echo /sys/module/${_modname//-/_}|{ read a b; echo $a; }) ]]; then dinfo "Possible missing firmware \"${_fw}\" for kernel module" \ "\"${_modname}.ko\"" else dwarn "Possible missing firmware \"${_fw}\" for kernel module" \ "\"${_modname}.ko\"" fi fi done return 0 } # Do something with all the dependencies of a kernel module. # Note that kernel modules depend on themselves using the technique we use # $1 = function to call for each dependency we find # It will be passed the full path to the found kernel module # $2 = module to get dependencies for # rest of args = arguments to modprobe # _fderr specifies FD passed from surrounding scope for_each_kmod_dep() { local _func=$1 _kmod=$2 _cmd _modpath _options shift 2 modprobe "$@" --ignore-install --show-depends $_kmod 2>&${_fderr} | ( while read _cmd _modpath _options || [ -n "$_cmd" ]; do [[ $_cmd = insmod ]] || continue $_func ${_modpath} || exit $? done ) } dracut_kernel_post() { for _f in modules.builtin.bin modules.builtin modules.order; do [[ -e $srcmods/$_f ]] && inst_simple "$srcmods/$_f" "/lib/modules/$kernel/$_f" done # generate module dependencies for the initrd if [[ -d $initdir/lib/modules/$kernel ]] && \ ! depmod -a -b "$initdir" $kernel; then dfatal "\"depmod -a $kernel\" failed." exit 1 fi } instmods() { # instmods [-c [-s]] <kernel module> [<kernel module> ... ] # instmods [-c [-s]] <kernel subsystem> # install kernel modules along with all their dependencies. # <kernel subsystem> can be e.g. "=block" or "=drivers/usb/storage" # -c check # -s silent local _optional="-o" local _silent local _ret [[ $no_kernel = yes ]] && return if [[ $1 = '-c' ]]; then unset _optional shift fi if [[ $1 = '-s' ]]; then _silent=1 shift fi if (($# == 0)); then read -r -d '' -a args set -- "${args[@]}" fi if (($# == 0)); then return 0 fi $DRACUT_INSTALL \ ${initdir:+-D "$initdir"} \ ${loginstall:+-L "$loginstall"} \ ${hostonly:+-H} \ ${omit_drivers:+-N "$omit_drivers"} \ ${srcmods:+--kerneldir "$srcmods"} \ ${_optional:+-o} \ ${_silent:+--silent} \ -m "$@" _ret=$? if (($_ret != 0)) && [[ -z "$_silent" ]]; then derror "FAILED: " \ $DRACUT_INSTALL \ ${initdir:+-D "$initdir"} \ ${loginstall:+-L "$loginstall"} \ ${hostonly:+-H} \ ${omit_drivers:+-N "$omit_drivers"} \ ${srcmods:+--kerneldir "$srcmods"} \ ${_optional:+-o} \ ${_silent:+--silent} \ -m "$@" fi [[ "$optional" ]] && return 0 return $_ret } if [[ "$(ln --help)" == *--relative* ]]; then ln_r() { ln -sfnr "${initdir}/$1" "${initdir}/$2" } else ln_r() { local _source=$1 local _dest=$2 [[ -d "${_dest%/*}" ]] && _dest=$(readlink -f "${_dest%/*}")/${_dest##*/} ln -sfn -- "$(convert_abs_rel "${_dest}" "${_source}")" "${initdir}/${_dest}" } fi dracut-initramfs-restore000075500000003422151701010110011413 0ustar00#!/bin/bash set -e # do some sanity checks first [ -e /run/initramfs/bin/sh ] && exit 0 [ -e /run/initramfs/.need_shutdown ] || exit 0 # SIGTERM signal is received upon forced shutdown: ignore the signal # We want to remain alive to be able to trap unpacking errors to avoid # switching root to an incompletely unpacked initramfs trap 'echo "Received SIGTERM signal, ignoring!" >&2' TERM KERNEL_VERSION="$(uname -r)" [[ $dracutbasedir ]] || dracutbasedir=/usr/lib/dracut SKIP="$dracutbasedir/skipcpio" [[ -x $SKIP ]] || SKIP=cat [[ -f /etc/machine-id ]] && read MACHINE_ID < /etc/machine-id mount -o ro /boot &>/dev/null || true if [[ $MACHINE_ID ]] && [[ -d /boot/${MACHINE_ID} || -L /boot/${MACHINE_ID} ]] ; then IMG="/boot/${MACHINE_ID}/${KERNEL_VERSION}/initrd" fi [[ -f $IMG ]] || IMG="/boot/initramfs-${KERNEL_VERSION}.img" cd /run/initramfs [ -f .need_shutdown -a -f "$IMG" ] || exit 1 if $SKIP "$IMG" | zcat | cpio -id --no-absolute-filenames --quiet >/dev/null; then rm -f -- .need_shutdown elif $SKIP "$IMG" | xzcat | cpio -id --no-absolute-filenames --quiet >/dev/null; then rm -f -- .need_shutdown elif $SKIP "$IMG" | lz4 -d -c | cpio -id --no-absolute-filenames --quiet >/dev/null; then rm -f -- .need_shutdown elif $SKIP "$IMG" | zstd -d -c | cpio -id --no-absolute-filenames --quiet >/dev/null; then rm -f -- .need_shutdown else # something failed, so we clean up echo "Unpacking of $IMG to /run/initramfs failed" >&2 rm -f -- /run/initramfs/shutdown exit 1 fi if [[ -d squash ]]; then unsquashfs -no-xattrs -f -d . squash-root.img >/dev/null if [ $? -ne 0 ]; then echo "Squash module is enabled for this initramfs but failed to unpack squash-root.img" >&2 rm -f -- /run/initramfs/shutdown exit 1 fi fi exit 0 dracut-install000075500000224160151701010110007410 0ustar00ELF>P>@0 @8@! @@@������� ��!�!p x � � !� ! DD��!�!S�td P�td4�4�4�ddQ�tdR�td��!�!P P /lib64/ld-linux-x86-64.so.2GNU�GNUGNU�����0�������!��j jl�bA��Pv�2���������rc8D7�x� �?�K��!�%�g�#>>Y� L�j�F�9 ����7�".����I�� �T=.`��xE��T��g �i��n������i�S0~S(���$�*�! !K !�(!\0!libkmod.so.2__gmon_start___ITM_deregisterTMCloneTable_ITM_registerTMCloneTablekmod_module_get_modulekmod_module_dependency_symbol_get_symbolkmod_get_dirnamekmod_unrefkmod_module_new_from_loadedkmod_module_new_from_lookupkmod_module_get_namekmod_module_get_softdepskmod_list_nextkmod_module_info_get_keykmod_module_unref_listkmod_module_get_infokmod_module_info_free_listkmod_module_get_dependency_symbolskmod_module_unrefkmod_module_get_dependencieskmod_module_dependency_symbols_free_listkmod_module_get_pathkmod_module_new_from_pathkmod_module_info_get_valuekmod_module_symbol_get_symbolkmod_newlibgcc_s.so.1_Unwind_Resume__gcc_personality_v0libc.so.6__xpg_basenamestrcpy__printf_chkfopenstrncmpoptindregexec__open64_2putsforkfutimes__stack_chk_fail__lxstatunlinkmkdirreallocabort_exitmemchrstrpbrkpopengetpidstrspnstrdupfts_closeisattyfeofsymlinkexeclpfgetscallocstrlenwritevstrstrstrcspn__errno_locationmemcmpstrndup__fprintf_chkfchownfts_readmemcpyfclose__vsnprintf_chkstrtoulmallocumaskrealpath__ctype_b_locgetenvfts_setregcompoptargioctl__snprintf_chkgetopt_longpcloseusleep__getdelimgeteuidwaitpidstrchrprogram_invocation_short_nameqsort__cxa_finalizesyscallfts_open__xstatunamestrcmpstrerror__asprintf_chk__libc_start_mainstpcpysysconffree__prognameGCC_3.0GCC_3.3.1GLIBC_2.14GLIBC_2.4GLIBC_2.7GLIBC_2.3GLIBC_2.8GLIBC_2.3.4GLIBC_2.2.5LIBKMOD_22LIBKMOD_5 p0P&yVa_& ^�����hii sii }ii �ii �ti �ui �"�& ��j��!0?�!�>�!�!�!��!�� !S�@!�`! ��!��!��!"��!+�!4� !8�@!?�`!D��!P��!W��!g��!y� !�� !��@ !A�` !��� !��� !��� !�� !9� !E� !J�@ !=�H !N�P !T�X !Y�` !]�h !e�p !l�x !��!�!�!#�!*�!1! !k(!l0!m�!�!�!�!�!�!�!�! �! �!�! ! ! ! ! !( !0 !8 !@ !H !P !X !` !h !p !x !� !� ! � !!� !"� !$� !%� !&� !'� !(� !)� !+� !,� !-� !.� !/� !0!1!2!3!4 !5(!60!78!8@!9H!:P!;X!<`!=h!>p!?x!@�!A�!B�!C�!D�!E�!F�!G�!H�!I�!J�!K�!L�!M�!N�!O�!P!Q!R!S!T !U(!V0!W8!X@!YH!ZP![X!\`!]h!^p!_x!`�!a�!b�!c�!d�!e�!f�!g�!h�!i��H��H�y� H��t��H����52� �%3� ��h�������h��������h�������h�������h�������h�������h�������h��q������h��a������h ��Q������h ��A������h��1������h��!������h ��������h��������h������h�������h��������h�������h�������h�������h�������h�������h��q������h��a������h��Q������h��A������h��1������h��!������h��������h��������h������h �������h!��������h"�������h#�������h$�������h%�������h&�������h'��q������h(��a������h)��Q������h*��A������h+��1������h,��!������h-��������h.��������h/������h0�������h1��������h2�������h3�������h4�������h5�������h6�������h7��q������h8��a������h9��Q������h:��A������h;��1������h<��!������h=��������h>��������h?������h@�������hA��������hB�������hC�������hD�������hE�������hF�������hG��q������hH��a������hI��Q������hJ��A������hK��1������hL��!������hM��������hN��������hO������hP�������hQ��������hR�������hS�������hT�������hU�������hV�������hW��q������hX��a������hY��Q������hZ��A������h[��1������h\��!������h]��������h^��������h_������h`�������ha��������hb�������hc��������%�� D���%�� D���%�� D���%�� D���%�� D���%�� D���%�� D���%�� D���%�� D���%�� D���%�� D���%�� D���%�� D���%�� D���%}� D���%u� D���%m� D���%e� D���%]� D���%U� D���%M� D���%E� D���%=� D���%5� D���%-� D���%%� D���%� D���%� D���% � D���%� D���%�� D���%�� D���%�� D���%�� D���%�� D���%�� D���%�� D���%�� D���%�� D���%�� D���%�� D���%�� D���%�� D���%�� D���%�� D���%�� D���%}� D���%u� D���%m� D���%e� D���%]� D���%U� D���%M� D���%E� D���%=� D���%5� D���%-� D���%%� D���%� D���%� D���% � D���%� D���%�� D���%�� D���%�� D���%�� D���%�� D���%�� D���%�� D���%�� D���%�� D���%�� D���%�� D���%�� D���%�� D���%�� D���%�� D���%�� D���%}� D���%u� D���%m� D���%e� D���%]� D���%U� D���%M� D���%E� D���%=� D���%5� D���%-� D���%%� D���%� D���%� D���% � D���%� D���%�� D���%�� D���%�� D���%�� D���%�� D���%�� DE1�H�|$H��t�.���M��tL�����M��tL���D���H���,�����H������H����H�|$H��t������L�����H�����H�|$����H�����H���?���H�<$�f���H��������H����1�H��H������D���H�����8���H�����H�����HDž����H����������L���H���������H�������L�����L���A�������詁A���tD��蛁L���p���A������I����HDž��������K���H�E�E1�E1�L��H�E����H�}��{���L���s���L���k���H�}��b���H�E�I��H�}��R���H��tH�����L��H�}��9���H�������H����H�E�E1�E1��H�E�E1�E1��u���H�E�E1�E1��b���D��躀�H�E�E1�E1��E�����I���n���1��g���H�}����H�}����L�����H�}����H������H��(������H�� ���H��t���H�����1�H�}�H��t���H�}�H��t���H��tH�����H�E�H��tH������L�����1����I����1����I�����I���1�H�}�H��t�K���H�}�H��t�=���H��tH���0���L���H���1���1���1���1��1��1��1��1��H�}�H��t� ���I��1����I�����I��1����I���1��v���1��o���1��h���1��a���1��Z���1��S���1��L���1��E���1��>���1��7���1��0���1��)���1��"������H��H����������H����������H���������L������H���_���HDžP���H��P�������H������H��t����H��@���H��t�H���3����E1�L�����H������H��t�������H������H���HDžP����HDžP����HDžP����s���HDžP����c���HDžP����S���E1��0���L������#���H������H�������]���� ���HDžP�������E1��B���E1��:���L�����H���H���1�H�����H���6���fD��AWAVAUATI��U��SH��(dH�%(H�D$1��t���,1��%g�i�=�� ����eL�5�SL�-�SL��L����S�=`� H�� tQH�==� 1��v���H��H���� H�D$H�\$�H����H�=�� 1�H���ZH��u�1���H�=�����H��H���I��L���1���H� >�H�5&���"dH��H�5C��o�H�� �2���H��� H���L�;�CH�5�H��������j1�H�����H�Y� H����H���@���L��L����RL��L��H��� ��RH�=�� H��� �H���H�=�� ��H��� H��tP�v�H��H����A��H�=�� 1������H�=�� H�5����H�� H���;Lc-�� E�uL��A9�}EJ��H�5�� M�<H�$I�?�����u"A�EH�$9���A�M9�u ��I�DI�)݀=N� �,$���=<� ���=2� ��$��������I���/O�4�O�d�L���h���H����� �� ��� L��L��A��@�Å�t<�=�� u@PH� ���KM��AVL����1�H�5����aZY�=�� ��1���c�������H�L$dH3%(���H��([]A\A]A^A_�H�=����H�+� H�����8��H������H� � H�����L���H� g�1��H�5H����?aH�=(� H��t����@H����H�=i� ��YH��u�� DH����H�=Y� ��YH��u�� DH���p�H�=1� �YH��u�H�=(� �SQH�=� �GQH�=� �;QH�=<� �/�H�=� ��fH�=� ��f���O�$�E1�1��J��� � �� L��A�H��I���`L��������t �=�� �A��I��D94$�5���M�$�X�1�L���H� ͝H�5���_M�,$�/L����L��H���e�����H�D$H��t�L�|$1�� I����M�/M����M��`�1�L�+�H� Y�H�5���_� � L��L���� A��v�Ņ�u�M��c�1�L��H� �H�56��7_�n���M�$�q�1�L�D�H� ܜ�H�5��_����H�|$�Te���I�ٺ�L���H� ߝH�5DŽ���^����K�4����9�����H�==� 1�H��1�O�,�E1��H��H��H��H���VM�uI�H�=�� L���QH��tL��H���?��t$L�����H�=�� H��H���OL���i!�A��I��D9<$�7���M�e�1���H�5�L�{�M��H� ՛�]H�5�� L����H���[���M���Z���D������L� 1� �L� �H� ��H�5�����]�\���L���H�$H���\���L�<$1�L�-f�� I����I�/H����AQM��I��H� ��AV�<H�5>�1���8]AZA�A[� �� ��� L��H���%�Å�u�VL�؆�I��AVH� ���?1�H�5���\_AX�d���H�<$�2c����L�a�1���H� ��H�5���\����H�L� �H� ����H�5s�1��r\����L�4�H� `���H�5C��D\��zL�s�H� 7������H�������H��������H��������1�I��^H��H���PTL���H� /�H�=�����R� �H�=�� H��� H9�tH�>� H��t �����H�=i� H�5b� H)�H��H��H��?H�H�tH�� H��t��fD�����==� u+UH�=�� H��tH�=�� �I��d����� ]������w����H��t;SH����H��H��u�*�H��H��t�</H�B�u�|�/t�H��[�f�1��1�[�f�AW1ҾAVAUATUSH��HH�<$H�|$ dH�%(H��$81�H�i�H�D$H�D$ H�D$(�y�H��I�����H���bH�L$L�t$0H�L$fDH�xp�H�D$H�5�������H�x(H�5���I��H���[H�¾L����H���bL�� H����������!�%����t������D�H�JHDщ��H��L)��"H���|0 u�D0H�T$H�<$L����H�\$����H��tc�H���0�H��I�����H�����L��H���r�H�=�� H��H���JH�|$H���c�H��H��u�H�|$H��t���L���d�L����H�������H�<$H�t$�E��Å���L�d$L�l$L��M����DH�D$L����H��H���$�H���<�H�=�� H��H��H����IH����H�<$L��H����H�\$���H��t_fDH��� �H��H�����H�����H�=�� H��H���{IH���S�H�|$H���V�H��H��u�H�|$H��t���H�|$L���2�I��H���&���H�|$��M��tL�����1�H��$8dH3%(��H��H[]A\A]A^A_�@H�|$H��������m�����H�\$H��H���^����^���f.�H���X���H���K�������L���H� '��H�5(}�1��"W��� �:�������H������H������H������H�����������H����ff.��H��� SH�5����1��I��H���������fDATI��U��SH� �H��dH�%(H��$�1�fDE1�H� �� L���H�_|�u�������D=���Hc�H�>����� �H�=�� H�55|�aH�~� �H�=�� ��H�y� ���� �H��$�dH3%(��H�Đ[]A\��W� �L���H�=�{��1���J� �-���H�5f� � H�= � �E����}�`� ����H�5:� � H�=^� �������6� ������� ������� ������ ������ ������ ������ ���H�5�� � H�=*� ��������� �a����\� �U���H�5�� � H�=r� �m�������� �)���H�5b� � H�=�� �A����=�Z� ���H�=6� ���H��� ������ ����H�=� ���H��� ���H�=�� ���=�� u!�=�� t H�=y� t��� 9�tn��tj�����H�=z��H��H���JI��L��y1���H� ��H�5�y��SH�5�yH���_H�� �1����L��yH� q�1���H�5]y��YS����H��H���t�H������H��� ����L� � L�����H� ��H�5y1��R��E���L� �� L�J���H� ֑��L� �� L�.���H� ���L� �� L�چ��H� ���L� u� L�����H� ���k����L��1���H� c�H�5Vx�WR���ff.�f�AVAUATUSL��$���H��H�$L9�u�H�� dH�%(H��$@1�H��H��I��H�D$��H��H����H������1�H��I���D���I��H����L���W�I�UL�DH9�v+A�8/u%J�T-H��f�H���z�/uI��H9�u�1�H�|$L��H��w�#�����H�|$�D$�����H�w��1�fD��/��H����H��V���u�D�E���}H�sD��E1�f���/��H����I��V���u��MA8��D1�E1��:u</��H����I����u�I9�s;L��1�f.�H���D.L�P�D.H9�vI9��@H��B�D/��E1ҐI������@�QHc��</�.���&��Hc�����H����t��/u�H��I9�u���H�|$M9�woH�|$f�1�M��t B�D/I�rLc�B�������/���AL)�H�L�7f.�A�T����L�H����t��/u�I����M9�v�B�D�-�H��L����H��� �H�|$��H��H��$@dH3<%(�H�� @[]A\A]A^�fDL������I��I��M9������H����I9��������H��E1���H���g���M���1�L���H� 4�H�5�t��NH���`�H���.���D�1�E1�E�������E1�E1�����E1�E1�H��������D��e���L��tH� Ȍ1���H�5Tt��PN���������H���,�DSH���7AH��1�H��t H��������[�ff.�AWAVAUATUSH��H�`� dH�%(H��$�1�H�$H�D$H���H�H���5H��L�l$L�t$I��L�%t�)fDH�t$L���^H����H�H���}1�I��L��L���������H�t$L�������t�L�L$L��s1�H� ݊�H�5s��MH�|$���H�D$H���y���f�H�$L�%{sH��t>H�H��t2H���*I��M��PH� y�H�5�r1���LXZH��u�H�$H��$�dH3%(H��uFH�ĸ[]A\A]A^A_�1��ԿL��r1��H� �H�5Or�PL����������=4� SH��u�=(� uR�[�E1�1�1�H��H�=�� ������u�I�ٺ�L���H� ��H�5�q��K1�[�E1�1�1�H��H�=�� �����t�I�ٺ��1�L��H� a�H�5�q�K1�[Ð��UH�0rH���SH��H� � dH�%(H�D$1�H��H�$�������H�<$H�5r����H��H��tHH��H��1�H��q���H���o��H�<$���H�D$dH3%(u:H��[]��L�$�M�1�L�9�H� �H�5�p�J��g��L�)qH� ɉ1��FH�5�p��J�������H������H��������fD��SH��H��H�=>� 1�H�q��+����x[�DH���5�� I��1��YL��H� ��H�5�o�IXZ[�f�UI��H��AWE��L��pAVAUATI���SH��0H�����������q�����H� �dH�%(H�E�1�VH�5�oHDž���IH�=� XL��Z�@���A�ń��%E��tH�����H�=�� ��������L�����L��L��������>������IH��������H��H���� H�=Z� H��H���?:H�����1�H����H�Ko��9/��L�H� Z� 1��{������ H����L���o����������H�����8H�������{���H��H���[�H������H���#�����������A��t ���������(�����%�=@�2=�����It'��������=�� tH�����1�L���3D�����L�uo1�H� D���H�5�m��GH������M��1�L�XoH� ����H�5�m�G�=� _AXt�=� uH����������=� L����Dž����H��0���L��������h��H���%�=��R�L��1��c����������5��H�����L��1����:��A�Ņ���������Ǿ �@1��k������������P�����L���D��������tK��P��������D��������t4����M��L�4nH� �������H�5Nl��JFH��x���D��H���HDž����HDž���H���H�E�H�������������D�����Z^D���R^�DA�����D�����L����t��(�����������L��lH� �1���H�5�k��E1�E1�H�����H�������D��H�]�dH3%(��H�e�[A\A]A^A_]�f.�M��t�1�L��zH� ��H�5k�E1�A��D�I�R���L��zH� j�1���H�5�j���DL���A��1��E����L�����L��k1�H� !��yH�5�j��D����fDH������I�ك8��L��kH� ߂1���H�5Sj��ODH���������H����H��H��������H������A�1ɺ�H��������������`H������������D�����L�������������� �*\f.��{��A�Dž��VL������H�������8��1�L��D�������x�D����L��k1�H� ���KH�5Vi��RCD����D����uH�=*� tL������E����1�L��jH� ��H�5i�C����f�I��L��i1���H� `�H�5�h���B���f�L���h��H�=� H��H���4����L��iH� �1���H�5�h��BHDž����H������A��������L����L��i1�H� ����H�57h��3BH���������A�����f.�1�L���&��I��H���������E��1�H��H�������aL��L���:��A�Dž��[H����L���������1�H� 2� HDž��H����A�}/H��g���M�D1��(������L����H����L��� �H��I��H�����1�AV��L��hH� �H�5g��AH�����A[L��X�r������H������~��H�����r���=�� ��L���]���E����Dž�����������umH��M��L��v�DAVH� �~�H�5f�@XZ���M����1�L��gH� �~H�5Of�P@A��p���DH��M��L��v1�AVH� H~�GH�5f��@XZ���f.�L���(������DL����L�"g1�H� I~��H�5�e��?��(���H����@��5��A������I�ٺ��1�L��uH� �}H�5se�t?��A�����M����1�L��fH� �}H�5:e�;?���������W�f���H�����1�L���e �;���H��L�����1�L��fAVH� c}��H�5�d���>AYAZ�������L�AeH� 9}1���H�5�d��>������!H�5�d�1��>�8���L��dH� �|1���H�5`d��\>������u@VH�5FfL� fjL�qtH��H� fAVH�fAT���H�� ����QH�5f1�L� �ejL��eH��H� �eAVH��eAT���H�� ���� ���������I���+����I���0����������I���@����I���'����I���M����I�����������������I���2����I��������|�����u�����j����I���������U�����L�����C�����:����I��������%����I�����ff.�UH��AWAVAUATSH��XH�}��dH�%(H�E�1�H�E�H�E��2��H�E�H����H�}�H�5�d�5��H��H���H�M�1�H�}��H��d�������H�}�H�5;e�F��H��H�E��E�H�E�H�E�H�E�@H���P������H�u�H�}�H�ٺ ���H��~�L�M����1�L�AdH� zH�5�a��;H�E�H�5�rH��I���n��H���H�5dL���V��H���-H�5dL���>��H���H�5dL���&��H����H�5dL�����H����H�5dL�����H����H�5dL������H����H�5dL������H����H�5�� L�����I��H����H�5�cL������/H��ID�H������I��H������������< ��L����� tH������u��L�����A�1�1�H��H��I��H�E��p�E����=H���u�M���ZL�oqH� xx�1�H�5$`�%:XZL�}�H�5CcL������H��t!�@A�1�1�L��L������ZH�}��q��L���y��H��H�E��M��I��H���!H���Y��H��I���.��I��H���BH���:��H��I�����H�E�H����H�����H�E�H����H�}�L���a��L���I��� H�=}bL�e�H���H�}�����ME�� ��1�H�5ScH��L��1��*VA�1�1�H��H��I�������:H�5bL�����H����@A�1�1�L��L���������L�M����1�L��aH� �vH�5�^�8�M����1�L��bH� �vH�5h^�i8�E�DH�}�����H��tH���*��H�}������E�H�]�dH3%(��H�e�[A\A]A^A_]�@L�M��\�1�L�aH� :vH�5�]��7����f�E1�L���e��H�}��\��L���T��L���L��H�}��C���M�M�����E1�H�E�E1��L�M��f�1�L��`H� �uH�5e]�f7�w����E1�H�E��s���H�}��1����A�ą�x<H�u�����������QH�E��8#ƀ�u�x!txD���bO����X��H�}���؉E��x������;����؉E�����L���9���M�麌�1�L��_H� �tH�5�\�6���L�h�@A�Ƅ����z��H�I����I��I�E�����DA u�I�EL��u�f.�H��H���t�DA t��M��L�K^1�H� gt���H�5\�6E1��1�L��L�����E���u$D���=NH�}��d������*����؉E���M�麻�1�L��]H� �sH�5�[�5�L���a���L�\H� �s1���H�5l[��h5����� �����B��������������������,���������I���L���������I�����������������I�������������������������I�����ff.�f�UH��AWAVI��AUI��ATSH��H��8dH�%(H�E�1��"��L��I��H�E����H�E�I��H�E�M���7H���.H���6��H�5�]H��I���K����M����H�E�L��J�\;B�8���H�}�I��L��A�H�~]1���������1�H�}�I��L��H�W]��������H���u�L�M��9L�9]H� �q�1�H�5�Y�3H�u�H�}�A�1�XZ1���H�}�1����H�}�����L������H�}�������H�M�dH3%(�&H�e�[A\A]A^A_]�H�^\L��H���f���H�[\L��H���T���H�Z\L��H���B���H�V\L��H���0���L�u�L��J�\;C�>���H�}�I��L��A�H�/\1���h������1�H�}�I��L��H�\��C���������L��XH� �p1��5H�5YX��U2�&L��XH� mp1��#H�51X��-2��s��1���������L��XH� )p1��)H�5�W���1�L�YXH� p1��/H�5�W��1���H�����UH��AWAVH�� ���AUATSH���H�����dH�%(H�E�1�HDž ��������Å��<L�� ���M���wL��0����@H�� ���L���y���I��H����L�����H�ǹ H�5�Z�����u�L������I��I��L��Z1�H� �n���H�5�V��0H�P� H���%H�;�Dž�������L��(����{f.�H��(���A�1�1�H���������H��(�����u.I����L�!Z�H� knH�5NV�O0H��(�������H����H�;�1�M��H��VL��HDž(���H���������&H��(���L���������D���L��(���L�^V1�H� �m��H�5�U��/�c���f���������Z���H���������H��M��L�g��PH� �mH�5nU1���h/XZ�����1�H�� ���H��t���H�M�dH3%(����H�e�[A\A]A^A_]É������H�����I�����H��I��1���AWL�RfH� m�H�5�T��.^_�1��L�LUH� �l1���H�5�T��.�����U����H�������H�����ff.�f�UH��AWAVAUATSH��HdH�%(H�E�1�H���_H�E�I��I��E1�H�E�H�E�L�=K� H�E��L�����H��H�E��̿��H��H���pH�=a� H����������H�=R� H��������BH�}��Y����=ʣ tE1�1�1�H��L���~������H�57� 1�1�H��A�H���A��H�� H�E����H��I��L�GW�PH� YkH�5\S1��H�E�H�E��F-H�}�Y^���H�}����H��H�����A�ƅ���H�}�H��t���H�}�H��t���H��tH���ӿ��H�}�H��t����L��L������I��H�������H�M�dH3%(D����H�e�[A\A]A^A_]�f�H�E�H��t�H���f�H��I��L�:d�PH� ejH�5hR1���b,XZ�h���H�U�H�u�H�}�臾��A�ƅ�� ���H�}����H�}�A�����E��DD����H�}�A�����H���7����0����-���E1��"���蛿����I�������I���5�����4����I�������I��������I���������������@UH��AWAVAUATI��SH��(dH�%(H�E�1�H�E�H�E��ؼ���=I� H�����=� ��L�����H��H����H�=x� H����������H�=i� H����������1�E1�H�}�H��t�ƽ��H�}�H��t踽��H��tH��諽��H�M�dH3%(D����H�e�[A\A]A^A_]�fDH�=� H���a�����N���I�ٺ)�1�L�kbH� iH�5_P�`*�b���H����������=;� H�E����=%� ��H��� H��I��L��SH� �h�<�H�H�5�OP1���)H�5o� XA�1�ZH��1�H�����A�ƅ����=e� �1ۀ=U� �����L���!���I��L��S1��CH� 1hH�5|O��x)1��}����H�u�L���$������<H�E��=J� I���?H����L�5�� �fDH�}�L���d���I��H���L��耻��E1�1�1�H��L��I��軹����u�L���o���H��I��1���AUL�(aH� ag�H�5�N�(_H�}�AXH��t蟼���I�ٺ8�1�L�BaH� 3gH�5~N�(1�A��~���f�E1�1�1�H��H�=o� ������� ���I�ٺ$�1�L�`H� �fH�5(N�)(�+���@L�9`H� �f1���H�5�M��'H�E��=� I����M�������L���Ż�����L���H���I��L�xQ1��@H� XfH�5�M��'L�����L������H��H������A�ƅ������H�U�H�u�L��詹��A�ƅ��j���H�}�����H�}�A������E��AE�A���F���f.�H�E�I��M���x���L�������k���H�E�I�ǀ=�� ����M���K���L�5|� �f.�H�}�L������I��H��t�L���4���E1�1�1�H��L��I���o�����u�L���#���H��I��1���AUL�_H� e�H�5sL�t&H�}�Y^H���?����P����5���1�A������W���A������L����=3� ����������ٹ����I��颾����I���ɾ����I�������I��鹾����I��鱾����I��驾����I��顾����I��陾����I��鑾����H��鉾����I�������I��� �����I��闾����I��钾�����}������`�����I���{�����I���v�����I���q�����I���l�����I���g�����I���b�����I���]�����I���X�����I���S�����I���U����UH��AWAVI��1�AUA��ATSH��H�=]� dH�%(H�E�1�HDžx����~���H��I���3���H�5�NH��H���Q���H��t H)�H� � �=� �1E����A�E�L��h���I�D�E1�H��H���H������H��`���H��x���H��X���H��h���L�oN1�H� �b��H�5 J�L��$H��</��<=��H�5�NH��HDž�����6;����H�5�NH���;����H���O���H��D�H��`���H��L���&������L������M��ut�="� �? �=� ��������L��賵����H�M�dH3%(�7H�e�[A\A]A^A_]�1�H��H���H��H��H��H��D��@������*f�H��������L��AE��+���I��H���ZL��觷��H��I���<���L��A����E��y��=\� u��=R� uLH��h�����L��MH� paH�5�H�L�1��z"��=� ���= � ��H������H������)������H�=kL�x���H���H�5(KH���в��I��H������H�������DL���@�������L��H������H��t�H��L��� H����������!�%����t�I�������D�H�JHDщ�@�H��H)�t�H�������� uƄ����I�ٺ��1�L�LZH� M`H�5`G�a!H�����H�=�� H��H���L���������?���L��菵�����H�5*LH���{8���\����f���H��X���H��L��HDž�����������H��x����]���H���u���I��H���1H��`���H��L���G���H��x������ٲ��HDžx�������L������M�����=&� ���=� �H��h���ASM��L��JH� 2_���0H�59F1��8 AYAZ��H��h�����L�$YH� �^H�5F�L�1���=�� ��E1�L���w���H������H��t趲��H��h���H��h���H9�H��������1��X���I�ٺ��1�L��JH� v^H�5�E��'���H������H��t�T���A���t�E��t��=� �A��w���L�K�$�1�L��IH� ^HDž����H�5EHDž����HDž�����H��h���H��� H������H��I�H�H��L�@1�萰������H��h���H��H������H�`I�H�L�@1��]�������H��h���H��H������H�9I�H�L�@1��*�������H������H������1ҾHDž����H������H������H������H������H�������*���H��H��@���蛱��I�Ń�M����fA�}bHDž������A�EbM�M(��f���;L��HH� �\1��JH�5�C��I�u(H��X���L��膲�����\H��x�������H������H��P���H���H��`���H��P���L�����H��x���A���u���HDžx���E���5L������M��u&��H��������L��AE��K���I��H����L���DZ��H��I���\�L��A������E��y��=|� u��=r� ��L��P���L�0G1�H� �[�yH�5�B���L�cGH� f[1��GH�5rB��nHDžP���H��P������H������H��t�&���H��@����ʯ��I���-���M�M(�N�1�L�#UH� �ZH�5B��=�� u�HDžP���H��P����x���H������H��t跮��H��@���tH��@����ѯ��H�������E���H�������9���H�������-����8����=8� �&�=*� u0H��h�����L��TH� HZH�5[A�L�1��RE1�L�����H������H���������I�}(�������<���H��@����L���]���M�M(�C1�L��EH� �Y�H�5�@���p���I�ٺ��1�L�HTH� �YH�5�@��R���L������.���I�ٺ��1�L� TH� fYH�5y@�zH������H����������M�M(�Y�1�L�~SH� 'YH�5:@�;�.���I�ٺ��1�L�.EH� �XH�5@� �H��P���菫��H������H��t�ά��A����DžP��������0H��������P����L��D����I�ĉ�P���H���%L���o���H��I����L����身����y��=&� u��=� �!���M���1�L��CH� 3XH�5F?�G��QL��P����m1�A�u(L��CH� X�H�5?�XZ�=�� � ������L��P���L�nR1�H� �W�dH�5�>���뿀=m� ���=_� �d���AVM��L��Q1�SH� }W�H�5�>���J���L��� ���H������H������H��h�����L��QH� +WH�5>>�L�1��5�>���苫���8��H��@���H��tH������H������蒩��H������膩��H�������z����w���ATM��L�1Q1�SH� �V�H�5�=��^_����H��h���APM��L��AH� sV��0H�5=1��~^_���L�^BH� IV1���H�5U=��Q�*����=� t ����H��h�����L�OBH� �UH�5=�L�1�� ��貪��L�t=H� �U1��.H�5�<�����"���L�D=H� �U1��(H�5�<����L�=H� |U1��4H�5�<�����H�������H���ׯ�����˯����H�������H���(�����H���Ű����H��������H���ѯ����H���(�����H���)�����H���*�����H���.����������H���)�����H���-�����H���)�����H���*�����齯����H���8�����H���3�����H���/���f.�D�����f���1�H9��������B��ff.�H��H��twH����H�N H�F(H��tAH�A(H�F(H��t=H�H H�NH�FH��tH�AH�FH��t&H�H�G ��tk���G H���H�GH��u�H�O���H�L�(���H� �T��H�5�SH�=�@�A�H� �T��H�5�SH�=�X�!�H� �T��H�5�SH�=�S��H��H��tH������H�D�(H�H�FH�VH�H��tH�rH�0H�GH�F H�F(H��t$H���H�p �G H�wtkH���fDH���H�w���H� �S��H�5SH�=�?�Yf�H� �S��H�5�RH�=�W�1�H� �S��H�5�RH�=�R��H� yS��H�5�RH�=�R���H� YS��H�5{RH�=�R���ATUSH�H��t$�P�H9�sz�JH��H�r�HH�[]A\�@�H��I���*H��1�H�|H��H!�H�G�H��H��耣��H��t�I�$�X���@H�I�$�f.�ɸ��Bȉ��ff.��ATUSH��tG��H��I��H�\�(H��u�#H�[H��tL��H�;�U��u�H��[]A\�f�1�H��[]A\�fDH� IR�(H�5[QH�=;>��USH��H��tuH��H����H��H�>�UH��Hi�H�Ή�H�� )����H������)�)Љ������}$tH�r� H�k� H�H��[]ÐH��H��[]�2���f�H� �Q��H�5�PH�=�=��H� �Q��H�5�PH�=�U���SH�wH��H��tH���(���H�sH��u�{$tH�� H�� H�[�fDH��[駢���������t��H���������u������鷤�����ATUH��SH���=*A�Ą���H�k� H����H�H�X� H�zH��1�H�HǂH��H)��� ���H�H��H����B HD�H����H��H�BHD�H�BH��H�*H�ZD�b$[]A\�@� H�=܇ ����H��H���k���1�[H��]A\�f��� ����H��H���k���1��А��SH��H��t3H�?t 1�[�f�H��H������H�H��u��[�fDH� �O��H�5�NH�=�;����H��t����f��ff.�@��H��tGUSH��H��H�wH��t"H�nH��� ���H��tH��謠��H�sH��u�H��H��[]���D�ff.�@��H��t/SH�wH��H��tf.�H�����H�sH��u�[�D����AUATUSH��H����I��H��H��I��A�UL���Hi�H�ډ�H�� )��������)�)�H��Ɖ�����H��t!L9`����E�H��[]A\A]�DA�}$t9H�5҅ H��tmH�H�Å H�.��L��L�f���H���[]A\A]�f��0膞��H��H��u˸���H� �M�6H�5�LH�=�9�A��0H�=\� �_���H���f.���ATUSH��tkH��H��H��I��UH���Hi�H�щ�H�� )��������)�H��)ȉ����H��tH�L�`1�[]A\�L��H��H��[]A\�n���fDH� M�VH�53LH�=9�f���H��tgUH��SH��H��H���H�߉�Hi�H�� I�ȉ�D)���D������)�)�H�������H��tH�@H��[]�H��1�[]��1��ff.�f���USH��H��taH��H��H�����Hi�H�ω�H�� )����H������)�)�H������H��t H�hH��H����H��H��[]��1�H��H��[]�@��H����AWAVI��AUI��ATI��H��UH��SH��A�$L����Hi�H�� )��������)�)�H��Ɖ�����I��H��txL��A�$L���Hi�H���H�� )��������)�)�L��Ɖ�������H��u#��L��L�����M�/��L��M�wL�����1�H����[]A\A]A^A_ú��������������H����AWAVI��AUI��ATI��H��UH��SH��A�$L����Hi�H�� )��������)�)�H��Ɖ�����I��H����L��A�$L���Hi�H���H�� )��������)�)�L��Ɖ�����H��tI9�tH��L���'�����L��L�����M�/��L��M�wL�����1�H��[]A\A]A^A_ø�������������H��twATI��UH��H��SH��U��Hi�H�ω�H�� )����H������)�)�L����#���H��tH9XuH��H���}���H��[]A\�D[1�]A\�f�1��ff.�f���H��tgH��tJH�H���tAH��t,H�H H�����H��HD�H�H��tH�H� H�@��H�GH��u��H�����1�H��tH��f�H��H� �H��H�5HH�=JH�m ff.�f���H��tWH��t:H�H��t2H���tH�H(H�H��tH�H� H�@�DH�GH��u��H�1�H��tH��f�H��H� %H��H�5�GH�=�G�� ff.�f���H��tgATI��UH��H��SH��UH��Hi�H�� I�ȉ�D)���D������)�)�L����a���H��tH�[H�@]A\�[1�]A\�f�1��ff.�f���H��tH�GH��tH�@�f�1��ff.�f���H��tH�GH��tH��f.�1��ff.�f���H��tH�GH��tH�@�f�1��ff.�f���SH��tH�wH��tH�^���H��[��1�H��[Ð��SH��tH�wH��t H����H��[�1�H��[�f���H��t�G �1��ff.�f���H��t�G �����fD��f���USH��H��tAH��t-H�^H��H��t!H�SH�3H��������t��xH�[ H��u�1�H��[]�fDH� �E�vH�5[EH�=;2����AVAUATUSH����I��H����L�vH��M�����I�>M�f �UH���Hi�H�� )��������)�)�I��Ɖ���H��uEI�>A�UL��Hi�H�Ή�H�� )����L�������)�)Љ��!��L��H�����M��M���p���[]A\A]A^��H� �D��H�5cDH�=C1�f���H����AVI��AUI��ATI��USH����H��A�UL���Hi�H�� )��������)�)�L��Ɖ��2�H����L��A�$L���Hi�H���H�� )��������)�)�L��Ɖ����I��H��t^H�Ɖ�L������L��L�����1�[]A\A]A^�f�1��DH� �C��H�5cCH�=C0�f����뾸�����f���USH��H��t1H�wH��H�?�"�H��H��tH��H���O�����x+H��H��[]ÐH� 9C��H�5�BH�=�/�A�H��1��F���@��AVAUATI��USH��dH�%(H�D$1��G �xH������H��H��tPI��1�L��H�$L������H��tY�@1�L��L��H�D����Lc�H��H��u�J�D�H�H�L$dH3%(H��uH��[]A\A]A^�fDH����薖��fDAWAVAUATUSH��hdH�%(H�D$X1��=�� ��H��I��L�5CL�-n)��H����H�5�FH��耕��H�\�;��H�5fFH��1��ђ��H��t�H�hD�=x E��x�f�H��L�4$AD$AD$(AD$8I�D$HH�D$H�\$谓���L��D��H�D$L�l$ H�D$(�=���H���L����?�������=�������1�H�L$XdH3%(uH��h[]A\A]A^A_��Z���f.�AWI��AVA��AUI��ATUSH��(H�L$H�l$dH�%(H��$1��Ĕ��L�L$M��H��D� �H�þ����H��D��L��Ƅ$�I���D�#H��$dH3%(uH��([]A\A]A^A_�謔��ff.��UI����H�=�x S1�H��H��Q�R�V��r���H�� ��H��H��x �z� �����a������S�]v ��x 謑����t[�D���9v ����[�������ff.�@���f.����ff.�����;=�u H���~1��f�L��L��H���b���f���H���I���L�L$H��t7)D$P)L$`)T$p)�$�)�$�)�$�)�$�)�$�dH�%(H�D$1�H��$����$(H�D$H�D$ H�D$1�;=Cu �D$0~H�L$dH3%(uH����DH��L��L����������ff.�����t S1ۅ�x��[��3�����t��t ��[þH�=n?���t ��x-L�@H� �A1��IH�5P?�����D�؉��_����EL��?H� LAI��H�5?�1�����Ht �\���ff.���PXL��?H���j���f.�PXH� �@�\H�5�>H�=�>H�����ff.�������9�u��s �@H�����ff.�@��PXL��?H�����f.���H����x��/�=�} H���@H� !@��H�5$>H�=C>�!����H� @��H�5>H�=/>�������H���s��x�����u�s 1�H��������} �D����r �D����wHc�H��l H����1��ff.�f���AUL�-sl ATI��H�=V=US1�H��dH�%(H�D$1��D$M��u�`I�|���H��tL���|�����t*H��H�� u�H�t$L���Q��xL�l$�������G�H�T$dH3%(��u2H��[]A\A]ÐH� �>�%H�5�<H�=�&����������Տ��D��H���#�����x���8���1�H��Ð�����f���SH�=�<����H��tH��H��������xU����H�=�<���H��H��tH���8�����x[�f�I��L��=�[H� �=H�5 <�1��v���I�ٺ �1�L�H=H� �=H�5�;�M����f.����H�6H�?�����UH��SH��H�?H��tH��@裌��H��H�;H��u�H��H��[]鉌��f�1�H�?t�H����H�?u��f��ff.�@��ATUSH��tSH��H��t;H�/I��H��u�#fDH��t"H�+H��tL��H���_�����u�H��[]A\�1�[H��]A\�fDH� >� H�5=H�=�&�������AUATUSH��H��tmH��H��tUH�/H��t=H��I��貋��I���DH��t2H�+H��tL��L��H���|�����u�H��L�t�H��H��[]A\A]�f�H��1�[H��]A\A]�H� I=�,H�5n<H�=&�1������H��t�b���f��ff.�@��ATUSH��tkH���{����xH�����I��H��t=H�;H��H��u�Wf.�H��H�;H��H��t=�ˌ��H�EH��u�L�����E1�[]L��A\���螉��H��H��t�I��H�EL��[]A\���H��t���f�1��ff.�f���ATUSH�� dH�%(H�D$1�H���K�o1�H���I����H��$H�N�xH�L$�%fD��Hʉ$H�H��t*H�������Nj$��/v�H�T$H�BH�D$H�H��u�H���ʈ��H��H����I�����L��謋��H�H����A�f.��E��/w7��HU�EH�:H��t7H���t��i���D��H��H��t]�EA����/v�H�UH�BH�EH�:H��u�J��H�H�t$dH34%(H��uEH�� []A\�fDE1��x����H���(���1���@����H��H��u�1�����D��H���H�t$(H�T$0H�L$8L�D$@L�L$H��t7)D$P)L$`)T$p)�$�)�$�)�$�)�$�)�$�dH�%(H�D$1�H��$�H���$H�D$H�D$ �D$0H�D$����H�T$dH3%(uH�����&���fD��AUATI��USH��H����H��H�����U���H�����K����|H���Ά��I��H��t?H�}H��H��u�]�H��H�}H��H��tD蚉��H�H��u�L��E1����H��L��[]A\A]�f��k���H�H��t�H��I��I�<$H��u�H�H��L��[]A\A]�DH��H��[]A\A]����fD��AVAUATUH��SH����H��I��I���j�����H����H���W����|H���څ��I��H��t8H�}H��H��u�T@H��H�}H��H��t?誈��H�H��u�L������E1�[]L��A\A]A^�L���H�H��t�H��I��I�<$H��u�H�L��[]A\A]A^�@�xH���D���H��H��t�I�����[]A\A]A^������AWAVAUATUSH��(dH�%(H�D$1�H���L�l$L�|$I��H��L��L��H��H�D$�H����1���D��L��L��L��H��D�s�xH��u�{H��藄��I��H��tkL��L��L��H��H�D$�EH����1��!�L��L��L��H����H��tGH�t$H��������I��H��u�L��E1��T���H�L$dH3%(L��uPH��([]A\A]A^A_�f�I��H���H� �6��H�5�5H�=�����*���L�����̆��ff.����AWAVAUATUSH��(dH�%(H�D$1�H���L�d$L�t$H��H�D$L��L���H����1�� �D��L��L��D�kH���kH��u�{H���*���I��H��tgL��L��H��H�D$�;H����1��fDL��L��H����H��tRH�t$��H��M�|���I�H��u�L��E1����H�L$dH3%(L��uWH��([]A\A]A^A_�f�I�D�H���f�H� 95�H�5�4H�=<�Q���'���L�����\���ff.����USH��H��tQH�5�5����H��H��t.H�������t"��H�,�H�}H��t�?u ���H�EH��H��[]�DH� y4�.H�5�3H�=�����AWAVAUATUH��SH��H����H��I��藂��I��H����L�mI��1�L��M��u�z�I�<$H��tJ�;H��HE��W���H�I��u�H�{�E���H��H����H��fDL���h���H��H��t?L�mM��t6H��H9�t�H��L���C���H���ο��H��H��tKH��f��H��H��[]A\A]A^A_�A�L�5�0�"����謀��H��H��H��u�1��ff.�f���AUI��ATUSH��H����H��H�������xH���Y���I��H��t:H�;H��H��u�D@H��H�;H��H��t0�+���H�EH��u�L��E1��G�H��L��[]A\A]�f�L�����H�EH��t�H�EH��L��[]A\A]�f�H��[]A\A]����H��L��1�1�[]A\A]����f.���H��tWATUH��SH�H��H��tMH�����pA��H��H��諃��H��t8D��H��A�T$H��H�E1�[]A\��1��D�E1�뻸����UH��H��SH������H��t1H��H��H���\�����xH��[]ÐH�߉D$�����D$H��[]ø���f���H��t�D1��ff.�f���AVI��AUATUSH��tdI��H��tlH�I��H��H��u�D@H��I�$I��H�]H��t+L��H��蠁����u�H��H���@��H�]H��u��I�$[L��]A\A]A^�@H� �0��H�560H�=���f���UH��SH��H��t'H�7H��tH��� �H�3H��tH��H������H��u�H��H��[]�ff.�f���AWI��AVAUATUSH��H��tpI��H��t~H�I��H��H��u"�QfDI�t2H��H���W~��H�]H��t1L���V~��L��H��H��I���5}����t�H��I�I��H�]H��u�I�H��L��[]A\A]A^A_�@H� y/��H�5/H�=�������AWAVAUATUSH��H��H��u H���=H���TH�,3H��E1��H9�v�8A�~u A�VA����H��H9�u�|3��������H�$H����E1�H9�w8�fDH��H��H�T$H)��-���H�T$H��I�tFH�ZA��H9�vwI��1�H��I)�L���P{��H�$H��D��L�<�H��u�L��H�����I�H��u:H�<$�!�H�$H�$H��[]A\A]A^A_�fDA�����;���DA��E9�t�H� .�H�5�-H�=�-���H� �-��H�5�-H�=�-�a��H����[]A\A]A^A_��~����USH��dH�%(H�D$1�H�$H��tq�?H��tiH���@H���|��H�\H��t.�;t)H��H��������y�H�$H��tH����1��DH�$H��tH�T$dH3%(uH��[]�1�1�1�������}��fD��H��t{AUI��ATI��USH��H�/H��tVM��tBI�uL��H��u�4@H��t*H�3H��t"H���}����u�H���[]A\A]�fDI��t I�,$H��u�H��1�[]A\A]�1��f���SH��H��t!H�?t�h�H� ��H�߉���|��H��[�ff.�f���H��tSH��H�;H��t�3y��H��u�[�����dH�%����H��t�DH�����y��H��~dH�%����H���H� �/�(H�5f,H�=�,�8����ATUSH��tSH��H��tkH��H��� z���I��H��t&H���z��1�L9�rL)�L��H��H�<�r|������[��]A\�fDH� /�2H�5�+H�=����H� �.�3H�5�+H�=�+�����S����y�+�K{�����u���}w����x�[����[�@H� y.�AH�5g+H�=w+�9�f���ATU��S��z����H��D� �����uD�#[]A\��H� .�UH�5+H�='+������AUI��ATA��U�SH���D�P���y��D��L���kz���Å�yE�pz�����u%��uԻ����H����[]A\A]É��K����Fz���H���ۉ�[]A\A]�D����v����x�uĉ�������D��H��tH��tH���yz������H����H ���Ð��d�%���t���@S�w������1��x��9����ЍT�d�%�[�ff.���ATUSH��dH�%(H�D$1�H�$H����I��H����H���Oy��1�H��H���H���z��H�$�UH��t=�9u8��uD��H9���A�$H�|$dH3<%(��u|H��[]A\�f.���u�����D����@H� �+��H�5)H�=����f�H� �+��H�5�(H�=)�������r�����x��f�����wHc�H��T H����1��ff.�f���AUL�-�T ATI��H�=�(US1�H��dH�%(H�D$1��D$M��u�`I�|���H��tL���|x����t*H��H��u�H�t$L���Q�����xL�l$�������G�H�T$dH3%(��u2H��[]A\A]ÐH� �*��H�5�'H�=�����������w��D��H��H ���AWAVAUATUH��SH��H����H����I��H��E1��u��I��H��I9�w9O�<4I��gt��I��H��t$L��H��H����x��K�|5L��H����x��C�D=H��L��[]A\A]A^A_�f�H�=G �w��@H��H��H��[]A\A]A^A_��x���H��[]A\A]A^A_��v��ff.�f���U1�H��SH��H��H��tH���t��H��H��H��H��[]����ff.�f���ATUSH��PH�t$(H�T$0H�L$8L�D$@L�L$HdH�%(H�D$1�H�D$p�$H�D$H�D$ H�D$H���H���/t��H�\$I���/D��Hډ$H�:H��t5�t��L��H��H9���Iċ$��/v�H�T$H�:H�BH�D$H��u�I�|$��r��H��H��tnH��H���q��H�L$p�$H�L$H�L$ H�L$�#fD��HL$��H�1�$H��t+H���q���$��/v�H�L$H�1H�QH�T$H��u�DH��H�\$dH3%(u,H��P[]A\�@1���@��&r��H��H��t����$u��@��AVAUATUSH����H��I��L�nI��H���}H����r��J�<(H����q��H���8H��L��H���Zv��I��H�(J�4#H9���H�=O%A��������H��H��H9����H�K��\u��K��x����Hc�H�>����SD�RЉ�A�� ��D�R�A���@��A��7��AC�D�SE�Z�D��A�� �E�Z�A�����A����A�JɅ���������H��H�� ʈP��A�����H��H���)���� H��H������� H��H��� ���� H��H������ H��H������H��H�������H��H�������H��H������\H��H�����D�[D��A��0D�ڃ�0�����kA��0���0���~��0E��xv��xrA��A��H��H��E �D �@�h��L����'H��H���9����"H��H���)����\H���L��[]A\A]A^�f.�E1�[]L��A\A]A^Ð�\H��H���H����DL���`o��H��t�I�������0�'�����\xH��H��f�P����f.�H� �$�H�5"H�=������A�J�� ���A�J�������W����fD��1�����D��AVAUATUSH����I��H����H��H���H�H�5�!H��HD�H����p��H��3@����@��'tUI��L�-�!@��"���@��\��L���p��H��u I��A�6@��u�L��H)�I�$H��L�u[]A\A]A^�f��SH�sH���u)H��1��Cf.���'���PH�H��tH�Ȁ�\u�x���PH�H��u�H��H)�I�$�9H��H��H��H�M[]A\A]A^�f�A�~�3A�vI�FI��@��� ����?����CH�K���!H��<\tQ<"tfH�B�R��t��\t?��"tH�����u�H��H)�I�4$�8H��H��H�EH��[]A\A]A^��H�Ѐx��H�P�@��u�H��H��H)��@1�H��[]A\A]A^�f.�H� a"��H�5�H�=�����H� A"��H�5�H�=�����H� !"��H�5�H�=��a���H��H��H)����I������H�H���H������H��1�����ff.�f���AUATUSH��H�H��HD߀;tC�?t>I��H��H��H��I���Zn��L��H�H����o��I�EH�H�EH��H��[]A\A]�H��1�H��[]A\A]����G�< v%�G�<v�G�<w'@���G���@���G��@���G���������f.����G�<w @���G��D������f���AWI��AVI��AUA��ATL�%�F UH�-�F SL)�H���oc��H��t1��L��L��D��A��H��H9�u�H��[]A\A]A^A_�ff.������H��H���/sys/devicesmodaliasinstall/dracut-install.c2madfhlL:oD:HRp:P:s:S:N:DRACUT_FIRMWARE_PATHDRACUT_FIRMWARE_PATH=%sNo SOURCE argument given%s/%sOut of memory!stat(%s) != 0find_binary(%s) == %s%s/lib/dracut/hostonly-filesa%s dracut_install('%s', '%s')hash hit items for '%s'ERROR: stat '%s': %m'%s' already existsdest dir '%s' does not existmkdir '%s''%s' install errorlstat '%s': %mln -s '%s' '%s'ERROR: ln -s '%s' '%s': %mdracut_install ret = %dcp '%s' '%s'Failed to chown %s: %m-fL--sparse=auto--reflink=autocp--preserve=mode,timestampscp ret = %d.soScript install: '%s'ERROR: failed to install '%s'ldd %s 2>&1ldd: '%s'Not a valid dynamic programcannot execute binary filenot a dynamic executableloader cannot load itselfnot regular filecannot read headercannot be preloaded=>Lib install: '%s'.so.glibc-hwcaps/lib/fipscheck/lib64/fipscheck/lib/hmaccalc/lib64/hmaccalc%s/.%s.hmac%s/%s.hmachmac cp '%s' '%s')firmwareFirmware %sdracut_install '%s' OKdracut_install '%s' '%s' OKdracut_install '%s' '%s'dracut_install '%s' ERROR/lib/modules/DRACUT_KERNEL_MODALIASESHandle module '%s'Failed to find module '%s' %sERROR: installing module '%s'Handling =%s%s/kernel/%s%s/extra/%s%s/updates/%sSkipping %sIgnoring %sHandling %sFTS ERROR: %m.ko.ko.xz.ko.gzFailed to find module '%s'ERROR: installing '%s'PATH is not setDESTROOTDIROut of memory%s/%d.logresolve_deps('%s')Handle '%s'dracut_install '%s'helpversiondebugverboselddresolvelazyoptionalhostonlyallmodulefipsdestrootdirlogdirmod-filter-pathmod-filter-nopathmod-filter-symbolmod-filter-nosymbolmod-filter-nonamesilentkerneldirfirmwaredirsCould not get list of loaded modules: %m. Switching to non-hostonly mode.Usage: %s -D DESTROOTDIR [OPTION]... -a SOURCE... or: %s -D DESTROOTDIR [OPTION]... SOURCE DEST or: %s -D DESTROOTDIR [OPTION]... -m KERNELMODULE [KERNELMODULE …] Install SOURCE to DEST in DESTROOTDIR with all needed dependencies. KERNELMODULE can have the format: <absolute path> with a leading / =<kernel subdir>[/<kernel subdir>…] like '=drivers/hid' <module name> -D --destrootdir Install all files to DESTROOTDIR as the root -a --all Install all SOURCE arguments to DESTROOTDIR -o --optional If SOURCE does not exist, do not fail -d --dir SOURCE is a directory -l --ldd Also install shebang executables and libraries -L --logdir <DIR> Log files, which were installed from the host to <DIR> -R --resolvelazy Only install shebang executables and libraries for all SOURCE files -H --hostonly Mark all SOURCE files as hostonly -f --fips Also install all '.SOURCE.hmac' files --module,-m Install kernel modules, instead of files --kerneldir Specify the kernel module directory --firmwaredirs Specify the firmware directory search path with : separation --silent Don't display error messages for kernel module install --modalias Only generate module list from /sys/devices modalias list -o --optional If kernel module does not exist, do not fail -p --mod-filter-path Filter kernel modules by path regexp -P --mod-filter-nopath Exclude kernel modules by path regexp -s --mod-filter-symbol Filter kernel modules by symbol regexp -S --mod-filter-nosymbol Exclude kernel modules by symbol regexp -N --mod-filter-noname Exclude kernel modules by name regexp -v --verbose Show more output --debug Show debug output --version Show package version -h --help Show this help Module path filter %s is not a regular expressionModule symbol filter %s is not a regular expressionEnvironment variable DRACUT_FIRMWARE_PATH is not setconvert_abs_rel(): target '%s' directory has no realpath.Path %s matched exclusion filterPath %s matched inclusion filterCould not open '%s' for writing.Could not append '%s' to logfile '%s': %mhash hit items_failed for '%s''%s' already exists, but checking for any depsERROR: failed to create directory '%s'--preserve=mode,xattr,timestampsFailed: cp --reflink=auto --sparse=auto --preserve=mode,xattr,timestamps -fL %s %sFailed: cp --reflink=auto --sparse=auto --preserve=mode,timestamps -fL %s %syou do not have execution permissionERROR: failed to install '%s' for '%s'could not get modinfo from '%s': %s Possible missing firmware %s for kernel module %sdracut_install '%s' '%s' ERRORdracut_install '%s' is excludeddracut_install '%s' not hostonlykmod_module_get_dependency_symbols failedModule %s: symbol %s matched exclusion filterModule %s: symbol %s matched inclusion filterNo symbol or path match for '%s'Adding module '%s' to hostonly module listFailed to lookup modules path '%s': %mFailed to get name for module '%s'3 Failed to lookup alias '%s': %dFailed to lookup alias '%s': %mEnvironment DESTROOTDIR or argument -D is not set!Environment DESTROOTDIR or argument -D is set to '/'!Environment DESTROOTDIR or argument -D is set to '%s': %mCould not open %s for logging: %mERROR: installing '%s' to '%s''q��r��r��r��q��r��r��r��q��r���p��r���p��r���p��sp��r��r��r��r��r��r��r��r��r��r��r��r��r��gp��r��r��[p��r��Op��r���q��r��r��r��Cp��7p��r��+p���o��r��r���o��r��r���o��r��r��r��r��r��r��r��r��r��r��r��r��r��r��r��r��r��r��r��r��r��r��r��r��r��r��r��r��r��r��r��r��r��r��r��r��r��r��r��r��r��r��r��r��r��r��r��r��r��r��r��r��r��r��r��r��r��r��r��r��r��r��r��r��r��r��r��r��r��r��r��r��r��r��r��r��r��r��r��r��r��r��r��r��r��r��r��r��r��r��r��r��r��r��r��r��r��r��r��r��r��r��r��r��r��r��r��r��r��r��r��r��r��r��r��r��r��r��r��r��r��r��r��r��r��r��r��r��r��r��r��r��r��r��r��r��r���o���o��yo��do��Ho��<o��install_onefind_binaryinstall_allresolve_lazyinstall_dependent_modulesinstall_firmwarecphmac_installlibrary_installresolve_depsconvert_abs_relln_rdracut_installcheck_module_symbolsinstall_modulecheck_module_pathinstall_modulesmodalias_listparse_argvmaindracut_log_cpmark_hostonlyinstall/hashmap.ch->n_entries >= 1!h->iterate_list_headihashmap_copyhashmap_move_onehashmap_movehashmap_mergehashmap_iterate_backwardshashmap_iteratehashmap_replacelink_entryhash_scanhashmap_putunlink_entryremove_entryhashmap_ensure_allocateddracut-install: /dev/consoleinstall/log.c(level & 0x07) == leveltarget >= 0target < _LOG_TARGET_MAXDRACUT_LOG_TARGETDRACUT_LOG_LEVELsafenullFailed to open /dev/console for logging: %sSuccessfully opened /dev/console for logging.Assertion '%s' failed at %s:%u, function %s(). Aborting.Code should not be reached '%s' at %s:%u, function %s(). Aborting.Failed to parse log target %s. Ignoring.Failed to parse log level %s. Ignoring.log_target_from_stringlog_parse_environmentlog_set_targetlog_set_max_levellog_open_consoleinstall/strv.cs || l == 0i == cstrv_parse_nulstrstrv_remove_prefixstrv_removestrv_split_newlinesstrv_split_quotedstrv_splitstrv_find_prefixstrv_findinstall/util.cpostfixfd >= 0close_nointr(fd) == 0ret_uemergstate alertcriterrwarningnoticeinfo(r = sysconf(_SC_PAGESIZE)) > 0������������������������������������������������������������������������������������������������������������������������������������������������ �� �� �� �� �� �� �� ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������split_quotedcunescape_length_with_prefixlog_level_from_stringsafe_atouclose_nointr_nofailclose_nointrendswithpage_size;`�,B���|H����N���O���5O���WO��`P����P�� Q��` :Q��� �Q�� �R��� �S��P�S��� ]��|^���\^��\b����b����f���j���k����l���m��<�n���,o���L|��xl����l��� ����x ����� ,���0 ����l�����̣��������ܥ������������0����h����<����L����L�������� ̩��$ ,���P l���l ����� ,���� ����0,���d�����������HL���`ܰ��x\��������������������L���0l���D����X�������������|���@<����|����,��� |���L̸��pܸ������������������̺������$,���8L���T����pܻ�����������,��������,��� ܽ��D��X,����\����ܾ���|��� ����4<���l\��������������,�������|��$���P,��������D���|�������������Dl���������$���@��\|��x���|�������l��D���\���x����,�����������,����������@���T�������L��,l��D����zRx��X��/D$4�=��PFJw�?:*3$"\�C��@ t0Y��GF�wC�C�CzPLRx��) �P$<Y���{B�I�B �B(�A0�A8�G�� 8A0A(B BBBE,zPLRx�]) ��������4I��W;T�\��*H�0l�\��CB�D�C �N�� AABAP�`���B�B�B �A(�A0�H��Q DЀ� 0A(A BBBG(zPLRx�u( �Ѐ�����0�H��"u8Ld��"A�`\T`d���B�B�B �B(�A0�A8�G��L�[�A�g 8A0A(B BBBA$��e���H�T DD DF,HHf��*�E�P�D0� AAH zPLRx�]' �0��(�G��"�(Hg��gE�e FDF jAAX�Pg�� TA�F B�P���P�A.Q.�.a. K'.�..Y..t.,zPLRx��& �������4�F����8��s���A�C M������.s.� E�RG����8��{����A�C D��E�F��.Y.M D��G��+�<,D~��#�A�C W�����(.C AS.o.n.4�G��%�<�����|A�C M�����$.K.� Jy.[.�zG��g�D�������A�C H����H�� G�.^..Q.;.T.��G����P<�a�A�C D��G�M��� A�.y.�.A.H.R.|.h.$��G��C�A������t�8I��/ �F�B�B �B(�D0�C8�D`�hQp`hA`} 8A0A(B BBBAGhOpZhH``hQp[hB`(zPLRx��# �`������0lH��"#(��� $���40����D[ AP�/De G(l����B�A�A �d ABE4�����oB�A�A �v ABCF ABG4�Ě���A�A�D f AABD DAGL���IA�x GD(|���)<���� 8P�����F�A�D �� ABE` DBJ �X���_E�Q JY G�����(�����QJ�A�G oD�A��Ԝ��9J�hF�L ����F�B�A �A(�D0f (A ABBFr (F ABBC8\ ȝ���F�A�A �T ABAJ ABK4� ,���sJ�D�J B AADDCAH��0� t���|E�A�D Y DAHFDAP �����O�B�E �E(�G0�D8�D@� 8C0A(B BBBAG������PX \����O�B�E �E(�G0�D8�D@� 8A0A(B BBBAG������8� ����K�D�G �Q ABFACBJ���� \����t���d8\���sK�D�G �B EBAACBJ���T����#h����#|ء��#��/E�[ HF����'E�Z AF����� ���(�,���oE�A�D } AAG<$p����F�B�B �A(�A0�� (A BBBHLd0���O�E�E �D(�A0��(A BBBC�����H0�����(��lE�A�D o DAB@�4����F�B�B �D(�A0�D@� 0A(A BBBGL$ ����6B�B�B �B(�A0�A8�D� 8A0A(B BBBAHt �����B�E�E �E(�A0�A8�G�z 8A0A(B BBBA(� ���OA�M�I(A0F8F@N � (���AE�U FP HT���$P���8L���.Lh����K�� F h����K�I DW A�����EAK�����%AA^�Ч��!\���EAK��_HS E4���-H\ D,H���@D���T@���#8h\����F�I�K �A(�F@w (A ABBB��'HV B �����E�H CP Z�����$�����7A�D�D dDA ����!84����F�A�A �A ABDC DBGLp����F�B�A �A(�D0V (D ABBCD (C DBBA�T���4�`����F�A�A �b AEHaABȪ��0 Ԫ���F�A�A �D@9 AABGT0����K�� AXpԬ���F�B�D �A(�D0| (D ABBJi (D ABBFG(A ABB\�h����F�B�B �A(�D0�{ (A EBBDl (A BBBEa(A BBBH,���dF�B�B �B(�A0�A8�D` 8A0A(B BBBCHx,���dF�B�B �B(�A0�A8�D`� 8A0A(B BBBJ(�P���E�A�D K DAFH�����#F�B�B �B(�A0�D8�D@� 8D0A(B BBBDl<�����F�E�A �A(�D0l (D ABBJ] (D ABBJD (A ABBFD(H ABB4����yK�A�D �EABH���H ���4�P���NA�G�D0` AABT AAAh���<0t����F�E�B �A(�A0�j (D BBBE$p��CE�D�D pDAH�����F�E�B �B(�A0�A8�D@y 8D0A(B BBBE`������F�B�B �B(�A0�A8�GP� 8A0A(B BBBGd8K0A(B BBB(H�����E�A�D0� AAALt@����K�E�D �A(�D0} (F ABBGS(C ABBA���������3E�m�����)J�ZD������X\\ A,�����F�A�A �L CBG Hl���WE�c HC E(l����OF�A�C �Z ABIH�̶���F�E�D �F(�D0| (C ABBAR (E ABBF� ���/RN�8���BY�h0l���F�A�A �D0� AABKLH���#8`d����F�I�K �A(�F@w (A ABBB�������R�B�B �B(�A0�D8�D@h8D0A(B BBBJ������P@������D 8G�0A�(B� B�B�B�LD8A�0A�(B� B�B�B�$4P���3E�F�G TGA0\h���|F�A�A �DpC AABEL�����*F�B�B �A(�A0�b (A BBBKD (A EBBB�����t������F�B�B �A(�A0�� (A BBBCo (A BBBJ� (A BBBIn (A BBBKHl����pF�B�A �A(�D0E (D ABBDD(F ABB�ܿ��F����D� ���eF�E�E �E(�H0�H8�G@n8A0A(B BBB,H�����@R]���������$�����(�������� 4=' P=���}�����S�t�|����������j�{��������������������� �� �� �� �����������������������������[�������������������'w�����~���4������������������ �� �� ���������� �� �������Tmh����w����&��$<������3���4����� ��KS�_��������������������%����U^&H7 ���3�X�s���������� ����������������������� ���� �������� �@��� � e�� ���h|& \q���=�H���E���v�������������������� �� �� �� ���� �� ���������������������������������������w��F��W����@������]���/ _�s�����"'E���1���� �� ���0?�>�!��h��S�d� �v�l�R"�o+�H4�a8�m?�fD�DP�LW�pg�Py�s��S��NA���������9�E�J�=�N�T�Y�]�e�l��p�@# ��!�!���oh� � ��!` �xh ���o���o����o�o����o&� !p#�#�#�#�#�#�#�#�#$$ $0$@$P$`$p$�$�$�$�$�$�$�$�$%% %0%@%P%`%p%�%�%�%�%�%�%�%�%&& &0&@&P&`&p&�&�&�&�&�&�&�&�&'' '0'@'P'`'p'�'�'�'�'�'�'�'�'(( (0(@(P(`(p(�(�(�(�(�(�(�(�()) )0)@)P)`)p)�)�)�)����GA$3a1@#>GA$3p1113�/��GA*GA$annobin gcc 8.5.0 20210514GA$plugin name: gcc-annobinGA$running gcc 8.5.0 20210514GA*GA*GA! GA*FORTIFYGA+GLIBCXX_ASSERTIONSGA*GOW*�GA*cf_protectionGA+omit_frame_pointerGA+stack_clashGA!stack_realignGA$3a1�>%�GA$3p1113Є�GA*GA$annobin gcc 8.5.0 20210514GA$plugin name: gcc-annobinGA$running gcc 8.5.0 20210514GA*GA! GA*FORTIFYGA+GLIBCXX_ASSERTIONSGA*cf_protectionGA+omit_frame_pointerGA+stack_clashGA!stack_realignGA*ЄI�GA*GOW*�GA*���GA*GOW* GA*FORTIFY@?�GA+GLIBCXX_ASSERTIONS GA*FORTIFYЄ��GA+GLIBCXX_ASSERTIONSdracut-install-049-239.git20251127.el8_10.x86_64.debugʦ1o�7zXZ�ִF!t/��%g _]?�E�h=��ڊ�2N�c��� }���M���8�9��i�Cu]E7��C�X�:e��5�,�o�=��D���y�֤� #s�؈6��ˠYĦ�� ��{$s)R� v8p�o�ׄ����x�OK�������X��>��-�[��Tա�# y� b<��י�k���Z�ˁ�F,<0�4�x��j�$�19�ĀɱC��?W��*_Z���l�A�N��tݟo�Ӗ`J�K)qGk��C�Ak��TqC�/�C�!MO�P�?s*Jj�ҫ��?���Am���W�z�l��)�$�J@���g��K�q�'������}��8u��.)Nx�_�� ة�O�l�?� �I2��=g-�K��@����{E�re�?.��ד ���yK��z�YZ~��5[�BZ�ޟj���|�GmL<�)�Eo�ᬡ��D��z�K6�$�g��%�?2qR�F�ʺ��O����QY̓7�#�C�F���� c��G����D��<����.��k�&���2-���_7r���5��=�K�s�?�xt��ȋ¥������`�a�⥟#s߈7��쳦���;�����E9��˗�,�N�$�(g�*�� 6sD��Ł� �G=N3�O=��m۫�Y�#P>솔N�W��pҗ�ˮso"��RW�d@N�pI�tr֓R�j� '�XR���ہ�8��z�T�POpK0�8`�O�mQ:��We���}]ZpR�G� R�1�)��`/P�(0�)�t"�7o0d�-ȏ��u(P;���Ca�t/�ۅ� M�Aj7"r�R��kf����yM�Q'�ŚO/��Z��{&�G�m �ԧ�ԗ�C���S��z�ƿ�u��<�$-�u����\�2O.T\}��f���5r<���(�(���3}���,�7O�e^�2mQP\L��h"9�Q_ �O~���8��6OS��D`(59k"$�L$�;`d63�U}�ݣ?/�L/=?���-��&�� �����"���(�۵����U�g�d�f��5�ʈ�ZP9+Vͺ�݉���+�����f�3�{4�#}� ����N�Oot��=�(�9��q���m_4��[�=����*9#v�����w-Ӑ�������]�܁$mP��?��y"��vb�Z)��_��T$%�Z�Q&X���~L�~��B��t;��g��x���`�0_��B�$��T��u@��?�0��?4'��2�E'1�����x !��!��Oa;*�-k/��0ױ���O4SquuU�t�1�����F1gܢ��P"4�(=�I�'K�֖���H��aj�dm*�x�͒��2M|w��}#���d��>����ta�C��z�iztjKz�� L���DC\I�_�7A��q�����~q ��ژz����;��"t���!d,��ȁh ue1?r����B��L����7t����E��5� �ٻ�!y�E�W?�>#,��W��?�#�2V+��������*��-+t]<�x֚ҹ_ ��&��N�V���<�m��p�Y���k�D�ׅ��.�E�d�$zX��m��C�_��Q����b���_n�~ j�|�m�6�\܇�,��U���p��>��4 ���L��]!F�]� �A����n��?�}�ۉ��W�~��Wc�2>/^�/����\�ϛ� ��q����z��ν�/-�?e�E�[��Q3%�Kw\�{��=5ҋ��ջ(h��]�����Y�Y��"�*5�&�"�En�� =��\��è�;�����y�)]zn9�b-0������l��� "�b����Mf�mk{���������Y�����q�cQ)�}ěO�$�o�)0P��Y�C�5��竗Zy���qv=��7�<N7��M6�?0_��;A'\:���'v���͇�=��C���~�S���G�~E�Q�]���;�d]���}�^��M��r��Ed�Rw��Ea^\�5К��s~�B��yg�w��#�%㒄B�_b��OA�4MpR��%��W?�״|�:����0g�p�^ x7�5�~4yB����ŗG��v�k�$x<O��em�wx���G~~2���6�� �m� eW,m��X.��~�s+� (�ؙ0��t:f��$�'�3�Y�,�XZ��x?$�k|��R��N�R�{Uy3���a�dJ���ʦ_�Q��I2!��|t�;�P6�#��n_�X�<�vSV�:X����[�Fg�B��I�%��,��6yk��@)��ź*&��4e*�\�1_��b7��-t�� |p��Qϖ��6A�l ����s>��j�a����8�~�Ԃ���J$��ȱ�g�YZ.shstrtab.interp.note.gnu.property.note.ABI-tag.note.gnu.build-id.gnu.hash.dynsym.dynstr.gnu.version.gnu.version_r.rela.dyn.rela.plt.init.plt.sec.text.fini.rodata.eh_frame_hdr.eh_frame.gcc_except_table.tbss.init_array.fini_array.data.rel.ro.dynamic.got.data.bss.gnu.build.attributes.gnu_debuglink.gnu_debugdata�� & 4@@$G���ohh4Q��P Y� � �a���o���n���o���}xxh�B��` �@#@#�`#`#P��)�)@��/�/%���� �0�0�!�4�4�d�����@������!���!���!���!�� � !� �!�`! ! "(a �8�<G8� �Vdracut-logger.sh000075500000031770151701010110007635 0ustar00#!/bin/bash # # logging faciality module for dracut both at build- and boot-time # # Copyright 2010 Amadeusz Żołnowski <aidecoe@aidecoe.name> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. __DRACUT_LOGGER__=1 ## @brief Logging facility module for dracut both at build- and boot-time. # # @section intro Introduction # # The logger takes a bit from Log4j philosophy. There are defined 6 logging # levels: # - TRACE (6) # The TRACE Level designates finer-grained informational events than the # DEBUG. # - DEBUG (5) # The DEBUG Level designates fine-grained informational events that are most # useful to debug an application. # - INFO (4) # The INFO level designates informational messages that highlight the # progress of the application at coarse-grained level. # - WARN (3) # The WARN level designates potentially harmful situations. # - ERROR (2) # The ERROR level designates error events that might still allow the # application to continue running. # - FATAL (1) # The FATAL level designates very severe error events that will presumably # lead the application to abort. # Descriptions are borrowed from Log4j documentation: # http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/Level.html # # @section usage Usage # # First of all you have to start with dlog_init() function which initializes # required variables. Don't call any other logging function before that one! # If you're ready with this, you can use following functions which corresponds # clearly to levels listed in @ref intro Introduction. Here they are: # - dtrace() # - ddebug() # - dinfo() # - dwarn() # - derror() # - dfatal() # They take all arguments given as a single message to be logged. See dlog() # function for details how it works. Note that you shouldn't use dlog() by # yourself. It's wrapped with above functions. # # @see dlog_init() dlog() # # @section conf Configuration # # Logging is controlled by following global variables: # - @var stdloglvl - logging level to standard error (console output) # - @var sysloglvl - logging level to syslog (by logger command) # - @var fileloglvl - logging level to file # - @var kmsgloglvl - logging level to /dev/kmsg (only for boot-time) # - @var logfile - log file which is used when @var fileloglvl is higher # than 0 # and two global variables: @var maxloglvl and @var syslogfacility which <b>must # not</b> be overwritten. Both are set by dlog_init(). @var maxloglvl holds # maximum logging level of those three and indicates that dlog_init() was run. # @var syslogfacility is set either to 'user' (when building initramfs) or # 'daemon' (when booting). # # Logging level set by the variable means that messages from this logging level # and above (FATAL is the highest) will be shown. Logging levels may be set # independently for each destination (stderr, syslog, file, kmsg). # # @see dlog_init() ## @brief Initializes dracut Logger. # # @retval 1 if something has gone wrong # @retval 0 on success. # # @note This function need to be called before any other from this file. # # If any of the variables is not set, this function set it to default: # - @var stdloglvl = 4 (info) # - @var sysloglvl = 0 (no logging) # - @var fileloglvl is set to 4 when @var logfile is set too, otherwise it's # - @var kmsgloglvl = 0 (no logging) # set to 0 # # @warning Function sets global variables @var maxloglvl and @syslogfacility. # See file doc comment for details. dlog_init() { local __oldumask local ret=0; local errmsg [ -z "$stdloglvl" ] && stdloglvl=4 [ -z "$sysloglvl" ] && sysloglvl=0 [ -z "$kmsgloglvl" ] && kmsgloglvl=0 # Skip initialization if it's already done. [ -n "$maxloglvl" ] && return 0 if [ -z "$fileloglvl" ]; then [ -w "$logfile" ] && fileloglvl=4 || fileloglvl=0 elif (( $fileloglvl > 0 )); then if [[ $logfile ]]; then __oldumask=$(umask) umask 0377 ! [ -e "$logfile" ] && >"$logfile" umask $__oldumask if [ -w "$logfile" -a -f "$logfile" ]; then # Mark new run in the log file echo >>"$logfile" if command -v date >/dev/null; then echo "=== $(date) ===" >>"$logfile" else echo "===============================================" >>"$logfile" fi echo >>"$logfile" else # We cannot log to file, so turn this facility off. fileloglvl=0 ret=1 errmsg="'$logfile' is not a writable file" fi fi fi if (( $UID != 0 )); then kmsgloglvl=0 sysloglvl=0 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 -a -w /dev/log ] || ! command -v logger >/dev/null; then # We cannot log to syslog, so turn this facility off. kmsgloglvl=$sysloglvl sysloglvl=0 ret=1 errmsg="No '/dev/log' or 'logger' included for syslog logging" fi fi if (($sysloglvl > 0)) || (($kmsgloglvl > 0 )); then if [ -n "$dracutbasedir" ]; then readonly syslogfacility=user else readonly syslogfacility=daemon fi export syslogfacility fi local lvl; local maxloglvl_l=0 for lvl in $stdloglvl $sysloglvl $fileloglvl $kmsgloglvl; do (( $lvl > $maxloglvl_l )) && maxloglvl_l=$lvl done readonly maxloglvl=$maxloglvl_l export maxloglvl if (($stdloglvl < 6)) && (($kmsgloglvl < 6)) && (($fileloglvl < 6)) && (($sysloglvl < 6)); then unset dtrace dtrace() { :; }; fi if (($stdloglvl < 5)) && (($kmsgloglvl < 5)) && (($fileloglvl < 5)) && (($sysloglvl < 5)); then unset ddebug ddebug() { :; }; fi if (($stdloglvl < 4)) && (($kmsgloglvl < 4)) && (($fileloglvl < 4)) && (($sysloglvl < 4)); then unset dinfo dinfo() { :; }; fi if (($stdloglvl < 3)) && (($kmsgloglvl < 3)) && (($fileloglvl < 3)) && (($sysloglvl < 3)); then unset dwarn dwarn() { :; }; unset dwarning dwarning() { :; }; fi if (($stdloglvl < 2)) && (($kmsgloglvl < 2)) && (($fileloglvl < 2)) && (($sysloglvl < 2)); then unset derror derror() { :; }; fi if (($stdloglvl < 1)) && (($kmsgloglvl < 1)) && (($fileloglvl < 1)) && (($sysloglvl < 1)); then unset dfatal dfatal() { :; }; fi [ -n "$errmsg" ] && derror "$errmsg" return $ret } ## @brief Converts numeric logging level to the first letter of level name. # # @param lvl Numeric logging level in range from 1 to 6. # @retval 1 if @a lvl is out of range. # @retval 0 if @a lvl is correct. # @result Echoes first letter of level name. _lvl2char() { case "$1" in 1) echo F;; 2) echo E;; 3) echo W;; 4) echo I;; 5) echo D;; 6) echo T;; *) return 1;; esac } ## @brief Converts numeric level to logger priority defined by POSIX.2. # # @param lvl Numeric logging level in range from 1 to 6. # @retval 1 if @a lvl is out of range. # @retval 0 if @a lvl is correct. # @result Echoes logger priority. _lvl2syspri() { printf $syslogfacility. case "$1" in 1) echo crit;; 2) echo error;; 3) echo warning;; 4) echo info;; 5) echo debug;; 6) echo debug;; *) return 1;; esac } ## @brief Converts dracut-logger numeric level to syslog log level # # @param lvl Numeric logging level in range from 1 to 6. # @retval 1 if @a lvl is out of range. # @retval 0 if @a lvl is correct. # @result Echoes kernel console numeric log level # # Conversion is done as follows: # # <tt> # none -> LOG_EMERG (0) # none -> LOG_ALERT (1) # FATAL(1) -> LOG_CRIT (2) # ERROR(2) -> LOG_ERR (3) # WARN(3) -> LOG_WARNING (4) # none -> LOG_NOTICE (5) # INFO(4) -> LOG_INFO (6) # DEBUG(5) -> LOG_DEBUG (7) # TRACE(6) / # </tt> # # @see /usr/include/sys/syslog.h _dlvl2syslvl() { local lvl case "$1" in 1) lvl=2;; 2) lvl=3;; 3) lvl=4;; 4) lvl=6;; 5) lvl=7;; 6) lvl=7;; *) return 1;; esac [ "$syslogfacility" = user ] && echo $((8+$lvl)) || echo $((24+$lvl)) } ## @brief Prints to stderr and/or writes to file, to syslog and/or /dev/kmsg # given message with given level (priority). # # @param lvl Numeric logging level. # @param msg Message. # @retval 0 It's always returned, even if logging failed. # # @note This function is not supposed to be called manually. Please use # dtrace(), ddebug(), or others instead which wrap this one. # # This is core logging function which logs given message to standard error, file # and/or syslog (with POSIX shell command <tt>logger</tt>) and/or to /dev/kmsg. # The format is following: # # <tt>X: some message</tt> # # where @c X is the first letter of logging level. See module description for # details on that. # # Message to syslog is sent with tag @c dracut. Priorities are mapped as # following: # - @c FATAL to @c crit # - @c ERROR to @c error # - @c WARN to @c warning # - @c INFO to @c info # - @c DEBUG and @c TRACE both to @c debug _do_dlog() { local lvl="$1"; shift local lvlc=$(_lvl2char "$lvl") || return 0 local msg="$*" local lmsg="$lvlc: $*" (( $lvl <= $stdloglvl )) && printf -- 'dracut: %s\n' "$msg" >&2 if (( $lvl <= $sysloglvl )); then if [[ "$_dlogfd" ]]; then printf -- "<%s>%s\n" "$(($(_dlvl2syslvl $lvl) & 7))" "$msg" >&$_dlogfd else logger -t "dracut[$$]" -p $(_lvl2syspri $lvl) -- "$msg" fi fi if (( $lvl <= $fileloglvl )) && [[ -w "$logfile" ]] && [[ -f "$logfile" ]]; then echo "$lmsg" >>"$logfile" fi (( $lvl <= $kmsgloglvl )) && \ echo "<$(_dlvl2syslvl $lvl)>dracut[$$] $msg" >/dev/kmsg } ## @brief Internal helper function for _do_dlog() # # @param lvl Numeric logging level. # @param msg Message. # @retval 0 It's always returned, even if logging failed. # # @note This function is not supposed to be called manually. Please use # dtrace(), ddebug(), or others instead which wrap this one. # # This function calls _do_dlog() either with parameter msg, or if # none is given, it will read standard input and will use every line as # a message. # # This enables: # dwarn "This is a warning" # echo "This is a warning" | dwarn dlog() { [ -z "$maxloglvl" ] && return 0 (( $1 <= $maxloglvl )) || return 0 if (( $# > 1 )); then _do_dlog "$@" else while read line || [ -n "$line" ]; do _do_dlog "$1" "$line" done fi } ## @brief Logs message at TRACE level (6) # # @param msg Message. # @retval 0 It's always returned, even if logging failed. dtrace() { set +x dlog 6 "$@" [ -n "$debug" ] && set -x || : } ## @brief Logs message at DEBUG level (5) # # @param msg Message. # @retval 0 It's always returned, even if logging failed. ddebug() { set +x dlog 5 "$@" [ -n "$debug" ] && set -x || : } ## @brief Logs message at INFO level (4) # # @param msg Message. # @retval 0 It's always returned, even if logging failed. dinfo() { set +x dlog 4 "$@" [ -n "$debug" ] && set -x || : } ## @brief Logs message at WARN level (3) # # @param msg Message. # @retval 0 It's always returned, even if logging failed. dwarn() { set +x dlog 3 "$@" [ -n "$debug" ] && set -x || : } ## @brief It's an alias to dwarn() function. # # @param msg Message. # @retval 0 It's always returned, even if logging failed. dwarning() { set +x dwarn "$@" [ -n "$debug" ] && set -x || : } ## @brief Logs message at ERROR level (2) # # @param msg Message. # @retval 0 It's always returned, even if logging failed. derror() { set +x dlog 2 "$@" [ -n "$debug" ] && set -x || : } ## @brief Logs message at FATAL level (1) # # @param msg Message. # @retval 0 It's always returned, even if logging failed. dfatal() { set +x dlog 1 "$@" [ -n "$debug" ] && set -x || : } dracut-version.sh000064400000000052151701010110010025 0ustar00DRACUT_VERSION=049-239.git20251127.el8_10 skipcpio000075500000027570151701010110006311 0ustar00ELF>�@�'@8@@@@hh��� hh h � �� � ����� ���DDS�td��� P�td� � � <<Q�tdR�tdhh h ��/lib64/ld-linux-x86-64.so.2GNU�GNUGNU��x�w��ʀ/ ���ya�)�9�� L7i� aE"� R"0 >@ libc.so.6exitfeofstrstrfseek__fprintf_chkstdoutfclosestderrfwritefread__cxa_finalizefopen64__libc_start_mainGLIBC_2.3.4GLIBC_2.2.5_ITM_deregisterTMCloneTable__gmon_start___ITM_registerTMCloneTableti {ui �h �p �x x � � � � � @ � � � � � � � � � � ��H��H�� H��t��H����5R �%S ��h�������h��������h�������h�������h�������h�������h�������h��q������h��a������h ��Q�������%� D���%� D���%� D���%� D���%� D���%� D���%} D���%u D���%m D���%e D��AUATUH��SH�����VH�~H�5��f���H��H���H����H�=� ����H����1�1�H���<����=u 0tjH�-l �@f.�H�ٺ�H������H��t(H� H�¾H������H��tH��������t�H�����H��1�[]A\A]À= 7u��=� 0u��=� 7�w����=� 0�j����=� 1�]���L�%� 1�M���(H�5L������H����H��H�� �>�����u.1�H��H���M���H�ٺL�� �� ��H��u�H��L�-b �����uTH����������H�ٺ�L���F ���H�������1����uBH��A�H9�u��u0H��1�1�H��������L)�1�H��H�l H������n���H�tH��1�����S���H�MH�=� �H�����H���2�����h���H�MH��H�=v �1��j�����@���H�H����@��1�I��^H��H���PTL�FH� �H�=X����� �H�=� H�� H9�tH�� H��t �����H�=� H�5� H)�H��H��H��?H�H�tH�u H��t��fD�����=� u+UH�=R H��tH�=� ����d����� ]������w������AWI��AVI��AUA��ATL�%l UH�-l SL)�H�����H��t1��L��L��D��A��H��H9�u�H��[]A\A]A^A_�ff.������H��H���Usage: %s <file> rCannot open file '%s' Read error from file '%s' TRAILER!!!;<`���p���������0���X ��������8zRx����/D$4���FJw�?:*3$"\p����<t����|F�B�A �D(�D0� (C ABBAD�(���eF�E�E �E(�H0�H8�G@n8A0A(B BBB�P�����x X h p ���o0�X �p � � ���o���o����o�o����o� 0@P`p�����GA$3a1GA$3p1113p U GA*GA$annobin gcc 8.5.0 20210514GA$plugin name: gcc-annobinGA$running gcc 8.5.0 20210514GA*GA! GA*FORTIFYGA+GLIBCXX_ASSERTIONSGA*cf_protectionGA+omit_frame_pointerGA+stack_clashGA!stack_realignGA*p �GA*GOW*�GA$3a1 e GA*�U GA*GOW* GA*FORTIFYGA+GLIBCXX_ASSERTIONSskipcpio-049-239.git20251127.el8_10.x86_64.debug����7zXZ�ִF!t/���S]?�E�h=��ڊ�2N� s���_>i���`��Sժ��u;f�i�h����H���~|a��Qq� ��qiO����� .�w ��,�>����u�O�|��p�����'�e�����(�#k������@J�����.�4Z�D��O��;%L�n-Кv��:�®zp}!�֦��1N�h�)��9�A�__uT��o�r�k�,�T�"�Y�j� ��ޯeº�Y����=���=X���O���_�J�+�TeB�m�_�f�nA[+����6 ���K} v$�J����,CzN��g�/��J`O��� te�NӉ 8�ؿc�u�c1{�Y��do��<��n����g��]�'}QӱTs|��;<kǐ��?y�:����N���xs Џ�y�����T7�t��Ү��I��HDK)61�TV�C���]�G�j7C���Z �S�$UΎo/��=Jn���w��g�V��S�|Y��%a�Em'0�;a�ǭ�]���'@t�����C���ג������C��1"��"ɛ�Cev���cR�-��S�S�6DV�����bU�y��1A�6�8�7rv�PMnT�E�8 ^��D��㑧��J0G*X��#��0� ���4Ŀ��ػ���1��˽� ��5| �^oNj4mJ����*YS����C�W�?^k� �lW��3�Ŷ1�¸�N3Vp�� ��g��QDc�ɍ���/J�t6(����S�I'��`&�;驢�d�OYT�XO�0���u��mJ�/�w��� �i,a� �����}&��,=��G����KYI�*���bu��g�YZ.shstrtab.interp.note.gnu.property.note.ABI-tag.note.gnu.build-id.gnu.hash.dynsym.dynstr.gnu.version.gnu.version_r.rela.dyn.rela.plt.init.plt.sec.text.fini.rodata.eh_frame_hdr.eh_frame.init_array.fini_array.data.rel.ro.dynamic.got.data.bss.gnu.build.attributes.gnu_debuglink.gnu_debugdata���� &�� 4$G���o00(QXX�Y���a���o��"n���o��0} ��B��� ������p p ��X X �h h U�� � <��h h�p p�x x�� ���p p�� H h ` � �"8/�"�x&>AUTHORS000064400000020145151705322070005620 0ustar00Harald Hoyer <harald@redhat.com> Victor Lowther <victor.lowther@gmail.com> Amadeusz Żołnowski <aidecoe@aidecoe.name> Hannes Reinecke <hare@suse.com> Will Woods <wwoods@redhat.com> Philippe Seewer <philippe.seewer@bfh.ch> Warren Togami <wtogami@redhat.com> Dave Young <dyoung@redhat.com> Jeremy Katz <katzj@redhat.com> David Dillow <dave@thedillows.org> Michal Soltys <soltys@ziu.info> Colin Guthrie <colin@mageia.org> Daniel Molkentin <dmolkentin@suse.com> Amerigo Wang <amwang@redhat.com> Thomas Renninger <trenn@suse.com> Lukas Nykryn <lnykryn@redhat.com> Alexander Tsoy <alexander@tsoy.me> Frederick Grose <fgrose@sugarlabs.org> WANG Chao <chaowang@redhat.com> Yu Watanabe <watanabe.yu+github@gmail.com> Andrey Borzenkov <arvidjaar@gmail.com> Hans de Goede <hdegoede@redhat.com> Peter Jones <pjones@redhat.com> Andreas Thienemann <andreas@bawue.net> Peter Robinson <pbrobinson@fedoraproject.org> Fabian Vogt <fvogt@suse.com> Kairui Song <kasong@redhat.com> John Reiser <jreiser@bitwagon.com> Luca Berra <bluca@vodka.it> Xunlei Pang <xlpang@redhat.com> Daniel Drake <drake@endlessm.com> Lubomir Rintel <lkundrak@v3.sk> Angelo "pallotron" Failla <pallotron@fb.com> Brian C. Lane <bcl@redhat.com> Ville Skyttä <ville.skytta@iki.fi> Cristian Rodríguez <crrodriguez@opensuse.org> Dan Horák <dhorak@redhat.com> Baoquan He <bhe@redhat.com> Brendan Germain <brendan.germain@nasdaqomx.com> Colin Walters <walters@verbum.org> Leho Kraav <leho@kraav.com> Moritz Maxeiner <moritz@ucworks.org> Nicolas Chauvet <kwizart@gmail.com> Ondrej Mosnacek <omosnace@redhat.com> Fabian Deutsch <fabiand@fedoraproject.org> Javier Martinez Canillas <javierm@redhat.com> Kamil Rytarowski <n54@gmx.com> Lidong Zhong <lidong.zhong@suse.com> Marc Grimme <grimme@atix.de> NeilBrown <neilb@suse.de> Peter Rajnoha <prajnoha@redhat.com> Radek Vykydal <rvykydal@redhat.com> Thorsten Behrens <tbehrens@suse.com> Chao Wang <chaowang@redhat.com> Frederic Crozat <fcrozat@suse.com> James Lee <jlee@thestaticvoid.com> Jesse Keating <jkeating@redhat.com> Martin Wilck <mwilck@suse.de> Mike Gilbert <floppym@gentoo.org> Milan Broz <mbroz@redhat.com> Mimi Zohar <zohar@linux.vnet.ibm.com> Roberto Sassu <roberto.sassu@polito.it> Stefan Reimer <it@startux.de> Adam Williamson <awilliam@redhat.com> Anton Blanchard <anton@samba.org> Bill Nottingham <notting@redhat.com> Chapman Flack <g2@anastigmatix.net> Chris Leech <cleech@redhat.com> David Cantrell <dcantrell@redhat.com> Dennis Gilmore <dennis@ausil.us> Jan Synacek <jsynacek@redhat.com> Jon Ander Hernandez <jonan.h@gmail.com> Juan RP <xtraeme@gmail.com> Lance Albertson <lance@osuosl.org> Marcos Mello <marcosfrm@gmail.com> Marian Ganisin <mganisin@redhat.com> Matthias Gerstner <matthias.gerstner@suse.de> Michael Ploujnikov <plouj@somanetworks.com> Pratyush Anand <panand@redhat.com> Silvio Fricke <silvio.fricke@gmail.com> Steven Brudenell <steven.brudenell@gmail.com> Stig Telfer <stelfer@cray.com> Thomas Backlund <tmb@mageia.org> Vasiliy Tolstov <v.tolstov@selfip.ru> Wim Muskee <wimmuskee@gmail.com> tpgxyz <tpgxyz@gmail.com> Alan Jenkins <alan-jenkins@tuffmail.co.uk> Alan Pevec <apevec@redhat.com> Alex Harpin <development@landsofshadow.co.uk> Ankit Kumar <ankit@linux.vnet.ibm.com> Antony Messerli <amesserl@rackspace.com> Chao Fan <cfan@redhat.com> Daniel Kahn Gillmor <dkg@fifthhorseman.net> Daniel Schaal <farbing@web.de> Denis Silakov <dsilakov@virtuozzo.com> Dimitri John Ledkov <dimitri.j.ledkov@intel.com> Erwan Velu <erwan.velu@enovance.com> Evgeny Vereshchagin <evvers@ya.ru> Guido Trentalancia <guido@trentalancia.net> Hari Bathini <hbathini@linux.vnet.ibm.com> Ian Dall <ian@beware.dropbear.id.au> Imran Haider <imran1008@gmail.com> James Buren <ryuo@frugalware.org> Joey Boggs <jboggs@redhat.com> Julian Wolf <juwolf@suse.com> Koen Kooi <koen@dominion.thruhere.net> Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> Kyle McMartin <kmcmarti@redhat.com> Lukas Wunner <lukas@wunner.de> Mike Snitzer <snitzer@redhat.com> Minfei Huang <mhuang@redhat.com> Nikoli <nikoli@gmx.us> Pingfan Liu <piliu@redhat.com> Przemysław Rudy <prudy1@o2.pl> Robert LeBlanc <robert@leblancnet.us> Robert Scheck <robert@fedoraproject.org> Stefan Berger <stefanb@us.ibm.com> Thomas Lange <lange@informatik.uni-koeln.de> Till Maas <opensource@till.name> Tony Asleson <tasleson@redhat.com> Vivek Goyal <vgoyal@redhat.com> Vladislav Bogdanov <bubble@hoster-ok.com> Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> Alexander Kurtz <alexander@kurtz.be> Alexander Todorov <atodorov@redhat.com> Andreas Stieger <astieger@suse.com> Andy Lutomirski <luto@mit.edu> Anssi Hannula <anssi@mageia.org> Artem Savkov <asavkov@redhat.com> B. Wilson <x@wilsonb.com> Brandon Philips <brandon@ifup.co> Bryn M. Reeves <bmr@redhat.com> Canek Peláez Valdés <caneko@gmail.com> Carlo Caione <carlo@endlessm.com> Chad Dupuis <chad.dupuis@cavium.com> Christian Heinz <christian.ch.heinz@gmail.com> Cong Wang <amwang@redhat.com> Dan Fuhry <dfuhry@datto.com> Dave Jones <davej@redhat.com> David Disseldorp <ddiss@suse.de> David Michael <david.michael@coreos.com> Dennis Schridde <devurandom@gmx.net> Derek Higgins <derekh@redhat.com> Duane Griffin <duaneg@dghda.com> Elan Ruusamäe <glen@delfi.ee> Enno Boland <g@s01.de> Eugene Syromiatnikov <esyr@redhat.com> Florian Albrechtskirchinger <falbrechtskirchinger@gmail.com> Florian Gamböck <mail@floga.de> François Cami <fcami@fedoraproject.org> Gerd von Egidy <gerd.von.egidy@intra2net.com> Glen Gray <slaine@slaine.org> HATAYAMA Daisuke <d.hatayama@jp.fujitsu.com> Hendrik Brueckner <brueckner@linux.ibm.com> Hermann Gausterer <git-dracut-2012@mrq1.org> Hiroaki Mizuguchi <hiroaki-m@iij.ad.jp> Hui Wang <john.wanghui@huawei.com> Ignaz Forster <iforster@suse.com> James Laska <jlaska@redhat.com> Jan Stodola <jstodola@redhat.com> Jason Dana <jasondana@quarksecurity.com> Jeremy Linton <lintonrjeremy@gmail.com> Jiri Pirko <jiri@resnulli.us> Joe Lawrence <Joe.Lawrence@stratus.com> Johannes Thumshirn <jthumshirn@suse.com> Jonas Jonsson <jonas@websystem.se> Kevin Yung <Kevin.Yung@myob.com> Lars R. Damerow <lars@pixar.com> Lennert Buytenhek <buytenh@wantstofly.org> Major Hayden <major@mhtx.net> Marc-Antoine Perennou <Marc-Antoine@Perennou.com> Marian Csontos <mcsontos@redhat.com> Mark Fasheh <mfasheh@suse.de> Marko Myllynen <myllynen@redhat.com> Matt <smoothsailing72@hotmail.com> Matt Smith <shadowfax@gmx.com> Matthew Thode <mthode@mthode.org> Mei Liu <liumbj@linux.vnet.ibm.com> Michael Chapman <mike@very.puzzling.org> Michael McCracken <michael.mccracken@gmail.com> Michal Koutný <mkoutny@suse.com> Michal Schmidt <mschmidt@redhat.com> Michal Sekletar <msekleta@redhat.com> Mike Gorse <mgorse@suse.com> Moritz 'Morty' Strübe <morty@gmx.net> Munehiro Matsuda <haro@kgt.co.jp> Nicolas Porcel <nicolasporcel06@gmail.com> Olivier Blin <dev@blino.org> P J P <ppandit@redhat.com> Paolo Bonzini <pbonzini@redhat.com> Pavel Zhukov <pzhukov@redhat.com> Pawel Wieczorkiewicz <pwieczorkiewicz@suse.de> Pekka Wallendahl <wyrmiyu@gmail.com> Prarit Bhargava <prarit@redhat.com> Praveen_Paladugu@Dell.com <Praveen_Paladugu@Dell.com> Pádraig Brady <P@draigBrady.com> Quentin Armitage <quentin@armitage.org.uk> Renaud Métrich <rmetrich@redhat.com> Robert Buchholz <rbu@goodpoint.de> Ruben Kerkhof <ruben@rubenkerkhof.com> Rusty Bird <rustybird@openmailbox.org> Sergey Fionov <fionov@gmail.com> Shawn W Dunn <sfalken@opensuse.org> Srinivasa T N <seenutn@linux.vnet.ibm.com> Stijn Hoop <stijn@sandcat.nl> Sullivan (CTR), Austin <austin.sullivan.ctr@progeny.net> Thilo Bangert <thilo.bangert@gmx.net> Thomas Blume <thomas.blume@suse.com> Tobias Geerinckx <tobias.geerinckx@gmail.com> Tobias Klauser <tklauser@distanz.ch> Tom Gundersen <teg@jklm.no> Tomasz Paweł Gajc <tpgxyz@gmail.com> Tomasz Torcz <tomek@pipebreaker.pl> Tong Li <tonli@redhat.com> Vadim Kuznetsov <vadimk@gentoo.org> Vaughan Cao <vaughan.cao@oracle.com> Vratislav Podzimek <vpodzime@redhat.com> Yanko Kaneti <yaneti@declera.com> Zhiguo Deng <bjzgdeng@linux.vnet.ibm.com> Ziyue Yang <ziyang@redhat.com> honza801 <honza801@gmail.com> jloeser <jloeser@suse.de> johannes <johannes.brechtmann@gmail.com> jonathan-teh <30538043+jonathan-teh@users.noreply.github.com> maximilian attems <max@stro.at> privb0x23 <privb0x23@users.noreply.github.com> tpg <tpgxyz@gmail.com> xtraeme <xtraeme@voidlinux.eu> HACKING000064400000001620151705322070005534 0ustar00Right now, most of the testing is done using a qemu/kvm guest and generating the initramfs on another box but the support is all present to build for the "running" machine. For the former, you can boot the guest using qemu's -kernel and -initrd options. dracut exists and will build an image. It is command-line equivalent to most mkinitrd implementations and should be pretty straight-forward to use. To use, just run dracut with an output file name and, optionally, a kernel version (it defaults to using the current). The appropriate modules will be copied over and things should be good to go. If you'd like to customize the list of modules copied in, edit /etc/dracut.conf and set dracutmodules="foo bar baz" Note that dracut calls functional components in modules.d "modules" while kernel modules are called "drivers". Requirements: * udev * nfs module: nfs daemon and rpc helper * iscsi: iscsi NEWS000064400000151576151705322070005264 0ustar00dracut-049 ========== lsinitrd: - record loaded kernel modules when hostonly mode is enabled lsinitrd $image -f */lib/dracut/loaded-kernel-modules.txt - allow to only unpack certain files kernel-modules: - add gpio and pinctrl drivers for arm*/aarch64 - add nfit kernel-network-modules: - add vlan kernel modules ifcfg/write-ifcfg.sh: - aggregate resolv.conf livenet: - Enable OverlayFS overlay in sysroot.mount generator. dmsquash-live: - Support a flattened squashfs.img dracut-systemd: - Start systemd-vconsole-setup before dracut-cmdline-ask iscsi: - do not install all of /etc/iscsi unless hostonly - start iscsid even w/o systemd multipath: - fixed shutdown network: - configure NetworkManager to use dhclient mdraid: - fixed uuid handling ":" versus "-" stratis: - Add additional binaries new modules: - 00warpclock - 99squash Adds support for building a squashed initramfs - 35network-legacy the old 40network - 35network-manager alternative to 35network-legacy - 90kernel-modules-extra adds out-of-tree kernel modules testsuite: - now runs on travis - support new qemu device options - even runs without kvm now dracut-048 ========== dracut.sh: - fixed finding of btrfs devices - harden dracut against BASH_ENV environment variable - no more prelinking - scan and install "external" kernel modules - fixed instmods with zero input - rdsosreport: best effort to strip out passwords - introduce tri-state hostonly mode Add a new option --hostonly-mode which accept an <mode> parameter, so we have a tri-state hostonly mode: * generic: by passing "--no-hostonly" or not passing anything. "--hostonly-mode" has no effect in such case. * sloppy: by passing "--hostonly --hostonly-mode sloppy". This is also the default mode when only "--hostonly" is given. * strict: by passing "--hostonly --hostonly-mode strict". Sloppy mode is the original hostonly mode, the new introduced strict mode will allow modules to ignore more drivers or do some extra job to save memory and disk space, while making the image less portable. Also introduced a helper function "optional_hostonly" to make it easier for modules to leverage new hostonly mode. To force install modules only in sloppy hostonly mode, use the form: hostonly="$(optional_hostonly)" instmods <modules> dracut-install: - don't error out, if no modules were installed - support modules.softdep lsinitrd.sh: - fixed zstd file signature kernel: - include all pci/host modules - add mmc/core for arm - Include Intel Volume Management Device support plymouth: - fix detection of plymouth directory drm: - make failing installation of drm modules nonfatal - include virtio DRM drivers in hostonly initramfs stratis: - initial Stratis support crypt: - correct s390 arch to include arch-specific crypto modules - add cmdline rd.luks.partuuid - add timeout option rd.luks.timeout shutdown: - sleep a little, if a process was killed network: - introduce ip=either6 option iscsi: - replace iscsistart with iscsid qeth_rules: - new module to copy qeth rules multipath-hostonly: - merged back into multipath mdraid: - fixed case if rd.md.uuid is in ID_FS_UUID format dracut-047 ========== dracut.sh: - sync initramfs to filesystem with fsfreeze - introduce "--no-hostonly-default-device" - disable lsinitrd logging when quiet - add support for Zstandard compression - fixed relative paths in --kerneldir - if /boot/vmlinuz-$version exists use /boot/ as default output dir - make qemu and qemu-net a default module in non-hostonly mode - fixed relative symlinks - support microcode updates for all AMD CPU families - install all modules-load.d regardless of hostonly - fixed parsing of "-i" and "--include" - bump kmod version to >= 23 - enable 'early_microcode' by default - fixed check_block_and_slaves() for nvme lsinitrd.sh: - dismiss "cat" error messages systemd-bootchart: - removed i18n: - install all keymaps for a given locale - add correct fontmaps dmsquash-live: - fixed systemd unit escape systemd: - enable core dumps with systemd from initrd - fixed setting of timeouts for device units - emergency.service: use Type=idle and fixed task limit multipath: - include files from /etc/multipath/conf.d - do not fail startup on missing configuration - start daemon after udev settle - add shutdown script - parse kernel commandline option 'multipath=off' - start before local-fs-pre.target dracut-emergency: - optionally print filesystem help network: - fixed MTU for bond master - fixed race condition when wait for networks fcoe: - handle CNAs with DCB firmware support - allow to specify the FCoE mode via the fcoe= parameter - always set AUTO_VLAN for fcoemon - add shutdown script - fixup fcoe-genrules.sh for VN2VN mode - switch back to using fipvlan for bnx2fc - add timeout mechanism crypt: - add basic LUKS detached header support - escape backslashes for systemd unit names correctly - put block_uuid.map into initramfs dmraid: - do not delete partitions dasd_mod: - do not set module parameters if dasd_cio_free is not present nfs: - fix mount if IPv4 address is used in /etc/fstab - support host being a DNS ALIAS fips: - fixed creating path to .hmac of kernel based on BOOT_IMAGE lunmask: - add module to handle LUN masking s390: - add rd.cio_accept dcssblk: - add new module for DCSS block devices zipl: - add new module to update s390x configuration iscsi: - no more iscsid, either iscsistart or iscsid integrity: - support loading x509 into the trusted/builtin .evm keyring - support X.509-only EVM configuration plymouth: - improve distro compatibility dracut-046 ========== dracut.sh: - bail out if module directory does not exist if people want to build the initramfs without kernel modules, then --no-kernel should be specified - add early microcode support for AMD family 16h - collect also all modaliases modules from sysfs for hostonly modules - sync initramfs after creation network: - wait for IPv6 RA if using none/static IPv6 assignment - ipv6 improvements - Handle curl using libnssckbi for TLS - fix dhcp classless_static_routes - dhclient: send client-identifier matching hardware address - don't arping for point-to-point connections - only bring up wired network interfaces (no wlan and wwan) mraid: - mdraid: wait for rd.md.uuid specified devices to be assembled crypt: - handle rd.luks.name crypt-gpg: - For GnuPG >= 2.1 support OpenPGP smartcards kernel-install: - Skip to create initrd if /etc/machine-id is missing or empty nfs: - handle rpcbind /run/rpcbind directory s390: - various fixes dmsquash-live: - add NTFS support multipath: - split out multipath-hostonly module lvmmerge: - new module, see README.md in the module directory dracut-systemd: - fixed dependencies dracut-045 ========== Important: dracut now requires libkmod for the dracut-install binary helper, which nows handles kernel module installing and filtering. dracut.sh: - restorecon final image file - fail hard, if we find modules and modules.dep is missing - support --tmpdir as a relative path - add default path for --uefi dracut-functions.sh: - fix check_vol_slaves() volume group name stripping dracut-install: - catch ldd message "cannot execute binary file" - added kernel module handling with libkmod Added parameters: --module,-m --mod-filter-path, -p --mod-filter-nopath, -P --mod-filter-symbol, -s --mod-filter-nosymbol, -S --mod-filter-noname, -N --silent --kerneldir --firmwaredirs - fallback to non-hostonly mode if lsmod fails lsinitrd: - new option "--unpack" - new option "--unpackearly" - and "--verbose" general initramfs fixes: - don't remove 99-cmdline-ask on 'hostonly' cleanup - call dracut-cmdline-ask.service, if /etc/cmdline.d/*.conf exists - break at switch_root only for bare rd.break - add rd.emergency=[reboot|poweroff|halt] specifies what action to execute in case of a critical failure - rd.memdebug=4 gives information, about kernel module memory consumption during loading dmsquash-live: - fixed livenet-generator execution flag and include only, if systemd is used - fixed dmsquash-live-root.sh for cases where the fstype of the liveimage is squashfs - fixed typo for rootfs.img - enable the use of the OverlayFS for the LiveOS root filesystem Patch notes: Integrate the option to use an OverlayFS as the root filesystem into the 90dmsquash-live module for testing purposes. The rd.live.overlay.overlayfs option allows one to request an OverlayFS overlay. If a persistent overlay is detected at the standard LiveOS path, the overlay & type detected will be used. Tested primarily with transient, in-RAM overlay boots on vfat- formatted Live USB devices, with persistent overlay directories on ext4-formatted Live USB devices, and with embedded, persistent overlay directories on vfat-formatted devices. (Persistent overlay directories on a vfat-formatted device must be in an embedded filesystem that supports the creation of trusted.* extended attributes, and must provide valid d_type in readdir responses.) The rd.live.overlay.readonly option, which allows a persistent overlayfs to be mounted read only through a higher level transient overlay directory, has been implemented through the multiple lower layers feature of OverlayFS. The default transient DM overlay size has been adjusted up to 32 GiB. This change supports comparison of transient Device-mapper vs. transient OverlayFS overlay performance. A transient DM overlay is a sparse file in memory, so this setting does not consume more RAM for legacy applications. It does permit a user to use all of the available root filesystem storage, and fails gently when it is consumed, as the available free root filesystem storage on a typical LiveOS build is only a few GiB. Thus, when booted on other- than-small RAM systems, the transient DM overlay should not overflow. OverlayFS offers the potential to use all of the available free RAM or all of the available free disc storage (on non-vfat-devices) in its overlay, even beyond the root filesystem available space, because the OverlayFS root filesystem is a union of directories on two different partitions. This patch also cleans up some message spew at shutdown, shortens the execution path in a couple of places, and uses persistent DM targets where required. dmraid: - added "nowatch" option in udev rule, otherwise udev would reread partitions for raid members - allow booting from degraded MD RAID arrays shutdown: - handle readonly /run on shutdown kernel-modules: - add all HID drivers, regardless of hostonly mode people swap keyboards sometimes and should be able to enter their disk password - add usb-storage To save the rdsosreport.txt to a USB stick, the usb-storage module is needed. - add xennet - add nvme systemd: - add /etc/machine-info - fixed systemd-escape call for names beginning with "-" - install missing drop-in configuration files for /etc/systemd/{journal.conf,system.conf} filesystems: - add support to F2FS filesystem (fsck and modules) network: - fix carrier detection - correctly set mac address for ip=...:<mtu>:<mac> - fixed vlan, bonding, bridging, team logic call ifup for the slaves and assemble afterwards - add mtu to list of variables to store in override - for rd.neednet=0 a bootdev is not needed anymore - dhclient-script.sh: add classless-static-routes support - support for iBFT IPv6 - support macaddr in brackets [] (commit 740c46c0224a187d6b5a42b4aa56e173238884cc) - use arping2, if available - support multiple default gateways from DHCP server - fixup VLAN handling - enhance team support - differ between ipv6 local and global tentative - ipv6: wait for a router advertised route - add 'mtu' parameter for bond options - use 'ip' instead of 'brctl' nbd: - add systemd generator - use export names instead of port numbers, because port number based exports are deprecated and were removed. fcoe: - no more /dev/shm state copying multipath: - check all /dev/mapper devices if they are multipath devices, not only mpath* fips: - fixed .hmac installation in FIPS mode plymouth: - also trigger the acpi subsystem syslog: - add imjournal.so to read systemd journal - move start from udev to initqueue/online caps: - make it a non default module livenet: - support nfs:// urls in livenet-generator nfs: - install all nfs modules non-hostonly crypt: - support keyfiles embedded in the initramfs testsuite: - add TEST-70-BONDBRIDGETEAMVLAN - make "-cpu host" the default dracut-044 ========== creation: - better udev & systemd dir detection - split dracut-functions.sh in dracut-init.sh and dracut-functions.sh dracut-functions.sh can now be sourced by external tools - detect all btrfs devices needed - added flag file if initqueue is needed - don't overwrite anything, if initramfs image file creation failed - if no compressor is specified, try to find a suitable one - drop scanning kernel config for CONFIG_MICROCODE_*_EARLY - remove "_EARLY" from CONFIG_MICROCODE_* checks - dracut.sh: add command line option for install_i18_all --no-hostonly-i18n -> install_i18n_all=yes --hostonly-i18n -> install_i18n_all=no - --no-reproducible to turn off reproducible mode - dracut-function.sh can now be sourced from outside of dracut - dracut-init.sh contains all functions, which only can be used from within the dracut infrastructure - support --mount with just mountpoint as a parameter - removed action_on_fail support - removed host_modalias concept - do not create microcode, if no firmware is available - skip gpg files in microcode generation initramfs: - ensure pre-mount (and resume) run before root fsck - add --online option to initqueue qemu: - fixed virtual machine detection lvm: - remove all quirk arguments for lvm >= 2.2.221 dmsquash: - fixup for checkisomd5 - increase timeout for checkisomd5 - use non-persistent metadata snapshots for transient overlays. - overflow support for persistent snapshot. - use non-persistent metadata snapshots. - avoid an overlay for persistent, uncompressed, read-write live installations. multipath: - multipath.conf included in hostonly mode - install all multipath path selector kernel modules iSCSI: - use the iBFT initiator name, if found and set - iscsid now present in the initramfs - iscsistart is done with systemd-run asynchrone to do things in paralllel. Also restarted for every new interface which shows up. - If rd.iscsi.waitnet (default) is set, iscsistart is done only after all interfaces are up. - If not all interfaces are up and rd.iscsi.testroute (default) is set, the route to a iscsi target IP is checked and skipped, if there is none. - If all things fail, we issue a "dummy" interface iscsiroot to retry everything in the initqueue/timeout. network: - added DHCP RENEW/REBIND - IPv4 DHCP lease time now optional (bootp) - IPv6 nfs parsing - fixed IPv6 route parsing - rd.peerdns=0 parameter to disable DHCP nameserver setting - detect duplicate IPv4 addresses for static addresses - if interfaces are specified with its enx* name, bind the correspondent MAC to the interface name - if multiple "ip=" are present on the kernel command line "rd.neednet=1" is assumed - add options to tweak timeouts rd.net.dhcp.retry=<cnt> If this option is set, dracut will try to connect via dhcp <cnt> times before failing. Default is 1. rd.net.timeout.dhcp=<arg> If this option is set, dhclient is called with "-timeout <arg>". rd.net.timeout.iflink=<seconds> Wait <seconds> until link shows up. Default is 60 seconds. rd.net.timeout.ifup=<seconds> Wait <seconds> until link has state "UP". Default is 20 seconds. rd.net.timeout.route=<seconds> Wait <seconds> until route shows up. Default is 20 seconds. rd.net.timeout.ipv6dad=<seconds> Wait <seconds> until IPv6 DAD is finished. Default is 50 seconds. rd.net.timeout.ipv6auto=<seconds> Wait <seconds> until IPv6 automatic addresses are assigned. Default is 40 seconds. rd.net.timeout.carrier=<seconds> Wait <seconds> until carrier is recognized. Default is 5 seconds. IMA: - load signed certificates in the IMA keyring, see modules.d/98integrity/README - load EVM public key in the kernel _evm keyring FCoE: fcoe: start with fcoemon instead of fipvlan dracut-043 ========== - add missing dmsquash-generator dracut-042 ========== - fixed dmsetup shutdown - new kernel command line option "rd.live.overlay.thin" This option changes the underlying mechanism for the overlay in the dmsquash module. Instead of a plain dm snapshot a dm thin snapshot is used. The advantage of the thin snapshot is, that the TRIM command is recognized, which means that at runtime, only the occupied blocks will be claimed from memory, and freed blocks will really be freed in ram. - dmsquash: Add squashfs support to rd.live.fsimg Previously rd.live.fsimg only supported filesystems residing in (compressed) archives. Now rd.live.fsimg can also be used when a squashfs image is used. This is achieved by extracting the rootfs image from the squashfs and then continue with the default routines for rd.live.fsimg. - lvm: add support for LVM system id - split up the systemd dracut module Basic systemd functionality is in 00systemd now. Switching root and the initrd.target is in 00systemd-initrd. Dracut additions to the systemd initrd are in 98dracut-systemd. - support for creating a UEFI boot executable via argument "--uefi" With an EFI stub, the kernel, the initramfs and a kernel cmdline can be glued together to a single UEFI executable, which can be booted by a UEFI BIOS. - network: split out kernel-network-modules, now in 90kernel-network-modules - support for ethernet point-to-point connections configured via DHCP - kernel-modules: install all HID drivers - dracut.pc pkg-config file - mount /dev, /dev/shm and /run noexec dracut-041 ========== - fixed the shutdown loop - fixed gzip compression for versions, which do not have --rsyncable - fixed ifcfg generation for persistent interface names - multipath: * new option to turn off multipath "rd.multipath=0" completly * preload scsi dh modules * start multipathd via systemd service - do not fail, if user pressed ESC during media check - fixed systemd-journal by symlinking /var/log to /run/initramfs/log - initrd-release moved to /usr/lib - lots of iSCSI fixes - new "rd.timeout" to specify the systemd JobTimeoutSec for devices - if $initrd/etc/cmdline.d/* has a "root=" and the kernel cmdline does not, generate a mount unit for it - increased the initqueue timeout for non systemd initramfs to 180s - $initrd/etc/cmdline.d/ hostonly files are now generated for NFS - make use of systemd-hibernate-resume, if available - fixed ldconfig parsing for hwcap output - network: add support for comma separated autoconf options like ip=eth0:auto6,dhcp - new parameter "rd.live.overlay.size" to specify the overlay for live images - changed the test suite for the new sfdisk syntax - added cache tools for dm-cache setups dracut-040 ========== - fixed dracut module dependency checks - fixed test suite dracut-039 ========== - DRACUT_PATH can now be used to specify the PATH used by dracut to search for binaries instead of the default /usr/sbin:/sbin:/usr/bin:/bin This should be set in the distribution config file /usr/lib/dracut/dracut.conf.d/01-dist.conf - add "--loginstall <DIR>" and loginstall="<DIR>" options to record all files, which are installed from the host fs - "rd.writable.fsimg" - support for read/write filesystem images - "rd.route" kernel command line parameter added - "--install-optional" and install_optional_items added - find plymouth pkglibdir on debian - torrent support for live images root=live:torrent://example.com/liveboot.img.torrent and generally added as a download handler - disable microcode, if the kernel does not support it - speed up ldconfig_paths() - more ARM modules - fixed inst*() functions and "-H" handling - fixed bridge setup - added --force-drivers parameter and force_drivers=+ config option to enforce driver loading at early boot time - documented "iso-scan/filename" usage in grub - various bugfixes dracut-038 ========== - "rd.cmdline=ask" will ask the user on the console to enter additional kernel command line parameters - "rd.hostonly=0" removes all "hostonly" added custom files, which is useful in combination with "rd.auto" or other specific parameters, if you want to boot on the same hardware, but the compiled in configuration does not match your setup anymore - inst* functions and dracut-install now accept the "-H" flag, which logs all installed files to /lib/dracut/hostonly-files. This is used to remove those files, if rd.hostonly is given on the kernel command line - strstr now only does literal string match, please use strglob and strglobin for globs - fixed unpacking of the microcode image on shutdown - added systemd-gpt-auto-generator - fcoe: wait for lldpad to be ready - network: handle "ip=dhcp6" - network: DCHPv6: set valid_lft and preferred_lft - dm: support dm-cache - fstab: do not mount and fsck from fstab if using systemd - break at switch_root only for bare rd.break and not for any rd.break=... - nbd: make use of "--systemd-mark", otherwise it gets killed on switch_root - fcoe-uefi: fixed cmdline parameter generation - iscsi: deprecate "ip=ibft", use "rd.iscsi.ibft[=1]" from now on - "lsinitrd -m" now only lists the dracut modules of the image - a lot of small bugfixes dracut-037 ========== - dracut: hostonly_cmdline variable and command line switch Toggle hostonly cmdline storing in the initramfs --hostonly-cmdline: Store kernel command line arguments needed in the initramfs --no-hostonly-cmdline: Do not store kernel command line arguments needed in the initramfs - dracut: --mount now understands full fstab lines - dracut now also includes drivers from the /lib/modules/<version>/updates directory - dracut: only set the owner of files to 0:0, if generated as non-root - dracut now directly writes to the initramfs file - dracut: call lz4 with the legacy flag (linux kernel does not support the new format) - systemd: rootfs-generator generates JobTimeout=0 units for the root device - systemd: added the systemd-sysctl service - systemd: add 80-net-setup-link.rules and .link files for persistent interface renaming - systemd: make dracut-shutdown.service failure non-fatal - network: various IPv6 fixes - network: DCHCP for IPv6 - network: understand ip=.....:<dns1>:<dns2> - network: parse ibft nameserver settings - shutdown: if kexec fails, just reboot - lvm: handle one LV at a time with lvchange - module-setup.sh: New functions require_binaries() and require_any_binary() to be used in the check() section of module-setup.sh. - a lot of small bugfixes Contributions from: Harald Hoyer Alexander Tsoy Till Maas Amadeusz Żołnowski Brian C. Lane Colin Guthrie Dave Young WANG Chao Shawn W Dunn dracut-036 ========== - fixed skipcpio signature checking dracut-035 ========== - changed dracut tarball compression to xz - new argument "--rebuild" - add lzo, lz4 compression - install: install all binaries with <name> found in PATH - lsinitrd can now handle initramfs images with an early cpio prepended (microcode, ACPI tables) - mkinitrd-suse added as a compat stub for dracut - lvm: install thin utils for non-hostonly - resume: fix swap detection in hostonly - avoid loading unnecessary 32-bit libraries for 64-bit initrds - crypt: wait for systemd password agents - crypt: skip crypt swaps with password files - network: before doing dhcp, dracut now checks, if the link has a carrier - network: dhclient-script.sh now sets the lease time - network: include usbnet drivers - network: include all ethernet drivers - network: add rd.bootif=0 to ignore BOOTIF - i18n: introduce i18n_install_all, to install everything i18n related - support SuSE DASD configurations - support SuSE zfcp configurations - support SuSE compressed KEYMAP= setting - usrmount: always install the module, so always mount /usr from within the initramfs - test/TEST-17-LVM-THIN: new test case for lvm thin pools - "halt" the machine in systemd mode for die() dracut-034 ========== - do not run dhcp on parts of assembled network interfaces (bond, bridge) - add option to turn on/off prelinking --prelink, --noprelink do_prelink=[yes|no] - add ACPI table overriding - do not log to syslog/kmsg/journal for UID != 0 - lvm/mdraid: Fix LVM on MD activation - bcache module removed (now in bcache-tools upstream) - mdadm: also install configs from /etc/mdadm.conf.d - fixes for mdadm-3.2.6+ - mkinitrd: better compat support for SUSE - fcoe: add FCoE UEFI boot device support - rootfs-block: add support for the rootfallback= kernel cmdline option Contributions from: Thomas Renninger Alexander Tsoy Peter Rajnoha WANG Chao Harald Hoyer dracut-033 ========== - improved hostonly device recognition - improved hostonly module recognition - add dracut.css for dracut.html - do not install udev rules from /etc in generic mode - fixed LABEL= parsing for swap devices - fixed iBFT network setup - url-lib.sh: handle 0-size files with curl - dracut.asc: document debugging dracut on shutdown - if rd.md=0, use dmraid for imsm and ddf - skip empty dracut modules - removed caching of kernel cmdline - fixed iso-scan, if the loop device driver is a kernel module - bcache: support new blkid - fixed ifup udev rules - ifup with dhcp, if no "ip=" specified for the interface Contributions from: WANG Chao Colin Walters Harald Hoyer dracut-032 ========== - add parameter --print-cmdline This prints the kernel command line parameters for the current disk layout. $ dracut --print-cmdline rd.luks.uuid=luks-e68c8906-6542-4a26-83c4-91b4dd9f0471 rd.lvm.lv=debian/root rd.lvm.lv=debian/usr root=/dev/mapper/debian-root rootflags=rw,relatime,errors=remount-ro,user_xattr,barrier=1,data=ordered rootfstype=ext4 - dracut.sh: add --persistent-policy option and persistent_policy conf option --persistent-policy <policy>: Use <policy> to address disks and partitions. <policy> can be any directory name found in /dev/disk. E.g. "by-uuid", "by-label" - dracut now creates the initramfs without udevadm that means the udev database does not have to populated and the initramfs can be built in a chroot with /sys /dev /proc mounted - renamed dracut_install() to inst_multiple() for consistent naming - if $libdirs is unset, fall back to ld.so.cache paths - always assemble /usr device in initramfs - bash module added (disable it, if you really want dash) - continue to boot, if the main loop times out, in systemd mode - removed inst*() shell pure versions, dracut-install binary is in charge now - fixed ifcfg file generation for vlan - do not include adjtime and localtime anymore - fixed generation of zfcp.conf of CMS setups - install vt102 terminfo dracut_install() is still there for backwards compat - do not strip files in FIPS mode - fixed iBFT interface configuration - fs-lib: install fsck and fsck.ext* - shutdown: fixed killall_proc_mountpoint() - network: also wait for ethernet interfaces to setup - fixed checking for FIPS mode Contributions from: Harald Hoyer WANG Chao Baoquan He Daniel Schaal Dave Young James Lee Radek Vykydal dracut-031 ========== - do not include the resume dracut module in hostonly mode, if no swap is present - don't warn twice about omitted modules - use systemd-cat for logging on systemd systems, if logfile is unset - fixed PARTUUID parsing - support kernel module signing keys - do not install the usrmount dracut module in hostonly mode, if /sbin/init does not live in /usr - add debian udev rule files - add support for bcache - network: handle bootif style interfaces e.g. ip=77-77-6f-6f-64-73:dhcp - add support for kmod static devnodes - add vlan support for iBFT Contributions from: Harald Hoyer Amadeusz Żołnowski Brandon Philips Colin Walters James Lee Kyle McMartin Peter Jones dracut-030 ========== - support new persistent network interface names - fix findmnt calls, prevents hang on stale NFS mounts - add systemd.slice and slice.target units - major shell cleanup - support root=PARTLABEL= and root=PARTUUID= - terminfo: only install l/linux v/vt100 and v/vt220 - unset all LC_* and LANG, 10% faster - fixed dependency loop for dracut-cmdline.service - do not wait_for_dev for the root devices - do not wait_for_dev for devices, if dracut-initqueue is not needed - support early microcode loading with --early-microcode - dmraid, let dmraid setup its own partitions - sosreport renamed to rdsosreport Contributions from: Harald Hoyer Konrad Rzeszutek Wilk WANG Chao dracut-029 ========== - wait for IPv6 autoconfiguration - i18n: make the default font configurable To set the default font for your distribution, add i18n_default_font="latarcyrheb-sun16" to your /lib/dracut/dracut.conf.d/01-dist.conf distribution config. - proper handle "rd.break" in systemd mode before switch-root - systemd: make unit files symlinks - build without dash requirement - add dracut-shutdown.service.8 manpage - handle MACs for "ip=" "ip=77-77-6f-6f-64-73:dhcp" - don't explode when mixing BOOTIF and ip= - 90lvm/module-setup.sh: redirect error message of lvs to /dev/null Contributions from: Harald Hoyer Will Woods Baoquan He dracut-028 ========== - full integration of crypto devs in systemd logic - support for bridge over team and vlan tagged team - support multiple bonding interfaces - new kernel command line param "rd.action_on_fail" to control the emergency action - support for bridge over a vlan tagged interface - support for "iso-scan/filename" kernel parameter - lsinitrd got some love and does not use "file" anymore - fixed issue with noexec mounted tmp dirs - FIPS mode fixed - dracut_install got some love - fixed some /usr mounting problems - ifcfg dracut module got some love and fixes - default installed font is now latarcyrheb-sun16 - new parameters rd.live.dir and rd.live.squashimg - lvm: add tools for thin provisioning - also install non-hwcap libs - setup correct system time and time zone in initrd - s390: fixed cms setup - add systemd-udevd persistent network interface naming Contributions from: Harald Hoyer Kamil Rytarowski WANG Chao Baoquan He Adam Williamson Colin Guthrie Dan Horák Dave Young Dennis Gilmore Dennis Schridde dracut-027 ========== - dracut now has bash-completion - require bash version 4 - systemd module now requires systemd >= 199 - dracut makes use of native systemd initrd units - added hooks for new-kernel-pkg and kernel-install - hostonly is now default for fedora - comply with the BootLoaderSpec paths http://www.freedesktop.org/wiki/Specifications/BootLoaderSpec - added rescue module - host_fs_types is now a hashmap - new dracut argument "--regenerate-all" - new dracut argument "--noimageifnotneeded" - new man page dracut.bootup - install all host filesystem drivers - use -D_FILE_OFFSET_BITS=64 to build dracut-install dracut-026 ========== - introduce /usr/lib/dracut/dracut.conf.d/ drop-in directory /usr/lib/dracut/dracut.conf.d/*.conf can be overwritten by the same filenames in /etc/dracut.conf.d. Packages should use /usr/lib/dracut/dracut.conf.d rather than /etc/dracut.conf.d for drop-in configuration files. /etc/dracut.conf and /etc/dracut.conf.d belong to the system administrator. - uses systemd-198 native initrd units - totally rely on the fstab-generator in systemd mode for block devices - dracut systemd now uses dracut.target rather than basic.target - dracut systemd services optimize themselves away - fixed hostonly parameter generation - turn off curl globbing (fixes IPv6) - modify the udev rules on install and not runtime time - enable initramfs building without kernel modules (fixed regression) - in the initqueue/timeout, reset the main loop counter, as we see new udev events or initqueue/work - fixed udev rule installation dracut-025 ========== - do not strip signed kernel modules - add sosreport script and generate /run/initramfs/sosreport.txt - make short uuid specification for allow-discards work - turn off RateLimit for the systemd journal - fixed MAC address assignment - add systemd checkisomd5 service - splitout drm kernel modules from plymouth module - add 'swapoff' to initramfs to fix shutdown/reboot - add team device support - add pre-shutdown hook - kill all processes in shutdown and report remaining ones - "--device" changed to "--add-device" and "add_device=" added for conf files - add memory usage trace to different hook points - cope with optional field #7 in /proc/self/mountinfo - lots of small bugfixes dracut-024 ========== - new dracut option "--device" - new dracut kernel command line options "rd.auto" - new dracut kernel command line options "rd.noverifyssl" - new dracut option "--kernel-cmdline" and "kernel_cmdline" option for default parameters - fixes for systemd and crypto - fix for kexec in shutdown, if not included in initramfs - create the initramfs non-world readable - prelink/preunlink in the initramfs - strip binaries in the initramfs by default now - various FIPS fixes - various dracut-install fixes dracut-023 ========== - resume from hibernate fixes - -N option for --no-hostonly - support for systemd crypto handling - new dracut module "crypt-loop" - deprecate the old kernel command line options - more documentation - honor CFLAGS for dracut-install build - multipath fixes - / is mounted according to rootflags parameter but forced ro at first. Later it is remounted according to /etc/fstab + rootflags parameter and "ro"/"rw". - support for xfs / reiserfs separate journal device - new "ro_mnt" option to force ro mount of / and /usr - root on cifs support - dracut-install: fixed issue for /var/tmp containing a symlink - only lazy resolve with ldd, if the /var/tmp partition is not mounted with "noexec" - i18n: fixed inclusion of "include" keymaps dracut-022 ========== - fixed host-only kernel module bug dracut-021 ========== - fixed systemd in the initramfs (requires systemd >= 187) - dracut-install: massive speedup with /var on the same filesystem with COW copy - dracut-install: moved to /usr/lib/dracut until it becomes a general purpose tool - new options: "rd.usrmount.ro" and "rd.skipfsck" - less mount/umount - apply "ro" on the kernel command line also to /usr - mount according to fstab, if neither "ro" or "rw" is specified - skip fsck for xfs and btrfs. remount is enough - give emergency_shell if /usr mount failed - dracut now uses getopt: * options can be position independent now!! * we can now use --option=<arg> - added option "--kver=<kernel-version>", and the image location can be omitted # dracut --kver 3.5.0-0.rc7.git1.2.fc18.x86_64 - dracut.sh: for --include copy also the symbolic links - man pages: lsinitrd and mkinitrd added - network: We do not support renaming in the kernel namespace anymore (as udev does that not anymore). So, if a user wants to use ifname, he has to rename to a custom namespace. "eth[0-9]+" is not allowed anymore. !!!!! - resume: moved the resume process to the initqueue. This should prevent accidently mounting the root file system. - testsuite: add support for: make V=1 TESTS="01 20 40" check $ sudo make V=1 clean check now runs the testsuite in verbose mode $ sudo make TESTS="01 20 40" clean check now only runs the 01, 20 and 40 tests. dracut-020 ========== - changed rd.dasd kernel parameter - arm kernel modules added to kernel-modules - make udevdir systemdutildir systemdsystemunitdir global vars your distribution should ship those settings in /etc/dracut.conf.d/01-distro.conf see dracut.conf.d/fedora.conf.example - kernel modules are now only handled with /sys/modules and modules.dep - systemd fixups - mdraid: wait for md devices to be clean, before shutdown - ifup fixed for ipv6 - add PARTUUID as root=PARTUUID=<partition uuid> parameter - fixed instmods() return code and set pipefail globally - add 04watchdog dracut module - dracut-shutdown.service: fixed ordering to be before shutdown.target - make use of "ln -r" instead of shell functions, if new coreutils is installed - network: support vlan tagged bonding - new dracut module qemu and qemu-net to install all kernel driver - fs-lib/fs-lib.sh: removed test mounting of btrfs and xfs - no more "mknod" in the initramfs!! - replaced all "tr" calls with "sed" - speedup with lazy kernel module dependency resolving - lots of speedup optimizations and last but not least - dracut-install: - new binary to significanlty speedup the installation process - dracut-functions.sh makes use of it, if installed dracut-019 ========== - initqueue/online hook - fixes for ifcfg write out - rootfs-block: avoid remount when options don't change - Debian multiarch support - virtfs root filesystem support - cope with systemd-udevd - mount tmpfs with strictatime - include all kernel/drivers/net/phy drivers - add debug_on() and debug_off() functions - add arguments for source_hook() and source_all() - cleanup hook - plymouth: get consoledev from /sys/class/tty/console/active - experimental systemd dracut module for systemd in the initramfs - install xhci-hcd kernel module - dracut: new "--mount" option - lsinitrd: new option --printsize - ARM storage kernel modules added - s390 cms conf file support - /etc/initrd-release in the initrd - vlan support - full bonding and bridge support - removed scsi_wait_scan kernel module from standard install - support rd.luks.allow-discards and honor options in crypttab - lots of bugfixes dracut-018 ========== - lvm: ignore lvm mirrors - lsinitrd: handle LZMA images - iscsi: add rd.iscsi.param - iscsi: add iscsi interface binding - new module cms to read and handle z-Series cms config files - fixed fstab.sys handling - new dracut option "--tmpdir" - new dracut option "--no-hostonly" - nbd: name based nbd connects - converted manpage and documentation source to asciidoc - write-ifcfg fixes and cleanups - ifup is now done in the initqueue - netroot cleanup - initqueue/online is now for hooks, which require network - no more /tmp/root.info - 98pollcdrom: factored out the ugly cdrom polling in the main loop - simplified rd.luks.uuid testing - removed "egrep" and "ls" calls - speedup kernel module installation - make bzip2 optional - lots of bugfixes dracut-017 ========== - a _lot_ faster than dracut-016 in image creation - systemd service dracut-shutdown.service - livenet fixes - ssh-client module install fix - root=iscsi:... fixed - lots of restructuring and optimizing in dracut-functions.sh - usrmount: honor fs_passno in /etc/fstab - renamed all shell scripts to .sh - new option "--omit-drivers" and config option "omit_drivers" - hostonly mode fixups dracut-016 ========== - fixed lsinitrd - honor binaries in sbin first - fixed usrmount module - added systemd service for shutdown - fixed terminfo on distros with /usr/share/terminfo - reload udev rules after "pre-trigger" hook - improved test suite - new parameter "--omit-drivers" and new conf param omit_drivers - "--offroot" support for mdraid - new libs: net-lib.sh, nfs-lib.sh, url-lib.sh, img-lib.sh full of functions to use in your dracut module dracut-015 ========== - hostonly mode automatically adds command line options for root and /usr - --add-fstab --mount parameters - ssh-client module - --ctty option: add job control - cleanup /run/initramfs - convertfs module - /sbin/ifup can be called directly - support kernel modules compressed with xz - s390 iscsi modules added - terminfo module - lsinitrd can handle concatened images - lsinitrd can sort by size dracut-014 ========== - new dracut arguments: --lvmconf --nolvmconf --fscks [LIST] --nofscks - new .conf options: install_items fscks nofscks - new kernel options: rd.md.ddf rd.md.waitclean plymouth.enable - dracut move from /sbin to /usr/bin - dracut modules dir moved from /usr/share/dracut to /usr/lib/dracut - profiling with "dracut --profile" - new TEST-16-DMSQUASH, test for Fedora LiveCDs - speedup of initramfs creation - ask_for_password fallback to CLI - mdraid completely switched to incremental assembly - no more cdrom polling - "switch_root" breakpoint is now very late - /dev/live is gone - /dev/root is gone - fs-lib dracut module for fscks added - xen dracut module removed - usb mass storage kernel drivers now included - usrmount dracut module added: mount /usr if found in /sysroot/etc/fstab - only include fsck helper needed for hostonly - fcoe: support for bnx2fc - support iSCSI drivers: qla4xxx, cxgb3i, cxgb4i, bnx2i, be2iscsi - fips-aesni dracut module added - add install_items to dracut.conf install_items+=" <file>[ <file> ...] " - speedup internal testsuite - internal testsuite: store temporary data in a temporary dir dracut-013 ========== - speedup of initramfs creation - fixed inst_dir for symbolic links - add unix kernel module dracut-012 ========== - better fsck handling - fixed wait condition for LVM volumes - fix for hardlinks (welcome Debian! :-) - shutdown bugfixes - automatic busybox symlink creation - try to mount /usr, if init points to a path in /usr - btrfs with multiple devices - "--force-add" option for dracut, to force-add dracut modules, without hostonly checks - lsinitrd also display the initramfs size in human readable form - livenet module, to mount live-isos over http - masterkey,ecryptfs,integrity security modules - initqueue/timeout queue e.g. for starting degraded raids - "make rpm" creates an rpm with an increasing release number from any git checkout - support lvm mirrors - start degraded lvm mirrors after a timeout - start degraded md raids after a timeout - getarg() now returns wildcards without file matching to the current fs - lots of bugfixes dracut-011 ========== - use udev-168 features for shutting down udev - introduce "--prefix" to put all initramfs files in e.g "/run/initramfs" - new shutdown script (called by systemd >= 030) to disassemble the root device - lots of bugfixes - new module for gpg-encrypted keys - 91crypt-gpg dracut-010 ========== - lots of bugfixes - plymouth: use /run/plymouth/pid instead of /run/initramfs/plymouth - add "/lib/firmware/updates" to default firmware path dracut-009 ========== - dracut generator - dracut-logger - xz compression - better argument handling - initramfs - hooks moved to /lib/dracut/hooks in initramfs - rd.driver.{blacklist|pre|post} accept comma separated driver list - iSCSI: iSCSI Boot Firmware Table (iBFT) support - support for /run - live image: support for generic rootfs.img (instead of ext3fs.img) - caps module - FCoE: EDD support dracut-008 ========== - removed --ignore-kernel-modules option (no longer necessary) - renamed kernel command line arguments to follow the rd. naming scheme - merged check, install, installkernel to module-setup.sh - support for bzip2 and xz compressed initramfs images. - source code beautification - lots of documentation - lsinitrd: "catinitrd" functionality - dracut: --list-modules - lvm: support for dynamic LVM SNAPSHOT root volume - 95fstab-sys: mount all /etc/fstab.sys volumes before switch_root - 96insmodpost dracut module - rd.shell=1 per default - rootfs-block:mount-root.sh add fsck - busybox shell replacements module - honor old "real_init=" - 97biosdevname dracut module dracut-007 ========== - module i18n is no longer fedora/red hat specific (Amadeusz Żołnowski) - distribution specific conf file - bootchartd support - debug module now has fsck - use "hardlink", if available, to save some space - /etc/dracut.conf can be overwritten by settings in /etc/dracut.conf.d/*.conf - gentoo splash module - --ignore-kernel-modules option - crypto keys on external devices support - bugfixes dracut-006 ========== - fixed mdraid with IMSM - fixed dracut manpages - dmraid parse different error messages - add cdrom polling mechanism for slow cdroms - add module btrfs - add btrfsctl scan for btrfs multi-devices (raid) - teach dmsquash live-root to use rootflags - trigger udev with action=add - fixed add_drivers handling - add sr_mod - use pigz instead of gzip, if available - boot from LVM mirrors and snapshots - iscsi: add support for multiple netroot=iscsi: - Support old version of module-init-tools - got rid of rdnetdebug - fixed "ip=auto6" - dracut.conf: use "+=" as default for config variables - bugfixes dracut-005 ========== - dcb support to dracut's FCoE support - add readonly overlay support for dmsquash - add keyboard kernel modules - dracut.conf: added add_dracutmodules - add /etc/dracut.conf.d - add preliminary IPv6 support - bugfixes dracut-004 ========== - dracut-lib: read multiple lines from $init/etc/cmdline - lsinitrd and mkinitrd - dmsquash: add support for loopmounted *.iso files - lvm: add rd_LVM_LV and "--poll n" - user suspend support - add additional drivers in host-only mode, too - improved emergency shell - support for compressed kernel modules - support for loading Xen modules - rdloaddriver kernel command line parameter - man pages for dracut-catimages and dracut-gencmdline - bugfixes dracut-003 ========== - add debian package modules - add dracut.conf manpage - add module 90multipath - add module 01fips - crypt: ignore devices in /etc/crypttab (root is not in there) unless rd_NO_CRYPTTAB is specified - kernel-modules: add scsi_dh scsi_dh_rdac scsi_dh_emc - add multinic support - add s390 zfcp support - add s390 dasd support - add s390 network support - fixed dracut-gencmdline for root=UUID or LABEL - do not destroy assembled raid arrays if mdadm.conf present - mount /dev/shm - let udevd not resolve group and user names - moved network from udev to initqueue - improved debug output: specifying "rdinitdebug" now logs to dmesg, console and /init.log - strip kernel modules which have no x bit set - redirect stdin, stdout, stderr all RW to /dev/console so the user can use "less" to view /init.log and dmesg - add new device mapper udev rules and dmeventd - fixed dracut-gencmdline for root=UUID or LABEL - do not destroy assembled raid arrays if mdadm.conf present - mount /dev/shm - let udevd not resolve group and user names - preserve timestamps of tools on initramfs generation - generate symlinks for binaries correctly - moved network from udev to initqueue - mount nfs3 with nfsvers=3 option and retry with nfsvers=2 - fixed nbd initqueue-finished - improved debug output: specifying "rdinitdebug" now logs to dmesg, console and /init.log - strip kernel modules which have no x bit set - redirect stdin, stdout, stderr all RW to /dev/console so the user can use "less" to view /init.log and dmesg - make install of new dm/lvm udev rules optionally - add new device mapper udev rules and dmeventd - Fix LiveCD boot regression - bail out if selinux policy could not be loaded and selinux=0 not specified on kernel command line - do not cleanup dmraids - copy over lvm.conf dracut-002 ========== - add ifname= argument for persistent netdev names - new /initqueue-finished to check if the main loop can be left - copy mdadm.conf if --mdadmconf set or mdadmconf in dracut.conf - plymouth: use plymouth-populate-initrd - add add_drivers for dracut and dracut.conf - add modprobe scsi_wait_scan to be sure everything was scanned - fix for several problems with md raid containers - fix for selinux policy loading - fix for mdraid for IMSM - fix for bug, which prevents installing 61-persistent-storage.rules (bug #520109) - fix for missing grep for md dracut-001 ========== - better --hostonly checks - better lvm/mdraid/dmraid handling - fcoe booting support Supported cmdline formats: fcoe=<networkdevice>:<dcb|nodcb> fcoe=<macaddress>:<dcb|nodcb> Note currently only nodcb is supported, the dcb option is reserved for future use. Note letters in the macaddress must be lowercase! Examples: fcoe=eth0:nodcb fcoe=4A:3F:4C:04:F8:D7:nodcb - Syslog support for dracut This module provides syslog functionality in the initrd. This is especially interesting when complex configuration being used to provide access to the device the rootfs resides on. dracut-0.9 ========== - let plymouth attach to the terminal (nice text output now) - new kernel command line parameter "rdinfo" show dracut output, even when "quiet" is specified - rd_LUKS_UUID is now handled correctly - dracut-gencmdline: rd_LUKS_UUID and rd_MD_UUID is now correctly generated - now generates initrd-generic with around 15MB - smaller bugfixes dracut-0.8 ========== - iSCSI with username and password - support for live images (dmsquashed live images) - iscsi_firmware fixes - smaller images - bugfixes dracut-0.7 ========== - dracut: strip binaries in initramfs --strip strip binaries in the initramfs (default) --nostrip do not strip binaries in the initramfs - dracut-catimages Usage: ./dracut-catimages [OPTION]... <initramfs> <base image> [<image>...] Creates initial ramdisk image by concatenating several images from the command line and /boot/dracut/ -f, --force Overwrite existing initramfs file. -i, --imagedir Directory with additional images to add (default: /boot/dracut/) -o, --overlaydir Overlay directory, which contains files that will be used to create an additional image --nooverlay Do not use the overlay directory --noimagedir Do not use the additional image directory -h, --help This message --debug Output debug information of the build process -v, --verbose Verbose output during the build process - s390 dasd support dracut-0.6 ========== - dracut: add --kernel-only and --no-kernel arguments --kernel-only only install kernel drivers and firmware files --no-kernel do not install kernel drivers and firmware files All kernel module related install commands moved from "install" to "installkernel". For "--kernel-only" all installkernel scripts of the specified modules are used, regardless of any checks, so that all modules which might be needed by any dracut generic image are in. The basic idea is to create two images. One image with the kernel modules and one without. So if the kernel changes, you only have to replace one image. Grub and the kernel can handle multiple images, so grub entry can look like this: title Fedora (2.6.29.5-191.fc11.i586) root (hd0,0) kernel /vmlinuz-2.6.29.5-191.fc11.i586 ro rhgb quiet initrd /initrd-20090722.img /initrd-kernel-2.6.29.5-191.fc11.i586.img /initrd-config.img initrd-20090722.img the image provided by the initrd rpm one old backup version is kept like with the kernel initrd-kernel-2.6.29.5-191.fc11.i586.img the image provided by the kernel rpm initrd-config.img optional image with local configuration files - dracut: add --kmoddir directory, where to look for kernel modules -k, --kmoddir [DIR] specify the directory, where to look for kernel modules dracut-0.5 ========== - more generic (all plymouth modules, all keyboards, all console fonts) - more kernel command line parameters (see also man dracut(8)) - a helper tool, which generates the kernel command line (dracut-gencmdline) - bridged network boot - a lot of new command line parameter dracut-0.4 ========== - bugfixes - firmware loading support - new internal queue (initqueue) initqueue now loops until /dev/root exists or root is mounted init now has the following points to inject scripts: /cmdline/*.sh scripts for command line parsing /pre-udev/*.sh scripts to run before udev is started /pre-trigger/*.sh scripts to run before the main udev trigger is pulled /initqueue/*.sh runs in parallel to the udev trigger Udev events can add scripts here with /sbin/initqueue. If /sbin/initqueue is called with the "--onetime" option, the script will be removed after it was run. If /initqueue/work is created and udev >= 143 then this loop can process the jobs in parallel to the udevtrigger. If the udev queue is empty and no root device is found or no root filesystem was mounted, the user will be dropped to a shell after a timeout. Scripts can remove themselves from the initqueue by "rm $job". /pre-mount/*.sh scripts to run before the root filesystem is mounted NFS is an exception, because it has no device node to be created and mounts in the udev events /mount/*.sh scripts to mount the root filesystem NFS is an exception, because it has no device node to be created and mounts in the udev events If the udev queue is empty and no root device is found or no root filesystem was mounted, the user will be dropped to a shell after a timeout. /pre-pivot/*.sh scripts to run before the real init is executed and the initramfs disappears All processes started before should be killed here. The behaviour of the dmraid module demonstrates how to use the new mechanism. If it detects a device which is part of a raidmember from a udev rule, it installs a job to scan for dmraid devices, if the udev queue is empty. After a scan, it removes itsself from the queue. dracut-0.3 ========== - first public version README000064400000007641151705322070005436 0ustar00dracut ------ dracut is an event driven initramfs infrastructure. dracut (the tool) is used to create an initramfs image by copying tools and files from an installed system and combining it with the dracut framework, usually found in /usr/lib/dracut/modules.d. Unlike existing initramfs's, this is an attempt at having as little as possible hard-coded into the initramfs as possible. The initramfs has (basically) one purpose in life -- getting the rootfs mounted so that we can transition to the real rootfs. This is all driven off of device availability. Therefore, instead of scripts hard-coded to do various things, we depend on udev to create device nodes for us and then when we have the rootfs's device node, we mount and carry on. This helps to keep the time required in the initramfs as little as possible so that things like a 5 second boot aren't made impossible as a result of the very existence of an initramfs. It's likely that we'll grow some hooks for running arbitrary commands in the flow of the script, but it's worth trying to resist the urge as much as we can as hooks are guaranteed to be the path to slow-down. Most of the initramfs generation functionality in dracut is provided by a bunch of generator modules that are sourced by the main dracut script to install specific functionality into the initramfs. They live in the modules.d subdirectory, and use functionality provided by dracut-functions to do their work. Some general rules for writing modules: * Use one of the inst family of functions to actually install files on to the initramfs. They handle mangling the pathnames and (for binaries, scripts, and kernel modules) installing dependencies as appropriate so you do not have to. * Scripts that end up on the initramfs should be POSIX compliant. dracut will try to use /bin/dash as /bin/sh for the initramfs if it is available, so you should install it on your system -- dash aims for strict POSIX compliance to the extent possible. * Hooks MUST be POSIX compliant -- they are sourced by the init script, and having a bashism break your user's ability to boot really sucks. * Generator modules should have a two digit numeric prefix -- they run in ascending sort order. Anything in the 90-99 range is stuff that dracut relies on, so try not to break those hooks. * Hooks must have a .sh extension. * Generator modules are described in more detail in README.modules. * We have some breakpoints for debugging your hooks. If you pass 'rdbreak' as a kernel parameter, the initramfs will drop to a shell just before switching to a new root. You can pass 'rdbreak=hookpoint', and the initramfs will break just before hooks in that hookpoint run. Also, there is an attempt to keep things as distribution-agnostic as possible. Every distribution has their own tool here and it's not something which is really interesting to have separate across them. So contributions to help decrease the distro-dependencies are welcome. Currently dracut lives on github.com and kernel.org. The tarballs can be found here: http://www.kernel.org/pub/linux/utils/boot/dracut/ ftp://ftp.kernel.org/pub/linux/utils/boot/dracut/ Git: git://git.kernel.org/pub/scm/boot/dracut/dracut.git http://git.kernel.org/pub/scm/boot/dracut/dracut.git https://git.kernel.org/pub/scm/boot/dracut/dracut.git git@github.com:dracutdevs/dracut.git Git Web: https://github.com/dracutdevs/dracut.git http://git.kernel.org/?p=boot/dracut/dracut.git Project Documentation: http://www.kernel.org/pub/linux/utils/boot/dracut/dracut.html Project Wiki: http://dracut.wiki.kernel.org See the TODO file for things which still need to be done and HACKING for some instructions on how to get started. There is also a mailing list that is being used for the discussion -- initramfs@vger.kernel.org. It is a typical vger list, send mail to majordomo@vger.kernel.org with body of 'subscribe initramfs email@host.com' Licensed under the GPLv2 TODO000064400000004215151705322070005240 0ustar00Current TODO list, broken into things which are relevant for the initramfs itself (/init et al) vs the generator. A lot of things are/should be marked with "FIXME" in the code. Items are ordered in priority. INITRAMFS TODO - search domain string - allow dual stack configuration (IPv4, IPv6) for the same interface - "bind-mount" kernel drivers in real root for the rescue image, if the real root does not have any kernel modules for this kernel https://bugzilla.redhat.com/show_bug.cgi?id=1046510 - use info and warn prefix - generate systemd unit dracut-initramfs-restore in /run/systemd dynamically - put "root=" parsing hooks in separate hook dir - call "root=" parsing hooks after getting new rootpath from dhcp - put mount hook in main initqueue loop / careful about resume! - the hard-coded list of udev rules that we care about is kind of lame. - panic fallback - progress indication for fsck https://bugzilla.redhat.com/show_bug.cgi?id=827118 - domain, searchdomain https://bugzilla.redhat.com/show_bug.cgi?id=840778 - probably fix "--include" https://bugzilla.redhat.com/show_bug.cgi?id=849338 GENERATOR TODO - report errors on missing files in check() - remove wait for swap devs, if no "resume=" is given on the kernel command line - remove wait for swap devs, if the "resume" dracut module is not included (omitted) - add presets (predefined set of modules) - add interpreter/plugin-scripts to be sourced at the beginning or end (can use dracut-functions) - add mechanism for module specific command line options - pkg-config integration, to make it easy for other packages to use us. - default module specification could use some work - udev rule copying, as mentioned above, is a bit too hard-coded - dracut-install parse LD_SHOW_AUXV="" AT_PLATFORM for lib install CODE TODO - document more functions - make function vars local, and prefix with "_" Future Enhancement Requests - run ssh server to enter crypto password or perform debugging (supported by debian) - https://bugzilla.redhat.com/show_bug.cgi?id=524727 - dracut + encrypted root + networking - lsinitrd --print-cmdline - dracut --print-cmdline error if additional arguments - library for cmdline dracut.html000064400000732025151705322070006727 0ustar00<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>dracut</title><style type="text/css"> body, h1, h2, h3, h4, h5, h6, pre, li, div { line-height: 1.29em; } body { background-color: white; margin:0 auto; font-family: "liberation sans", "Myriad ", "Bitstream Vera Sans", "Lucida Grande", "Luxi Sans", "Trebuchet MS", helvetica, verdana, arial, sans-serif; font-size:12px; max-width:55em; color:black; } /* desktop styles */ body.desktop { margin-left: 26em; } body.desktop .book > .toc { display:block; width:24em; height:99%; position:fixed; overflow:auto; top:0px; left:0px; padding-left:1em; background-color:#EEEEEE; } .toc { line-height:1.35em; } .toc .glossary, .toc .chapter, .toc .appendix { margin-top:1em; } .toc .part { margin-top:1em; display:block; } span.glossary, span.appendix { display:block; margin-top:0.5em; } div { padding-top:0px; } div.section { padding-top:1em; } p, div.para, div.formalpara { padding-top:0px; margin-top:0.3em; padding-bottom:0px; margin-bottom:1em; } /*Links*/ a { outline: none; } a:link { text-decoration:none; border-bottom: 1px dotted ; color:#3366cc; } a:visited { text-decoration:none; border-bottom: 1px dotted ; color:#003366; } div.longdesc-link { float:right; color:#999; } .toc a, .qandaset a { font-weight:normal; } /*headings*/ h1, h2, h3, h4, h5, h6 { color: #336699; margin-top: 0em; margin-bottom: 0em; background-color: transparent; } h1 { font-size:2.0em; } .titlepage h1.title { font-size: 3.0em; padding-top: 1em; text-align:left; } .book > .titlepage h1.title { text-align:center; } .article > .titlepage h1.title { text-align:center; } .set .titlepage > div > div > h1.title { text-align:center; } .producttitle { margin-top: 0em; margin-bottom: 0em; font-size: 3.0em; font-weight: bold; color: white; text-align: center; padding: 0.7em; } .titlepage .corpauthor { margin-top: 1em; text-align: center; } .section h1.title { font-size: 1.6em; padding: 0em; color: #336699; text-align: left; background: white; } h2 { font-size:1.6em; } h2.subtitle, h3.subtitle { margin-top: 1em; margin-bottom: 1em; font-size: 1.4em; text-align: center; } .preface > div > div > div > h2.title { margin-top: 1em; font-size: 2.0em; } .appendix h2 { margin-top: 1em; font-size: 2.0em; } h3 { font-size:1.3em; padding-top:0em; padding-bottom:0em; } h4 { font-size:1.1em; padding-top:0em; padding-bottom:0em; } h5 { font-size:1em; } h6 { font-size:1em; } h5.formalpara { font-size:1em; margin-top:2em; margin-bottom:.8em; } .abstract h6 { margin-top:1em; margin-bottom:.5em; font-size:2em; } /*element rules*/ hr { border-collapse: collapse; border-style:none; border-top: 1px dotted #ccc; width:100%; margin-top: 3em; } /* web site rules */ ul.languages, .languages li { display:inline; padding:0em; } .languages li a { padding:0em .5em; text-decoration: none; } .languages li p, .languages li div.para { display:inline; } .languages li a:link, .languages li a:visited { color:#444; } .languages li a:hover, .languages li a:focus, .languages li a:active { color:black; } ul.languages { display:block; background-color:#eee; padding:.5em; } /*supporting stylesheets*/ /*unique to the webpage only*/ .books { position:relative; } .versions li { width:100%; clear:both; display:block; } a.version { font-size:2em; text-decoration:none; width:100%; display:block; padding:1em 0em .2em 0em; clear:both; } a.version:before { content:"Version"; font-size:smaller; } a.version:visited, a.version:link { color:#666; } a.version:focus, a.version:hover { color:black; } .books { display:block; position:relative; clear:both; width:100%; } .books li { display:block; width:200px; float:left; position:relative; clear: none ; } .books .html { width:170px; display:block; } .books .pdf { position:absolute; left:170px; top:0px; font-size:smaller; } .books .pdf:link, .books .pdf:visited { color:#555; } .books .pdf:hover, .books .pdf:focus { color:#000; } .books li a { text-decoration:none; } .books li a:hover { color:black; } /*products*/ .products li { display: block; width:300px; float:left; } .products li a { width:300px; padding:.5em 0em; } .products ul { clear:both; } /*revision history*/ .revhistory { display:block; } .revhistory table { background-color:transparent; border-color:#fff; padding:0em; margin: 0; border-collapse:collapse; border-style:none; } .revhistory td { text-align :left; padding:0em; border: none; border-top: 1px solid #fff; font-weight: bold; } .revhistory .simplelist td { font-weight: normal; } .revhistory .simplelist { margin-bottom: 1.5em; margin-left: 1em; } .revhistory table th { display: none; } /*credits*/ .authorgroup div { clear:both; text-align: center; } h3.author { margin: 0em; padding: 0em; padding-top: 1em; } .authorgroup h4 { padding: 0em; margin: 0em; padding-top: 1em; margin-top: 1em; } .author, .editor, .translator, .othercredit, .contrib { display: block; } .revhistory .author { display: inline; } .othercredit h3 { padding-top: 1em; } .othercredit { margin:0em; padding:0em; } .releaseinfo { clear: both; } .copyright { margin-top: 1em; } /* qanda sets */ .answer { margin-bottom:1em; border-bottom:1px dotted #ccc; } .qandaset .toc { border-bottom:1px dotted #ccc; } .question { font-weight:bold; } .answer .data, .question .data { padding-left: 2.6em; } .answer label, .question label { float:left; font-weight:bold; } /*Lists*/ ul { padding-left:1.6em; list-style-type: circle; } ul ul { list-style-type: circle; } ol { list-style-image:none; list-style-type: decimal; } ol ol { list-style-type: lower-alpha; } ol.arabic { list-style-type: decimal; } ol.loweralpha { list-style-type: lower-alpha; } ol.lowerroman { list-style-type: lower-roman; } ol.upperalpha { list-style-type: upper-alpha; } ol.upperroman { list-style-type: upper-roman; } dt { font-weight:bold; margin-bottom:0em; padding-bottom:0em; } dd { margin:0em; margin-left:2em; padding-top:0em; padding-bottom: 1em; } li { padding-top:0px; margin-top:0em; padding-bottom:0px; margin-bottom:0.4em; } li p, li div.para { padding-top:0px; margin-top:0em; padding-bottom:0px; margin-bottom:0.3em; } /*images*/ img { display:block; margin: 2em 0; } .inlinemediaobject, .inlinemediaobject img { display:inline; margin:0em; } .figure img { display:block; margin:0; } .figure .title { margin:0em; margin-bottom:2em; padding:0px; } /*document modes*/ .confidential { background-color:#900; color:White; padding:.5em .5em; text-transform:uppercase; text-align:center; } .longdesc-link { display:none; } .longdesc { display:none; } .prompt { padding:0em .3em; } /*user interface styles*/ .screen .replaceable { } .guibutton, .guilabel { font-family: "liberation mono", "bitstream vera mono", "dejavu mono", monospace; font-weight: bold; white-space: nowrap; } .example { background-color: #ffffff; border-left: 3px solid #aaaaaa; padding-top: 1em; padding-bottom: 0.1em; } .example h6 { padding-left: 10px; } .example-contents { padding-left: 10px; background-color: #ffffff; } .example-contents .para { /* padding: 10px;*/ } /*terminal/console text*/ .computeroutput, .option { font-family:"liberation mono", "bitstream vera mono", "dejavu mono", monospace; font-weight:bold; } .replaceable { font-family:"liberation mono", "bitstream vera mono", "dejavu mono", monospace; font-style: italic; } .command, .filename, .keycap, .classname, .literal { font-family:"liberation mono", "bitstream vera mono", "dejavu mono", monospace; font-weight:bold; } /* no bold in toc */ .toc * { font-weight: inherit; } pre { font-family:"liberation mono", "bitstream vera mono", "dejavu mono", monospace; display:block; background-color: #f5f5f5; color: #000000; border: 1px solid #aaaaaa; margin-bottom: 0.3em; padding:.5em 1em; white-space: pre-wrap; /* css-3 */ white-space: -moz-pre-wrap !important; /* Mozilla, since 1999 */ white-space: -pre-wrap; /* Opera 4-6 */ white-space: -o-pre-wrap; /* Opera 7 */ word-wrap: break-word; /* Internet Explorer 5.5+ */ font-size: 0.9em; } pre .replaceable, pre .keycap { } code { font-family:"liberation mono", "bitstream vera mono", "dejavu mono", monospace; white-space: nowrap; font-weight:bold; } .parameter code { display: inline; white-space: pre-wrap; /* css-3 */ white-space: -moz-pre-wrap !important; /* Mozilla, since 1999 */ white-space: -pre-wrap; /* Opera 4-6 */ white-space: -o-pre-wrap; /* Opera 7 */ word-wrap: break-word; /* Internet Explorer 5.5+ */ } div.warning, div.note, div.important { color: black; margin: 0em; padding: 0em; background: none; background-color: white; margin-bottom: 1em; padding-left: 1em; border-left: 2px solid #aaaaaa; } div.warning h2, div.note h2,div.important h2 { margin: 0em; padding: 0em; color: #eeeeec; padding-top: 0px; padding-bottom: 0px; height: 1.4em; line-height: 1.4em; font-size: 1.4em; display:inline; } div.admonition_header { clear: both; margin: 0em; padding: 0em; margin-top: -3.3em; padding-left: 58px; line-height: 1.0em; font-size: 1.0em; } div.warning p, div.warning div.para, div.note p, div.note div.para, div.important p, div.important div.para { padding: 0em; margin: 0em; } div.admonition { border: none; border-left: 1px solid #aaaaaa; border-right: 1px solid #aaaaaa; padding:0em; margin:0em; padding-top: 1.5em; padding-bottom: 1em; padding-left: 2em; padding-right: 1em; background-color: #eeeeec; -moz-border-radius: 0px; -webkit-border-radius: 0px; border-radius: 0px; } /*Page Title*/ #title { display:block; height:45px; padding-bottom:1em; margin:0em; } #title a.left{ display:inline; border:none; } #title a.left img{ border:none; float:left; margin:0em; margin-top:.7em; } #title a.right { padding-bottom:1em; } #title a.right img { border:none; float:right; margin:0em; margin-top:.7em; } /*Table*/ table { border:1px solid #6c614b; width:100%; border-collapse:collapse; } table.simplelist, .calloutlist table { border-style: none; } table th { text-align:left; background-color:#6699cc; padding:.3em .5em; color:white; } table td { padding:.15em .5em; } table tr.even td { background-color:#f5f5f5; } table th p:first-child, table td p:first-child, table li p:first-child, table th div.para:first-child, table td div.para:first-child, table li div.para:first-child { margin-top:0em; padding-top:0em; display:inline; } th, td { border-style:none; vertical-align: top; border: 1px solid #000; } .simplelist th, .simplelist td { border: none; } table table td { border-bottom:1px dotted #aaa; background-color:white; padding:.6em 0em; } table table { border:1px solid white; } td.remarkval { color:#444; } td.fieldval { font-weight:bold; } .lbname, .lbtype, .lbdescr, .lbdriver, .lbhost { color:white; font-weight:bold; background-color:#999; width:120px; } td.remarkval { width:230px; } td.tname { font-weight:bold; } th.dbfield { width:120px; } th.dbtype { width:70px; } th.dbdefault { width:70px; } th.dbnul { width:70px; } th.dbkey { width:70px; } span.book { margin-top:4em; display:block; } span.chapter { display:block; margin-top:0.5em; } table.simplelist td, .calloutlist table td { border-style: none; } /*Breadcrumbs*/ #breadcrumbs ul li.first:before { content:" "; } #breadcrumbs { color:#900; padding:3px; margin-bottom:25px; } #breadcrumbs ul { margin-left:0; padding-left:0; display:inline; border:none; } #breadcrumbs ul li { margin-left:0; padding-left:2px; border:none; list-style:none; display:inline; } #breadcrumbs ul li:before { content:"\0020 \0020 \0020 \00BB \0020"; color:#333; } /*index*/ .glossary h3, .index h3 { font-size: 2em; color:#aaa; margin:0em; } .indexdiv { margin-bottom:1em; } .glossary dt, .index dt { color:#444; padding-top:.5em; } .glossary dl dl dt, .index dl dl dt { color:#777; font-weight:normal; padding-top:0em; } .index dl dl dt:before { content:"- "; color:#ccc; } /*changes*/ .footnote { font-size: .7em; margin:0em; color:#222; } table .footnote { } sup { color:#999; margin:0em; padding:0em; line-height: .4em; font-size: 1em; padding-left:0em; } .footnote { position:relative; } .footnote sup { color:#e3dcc0; position:absolute; left: .4em; } .footnote sup a:link, .footnote sup a:visited { color:#92917d; text-decoration:none; } .footnote:hover sup a { text-decoration:none; } .footnote p,.footnote div.para { padding-left:2em; } .footnote a:link, .footnote a:visited { color:#00537c; } .footnote a:hover { } /**/ div.chapter { margin-top:3em; } div.section { margin-top:1em; } div.note .replaceable, div.important .replaceable, div.warning .replaceable, div.note .keycap, div.important .keycap, div.warning .keycap { } ul li p:last-child, ul li div.para:last-child { margin-bottom:0em; padding-bottom:0em; } /* Dirty EVIL Mozilla hack for round corners */ pre { -moz-border-radius:11px; -webkit-border-radius:11px; border-radius: 11px; } .example { -moz-border-radius:0px; -webkit-border-radius:0px; border-radius: 0px; } .package, .citetitle { font-style: italic; } .titlepage .edition { color: #336699; background-color: transparent; margin-top: 1em; margin-bottom: 1em; font-size: 1.4em; font-weight: bold; text-align: center; } span.remark { background-color: #ff00ff; } .foreignphrase { font-style: inherit; } dt { clear:both; } dt img { border-style: none; max-width: 112px; } dt object { max-width: 112px; } dt .inlinemediaobject, dt object { display: inline; float: left; margin-bottom: 1em; padding-right: 1em; width: 112px; } dl:after { display: block; clear: both; content: ""; } .toc dd { padding-bottom: 0em; margin-bottom: 1em; padding-left: 1.3em; margin-left: 0em; } div.toc > dl > dt { padding-bottom: 0em; margin-bottom: 0em; margin-top: 1em; } .strikethrough { text-decoration: line-through; } .underline { text-decoration: underline; } .calloutlist img, .callout { padding: 0em; margin: 0em; width: 12pt; display: inline; vertical-align: middle; } .stepalternatives { list-style-image: none; list-style-type: none; } a:link { color:#0066cc; } a:hover, a:active { color:#003366; } a:visited { color:#6699cc; } h1 { color:#3c6eb4 } .section h1.title { color:#3c6eb4; } h2,h3,h4,h5,h6 { color:#3c6eb4; } table { border:1px solid #3c6eb4; } table th { background-color:#3c6eb4; } table tr.even td { background-color:#f5f5f5; } .revhistory table th { color:#3c6eb4; } .titlepage .edition { color: #3c6eb4; } </style><meta name="generator" content="DocBook XSL Stylesheets Vsnapshot" /></head><body><div xml:lang="en" class="book" lang="en"><div class="titlepage"><div><div><h1 class="title"><a id="id1337"></a>dracut</h1></div><div><div class="author"><h3 class="author"><span class="firstname">Harald</span> <span class="surname">Hoyer</span></h3><code class="email"><<a class="email" href="mailto:harald@redhat.com">harald@redhat.com</a>></code></div></div><div><div class="revhistory"><table style="border-style:solid; width:100%;" summary="Revision History"><tr><th align="left" valign="top" colspan="3"><strong>Revision History</strong></th></tr><tr><td align="left">Revision 3.0</td><td align="left">October 2013</td><td align="left">HH</td></tr></table></div></div></div><hr /></div><div class="toc"><p><strong>Table of Contents</strong></p><dl class="toc"><dt><span class="part"><a href="#_introduction">I. Introduction</a></span></dt><dd><dl><dt><span class="chapter"><a href="#_definition">1. Definition</a></span></dt><dt><span class="chapter"><a href="#_rationale">2. Rationale</a></span></dt><dt><span class="chapter"><a href="#_implementation">3. Implementation</a></span></dt><dt><span class="chapter"><a href="#_mount_preparations">4. Mount preparations</a></span></dt><dt><span class="chapter"><a href="#_dracut_on_shutdown">5. Dracut on shutdown</a></span></dt></dl></dd><dt><span class="part"><a href="#_user_manual">II. User Manual</a></span></dt><dd><dl><dt><span class="chapter"><a href="#_dracut_8">6. DRACUT(8)</a></span></dt><dd><dl><dt><span class="section"><a href="#_name">NAME</a></span></dt><dt><span class="section"><a href="#_synopsis">SYNOPSIS</a></span></dt><dt><span class="section"><a href="#_description">DESCRIPTION</a></span></dt><dt><span class="section"><a href="#_usage">USAGE</a></span></dt><dd><dl><dt><span class="section"><a href="#_inspecting_the_contents">Inspecting the Contents</a></span></dt><dt><span class="section"><a href="#_adding_dracut_modules">Adding dracut Modules</a></span></dt><dt><span class="section"><a href="#_omitting_dracut_modules">Omitting dracut Modules</a></span></dt><dt><span class="section"><a href="#_adding_kernel_modules">Adding Kernel Modules</a></span></dt><dt><span class="section"><a href="#_boot_parameters">Boot parameters</a></span></dt><dt><span class="section"><a href="#Injecting">Injecting custom Files</a></span></dt><dt><span class="section"><a href="#NetworkBoot">Network Boot</a></span></dt></dl></dd><dt><span class="section"><a href="#_troubleshooting">Troubleshooting</a></span></dt><dd><dl><dt><span class="section"><a href="#identifying-your-problem-area">Identifying your problem area</a></span></dt><dt><span class="section"><a href="#information-to-include-in-your-report">Information to include in your report</a></span></dt><dt><span class="section"><a href="#debugging-dracut">Debugging dracut</a></span></dt></dl></dd><dt><span class="section"><a href="#_options">OPTIONS</a></span></dt><dt><span class="section"><a href="#_environment">ENVIRONMENT</a></span></dt><dt><span class="section"><a href="#_files">FILES</a></span></dt><dd><dl><dt><span class="section"><a href="#_configuration_in_the_initramfs">Configuration in the initramfs</a></span></dt></dl></dd><dt><span class="section"><a href="#_availability">AVAILABILITY</a></span></dt><dt><span class="section"><a href="#_authors">AUTHORS</a></span></dt><dt><span class="section"><a href="#_see_also">SEE ALSO</a></span></dt></dl></dd><dt><span class="chapter"><a href="#dracutconf5">7. DRACUT.CONF(5)</a></span></dt><dd><dl><dt><span class="section"><a href="#_name_2">NAME</a></span></dt><dt><span class="section"><a href="#_synopsis_2">SYNOPSIS</a></span></dt><dt><span class="section"><a href="#_description_2">Description</a></span></dt><dt><span class="section"><a href="#_files_2">Files</a></span></dt><dt><span class="section"><a href="#_author">AUTHOR</a></span></dt><dt><span class="section"><a href="#_see_also_2">See Also</a></span></dt></dl></dd><dt><span class="chapter"><a href="#dracutcmdline7">8. DRACUT.CMDLINE(7)</a></span></dt><dd><dl><dt><span class="section"><a href="#_name_3">NAME</a></span></dt><dt><span class="section"><a href="#_description_3">DESCRIPTION</a></span></dt><dd><dl><dt><span class="section"><a href="#_standard">Standard</a></span></dt><dt><span class="section"><a href="#_iso_scan_filename">iso-scan/filename</a></span></dt><dt><span class="section"><a href="#_misc">Misc</a></span></dt><dt><span class="section"><a href="#dracutkerneldebug">Debug</a></span></dt><dt><span class="section"><a href="#_i18n">I18N</a></span></dt><dt><span class="section"><a href="#_lvm">LVM</a></span></dt><dt><span class="section"><a href="#_crypto_luks">crypto LUKS</a></span></dt><dt><span class="section"><a href="#_crypto_luks_key_on_removable_device_support">crypto LUKS - key on removable device support</a></span></dt><dt><span class="section"><a href="#_md_raid">MD RAID</a></span></dt><dt><span class="section"><a href="#_dm_raid">DM RAID</a></span></dt><dt><span class="section"><a href="#_multipath">MULTIPATH</a></span></dt><dt><span class="section"><a href="#_fips">FIPS</a></span></dt><dt><span class="section"><a href="#_network">Network</a></span></dt><dt><span class="section"><a href="#_nfs">NFS</a></span></dt><dt><span class="section"><a href="#_cifs">CIFS</a></span></dt><dt><span class="section"><a href="#_iscsi">iSCSI</a></span></dt><dt><span class="section"><a href="#_fcoe">FCoE</a></span></dt><dt><span class="section"><a href="#_nbd">NBD</a></span></dt><dt><span class="section"><a href="#_dasd">DASD</a></span></dt><dt><span class="section"><a href="#_zfcp">ZFCP</a></span></dt><dt><span class="section"><a href="#_znet">ZNET</a></span></dt><dt><span class="section"><a href="#_booting_live_images">Booting live images</a></span></dt><dt><span class="section"><a href="#_zipl">ZIPL</a></span></dt><dt><span class="section"><a href="#_cio_ignore">CIO_IGNORE</a></span></dt><dt><span class="section"><a href="#_plymouth_boot_splash">Plymouth Boot Splash</a></span></dt><dt><span class="section"><a href="#_kernel_keys">Kernel keys</a></span></dt><dt><span class="section"><a href="#_deprecated_renamed_options">Deprecated, renamed Options</a></span></dt><dt><span class="section"><a href="#_configuration_in_the_initramfs_2">Configuration in the Initramfs</a></span></dt></dl></dd><dt><span class="section"><a href="#_author_2">AUTHOR</a></span></dt><dt><span class="section"><a href="#_see_also_3">SEE ALSO</a></span></dt></dl></dd><dt><span class="chapter"><a href="#lsinitrd1">9. LSINITRD(1)</a></span></dt><dd><dl><dt><span class="section"><a href="#_name_4">NAME</a></span></dt><dt><span class="section"><a href="#_synopsis_3">SYNOPSIS</a></span></dt><dt><span class="section"><a href="#_description_4">DESCRIPTION</a></span></dt><dt><span class="section"><a href="#_options_2">OPTIONS</a></span></dt><dt><span class="section"><a href="#_availability_2">AVAILABILITY</a></span></dt><dt><span class="section"><a href="#_authors_2">AUTHORS</a></span></dt><dt><span class="section"><a href="#_see_also_4">SEE ALSO</a></span></dt></dl></dd><dt><span class="chapter"><a href="#mkinitrd8">10. MKINITRD(8)</a></span></dt><dd><dl><dt><span class="section"><a href="#_name_5">NAME</a></span></dt><dt><span class="section"><a href="#_synopsis_4">SYNOPSIS</a></span></dt><dt><span class="section"><a href="#_description_5">DESCRIPTION</a></span></dt><dt><span class="section"><a href="#_options_3">OPTIONS</a></span></dt><dt><span class="section"><a href="#_availability_3">AVAILABILITY</a></span></dt><dt><span class="section"><a href="#_authors_3">AUTHORS</a></span></dt><dt><span class="section"><a href="#_see_also_5">SEE ALSO</a></span></dt></dl></dd><dt><span class="chapter"><a href="#_developer_manual">11. Developer Manual</a></span></dt><dt><span class="chapter"><a href="#dracutmodules7">12. DRACUT.MODULES(7)</a></span></dt><dd><dl><dt><span class="section"><a href="#_name_6">NAME</a></span></dt><dt><span class="section"><a href="#_description_6">DESCRIPTION</a></span></dt><dt><span class="section"><a href="#stages">Boot Process Stages</a></span></dt><dd><dl><dt><span class="section"><a href="#_hook_cmdline">Hook: cmdline</a></span></dt><dt><span class="section"><a href="#_hook_pre_udev">Hook: pre-udev</a></span></dt><dt><span class="section"><a href="#_start_udev">Start Udev</a></span></dt><dt><span class="section"><a href="#_hook_pre_trigger">Hook: pre-trigger</a></span></dt><dt><span class="section"><a href="#_trigger_udev">Trigger Udev</a></span></dt><dt><span class="section"><a href="#_main_loop">Main Loop</a></span></dt><dt><span class="section"><a href="#_hook_pre_mount">Hook: pre-mount</a></span></dt><dt><span class="section"><a href="#_hook_mount">Hook: mount</a></span></dt><dt><span class="section"><a href="#_hook_pre_pivot">Hook: pre-pivot</a></span></dt><dt><span class="section"><a href="#_hook_cleanup">Hook: cleanup</a></span></dt><dt><span class="section"><a href="#_cleanup_and_switch_root">Cleanup and switch_root</a></span></dt></dl></dd><dt><span class="section"><a href="#_network_infrastructure">Network Infrastructure</a></span></dt><dt><span class="section"><a href="#_writing_a_module">Writing a Module</a></span></dt><dd><dl><dt><span class="section"><a href="#_module_setup_sh_check">module-setup.sh: check()</a></span></dt><dt><span class="section"><a href="#_module_setup_sh_depends">module-setup.sh: depends()</a></span></dt><dt><span class="section"><a href="#_module_setup_sh_cmdline">module-setup.sh: cmdline()</a></span></dt><dt><span class="section"><a href="#_module_setup_sh_install">module-setup.sh: install()</a></span></dt><dt><span class="section"><a href="#_module_setup_sh_installkernel">module-setup.sh: installkernel()</a></span></dt><dt><span class="section"><a href="#_anchor_id_creation_xreflabel_creation_creation_functions">Creation Functions</a></span></dt><dt><span class="section"><a href="#_initramfs_functions">Initramfs Functions</a></span></dt><dt><span class="section"><a href="#_network_modules">Network Modules</a></span></dt></dl></dd><dt><span class="section"><a href="#_author_3">AUTHOR</a></span></dt><dt><span class="section"><a href="#_see_also_6">SEE ALSO</a></span></dt></dl></dd><dt><span class="chapter"><a href="#dracutbootup7">13. DRACUT.BOOTUP(7)</a></span></dt><dd><dl><dt><span class="section"><a href="#_name_7">NAME</a></span></dt><dt><span class="section"><a href="#_description_7">DESCRIPTION</a></span></dt><dt><span class="section"><a href="#_author_4">AUTHOR</a></span></dt><dt><span class="section"><a href="#_see_also_7">SEE ALSO</a></span></dt></dl></dd><dt><span class="appendix"><a href="#_license">A. License</a></span></dt></dl></dd></dl></div><div class="part"><div class="titlepage"><div><div><h1 class="title"><a id="_introduction"></a>Part I. Introduction</h1></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl class="toc"><dt><span class="chapter"><a href="#_definition">1. Definition</a></span></dt><dt><span class="chapter"><a href="#_rationale">2. Rationale</a></span></dt><dt><span class="chapter"><a href="#_implementation">3. Implementation</a></span></dt><dt><span class="chapter"><a href="#_mount_preparations">4. Mount preparations</a></span></dt><dt><span class="chapter"><a href="#_dracut_on_shutdown">5. Dracut on shutdown</a></span></dt></dl></div><p>This section is a modified version of <a class="ulink" href="http://en.wikipedia.org/wiki/Initrd" target="_top">http://en.wikipedia.org/wiki/Initrd</a> which is licensed under the Creative Commons Attribution/Share-Alike License.</p><div class="chapter"><div class="titlepage"><div><div><h2 class="title"><a id="_definition"></a>Chapter 1. Definition</h2></div></div></div><p>An <span class="emphasis"><em>initial ramdisk</em></span> is a temporary file system used in the boot process of the Linux kernel. <span class="emphasis"><em>initrd</em></span> and <span class="emphasis"><em>initramfs</em></span> refer to slightly different schemes for loading this file system into memory. Both are commonly used to make preparations before the real root file system can be mounted.</p></div><div class="chapter"><div class="titlepage"><div><div><h2 class="title"><a id="_rationale"></a>Chapter 2. Rationale</h2></div></div></div><p>Many Linux distributions ship a single, generic kernel image that is intended to boot as wide a variety of hardware as possible. The device drivers for this generic kernel image are included as loadable modules, as it is not possible to statically compile them all into the one kernel without making it too large to boot from computers with limited memory or from lower-capacity media like floppy disks.</p><p>This then raises the problem of detecting and loading the modules necessary to mount the root file system at boot time (or, for that matter, deducing where or what the root file system is).</p><p>To further complicate matters, the root file system may be on a software RAID volume, LVM, NFS (on diskless workstations), or on an encrypted partition. All of these require special preparations to mount.</p><p>Another complication is kernel support for hibernation, which suspends the computer to disk by dumping an image of the entire system to a swap partition or a regular file, then powering off. On next boot, this image has to be made accessible before it can be loaded back into memory.</p><p>To avoid having to hardcode handling for so many special cases into the kernel, an initial boot stage with a temporary root file system —now dubbed early user space— is used. This root file system would contain user-space helpers that would do the hardware detection, module loading and device discovery necessary to get the real root file system mounted.</p></div><div class="chapter"><div class="titlepage"><div><div><h2 class="title"><a id="_implementation"></a>Chapter 3. Implementation</h2></div></div></div><p>An image of this initial root file system (along with the kernel image) must be stored somewhere accessible by the Linux bootloader or the boot firmware of the computer. This can be:</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"> The root file system itself </li><li class="listitem"> A boot image on an optical disc </li><li class="listitem"> A small ext2/ext3 or FAT-formatted partition on a local disk (a <span class="emphasis"><em>boot partition</em></span>) </li><li class="listitem"> A TFTP server (on systems that can boot from Ethernet) </li></ul></div><p>The bootloader will load the kernel and initial root file system image into memory and then start the kernel, passing in the memory address of the image.</p><p>Depending on which algorithms were compiled statically into it, the kernel can currently unpack initrd/initramfs images compressed with gzip, bzip2 and LZMA.</p></div><div class="chapter"><div class="titlepage"><div><div><h2 class="title"><a id="_mount_preparations"></a>Chapter 4. Mount preparations</h2></div></div></div><p>dracut can generate a customized initrams image which contains only whatever is necessary to boot some particular computer, such as ATA, SCSI and filesystem kernel modules (host-only mode).</p><p>dracut can also generate a more generic initramfs image (default mode).</p><p>dracut’s initramfs starts only with the device name of the root file system (or its UUID) and must discover everything else at boot time. A complex cascade of tasks must be performed to get the root file system mounted:</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"> Any hardware drivers that the boot process depends on must be loaded. All kernel modules for common storage devices are packed onto the initramfs and then udev pulls in modules matching the computer’s detected hardware. </li><li class="listitem"> On systems which display a boot rd.splash screen, the video hardware must be initialized and a user-space helper started to paint animations onto the display in lockstep with the boot process. </li><li class="listitem"><p class="simpara"> If the root file system is on NFS, dracut does then: </p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: circle; "><li class="listitem"> Bring up the primary network interface. </li><li class="listitem"> Invoke a DHCP client, with which it can obtain a DHCP lease. </li><li class="listitem"> Extract the name of the NFS share and the address of the NFS server from the lease. </li><li class="listitem"> Mount the NFS share. </li></ul></div></li><li class="listitem"> If the root file system appears to be on a software RAID device, there is no way of knowing which devices the RAID volume spans; the standard MD utilities must be invoked to scan all available block devices with a raid signature and bring the required ones online. </li><li class="listitem"> If the root file system appears to be on a logical volume, the LVM utilities must be invoked to scan for and activate the volume group containing it. </li><li class="listitem"><p class="simpara"> If the root file system is on an encrypted block device: </p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: circle; "><li class="listitem"> Invoke a helper script to prompt the user to type in a passphrase and/or insert a hardware token (such as a smart card or a USB security dongle). </li></ul></div></li><li class="listitem"> Create a decryption target with the device mapper. </li></ul></div><p>dracut uses udev, an event-driven hotplug agent, which invokes helper programs as hardware devices, disk partitions and storage volumes matching certain rules come online. This allows discovery to run in parallel, and to progressively cascade into arbitrary nestings of LVM, RAID or encryption to get at the root file system.</p><p>When the root file system finally becomes visible:</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"> Any maintenance tasks which cannot run on a mounted root file system are done. </li><li class="listitem"> The root file system is mounted read-only. </li><li class="listitem"> Any processes which must continue running (such as the rd.splash screen helper and its command FIFO) are hoisted into the newly-mounted root file system. </li></ul></div><p>The final root file system cannot simply be mounted over /, since that would make the scripts and tools on the initial root file system inaccessible for any final cleanup tasks. On an initramfs, the initial root file system cannot be rotated away. Instead, it is simply emptied and the final root file system mounted over the top.</p><p>If the systemd module is used in the initramfs, the ordering of the services started looks like <a class="xref" href="#dracutbootup7" title="Chapter 13. DRACUT.BOOTUP(7)">Chapter 13, <em>DRACUT.BOOTUP(7)</em></a>.</p></div><div class="chapter"><div class="titlepage"><div><div><h2 class="title"><a id="_dracut_on_shutdown"></a>Chapter 5. Dracut on shutdown</h2></div></div></div><p>On a systemd driven system, the dracut initramfs is also used for the shutdown procedure.</p><p>The following steps are executed during a shutdown:</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"> systemd switches to the shutdown.target </li><li class="listitem"> systemd starts $prefix/lib/systemd/system/shutdown.target.wants/dracut-shutdown.service </li><li class="listitem"> dracut-shutdown.service executes /usr/lib/dracut/dracut-initramfs-restore which unpacks the initramfs to /run/initramfs </li><li class="listitem"> systemd finishes shutdown.target </li><li class="listitem"> systemd kills all processes </li><li class="listitem"> systemd tries to unmount everything and mounts the remaining read-only </li><li class="listitem"> systemd checks, if there is a /run/initramfs/shutdown executable </li><li class="listitem"> if yes, it does a pivot_root to /run/initramfs and executes ./shutdown. The old root is then mounted on /oldroot. /usr/lib/dracut/modules.d/99shutdown/shutdown.sh is the shutdown executable. </li><li class="listitem"> shutdown will try to umount every /oldroot mount and calls the various shutdown hooks from the dracut modules </li></ul></div><p>This ensures, that all devices are disassembled and unmounted cleanly.</p></div></div><div class="part"><div class="titlepage"><div><div><h1 class="title"><a id="_user_manual"></a>Part II. User Manual</h1></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl class="toc"><dt><span class="chapter"><a href="#_dracut_8">6. DRACUT(8)</a></span></dt><dd><dl><dt><span class="section"><a href="#_name">NAME</a></span></dt><dt><span class="section"><a href="#_synopsis">SYNOPSIS</a></span></dt><dt><span class="section"><a href="#_description">DESCRIPTION</a></span></dt><dt><span class="section"><a href="#_usage">USAGE</a></span></dt><dd><dl><dt><span class="section"><a href="#_inspecting_the_contents">Inspecting the Contents</a></span></dt><dt><span class="section"><a href="#_adding_dracut_modules">Adding dracut Modules</a></span></dt><dt><span class="section"><a href="#_omitting_dracut_modules">Omitting dracut Modules</a></span></dt><dt><span class="section"><a href="#_adding_kernel_modules">Adding Kernel Modules</a></span></dt><dt><span class="section"><a href="#_boot_parameters">Boot parameters</a></span></dt><dt><span class="section"><a href="#Injecting">Injecting custom Files</a></span></dt><dt><span class="section"><a href="#NetworkBoot">Network Boot</a></span></dt></dl></dd><dt><span class="section"><a href="#_troubleshooting">Troubleshooting</a></span></dt><dd><dl><dt><span class="section"><a href="#identifying-your-problem-area">Identifying your problem area</a></span></dt><dt><span class="section"><a href="#information-to-include-in-your-report">Information to include in your report</a></span></dt><dt><span class="section"><a href="#debugging-dracut">Debugging dracut</a></span></dt></dl></dd><dt><span class="section"><a href="#_options">OPTIONS</a></span></dt><dt><span class="section"><a href="#_environment">ENVIRONMENT</a></span></dt><dt><span class="section"><a href="#_files">FILES</a></span></dt><dd><dl><dt><span class="section"><a href="#_configuration_in_the_initramfs">Configuration in the initramfs</a></span></dt></dl></dd><dt><span class="section"><a href="#_availability">AVAILABILITY</a></span></dt><dt><span class="section"><a href="#_authors">AUTHORS</a></span></dt><dt><span class="section"><a href="#_see_also">SEE ALSO</a></span></dt></dl></dd><dt><span class="chapter"><a href="#dracutconf5">7. DRACUT.CONF(5)</a></span></dt><dd><dl><dt><span class="section"><a href="#_name_2">NAME</a></span></dt><dt><span class="section"><a href="#_synopsis_2">SYNOPSIS</a></span></dt><dt><span class="section"><a href="#_description_2">Description</a></span></dt><dt><span class="section"><a href="#_files_2">Files</a></span></dt><dt><span class="section"><a href="#_author">AUTHOR</a></span></dt><dt><span class="section"><a href="#_see_also_2">See Also</a></span></dt></dl></dd><dt><span class="chapter"><a href="#dracutcmdline7">8. DRACUT.CMDLINE(7)</a></span></dt><dd><dl><dt><span class="section"><a href="#_name_3">NAME</a></span></dt><dt><span class="section"><a href="#_description_3">DESCRIPTION</a></span></dt><dd><dl><dt><span class="section"><a href="#_standard">Standard</a></span></dt><dt><span class="section"><a href="#_iso_scan_filename">iso-scan/filename</a></span></dt><dt><span class="section"><a href="#_misc">Misc</a></span></dt><dt><span class="section"><a href="#dracutkerneldebug">Debug</a></span></dt><dt><span class="section"><a href="#_i18n">I18N</a></span></dt><dt><span class="section"><a href="#_lvm">LVM</a></span></dt><dt><span class="section"><a href="#_crypto_luks">crypto LUKS</a></span></dt><dt><span class="section"><a href="#_crypto_luks_key_on_removable_device_support">crypto LUKS - key on removable device support</a></span></dt><dt><span class="section"><a href="#_md_raid">MD RAID</a></span></dt><dt><span class="section"><a href="#_dm_raid">DM RAID</a></span></dt><dt><span class="section"><a href="#_multipath">MULTIPATH</a></span></dt><dt><span class="section"><a href="#_fips">FIPS</a></span></dt><dt><span class="section"><a href="#_network">Network</a></span></dt><dt><span class="section"><a href="#_nfs">NFS</a></span></dt><dt><span class="section"><a href="#_cifs">CIFS</a></span></dt><dt><span class="section"><a href="#_iscsi">iSCSI</a></span></dt><dt><span class="section"><a href="#_fcoe">FCoE</a></span></dt><dt><span class="section"><a href="#_nbd">NBD</a></span></dt><dt><span class="section"><a href="#_dasd">DASD</a></span></dt><dt><span class="section"><a href="#_zfcp">ZFCP</a></span></dt><dt><span class="section"><a href="#_znet">ZNET</a></span></dt><dt><span class="section"><a href="#_booting_live_images">Booting live images</a></span></dt><dt><span class="section"><a href="#_zipl">ZIPL</a></span></dt><dt><span class="section"><a href="#_cio_ignore">CIO_IGNORE</a></span></dt><dt><span class="section"><a href="#_plymouth_boot_splash">Plymouth Boot Splash</a></span></dt><dt><span class="section"><a href="#_kernel_keys">Kernel keys</a></span></dt><dt><span class="section"><a href="#_deprecated_renamed_options">Deprecated, renamed Options</a></span></dt><dt><span class="section"><a href="#_configuration_in_the_initramfs_2">Configuration in the Initramfs</a></span></dt></dl></dd><dt><span class="section"><a href="#_author_2">AUTHOR</a></span></dt><dt><span class="section"><a href="#_see_also_3">SEE ALSO</a></span></dt></dl></dd><dt><span class="chapter"><a href="#lsinitrd1">9. LSINITRD(1)</a></span></dt><dd><dl><dt><span class="section"><a href="#_name_4">NAME</a></span></dt><dt><span class="section"><a href="#_synopsis_3">SYNOPSIS</a></span></dt><dt><span class="section"><a href="#_description_4">DESCRIPTION</a></span></dt><dt><span class="section"><a href="#_options_2">OPTIONS</a></span></dt><dt><span class="section"><a href="#_availability_2">AVAILABILITY</a></span></dt><dt><span class="section"><a href="#_authors_2">AUTHORS</a></span></dt><dt><span class="section"><a href="#_see_also_4">SEE ALSO</a></span></dt></dl></dd><dt><span class="chapter"><a href="#mkinitrd8">10. MKINITRD(8)</a></span></dt><dd><dl><dt><span class="section"><a href="#_name_5">NAME</a></span></dt><dt><span class="section"><a href="#_synopsis_4">SYNOPSIS</a></span></dt><dt><span class="section"><a href="#_description_5">DESCRIPTION</a></span></dt><dt><span class="section"><a href="#_options_3">OPTIONS</a></span></dt><dt><span class="section"><a href="#_availability_3">AVAILABILITY</a></span></dt><dt><span class="section"><a href="#_authors_3">AUTHORS</a></span></dt><dt><span class="section"><a href="#_see_also_5">SEE ALSO</a></span></dt></dl></dd><dt><span class="chapter"><a href="#_developer_manual">11. Developer Manual</a></span></dt><dt><span class="chapter"><a href="#dracutmodules7">12. DRACUT.MODULES(7)</a></span></dt><dd><dl><dt><span class="section"><a href="#_name_6">NAME</a></span></dt><dt><span class="section"><a href="#_description_6">DESCRIPTION</a></span></dt><dt><span class="section"><a href="#stages">Boot Process Stages</a></span></dt><dd><dl><dt><span class="section"><a href="#_hook_cmdline">Hook: cmdline</a></span></dt><dt><span class="section"><a href="#_hook_pre_udev">Hook: pre-udev</a></span></dt><dt><span class="section"><a href="#_start_udev">Start Udev</a></span></dt><dt><span class="section"><a href="#_hook_pre_trigger">Hook: pre-trigger</a></span></dt><dt><span class="section"><a href="#_trigger_udev">Trigger Udev</a></span></dt><dt><span class="section"><a href="#_main_loop">Main Loop</a></span></dt><dt><span class="section"><a href="#_hook_pre_mount">Hook: pre-mount</a></span></dt><dt><span class="section"><a href="#_hook_mount">Hook: mount</a></span></dt><dt><span class="section"><a href="#_hook_pre_pivot">Hook: pre-pivot</a></span></dt><dt><span class="section"><a href="#_hook_cleanup">Hook: cleanup</a></span></dt><dt><span class="section"><a href="#_cleanup_and_switch_root">Cleanup and switch_root</a></span></dt></dl></dd><dt><span class="section"><a href="#_network_infrastructure">Network Infrastructure</a></span></dt><dt><span class="section"><a href="#_writing_a_module">Writing a Module</a></span></dt><dd><dl><dt><span class="section"><a href="#_module_setup_sh_check">module-setup.sh: check()</a></span></dt><dt><span class="section"><a href="#_module_setup_sh_depends">module-setup.sh: depends()</a></span></dt><dt><span class="section"><a href="#_module_setup_sh_cmdline">module-setup.sh: cmdline()</a></span></dt><dt><span class="section"><a href="#_module_setup_sh_install">module-setup.sh: install()</a></span></dt><dt><span class="section"><a href="#_module_setup_sh_installkernel">module-setup.sh: installkernel()</a></span></dt><dt><span class="section"><a href="#_anchor_id_creation_xreflabel_creation_creation_functions">Creation Functions</a></span></dt><dt><span class="section"><a href="#_initramfs_functions">Initramfs Functions</a></span></dt><dt><span class="section"><a href="#_network_modules">Network Modules</a></span></dt></dl></dd><dt><span class="section"><a href="#_author_3">AUTHOR</a></span></dt><dt><span class="section"><a href="#_see_also_6">SEE ALSO</a></span></dt></dl></dd><dt><span class="chapter"><a href="#dracutbootup7">13. DRACUT.BOOTUP(7)</a></span></dt><dd><dl><dt><span class="section"><a href="#_name_7">NAME</a></span></dt><dt><span class="section"><a href="#_description_7">DESCRIPTION</a></span></dt><dt><span class="section"><a href="#_author_4">AUTHOR</a></span></dt><dt><span class="section"><a href="#_see_also_7">SEE ALSO</a></span></dt></dl></dd><dt><span class="appendix"><a href="#_license">A. License</a></span></dt></dl></div><div class="chapter"><div class="titlepage"><div><div><h2 class="title"><a id="_dracut_8"></a>Chapter 6. DRACUT(8)</h2></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl class="toc"><dt><span class="section"><a href="#_name">NAME</a></span></dt><dt><span class="section"><a href="#_synopsis">SYNOPSIS</a></span></dt><dt><span class="section"><a href="#_description">DESCRIPTION</a></span></dt><dt><span class="section"><a href="#_usage">USAGE</a></span></dt><dd><dl><dt><span class="section"><a href="#_inspecting_the_contents">Inspecting the Contents</a></span></dt><dt><span class="section"><a href="#_adding_dracut_modules">Adding dracut Modules</a></span></dt><dt><span class="section"><a href="#_omitting_dracut_modules">Omitting dracut Modules</a></span></dt><dt><span class="section"><a href="#_adding_kernel_modules">Adding Kernel Modules</a></span></dt><dt><span class="section"><a href="#_boot_parameters">Boot parameters</a></span></dt><dt><span class="section"><a href="#Injecting">Injecting custom Files</a></span></dt><dt><span class="section"><a href="#NetworkBoot">Network Boot</a></span></dt></dl></dd><dt><span class="section"><a href="#_troubleshooting">Troubleshooting</a></span></dt><dd><dl><dt><span class="section"><a href="#identifying-your-problem-area">Identifying your problem area</a></span></dt><dt><span class="section"><a href="#information-to-include-in-your-report">Information to include in your report</a></span></dt><dt><span class="section"><a href="#debugging-dracut">Debugging dracut</a></span></dt></dl></dd><dt><span class="section"><a href="#_options">OPTIONS</a></span></dt><dt><span class="section"><a href="#_environment">ENVIRONMENT</a></span></dt><dt><span class="section"><a href="#_files">FILES</a></span></dt><dd><dl><dt><span class="section"><a href="#_configuration_in_the_initramfs">Configuration in the initramfs</a></span></dt></dl></dd><dt><span class="section"><a href="#_availability">AVAILABILITY</a></span></dt><dt><span class="section"><a href="#_authors">AUTHORS</a></span></dt><dt><span class="section"><a href="#_see_also">SEE ALSO</a></span></dt></dl></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="_name"></a>NAME</h2></div></div></div><p>dracut - low-level tool for generating an initramfs/initrd image</p></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="_synopsis"></a>SYNOPSIS</h2></div></div></div><p><span class="strong"><strong>dracut</strong></span> [<span class="emphasis"><em>OPTION…</em></span>] [<span class="emphasis"><em><image></em></span> [<span class="emphasis"><em><kernel version></em></span>]]</p></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="_description"></a>DESCRIPTION</h2></div></div></div><p>Create an initramfs <image> for the kernel with the version <kernel version>. If <kernel version> is omitted, then the version of the actual running kernel is used. If <image> is omitted or empty, then the default location /boot/initramfs-<kernel version>.img is used.</p><p>dracut creates an initial image used by the kernel for preloading the block device modules (such as IDE, SCSI or RAID) which are needed to access the root filesystem, mounting the root filesystem and booting into the real system.</p><p>At boot time, the kernel unpacks that archive into RAM disk, mounts and uses it as initial root file system. All finding of the root device happens in this early userspace.</p><p>Initramfs images are also called "initrd".</p><p>For a complete list of kernel command line options see <span class="strong"><strong>dracut.cmdline</strong></span>(7).</p><p>If you are dropped to an emergency shell, while booting your initramfs, the file <span class="emphasis"><em>/run/initramfs/rdsosreport.txt</em></span> is created, which can be saved to a (to be mounted by hand) partition (usually /boot) or a USB stick. Additional debugging info can be produced by adding <span class="strong"><strong>rd.debug</strong></span> to the kernel command line. <span class="emphasis"><em>/run/initramfs/rdsosreport.txt</em></span> contains all logs and the output of some tools. It should be attached to any report about dracut problems.</p></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="_usage"></a>USAGE</h2></div></div></div><p>To create a initramfs image, the most simple command is:</p><pre class="screen"># dracut</pre><p>This will generate a general purpose initramfs image, with all possible functionality resulting of the combination of the installed dracut modules and system tools. The image is /boot/initramfs-<span class="emphasis"><em><code class="literal"><kernel version></code></em></span>.img and contains the kernel modules of the currently active kernel with version <span class="emphasis"><em><code class="literal"><kernel version></code></em></span>.</p><p>If the initramfs image already exists, dracut will display an error message, and to overwrite the existing image, you have to use the --force option.</p><pre class="screen"># dracut --force</pre><p>If you want to specify another filename for the resulting image you would issue a command like:</p><pre class="screen"># dracut foobar.img</pre><p>To generate an image for a specific kernel version, the command would be:</p><pre class="screen"># dracut foobar.img 2.6.40-1.rc5.f20</pre><p>A shortcut to generate the image at the default location for a specific kernel version is:</p><pre class="screen"># dracut --kver 2.6.40-1.rc5.f20</pre><p>If you want to create lighter, smaller initramfs images, you may want to specify the --hostonly or -H option. Using this option, the resulting image will contain only those dracut modules, kernel modules and filesystems, which are needed to boot this specific machine. This has the drawback, that you can’t put the disk on another controller or machine, and that you can’t switch to another root filesystem, without recreating the initramfs image. The usage of the --hostonly option is only for experts and you will have to keep the broken pieces. At least keep a copy of a general purpose image (and corresponding kernel) as a fallback to rescue your system.</p><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="_inspecting_the_contents"></a>Inspecting the Contents</h3></div></div></div><p>To see the contents of the image created by dracut, you can use the lsinitrd tool.</p><pre class="screen"># lsinitrd | less</pre><p>To display the contents of a file in the initramfs also use the lsinitrd tool:</p><pre class="screen"># lsinitrd -f /etc/ld.so.conf include ld.so.conf.d/*.conf</pre></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="_adding_dracut_modules"></a>Adding dracut Modules</h3></div></div></div><p>Some dracut modules are turned off by default and have to be activated manually. You can do this by adding the dracut modules to the configuration file <span class="emphasis"><em>/etc/dracut.conf</em></span> or <span class="emphasis"><em>/etc/dracut.conf.d/myconf.conf</em></span>. See <span class="strong"><strong>dracut.conf</strong></span>(5). You can also add dracut modules on the command line by using the -a or --add option:</p><pre class="screen"># dracut --add bootchart initramfs-bootchart.img</pre><p>To see a list of available dracut modules, use the --list-modules option:</p><pre class="screen"># dracut --list-modules</pre></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="_omitting_dracut_modules"></a>Omitting dracut Modules</h3></div></div></div><p>Sometimes you don’t want a dracut module to be included for reasons of speed, size or functionality. To do this, either specify the omit_dracutmodules variable in the <span class="emphasis"><em>dracut.conf</em></span> or <span class="emphasis"><em>/etc/dracut.conf.d/myconf.conf</em></span> configuration file (see <span class="strong"><strong>dracut.conf</strong></span>(5)), or use the -o or --omit option on the command line:</p><pre class="screen"># dracut -o "multipath lvm" no-multipath-lvm.img</pre></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="_adding_kernel_modules"></a>Adding Kernel Modules</h3></div></div></div><p>If you need a special kernel module in the initramfs, which is not automatically picked up by dracut, you have the use the --add-drivers option on the command line or the drivers variable in the <span class="emphasis"><em>/etc/dracut.conf</em></span> or <span class="emphasis"><em>/etc/dracut.conf.d/myconf.conf</em></span> configuration file (see <span class="strong"><strong>dracut.conf</strong></span>(5)):</p><pre class="screen"># dracut --add-drivers mymod initramfs-with-mymod.img</pre></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="_boot_parameters"></a>Boot parameters</h3></div></div></div><p>An initramfs generated without the "hostonly" mode, does not contain any system configuration files (except for some special exceptions), so the configuration has to be done on the kernel command line. With this flexibility, you can easily boot from a changed root partition, without the need to recompile the initramfs image. So, you could completely change your root partition (move it inside a md raid with encryption and LVM on top), as long as you specify the correct filesystem LABEL or UUID on the kernel command line for your root device, dracut will find it and boot from it.</p><p>The kernel command line can also be provided by the dhcp server with the root-path option. See <a class="xref" href="#NetworkBoot" title="Network Boot">the section called “Network Boot”</a>.</p><p>For a full reference of all kernel command line parameters, see <span class="strong"><strong>dracut.cmdline</strong></span>(5).</p><p>To get a quick start for the suitable kernel command line on your system, use the <span class="emphasis"><em>--print-cmdline</em></span> option:</p><pre class="screen"># dracut --print-cmdline root=UUID=8b8b6f91-95c7-4da2-831b-171e12179081 rootflags=rw,relatime,discard,data=ordered rootfstype=ext4</pre><div class="section"><div class="titlepage"><div><div><h4 class="title"><a id="_specifying_the_root_device"></a>Specifying the root Device</h4></div></div></div><p>This is the only option dracut really needs to boot from your root partition. Because your root partition can live in various environments, there are a lot of formats for the root= option. The most basic one is root=<span class="emphasis"><em><code class="literal"><path to device node></code></em></span>:</p><pre class="screen">root=/dev/sda2</pre><p>Because device node names can change, dependent on the drive ordering, you are encouraged to use the filesystem identifier (UUID) or filesystem label (LABEL) to specify your root partition:</p><pre class="screen">root=UUID=19e9dda3-5a38-484d-a9b0-fa6b067d0331</pre><p>or</p><pre class="screen">root=LABEL=myrootpartitionlabel</pre><p>To see all UUIDs or LABELs on your system, do:</p><pre class="screen"># ls -l /dev/disk/by-uuid</pre><p>or</p><pre class="screen"># ls -l /dev/disk/by-label</pre><p>If your root partition is on the network see <a class="xref" href="#NetworkBoot" title="Network Boot">the section called “Network Boot”</a>.</p></div><div class="section"><div class="titlepage"><div><div><h4 class="title"><a id="_keyboard_settings"></a>Keyboard Settings</h4></div></div></div><p>If you have to input passwords for encrypted disk volumes, you might want to set the keyboard layout and specify a display font.</p><p>A typical german kernel command would contain:</p><pre class="screen">rd.vconsole.font=latarcyrheb-sun16 rd.vconsole.keymap=de-latin1-nodeadkeys rd.locale.LANG=de_DE.UTF-8</pre><p>Setting these options can override the setting stored on your system, if you use a modern init system, like systemd.</p></div><div class="section"><div class="titlepage"><div><div><h4 class="title"><a id="_blacklisting_kernel_modules"></a>Blacklisting Kernel Modules</h4></div></div></div><p>Sometimes it is required to prevent the automatic kernel module loading of a specific kernel module. To do this, just add rd.blacklist=<span class="emphasis"><em><code class="literal"><kernel module name></code></em></span>, with <span class="emphasis"><em><code class="literal"><kernel module name></code></em></span> not containing the <span class="emphasis"><em>.ko</em></span> suffix, to the kernel command line. For example:</p><pre class="screen">rd.driver.blacklist=mptsas rd.driver.blacklist=nouveau</pre><p>The option can be specified multiple times on the kernel command line.</p></div><div class="section"><div class="titlepage"><div><div><h4 class="title"><a id="_speeding_up_the_boot_process"></a>Speeding up the Boot Process</h4></div></div></div><p>If you want to speed up the boot process, you can specify as much information for dracut on the kernel command as possible. For example, you can tell dracut, that you root partition is not on a LVM volume or not on a raid partition, or that it lives inside a specific crypto LUKS encrypted volume. By default, dracut searches everywhere. A typical dracut kernel command line for a plain primary or logical partition would contain:</p><pre class="screen">rd.luks=0 rd.lvm=0 rd.md=0 rd.dm=0</pre><p>This turns off every automatic assembly of LVM, MD raids, DM raids and crypto LUKS.</p><p>Of course, you could also omit the dracut modules in the initramfs creation process, but then you would lose the possibility to turn it on on demand.</p></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="Injecting"></a>Injecting custom Files</h3></div></div></div><p>To add your own files to the initramfs image, you have several possibilities.</p><p>The --include option let you specify a source path and a target path. For example</p><pre class="screen"># dracut --include cmdline-preset /etc/cmdline.d/mycmdline.conf initramfs-cmdline-pre.img</pre><p>will create an initramfs image, where the file cmdline-preset will be copied inside the initramfs to <span class="emphasis"><em>/etc/cmdline.d/mycmdline.conf</em></span>. --include can only be specified once.</p><pre class="screen"># mkdir -p rd.live.overlay/etc/cmdline.d # mkdir -p rd.live.overlay/etc/conf.d # echo "ip=dhcp" >> rd.live.overlay/etc/cmdline.d/mycmdline.conf # echo export FOO=testtest >> rd.live.overlay/etc/conf.d/testvar.conf # echo export BAR=testtest >> rd.live.overlay/etc/conf.d/testvar.conf # tree rd.live.overlay/ rd.live.overlay/ `-- etc |-- cmdline.d | `-- mycmdline.conf `-- conf.d `-- testvar.conf # dracut --include rd.live.overlay / initramfs-rd.live.overlay.img</pre><p>This will put the contents of the rd.live.overlay directory into the root of the initramfs image.</p><p>The --install option let you specify several files, which will get installed in the initramfs image at the same location, as they are present on initramfs creation time.</p><pre class="screen"># dracut --install 'strace fsck.ext3 ssh' initramfs-dbg.img</pre><p>This will create an initramfs with the strace, fsck.ext3 and ssh executables, together with the libraries needed to start those. The --install option can be specified multiple times.</p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="NetworkBoot"></a>Network Boot</h3></div></div></div><p>If your root partition is on a network drive, you have to have the network dracut modules installed to create a network aware initramfs image.</p><p>If you specify ip=dhcp on the kernel command line, then dracut asks a dhcp server about the ip address for the machine. The dhcp server can also serve an additional root-path, which will set the root device for dracut. With this mechanism, you have static configuration on your client machine and a centralized boot configuration on your TFTP/DHCP server. If you can’t pass a kernel command line, then you can inject <span class="emphasis"><em>/etc/cmdline.d/mycmdline.conf</em></span>, with a method described in <a class="xref" href="#Injecting" title="Injecting custom Files">the section called “Injecting custom Files”</a>.</p><div class="section"><div class="titlepage"><div><div><h4 class="title"><a id="_reducing_the_image_size"></a>Reducing the Image Size</h4></div></div></div><p>To reduce the size of the initramfs, you should create it with by omitting all dracut modules, which you know, you don’t need to boot the machine.</p><p>You can also specify the exact dracut and kernel modules to produce a very tiny initramfs image.</p><p>For example for a NFS image, you would do:</p><pre class="screen"># dracut -m "nfs network base" initramfs-nfs-only.img</pre><p>Then you would boot from this image with your target machine and reduce the size once more by creating it on the target machine with the --host-only option:</p><pre class="screen"># dracut -m "nfs network base" --host-only initramfs-nfs-host-only.img</pre><p>This will reduce the size of the initramfs image significantly.</p></div></div></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="_troubleshooting"></a>Troubleshooting</h2></div></div></div><p>If the boot process does not succeed, you have several options to debug the situation. Some of the basic operations are covered here. For more information you should also visit: <a class="ulink" href="https://www.kernel.org/pub/linux/utils/boot/dracut/dracut.html" target="_top">https://www.kernel.org/pub/linux/utils/boot/dracut/dracut.html</a></p><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="identifying-your-problem-area"></a>Identifying your problem area</h3></div></div></div><div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem"> Remove <span class="emphasis"><em>'rhgb</em></span>' and <span class="emphasis"><em>'quiet</em></span>' from the kernel command line </li><li class="listitem"> Add <span class="emphasis"><em>'rd.shell</em></span>' to the kernel command line. This will present a shell should dracut be unable to locate your root device </li><li class="listitem"> Add <span class="emphasis"><em>'rd.shell rd.debug log_buf_len=1M</em></span>' to the kernel command line so that dracut shell commands are printed as they are executed </li><li class="listitem"> The file /run/initramfs/rdsosreport.txt is generated, which contains all the logs and the output of all significant tools, which are mentioned later. </li></ol></div><p>If you want to save that output, simply mount /boot by hand or insert an USB stick and mount that. Then you can store the output for later inspection.</p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="information-to-include-in-your-report"></a>Information to include in your report</h3></div></div></div><div class="section"><div class="titlepage"><div><div><h4 class="title"><a id="all-bug-reports"></a>All bug reports</h4></div></div></div><p>In all cases, the following should be mentioned and attached to your bug report:</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"> The exact kernel command-line used. Typically from the bootloader configuration file (e.g. <span class="emphasis"><em>/boot/grub2/grub.cfg</em></span>) or from <span class="emphasis"><em>/proc/cmdline</em></span>. </li><li class="listitem"> A copy of your disk partition information from <span class="emphasis"><em>/etc/fstab</em></span>, which might be obtained booting an old working initramfs or a rescue medium. </li><li class="listitem"> Turn on dracut debugging (see <span class="emphasis"><em>the <span class="emphasis"><em>debugging dracut</em></span> section</em></span>), and attach the file /run/initramfs/rdsosreport.txt. </li><li class="listitem"> If you use a dracut configuration file, please include <span class="emphasis"><em>/etc/dracut.conf</em></span> and all files in <span class="emphasis"><em>/etc/dracut.conf.d/*.conf</em></span> </li></ul></div></div><div class="section"><div class="titlepage"><div><div><h4 class="title"><a id="network-root-device-related-problems"></a>Network root device related problems</h4></div></div></div><p>This section details information to include when experiencing problems on a system whose root device is located on a network attached volume (e.g. iSCSI, NFS or NBD). As well as the information from <a class="xref" href="#all-bug-reports" title="All bug reports">the section called “All bug reports”</a>, include the following information:</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p class="simpara"> Please include the output of </p><pre class="screen"># /sbin/ifup <interfacename> # ip addr show</pre></li></ul></div></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="debugging-dracut"></a>Debugging dracut</h3></div></div></div><div class="section"><div class="titlepage"><div><div><h4 class="title"><a id="configure-a-serial-console"></a>Configure a serial console</h4></div></div></div><p>Successfully debugging dracut will require some form of console logging during the system boot. This section documents configuring a serial console connection to record boot messages.</p><div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem"> First, enable serial console output for both the kernel and the bootloader. </li><li class="listitem"><p class="simpara"> Open the file <span class="emphasis"><em>/boot/grub2/grub.cfg</em></span> for editing. Below the line <span class="emphasis"><em>'timeout=5</em></span>', add the following: </p><pre class="screen">serial --unit=0 --speed=9600 terminal --timeout=5 serial console</pre></li><li class="listitem"><p class="simpara"> Also in <span class="emphasis"><em>/boot/grub2/grub.cfg</em></span>, add the following boot arguemnts to the <span class="emphasis"><em>'kernel</em></span>' line: </p><pre class="screen">console=tty0 console=ttyS0,9600</pre></li><li class="listitem"><p class="simpara"> When finished, the <span class="emphasis"><em>/boot/grub2/grub.cfg</em></span> file should look similar to the example below. </p><pre class="screen">default=0 timeout=5 serial --unit=0 --speed=9600 terminal --timeout=5 serial console title Fedora (2.6.29.5-191.fc11.x86_64) root (hd0,0) kernel /vmlinuz-2.6.29.5-191.fc11.x86_64 ro root=/dev/mapper/vg_uc1-lv_root console=tty0 console=ttyS0,9600 initrd /dracut-2.6.29.5-191.fc11.x86_64.img</pre></li><li class="listitem"> More detailed information on how to configure the kernel for console output can be found at <a class="ulink" href="http://www.faqs.org/docs/Linux-HOWTO/Remote-Serial-Console-HOWTO.html#CONFIGURE-KERNEL" target="_top">http://www.faqs.org/docs/Linux-HOWTO/Remote-Serial-Console-HOWTO.html#CONFIGURE-KERNEL</a>. </li><li class="listitem"><p class="simpara"> Redirecting non-interactive output </p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>You can redirect all non-interactive output to <span class="emphasis"><em>/dev/kmsg</em></span> and the kernel will put it out on the console when it reaches the kernel buffer by doing</p></div><pre class="screen"># exec >/dev/kmsg 2>&1 </dev/console</pre></li></ol></div></div><div class="section"><div class="titlepage"><div><div><h4 class="title"><a id="using-the-dracut-shell"></a>Using the dracut shell</h4></div></div></div><p>dracut offers a shell for interactive debugging in the event dracut fails to locate your root filesystem. To enable the shell:</p><div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem"> Add the boot parameter <span class="emphasis"><em>'rd.shell</em></span>' to your bootloader configuration file (e.g. <span class="emphasis"><em>/boot/grub2/grub.cfg</em></span>) </li><li class="listitem"><p class="simpara"> Remove the boot arguments <span class="emphasis"><em>'rhgb</em></span>' and <span class="emphasis"><em>'quiet</em></span>' </p><p class="simpara">A sample <span class="emphasis"><em>/boot/grub2/grub.cfg</em></span> bootloader configuration file is listed below.</p><pre class="screen">default=0 timeout=5 serial --unit=0 --speed=9600 terminal --timeout=5 serial console title Fedora (2.6.29.5-191.fc11.x86_64) root (hd0,0) kernel /vmlinuz-2.6.29.5-191.fc11.x86_64 ro root=/dev/mapper/vg_uc1-lv_root console=tty0 rd.shell initrd /dracut-2.6.29.5-191.fc11.x86_64.img</pre></li><li class="listitem"><p class="simpara"> If system boot fails, you will be dropped into a shell as seen in the example below. </p><pre class="screen">No root device found Dropping to debug shell. #</pre></li><li class="listitem"> Use this shell prompt to gather the information requested above (see <a class="xref" href="#all-bug-reports" title="All bug reports">the section called “All bug reports”</a>). </li></ol></div></div><div class="section"><div class="titlepage"><div><div><h4 class="title"><a id="accessing-the-root-volume-from-the-dracut-shell"></a>Accessing the root volume from the dracut shell</h4></div></div></div><p>From the dracut debug shell, you can manually perform the task of locating and preparing your root volume for boot. The required steps will depend on how your root volume is configured. Common scenarios include:</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"> A block device (e.g. <span class="emphasis"><em>/dev/sda7</em></span>) </li><li class="listitem"> A LVM logical volume (e.g. <span class="emphasis"><em>/dev/VolGroup00/LogVol00</em></span>) </li><li class="listitem"> An encrypted device (e.g. <span class="emphasis"><em>/dev/mapper/luks-4d5972ea-901c-4584-bd75-1da802417d83</em></span>) </li><li class="listitem"> A network attached device (e.g. <span class="emphasis"><em>netroot=iscsi:@192.168.0.4::3260::iqn.2009-02.org.example:for.all</em></span>) </li></ul></div><p>The exact method for locating and preparing will vary. However, to continue with a successful boot, the objective is to locate your root volume and create a symlink <span class="emphasis"><em>/dev/root</em></span> which points to the file system. For example, the following example demonstrates accessing and booting a root volume that is an encrypted LVM Logical volume.</p><div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem"><p class="simpara"> Inspect your partitions using parted </p><pre class="screen"># parted /dev/sda -s p Model: ATA HTS541060G9AT00 (scsi) Disk /dev/sda: 60.0GB Sector size (logical/physical): 512B/512B Partition Table: msdos Number Start End Size Type File system Flags 1 32.3kB 10.8GB 107MB primary ext4 boot 2 10.8GB 55.6GB 44.7GB logical lvm</pre></li><li class="listitem"><p class="simpara"> You recall that your root volume was a LVM logical volume. Scan and activate any logical volumes. </p><pre class="screen"># lvm vgscan # lvm vgchange -ay</pre></li><li class="listitem"><p class="simpara"> You should see any logical volumes now using the command blkid: </p><pre class="screen"># blkid /dev/sda1: UUID="3de247f3-5de4-4a44-afc5-1fe179750cf7" TYPE="ext4" /dev/sda2: UUID="Ek4dQw-cOtq-5MJu-OGRF-xz5k-O2l8-wdDj0I" TYPE="LVM2_member" /dev/mapper/linux-root: UUID="def0269e-424b-4752-acf3-1077bf96ad2c" TYPE="crypto_LUKS" /dev/mapper/linux-home: UUID="c69127c1-f153-4ea2-b58e-4cbfa9257c5e" TYPE="ext3" /dev/mapper/linux-swap: UUID="47b4d329-975c-4c08-b218-f9c9bf3635f1" TYPE="swap"</pre></li><li class="listitem"><p class="simpara"> From the output above, you recall that your root volume exists on an encrypted block device. Following the guidance disk encryption guidance from the Installation Guide, you unlock your encrypted root volume. </p><pre class="screen"># UUID=$(cryptsetup luksUUID /dev/mapper/linux-root) # cryptsetup luksOpen /dev/mapper/linux-root luks-$UUID Enter passphrase for /dev/mapper/linux-root: Key slot 0 unlocked.</pre></li><li class="listitem"><p class="simpara"> Next, make a symbolic link to the unlocked root volume </p><pre class="screen"># ln -s /dev/mapper/luks-$UUID /dev/root</pre></li><li class="listitem"><p class="simpara"> With the root volume available, you may continue booting the system by exiting the dracut shell </p><pre class="screen"># exit</pre></li></ol></div></div><div class="section"><div class="titlepage"><div><div><h4 class="title"><a id="additional-dracut-boot-parameters"></a>Additional dracut boot parameters</h4></div></div></div><p>For more debugging options, see <span class="strong"><strong>dracut.cmdline</strong></span>(7).</p></div><div class="section"><div class="titlepage"><div><div><h4 class="title"><a id="debugging-dracut-on-shutdown"></a>Debugging dracut on shutdown</h4></div></div></div><p>To debug the shutdown sequence on systemd systems, you can <span class="emphasis"><em>rd.break</em></span> on <span class="emphasis"><em>pre-shutdown</em></span> or <span class="emphasis"><em>shutdown</em></span>.</p><p>To do this from an already booted system:</p><pre class="screen"># mkdir -p /run/initramfs/etc/cmdline.d # echo "rd.debug rd.break=pre-shutdown rd.break=shutdown" > /run/initramfs/etc/cmdline.d/debug.conf # touch /run/initramfs/.need_shutdown</pre><p>This will give you a dracut shell after the system pivot’ed back in the initramfs.</p></div></div></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="_options"></a>OPTIONS</h2></div></div></div><div class="variablelist"><dl class="variablelist"><dt><span class="term"> <span class="strong"><strong>--kver</strong></span> <span class="emphasis"><em><kernel version></em></span> </span></dt><dd> set the kernel version. This enables to specify the kernel version, without specifying the location of the initramfs image. For example: </dd></dl></div><pre class="screen"># dracut --kver 3.5.0-0.rc7.git1.2.fc18.x86_64</pre><div class="variablelist"><dl class="variablelist"><dt><span class="term"> <span class="strong"><strong>-f, --force</strong></span> </span></dt><dd> overwrite existing initramfs file. </dd><dt><span class="term"> <span class="strong"><strong>-a, --add</strong></span> <span class="emphasis"><em><list of dracut modules></em></span> </span></dt><dd><p class="simpara"> add a space-separated list of dracut modules to the default set of modules. This parameter can be specified multiple times. </p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>If [LIST] has multiple arguments, then you have to put these in quotes. For example:</p><pre class="screen"># dracut --add "module1 module2" ...</pre></div></dd><dt><span class="term"> <span class="strong"><strong>--force-add</strong></span> <span class="emphasis"><em><list of dracut modules></em></span> </span></dt><dd><p class="simpara"> force to add a space-separated list of dracut modules to the default set of modules, when -H is specified. This parameter can be specified multiple times. </p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>If [LIST] has multiple arguments, then you have to put these in quotes. For example:</p><pre class="screen"># dracut --force-add "module1 module2" ...</pre></div></dd><dt><span class="term"> <span class="strong"><strong>-o, --omit</strong></span> <span class="emphasis"><em><list of dracut modules></em></span> </span></dt><dd><p class="simpara"> omit a space-separated list of dracut modules. This parameter can be specified multiple times. </p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>If [LIST] has multiple arguments, then you have to put these in quotes. For example:</p><pre class="screen"># dracut --omit "module1 module2" ...</pre></div></dd><dt><span class="term"> <span class="strong"><strong>-m, --modules</strong></span> <span class="emphasis"><em><list of dracut modules></em></span> </span></dt><dd><p class="simpara"> specify a space-separated list of dracut modules to call when building the initramfs. Modules are located in <span class="emphasis"><em>/usr/lib/dracut/modules.d</em></span>. This parameter can be specified multiple times. This option forces dracut to only include the specified dracut modules. In most cases the "--add" option is what you want to use. </p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>If [LIST] has multiple arguments, then you have to put these in quotes. For example:</p><pre class="screen"># dracut --modules "module1 module2" ...</pre></div></dd><dt><span class="term"> <span class="strong"><strong>-d, --drivers</strong></span> <span class="emphasis"><em><list of kernel modules></em></span> </span></dt><dd><p class="simpara"> specify a space-separated list of kernel modules to exclusively include in the initramfs. The kernel modules have to be specified without the ".ko" suffix. This parameter can be specified multiple times. </p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>If [LIST] has multiple arguments, then you have to put these in quotes. For example:</p><pre class="screen"># dracut --drivers "kmodule1 kmodule2" ...</pre></div></dd><dt><span class="term"> <span class="strong"><strong>--add-drivers</strong></span> <span class="emphasis"><em><list of kernel modules></em></span> </span></dt><dd><p class="simpara"> specify a space-separated list of kernel modules to add to the initramfs. The kernel modules have to be specified without the ".ko" suffix. This parameter can be specified multiple times. </p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>If [LIST] has multiple arguments, then you have to put these in quotes. For example:</p><pre class="screen"># dracut --add-drivers "kmodule1 kmodule2" ...</pre></div></dd><dt><span class="term"> <span class="strong"><strong>--force-drivers</strong></span> <span class="emphasis"><em><list of kernel modules></em></span> </span></dt><dd><p class="simpara"> See add-drivers above. But in this case it is ensured that the drivers are tried to be loaded early via modprobe. </p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>If [LIST] has multiple arguments, then you have to put these in quotes. For example:</p><pre class="screen"># dracut --force-drivers "kmodule1 kmodule2" ...</pre></div></dd><dt><span class="term"> <span class="strong"><strong>--omit-drivers</strong></span> <span class="emphasis"><em><list of kernel modules></em></span> </span></dt><dd><p class="simpara"> specify a space-separated list of kernel modules not to add to the initramfs. The kernel modules have to be specified without the ".ko" suffix. This parameter can be specified multiple times. </p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>If [LIST] has multiple arguments, then you have to put these in quotes. For example:</p><pre class="screen"># dracut --omit-drivers "kmodule1 kmodule2" ...</pre></div></dd><dt><span class="term"> <span class="strong"><strong>--filesystems</strong></span> <span class="emphasis"><em><list of filesystems></em></span> </span></dt><dd><p class="simpara"> specify a space-separated list of kernel filesystem modules to exclusively include in the generic initramfs. This parameter can be specified multiple times. </p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>If [LIST] has multiple arguments, then you have to put these in quotes. For example:</p><pre class="screen"># dracut --filesystems "filesystem1 filesystem2" ...</pre></div></dd><dt><span class="term"> <span class="strong"><strong>-k, --kmoddir</strong></span> <span class="emphasis"><em><kernel directory></em></span> </span></dt><dd> specify the directory, where to look for kernel modules </dd><dt><span class="term"> <span class="strong"><strong>--fwdir</strong></span> <span class="emphasis"><em><dir>[:<dir>…]++</em></span> </span></dt><dd> specify additional directories, where to look for firmwares. This parameter can be specified multiple times. </dd><dt><span class="term"> <span class="strong"><strong>--kernel-cmdline <parameters></strong></span> </span></dt><dd> specify default kernel command line parameters </dd><dt><span class="term"> <span class="strong"><strong>--kernel-only</strong></span> </span></dt><dd> only install kernel drivers and firmware files </dd><dt><span class="term"> <span class="strong"><strong>--no-kernel</strong></span> </span></dt><dd> do not install kernel drivers and firmware files </dd><dt><span class="term"> <span class="strong"><strong>--early-microcode</strong></span> </span></dt><dd> Combine early microcode with ramdisk </dd><dt><span class="term"> <span class="strong"><strong>--no-early-microcode</strong></span> </span></dt><dd> Do not combine early microcode with ramdisk </dd><dt><span class="term"> <span class="strong"><strong>--print-cmdline</strong></span> </span></dt><dd> print the kernel command line for the current disk layout </dd><dt><span class="term"> <span class="strong"><strong>--mdadmconf</strong></span> </span></dt><dd> include local <span class="emphasis"><em>/etc/mdadm.conf</em></span> </dd><dt><span class="term"> <span class="strong"><strong>--nomdadmconf</strong></span> </span></dt><dd> do not include local <span class="emphasis"><em>/etc/mdadm.conf</em></span> </dd><dt><span class="term"> <span class="strong"><strong>--lvmconf</strong></span> </span></dt><dd> include local <span class="emphasis"><em>/etc/lvm/lvm.conf</em></span> </dd><dt><span class="term"> <span class="strong"><strong>--nolvmconf</strong></span> </span></dt><dd> do not include local <span class="emphasis"><em>/etc/lvm/lvm.conf</em></span> </dd><dt><span class="term"> <span class="strong"><strong>--fscks</strong></span> [LIST] </span></dt><dd><p class="simpara"> add a space-separated list of fsck tools, in addition to <span class="emphasis"><em>dracut.conf</em></span>'s specification; the installation is opportunistic (non-existing tools are ignored) </p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>If [LIST] has multiple arguments, then you have to put these in quotes. For example:</p><pre class="screen"># dracut --fscks "fsck.foo barfsck" ...</pre></div></dd><dt><span class="term"> <span class="strong"><strong>--nofscks</strong></span> </span></dt><dd> inhibit installation of any fsck tools </dd><dt><span class="term"> <span class="strong"><strong>--strip</strong></span> </span></dt><dd> strip binaries in the initramfs (default) </dd><dt><span class="term"> <span class="strong"><strong>--nostrip</strong></span> </span></dt><dd> do not strip binaries in the initramfs </dd><dt><span class="term"> <span class="strong"><strong>--hardlink</strong></span> </span></dt><dd> hardlink files in the initramfs (default) </dd><dt><span class="term"> <span class="strong"><strong>--nohardlink</strong></span> </span></dt><dd> do not hardlink files in the initramfs </dd><dt><span class="term"> <span class="strong"><strong>--prefix</strong></span> <span class="emphasis"><em><dir></em></span> </span></dt><dd> prefix initramfs files with the specified directory </dd><dt><span class="term"> <span class="strong"><strong>--noprefix</strong></span> </span></dt><dd> do not prefix initramfs files (default) </dd><dt><span class="term"> <span class="strong"><strong>-h, --help</strong></span> </span></dt><dd> display help text and exit. </dd><dt><span class="term"> <span class="strong"><strong>--debug</strong></span> </span></dt><dd> output debug information of the build process </dd><dt><span class="term"> <span class="strong"><strong>-v, --verbose</strong></span> </span></dt><dd> increase verbosity level (default is info(4)) </dd><dt><span class="term"> <span class="strong"><strong>-q, --quiet</strong></span> </span></dt><dd> decrease verbosity level (default is info(4)) </dd><dt><span class="term"> <span class="strong"><strong>-c, --conf</strong></span> <span class="emphasis"><em><dracut configuration file></em></span> </span></dt><dd><p class="simpara"> specify configuration file to use. </p><p class="simpara">Default: <span class="emphasis"><em>/etc/dracut.conf</em></span></p></dd><dt><span class="term"> <span class="strong"><strong>--confdir</strong></span> <span class="emphasis"><em><configuration directory></em></span> </span></dt><dd><p class="simpara"> specify configuration directory to use. </p><p class="simpara">Default: <span class="emphasis"><em>/etc/dracut.conf.d</em></span></p></dd><dt><span class="term"> <span class="strong"><strong>--tmpdir</strong></span> <span class="emphasis"><em><temporary directory></em></span> </span></dt><dd><p class="simpara"> specify temporary directory to use. </p><p class="simpara">Default: <span class="emphasis"><em>/var/tmp</em></span></p></dd><dt><span class="term"> <span class="strong"><strong>--sshkey</strong></span> <span class="emphasis"><em><sshkey file></em></span> </span></dt><dd> ssh key file used with ssh-client module. </dd><dt><span class="term"> <span class="strong"><strong>--logfile</strong></span> <span class="emphasis"><em><logfile></em></span> </span></dt><dd><p class="simpara"> logfile to use; overrides any setting from the configuration files. </p><p class="simpara">Default: <span class="emphasis"><em>/var/log/dracut.log</em></span></p></dd><dt><span class="term"> <span class="strong"><strong>-l, --local</strong></span> </span></dt><dd> activates the local mode. dracut will use modules from the current working directory instead of the system-wide installed modules in <span class="emphasis"><em>/usr/lib/dracut/modules.d</em></span>. This is useful when running dracut from a git checkout. </dd><dt><span class="term"> <span class="strong"><strong>-H, --hostonly</strong></span> </span></dt><dd><p class="simpara"> Host-Only mode: Install only what is needed for booting the local host instead of a generic host and generate host-specific configuration. </p><div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Warning</h3><p>If chrooted to another root other than the real root device, use "--fstab" and provide a valid <span class="emphasis"><em>/etc/fstab</em></span>.</p></div></dd><dt><span class="term"> <span class="strong"><strong>-N, --no-hostonly</strong></span> </span></dt><dd> Disable Host-Only mode </dd></dl></div><p><span class="strong"><strong>--hostonly-cmdline</strong></span>: Store kernel command line arguments needed in the initramfs</p><p><span class="strong"><strong>--no-hostonly-cmdline</strong></span>: Do not store kernel command line arguments needed in the initramfs</p><p><span class="strong"><strong>--no-hostonly-default-device</strong></span>: Do not generate implicit host devices like root, swap, fstab, etc. Use "--mount" or "--add-device" to explicitly add devices as needed.</p><p><span class="strong"><strong>--hostonly-i18n</strong></span>: Install only needed keyboard and font files according to the host configuration (default).</p><p><span class="strong"><strong>--no-hostonly-i18n</strong></span>: Install all keyboard and font files available.</p><div class="variablelist"><dl class="variablelist"><dt><span class="term"> <span class="strong"><strong>--persistent-policy</strong></span> <span class="emphasis"><em><policy></em></span> </span></dt><dd> Use <span class="emphasis"><em><policy></em></span> to address disks and partitions. <span class="emphasis"><em><policy></em></span> can be any directory name found in /dev/disk. E.g. "by-uuid", "by-label" </dd><dt><span class="term"> <span class="strong"><strong>--fstab</strong></span> </span></dt><dd> Use <span class="emphasis"><em>/etc/fstab</em></span> instead of <span class="emphasis"><em>/proc/self/mountinfo</em></span>. </dd><dt><span class="term"> <span class="strong"><strong>--add-fstab</strong></span> <span class="emphasis"><em><filename></em></span> </span></dt><dd> Add entries of <span class="emphasis"><em><filename></em></span> to the initramfs /etc/fstab. </dd><dt><span class="term"> <span class="strong"><strong>--mount</strong></span> "<span class="emphasis"><em><device></em></span> <span class="emphasis"><em><mountpoint></em></span> <span class="emphasis"><em><filesystem type></em></span> [<span class="emphasis"><em><filesystem options></em></span> [<span class="emphasis"><em><dump frequency></em></span> [<span class="emphasis"><em><fsck order></em></span>]]]" </span></dt><dd> Mount <span class="emphasis"><em><device></em></span> on <span class="emphasis"><em><mountpoint></em></span> with <span class="emphasis"><em><filesystem type></em></span> in the initramfs. <span class="emphasis"><em><filesystem options></em></span>, <span class="emphasis"><em><dump options></em></span> and <span class="emphasis"><em><fsck order></em></span> can be specified, see fstab manpage for the details. The default <span class="emphasis"><em><filesystem options></em></span> is "defaults". The default <span class="emphasis"><em><dump frequency></em></span> is "0". the default <span class="emphasis"><em><fsck order></em></span> is "2". </dd><dt><span class="term"> <span class="strong"><strong>--mount</strong></span> "<span class="emphasis"><em><mountpoint></em></span>" </span></dt><dd> Like above, but <span class="emphasis"><em><device></em></span>, <span class="emphasis"><em><filesystem type></em></span> and <span class="emphasis"><em><filesystem options></em></span> are determined by looking at the current mounts. </dd><dt><span class="term"> <span class="strong"><strong>--add-device</strong></span> <span class="emphasis"><em><device></em></span> </span></dt><dd> Bring up <span class="emphasis"><em><device></em></span> in initramfs, <span class="emphasis"><em><device></em></span> should be the device name. This can be useful in hostonly mode for resume support when your swap is on LVM or an encrypted partition. [NB --device can be used for compatibility with earlier releases] </dd><dt><span class="term"> <span class="strong"><strong>-i, --include</strong></span> <span class="emphasis"><em><SOURCE></em></span> <span class="emphasis"><em><TARGET></em></span> </span></dt><dd> include the files in the SOURCE directory into the TARGET directory in the final initramfs. If SOURCE is a file, it will be installed to TARGET in the final initramfs. This parameter can be specified multiple times. </dd><dt><span class="term"> <span class="strong"><strong>-I, --install</strong></span> <span class="emphasis"><em><file list></em></span> </span></dt><dd><p class="simpara"> install the space separated list of files into the initramfs. </p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>If [LIST] has multiple arguments, then you have to put these in quotes. For example:</p><pre class="screen"># dracut --install "/bin/foo /sbin/bar" ...</pre></div></dd><dt><span class="term"> <span class="strong"><strong>--install-optional</strong></span> <span class="emphasis"><em><file list></em></span> </span></dt><dd> install the space separated list of files into the initramfs, if they exist. </dd><dt><span class="term"> <span class="strong"><strong>--gzip</strong></span> </span></dt><dd> Compress the generated initramfs using gzip. This will be done by default, unless another compression option or --no-compress is passed. Equivalent to "--compress=gzip -9" </dd><dt><span class="term"> <span class="strong"><strong>--bzip2</strong></span> </span></dt><dd><p class="simpara"> Compress the generated initramfs using bzip2. </p><div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Warning</h3><p>Make sure your kernel has bzip2 decompression support compiled in, otherwise you will not be able to boot. Equivalent to "--compress=bzip2"</p></div></dd><dt><span class="term"> <span class="strong"><strong>--lzma</strong></span> </span></dt><dd><p class="simpara"> Compress the generated initramfs using lzma. </p><div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Warning</h3><p>Make sure your kernel has lzma decompression support compiled in, otherwise you will not be able to boot. Equivalent to "lzma --compress=lzma -9"</p></div></dd><dt><span class="term"> <span class="strong"><strong>--xz</strong></span> </span></dt><dd><p class="simpara"> Compress the generated initramfs using xz. </p><div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Warning</h3><p>Make sure your kernel has xz decompression support compiled in, otherwise you will not be able to boot. Equivalent to "lzma --compress=xz --check=crc32 --lzma2=dict=1MiB"</p></div></dd><dt><span class="term"> <span class="strong"><strong>--lzo</strong></span> </span></dt><dd> Compress the generated initramfs using lzop. </dd></dl></div><div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Warning</h3><p>Make sure your kernel has lzo decompression support compiled in, otherwise you will not be able to boot.</p></div><div class="variablelist"><dl class="variablelist"><dt><span class="term"> <span class="strong"><strong>--lz4</strong></span> </span></dt><dd> Compress the generated initramfs using lz4. </dd></dl></div><div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Warning</h3><p>Make sure your kernel has lz4 decompression support compiled in, otherwise you will not be able to boot.</p></div><div class="variablelist"><dl class="variablelist"><dt><span class="term"> <span class="strong"><strong>--zstd</strong></span> </span></dt><dd> Compress the generated initramfs using Zstandard. </dd></dl></div><div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Warning</h3><p>Make sure your kernel has zstd decompression support compiled in, otherwise you will not be able to boot.</p></div><div class="variablelist"><dl class="variablelist"><dt><span class="term"> <span class="strong"><strong>--compress</strong></span> <span class="emphasis"><em><compressor></em></span> </span></dt><dd> Compress the generated initramfs using the passed compression program. If you pass it just the name of a compression program, it will call that program with known-working arguments. If you pass a quoted string with arguments, it will be called with exactly those arguments. Depending on what you pass, this may result in an initramfs that the kernel cannot decompress. The default value can also be set via the <span class="emphasis"><em>INITRD_COMPRESS</em></span> environment variable. </dd><dt><span class="term"> <span class="strong"><strong>--no-compress</strong></span> </span></dt><dd> Do not compress the generated initramfs. This will override any other compression options. </dd><dt><span class="term"> <span class="strong"><strong>--reproducible</strong></span> </span></dt><dd> Create reproducible images. </dd><dt><span class="term"> <span class="strong"><strong>--no-reproducible</strong></span> </span></dt><dd> Do not create reproducible images. </dd><dt><span class="term"> <span class="strong"><strong>--list-modules</strong></span> </span></dt><dd> List all available dracut modules. </dd><dt><span class="term"> <span class="strong"><strong>-M, --show-modules</strong></span> </span></dt><dd> Print included module’s name to standard output during build. </dd><dt><span class="term"> <span class="strong"><strong>--keep</strong></span> </span></dt><dd> Keep the initramfs temporary directory for debugging purposes. </dd><dt><span class="term"> <span class="strong"><strong>--printsize</strong></span> </span></dt><dd> Print out the module install size </dd></dl></div><p><span class="strong"><strong>--profile</strong></span>: Output profile information of the build process</p><p><span class="strong"><strong>--ro-mnt</strong></span>: Mount / and /usr read-only by default.</p><div class="variablelist"><dl class="variablelist"><dt><span class="term"> <span class="strong"><strong>-L, --stdlog</strong></span> <span class="emphasis"><em><level></em></span> </span></dt><dd> [0-6] Specify logging level (to standard error) </dd></dl></div><pre class="screen"> 0 - suppress any messages 1 - only fatal errors 2 - all errors 3 - warnings 4 - info 5 - debug info (here starts lots of output) 6 - trace info (and even more)</pre><div class="variablelist"><dl class="variablelist"><dt><span class="term"> <span class="strong"><strong>--regenerate-all</strong></span> </span></dt><dd> Regenerate all initramfs images at the default location with the kernel versions found on the system. Additional parameters are passed through. </dd><dt><span class="term"> <span class="strong"><strong>--loginstall <span class="emphasis"><em><DIR></em></span></strong></span> </span></dt><dd> Log all files installed from the host to <span class="emphasis"><em><DIR></em></span>. </dd><dt><span class="term"> <span class="strong"><strong>--uefi</strong></span> </span></dt><dd> Instead of creating an initramfs image, dracut will create an UEFI executable, which can be executed by an UEFI BIOS. The default output filename is <span class="emphasis"><em><EFI>/EFI/Linux/linux-$kernel$-<MACHINE_ID>-<BUILD_ID>.efi</em></span>. <EFI> might be <span class="emphasis"><em>/efi</em></span>, <span class="emphasis"><em>/boot</em></span> or <span class="emphasis"><em>/boot/efi</em></span> depending on where the ESP partition is mounted. The <BUILD_ID> is taken from BUILD_ID in <span class="emphasis"><em>/usr/lib/os-release</em></span> or if it exists <span class="emphasis"><em>/etc/os-release</em></span> and is left out, if BUILD_ID is non-existant or empty. </dd><dt><span class="term"> <span class="strong"><strong>--no-machineid</strong></span> </span></dt><dd> affects the default output filename of <span class="strong"><strong>--uefi</strong></span> and will discard the <MACHINE_ID> part. </dd><dt><span class="term"> <span class="strong"><strong>--uefi-stub <span class="emphasis"><em><FILE></em></span></strong></span> </span></dt><dd> Specifies the UEFI stub loader, which will load the attached kernel, initramfs and kernel command line and boots the kernel. The default is <span class="emphasis"><em>$prefix/lib/systemd/boot/efi/linux<EFI-MACHINE-TYPE-NAME>.efi.stub</em></span> or <span class="emphasis"><em>$prefix/lib/gummiboot/linux<EFI-MACHINE-TYPE-NAME>.efi.stub</em></span> </dd><dt><span class="term"> <span class="strong"><strong>--kernel-image <span class="emphasis"><em><FILE></em></span></strong></span> </span></dt><dd> Specifies the kernel image, which to include in the UEFI executable. The default is <span class="emphasis"><em>/lib/modules/<KERNEL-VERSION>/vmlinuz</em></span> or <span class="emphasis"><em>/boot/vmlinuz-<KERNEL-VERSION></em></span> </dd></dl></div></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="_environment"></a>ENVIRONMENT</h2></div></div></div><div class="variablelist"><dl class="variablelist"><dt><span class="term"> <span class="emphasis"><em>INITRD_COMPRESS</em></span> </span></dt><dd> sets the default compression program. See <span class="strong"><strong>--compress</strong></span>. </dd></dl></div></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="_files"></a>FILES</h2></div></div></div><div class="variablelist"><dl class="variablelist"><dt><span class="term"> <span class="emphasis"><em>/var/log/dracut.log</em></span> </span></dt><dd> logfile of initramfs image creation </dd><dt><span class="term"> <span class="emphasis"><em>/tmp/dracut.log</em></span> </span></dt><dd> logfile of initramfs image creation, if <span class="emphasis"><em>/var/log/dracut.log</em></span> is not writable </dd><dt><span class="term"> <span class="emphasis"><em>/etc/dracut.conf</em></span> </span></dt><dd> see dracut.conf5 </dd><dt><span class="term"> <span class="emphasis"><em>/etc/dracut.conf.d/*.conf</em></span> </span></dt><dd> see dracut.conf5 </dd><dt><span class="term"> <span class="emphasis"><em>/usr/lib/dracut/dracut.conf.d/*.conf</em></span> </span></dt><dd> see dracut.conf5 </dd></dl></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="_configuration_in_the_initramfs"></a>Configuration in the initramfs</h3></div></div></div><div class="variablelist"><dl class="variablelist"><dt><span class="term"> <span class="emphasis"><em>/etc/conf.d/</em></span> </span></dt><dd> Any files found in <span class="emphasis"><em>/etc/conf.d/</em></span> will be sourced in the initramfs to set initial values. Command line options will override these values set in the configuration files. </dd><dt><span class="term"> <span class="emphasis"><em>/etc/cmdline</em></span> </span></dt><dd> Can contain additional command line options. Deprecated, better use /etc/cmdline.d/*.conf. </dd><dt><span class="term"> <span class="emphasis"><em>/etc/cmdline.d/*.conf</em></span> </span></dt><dd> Can contain additional command line options. </dd></dl></div></div></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="_availability"></a>AVAILABILITY</h2></div></div></div><p>The dracut command is part of the dracut package and is available from <a class="ulink" href="https://dracut.wiki.kernel.org" target="_top">https://dracut.wiki.kernel.org</a></p></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="_authors"></a>AUTHORS</h2></div></div></div><p>Harald Hoyer</p><p>Victor Lowther</p><p>Philippe Seewer</p><p>Warren Togami</p><p>Amadeusz Żołnowski</p><p>Jeremy Katz</p><p>David Dillow</p><p>Will Woods</p></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="_see_also"></a>SEE ALSO</h2></div></div></div><p><span class="strong"><strong>dracut.cmdline</strong></span>(7) <span class="strong"><strong>dracut.conf</strong></span>(5) <span class="strong"><strong>lsinitrd</strong></span>(1)</p></div></div><div class="chapter"><div class="titlepage"><div><div><h2 class="title"><a id="dracutconf5"></a>Chapter 7. DRACUT.CONF(5)</h2></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl class="toc"><dt><span class="section"><a href="#_name_2">NAME</a></span></dt><dt><span class="section"><a href="#_synopsis_2">SYNOPSIS</a></span></dt><dt><span class="section"><a href="#_description_2">Description</a></span></dt><dt><span class="section"><a href="#_files_2">Files</a></span></dt><dt><span class="section"><a href="#_author">AUTHOR</a></span></dt><dt><span class="section"><a href="#_see_also_2">See Also</a></span></dt></dl></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="_name_2"></a>NAME</h2></div></div></div><p>dracut.conf - configuration file(s) for dracut</p></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="_synopsis_2"></a>SYNOPSIS</h2></div></div></div><p><span class="emphasis"><em>/etc/dracut.conf</em></span> <span class="emphasis"><em>/etc/dracut.conf.d/*.conf</em></span> <span class="emphasis"><em>/usr/lib/dracut/dracut.conf.d/*.conf</em></span></p></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="_description_2"></a>Description</h2></div></div></div><p><span class="emphasis"><em>dracut.conf</em></span> is loaded during the initialisation phase of dracut. Command line parameter will override any values set here.</p><p><span class="emphasis"><em>*.conf</em></span> files are read from /usr/lib/dracut/dracut.conf.d and /etc/dracut.conf.d. Files with the same name in /etc/dracut.conf.d will replace files in /usr/lib/dracut/dracut.conf.d. The files are then read in alphanumerical order and will override parameters set in <span class="emphasis"><em>/etc/dracut.conf</em></span>. Each line specifies an attribute and a value. A <span class="emphasis"><em>#</em></span> indicates the beginning of a comment; following characters, up to the end of the line are not interpreted.</p><p>dracut command line options will override any values set here.</p><p>Configuration files must have the extension .conf; other extensions are ignored.</p><div class="variablelist"><dl class="variablelist"><dt><span class="term"> <span class="strong"><strong>add_dracutmodules+=</strong></span>" <span class="emphasis"><em><dracut modules></em></span> " </span></dt><dd> Add a space-separated list of dracut modules to call when building the initramfs. Modules are located in <span class="emphasis"><em>/usr/lib/dracut/modules.d</em></span>. </dd><dt><span class="term"> <span class="strong"><strong>dracutmodules+=</strong></span>" <span class="emphasis"><em><dracut modules></em></span> " </span></dt><dd> Specify a space-separated list of dracut modules to call when building the initramfs. Modules are located in <span class="emphasis"><em>/usr/lib/dracut/modules.d</em></span>. This option forces dracut to only include the specified dracut modules. In most cases the "add_dracutmodules" option is what you want to use. </dd><dt><span class="term"> <span class="strong"><strong>omit_dracutmodules+=</strong></span>" <span class="emphasis"><em><dracut modules></em></span> " </span></dt><dd> Omit a space-separated list of dracut modules to call when building the initramfs. Modules are located in <span class="emphasis"><em>/usr/lib/dracut/modules.d</em></span>. </dd><dt><span class="term"> <span class="strong"><strong>drivers+=</strong></span>" <span class="emphasis"><em><kernel modules></em></span> " </span></dt><dd> Specify a space-separated list of kernel modules to exclusively include in the initramfs. The kernel modules have to be specified without the ".ko" suffix. </dd><dt><span class="term"> <span class="strong"><strong>add_drivers+=</strong></span>" <span class="emphasis"><em><kernel modules></em></span> " </span></dt><dd> Specify a space-separated list of kernel modules to add to the initramfs. The kernel modules have to be specified without the ".ko" suffix. </dd><dt><span class="term"> <span class="strong"><strong>force_drivers+=</strong></span>" <span class="emphasis"><em><list of kernel modules></em></span> " </span></dt><dd> See add_drivers above. But in this case it is ensured that the drivers are tried to be loaded early via modprobe. </dd><dt><span class="term"> <span class="strong"><strong>omit_drivers+=</strong></span>" <span class="emphasis"><em><kernel modules></em></span> " </span></dt><dd> Specify a space-separated list of kernel modules not to add to the initramfs. The kernel modules have to be specified without the ".ko" suffix. </dd><dt><span class="term"> <span class="strong"><strong>filesystems+=</strong></span>" <span class="emphasis"><em><filesystem names></em></span> " </span></dt><dd> Specify a space-separated list of kernel filesystem modules to exclusively include in the generic initramfs. </dd><dt><span class="term"> <span class="strong"><strong>drivers_dir=</strong></span>"<span class="emphasis"><em><kernel modules directory></em></span>" </span></dt><dd> Specify the directory, where to look for kernel modules </dd><dt><span class="term"> <span class="strong"><strong>fw_dir+=</strong></span>" :<span class="emphasis"><em><dir></em></span>[:<span class="emphasis"><em><dir></em></span> …] " </span></dt><dd> Specify additional directories, where to look for firmwares, separated by : </dd><dt><span class="term"> <span class="strong"><strong>install_items+=</strong></span>" <span class="emphasis"><em><file></em></span>[ <span class="emphasis"><em><file></em></span> …] " </span></dt><dd> Specify additional files to include in the initramfs, separated by spaces. </dd><dt><span class="term"> <span class="strong"><strong>install_optional_items+=</strong></span>" <span class="emphasis"><em><file></em></span>[ <span class="emphasis"><em><file></em></span> …] " </span></dt><dd> Specify additional files to include in the initramfs, separated by spaces, if they exist. </dd><dt><span class="term"> <span class="strong"><strong>compress=</strong></span>"<span class="emphasis"><em>{bzip2|lzma|xz|gzip|lzo|lz4|zstd|<compressor [args …]>}</em></span>" </span></dt><dd> Compress the generated initramfs using the passed compression program. If you pass it just the name of a compression program, it will call that program with known-working arguments. If you pass arguments, it will be called with exactly those arguments. Depending on what you pass, this may result in an initramfs that the kernel cannot decompress. </dd><dt><span class="term"> <span class="strong"><strong>do_strip=</strong></span>"<span class="emphasis"><em>{yes|no}</em></span>" </span></dt><dd> Strip binaries in the initramfs (default=yes) </dd><dt><span class="term"> <span class="strong"><strong>hostonly=</strong></span>"<span class="emphasis"><em>{yes|no}</em></span>" </span></dt><dd> Host-Only mode: Install only what is needed for booting the local host instead of a generic host and generate host-specific configuration. </dd><dt><span class="term"> <span class="strong"><strong>hostonly_cmdline=</strong></span>"<span class="emphasis"><em>{yes|no}</em></span>" </span></dt><dd> If set to "yes", store the kernel command line arguments needed in the initramfs </dd><dt><span class="term"> <span class="strong"><strong>persistent_policy=</strong></span>"<span class="emphasis"><em><policy></em></span>" </span></dt><dd> Use <span class="emphasis"><em><policy></em></span> to address disks and partitions. <span class="emphasis"><em><policy></em></span> can be any directory name found in /dev/disk. E.g. "by-uuid", "by-label" </dd><dt><span class="term"> <span class="strong"><strong>tmpdir=</strong></span>"<span class="emphasis"><em><temporary directory></em></span>" </span></dt><dd> Specify temporary directory to use. </dd></dl></div><div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Warning</h3><p>If chrooted to another root other than the real root device, use --fstab and provide a valid <span class="emphasis"><em>/etc/fstab</em></span>.</p></div><div class="variablelist"><dl class="variablelist"><dt><span class="term"> <span class="strong"><strong>use_fstab=</strong></span>"<span class="emphasis"><em>{yes|no}</em></span>" </span></dt><dd> Use <span class="emphasis"><em>/etc/fstab</em></span> instead of <span class="emphasis"><em>/proc/self/mountinfo</em></span>. </dd><dt><span class="term"> <span class="strong"><strong>add_fstab+=</strong></span>" <span class="emphasis"><em><filename></em></span> " </span></dt><dd> Add entries of <span class="emphasis"><em><filename></em></span> to the initramfs /etc/fstab. </dd><dt><span class="term"> <span class="strong"><strong>add_device+=</strong></span>" <span class="emphasis"><em><device></em></span> " </span></dt><dd> Bring up <span class="emphasis"><em><device></em></span> in initramfs, <span class="emphasis"><em><device></em></span> should be the device name. This can be useful in hostonly mode for resume support when your swap is on LVM an encrypted partition. </dd><dt><span class="term"> <span class="strong"><strong>mdadmconf=</strong></span>"<span class="emphasis"><em>{yes|no}</em></span>" </span></dt><dd> Include local <span class="emphasis"><em>/etc/mdadm.conf</em></span> (default=yes) </dd><dt><span class="term"> <span class="strong"><strong>lvmconf=</strong></span>"<span class="emphasis"><em>{yes|no}</em></span>" </span></dt><dd> Include local <span class="emphasis"><em>/etc/lvm/lvm.conf</em></span> (default=yes) </dd><dt><span class="term"> <span class="strong"><strong>fscks=</strong></span>" <span class="emphasis"><em><fsck tools></em></span> " </span></dt><dd> Add a space-separated list of fsck tools. If nothing is specified, the default is: "umount mount /sbin/fsck* xfs_db xfs_check xfs_repair e2fsck jfs_fsck reiserfsck btrfsck". The installation is opportunistic (non-existing tools are ignored). </dd><dt><span class="term"> <span class="strong"><strong>nofscks=</strong></span>"<span class="emphasis"><em>{yes|no}</em></span>" </span></dt><dd> If specified, inhibit installation of any fsck tools. </dd><dt><span class="term"> <span class="strong"><strong>ro_mnt=</strong></span>"<span class="emphasis"><em>{yes|no}</em></span>" </span></dt><dd> Mount <span class="emphasis"><em>/</em></span> and <span class="emphasis"><em>/usr</em></span> read-only by default. </dd><dt><span class="term"> <span class="strong"><strong>kernel_cmdline=</strong></span>"<span class="emphasis"><em>parameters</em></span>" </span></dt><dd> Specify default kernel command line parameters </dd><dt><span class="term"> <span class="strong"><strong>kernel_only=</strong></span>"<span class="emphasis"><em>{yes|no}</em></span>" </span></dt><dd> Only install kernel drivers and firmware files. (default=no) </dd><dt><span class="term"> <span class="strong"><strong>no_kernel=</strong></span>"<span class="emphasis"><em>{yes|no}</em></span>" </span></dt><dd> Do not install kernel drivers and firmware files (default=no) </dd><dt><span class="term"> <span class="strong"><strong>acpi_override=</strong></span>"<span class="emphasis"><em>{yes|no}</em></span>" </span></dt><dd> [WARNING] ONLY USE THIS IF YOU KNOW WHAT YOU ARE DOING! Override BIOS provided ACPI tables. For further documentation read Documentation/acpi/initrd_table_override.txt in the kernel sources. Search for ACPI table files (must have .aml suffix) in acpi_table_dir= directory (see below) and add them to a separate uncompressed cpio archive. This cpio archive gets glued (concatenated, uncompressed one must be the first one) to the compressed cpio archive. The first, uncompressed cpio archive is for data which the kernel must be able to access very early (and cannot make use of uncompress algorithms yet) like microcode or ACPI tables (default=no). </dd><dt><span class="term"> <span class="strong"><strong>acpi_table_dir=</strong></span>"<span class="emphasis"><em><dir></em></span>" </span></dt><dd> Directory to search for ACPI tables if acpi_override= is set to yes. </dd><dt><span class="term"> <span class="strong"><strong>early_microcode=</strong></span>"{yes|no}" </span></dt><dd> Combine early microcode with ramdisk (default=yes) </dd><dt><span class="term"> <span class="strong"><strong>stdloglvl</strong></span>="<span class="emphasis"><em>{0-6}</em></span>" </span></dt><dd> Set logging to standard error level. </dd><dt><span class="term"> <span class="strong"><strong>sysloglvl</strong></span>="<span class="emphasis"><em>{0-6}</em></span>" </span></dt><dd> Set logging to syslog level. </dd><dt><span class="term"> <span class="strong"><strong>fileloglvl=</strong></span>"<span class="emphasis"><em>{0-6}</em></span>" </span></dt><dd> Set logging to file level. </dd><dt><span class="term"> <span class="strong"><strong>logfile=</strong></span>"<span class="emphasis"><em><file></em></span>" </span></dt><dd> Path to log file. </dd><dt><span class="term"> <span class="strong"><strong>show_modules=</strong></span>"<span class="emphasis"><em>{yes|no}</em></span>" </span></dt><dd> Print the name of the included modules to standard output during build. </dd><dt><span class="term"> <span class="strong"><strong>i18n_vars=</strong></span>"<span class="emphasis"><em><variable mapping></em></span>" </span></dt><dd> Distribution specific variable mapping. See dracut/modules.d/10i18n/README for a detailed description. </dd><dt><span class="term"> <span class="strong"><strong>i18n_default_font=</strong></span>"<span class="emphasis"><em><fontname></em></span>" </span></dt><dd> The font <fontname> to install, if not specified otherwise. Default is "LatArCyrHeb-16". </dd><dt><span class="term"> <span class="strong"><strong>i18n_install_all=</strong></span>"<span class="emphasis"><em>{yes|no}</em></span>" </span></dt><dd> Install everything regardless of generic or hostonly mode. </dd><dt><span class="term"> <span class="strong"><strong>reproducible=</strong></span>"<span class="emphasis"><em>{yes|no}</em></span>" </span></dt><dd> Create reproducible images. </dd><dt><span class="term"> <span class="strong"><strong>loginstall=</strong></span>"<span class="emphasis"><em><DIR></em></span>" </span></dt><dd> Log all files installed from the host to <span class="emphasis"><em><DIR></em></span>. </dd><dt><span class="term"> <span class="strong"><strong>uefi_stub=</strong></span>"<span class="emphasis"><em><FILE></em></span>" </span></dt><dd> Specifies the UEFI stub loader, which will load the attached kernel, initramfs and kernel command line and boots the kernel. The default is <span class="emphasis"><em>/lib/systemd/boot/efi/linux<EFI-MACHINE-TYPE-NAME>.efi.stub</em></span> or <span class="emphasis"><em>/usr/lib/gummiboot/linux<EFI-MACHINE-TYPE-NAME>.efi.stub</em></span> </dd><dt><span class="term"> <span class="strong"><strong>kernel_image=</strong></span>"<span class="emphasis"><em><FILE></em></span>" </span></dt><dd> Specifies the kernel image, which to include in the UEFI executable. The default is <span class="emphasis"><em>/lib/modules/<KERNEL-VERSION>/vmlinuz</em></span> or <span class="emphasis"><em>/boot/vmlinuz-<KERNEL-VERSION></em></span> </dd></dl></div></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="_files_2"></a>Files</h2></div></div></div><div class="variablelist"><dl class="variablelist"><dt><span class="term"> <span class="emphasis"><em>/etc/dracut.conf</em></span> </span></dt><dd> Old configuration file. You better use your own file in <span class="emphasis"><em>/etc/dracut.conf.d/</em></span>. </dd><dt><span class="term"> <span class="emphasis"><em>/etc/dracut.conf.d/</em></span> </span></dt><dd> Any <span class="emphasis"><em>/etc/dracut.conf.d/*.conf</em></span> file can override the values in <span class="emphasis"><em>/etc/dracut.conf</em></span>. The configuration files are read in alphanumerical order. </dd></dl></div></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="_author"></a>AUTHOR</h2></div></div></div><p>Harald Hoyer</p></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="_see_also_2"></a>See Also</h2></div></div></div><p><span class="strong"><strong>dracut</strong></span>(8) <span class="strong"><strong>dracut.cmdline</strong></span>(7)</p></div></div><div class="chapter"><div class="titlepage"><div><div><h2 class="title"><a id="dracutcmdline7"></a>Chapter 8. DRACUT.CMDLINE(7)</h2></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl class="toc"><dt><span class="section"><a href="#_name_3">NAME</a></span></dt><dt><span class="section"><a href="#_description_3">DESCRIPTION</a></span></dt><dd><dl><dt><span class="section"><a href="#_standard">Standard</a></span></dt><dt><span class="section"><a href="#_iso_scan_filename">iso-scan/filename</a></span></dt><dt><span class="section"><a href="#_misc">Misc</a></span></dt><dt><span class="section"><a href="#dracutkerneldebug">Debug</a></span></dt><dt><span class="section"><a href="#_i18n">I18N</a></span></dt><dt><span class="section"><a href="#_lvm">LVM</a></span></dt><dt><span class="section"><a href="#_crypto_luks">crypto LUKS</a></span></dt><dt><span class="section"><a href="#_crypto_luks_key_on_removable_device_support">crypto LUKS - key on removable device support</a></span></dt><dt><span class="section"><a href="#_md_raid">MD RAID</a></span></dt><dt><span class="section"><a href="#_dm_raid">DM RAID</a></span></dt><dt><span class="section"><a href="#_multipath">MULTIPATH</a></span></dt><dt><span class="section"><a href="#_fips">FIPS</a></span></dt><dt><span class="section"><a href="#_network">Network</a></span></dt><dt><span class="section"><a href="#_nfs">NFS</a></span></dt><dt><span class="section"><a href="#_cifs">CIFS</a></span></dt><dt><span class="section"><a href="#_iscsi">iSCSI</a></span></dt><dt><span class="section"><a href="#_fcoe">FCoE</a></span></dt><dt><span class="section"><a href="#_nbd">NBD</a></span></dt><dt><span class="section"><a href="#_dasd">DASD</a></span></dt><dt><span class="section"><a href="#_zfcp">ZFCP</a></span></dt><dt><span class="section"><a href="#_znet">ZNET</a></span></dt><dt><span class="section"><a href="#_booting_live_images">Booting live images</a></span></dt><dt><span class="section"><a href="#_zipl">ZIPL</a></span></dt><dt><span class="section"><a href="#_cio_ignore">CIO_IGNORE</a></span></dt><dt><span class="section"><a href="#_plymouth_boot_splash">Plymouth Boot Splash</a></span></dt><dt><span class="section"><a href="#_kernel_keys">Kernel keys</a></span></dt><dt><span class="section"><a href="#_deprecated_renamed_options">Deprecated, renamed Options</a></span></dt><dt><span class="section"><a href="#_configuration_in_the_initramfs_2">Configuration in the Initramfs</a></span></dt></dl></dd><dt><span class="section"><a href="#_author_2">AUTHOR</a></span></dt><dt><span class="section"><a href="#_see_also_3">SEE ALSO</a></span></dt></dl></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="_name_3"></a>NAME</h2></div></div></div><p>dracut.cmdline - dracut kernel command line options</p></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="_description_3"></a>DESCRIPTION</h2></div></div></div><p>The root device used by the kernel is specified in the boot configuration file on the kernel command line, as always.</p><p>The traditional <span class="emphasis"><em>root=/dev/sda1</em></span> style device specification is allowed, but not encouraged. The root device should better be identified by LABEL or UUID. If a label is used, as in <span class="emphasis"><em>root=LABEL=<label_of_root></em></span> the initramfs will search all available devices for a filesystem with the appropriate label, and mount that device as the root filesystem. <span class="emphasis"><em>root=UUID=<uuidnumber></em></span> will mount the partition with that UUID as the root filesystem.</p><p>In the following all kernel command line parameters, which are processed by dracut, are described.</p><p>"rd.*" parameters mentioned without "=" are boolean parameters. They can be turned on/off by setting them to {0|1}. If the assignment with "=" is missing "=1" is implied. For example <span class="emphasis"><em>rd.info</em></span> can be turned off with <span class="emphasis"><em>rd.info=0</em></span> or turned on with <span class="emphasis"><em>rd.info=1</em></span> or <span class="emphasis"><em>rd.info</em></span>. The last value in the kernel command line is the value, which is honored.</p><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="_standard"></a>Standard</h3></div></div></div><div class="variablelist"><dl class="variablelist"><dt><span class="term"> <span class="strong"><strong>init=</strong></span><span class="emphasis"><em><path to real init></em></span> </span></dt><dd> specify the path to the init program to be started after the initramfs has finished </dd><dt><span class="term"> <span class="strong"><strong>root=</strong></span><span class="emphasis"><em><path to blockdevice></em></span> </span></dt><dd><p class="simpara"> specify the block device to use as the root filesystem. </p><p><strong>Example. </strong> </p><pre class="screen">root=/dev/sda1 root=/dev/disk/by-path/pci-0000:00:1f.1-scsi-0:0:1:0-part1 root=/dev/disk/by-label/Root root=LABEL=Root root=/dev/disk/by-uuid/3f5ad593-4546-4a94-a374-bcfb68aa11f7 root=UUID=3f5ad593-4546-4a94-a374-bcfb68aa11f7 root=PARTUUID=3f5ad593-4546-4a94-a374-bcfb68aa11f7</pre><p> </p></dd><dt><span class="term"> <span class="strong"><strong>rootfstype=</strong></span><span class="emphasis"><em><filesystem type></em></span> </span></dt><dd><p class="simpara"> "auto" if not specified. </p><p><strong>Example. </strong> </p><pre class="screen">rootfstype=ext3</pre><p> </p></dd><dt><span class="term"> <span class="strong"><strong>rootflags=</strong></span><span class="emphasis"><em><mount options></em></span> </span></dt><dd> specify additional mount options for the root filesystem. If not set, <span class="emphasis"><em>/etc/fstab</em></span> of the real root will be parsed for special mount options and mounted accordingly. </dd><dt><span class="term"> <span class="strong"><strong>ro</strong></span> </span></dt><dd> force mounting <span class="emphasis"><em>/</em></span> and <span class="emphasis"><em>/usr</em></span> (if it is a separate device) read-only. If none of ro and rw is present, both are mounted according to <span class="emphasis"><em>/etc/fstab</em></span>. </dd><dt><span class="term"> <span class="strong"><strong>rw</strong></span> </span></dt><dd> force mounting <span class="emphasis"><em>/</em></span> and <span class="emphasis"><em>/usr</em></span> (if it is a separate device) read-write. See also ro option. </dd><dt><span class="term"> <span class="strong"><strong>rootfallback=</strong></span><span class="emphasis"><em><path to blockdevice></em></span> </span></dt><dd> specify the block device to use as the root filesystem, if the normal root cannot be found. This can only be a simple block device with a simple file system, for which the filesystem driver is either compiled in, or added manually to the initramfs. This parameter can be specified multiple times. </dd><dt><span class="term"> <span class="strong"><strong>rd.auto</strong></span> <span class="strong"><strong>rd.auto=1</strong></span> </span></dt><dd> enable autoassembly of special devices like cryptoLUKS, dmraid, mdraid or lvm. Default is off as of dracut version >= 024. </dd><dt><span class="term"> <span class="strong"><strong>rd.hostonly=0</strong></span> </span></dt><dd> removes all compiled in configuration of the host system the initramfs image was built on. This helps booting, if any disk layout changed, especially in combination with rd.auto or other parameters specifying the layout. </dd><dt><span class="term"> <span class="strong"><strong>rd.cmdline=ask</strong></span> </span></dt><dd> prompts the user for additional kernel command line parameters </dd><dt><span class="term"> <span class="strong"><strong>rd.fstab=0</strong></span> </span></dt><dd> do not honor special mount options for the root filesystem found in <span class="emphasis"><em>/etc/fstab</em></span> of the real root. </dd><dt><span class="term"> <span class="strong"><strong>resume=</strong></span><span class="emphasis"><em><path to resume partition></em></span> </span></dt><dd><p class="simpara"> resume from a swap partition </p><p><strong>Example. </strong> </p><pre class="screen">resume=/dev/disk/by-path/pci-0000:00:1f.1-scsi-0:0:1:0-part1 resume=/dev/disk/by-uuid/3f5ad593-4546-4a94-a374-bcfb68aa11f7 resume=UUID=3f5ad593-4546-4a94-a374-bcfb68aa11f7</pre><p> </p></dd><dt><span class="term"> <span class="strong"><strong>rd.skipfsck</strong></span> </span></dt><dd> skip fsck for rootfs and <span class="emphasis"><em>/usr</em></span>. If you’re mounting <span class="emphasis"><em>/usr</em></span> read-only and the init system performs fsck before remount, you might want to use this option to avoid duplication. </dd></dl></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="_iso_scan_filename"></a>iso-scan/filename</h3></div></div></div><p>Using iso-scan/filename with a Fedora/Red Hat/CentOS Live iso should just work by copying the original kernel cmdline parameters.</p><p><strong>Example. </strong> </p><pre class="screen">menuentry 'Live Fedora 20' --class fedora --class gnu-linux --class gnu --class os { set isolabel=Fedora-Live-LXDE-x86_64-20-1 set isofile="/boot/iso/Fedora-Live-LXDE-x86_64-20-1.iso" loopback loop $isofile linux (loop)/isolinux/vmlinuz0 boot=isolinux iso-scan/filename=$isofile root=live:LABEL=$isolabel ro rd.live.image quiet rhgb initrd (loop)/isolinux/initrd0.img }</pre><p> </p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="_misc"></a>Misc</h3></div></div></div><div class="variablelist"><dl class="variablelist"><dt><span class="term"> <span class="strong"><strong>rd.emergency=</strong></span><span class="emphasis"><em>[reboot|poweroff|halt]</em></span> </span></dt><dd> specify, what action to execute in case of a critical failure. rd.shell=0 also be specified. </dd><dt><span class="term"> <span class="strong"><strong>rd.driver.blacklist=</strong></span><span class="emphasis"><em><drivername></em></span>[,<span class="emphasis"><em><drivername></em></span>,…] </span></dt><dd> do not load kernel module <drivername>. This parameter can be specified multiple times. </dd><dt><span class="term"> <span class="strong"><strong>rd.driver.pre=</strong></span><span class="emphasis"><em><drivername></em></span>[,<span class="emphasis"><em><drivername></em></span>,…] </span></dt><dd> force loading kernel module <drivername>. This parameter can be specified multiple times. </dd><dt><span class="term"> <span class="strong"><strong>rd.driver.post=</strong></span><span class="emphasis"><em><drivername></em></span>[,<span class="emphasis"><em><drivername></em></span>,…] </span></dt><dd> force loading kernel module <drivername> after all automatic loading modules have been loaded. This parameter can be specified multiple times. </dd><dt><span class="term"> <span class="strong"><strong>rd.retry=</strong></span><span class="emphasis"><em><seconds></em></span> </span></dt><dd> specify how long dracut should retry the initqueue to configure devices. The default is 30 seconds. After 2/3 of the time, degraded raids are force started. If you have hardware, which takes a very long time to announce its drives, you might want to extend this value. </dd><dt><span class="term"> <span class="strong"><strong>rd.timeout=</strong></span><span class="emphasis"><em><seconds></em></span> </span></dt><dd> specify how long dracut should wait for devices to appear. The default is <span class="emphasis"><em>0</em></span>, which means <span class="emphasis"><em>forever</em></span>. Note that this timeout should be longer than rd.retry to allow for proper configuration. </dd><dt><span class="term"> <span class="strong"><strong>rd.noverifyssl</strong></span> </span></dt><dd> accept self-signed certificates for ssl downloads. </dd><dt><span class="term"> <span class="strong"><strong>rd.ctty=</strong></span><span class="emphasis"><em><terminal device></em></span> </span></dt><dd> specify the controlling terminal for the console. This is useful, if you have multiple "console=" arguments. </dd></dl></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="dracutkerneldebug"></a>Debug</h3></div></div></div><p>If you are dropped to an emergency shell, the file <span class="emphasis"><em>/run/initramfs/rdsosreport.txt</em></span> is created, which can be saved to a (to be mounted by hand) partition (usually /boot) or a USB stick. Additional debugging info can be produced by adding <span class="strong"><strong>rd.debug</strong></span> to the kernel command line. <span class="emphasis"><em>/run/initramfs/rdsosreport.txt</em></span> contains all logs and the output of some tools. It should be attached to any report about dracut problems.</p><div class="variablelist"><dl class="variablelist"><dt><span class="term"> <span class="strong"><strong>rd.info</strong></span> </span></dt><dd> print informational output though "quiet" is set </dd><dt><span class="term"> <span class="strong"><strong>rd.shell</strong></span> </span></dt><dd> allow dropping to a shell, if root mounting fails </dd><dt><span class="term"> <span class="strong"><strong>rd.debug</strong></span> </span></dt><dd> set -x for the dracut shell. If systemd is active in the initramfs, all output is logged to the systemd journal, which you can inspect with "journalctl -ab". If systemd is not active, the logs are written to dmesg and <span class="emphasis"><em>/run/initramfs/init.log</em></span>. If "quiet" is set, it also logs to the console. </dd><dt><span class="term"> <span class="strong"><strong>rd.memdebug=[0-5]</strong></span> </span></dt><dd><p class="simpara"> Print memory usage info at various points, set the verbose level from 0 to 5. </p><pre class="literallayout">Higher level means more debugging output:</pre><pre class="screen"> 0 - no output 1 - partial /proc/meminfo 2 - /proc/meminfo 3 - /proc/meminfo + /proc/slabinfo 4 - /proc/meminfo + /proc/slabinfo + memstrack summary NOTE: memstrack is a memory tracing tool that tracks the total memory consumption, and peak memory consumption of each kernel modules and userspace progress during the whole initramfs runtime, report is genereted and the end of initramsfs run. 5 - /proc/meminfo + /proc/slabinfo + memstrack (with top memory stacktrace) NOTE: memstrack (with top memory stacktrace) will print top memory allocation stack traces during the whole initramfs runtime.</pre></dd><dt><span class="term"> <span class="strong"><strong>rd.break</strong></span> </span></dt><dd> drop to a shell at the end </dd><dt><span class="term"> <span class="strong"><strong>rd.break=</strong></span><span class="emphasis"><em>{cmdline|pre-udev|pre-trigger|initqueue|pre-mount|mount|pre-pivot|cleanup}</em></span> </span></dt><dd> drop to a shell on defined breakpoint </dd><dt><span class="term"> <span class="strong"><strong>rd.udev.info</strong></span> </span></dt><dd> set udev to loglevel info </dd><dt><span class="term"> <span class="strong"><strong>rd.udev.debug</strong></span> </span></dt><dd> set udev to loglevel debug </dd></dl></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="_i18n"></a>I18N</h3></div></div></div><div class="variablelist"><dl class="variablelist"><dt><span class="term"> <span class="strong"><strong>rd.vconsole.keymap=</strong></span><span class="emphasis"><em><keymap base file name></em></span> </span></dt><dd><p class="simpara"> keyboard translation table loaded by loadkeys; taken from keymaps directory; will be written as KEYMAP to <span class="emphasis"><em>/etc/vconsole.conf</em></span> in the initramfs. </p><p><strong>Example. </strong> </p><pre class="screen">rd.vconsole.keymap=de-latin1-nodeadkeys</pre><p> </p></dd><dt><span class="term"> <span class="strong"><strong>rd.vconsole.keymap.ext=</strong></span><span class="emphasis"><em><list of keymap base file names></em></span> </span></dt><dd> list of extra keymaps to bo loaded (sep. by space); will be written as EXT_KEYMAP to <span class="emphasis"><em>/etc/vconsole.conf</em></span> in the initramfs </dd><dt><span class="term"> <span class="strong"><strong>rd.vconsole.unicode</strong></span> </span></dt><dd> boolean, indicating UTF-8 mode; will be written as UNICODE to <span class="emphasis"><em>/etc/vconsole.conf</em></span> in the initramfs </dd><dt><span class="term"> <span class="strong"><strong>rd.vconsole.font=</strong></span><span class="emphasis"><em><font base file name></em></span> </span></dt><dd><p class="simpara"> console font; taken from consolefonts directory; will be written as FONT to <span class="emphasis"><em>/etc/vconsole.conf</em></span> in the initramfs. </p><p><strong>Example. </strong> </p><pre class="screen">rd.vconsole.font=LatArCyrHeb-16</pre><p> </p></dd><dt><span class="term"> <span class="strong"><strong>rd.vconsole.font.map=</strong></span><span class="emphasis"><em><console map base file name></em></span> </span></dt><dd> see description of <span class="emphasis"><em>-m</em></span> parameter in setfont manual; taken from consoletrans directory; will be written as FONT_MAP to <span class="emphasis"><em>/etc/vconsole.conf</em></span> in the initramfs </dd><dt><span class="term"> <span class="strong"><strong>rd.vconsole.font.unimap=</strong></span><span class="emphasis"><em><unicode table base file name></em></span> </span></dt><dd> see description of <span class="emphasis"><em>-u</em></span> parameter in setfont manual; taken from unimaps directory; will be written as FONT_UNIMAP to <span class="emphasis"><em>/etc/vconsole.conf</em></span> in the initramfs </dd><dt><span class="term"> <span class="strong"><strong>rd.locale.LANG=</strong></span><span class="emphasis"><em><locale></em></span> </span></dt><dd><p class="simpara"> taken from the environment; if no UNICODE is defined we set its value in basis of LANG value (whether it ends with ".utf8" (or similar) or not); will be written as LANG to <span class="emphasis"><em>/etc/locale.conf</em></span> in the initramfs. </p><p><strong>Example. </strong> </p><pre class="screen">rd.locale.LANG=pl_PL.utf8</pre><p> </p></dd><dt><span class="term"> <span class="strong"><strong>rd.locale.LC_ALL=</strong></span><span class="emphasis"><em><locale></em></span> </span></dt><dd> taken from the environment; will be written as LC_ALL to <span class="emphasis"><em>/etc/locale.conf</em></span> in the initramfs </dd></dl></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="_lvm"></a>LVM</h3></div></div></div><div class="variablelist"><dl class="variablelist"><dt><span class="term"> <span class="strong"><strong>rd.lvm=0</strong></span> </span></dt><dd> disable LVM detection </dd><dt><span class="term"> <span class="strong"><strong>rd.lvm.vg=</strong></span><span class="emphasis"><em><volume group name></em></span> </span></dt><dd> only activate the volume groups with the given name. rd.lvm.vg can be specified multiple times on the kernel command line. </dd><dt><span class="term"> <span class="strong"><strong>rd.lvm.lv=</strong></span><span class="emphasis"><em><logical volume name></em></span> </span></dt><dd> only activate the logical volumes with the given name. rd.lvm.lv can be specified multiple times on the kernel command line. </dd><dt><span class="term"> <span class="strong"><strong>rd.lvm.conf=0</strong></span> </span></dt><dd> remove any <span class="emphasis"><em>/etc/lvm/lvm.conf</em></span>, which may exist in the initramfs </dd></dl></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="_crypto_luks"></a>crypto LUKS</h3></div></div></div><div class="variablelist"><dl class="variablelist"><dt><span class="term"> <span class="strong"><strong>rd.luks=0</strong></span> </span></dt><dd> disable crypto LUKS detection </dd><dt><span class="term"> <span class="strong"><strong>rd.luks.uuid=</strong></span><span class="emphasis"><em><luks uuid></em></span> </span></dt><dd> only activate the LUKS partitions with the given UUID. Any "luks-" of the LUKS UUID is removed before comparing to <span class="emphasis"><em><luks uuid></em></span>. The comparisons also matches, if <span class="emphasis"><em><luks uuid></em></span> is only the beginning of the LUKS UUID, so you don’t have to specify the full UUID. This parameter can be specified multiple times. </dd><dt><span class="term"> <span class="strong"><strong>rd.luks.allow-discards=</strong></span><span class="emphasis"><em><luks uuid></em></span> </span></dt><dd> Allow using of discards (TRIM) requests for LUKS partitions with the given UUID. Any "luks-" of the LUKS UUID is removed before comparing to <span class="emphasis"><em><luks uuid></em></span>. The comparisons also matches, if <span class="emphasis"><em><luks uuid></em></span> is only the beginning of the LUKS UUID, so you don’t have to specify the full UUID. This parameter can be specified multiple times. </dd><dt><span class="term"> <span class="strong"><strong>rd.luks.allow-discards</strong></span> </span></dt><dd> Allow using of discards (TRIM) requests on all LUKS partitions. </dd><dt><span class="term"> <span class="strong"><strong>rd.luks.crypttab=0</strong></span> </span></dt><dd> do not check, if LUKS partition is in <span class="emphasis"><em>/etc/crypttab</em></span> </dd><dt><span class="term"> <span class="strong"><strong>rd.luks.timeout=</strong></span><span class="emphasis"><em><seconds></em></span> </span></dt><dd> specify how long dracut should wait when waiting for the user to enter the password. This avoid blocking the boot if no password is entered. It does not apply to luks key. The default is <span class="emphasis"><em>0</em></span>, which means <span class="emphasis"><em>forever</em></span>. </dd></dl></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="_crypto_luks_key_on_removable_device_support"></a>crypto LUKS - key on removable device support</h3></div></div></div><div class="variablelist"><dl class="variablelist"><dt><span class="term"> <span class="strong"><strong>rd.luks.key=</strong></span><span class="emphasis"><em><keypath></em></span>:<span class="emphasis"><em><keydev></em></span>:<span class="emphasis"><em><luksdev></em></span> </span></dt><dd><p class="simpara"> <span class="emphasis"><em>keypath</em></span> is a path to key file to look for. It’s REQUIRED. When <span class="emphasis"><em>keypath</em></span> ends with <span class="emphasis"><em>.gpg</em></span> it’s considered to be key encrypted symmetrically with GPG. You will be prompted for password on boot. GPG support comes with <span class="emphasis"><em>crypt-gpg</em></span> module which needs to be added explicitly. </p><p class="simpara"><span class="emphasis"><em>keydev</em></span> is a device on which key file resides. It might be kernel name of devices (should start with "/dev/"), UUID (prefixed with "UUID=") or label (prefix with "LABEL="). You don’t have to specify full UUID. Just its beginning will suffice, even if its ambiguous. All matching devices will be probed. This parameter is recommended, but not required. If not present, all block devices will be probed, which may significantly increase boot time.</p><p class="simpara">If <span class="emphasis"><em>luksdev</em></span> is given, the specified key will only be applied for that LUKS device. Possible values are the same as for <span class="emphasis"><em>keydev</em></span>. Unless you have several LUKS devices, you don’t have to specify this parameter. The simplest usage is:</p><p><strong>Example. </strong> </p><pre class="screen">rd.luks.key=/foo/bar.key</pre><p> </p><p class="simpara">As you see, you can skip colons in such a case.</p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>dracut pipes key to cryptsetup with <span class="emphasis"><em>-d -</em></span> argument, therefore you need to pipe to crypsetup luksFormat with <span class="emphasis"><em>-d -</em></span>, too!</p><p>Here follows example for key encrypted with GPG:</p><pre class="screen">gpg --quiet --decrypt rootkey.gpg | \ cryptsetup -d - -v --cipher serpent-cbc-essiv:sha256 \ --key-size 256 luksFormat /dev/sda3</pre><p>If you use plain keys, just add path to <span class="emphasis"><em>-d</em></span> option:</p><pre class="screen">cryptsetup -d rootkey.key -v --cipher serpent-cbc-essiv:sha256 \ --key-size 256 luksFormat /dev/sda3</pre></div></dd></dl></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="_md_raid"></a>MD RAID</h3></div></div></div><div class="variablelist"><dl class="variablelist"><dt><span class="term"> <span class="strong"><strong>rd.md=0</strong></span> </span></dt><dd> disable MD RAID detection </dd><dt><span class="term"> <span class="strong"><strong>rd.md.imsm=0</strong></span> </span></dt><dd> disable MD RAID for imsm/isw raids, use DM RAID instead </dd><dt><span class="term"> <span class="strong"><strong>rd.md.ddf=0</strong></span> </span></dt><dd> disable MD RAID for SNIA ddf raids, use DM RAID instead </dd><dt><span class="term"> <span class="strong"><strong>rd.md.conf=0</strong></span> </span></dt><dd> ignore mdadm.conf included in initramfs </dd><dt><span class="term"> <span class="strong"><strong>rd.md.waitclean=1</strong></span> </span></dt><dd> wait for any resync, recovery, or reshape activity to finish before continuing </dd><dt><span class="term"> <span class="strong"><strong>rd.md.uuid=</strong></span><span class="emphasis"><em><md raid uuid></em></span> </span></dt><dd> only activate the raid sets with the given UUID. This parameter can be specified multiple times. </dd></dl></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="_dm_raid"></a>DM RAID</h3></div></div></div><div class="variablelist"><dl class="variablelist"><dt><span class="term"> <span class="strong"><strong>rd.dm=0</strong></span> </span></dt><dd> disable DM RAID detection </dd><dt><span class="term"> <span class="strong"><strong>rd.dm.uuid=</strong></span><span class="emphasis"><em><dm raid uuid></em></span> </span></dt><dd> only activate the raid sets with the given UUID. This parameter can be specified multiple times. </dd></dl></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="_multipath"></a>MULTIPATH</h3></div></div></div><div class="variablelist"><dl class="variablelist"><dt><span class="term"> <span class="strong"><strong>rd.multipath=0</strong></span> </span></dt><dd> disable multipath detection </dd><dt><span class="term"> <span class="strong"><strong>rd.multipath=default</strong></span> </span></dt><dd> use default multipath settings </dd></dl></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="_fips"></a>FIPS</h3></div></div></div><div class="variablelist"><dl class="variablelist"><dt><span class="term"> <span class="strong"><strong>rd.fips</strong></span> </span></dt><dd> enable FIPS </dd><dt><span class="term"> <span class="strong"><strong>boot=</strong></span><span class="emphasis"><em><boot device></em></span> </span></dt><dd><p class="simpara"> specify the device, where /boot is located. </p><p><strong>Example. </strong> </p><pre class="screen">boot=/dev/sda1 boot=/dev/disk/by-path/pci-0000:00:1f.1-scsi-0:0:1:0-part1 boot=UUID=<uuid> boot=LABEL=<label></pre><p> </p></dd><dt><span class="term"> <span class="strong"><strong>rd.fips.skipkernel</strong></span> </span></dt><dd> skip checksum check of the kernel image. Useful, if the kernel image is not in a separate boot partition. </dd></dl></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="_network"></a>Network</h3></div></div></div><div class="important" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Important</h3><p>It is recommended to either bind an interface to a MAC with the <span class="strong"><strong>ifname</strong></span> argument, or to use the systemd-udevd predictable network interface names.</p><p>Predictable network interface device names based on:</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"> firmware/bios-provided index numbers for on-board devices </li><li class="listitem"> firmware-provided pci-express hotplug slot index number </li><li class="listitem"> physical/geographical location of the hardware </li><li class="listitem"> the interface’s MAC address </li></ul></div><p>See: <a class="ulink" href="http://www.freedesktop.org/wiki/Software/systemd/PredictableNetworkInterfaceNames" target="_top">http://www.freedesktop.org/wiki/Software/systemd/PredictableNetworkInterfaceNames</a></p><p>Two character prefixes based on the type of interface:</p><div class="variablelist"><dl class="variablelist"><dt><span class="term"> en </span></dt><dd> ethernet </dd><dt><span class="term"> wl </span></dt><dd> wlan </dd><dt><span class="term"> ww </span></dt><dd> wwan </dd></dl></div><p>Type of names:</p><div class="variablelist"><dl class="variablelist"><dt><span class="term"> o<index> </span></dt><dd> on-board device index number </dd><dt><span class="term"> s<slot>[f<function>][d<dev_id>] </span></dt><dd> hotplug slot index number </dd><dt><span class="term"> x<MAC> </span></dt><dd> MAC address </dd><dt><span class="term"> [P<domain>]p<bus>s<slot>[f<function>][d<dev_id>] </span></dt><dd> PCI geographical location </dd><dt><span class="term"> [P<domain>]p<bus>s<slot>[f<function>][u<port>][..][c<config>][i<interface>] </span></dt><dd> USB port number chain </dd></dl></div><p>All multi-function PCI devices will carry the [f<function>] number in the device name, including the function 0 device.</p><p>When using PCI geography, The PCI domain is only prepended when it is not 0.</p><p>For USB devices the full chain of port numbers of hubs is composed. If the name gets longer than the maximum number of 15 characters, the name is not exported. The usual USB configuration == 1 and interface == 0 values are suppressed.</p><div class="variablelist"><dl class="variablelist"><dt><span class="term"> PCI ethernet card with firmware index "1" </span></dt><dd><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"> eno1 </li></ul></div></dd><dt><span class="term"> PCI ethernet card in hotplug slot with firmware index number </span></dt><dd><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"> ens1 </li></ul></div></dd><dt><span class="term"> PCI ethernet multi-function card with 2 ports </span></dt><dd><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"> enp2s0f0 </li><li class="listitem"> enp2s0f1 </li></ul></div></dd><dt><span class="term"> PCI wlan card </span></dt><dd><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"> wlp3s0 </li></ul></div></dd><dt><span class="term"> USB built-in 3G modem </span></dt><dd><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"> wwp0s29u1u4i6 </li></ul></div></dd><dt><span class="term"> USB Android phone </span></dt><dd><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"> enp0s29u1u2 </li></ul></div></dd></dl></div></div><div class="variablelist"><dl class="variablelist"><dt><span class="term"> <span class="strong"><strong>ip=</strong></span><span class="emphasis"><em>{dhcp|on|any|dhcp6|auto6|either6}</em></span> </span></dt><dd><div class="variablelist"><dl class="variablelist"><dt><span class="term"> dhcp|on|any </span></dt><dd> get ip from dhcp server from all interfaces. If root=dhcp, loop sequentially through all interfaces (eth0, eth1, …) and use the first with a valid DHCP root-path. </dd><dt><span class="term"> auto6 </span></dt><dd> IPv6 autoconfiguration </dd><dt><span class="term"> dhcp6 </span></dt><dd> IPv6 DHCP </dd><dt><span class="term"> either6 </span></dt><dd> if auto6 fails, then dhcp6 </dd></dl></div></dd><dt><span class="term"> <span class="strong"><strong>ip=</strong></span><span class="emphasis"><em><interface></em></span>:<span class="emphasis"><em>{dhcp|on|any|dhcp6|auto6}</em></span>[:[<span class="emphasis"><em><mtu></em></span>][:<span class="emphasis"><em><macaddr></em></span>]] </span></dt><dd><p class="simpara"> This parameter can be specified multiple times. </p><div class="informalexample"><div class="variablelist"><dl class="variablelist"><dt><span class="term"> dhcp|on|any|dhcp6 </span></dt><dd> get ip from dhcp server on a specific interface </dd><dt><span class="term"> auto6 </span></dt><dd> do IPv6 autoconfiguration </dd><dt><span class="term"> <macaddr> </span></dt><dd> optionally <span class="strong"><strong>set</strong></span> <macaddr> on the <interface>. This cannot be used in conjunction with the <span class="strong"><strong>ifname</strong></span> argument for the same <interface>. </dd></dl></div></div></dd><dt><span class="term"> <span class="strong"><strong>ip=</strong></span><span class="emphasis"><em><client-IP></em></span>:[<span class="emphasis"><em><peer></em></span>]:<span class="emphasis"><em><gateway-IP></em></span>:<span class="emphasis"><em><netmask></em></span>:<span class="emphasis"><em><client_hostname></em></span>:<span class="emphasis"><em><interface></em></span>:<span class="emphasis"><em>{none|off|dhcp|on|any|dhcp6|auto6|ibft}</em></span>[:[<span class="emphasis"><em><mtu></em></span>][:<span class="emphasis"><em><macaddr></em></span>]] </span></dt><dd><p class="simpara"> explicit network configuration. If you want do define a IPv6 address, put it in brackets (e.g. [2001:DB8::1]). This parameter can be specified multiple times. <span class="emphasis"><em><peer></em></span> is optional and is the address of the remote endpoint for pointopoint interfaces and it may be followed by a slash and a decimal number, encoding the network prefix length. </p><div class="informalexample"><div class="variablelist"><dl class="variablelist"><dt><span class="term"> <macaddr> </span></dt><dd> optionally <span class="strong"><strong>set</strong></span> <macaddr> on the <interface>. This cannot be used in conjunction with the <span class="strong"><strong>ifname</strong></span> argument for the same <interface>. </dd></dl></div></div></dd><dt><span class="term"> <span class="strong"><strong>ip=</strong></span><span class="emphasis"><em><client-IP></em></span>:[<span class="emphasis"><em><peer></em></span>]:<span class="emphasis"><em><gateway-IP></em></span>:<span class="emphasis"><em><netmask></em></span>:<span class="emphasis"><em><client_hostname></em></span>:<span class="emphasis"><em><interface></em></span>:<span class="emphasis"><em>{none|off|dhcp|on|any|dhcp6|auto6|ibft}</em></span>[:[<span class="emphasis"><em><dns1></em></span>][:<span class="emphasis"><em><dns2></em></span>]] </span></dt><dd> explicit network configuration. If you want do define a IPv6 address, put it in brackets (e.g. [2001:DB8::1]). This parameter can be specified multiple times. <span class="emphasis"><em><peer></em></span> is optional and is the address of the remote endpoint for pointopoint interfaces and it may be followed by a slash and a decimal number, encoding the network prefix length. </dd><dt><span class="term"> <span class="strong"><strong>ifname=</strong></span><span class="emphasis"><em><interface></em></span>:<span class="emphasis"><em><MAC></em></span> </span></dt><dd><p class="simpara"> Assign network device name <interface> (ie "bootnet") to the NIC with MAC <MAC>. </p><div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Warning</h3><p>Do <span class="strong"><strong>not</strong></span> use the default kernel naming scheme for the interface name, as it can conflict with the kernel names. So, don’t use "eth[0-9]+" for the interface name. Better name it "bootnet" or "bluesocket".</p></div></dd><dt><span class="term"> <span class="strong"><strong>rd.route=</strong></span><span class="emphasis"><em><net></em></span>/<span class="emphasis"><em><netmask></em></span>:<span class="emphasis"><em><gateway></em></span>[:<span class="emphasis"><em><interface></em></span>] </span></dt><dd><p class="simpara"> Add a static route with route options, which are separated by a colon. IPv6 addresses have to be put in brackets. </p><p><strong>Example. </strong> </p><pre class="screen"> rd.route=192.168.200.0/24:192.168.100.222:ens10 rd.route=192.168.200.0/24:192.168.100.222 rd.route=192.168.200.0/24::ens10 rd.route=[2001:DB8:3::/8]:[2001:DB8:2::1]:ens10</pre><p> </p></dd><dt><span class="term"> <span class="strong"><strong>bootdev=</strong></span><span class="emphasis"><em><interface></em></span> </span></dt><dd> specify network interface to use routing and netroot information from. Required if multiple ip= lines are used. </dd><dt><span class="term"> <span class="strong"><strong>BOOTIF=</strong></span><span class="emphasis"><em><MAC></em></span> </span></dt><dd> specify network interface to use routing and netroot information from. </dd><dt><span class="term"> <span class="strong"><strong>rd.bootif=0</strong></span> </span></dt><dd> Disable BOOTIF parsing, which is provided by PXE </dd><dt><span class="term"> <span class="strong"><strong>nameserver=</strong></span><span class="emphasis"><em><IP></em></span> [<span class="strong"><strong>nameserver=</strong></span><span class="emphasis"><em><IP></em></span> …] </span></dt><dd> specify nameserver(s) to use </dd><dt><span class="term"> <span class="strong"><strong>rd.peerdns=0</strong></span> </span></dt><dd> Disable DNS setting of DHCP parameters. </dd><dt><span class="term"> <span class="strong"><strong>biosdevname=0</strong></span> </span></dt><dd> boolean, turn off biosdevname network interface renaming </dd><dt><span class="term"> <span class="strong"><strong>rd.neednet=1</strong></span> </span></dt><dd> boolean, bring up network even without netroot set </dd><dt><span class="term"> <span class="strong"><strong>vlan=</strong></span><span class="emphasis"><em><vlanname></em></span>:<span class="emphasis"><em><phydevice></em></span> </span></dt><dd> Setup vlan device named <vlanname> on <phydeivce>. We support the four styles of vlan names: VLAN_PLUS_VID (vlan0005), VLAN_PLUS_VID_NO_PAD (vlan5), DEV_PLUS_VID (eth0.0005), DEV_PLUS_VID_NO_PAD (eth0.5) </dd><dt><span class="term"> <span class="strong"><strong>bond=</strong></span><span class="emphasis"><em><bondname></em></span>[:<span class="emphasis"><em><bondslaves></em></span>:[:<span class="emphasis"><em><options></em></span>[:<mtu>]]] </span></dt><dd> Setup bonding device <bondname> on top of <bondslaves>. <bondslaves> is a comma-separated list of physical (ethernet) interfaces. <options> is a comma-separated list on bonding options (modinfo bonding for details) in format compatible with initscripts. If <options> includes multi-valued arp_ip_target option, then its values should be separated by semicolon. if the mtu is specified, it will be set on the bond master. Bond without parameters assumes bond=bond0:eth0,eth1:mode=balance-rr </dd><dt><span class="term"> <span class="strong"><strong>team=</strong></span><span class="emphasis"><em><teammaster></em></span>:<span class="emphasis"><em><teamslaves></em></span>[:<span class="emphasis"><em><teamrunner></em></span>] </span></dt><dd> Setup team device <teammaster> on top of <teamslaves>. <teamslaves> is a comma-separated list of physical (ethernet) interfaces. <teamrunner> is the runner type to be used (see <span class="strong"><strong>teamd.conf</strong></span>(5)); defaults to activebackup. Team without parameters assumes team=team0:eth0,eth1:activebackup </dd><dt><span class="term"> <span class="strong"><strong>bridge=</strong></span><span class="emphasis"><em><bridgename></em></span>:<span class="emphasis"><em><ethnames></em></span> </span></dt><dd> Setup bridge <bridgename> with <ethnames>. <ethnames> is a comma-separated list of physical (ethernet) interfaces. Bridge without parameters assumes bridge=br0:eth0 </dd></dl></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="_nfs"></a>NFS</h3></div></div></div><div class="variablelist"><dl class="variablelist"><dt><span class="term"> <span class="strong"><strong>root=</strong></span>[<span class="emphasis"><em><server-ip></em></span>:]<span class="emphasis"><em><root-dir></em></span>[:<span class="emphasis"><em><nfs-options></em></span>] </span></dt><dd> mount nfs share from <server-ip>:/<root-dir>, if no server-ip is given, use dhcp next_server. If server-ip is an IPv6 address it has to be put in brackets, e.g. [2001:DB8::1]. NFS options can be appended with the prefix ":" or "," and are separated by ",". </dd><dt><span class="term"> <span class="strong"><strong>root=</strong></span>nfs:[<span class="emphasis"><em><server-ip></em></span>:]<span class="emphasis"><em><root-dir></em></span>[:<span class="emphasis"><em><nfs-options></em></span>], <span class="strong"><strong>root=</strong></span>nfs4:[<span class="emphasis"><em><server-ip></em></span>:]<span class="emphasis"><em><root-dir></em></span>[:<span class="emphasis"><em><nfs-options></em></span>], <span class="strong"><strong>root=</strong></span><span class="emphasis"><em>{dhcp|dhcp6}</em></span> </span></dt><dd><p class="simpara"> root=dhcp alone directs initrd to look at the DHCP root-path where NFS options can be specified. </p><p><strong>Example. </strong> </p><pre class="screen"> root-path=<server-ip>:<root-dir>[,<nfs-options>] root-path=nfs:<server-ip>:<root-dir>[,<nfs-options>] root-path=nfs4:<server-ip>:<root-dir>[,<nfs-options>]</pre><p> </p></dd><dt><span class="term"> <span class="strong"><strong>root=</strong></span><span class="emphasis"><em>/dev/nfs</em></span> nfsroot=[<span class="emphasis"><em><server-ip></em></span>:]<span class="emphasis"><em><root-dir></em></span>[:<span class="emphasis"><em><nfs-options></em></span>] </span></dt><dd> <span class="emphasis"><em>Deprecated!</em></span> kernel Documentation_/filesystems/nfsroot.txt_ defines this method. This is supported by dracut, but not recommended. </dd><dt><span class="term"> <span class="strong"><strong>rd.nfs.domain=</strong></span><span class="emphasis"><em><NFSv4 domain name></em></span> </span></dt><dd> Set the NFSv4 domain name. Will override the settings in <span class="emphasis"><em>/etc/idmap.conf</em></span>. </dd><dt><span class="term"> <span class="strong"><strong>rd.net.dhcp.retry=</strong></span><span class="emphasis"><em><cnt></em></span> </span></dt><dd> If this option is set, dracut will try to connect via dhcp <cnt> times before failing. Default is 1. </dd><dt><span class="term"> <span class="strong"><strong>rd.net.timeout.dhcp=</strong></span><span class="emphasis"><em><arg></em></span> </span></dt><dd> If this option is set, dhclient is called with "-timeout <arg>". </dd><dt><span class="term"> <span class="strong"><strong>rd.net.timeout.iflink=</strong></span><span class="emphasis"><em><seconds></em></span> </span></dt><dd> Wait <seconds> until link shows up. Default is 60 seconds. </dd><dt><span class="term"> <span class="strong"><strong>rd.net.timeout.ifup=</strong></span><span class="emphasis"><em><seconds></em></span> </span></dt><dd> Wait <seconds> until link has state "UP". Default is 20 seconds. </dd><dt><span class="term"> <span class="strong"><strong>rd.net.timeout.route=</strong></span><span class="emphasis"><em><seconds></em></span> </span></dt><dd> Wait <seconds> until route shows up. Default is 20 seconds. </dd><dt><span class="term"> <span class="strong"><strong>rd.net.timeout.ipv6dad=</strong></span><span class="emphasis"><em><seconds></em></span> </span></dt><dd> Wait <seconds> until IPv6 DAD is finished. Default is 50 seconds. </dd><dt><span class="term"> <span class="strong"><strong>rd.net.timeout.ipv6auto=</strong></span><span class="emphasis"><em><seconds></em></span> </span></dt><dd> Wait <seconds> until IPv6 automatic addresses are assigned. Default is 40 seconds. </dd><dt><span class="term"> <span class="strong"><strong>rd.net.timeout.carrier=</strong></span><span class="emphasis"><em><seconds></em></span> </span></dt><dd> Wait <seconds> until carrier is recognized. Default is 10 seconds. </dd></dl></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="_cifs"></a>CIFS</h3></div></div></div><div class="variablelist"><dl class="variablelist"><dt><span class="term"> <span class="strong"><strong>root=</strong></span>cifs://[<span class="emphasis"><em><username></em></span>[:<span class="emphasis"><em><password></em></span>]@]<span class="emphasis"><em><server-ip></em></span>:<span class="emphasis"><em><root-dir></em></span> </span></dt><dd><p class="simpara"> mount cifs share from <server-ip>:/<root-dir>, if no server-ip is given, use dhcp next_server. if server-ip is an IPv6 address it has to be put in brackets, e.g. [2001:DB8::1]. If a username or password are not specified as part of the root, then they must be passed on the command line through cifsuser/cifspass. </p><div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Warning</h3><p>Passwords specified on the kernel command line are visible for all users via the file <span class="emphasis"><em>/proc/cmdline</em></span> and via dmesg or can be sniffed on the network, when using DHCP with DHCP root-path.</p></div></dd><dt><span class="term"> <span class="strong"><strong>cifsuser</strong></span>=<span class="emphasis"><em><username></em></span> </span></dt><dd> Set the cifs username, if not specified as part of the root. </dd><dt><span class="term"> <span class="strong"><strong>cifspass</strong></span>=<span class="emphasis"><em><password></em></span> </span></dt><dd><p class="simpara"> Set the cifs password, if not specified as part of the root. </p><div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Warning</h3><p>Passwords specified on the kernel command line are visible for all users via the file <span class="emphasis"><em>/proc/cmdline</em></span> and via dmesg or can be sniffed on the network, when using DHCP with DHCP root-path.</p></div></dd></dl></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="_iscsi"></a>iSCSI</h3></div></div></div><div class="variablelist"><dl class="variablelist"><dt><span class="term"> <span class="strong"><strong>root=</strong></span>iscsi:[<span class="emphasis"><em><username></em></span>:<span class="emphasis"><em><password></em></span>[:<span class="emphasis"><em><reverse></em></span>:<span class="emphasis"><em><password></em></span>]@][<span class="emphasis"><em><servername></em></span>]:[<span class="emphasis"><em><protocol></em></span>]:[<span class="emphasis"><em><port></em></span>][:[<span class="emphasis"><em><iscsi_iface_name></em></span>]:[<span class="emphasis"><em><netdev_name></em></span>]]:[<span class="emphasis"><em><LUN></em></span>]:<span class="emphasis"><em><targetname></em></span> </span></dt><dd><p class="simpara"> protocol defaults to "6", LUN defaults to "0". If the "servername" field is provided by BOOTP or DHCP, then that field is used in conjunction with other associated fields to contact the boot server in the Boot stage. However, if the "servername" field is not provided, then the "targetname" field is then used in the Discovery Service stage in conjunction with other associated fields. See <a class="ulink" href="http://tools.ietf.org/html/rfc4173#section-5" target="_top">rfc4173</a>. </p><div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Warning</h3><p>Passwords specified on the kernel command line are visible for all users via the file <span class="emphasis"><em>/proc/cmdline</em></span> and via dmesg or can be sniffed on the network, when using DHCP with DHCP root-path.</p></div><p><strong>Example. </strong> </p><pre class="screen">root=iscsi:192.168.50.1::::iqn.2009-06.dracut:target0</pre><p> </p><p class="simpara">If servername is an IPv6 address, it has to be put in brackets:</p><p><strong>Example. </strong> </p><pre class="screen">root=iscsi:[2001:DB8::1]::::iqn.2009-06.dracut:target0</pre><p> </p></dd><dt><span class="term"> <span class="strong"><strong>root=</strong></span><span class="emphasis"><em>???</em></span> <span class="strong"><strong>netroot=</strong></span>iscsi:[<span class="emphasis"><em><username></em></span>:<span class="emphasis"><em><password></em></span>[:<span class="emphasis"><em><reverse></em></span>:<span class="emphasis"><em><password></em></span>]@][<span class="emphasis"><em><servername></em></span>]:[<span class="emphasis"><em><protocol></em></span>]:[<span class="emphasis"><em><port></em></span>][:[<span class="emphasis"><em><iscsi_iface_name></em></span>]:[<span class="emphasis"><em><netdev_name></em></span>]]:[<span class="emphasis"><em><LUN></em></span>]:<span class="emphasis"><em><targetname></em></span> … </span></dt><dd><p class="simpara"> multiple netroot options allow setting up multiple iscsi disks: </p><p><strong>Example. </strong> </p><pre class="screen">root=UUID=12424547 netroot=iscsi:192.168.50.1::::iqn.2009-06.dracut:target0 netroot=iscsi:192.168.50.1::::iqn.2009-06.dracut:target1</pre><p> </p><p class="simpara">If servername is an IPv6 address, it has to be put in brackets:</p><p><strong>Example. </strong> </p><pre class="screen">netroot=iscsi:[2001:DB8::1]::::iqn.2009-06.dracut:target0</pre><p> </p><div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Warning</h3><p>Passwords specified on the kernel command line are visible for all users via the file <span class="emphasis"><em>/proc/cmdline</em></span> and via dmesg or can be sniffed on the network, when using DHCP with DHCP root-path. You may want to use rd.iscsi.firmware.</p></div></dd><dt><span class="term"> <span class="strong"><strong>root=</strong></span><span class="emphasis"><em>???</em></span> <span class="strong"><strong>rd.iscsi.initiator=</strong></span><span class="emphasis"><em><initiator></em></span> <span class="strong"><strong>rd.iscsi.target.name=</strong></span><span class="emphasis"><em><target name></em></span> <span class="strong"><strong>rd.iscsi.target.ip=</strong></span><span class="emphasis"><em><target ip></em></span> <span class="strong"><strong>rd.iscsi.target.port=</strong></span><span class="emphasis"><em><target port></em></span> <span class="strong"><strong>rd.iscsi.target.group=</strong></span><span class="emphasis"><em><target group></em></span> <span class="strong"><strong>rd.iscsi.username=</strong></span><span class="emphasis"><em><username></em></span> <span class="strong"><strong>rd.iscsi.password=</strong></span><span class="emphasis"><em><password></em></span> <span class="strong"><strong>rd.iscsi.in.username=</strong></span><span class="emphasis"><em><in username></em></span> <span class="strong"><strong>rd.iscsi.in.password=</strong></span><span class="emphasis"><em><in password></em></span> </span></dt><dd><p class="simpara"> manually specify all iscsistart parameter (see <span class="strong"><strong><code class="literal">iscsistart --help</code></strong></span>) </p><div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Warning</h3><p>Passwords specified on the kernel command line are visible for all users via the file <span class="emphasis"><em>/proc/cmdline</em></span> and via dmesg or can be sniffed on the network, when using DHCP with DHCP root-path. You may want to use rd.iscsi.firmware.</p></div></dd><dt><span class="term"> <span class="strong"><strong>root=</strong></span><span class="emphasis"><em>???</em></span> <span class="strong"><strong>netroot=</strong></span>iscsi <span class="strong"><strong>rd.iscsi.firmware=1</strong></span> </span></dt><dd> will read the iscsi parameter from the BIOS firmware </dd><dt><span class="term"> <span class="strong"><strong>rd.iscsi.login_retry_max=</strong></span><span class="emphasis"><em><num></em></span> </span></dt><dd> maximum number of login retries </dd><dt><span class="term"> <span class="strong"><strong>rd.iscsi.param=</strong></span><span class="emphasis"><em><param></em></span> </span></dt><dd><p class="simpara"> <param> will be passed as "--param <param>" to iscsistart. This parameter can be specified multiple times. </p><p><strong>Example. </strong> </p><pre class="screen">"netroot=iscsi rd.iscsi.firmware=1 rd.iscsi.param=node.session.timeo.replacement_timeout=30"</pre><p> </p><p class="simpara">will result in</p><pre class="screen">iscsistart -b --param node.session.timeo.replacement_timeout=30</pre></dd></dl></div><p><span class="strong"><strong>rd.iscsi.ibft</strong></span> <span class="strong"><strong>rd.iscsi.ibft=1</strong></span>: Turn on iBFT autoconfiguration for the interfaces</p><p><span class="strong"><strong>rd.iscsi.mp</strong></span> <span class="strong"><strong>rd.iscsi.mp=1</strong></span>: Configure all iBFT interfaces, not only used for booting (multipath)</p><p><span class="strong"><strong>rd.iscsi.waitnet=0</strong></span>: Turn off waiting for all interfaces to be up before trying to login to the iSCSI targets.</p><p><span class="strong"><strong>rd.iscsi.testroute=0</strong></span>: Turn off checking, if the route to the iSCSI target IP is possible before trying to login.</p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="_fcoe"></a>FCoE</h3></div></div></div><div class="variablelist"><dl class="variablelist"><dt><span class="term"> <span class="strong"><strong>rd.fcoe=0</strong></span> </span></dt><dd> disable FCoE and lldpad </dd><dt><span class="term"> <span class="strong"><strong>fcoe=</strong></span><span class="emphasis"><em><edd|interface|MAC></em></span>:<span class="emphasis"><em>{dcb|nodcb}</em></span>:<span class="emphasis"><em>{fabric|vn2vn}</em></span> </span></dt><dd><p class="simpara"> Try to connect to a FCoE SAN through the NIC specified by <span class="emphasis"><em><interface></em></span> or <span class="emphasis"><em><MAC></em></span> or EDD settings. The second argument specifies if DCB should be used. The optional third argument specifies whether fabric or VN2VN mode should be used. This parameter can be specified multiple times. </p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>letters in the MAC-address must be lowercase!</p></div></dd></dl></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="_nbd"></a>NBD</h3></div></div></div><div class="variablelist"><dl class="variablelist"><dt><span class="term"> <span class="strong"><strong>root=</strong></span>??? <span class="strong"><strong>netroot=</strong></span>nbd:<span class="emphasis"><em><server></em></span>:<span class="emphasis"><em><port/exportname></em></span>[:<span class="emphasis"><em><fstype></em></span>[:<span class="emphasis"><em><mountopts></em></span>[:<span class="emphasis"><em><nbdopts></em></span>]]] </span></dt><dd><p class="simpara"> mount nbd share from <server>. </p><p class="simpara">NOTE: If "exportname" instead of "port" is given the standard port is used. Newer versions of nbd are only supported with "exportname".</p></dd><dt><span class="term"> <span class="strong"><strong>root=dhcp</strong></span> with <span class="strong"><strong>dhcp</strong></span> <span class="strong"><strong>root-path=</strong></span>nbd:<span class="emphasis"><em><server></em></span>:<span class="emphasis"><em><port/exportname></em></span>[:<span class="emphasis"><em><fstype></em></span>[:<span class="emphasis"><em><mountopts></em></span>[:<span class="emphasis"><em><nbdopts></em></span>]]] </span></dt><dd><p class="simpara"> root=dhcp alone directs initrd to look at the DHCP root-path where NBD options can be specified. This syntax is only usable in cases where you are directly mounting the volume as the rootfs. </p><p class="simpara">NOTE: If "exportname" instead of "port" is given the standard port is used. Newer versions of nbd are only supported with "exportname".</p></dd></dl></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="_dasd"></a>DASD</h3></div></div></div><div class="variablelist"><dl class="variablelist"><dt><span class="term"> <span class="strong"><strong>rd.dasd=</strong></span>…. </span></dt><dd> same syntax as the kernel module parameter (s390 only) </dd></dl></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="_zfcp"></a>ZFCP</h3></div></div></div><div class="variablelist"><dl class="variablelist"><dt><span class="term"> <span class="strong"><strong>rd.zfcp=</strong></span><span class="emphasis"><em><zfcp adaptor device bus ID></em></span>,<span class="emphasis"><em><WWPN></em></span>,<span class="emphasis"><em><FCPLUN></em></span> </span></dt><dd> rd.zfcp can be specified multiple times on the kernel command line. </dd><dt><span class="term"> <span class="strong"><strong>rd.zfcp=</strong></span><span class="emphasis"><em><zfcp adaptor device bus ID></em></span> </span></dt><dd><p class="simpara"> If NPIV is enabled and the <span class="emphasis"><em>allow_lun_scan</em></span> parameter to the zfcp module is set to <span class="emphasis"><em>Y</em></span> then the zfcp adaptor will be initiating a scan internally and the <WWPN> and <FCPLUN> parameters can be omitted. </p><p><strong>Example. </strong> </p><pre class="screen">rd.zfcp=0.0.4000,0x5005076300C213e9,0x5022000000000000 rd.zfcp=0.0.4000</pre><p> </p></dd><dt><span class="term"> <span class="strong"><strong>rd.zfcp.conf=0</strong></span> </span></dt><dd> ignore zfcp.conf included in the initramfs </dd></dl></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="_znet"></a>ZNET</h3></div></div></div><div class="variablelist"><dl class="variablelist"><dt><span class="term"> <span class="strong"><strong>rd.znet=</strong></span><span class="emphasis"><em><nettype></em></span>,<span class="emphasis"><em><subchannels></em></span>,<span class="emphasis"><em><options></em></span> </span></dt><dd> The whole parameter is appended to /etc/ccw.conf, which is used on RHEL/Fedora with ccw_init, which is called from udev for certain devices on z-series. rd.znet can be specified multiple times on the kernel command line. </dd><dt><span class="term"> <span class="strong"><strong>rd.znet_ifname=</strong></span><span class="emphasis"><em><ifname></em></span>:<span class="emphasis"><em><subchannels></em></span> </span></dt><dd><p class="simpara"> Assign network device name <interface> (i.e. "bootnet") to the NIC corresponds to the subchannels. This is useful when dracut’s default "ifname=" doesn’t work due to device having a changing MAC address. </p><p><strong>Example. </strong> </p><pre class="screen">rd.znet=qeth,0.0.0600,0.0.0601,0.0.0602,layer2=1,portname=foo rd.znet=ctc,0.0.0600,0.0.0601,protocol=bar</pre><p> </p></dd></dl></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="_booting_live_images"></a>Booting live images</h3></div></div></div><p>Dracut offers multiple options for live booted images:</p><div class="informalexample"><div class="variablelist"><dl class="variablelist"><dt><span class="term"> SquashFS with read-only filesystem image </span></dt><dd><p class="simpara"> The system will boot with a read-only filesystem from the SquashFS and apply a writable Device-mapper snapshot or an OverlayFS overlay mount for the read-only base filesystem. This method ensures a relatively fast boot and lower RAM usage. Users <span class="strong"><strong>must be careful</strong></span> to avoid writing too many blocks to a snapshot volume. Once the blocks of the snapshot overlay are exhausted, the root filesystem becomes read-only and may cause application failures. The snapshot overlay file is marked <span class="emphasis"><em>Overflow</em></span>, and a difficult recovery is required to repair and enlarge the overlay offline. Non-persistent overlays are sparse files in RAM that only consume content space as required blocks are allocated. They default to an apparent size of 32 GiB in RAM. The size can be adjusted with the <span class="strong"><strong>rd.live.overlay.size=</strong></span> kernel command line option. </p><p class="simpara">The filesystem structure is traditionally expected to be:</p><pre class="screen">squashfs.img | SquashFS from LiveCD .iso !(mount) /LiveOS |- rootfs.img | Filesystem image to mount read-only !(mount) /bin | Live filesystem /boot | /dev | ... |</pre><p class="simpara">For OverlayFS mount overlays, the filesystem structure may also be a direct compression of the root filesystem:</p><pre class="screen">squashfs.img | SquashFS from LiveCD .iso !(mount) /bin | Live filesystem /boot | /dev | ... |</pre><p class="simpara">Dracut uses one of the overlay methods of live booting by default. No additional command line options are required other than <span class="strong"><strong>root=live:<URL></strong></span> to specify the location of your squashed filesystem.</p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"> The compressed SquashFS image can be copied during boot to RAM at <code class="literal">/run/initramfs/squashed.img</code> by using the <span class="strong"><strong>rd.live.ram=1</strong></span> option. </li><li class="listitem"> A device with a persistent overlay can be booted read-only by using the <span class="strong"><strong>rd.live.overlay.readonly</strong></span> option on the kernel command line. This will either cause a temporary, writable overlay to be stacked over a read-only snapshot of the root filesystem or the OverlayFS mount will use an additional lower layer with the root filesystem. </li></ul></div></dd><dt><span class="term"> Uncompressed live filesystem image </span></dt><dd><p class="simpara"> When the live system was installed with the <span class="emphasis"><em>--skipcompress</em></span> option of the <span class="emphasis"><em>livecd-iso-to-disk</em></span> installation script for Live USB devices, the root filesystem image, <span class="emphasis"><em>rootfs.img</em></span>, is expanded on installation and no SquashFS is involved during boot. </p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"> If <span class="strong"><strong>rd.live.ram=1</strong></span> is used in this situation, the full, uncompressed root filesystem is copied during boot to <code class="literal">/run/initramfs/rootfs.img</code> in the <code class="literal">/run</code> tmpfs. </li><li class="listitem"> If <span class="strong"><strong>rd.live.overlay=none</strong></span> is provided as a kernel command line option, a writable, linear Device-mapper target is created on boot with no overlay. </li></ul></div></dd><dt><span class="term"> Writable filesystem image </span></dt><dd><p class="simpara"> The system will retrieve a compressed filesystem image, extract it to <code class="literal">/run/initramfs/fsimg/rootfs.img</code>, connect it to a loop device, create a writable, linear Device-mapper target at <code class="literal">/dev/mapper/live-rw</code>, and mount that as a writable volume at <code class="literal">/</code>. More RAM is required during boot but the live filesystem is easier to manage if it becomes full. Users can make a filesystem image of any size and that size will be maintained when the system boots. There is no persistence of root filesystem changes between boots with this option. </p><p class="simpara">The filesystem structure is expected to be:</p><pre class="screen">rootfs.tgz | Compressed tarball containing filesystem image !(unpack) /rootfs.img | Filesystem image at /run/initramfs/fsimg/ !(mount) /bin | Live filesystem /boot | /dev | ... |</pre><p class="simpara">To use this boot option, ensure that <span class="strong"><strong>rd.writable.fsimg=1</strong></span> is in your kernel command line and add the <span class="strong"><strong>root=live:<URL></strong></span> to specify the location of your compressed filesystem image tarball or SquashFS image.</p></dd></dl></div></div><div class="variablelist"><dl class="variablelist"><dt><span class="term"> <span class="strong"><strong>rd.writable.fsimg=</strong></span>1 </span></dt><dd><p class="simpara"> Enables writable filesystem support. The system will boot with a fully writable (but non-persistent) filesystem without snapshots <span class="emphasis"><em>(see notes above about available live boot options)</em></span>. You can use the <span class="strong"><strong>rootflags</strong></span> option to set mount options for the live filesystem as well <span class="emphasis"><em>(see documentation about rootflags in the <span class="strong"><strong>Standard</strong></span> section above)</em></span>. This implies that the whole image is copied to RAM before the boot continues. </p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>There must be enough free RAM available to hold the complete image.</p></div><p class="simpara">This method is very suitable for diskless boots.</p></dd><dt><span class="term"> <span class="strong"><strong>root=</strong></span>live:<span class="emphasis"><em><url></em></span> </span></dt><dd><p class="simpara"> Boots a live image retrieved from <span class="emphasis"><em><url></em></span>. Requires the dracut <span class="emphasis"><em>livenet</em></span> module. Valid handlers: <span class="emphasis"><em>http, https, ftp, torrent, tftp</em></span>. </p><p><strong>Examples. </strong> </p><pre class="screen">root=live:http://example.com/liveboot.img root=live:ftp://ftp.example.com/liveboot.img root=live:torrent://example.com/liveboot.img.torrent</pre><p> </p></dd><dt><span class="term"> <span class="strong"><strong>rd.live.debug=</strong></span>1 </span></dt><dd> Enables debug output from the live boot process. </dd><dt><span class="term"> <span class="strong"><strong>rd.live.dir=</strong></span><span class="emphasis"><em><path></em></span> </span></dt><dd> Specifies the directory within the boot device where the squashfs.img or rootfs.img can be found. By default, this is <code class="literal">/LiveOS</code>. </dd><dt><span class="term"> <span class="strong"><strong>rd.live.squashimg=</strong></span><span class="emphasis"><em><filename of SquashFS image></em></span> </span></dt><dd> Specifies the filename for a SquashFS image of the root filesystem. By default, this is <span class="emphasis"><em>squashfs.img</em></span>. </dd><dt><span class="term"> <span class="strong"><strong>rd.live.ram=</strong></span>1 </span></dt><dd> Copy the complete image to RAM and use this for booting. This is useful when the image resides on, e.g., a DVD which needs to be ejected later on. </dd><dt><span class="term"> <span class="strong"><strong>rd.live.overlay={</strong></span><span class="emphasis"><em><devspec></em></span>[:<span class="emphasis"><em>{<pathspec>|auto}</em></span>]|<span class="emphasis"><em>none</em></span>} </span></dt><dd><p class="simpara"> Manage the usage of a permanent overlay. </p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"> <span class="emphasis"><em><devspec></em></span> specifies the path to a device with a mountable filesystem. </li><li class="listitem"><p class="simpara"> <span class="emphasis"><em><pathspec></em></span> is the path to a file within that filesystem, which shall be used to persist the changes made to the device specified by the <span class="strong"><strong>root=live:<span class="emphasis"><em><url></em></span></strong></span> option. </p><p class="simpara">The default <span class="emphasis"><em>pathspec</em></span>, when <span class="emphasis"><em>auto</em></span> or no <span class="emphasis"><em>:<pathspec></em></span> is given, is <code class="literal">/<<span style="color: red"><b>rd.live.dir</b></span>>/overlay-<label>-<uuid></code>, where <span class="emphasis"><em><label></em></span> is the device LABEL, and <span class="emphasis"><em><uuid></em></span> is the device UUID. * <span class="emphasis"><em>none</em></span> (the word itself) specifies that no overlay will be used, such as when an uncompressed, writable live root filesystem is available.</p><p class="simpara">If a persistent overlay <span class="emphasis"><em>is detected</em></span> at the standard LiveOS path, the overlay & overlay type detected, whether Device-mapper or OverlayFS, will be used.</p></li></ul></div><p><strong>Examples. </strong> </p><pre class="screen">rd.live.overlay=/dev/sdb1:persistent-overlay.img rd.live.overlay=UUID=99440c1f-8daa-41bf-b965-b7240a8996f4</pre><p> </p></dd><dt><span class="term"> <span class="strong"><strong>rd.live.overlay.size=</strong></span><span class="emphasis"><em><size_MiB></em></span> </span></dt><dd> Specifies a non-persistent Device-mapper overlay size in MiB. The default is <span class="emphasis"><em>32768</em></span>. </dd><dt><span class="term"> <span class="strong"><strong>rd.live.overlay.readonly=</strong></span>1 </span></dt><dd> This is used to boot with a normally read-write persistent overlay in a read-only mode. With this option, either an additional, non-persistent, writable snapshot overlay will be stacked over a read-only snapshot, <code class="literal">/dev/mapper/live‑ro</code>, of the base filesystem with the persistent overlay, or a read-only loop device, in the case of a writable <span class="emphasis"><em>rootfs.img</em></span>, or an OverlayFS mount will use the persistent overlay directory linked at <code class="literal">/run/overlayfs‑r</code> as an additional lower layer along with the base root filesystem and apply a transient, writable upper directory overlay, in order to complete the booted root filesystem. </dd><dt><span class="term"> <span class="strong"><strong>rd.live.overlay.reset=</strong></span>1 </span></dt><dd> Specifies that a persistent overlay should be reset on boot. All previous root filesystem changes are vacated by this action. </dd><dt><span class="term"> <span class="strong"><strong>rd.live.overlay.thin=</strong></span>1 </span></dt><dd> Enables the usage of thin snapshots instead of classic dm snapshots. The advantage of thin snapshots is that they support discards, and will free blocks that are not claimed by the filesystem. In this use case, this means that memory is given back to the kernel when the filesystem does not claim it anymore. </dd><dt><span class="term"> <span class="strong"><strong>rd.live.overlay.overlayfs=</strong></span>1 </span></dt><dd><p class="simpara"> Enables the use of the <span class="strong"><strong>OverlayFS</strong></span> kernel module, if available, to provide a copy-on-write union directory for the root filesystem. OverlayFS overlays are directories of the files that have changed on the read-only base (lower) filesystem. The root filesystem is provided through a special overlay type mount that merges the lower and upper directories. If an OverlayFS upper directory is not present on the boot device, a tmpfs directory will be created at <code class="literal">/run/overlayfs</code> to provide temporary storage. Persistent storage can be provided on vfat or msdos formatted devices by supplying the OverlayFS upper directory within an embedded filesystem that supports the creation of trusted.* extended attributes and provides a valid d_type in readdir responses, such as with ext4 and xfs. On non-vfat-formatted devices, a persistent OverlayFS overlay can extend the available root filesystem storage up to the capacity of the LiveOS disk device. </p><p class="simpara">If a persistent overlay is detected at the standard LiveOS path, the overlay & overlay type detected, whether OverlayFS or Device-mapper, will be used.</p><p class="simpara">The <span class="strong"><strong>rd.live.overlay.readonly</strong></span> option, which allows a persistent overlayfs to be mounted read-only through a higher level transient overlay directory, has been implemented through the multiple lower layers feature of OverlayFS.</p></dd></dl></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="_zipl"></a>ZIPL</h3></div></div></div><div class="variablelist"><dl class="variablelist"><dt><span class="term"> <span class="strong"><strong>rd.zipl=</strong></span><span class="emphasis"><em><path to blockdevice></em></span> </span></dt><dd><p class="simpara"> Update the dracut commandline with the values found in the <span class="emphasis"><em>dracut-cmdline.conf</em></span> file on the given device. The values are merged into the existing commandline values and the udev events are regenerated. </p><p><strong>Example. </strong> </p><pre class="screen">rd.zipl=UUID=0fb28157-99e3-4395-adef-da3f7d44835a</pre><p> </p></dd></dl></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="_cio_ignore"></a>CIO_IGNORE</h3></div></div></div><div class="variablelist"><dl class="variablelist"><dt><span class="term"> <span class="strong"><strong>rd.cio_accept=</strong></span><span class="emphasis"><em><device-ids></em></span> </span></dt><dd><p class="simpara"> Remove the devices listed in <device-ids> from the default cio_ignore kernel command-line settings. <device-ids> is a list of comma-separated CCW device ids. The default for this value is taken from the <span class="emphasis"><em>/boot/zipl/active_devices.txt</em></span> file. </p><p><strong>Example. </strong> </p><pre class="screen">rd.cio_accept=0.0.0180,0.0.0800,0.0.0801,0.0.0802</pre><p> </p></dd></dl></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="_plymouth_boot_splash"></a>Plymouth Boot Splash</h3></div></div></div><div class="variablelist"><dl class="variablelist"><dt><span class="term"> <span class="strong"><strong>plymouth.enable=0</strong></span> </span></dt><dd> disable the plymouth bootsplash completely. </dd><dt><span class="term"> <span class="strong"><strong>rd.plymouth=0</strong></span> </span></dt><dd> disable the plymouth bootsplash only for the initramfs. </dd></dl></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="_kernel_keys"></a>Kernel keys</h3></div></div></div><div class="variablelist"><dl class="variablelist"><dt><span class="term"> <span class="strong"><strong>masterkey=</strong></span><span class="emphasis"><em><kernel master key path name></em></span> </span></dt><dd><p class="simpara"> Set the path name of the kernel master key. </p><p><strong>Example. </strong> </p><pre class="screen">masterkey=/etc/keys/kmk-trusted.blob</pre><p> </p></dd><dt><span class="term"> <span class="strong"><strong>masterkeytype=</strong></span><span class="emphasis"><em><kernel master key type></em></span> </span></dt><dd><p class="simpara"> Set the type of the kernel master key. </p><p><strong>Example. </strong> </p><pre class="screen">masterkeytype=trusted</pre><p> </p></dd><dt><span class="term"> <span class="strong"><strong>evmkey=</strong></span><span class="emphasis"><em><EVM key path name></em></span> </span></dt><dd><p class="simpara"> Set the path name of the EVM key. </p><p><strong>Example. </strong> </p><pre class="screen">evmkey=/etc/keys/evm-trusted.blob</pre><p> </p></dd><dt><span class="term"> <span class="strong"><strong>ecryptfskey=</strong></span><span class="emphasis"><em><eCryptfs key path name></em></span> </span></dt><dd><p class="simpara"> Set the path name of the eCryptfs key. </p><p><strong>Example. </strong> </p><pre class="screen">ecryptfskey=/etc/keys/ecryptfs-trusted.blob</pre><p> </p></dd></dl></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="_deprecated_renamed_options"></a>Deprecated, renamed Options</h3></div></div></div><p>Here is a list of options, which were used in dracut prior to version 008, and their new replacement.</p><div class="variablelist"><dl class="variablelist"><dt><span class="term"> rdbreak </span></dt><dd> rd.break </dd><dt><span class="term"> rd.ccw </span></dt><dd> rd.znet </dd><dt><span class="term"> rd_CCW </span></dt><dd> rd.znet </dd><dt><span class="term"> rd_DASD_MOD </span></dt><dd> rd.dasd </dd><dt><span class="term"> rd_DASD </span></dt><dd> rd.dasd </dd><dt><span class="term"> rdinitdebug rdnetdebug </span></dt><dd> rd.debug </dd><dt><span class="term"> rd_NO_DM </span></dt><dd> rd.dm=0 </dd><dt><span class="term"> rd_DM_UUID </span></dt><dd> rd.dm.uuid </dd><dt><span class="term"> rdblacklist </span></dt><dd> rd.driver.blacklist </dd><dt><span class="term"> rdinsmodpost </span></dt><dd> rd.driver.post </dd><dt><span class="term"> rdloaddriver </span></dt><dd> rd.driver.pre </dd><dt><span class="term"> rd_NO_FSTAB </span></dt><dd> rd.fstab=0 </dd><dt><span class="term"> rdinfo </span></dt><dd> rd.info </dd><dt><span class="term"> check </span></dt><dd> rd.live.check </dd><dt><span class="term"> rdlivedebug </span></dt><dd> rd.live.debug </dd><dt><span class="term"> live_dir </span></dt><dd> rd.live.dir </dd><dt><span class="term"> liveimg </span></dt><dd> rd.live.image </dd><dt><span class="term"> overlay </span></dt><dd> rd.live.overlay </dd><dt><span class="term"> readonly_overlay </span></dt><dd> rd.live.overlay.readonly </dd><dt><span class="term"> reset_overlay </span></dt><dd> rd.live.overlay.reset </dd><dt><span class="term"> live_ram </span></dt><dd> rd.live.ram </dd><dt><span class="term"> rd_NO_CRYPTTAB </span></dt><dd> rd.luks.crypttab=0 </dd><dt><span class="term"> rd_LUKS_KEYDEV_UUID </span></dt><dd> rd.luks.keydev.uuid </dd><dt><span class="term"> rd_LUKS_KEYPATH </span></dt><dd> rd.luks.keypath </dd><dt><span class="term"> rd_NO_LUKS </span></dt><dd> rd.luks=0 </dd><dt><span class="term"> rd_LUKS_UUID </span></dt><dd> rd.luks.uuid </dd><dt><span class="term"> rd_NO_LVMCONF </span></dt><dd> rd.lvm.conf </dd><dt><span class="term"> rd_LVM_LV </span></dt><dd> rd.lvm.lv </dd><dt><span class="term"> rd_NO_LVM </span></dt><dd> rd.lvm=0 </dd><dt><span class="term"> rd_LVM_SNAPSHOT </span></dt><dd> rd.lvm.snapshot </dd><dt><span class="term"> rd_LVM_SNAPSIZE </span></dt><dd> rd.lvm.snapsize </dd><dt><span class="term"> rd_LVM_VG </span></dt><dd> rd.lvm.vg </dd><dt><span class="term"> rd_NO_MDADMCONF </span></dt><dd> rd.md.conf=0 </dd><dt><span class="term"> rd_NO_MDIMSM </span></dt><dd> rd.md.imsm=0 </dd><dt><span class="term"> rd_NO_MD </span></dt><dd> rd.md=0 </dd><dt><span class="term"> rd_MD_UUID </span></dt><dd> rd.md.uuid </dd></dl></div><p>rd_NO_MULTIPATH: rd.multipath=0</p><div class="variablelist"><dl class="variablelist"><dt><span class="term"> rd_NFS_DOMAIN </span></dt><dd> rd.nfs.domain </dd><dt><span class="term"> iscsi_initiator </span></dt><dd> rd.iscsi.initiator </dd><dt><span class="term"> iscsi_target_name </span></dt><dd> rd.iscsi.target.name </dd><dt><span class="term"> iscsi_target_ip </span></dt><dd> rd.iscsi.target.ip </dd><dt><span class="term"> iscsi_target_port </span></dt><dd> rd.iscsi.target.port </dd><dt><span class="term"> iscsi_target_group </span></dt><dd> rd.iscsi.target.group </dd><dt><span class="term"> iscsi_username </span></dt><dd> rd.iscsi.username </dd><dt><span class="term"> iscsi_password </span></dt><dd> rd.iscsi.password </dd><dt><span class="term"> iscsi_in_username </span></dt><dd> rd.iscsi.in.username </dd><dt><span class="term"> iscsi_in_password </span></dt><dd> rd.iscsi.in.password </dd><dt><span class="term"> iscsi_firmware </span></dt><dd> rd.iscsi.firmware=0 </dd><dt><span class="term"> rd_NO_PLYMOUTH </span></dt><dd> rd.plymouth=0 </dd><dt><span class="term"> rd_retry </span></dt><dd> rd.retry </dd><dt><span class="term"> rdshell </span></dt><dd> rd.shell </dd><dt><span class="term"> rd_NO_SPLASH </span></dt><dd> rd.splash </dd><dt><span class="term"> rdudevdebug </span></dt><dd> rd.udev.debug </dd><dt><span class="term"> rdudevinfo </span></dt><dd> rd.udev.info </dd><dt><span class="term"> rd_NO_ZFCPCONF </span></dt><dd> rd.zfcp.conf=0 </dd><dt><span class="term"> rd_ZFCP </span></dt><dd> rd.zfcp </dd><dt><span class="term"> rd_ZNET </span></dt><dd> rd.znet </dd><dt><span class="term"> KEYMAP </span></dt><dd> vconsole.keymap </dd><dt><span class="term"> KEYTABLE </span></dt><dd> vconsole.keymap </dd><dt><span class="term"> SYSFONT </span></dt><dd> vconsole.font </dd><dt><span class="term"> CONTRANS </span></dt><dd> vconsole.font.map </dd><dt><span class="term"> UNIMAP </span></dt><dd> vconsole.font.unimap </dd><dt><span class="term"> UNICODE </span></dt><dd> vconsole.unicode </dd><dt><span class="term"> EXT_KEYMAP </span></dt><dd> vconsole.keymap.ext </dd></dl></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="_configuration_in_the_initramfs_2"></a>Configuration in the Initramfs</h3></div></div></div><div class="variablelist"><dl class="variablelist"><dt><span class="term"> <span class="emphasis"><em>/etc/conf.d/</em></span> </span></dt><dd> Any files found in <span class="emphasis"><em>/etc/conf.d/</em></span> will be sourced in the initramfs to set initial values. Command line options will override these values set in the configuration files. </dd><dt><span class="term"> <span class="emphasis"><em>/etc/cmdline</em></span> </span></dt><dd> Can contain additional command line options. Deprecated, better use /etc/cmdline.d/*.conf. </dd><dt><span class="term"> <span class="emphasis"><em>/etc/cmdline.d/*.conf</em></span> </span></dt><dd> Can contain additional command line options. </dd></dl></div></div></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="_author_2"></a>AUTHOR</h2></div></div></div><p>Harald Hoyer</p></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="_see_also_3"></a>SEE ALSO</h2></div></div></div><p><span class="strong"><strong>dracut</strong></span>(8) <span class="strong"><strong>dracut.conf</strong></span>(5)</p></div></div><div class="chapter"><div class="titlepage"><div><div><h2 class="title"><a id="lsinitrd1"></a>Chapter 9. LSINITRD(1)</h2></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl class="toc"><dt><span class="section"><a href="#_name_4">NAME</a></span></dt><dt><span class="section"><a href="#_synopsis_3">SYNOPSIS</a></span></dt><dt><span class="section"><a href="#_description_4">DESCRIPTION</a></span></dt><dt><span class="section"><a href="#_options_2">OPTIONS</a></span></dt><dt><span class="section"><a href="#_availability_2">AVAILABILITY</a></span></dt><dt><span class="section"><a href="#_authors_2">AUTHORS</a></span></dt><dt><span class="section"><a href="#_see_also_4">SEE ALSO</a></span></dt></dl></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="_name_4"></a>NAME</h2></div></div></div><p>lsinitrd - tool to show the contents of an initramfs image</p></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="_synopsis_3"></a>SYNOPSIS</h2></div></div></div><p><span class="strong"><strong>lsinitrd</strong></span> [<span class="emphasis"><em>OPTION…</em></span>] [<image> [<filename> [<filename> […] ]]]</p><p><span class="strong"><strong>lsinitrd</strong></span> [<span class="emphasis"><em>OPTION…</em></span>] -k <kernel-version></p></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="_description_4"></a>DESCRIPTION</h2></div></div></div><p>lsinitrd shows the contents of an initramfs image. if <image> is omitted, then lsinitrd uses the default image <span class="emphasis"><em>/boot/<machine-id>/<kernel-version>/initrd</em></span> or <span class="emphasis"><em>/boot/initramfs-<kernel-version>.img</em></span>.</p></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="_options_2"></a>OPTIONS</h2></div></div></div><div class="variablelist"><dl class="variablelist"><dt><span class="term"> <span class="strong"><strong>-h, --help</strong></span> </span></dt><dd> print a help message and exit. </dd><dt><span class="term"> <span class="strong"><strong>-s, --size</strong></span> </span></dt><dd> sort the contents of the initramfs by size. </dd><dt><span class="term"> <span class="strong"><strong>-f, --file</strong></span> <span class="emphasis"><em><filename></em></span> </span></dt><dd> print the contents of <filename>. </dd><dt><span class="term"> <span class="strong"><strong>-k, --kver</strong></span> <span class="emphasis"><em><kernel version></em></span> </span></dt><dd> inspect the initramfs of <kernel version>. </dd><dt><span class="term"> <span class="strong"><strong>-m, --mod</strong></span> </span></dt><dd> list dracut modules included of the initramfs image. </dd><dt><span class="term"> <span class="strong"><strong>--unpack</strong></span> </span></dt><dd> unpack the initramfs to the current directory, instead of displaying the contents. If optional filenames are given, will only unpack specified files, else the whole image will be unpacked. Won’t unpack anything from early cpio part. </dd><dt><span class="term"> <span class="strong"><strong>--unpackearly</strong></span> </span></dt><dd> unpack the early microcode initramfs to the current directory, instead of displaying the contents. Same as --unpack, but only unpack files from early cpio part. </dd><dt><span class="term"> <span class="strong"><strong>-v, --verbose</strong></span> </span></dt><dd> unpack verbosely </dd></dl></div></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="_availability_2"></a>AVAILABILITY</h2></div></div></div><p>The lsinitrd command is part of the dracut package and is available from <a class="ulink" href="https://dracut.wiki.kernel.org" target="_top">https://dracut.wiki.kernel.org</a></p></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="_authors_2"></a>AUTHORS</h2></div></div></div><p>Harald Hoyer</p><p>Amerigo Wang</p><p>Nikoli</p></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="_see_also_4"></a>SEE ALSO</h2></div></div></div><p><span class="strong"><strong>dracut</strong></span>(8)</p></div></div><div class="chapter"><div class="titlepage"><div><div><h2 class="title"><a id="mkinitrd8"></a>Chapter 10. MKINITRD(8)</h2></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl class="toc"><dt><span class="section"><a href="#_name_5">NAME</a></span></dt><dt><span class="section"><a href="#_synopsis_4">SYNOPSIS</a></span></dt><dt><span class="section"><a href="#_description_5">DESCRIPTION</a></span></dt><dt><span class="section"><a href="#_options_3">OPTIONS</a></span></dt><dt><span class="section"><a href="#_availability_3">AVAILABILITY</a></span></dt><dt><span class="section"><a href="#_authors_3">AUTHORS</a></span></dt><dt><span class="section"><a href="#_see_also_5">SEE ALSO</a></span></dt></dl></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="_name_5"></a>NAME</h2></div></div></div><p>mkinitrd - is a compat wrapper, which calls dracut to generate an initramfs</p></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="_synopsis_4"></a>SYNOPSIS</h2></div></div></div><p><span class="strong"><strong>mkinitrd</strong></span> [<span class="emphasis"><em>OPTION…</em></span>] [<initrd-image>] <kernel-version></p></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="_description_5"></a>DESCRIPTION</h2></div></div></div><p>mkinitrd creates an initramfs image <initrd-image> for the kernel with version <kernel-version> by calling "dracut".</p><div class="important" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Important</h3><p>If a more fine grained control over the resulting image is needed, "dracut" should be called directly.</p></div></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="_options_3"></a>OPTIONS</h2></div></div></div><div class="variablelist"><dl class="variablelist"><dt><span class="term"> <span class="strong"><strong>--version</strong></span> </span></dt><dd> print info about the version </dd><dt><span class="term"> <span class="strong"><strong>-v, --verbose</strong></span> </span></dt><dd> increase verbosity level </dd><dt><span class="term"> <span class="strong"><strong>-f, --force</strong></span> </span></dt><dd> overwrite existing initramfs file. </dd><dt><span class="term"> <span class="strong"><strong>*--image-version</strong></span> </span></dt><dd> append the kernel version to the target image <initrd-image>-<kernel-version>. </dd><dt><span class="term"> <span class="strong"><strong>--with=<module></strong></span> </span></dt><dd> add the kernel module <module> to the initramfs. </dd><dt><span class="term"> <span class="strong"><strong>--preload=<module></strong></span> </span></dt><dd> preload the kernel module <module> in the initramfs before any other kernel modules are loaded. This can be used to ensure a certain device naming, which should in theory be avoided and the use of symbolic links in /dev is encouraged. </dd><dt><span class="term"> <span class="strong"><strong>--nocompress</strong></span> </span></dt><dd> do not compress the resulting image. </dd><dt><span class="term"> <span class="strong"><strong>--help</strong></span> </span></dt><dd> print a help message and exit. </dd></dl></div></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="_availability_3"></a>AVAILABILITY</h2></div></div></div><p>The mkinitrd command is part of the dracut package and is available from <a class="ulink" href="https://dracut.wiki.kernel.org" target="_top">https://dracut.wiki.kernel.org</a></p></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="_authors_3"></a>AUTHORS</h2></div></div></div><p>Harald Hoyer</p></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="_see_also_5"></a>SEE ALSO</h2></div></div></div><p><span class="strong"><strong>dracut</strong></span>(8)</p></div></div><div class="chapter"><div class="titlepage"><div><div><h2 class="title"><a id="_developer_manual"></a>Chapter 11. Developer Manual</h2></div></div></div></div><div class="chapter"><div class="titlepage"><div><div><h2 class="title"><a id="dracutmodules7"></a>Chapter 12. DRACUT.MODULES(7)</h2></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl class="toc"><dt><span class="section"><a href="#_name_6">NAME</a></span></dt><dt><span class="section"><a href="#_description_6">DESCRIPTION</a></span></dt><dt><span class="section"><a href="#stages">Boot Process Stages</a></span></dt><dd><dl><dt><span class="section"><a href="#_hook_cmdline">Hook: cmdline</a></span></dt><dt><span class="section"><a href="#_hook_pre_udev">Hook: pre-udev</a></span></dt><dt><span class="section"><a href="#_start_udev">Start Udev</a></span></dt><dt><span class="section"><a href="#_hook_pre_trigger">Hook: pre-trigger</a></span></dt><dt><span class="section"><a href="#_trigger_udev">Trigger Udev</a></span></dt><dt><span class="section"><a href="#_main_loop">Main Loop</a></span></dt><dt><span class="section"><a href="#_hook_pre_mount">Hook: pre-mount</a></span></dt><dt><span class="section"><a href="#_hook_mount">Hook: mount</a></span></dt><dt><span class="section"><a href="#_hook_pre_pivot">Hook: pre-pivot</a></span></dt><dt><span class="section"><a href="#_hook_cleanup">Hook: cleanup</a></span></dt><dt><span class="section"><a href="#_cleanup_and_switch_root">Cleanup and switch_root</a></span></dt></dl></dd><dt><span class="section"><a href="#_network_infrastructure">Network Infrastructure</a></span></dt><dt><span class="section"><a href="#_writing_a_module">Writing a Module</a></span></dt><dd><dl><dt><span class="section"><a href="#_module_setup_sh_check">module-setup.sh: check()</a></span></dt><dt><span class="section"><a href="#_module_setup_sh_depends">module-setup.sh: depends()</a></span></dt><dt><span class="section"><a href="#_module_setup_sh_cmdline">module-setup.sh: cmdline()</a></span></dt><dt><span class="section"><a href="#_module_setup_sh_install">module-setup.sh: install()</a></span></dt><dt><span class="section"><a href="#_module_setup_sh_installkernel">module-setup.sh: installkernel()</a></span></dt><dt><span class="section"><a href="#_anchor_id_creation_xreflabel_creation_creation_functions">Creation Functions</a></span></dt><dt><span class="section"><a href="#_initramfs_functions">Initramfs Functions</a></span></dt><dt><span class="section"><a href="#_network_modules">Network Modules</a></span></dt></dl></dd><dt><span class="section"><a href="#_author_3">AUTHOR</a></span></dt><dt><span class="section"><a href="#_see_also_6">SEE ALSO</a></span></dt></dl></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="_name_6"></a>NAME</h2></div></div></div><p>dracut.modules - dracut modules</p></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="_description_6"></a>DESCRIPTION</h2></div></div></div><p>dracut uses a modular system to build and extend the initramfs image. All modules are located in <span class="emphasis"><em>/usr/lib/dracut/modules.d</em></span> or in <span class="emphasis"><em><git-src>/modules.d</em></span>. The most basic dracut module is <span class="emphasis"><em>99base</em></span>. In <span class="emphasis"><em>99base</em></span> the initial shell script init is defined, which gets run by the kernel after initramfs loading. Although you can replace init with your own version of <span class="emphasis"><em>99base</em></span>, this is not encouraged. Instead you should use, if possible, the hooks of dracut. All hooks, and the point of time in which they are executed, are described in <a class="xref" href="#stages" title="Boot Process Stages">the section called “Boot Process Stages”</a>.</p><p>The main script, which creates the initramfs is dracut itself. It parses all arguments and sets up the directory, in which everything is installed. It then executes all check, install, installkernel scripts found in the modules, which are to be processed. After everything is installed, the install directory is archived and compressed to the final initramfs image. All helper functions used by check, install and installkernel are found in in the file <span class="emphasis"><em>dracut-functions</em></span>. These shell functions are available to all module installer (install, installkernel) scripts, without the need to source <span class="emphasis"><em>dracut-functions</em></span>.</p><p>A module can check the preconditions for install and installkernel with the check script. Also dependencies can be expressed with check. If a module passed check, install and installkernel will be called to install all of the necessary files for the module. To split between kernel and non-kernel parts of the installation, all kernel module related parts have to be in installkernel. All other files found in a module directory are module specific and mostly are hook scripts and udev rules.</p></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="stages"></a>Boot Process Stages</h2></div></div></div><p>dracut modules can insert custom script at various points, to control the boot process. These hooks are plain directories containing shell scripts ending with ".sh", which are sourced by init. Common used functions are in <span class="emphasis"><em>dracut-lib.sh</em></span>, which can be sourced by any script.</p><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="_hook_cmdline"></a>Hook: cmdline</h3></div></div></div><p>The <span class="emphasis"><em>cmdline</em></span> hook is a place to insert scripts to parse the kernel command line and prepare the later actions, like setting up udev rules and configuration files.</p><p>In this hook the most important environment variable is defined: root. The second one is rootok, which indicates, that a module claimed to be able to parse the root defined. So for example, <span class="strong"><strong>root=</strong></span><span class="emphasis"><em>iscsi:….</em></span> will be claimed by the iscsi dracut module, which then sets rootok.</p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="_hook_pre_udev"></a>Hook: pre-udev</h3></div></div></div><p>This hook is executed right after the cmdline hook and a check if root and rootok were set. Here modules can take action with the final root, and before udev has been run.</p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="_start_udev"></a>Start Udev</h3></div></div></div><p>Now udev is started and the logging for udev is setup.</p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="_hook_pre_trigger"></a>Hook: pre-trigger</h3></div></div></div><p>In this hook, you can set udev environment variables with <span class="strong"><strong>udevadm control --property=KEY=<span class="emphasis"><em>value</em></span></strong></span> or control the further execution of udev with udevadm.</p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="_trigger_udev"></a>Trigger Udev</h3></div></div></div><p>udev is triggered by calling udevadm trigger, which sends add events for all devices and subsystems.</p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="_main_loop"></a>Main Loop</h3></div></div></div><p>In the main loop of dracut loops until udev has settled and all scripts in <span class="emphasis"><em>initqueue/finished</em></span> returned true. In this loop there are three hooks, where scripts can be inserted by calling /sbin/initqueue.</p><div class="section"><div class="titlepage"><div><div><h4 class="title"><a id="_initqueue"></a>Initqueue</h4></div></div></div><p>This hook gets executed every time a script is inserted here, regardless of the udev state.</p></div><div class="section"><div class="titlepage"><div><div><h4 class="title"><a id="_initqueue_settled"></a>Initqueue settled</h4></div></div></div><p>This hooks (initqueue/settled) gets executed every time udev has settled.</p></div><div class="section"><div class="titlepage"><div><div><h4 class="title"><a id="_initqueue_timeout"></a>Initqueue timeout</h4></div></div></div><p>This hooks (initqueue/timeout) gets executed, when the main loop counter becomes half of the rd.retry counter.</p></div><div class="section"><div class="titlepage"><div><div><h4 class="title"><a id="_initqueue_finished"></a>Initqueue finished</h4></div></div></div><p>This hook (initqueue/finished) is called after udev has settled and if all scripts herein return 0 the main loop will be ended. Abritary scripts can be added here, to loop in the initqueue until something happens, which a dracut module wants to wait for.</p></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="_hook_pre_mount"></a>Hook: pre-mount</h3></div></div></div><p>Before the root device is mounted all scripts in the hook pre-mount are executed. In some cases (e.g. NFS) the real root device is already mounted, though.</p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="_hook_mount"></a>Hook: mount</h3></div></div></div><p>This hook is mainly to mount the real root device.</p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="_hook_pre_pivot"></a>Hook: pre-pivot</h3></div></div></div><p>This hook is called before cleanup hook, This is a good place for actions other than cleanups which need to be called before pivot.</p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="_hook_cleanup"></a>Hook: cleanup</h3></div></div></div><p>This hook is the last hook and is called before init finally switches root to the real root device. This is a good place to clean up and kill processes not needed anymore.</p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="_cleanup_and_switch_root"></a>Cleanup and switch_root</h3></div></div></div><p>Init (or systemd) kills all udev processes, cleans up the environment, sets up the arguments for the real init process and finally calls switch_root. switch_root removes the whole filesystem hierarchy of the initramfs, chroot()s to the real root device and calls /sbin/init with the specified arguments.</p><p>To ensure all files in the initramfs hierarchy can be removed, all processes still running from the initramfs should not have any open file descriptors left.</p></div></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="_network_infrastructure"></a>Network Infrastructure</h2></div></div></div><p>FIXME</p></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="_writing_a_module"></a>Writing a Module</h2></div></div></div><p>A simple example module is <span class="emphasis"><em>96insmodpost</em></span>, which modprobes a kernel module after udev has settled and the basic device drivers have been loaded.</p><p>All module installation information is in the file module-setup.sh.</p><p>First we create a check() function, which just exits with 0 indicating that this module should be included by default.</p><p>check():</p><pre class="screen">return 0</pre><p>The we create the install() function, which installs a cmdline hook with priority number 20 called <span class="emphasis"><em>parse-insmodpost.sh</em></span>. It also installs the <span class="emphasis"><em>insmodpost.sh</em></span> script in <span class="emphasis"><em>/sbin</em></span>.</p><p>install():</p><pre class="screen">inst_hook cmdline 20 "$moddir/parse-insmodpost.sh" inst_simple "$moddir/insmodpost.sh" /sbin/insmodpost.sh</pre><p>The <span class="emphasis"><em>parse-instmodpost.sh</em></span> parses the kernel command line for a argument rd.driver.post, blacklists the module from being autoloaded and installs the hook <span class="emphasis"><em>insmodpost.sh</em></span> in the <span class="emphasis"><em>initqueue/settled</em></span>.</p><p><span class="emphasis"><em>parse-insmodpost.sh</em></span>:</p><pre class="screen">for p in $(getargs rd.driver.post=); do echo "blacklist $p" >> /etc/modprobe.d/initramfsblacklist.conf _do_insmodpost=1 done [ -n "$_do_insmodpost" ] && /sbin/initqueue --settled --unique --onetime /sbin/insmodpost.sh unset _do_insmodpost</pre><p><span class="emphasis"><em>insmodpost.sh</em></span>, which is called in the <span class="emphasis"><em>initqueue/settled</em></span> hook will just modprobe the kernel modules specified in all rd.driver.post kernel command line parameters. It runs after udev has settled and is only called once (--onetime).</p><p><span class="emphasis"><em>insmodpost.sh</em></span>:</p><pre class="screen">. /lib/dracut-lib.sh for p in $(getargs rd.driver.post=); do modprobe $p done</pre><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="_module_setup_sh_check"></a>module-setup.sh: check()</h3></div></div></div><p><span class="emphasis"><em>check()</em></span> is called by dracut to evaluate the inclusion of a dracut module in the initramfs.</p><div class="variablelist"><dl class="variablelist"><dt><span class="term"> $hostonly </span></dt><dd> If the $hostonly variable is set, then the module check() function should be in "hostonly" mode, which means, that the check() should only return 0, if the module is really needed to boot this specific host. </dd></dl></div><p>check() should return with:</p><div class="variablelist"><dl class="variablelist"><dt><span class="term"> 0 </span></dt><dd> Include the dracut module in the initramfs. </dd><dt><span class="term"> 1 </span></dt><dd> Do not include the dracut module. The requirements are not fulfilled (missing tools, etc.) </dd><dt><span class="term"> 255 </span></dt><dd> Only include the dracut module, if another module requires it or if explicitly specified in the config file or on the argument list. </dd></dl></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="_module_setup_sh_depends"></a>module-setup.sh: depends()</h3></div></div></div><p>The function depends() should echo all other dracut module names the module depends on.</p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="_module_setup_sh_cmdline"></a>module-setup.sh: cmdline()</h3></div></div></div><p>This function should print the kernel command line options needed to boot the current machine setup. It should start with a space and should not print a newline.</p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="_module_setup_sh_install"></a>module-setup.sh: install()</h3></div></div></div><p>The install() function is called to install everything non-kernel related. To install binaries, scripts, and other files, you can use the functions mentioned in <a class="xref" href="#creation">[creation]</a>.</p><p>To address a file in the current module directory, use the variable "$moddir".</p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="_module_setup_sh_installkernel"></a>module-setup.sh: installkernel()</h3></div></div></div><p>In installkernel() all kernel related files should be installed. You can use all of the functions mentioned in <a class="xref" href="#creation">[creation]</a> to install files.</p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="_anchor_id_creation_xreflabel_creation_creation_functions"></a><a id="creation"></a>Creation Functions</h3></div></div></div><div class="section"><div class="titlepage"><div><div><h4 class="title"><a id="_inst_multiple_o_lt_file_gt_lt_file_gt_8230"></a>inst_multiple [-o] <file> [ <file> …]</h4></div></div></div><p>installs multiple binaries and files. If executables are specified without a path, dracut will search the path PATH=/usr/sbin:/sbin:/usr/bin:/bin for the binary. If the option "-o" is given as the first parameter, a missing file does not lead to an error.</p></div><div class="section"><div class="titlepage"><div><div><h4 class="title"><a id="_inst_lt_src_gt_lt_dst_gt"></a>inst <src> [<dst>]</h4></div></div></div><p>installs <span class="emphasis"><em>one</em></span> file <src> either to the same place in the initramfs or to an optional <dst>. inst with more than two arguments is treated the same as inst_multiple, all arguments are treated as files to install and none as install destinations.</p></div><div class="section"><div class="titlepage"><div><div><h4 class="title"><a id="_inst_hook_lt_hookdir_gt_lt_prio_gt_lt_src_gt"></a>inst_hook <hookdir> <prio> <src></h4></div></div></div><p>installs an executable/script <src> in the dracut hook <hookdir> with priority <prio>.</p></div><div class="section"><div class="titlepage"><div><div><h4 class="title"><a id="_inst_rules_lt_udevrule_gt_lt_udevrule_gt_8230"></a>inst_rules <udevrule> [ <udevrule> …]</h4></div></div></div><p>installs one ore more udev rules. Non-existant udev rules are reported, but do not let dracut fail.</p></div><div class="section"><div class="titlepage"><div><div><h4 class="title"><a id="_instmods_lt_kernelmodule_gt_lt_kernelmodule_gt_8230"></a>instmods <kernelmodule> [ <kernelmodule> … ]</h4></div></div></div><p>instmods should be used only in the installkernel() function.</p><p>instmods installs one or more kernel modules in the initramfs. <kernelmodule> can also be a whole subsystem, if prefixed with a "=", like "=drivers/net/team".</p><p>instmods will not install the kernel module, if $hostonly is set and the kernel module is not currently needed by any /sys/<span class="strong"><strong>…</strong></span>/uevent MODALIAS. To install a kernel module regardless of the hostonly mode use the form:</p><pre class="screen">hostonly='' instmods <kernelmodule></pre></div></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="_initramfs_functions"></a>Initramfs Functions</h3></div></div></div><p>FIXME</p></div><div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="_network_modules"></a>Network Modules</h3></div></div></div><p>FIXME</p></div></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="_author_3"></a>AUTHOR</h2></div></div></div><p>Harald Hoyer</p></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="_see_also_6"></a>SEE ALSO</h2></div></div></div><p><span class="strong"><strong>dracut</strong></span>(8)</p></div></div><div class="chapter"><div class="titlepage"><div><div><h2 class="title"><a id="dracutbootup7"></a>Chapter 13. DRACUT.BOOTUP(7)</h2></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl class="toc"><dt><span class="section"><a href="#_name_7">NAME</a></span></dt><dt><span class="section"><a href="#_description_7">DESCRIPTION</a></span></dt><dt><span class="section"><a href="#_author_4">AUTHOR</a></span></dt><dt><span class="section"><a href="#_see_also_7">SEE ALSO</a></span></dt></dl></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="_name_7"></a>NAME</h2></div></div></div><p>dracut.bootup - boot ordering in the initramfs</p></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="_description_7"></a>DESCRIPTION</h2></div></div></div><p>This flow chart illustrates the ordering of the services, if systemd is used in the dracut initramfs.</p><pre class="screen"> systemd-journal.socket | v dracut-cmdline.service | v dracut-pre-udev.service | v systemd-udevd.service | v local-fs-pre.target dracut-pre-trigger.service | | v v (various mounts) (various swap systemd-udev-trigger.service | devices...) | (various low-level (various low-level | | | services: seed, API VFS mounts: v v v tmpfiles, random mqueue, configfs, local-fs.target swap.target dracut-initqueue.service sysctl, ...) debugfs, ...) | | | | | \_______________|____________________ | ___________________|____________________/ \|/ v sysinit.target | _________________/|\___________________ / | \ | | | v | v (various | rescue.service sockets...) | | | | v v | rescue.target sockets.target | | | \_________________ | emergency.service \| | v v basic.target emergency.target | ______________________/| / | | v | dracut-pre-mount.service | | | v | sysroot.mount | | | v | initrd-root-fs.target (custom initrd services) | | v | dracut-mount.service | | | v | initrd-parse-etc.service | | | v | (sysroot-usr.mount and | various mounts marked | with fstab option | x-initrd.mount) | | | v | initrd-fs.target \______________________ | \| v initrd.target | v dracut-pre-pivot.service | v initrd-cleanup.service isolates to initrd-switch-root.target | v ______________________/| / | | initrd-udevadm-cleanup-db.service | | (custom initrd services) | | | \______________________ | \| v initrd-switch-root.target | v initrd-switch-root.service | v switch-root</pre></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="_author_4"></a>AUTHOR</h2></div></div></div><p>Harald Hoyer</p></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="_see_also_7"></a>SEE ALSO</h2></div></div></div><p><span class="strong"><strong>dracut</strong></span>(8) <span class="strong"><strong>bootup</strong></span>(7)</p></div></div><div class="appendix"><div class="titlepage"><div><div><h2 class="title"><a id="_license"></a>Appendix A. License</h2></div></div></div><p>This work is licensed under the Creative Commons Attribution/Share-Alike License. To view a copy of this license, visit <a class="ulink" href="http://creativecommons.org/licenses/by-sa/3.0/" target="_top">http://creativecommons.org/licenses/by-sa/3.0/</a> or send a letter to Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.</p></div></div></div></body></html>dracut.png000064400000014330151705322070006537 0ustar00�PNG IHDRUB&&�y�IDATx�Zx�H�=#��0sn�M�PZ�333���n333�2c!���0:N��-��9�>?fh��;_�G1Jg�=F��<������{���'鰰�Ə�؏��]���)�:��5�5�m�-�-����υB�������-l��mՑ#G>"��Y�}�@ ><<���zTTT �A����L&���-����ʕ+(�J/��~����W��K���I��Ç�@���x��7������0���8���4aYM>۶�����g��̙3(��z��[��[~�� ��#�}-<�a� ��W~ڀ���2��~;��� V.�#��5��0쳘�}뭷099)�+90��9����\�}[y�o�����'�<z���g�����*# ��t*�ӧ�04��`0���M$��2�KyLͥ�H�.�/:��Q[DKm���X�F�d����� ����a`�� �e��H&�.�>�۾�;�����2����@�������<� �9����ر���;�k�.d����������%�1���z���#Aģ����]D:[D&_D0``����6ঁZ��ǩ��^~�e��c�p����<�3Sg�si�������&��c�H�Qy;[�K �9���ELO_��|ʧ����D����K��7�o/�+��n���f4�ƨ���_y�\W�61����8�Mq|����YKK=@���^���ٻ��q���P4t7���n@�zk[��D���%M"���F�15u�������6,..j�����4J.01��j�ĵ���PA$@�2�.�[��"2��^�d���s�x����|�����GSS=A{���?�X<*��Fggwqf���+Pa�u�wZN�D7����ho��/��;]ZZ"�ϞX���%t6U�D���t#�W��p�TD����x���"i\��魄�YƫgV����[?6(�Y�⍍��#&�[[[����������.*�Ǐ<>�^Sss �)P(�����ׇ�� ��3��y��p�Dڄ�����q}�TL�L%&�R(yPJ�9n����&����0�)�[k�]I�{�4���^<����e1;ea_��z���O�]���zP�B���:�G�#�JS�D����?�ח�wg3�0�ӀC�툅��&� �b���B��A[A������TK9�1V������y�=���`���ֻ�� ù�:�|�gGO@�-L�����I�䕌��\���\���zt5V�G��"`d#�9�4�ME��"����d��նW?�*�0��j#�c7�G�ϗ�^�����89y;v�X0��o{P���*=`_k[�"Ke,.,��k�TJ����x��ݭ�,��#l�\yp]�����A����<�������\���|����&��k����w0�����*���p��3lkPCy�� �P׀��'�������y�_����FMc�0 �`�b�]��y���t:MW ���$���E��W܄��.�g.+���䢊�S�$v3��-�T�`wW�k l�.�&����E1�s�C�A�]�h� SS&}�<�Jf�X*bEؙX_���)j+[s����z�1}.�LC�st��#�ŕ샒�����q��U���a�����huu5/B�7��T�4�k���ɟ��Ä2����y�SD?����YJ�3u��p��J��yG[5K�c����555���B8�t��mA}ꩧv ������+I��d��Mbٹ�̣���,���g��-ϲ8����9�i�.��͜�*�^D���׃H$�t�&��16��Z����~�j��L�DZ����:�%�J9JIX��c`Y ��B�A;=�%i�I�>� �1�+&�_"���/ )lk0m��R(h+�9�=�"lima`���\��5�X���� �����EQJi�2���-���o[VT�T�H!�ϡ���@H��� ��6UD�0��`��������GW^^Z�KS>�/O��l�ato�Ԩ��j|��Z2�P�*x>~��E��(3���/���Ύk��Yݫ��m���ᇪ�e7vvvҽ`�RT �F����d^���TL������Mf��I�H�d��'�me�w�C��0|���lf��֠��P�`@��Yۊ�v)p�^���:,�.� ŵx�*g=2�#�����MƂ[���"���P��,�(��l���;zĽ y�`B�<�� ��W �<�����6���HL�_,��xe���TJZj�)W�I�h��X�ѣRX:����;'��Ks���ճ���P0��aY�ZЛ��%�Z��f�a��?��8��+ز�zTD�����4�%�v�W��ܿ�@Ub��a�FjB�f@9(�'Uǃ��6 ��ǎb��Z^3�!3��vQ�=ѝ�`���\呑�Il��*���bA�L���ɬP%��#9���@�`H2���m��O?����OmKS+��Z����T��P�V���S4;;����r�$Be�@)��#�P�\��(��T6�T:�w�@-5�1�W�ke�I�}��� ��\���A�,Sڃ�{G�y�q[���� �pD.`2�N) *���1��*F�L����,hPK�ʩRm]=����239�@V�sc+�[� g��mAx(�ɉu��[.&zk�sc*ǒU�'�U��%�{���G�G��m�R[�2��Z]S��ca/ݬVܿ�97PIYL�2x��8~���6��?�a��,J����t���TV�� /���b���)����k.���V��r4��b)�ō�5��m}>,g��נ�H���my�A��z�V"�Dg�N�r�Q[�xC�w�u�.n���B6����z$���'o�����@��V�`1��J2��ͬ�j��t]�S%��l�>CM�bhD$�Dc��A���@<lb�����NkEe\�DZ� �V��k �]�����*��mq�x���oiq f���~���Q|��f���p]q߾�p���OA ���]U����UU�5��R��KaQ�h4�A�ػEɱ���1�GZ��U|d;� ��&�333�@�/��u �����>|����4�+e>8::�4`�tFN����h��X���U�ɱ�5g``@���}�v��sW�[nCCu��zZ>�3tg �P�X,hY�mM�6 [|PF��K�"� qV^��1���%D�&���7\��SK���:���Q �t�����^^Y��;�T��ǂ����5tY�ɦ��1�����U�t� R�o�ńq��U������w�3�e���:>�V����'� ˀ<��a�JbuT�U��+9<���q�%�8yi�����#�x?�d'� %�t�@/�ד {K[l)�V�Vuj��5U�B1�+IW��l��/��%�w�an~F�<�|0/.[�[q���QWWG��O·��$��iܹ�L������6x���W $�${�������٫s�оV��oR���p��Q���9d���Eee�I���k��f�/�+�v4{�ի�w�0�&�t=6�|��+��5x덷q��y�蚛���q���>+Lqq��md�L����ڬ|C��C�� �� ��Jϼ���ٷw�K&��{�JȞ� �� =�� �յ8��B����ܫ�tv�` @0������h,�_Ѣ]�;��6[v,K�G?{O��4��+���F�TWA7�0�C[��@p}�j��`/�W�wo.��=M�����BiG2P��ש������SD�nd�gye'_~�}o�:T1��+���{��@��?<�3���щ����B��g����.J��./ve##���pa1�� ���PB����°���<Ⱥ����n"CP6�EK�)ȹ3?}��g��o���m�����˘<5���B�x�@'(�y:���m����ޡ���W-�dI �y[������ʯ�������_Xrk{������f�ڙ5��K�X�ȣ: ĭb���Y� �iWE��@�VX�XI���Ýc���[:�P��]�/<�=E�տ��3π%�e�}v�����\���2������ Q ��V�(���I����*���G����I�_V���!�o�G%j�9���l>=� X ��W�l_K?X���暈�,(/2�HawO5�'N�`�)�w��7�~�6��aM�C� �� *c���ٞ��6�>�a��?�)�"�{h����&�"y���qs�H};p���w9��VV�q�@Ӥ%am"]�A��&��U!TF, �� x�a��q����������9�X�tax.�m��ڣ�hmo�6�k��m۶m�1�=�>�{�N��I �S���ۗ�ԩ��`�<�meR���6����(��0`� T`�ɨl0��zOjK�1x�j�w\:+b���k5���9&1�Z<`<N��C{'�/�tw��wz�2Py��0����ϻ��mmm��q�� =�d[WW�3 d~9%�Z��9��f��l(�W3[R�]��5�k�V�i�[���A��v��������_~ɆV�P31�V�6���zb���i��_��a��(�^>�4��|� y��g��|��M�:�~��[,uo�EU�ఱ�A�Jobٛ���~ڌYm�&M:V���s�r�Q&Bu�|US�$ `�����(���\BfyL��"���N�� �ک£BI�M5M6˟��$��38�{y=�)�5nr���&�,Gv��o��(� �L@1�f���#GN�8yjg��!�g��j��TH�,���fp�r�O�;Ud�d� 3h,�����&�(@�V���y����3U��qb��X6�f�4��X��*��"�#sr�+��r }��݅p���}��Tܱڪ��gJ'���奇i��!vP� ��5Wv4͞�7v����Ƶ���*���2Q@� b�0�.bx�g��w���Kg�{�L���@_�����*��~����; �fʶ.�-��c ��nX��R�,K4�j�.P�)j��H뽘5gP�V��>�ep���݇'*�����a�p�G������ų88��վ���^ Ͼ7S@���A�L�Y~8��"����� d�c�ohKKˉ��֦�n� �I�]a���mZ��A���$��o��;�{���P�<�&�Dr��-�?�W�@F���395`)��$i]����^�§�x��ʁ�� Xx�Ƃ����[5?��y����`� k�*�El����uvv��s�k��#C��Q�ϫ)��ET���tJ�Z�niݒ�?�|�/��X6��C����v��7f���h*Kݒ z�X��655��\p������{ﲾT��Z�CM���OiKV�Y�� �IC�*}�Lh����Gqw��6Tm~��$�Kf-��.����h�l���wŰ`��u����ec�dud\Ľ� �_�N�@��9�#�8����?|s�Z��zo�q�$�-� ��$4�pރ��&��hnn��@��[�i�#��t�9�q�;^@���.�s=��Hϗ��z~����1Oj*����ݳ�>{�4}!i+W���er��80n[�t��N�*`�T��~@9��"��,�X�<����Q5g���Xʋ�wi�P�T��%��X�{�>O�̕S����W��*Ȉ>~����u��zi�di�[�$Ĵ�f�I"b+3# ���RT\c#�����O�E6�w������[���!{:T�8D��V��l�`W$�Ԣ��9�E��<��TTI��}O%��0n��̍Ȥ���OR@���}W*�]�|A���?g���p�9�;#=Z�iY���=���)��t�*�֮��ޚz��~��D.8��3��+iU�� h8�`�YZ��?N�H�)���M��o������-}�\q�@>�G��:PP}�����pM�0���;I�f,6T���er|��Go�qũ7,�w03i@�&���)S�,�3���i/+F-��1 ����>���M�d�?��>�4j:��?� �E�����P���:u��Q ٣��IEND�B`�dracut.svg000064400000210531151705322070006553 0ustar00<?xml version="1.0" encoding="UTF-8" standalone="no"?> <!-- Created with Inkscape (http://www.inkscape.org/) --> <svg xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://creativecommons.org/ns#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" version="1.0" width="85.316391" height="65.840691" id="svg2963" inkscape:version="0.48.0 r9654" sodipodi:docname="dracut.svg"> <metadata id="metadata98"> <rdf:RDF> <cc:Work rdf:about=""> <dc:format>image/svg+xml</dc:format> <dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> <dc:title /> </cc:Work> </rdf:RDF> </metadata> <sodipodi:namedview pagecolor="#ffffff" bordercolor="#666666" borderopacity="1" objecttolerance="10" gridtolerance="10" guidetolerance="10" inkscape:pageopacity="0" inkscape:pageshadow="2" inkscape:window-width="1600" inkscape:window-height="1125" id="namedview96" showgrid="false" inkscape:zoom="4.3457604" inkscape:cx="29.014935" inkscape:cy="10.744263" inkscape:window-x="0" inkscape:window-y="25" inkscape:window-maximized="1" inkscape:current-layer="svg2963" fit-margin-top="4" fit-margin-left="4" fit-margin-right="4" fit-margin-bottom="4" /> <defs id="defs3"> <radialGradient cx="605.71429" cy="486.64789" r="117.14286" fx="605.71429" fy="486.64789" id="radialGradient6719" xlink:href="#linearGradient5060" gradientUnits="userSpaceOnUse" gradientTransform="matrix(-2.774389,0,0,1.969706,112.7623,-872.8854)" /> <linearGradient id="linearGradient5060"> <stop style="stop-color:#000000;stop-opacity:1" offset="0" id="stop5062" /> <stop style="stop-color:#000000;stop-opacity:0" offset="1" id="stop5064" /> </linearGradient> <radialGradient cx="605.71429" cy="486.64789" r="117.14286" fx="605.71429" fy="486.64789" id="radialGradient6717" xlink:href="#linearGradient5060" gradientUnits="userSpaceOnUse" gradientTransform="matrix(2.774389,0,0,1.969706,-1891.633,-872.8854)" /> <linearGradient id="linearGradient5048"> <stop style="stop-color:#000000;stop-opacity:0" offset="0" id="stop5050" /> <stop style="stop-color:#000000;stop-opacity:1" offset="0.5" id="stop5056" /> <stop style="stop-color:#000000;stop-opacity:0" offset="1" id="stop5052" /> </linearGradient> <linearGradient x1="302.85715" y1="366.64789" x2="302.85715" y2="609.50507" id="linearGradient6715" xlink:href="#linearGradient5048" gradientUnits="userSpaceOnUse" gradientTransform="matrix(2.774389,0,0,1.969706,-1892.179,-872.8854)" /> <linearGradient id="linearGradient4995"> <stop style="stop-color:#de9523;stop-opacity:1" offset="0" id="stop4997" /> <stop style="stop-color:#a36d18;stop-opacity:1" offset="1" id="stop4999" /> </linearGradient> <linearGradient id="linearGradient4987"> <stop style="stop-color:#a0670c;stop-opacity:1" offset="0" id="stop4989" /> <stop style="stop-color:#a0670c;stop-opacity:0" offset="1" id="stop4991" /> </linearGradient> <linearGradient id="linearGradient4979"> <stop style="stop-color:#fbf0e0;stop-opacity:1" offset="0" id="stop4981" /> <stop style="stop-color:#f0ce99;stop-opacity:1" offset="1" id="stop4983" /> </linearGradient> <linearGradient id="linearGradient4222"> <stop style="stop-color:#ffffff;stop-opacity:1" offset="0" id="stop4224" /> <stop style="stop-color:#ffffff;stop-opacity:0.68639052" offset="1" id="stop4226" /> </linearGradient> <linearGradient id="linearGradient4210"> <stop style="stop-color:#eaba6f;stop-opacity:1" offset="0" id="stop4212" /> <stop style="stop-color:#b97a1b;stop-opacity:1" offset="1" id="stop4214" /> </linearGradient> <linearGradient id="linearGradient4192"> <stop style="stop-color:#e9b96e;stop-opacity:1" offset="0" id="stop4194" /> <stop style="stop-color:#f1d19e;stop-opacity:1" offset="1" id="stop4196" /> </linearGradient> <linearGradient id="linearGradient4182"> <stop style="stop-color:#a36d18;stop-opacity:1" offset="0" id="stop4184" /> <stop style="stop-color:#d79020;stop-opacity:1" offset="1" id="stop4186" /> </linearGradient> <linearGradient x1="30.062469" y1="13.444801" x2="17.696169" y2="12.333632" id="linearGradient2269" xlink:href="#linearGradient4979" gradientUnits="userSpaceOnUse" /> <linearGradient x1="36.288929" y1="14.661557" x2="47.065834" y2="15.267649" id="linearGradient2274" xlink:href="#linearGradient4995" gradientUnits="userSpaceOnUse" /> <linearGradient x1="25.381256" y1="24.720648" x2="24.119167" y2="16.17037" id="linearGradient2277" xlink:href="#linearGradient4192" gradientUnits="userSpaceOnUse" gradientTransform="matrix(1,0,0,0.986355,0,0.316638)" /> <linearGradient x1="16.148972" y1="12.636667" x2="34.193642" y2="12.636667" id="linearGradient2280" xlink:href="#linearGradient4182" gradientUnits="userSpaceOnUse" gradientTransform="matrix(1,0,0,1.039184,0,-0.04057054)" /> <linearGradient x1="21.906841" y1="9.7577486" x2="22.071806" y2="16.020695" id="linearGradient2282" xlink:href="#linearGradient4987" gradientUnits="userSpaceOnUse" /> <linearGradient x1="18.706615" y1="19.912336" x2="30.014812" y2="47.388485" id="linearGradient2285" xlink:href="#linearGradient4222" gradientUnits="userSpaceOnUse" /> <linearGradient x1="24.990499" y1="34.004856" x2="24.990499" y2="22.585211" id="linearGradient2288" xlink:href="#linearGradient4210" gradientUnits="userSpaceOnUse" /> <linearGradient x1="27.366341" y1="26.580296" x2="31.335964" y2="30.557772" id="linearGradient2852" xlink:href="#linearGradient2846" gradientUnits="userSpaceOnUse" /> <radialGradient cx="24.130018" cy="37.967922" r="16.528622" fx="24.130018" fy="37.967922" id="radialGradient2842" xlink:href="#linearGradient4477" gradientUnits="userSpaceOnUse" gradientTransform="matrix(1,0,0,0.237968,0,28.93278)" /> <linearGradient x1="18.292673" y1="13.602121" x2="17.500893" y2="25.743469" id="linearGradient2372" xlink:href="#linearGradient2366" gradientUnits="userSpaceOnUse" /> <radialGradient cx="24.130018" cy="37.967922" r="16.528622" fx="24.130018" fy="37.967922" id="radialGradient4493" xlink:href="#linearGradient4487" gradientUnits="userSpaceOnUse" gradientTransform="matrix(1,0,0,0.237968,0,28.93278)" /> <radialGradient cx="15.414371" cy="13.078408" r="6.65625" fx="15.414371" fy="13.078408" id="radialGradient4473" xlink:href="#linearGradient4467" gradientUnits="userSpaceOnUse" gradientTransform="matrix(2.592963,0,0,2.252104,-25.05975,-18.941)" /> <radialGradient cx="18.240929" cy="21.817987" r="8.3085051" fx="18.240929" fy="21.817987" id="radialGradient4460" xlink:href="#linearGradient4454" gradientUnits="userSpaceOnUse" /> <linearGradient x1="30.65625" y1="34" x2="33.21875" y2="31.0625" id="linearGradient4446" xlink:href="#linearGradient4440" gradientUnits="userSpaceOnUse" gradientTransform="matrix(1.334593,0,0,1.291292,-6.973842,-7.460658)" /> <linearGradient id="linearGradient4440"> <stop style="stop-color:#7d7d7d;stop-opacity:1" offset="0" id="stop4442" /> <stop style="stop-color:#b1b1b1;stop-opacity:1" offset="0.5" id="stop4448" /> <stop style="stop-color:#686868;stop-opacity:1" offset="1" id="stop4444" /> </linearGradient> <linearGradient id="linearGradient4454"> <stop style="stop-color:#729fcf;stop-opacity:0.20784314" offset="0" id="stop4456" /> <stop style="stop-color:#729fcf;stop-opacity:0.6761905" offset="1" id="stop4458" /> </linearGradient> <linearGradient id="linearGradient4467"> <stop style="stop-color:#ffffff;stop-opacity:1" offset="0" id="stop4469" /> <stop style="stop-color:#ffffff;stop-opacity:0.24761905" offset="1" id="stop4471" /> </linearGradient> <linearGradient id="linearGradient4477"> <stop style="stop-color:#000000;stop-opacity:1" offset="0" id="stop4479" /> <stop style="stop-color:#000000;stop-opacity:0" offset="1" id="stop4481" /> </linearGradient> <linearGradient id="linearGradient4487"> <stop style="stop-color:#ffffff;stop-opacity:1" offset="0" id="stop4489" /> <stop style="stop-color:#ffffff;stop-opacity:0" offset="1" id="stop4491" /> </linearGradient> <linearGradient id="linearGradient2366"> <stop style="stop-color:#ffffff;stop-opacity:1" offset="0" id="stop2368" /> <stop style="stop-color:#ffffff;stop-opacity:0.21904762" offset="0.5" id="stop2374" /> <stop style="stop-color:#ffffff;stop-opacity:1" offset="1" id="stop2370" /> </linearGradient> <linearGradient id="linearGradient2846"> <stop style="stop-color:#8a8a8a;stop-opacity:1" offset="0" id="stop2848" /> <stop style="stop-color:#484848;stop-opacity:1" offset="1" id="stop2850" /> </linearGradient> <linearGradient inkscape:collect="always" xlink:href="#linearGradient2064" id="linearGradient5790" gradientUnits="userSpaceOnUse" x1="18.048874" y1="25.461344" x2="22.211937" y2="12.143078" gradientTransform="matrix(0.940224,0,0,0.931632,1.331811,5.401537)" /> <linearGradient id="linearGradient2064"> <stop id="stop2066" offset="0" style="stop-color:white;stop-opacity:1;" /> <stop style="stop-color:#555753;stop-opacity:0.60000002;" offset="0.5" id="stop2070" /> <stop id="stop2068" offset="1" style="stop-color:#555753;stop-opacity:0;" /> </linearGradient> <linearGradient inkscape:collect="always" xlink:href="#linearGradient8631" id="linearGradient5865" x1="24" y1="36.638382" x2="25.818018" y2="6.8314762" gradientUnits="userSpaceOnUse" /> <linearGradient id="linearGradient8631"> <stop id="stop8633" offset="0" style="stop-color:#eeeeec;stop-opacity:1" /> <stop style="stop-color:#eeeeec;stop-opacity:1;" offset="0.2" id="stop8637" /> <stop id="stop8635" offset="1" style="stop-color:#babdb6;stop-opacity:1" /> </linearGradient> <linearGradient inkscape:collect="always" xlink:href="#linearGradient5690" id="linearGradient8603" x1="20.304037" y1="24.035707" x2="18.498415" y2="40.647167" gradientUnits="userSpaceOnUse" /> <linearGradient id="linearGradient5690"> <stop style="stop-color:white;stop-opacity:1;" offset="0" id="stop5692" /> <stop style="stop-color:#888a85;stop-opacity:0.59848487" offset="1" id="stop5694" /> </linearGradient> <radialGradient inkscape:collect="always" xlink:href="#linearGradient8625" id="radialGradient8676" gradientUnits="userSpaceOnUse" gradientTransform="matrix(1.662477,0,0,1.61358,-4.989175,-18.65647)" cx="7.4792061" cy="30.36071" fx="7.4792061" fy="30.36071" r="0.53125" /> <linearGradient id="linearGradient8625"> <stop id="stop8627" offset="0" style="stop-color:white;stop-opacity:1" /> <stop id="stop8629" offset="1" style="stop-color:#babdb6;stop-opacity:1" /> </linearGradient> <radialGradient inkscape:collect="always" xlink:href="#linearGradient8613" id="radialGradient8678" gradientUnits="userSpaceOnUse" gradientTransform="matrix(1.662477,0,0,1.61358,-4.989175,-18.65647)" cx="7.5177727" cy="30.573555" fx="7.5177727" fy="30.573555" r="0.53125" /> <linearGradient id="linearGradient8613"> <stop style="stop-color:#babdb6;stop-opacity:1" offset="0" id="stop8615" /> <stop style="stop-color:#2e3436;stop-opacity:1" offset="1" id="stop8617" /> </linearGradient> <radialGradient inkscape:collect="always" xlink:href="#linearGradient9641" id="radialGradient8680" gradientUnits="userSpaceOnUse" gradientTransform="matrix(1.662477,0,0,1.61358,-4.989175,-18.65647)" cx="7.4893188" cy="30.337601" fx="7.4893188" fy="30.337601" r="0.53125" /> <linearGradient id="linearGradient9641"> <stop style="stop-color:white;stop-opacity:1" offset="0" id="stop9643" /> <stop style="stop-color:#888a85;stop-opacity:1" offset="1" id="stop9645" /> </linearGradient> <radialGradient inkscape:collect="always" xlink:href="#linearGradient8613" id="radialGradient8682" gradientUnits="userSpaceOnUse" gradientTransform="matrix(1.662477,0,0,1.61358,-4.989175,-18.65647)" cx="7.5177727" cy="30.573555" fx="7.5177727" fy="30.573555" r="0.53125" /> <linearGradient id="linearGradient3375"> <stop style="stop-color:#babdb6;stop-opacity:1" offset="0" id="stop3377" /> <stop style="stop-color:#2e3436;stop-opacity:1" offset="1" id="stop3379" /> </linearGradient> <linearGradient inkscape:collect="always" xlink:href="#linearGradient8710" id="linearGradient9649" gradientUnits="userSpaceOnUse" x1="40.617188" y1="30.554688" x2="40.710938" y2="30.359375" gradientTransform="matrix(0.866025,-0.5,0.5,0.866025,-38.79233,11.403385)" /> <linearGradient id="linearGradient8710"> <stop style="stop-color:black;stop-opacity:1;" offset="0" id="stop8712" /> <stop style="stop-color:white;stop-opacity:1;" offset="1" id="stop8714" /> </linearGradient> <linearGradient inkscape:collect="always" xlink:href="#linearGradient8710" id="linearGradient9654" gradientUnits="userSpaceOnUse" x1="40.617188" y1="30.554688" x2="40.710938" y2="30.359375" gradientTransform="matrix(0.707107,0.527555,-0.707107,0.527555,29.0058,-20.09196)" /> <linearGradient id="linearGradient3386"> <stop style="stop-color:black;stop-opacity:1;" offset="0" id="stop3388" /> <stop style="stop-color:white;stop-opacity:1;" offset="1" id="stop3390" /> </linearGradient> <linearGradient inkscape:collect="always" xlink:href="#linearGradient2899-4" id="linearGradient5655-6" gradientUnits="userSpaceOnUse" x1="53.812813" y1="43.573235" x2="-2.8138931" y2="35.500015" gradientTransform="translate(0,50)" /> <linearGradient id="linearGradient2899-4"> <stop id="stop2901-1" offset="0" style="stop-color:#555753;stop-opacity:1" /> <stop id="stop2903-2" offset="1" style="stop-color:#2e3436;stop-opacity:1" /> </linearGradient> <linearGradient inkscape:collect="always" xlink:href="#linearGradient2967-8" id="linearGradient2973-8" x1="12.5" y1="43.1875" x2="12.5" y2="34.045513" gradientUnits="userSpaceOnUse" /> <linearGradient inkscape:collect="always" id="linearGradient2967-8"> <stop style="stop-color:white;stop-opacity:1;" offset="0" id="stop2969-9" /> <stop style="stop-color:white;stop-opacity:0;" offset="1" id="stop2971-2" /> </linearGradient> <linearGradient inkscape:collect="always" xlink:href="#linearGradient2909-8" id="linearGradient4711-8" gradientUnits="userSpaceOnUse" gradientTransform="matrix(1,0,0,1.42294,10.5,-14.95703)" x1="15.335379" y1="33.06237" x2="20.329321" y2="36.37693" /> <linearGradient id="linearGradient2909-8"> <stop style="stop-color:white;stop-opacity:0;" offset="0" id="stop2911-8" /> <stop id="stop2917-6" offset="0.5" style="stop-color:white;stop-opacity:1;" /> <stop style="stop-color:white;stop-opacity:0;" offset="1" id="stop2913-8" /> </linearGradient> <linearGradient inkscape:collect="always" xlink:href="#linearGradient2909-8" id="linearGradient4713-3" gradientUnits="userSpaceOnUse" gradientTransform="matrix(1,0,0,1.42294,-0.875,-15.04578)" x1="15.335379" y1="33.06237" x2="20.329321" y2="36.37693" /> <linearGradient id="linearGradient3406"> <stop style="stop-color:white;stop-opacity:0;" offset="0" id="stop3408" /> <stop id="stop3410" offset="0.5" style="stop-color:white;stop-opacity:1;" /> <stop style="stop-color:white;stop-opacity:0;" offset="1" id="stop3412" /> </linearGradient> <linearGradient inkscape:collect="always" xlink:href="#linearGradient2909-8" id="linearGradient3845" gradientUnits="userSpaceOnUse" gradientTransform="matrix(0.459833,0,-0.391165,1.370105,40.62503,-13.29892)" x1="15.335379" y1="33.06237" x2="20.329321" y2="36.37693" /> <linearGradient id="linearGradient3415"> <stop style="stop-color:white;stop-opacity:0;" offset="0" id="stop3417" /> <stop id="stop3419" offset="0.5" style="stop-color:white;stop-opacity:1;" /> <stop style="stop-color:white;stop-opacity:0;" offset="1" id="stop3421" /> </linearGradient> <radialGradient inkscape:collect="always" xlink:href="#linearGradient5740-4" id="radialGradient5748-9" cx="25.251999" cy="16.47991" fx="25.251999" fy="16.47991" r="21.980215" gradientTransform="matrix(1.032991,-0.596398,0.575121,0.99614,-11.609134,6.2008493)" gradientUnits="userSpaceOnUse" /> <linearGradient id="linearGradient5740-4"> <stop style="stop-color:#d0d0cb;stop-opacity:1;" offset="0" id="stop5742-2" /> <stop style="stop-color:#babdb6;stop-opacity:1" offset="1" id="stop5744-2" /> </linearGradient> <linearGradient inkscape:collect="always" xlink:href="#linearGradient2839-7" id="linearGradient7658-1" gradientUnits="userSpaceOnUse" x1="27.057796" y1="12.669416" x2="32.042896" y2="31.219666" /> <linearGradient id="linearGradient2839-7"> <stop style="stop-color:white;stop-opacity:0.25773194;" offset="0" id="stop2841-4" /> <stop id="stop2847-3" offset="0.5472973" style="stop-color:white;stop-opacity:1;" /> <stop style="stop-color:white;stop-opacity:0.24705882;" offset="0.66243607" id="stop2849-1" /> <stop id="stop2851-4" offset="0.875" style="stop-color:white;stop-opacity:0.83505154;" /> <stop style="stop-color:white;stop-opacity:0;" offset="1" id="stop2843-6" /> </linearGradient> <radialGradient inkscape:collect="always" xlink:href="#linearGradient9613-9" id="radialGradient8623-2" gradientUnits="userSpaceOnUse" gradientTransform="matrix(1.389748,0,0,1.348872,-2.91982,-10.63815)" cx="7.5191436" cy="30.304251" fx="7.5191436" fy="30.304251" r="0.53125" /> <linearGradient id="linearGradient9613-9"> <stop style="stop-color:white;stop-opacity:1" offset="0" id="stop9615-4" /> <stop id="stop9619-3" offset="0.5" style="stop-color:white;stop-opacity:1;" /> <stop style="stop-color:#cccfca;stop-opacity:1" offset="1" id="stop9617-5" /> </linearGradient> <linearGradient inkscape:collect="always" xlink:href="#linearGradient2064-6" id="linearGradient5790-3" gradientUnits="userSpaceOnUse" x1="18.048874" y1="25.461344" x2="22.211937" y2="12.143078" gradientTransform="matrix(0.940224,0,0,0.931632,1.957236,-3.9520937)" /> <linearGradient id="linearGradient2064-6"> <stop id="stop2066-0" offset="0" style="stop-color:white;stop-opacity:1;" /> <stop style="stop-color:#555753;stop-opacity:0.60000002;" offset="0.5" id="stop2070-5" /> <stop id="stop2068-0" offset="1" style="stop-color:#555753;stop-opacity:0;" /> </linearGradient> <linearGradient inkscape:collect="always" xlink:href="#linearGradient3468-4" id="linearGradient3474-4" x1="24.748737" y1="35.354588" x2="24.998737" y2="14.997767" gradientUnits="userSpaceOnUse" gradientTransform="matrix(1,0,0,0.995556,0.625425,-9.284744)" /> <linearGradient id="linearGradient3468-4"> <stop style="stop-color:#fdfdfc;stop-opacity:1" offset="0" id="stop3470-9" /> <stop style="stop-color:white;stop-opacity:0.37121212" offset="1" id="stop3472-9" /> </linearGradient> <linearGradient inkscape:collect="always" xlink:href="#linearGradient8631-9" id="linearGradient5865-1" x1="24" y1="36.638382" x2="25.818018" y2="6.8314762" gradientUnits="userSpaceOnUse" /> <linearGradient id="linearGradient8631-9"> <stop id="stop8633-6" offset="0" style="stop-color:#eeeeec;stop-opacity:1" /> <stop style="stop-color:#eeeeec;stop-opacity:1;" offset="0.2" id="stop8637-2" /> <stop id="stop8635-5" offset="1" style="stop-color:#babdb6;stop-opacity:1" /> </linearGradient> <linearGradient inkscape:collect="always" xlink:href="#linearGradient5690-4" id="linearGradient8603-0" x1="20.304037" y1="24.035707" x2="18.498415" y2="40.647167" gradientUnits="userSpaceOnUse" /> <linearGradient id="linearGradient5690-4"> <stop style="stop-color:white;stop-opacity:1;" offset="0" id="stop5692-0" /> <stop style="stop-color:#888a85;stop-opacity:0.59848487" offset="1" id="stop5694-9" /> </linearGradient> <radialGradient inkscape:collect="always" xlink:href="#linearGradient8613-9" id="radialGradient8619-8" cx="7.5177727" cy="30.573555" fx="7.5177727" fy="30.573555" r="0.53125" gradientTransform="matrix(1.662477,0,0,1.61358,-4.989175,-18.65647)" gradientUnits="userSpaceOnUse" /> <linearGradient id="linearGradient8613-9"> <stop style="stop-color:#babdb6;stop-opacity:1" offset="0" id="stop8615-6" /> <stop style="stop-color:#2e3436;stop-opacity:1" offset="1" id="stop8617-1" /> </linearGradient> <radialGradient inkscape:collect="always" xlink:href="#linearGradient9633-2" id="radialGradient8664-0" gradientUnits="userSpaceOnUse" gradientTransform="matrix(1.569487,0,0,1.523325,-4.288627,-15.92107)" cx="7.5336008" cy="30.307562" fx="7.5336008" fy="30.307562" r="0.53125" /> <linearGradient id="linearGradient9633-2"> <stop style="stop-color:#eeeeec;stop-opacity:1" offset="0" id="stop9635-8" /> <stop style="stop-color:#888a85;stop-opacity:1" offset="1" id="stop9639-3" /> </linearGradient> <radialGradient inkscape:collect="always" xlink:href="#linearGradient8613-9" id="radialGradient8666-9" gradientUnits="userSpaceOnUse" gradientTransform="matrix(1.662477,0,0,1.61358,-4.989175,-18.65647)" cx="7.5177727" cy="30.573555" fx="7.5177727" fy="30.573555" r="0.53125" /> <linearGradient id="linearGradient3466"> <stop style="stop-color:#babdb6;stop-opacity:1" offset="0" id="stop3468" /> <stop style="stop-color:#2e3436;stop-opacity:1" offset="1" id="stop3470" /> </linearGradient> <radialGradient inkscape:collect="always" xlink:href="#linearGradient8625-5" id="radialGradient3847" gradientUnits="userSpaceOnUse" gradientTransform="matrix(1.662477,0,0,1.61358,-4.989175,-18.65647)" cx="7.4792061" cy="30.36071" fx="7.4792061" fy="30.36071" r="0.53125" /> <linearGradient id="linearGradient8625-5"> <stop id="stop8627-5" offset="0" style="stop-color:white;stop-opacity:1" /> <stop id="stop8629-2" offset="1" style="stop-color:#babdb6;stop-opacity:1" /> </linearGradient> <radialGradient inkscape:collect="always" xlink:href="#linearGradient8613-9" id="radialGradient8678-2" gradientUnits="userSpaceOnUse" gradientTransform="matrix(1.662477,0,0,1.61358,-4.989175,-18.65647)" cx="7.5177727" cy="30.573555" fx="7.5177727" fy="30.573555" r="0.53125" /> <linearGradient id="linearGradient3477"> <stop style="stop-color:#babdb6;stop-opacity:1" offset="0" id="stop3479" /> <stop style="stop-color:#2e3436;stop-opacity:1" offset="1" id="stop3481" /> </linearGradient> <radialGradient inkscape:collect="always" xlink:href="#linearGradient9641-4" id="radialGradient8680-0" gradientUnits="userSpaceOnUse" gradientTransform="matrix(1.662477,0,0,1.61358,-4.989175,-18.65647)" cx="7.4893188" cy="30.337601" fx="7.4893188" fy="30.337601" r="0.53125" /> <linearGradient id="linearGradient9641-4"> <stop style="stop-color:white;stop-opacity:1" offset="0" id="stop9643-2" /> <stop style="stop-color:#888a85;stop-opacity:1" offset="1" id="stop9645-2" /> </linearGradient> <radialGradient inkscape:collect="always" xlink:href="#linearGradient8613-9" id="radialGradient8682-2" gradientUnits="userSpaceOnUse" gradientTransform="matrix(1.662477,0,0,1.61358,-4.989175,-18.65647)" cx="7.5177727" cy="30.573555" fx="7.5177727" fy="30.573555" r="0.53125" /> <linearGradient id="linearGradient3488"> <stop style="stop-color:#babdb6;stop-opacity:1" offset="0" id="stop3490" /> <stop style="stop-color:#2e3436;stop-opacity:1" offset="1" id="stop3492" /> </linearGradient> <linearGradient gradientTransform="translate(0.625425,-5.3536307)" inkscape:collect="always" xlink:href="#linearGradient8710-7" id="linearGradient8716-4" x1="40.617188" y1="30.554688" x2="40.710938" y2="30.359375" gradientUnits="userSpaceOnUse" /> <linearGradient id="linearGradient8710-7"> <stop style="stop-color:black;stop-opacity:1;" offset="0" id="stop8712-0" /> <stop style="stop-color:white;stop-opacity:1;" offset="1" id="stop8714-4" /> </linearGradient> <linearGradient inkscape:collect="always" xlink:href="#linearGradient8710-7" id="linearGradient9605-0" gradientUnits="userSpaceOnUse" x1="40.617188" y1="30.554688" x2="40.710938" y2="30.359375" gradientTransform="matrix(0.602867,-0.797841,0.797841,0.602867,-40.500685,39.274099)" /> <linearGradient id="linearGradient3499"> <stop style="stop-color:black;stop-opacity:1;" offset="0" id="stop3501" /> <stop style="stop-color:white;stop-opacity:1;" offset="1" id="stop3503" /> </linearGradient> <linearGradient inkscape:collect="always" xlink:href="#linearGradient8710-7" id="linearGradient3837" gradientUnits="userSpaceOnUse" gradientTransform="matrix(0.866025,-0.5,0.5,0.866025,-38.166905,2.0497543)" x1="40.617188" y1="30.554688" x2="40.710938" y2="30.359375" /> <linearGradient id="linearGradient3506"> <stop style="stop-color:black;stop-opacity:1;" offset="0" id="stop3508" /> <stop style="stop-color:white;stop-opacity:1;" offset="1" id="stop3510" /> </linearGradient> <linearGradient inkscape:collect="always" xlink:href="#linearGradient8710-7" id="linearGradient9654-8" gradientUnits="userSpaceOnUse" x1="40.617188" y1="30.554688" x2="40.710938" y2="30.359375" gradientTransform="matrix(0.707107,0.527555,-0.707107,0.527555,29.631226,-29.445591)" /> <linearGradient id="linearGradient3513"> <stop style="stop-color:black;stop-opacity:1;" offset="0" id="stop3515" /> <stop style="stop-color:white;stop-opacity:1;" offset="1" id="stop3517" /> </linearGradient> <linearGradient inkscape:collect="always" xlink:href="#linearGradient2986-0" id="linearGradient3839" gradientUnits="userSpaceOnUse" gradientTransform="translate(0.625425,-5.3536307)" x1="21.9375" y1="39" x2="21.9375" y2="37.995617" /> <linearGradient inkscape:collect="always" id="linearGradient2986-0"> <stop style="stop-color:black;stop-opacity:1;" offset="0" id="stop2988-7" /> <stop style="stop-color:black;stop-opacity:0;" offset="1" id="stop2990-5" /> </linearGradient> <linearGradient inkscape:collect="always" xlink:href="#linearGradient2902-1" id="linearGradient2910-9" x1="22.101398" y1="27.658131" x2="22.971142" y2="20.903238" gradientUnits="userSpaceOnUse" gradientTransform="translate(0.625425,-3.3536307)" /> <linearGradient inkscape:collect="always" id="linearGradient2902-1"> <stop style="stop-color:black;stop-opacity:1;" offset="0" id="stop2905-4" /> <stop style="stop-color:black;stop-opacity:0;" offset="1" id="stop2907-9" /> </linearGradient> <linearGradient inkscape:collect="always" xlink:href="#linearGradient2916-1" id="linearGradient2922-2" x1="24.847851" y1="28.908398" x2="24.847851" y2="25.757175" gradientUnits="userSpaceOnUse" gradientTransform="translate(0.625425,-3.3536307)" /> <linearGradient inkscape:collect="always" id="linearGradient2916-1"> <stop style="stop-color:white;stop-opacity:1;" offset="0" id="stop2918-5" /> <stop style="stop-color:white;stop-opacity:0;" offset="1" id="stop2920-9" /> </linearGradient> <linearGradient y2="25.757175" x2="24.847851" y1="28.908398" x1="24.847851" gradientTransform="translate(0.625425,-3.3536307)" gradientUnits="userSpaceOnUse" id="linearGradient3576" xlink:href="#linearGradient2916-1" inkscape:collect="always" /> <radialGradient inkscape:collect="always" xlink:href="#linearGradient4477" id="radialGradient3511" gradientUnits="userSpaceOnUse" gradientTransform="matrix(1,0,0,0.237968,0,28.93278)" cx="24.130018" cy="37.967922" fx="24.130018" fy="37.967922" r="16.528622" /> <linearGradient inkscape:collect="always" xlink:href="#linearGradient2846" id="linearGradient3514" gradientUnits="userSpaceOnUse" x1="27.366341" y1="26.580296" x2="31.335964" y2="30.557772" /> <linearGradient inkscape:collect="always" xlink:href="#linearGradient4440" id="linearGradient3516" gradientUnits="userSpaceOnUse" gradientTransform="matrix(1.334593,0,0,1.291292,-6.973842,-7.460658)" x1="30.65625" y1="34" x2="33.21875" y2="31.0625" /> <linearGradient inkscape:collect="always" xlink:href="#linearGradient2366" id="linearGradient3518" gradientUnits="userSpaceOnUse" x1="18.292673" y1="13.602121" x2="17.500893" y2="25.743469" /> <radialGradient inkscape:collect="always" xlink:href="#linearGradient4487" id="radialGradient3520" gradientUnits="userSpaceOnUse" gradientTransform="matrix(1,0,0,0.237968,0,28.93278)" cx="24.130018" cy="37.967922" fx="24.130018" fy="37.967922" r="16.528622" /> <radialGradient inkscape:collect="always" xlink:href="#linearGradient4454" id="radialGradient3522" gradientUnits="userSpaceOnUse" cx="18.240929" cy="21.817987" fx="18.240929" fy="21.817987" r="8.3085051" /> <radialGradient inkscape:collect="always" xlink:href="#linearGradient4467" id="radialGradient3524" gradientUnits="userSpaceOnUse" gradientTransform="matrix(2.592963,0,0,2.252104,-25.05975,-18.941)" cx="15.414371" cy="13.078408" fx="15.414371" fy="13.078408" r="6.65625" /> </defs> <g id="g6707" style="display:inline" transform="matrix(0.0370386,0,0,0.03670958,74.545662,41.635225)"> <rect id="rect6709" style="opacity:0.40206185;color:#000000;fill:url(#linearGradient6715);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;marker:none;visibility:visible;display:inline;overflow:visible" y="-150.69685" x="-1559.2523" height="478.35718" width="1339.6335" /> <path inkscape:connector-curvature="0" id="path6711" style="opacity:0.40206185;color:#000000;fill:url(#radialGradient6717);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;marker:none;visibility:visible;display:inline;overflow:visible" d="m -219.61876,-150.68038 c 0,0 0,478.33079 0,478.33079 142.874166,0.90045 345.40022,-107.16966 345.40014,-239.196175 0,-132.026537 -159.436816,-239.134595 -345.40014,-239.134615 z" /> <path inkscape:connector-curvature="0" id="path6713" style="opacity:0.40206185;color:#000000;fill:url(#radialGradient6719);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;marker:none;visibility:visible;display:inline;overflow:visible" d="m -1559.2523,-150.68038 c 0,0 0,478.33079 0,478.33079 -142.8742,0.90045 -345.4002,-107.16966 -345.4002,-239.196175 0,-132.026537 159.4368,-239.134595 345.4002,-239.134615 z" /> </g> <g transform="matrix(1.2957479,0,0,1.2957479,9.1984201,1.0434641)" style="display:inline" id="g3292"> <path inkscape:connector-curvature="0" sodipodi:nodetypes="cccssscccc" id="path2784" d="m 16.110953,16.552805 c -0.573581,0 -1.02837,0.431821 -1.02837,0.989859 l -0.940223,3.230801 c -2.859962,1.276514 -4.6423552,3.099073 -4.6423552,5.123976 0,3.856957 6.4790242,6.987239 14.4853222,6.98724 8.006296,0 14.514705,-3.130284 14.514704,-6.98724 0,-2.039034 -1.835591,-3.875388 -4.730501,-5.153089 l -0.940224,-3.201688 c 0,-0.558038 -0.454788,-0.989859 -1.02837,-0.989859 l -15.689983,0 z" style="fill:none;stroke:url(#linearGradient5790);stroke-width:1.00000012;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0" /> <path transform="translate(0,4)" d="m 16.125,13 c -0.362612,0 -0.59375,0.214848 -0.59375,0.53125 a 0.44198593,0.44198593 0 0 1 0,0.125 l -0.9375,3.25 a 0.44198593,0.44198593 0 0 1 -0.25,0.28125 c -1.389902,0.620369 -2.498509,1.378237 -3.25,2.1875 -0.751491,0.809263 -1.15625,1.64948 -1.15625,2.53125 0,1.680455 1.454964,3.3092 4,4.53125 2.545036,1.22205 6.116607,2 10.0625,2 3.945892,0 7.517463,-0.77795 10.0625,-2 2.545037,-1.22205 4,-2.850795 4,-4.53125 0,-0.887751 -0.393776,-1.747213 -1.15625,-2.5625 -0.762474,-0.815287 -1.905355,-1.566441 -3.3125,-2.1875 a 0.44198593,0.44198593 0 0 1 -0.25,-0.28125 l -0.9375,-3.21875 a 0.44198593,0.44198593 0 0 1 0,-0.125 C 32.406249,13.214846 32.175114,13 31.8125,13 L 16.125,13 z" id="path5857" style="fill:url(#linearGradient5865);fill-opacity:1;stroke:none;display:inline" inkscape:original="M 16.125 12.5625 C 15.55142 12.5625 15.09375 12.973212 15.09375 13.53125 L 14.15625 16.78125 C 11.296288 18.057765 9.5 19.881347 9.5 21.90625 C 9.5 25.763206 15.993702 28.874999 24 28.875 C 32.006296 28.874999 38.500001 25.763206 38.5 21.90625 C 38.5 19.867215 36.67616 18.027701 33.78125 16.75 L 32.84375 13.53125 C 32.843748 12.973212 32.386082 12.5625 31.8125 12.5625 L 16.125 12.5625 z " inkscape:radius="-0.44194174" sodipodi:type="inkscape:offset" /> <path transform="matrix(0.449978,0,0,0.349909,16.36363,16.21469)" d="m 24.748736,25.107418 c 0,2.367553 -3.482407,4.286835 -7.778174,4.286835 -4.295767,0 -7.7781744,-1.919282 -7.7781744,-4.286835 0,-2.367553 3.4824074,-4.286835 7.7781744,-4.286835 4.295767,0 7.778174,1.919282 7.778174,4.286835 z" sodipodi:ry="4.2868347" sodipodi:rx="7.7781744" sodipodi:cy="25.107418" sodipodi:cx="16.970562" id="path8595" style="opacity:0.9;color:#000000;fill:#000000;fill-opacity:0.05303028;fill-rule:nonzero;stroke:url(#linearGradient8603);stroke-width:2.52015233;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:1.4;marker:none;visibility:visible;display:inline;overflow:visible" sodipodi:type="arc" /> <path transform="matrix(-2.628602,0,0,1.777765,31.79309,-36.77739)" d="m 8.15625,30.578125 c 0,0.284772 -0.2378487,0.515625 -0.53125,0.515625 -0.2934013,0 -0.53125,-0.230853 -0.53125,-0.515625 0,-0.284772 0.2378487,-0.515625 0.53125,-0.515625 0.2934013,0 0.53125,0.230853 0.53125,0.515625 z" sodipodi:ry="0.515625" sodipodi:rx="0.53125" sodipodi:cy="30.578125" sodipodi:cx="7.625" id="path8668" style="color:#000000;fill:url(#radialGradient8676);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;marker:none;visibility:visible;display:inline;overflow:visible" sodipodi:type="arc" /> <path transform="matrix(1.411772,0,0,0.969697,0.985233,-12.15152)" d="m 8.15625,30.578125 c 0,0.284772 -0.2378487,0.515625 -0.53125,0.515625 -0.2934013,0 -0.53125,-0.230853 -0.53125,-0.515625 0,-0.284772 0.2378487,-0.515625 0.53125,-0.515625 0.2934013,0 0.53125,0.230853 0.53125,0.515625 z" sodipodi:ry="0.515625" sodipodi:rx="0.53125" sodipodi:cy="30.578125" sodipodi:cx="7.625" id="path8670" style="color:#000000;fill:url(#radialGradient8678);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;marker:none;visibility:visible;display:inline;overflow:visible" sodipodi:type="arc" /> <path transform="matrix(-2.628602,0,0,1.777765,56.3029,-36.77739)" d="m 8.15625,30.578125 c 0,0.284772 -0.2378487,0.515625 -0.53125,0.515625 -0.2934013,0 -0.53125,-0.230853 -0.53125,-0.515625 0,-0.284772 0.2378487,-0.515625 0.53125,-0.515625 0.2934013,0 0.53125,0.230853 0.53125,0.515625 z" sodipodi:ry="0.515625" sodipodi:rx="0.53125" sodipodi:cy="30.578125" sodipodi:cx="7.625" id="path8672" style="color:#000000;fill:url(#radialGradient8680);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;marker:none;visibility:visible;display:inline;overflow:visible" sodipodi:type="arc" /> <path transform="matrix(1.411772,0,0,0.969697,25.49504,-12.15152)" d="m 8.15625,30.578125 c 0,0.284772 -0.2378487,0.515625 -0.53125,0.515625 -0.2934013,0 -0.53125,-0.230853 -0.53125,-0.515625 0,-0.284772 0.2378487,-0.515625 0.53125,-0.515625 0.2934013,0 0.53125,0.230853 0.53125,0.515625 z" sodipodi:ry="0.515625" sodipodi:rx="0.53125" sodipodi:cy="30.578125" sodipodi:cx="7.625" id="path8674" style="color:#000000;fill:url(#radialGradient8682);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;marker:none;visibility:visible;display:inline;overflow:visible" sodipodi:type="arc" /> <path inkscape:connector-curvature="0" id="path9647" d="m 11.263531,17.446473 0.972937,-0.06482" style="opacity:0.4;fill:none;stroke:url(#linearGradient9649);stroke-width:0.29999995;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;display:inline" /> <path inkscape:connector-curvature="0" id="path9652" d="m 36.124038,17.147874 0.314427,0.688634" style="opacity:0.4;fill:none;stroke:url(#linearGradient9654);stroke-width:0.29999998;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;display:inline" /> <g transform="translate(0.625425,-54.351101)" id="g5672-9" style="display:inline"> <path inkscape:connector-curvature="0" style="color:#000000;fill:url(#linearGradient5655-6);fill-opacity:1;fill-rule:nonzero;stroke:#2e3436;stroke-width:1;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:1.4;marker:none;visibility:visible;display:inline;overflow:visible" d="m 4.5182287,80.500013 38.9635393,0 c 0.564099,0 1.018229,0.45413 1.018229,1.018229 l 0,2.963543 c 0,1.315584 -0.450231,3.018228 -2.455729,3.018228 L 40.5,87.5 l 0,1 -33,0 0,-1 -1.8567713,1.3e-5 c -1.2712053,0 -2.1432282,-0.884627 -2.1432282,-2.255665 l 0,-3.726106 c 0,-0.564099 0.4541297,-1.018229 1.0182282,-1.018229 z" id="rect2010-0" sodipodi:nodetypes="ccccccccccccc" /> <path inkscape:connector-curvature="0" sodipodi:nodetypes="ccccccc" id="path2076-3" d="m 4.59375,31.59375 0,3.729743 c 0,0.599619 0.3756505,1.104854 0.8863276,1.104854 l 36.9463294,0 c 0.512469,0 0.979843,-0.507235 0.979843,-1.016466 l 0,-3.818131 -38.8125,0 z" style="opacity:0.1;color:#000000;fill:none;stroke:url(#linearGradient2973-8);stroke-width:0.99999988;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dashoffset:1.4;marker:none;visibility:visible;display:inline;overflow:visible" transform="translate(0,50)" /> <g id="g4706-3" style="opacity:0.5" transform="translate(0,50)"> <path inkscape:connector-curvature="0" inkscape:export-ydpi="90" inkscape:export-xdpi="90" inkscape:export-filename="/home/lapo/Desktop/uhm.png" sodipodi:nodetypes="ccccc" id="path2907-3" d="m 26.144738,32.088747 c 0,0 -1.502602,5.533939 -3.226175,5.911253 0,0 6.231378,-0.125771 6.231378,-0.125771 1.387072,-0.317461 3.358758,-5.785482 3.358758,-5.785482 l -6.363961,0 z" style="opacity:0.10952382;fill:url(#linearGradient4711-8);fill-opacity:1;fill-rule:evenodd;stroke:none" /> <path inkscape:connector-curvature="0" style="opacity:0.10952382;fill:url(#linearGradient4713-3);fill-opacity:1;fill-rule:evenodd;stroke:none" d="m 14.769738,32 c 0,0 -1.502602,5.533939 -3.226175,5.911253 0,0 6.231378,-0.125771 6.231378,-0.125771 C 19.162013,37.468021 21.133699,32 21.133699,32 l -6.363961,0 z" id="path2892-7" sodipodi:nodetypes="ccccc" inkscape:export-filename="/home/lapo/Desktop/uhm.png" inkscape:export-xdpi="90" inkscape:export-ydpi="90" /> <path inkscape:connector-curvature="0" style="opacity:0.10952382;fill:url(#linearGradient3845);fill-opacity:1;fill-rule:evenodd;stroke:none" d="m 34.886139,32 c 0,0 -2.212224,5.328458 -3.108503,5.691761 0,0 2.899969,-0.121101 2.899969,-0.121101 C 35.402697,37.264987 37.8125,32 37.8125,32 l -2.926361,0 z" id="path2896-3" sodipodi:nodetypes="ccccc" inkscape:export-filename="/home/lapo/Desktop/uhm.png" inkscape:export-xdpi="90" inkscape:export-ydpi="90" /> </g> </g> <path inkscape:connector-curvature="0" inkscape:export-ydpi="90" inkscape:export-xdpi="90" inkscape:export-filename="/home/lapo/Desktop/uhm.png" sodipodi:nodetypes="cczzcczzc" id="rect1879-2" d="m 12.318553,5.1451573 24.572566,0 c 1.68417,0 2.396517,0.117479 3.040019,2.385005 l 5.074491,17.8811187 c 0.501024,1.765471 -1.355848,2.735101 -3.040018,2.735101 l -34.721555,0 c -1.868408,0 -3.489383,-1.181417 -3.040018,-2.735101 L 9.45447,7.2578663 c 0.568301,-1.964905 1.179912,-2.112709 2.864083,-2.112709 z" style="fill:url(#radialGradient5748-9);fill-opacity:1;stroke:#888a85;stroke-width:1.00000024;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dashoffset:0;display:inline" /> <path d="m 11.6875,11 c -0.826242,0 -1.28475,0.06523 -1.5625,0.25 -0.2777497,0.184768 -0.5402012,0.558525 -0.8125,1.5 l -5.25,18.125 c -0.1708248,0.590628 0.031475,1.039316 0.5,1.4375 C 5.0310253,32.710684 5.7975106,33.000001 6.625,33 l 34.71875,0 c 0.744655,0 1.538941,-0.2482 2.03125,-0.625 0.492309,-0.3768 0.731017,-0.796077 0.53125,-1.5 L 38.84375,13 C 38.534499,11.910283 38.220548,11.458908 37.90625,11.25 37.591952,11.041092 37.112699,11 36.28125,11 L 11.6875,11 z" id="path5806-6" style="opacity:0.46240599;fill:url(#linearGradient7658-1);fill-opacity:1;stroke:none;display:inline" inkscape:original="M 11.6875 10.5 C 10.00333 10.5 9.4120513 10.660095 8.84375 12.625 L 3.59375 30.75 C 3.1443849 32.303684 4.7565918 33.500002 6.625 33.5 L 41.34375 33.5 C 43.02792 33.5 44.876024 32.515471 44.375 30.75 L 39.3125 12.875 C 38.668998 10.607474 37.965419 10.5 36.28125 10.5 L 11.6875 10.5 z " inkscape:radius="-0.5" sodipodi:type="inkscape:offset" transform="translate(0.625425,-5.3536307)" /> <path transform="matrix(-2.628602,0,0,1.777765,28.418516,-29.131021)" d="m 8.15625,30.578125 c 0,0.284772 -0.2378487,0.515625 -0.53125,0.515625 -0.2934013,0 -0.53125,-0.230853 -0.53125,-0.515625 0,-0.284772 0.2378487,-0.515625 0.53125,-0.515625 0.2934013,0 0.53125,0.230853 0.53125,0.515625 z" sodipodi:ry="0.515625" sodipodi:rx="0.53125" sodipodi:cy="30.578125" sodipodi:cx="7.625" id="path8621-5" style="color:#000000;fill:url(#radialGradient8623-2);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;marker:none;visibility:visible;display:inline;overflow:visible" sodipodi:type="arc" /> <path inkscape:connector-curvature="0" sodipodi:nodetypes="cccssscccc" id="path2784-2" d="m 16.736379,7.1991743 c -0.573581,0 -1.02837,0.431821 -1.02837,0.9898587 l -0.940223,3.230801 c -2.859962,1.276514 -4.642356,3.099073 -4.642356,5.123976 0,3.856957 6.479025,6.987239 14.485323,6.98724 8.006296,0 14.514705,-3.130284 14.514704,-6.98724 0,-2.039034 -1.835591,-3.875388 -4.730501,-5.153089 L 33.454732,8.189033 c 0,-0.5580377 -0.454788,-0.9898587 -1.02837,-0.9898587 l -15.689983,0 z" style="fill:none;stroke:url(#linearGradient5790-3);stroke-width:1.00000012;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;display:inline" /> <path inkscape:connector-curvature="0" sodipodi:nodetypes="csccsccsccscc" id="path3394-6" d="m 12.312926,6.1463743 c -0.803124,0 -1.097169,0.07051 -1.218751,0.155556 -0.121582,0.08504 -0.357707,0.40212 -0.6875,1.306667 l -5.25,18.1377857 c -0.13372,0.366765 -0.05483,0.533865 0.3125,0.84 0.367327,0.306136 1.066693,0.56 1.78125,0.560001 l 34.718751,0 c 0.639793,0 1.393345,-0.237954 1.78125,-0.52889 0.387905,-0.290935 0.488311,-0.382809 0.3125,-0.871111 l -5.0625,-17.8577857 c -0.377206,-1.04766 -0.68208,-1.439297 -0.84375,-1.555556 -0.16167,-0.116259 -0.443711,-0.186667 -1.25,-0.186667 l -24.59375,0 z" style="fill:none;stroke:url(#linearGradient3474-4);stroke-width:1.00000036;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dashoffset:0;display:inline" /> <g style="opacity:0.3028571;display:inline" transform="translate(7.625425,-6.353631)" id="g5657-5"> <rect style="color:#000000;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:#eeeeec;stroke-width:1.00000024;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:1.4;marker:none;visibility:visible;display:inline;overflow:visible" id="rect5641-8" width="14.000004" height="1.9999924" x="18.499996" y="35.500008" rx="0.75130093" ry="0.74712253" /> <rect style="color:#000000;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;marker:none;visibility:visible;display:inline;overflow:visible" id="rect5645-7" width="1" height="1" x="19" y="36" /> <rect style="color:#000000;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;marker:none;visibility:visible;display:inline;overflow:visible" id="rect5647-9" width="1" height="1" x="22" y="36" /> <rect style="color:#000000;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;marker:none;visibility:visible;display:inline;overflow:visible" id="rect5649-6" width="1" height="1" x="24" y="36" /> <rect style="color:#000000;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;marker:none;visibility:visible;display:inline;overflow:visible" id="rect5651-0" width="1" height="1" x="26" y="36" /> <rect style="color:#000000;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;marker:none;visibility:visible;display:inline;overflow:visible" id="rect5653-4" width="2" height="1" x="29" y="36" /> </g> <path d="m 16.125,13 c -0.362612,0 -0.59375,0.214848 -0.59375,0.53125 a 0.44198593,0.44198593 0 0 1 0,0.125 l -0.9375,3.25 a 0.44198593,0.44198593 0 0 1 -0.25,0.28125 c -1.389902,0.620369 -2.498509,1.378237 -3.25,2.1875 -0.751491,0.809263 -1.15625,1.64948 -1.15625,2.53125 0,1.680455 1.454964,3.3092 4,4.53125 2.545036,1.22205 6.116607,2 10.0625,2 3.945892,0 7.517463,-0.77795 10.0625,-2 2.545037,-1.22205 4,-2.850795 4,-4.53125 0,-0.887751 -0.393776,-1.747213 -1.15625,-2.5625 -0.762474,-0.815287 -1.905355,-1.566441 -3.3125,-2.1875 a 0.44198593,0.44198593 0 0 1 -0.25,-0.28125 l -0.9375,-3.21875 a 0.44198593,0.44198593 0 0 1 0,-0.125 C 32.406249,13.214846 32.175114,13 31.8125,13 L 16.125,13 z" id="path5857-1" style="fill:url(#linearGradient5865-1);fill-opacity:1;stroke:none;display:inline" inkscape:original="M 16.125 12.5625 C 15.55142 12.5625 15.09375 12.973212 15.09375 13.53125 L 14.15625 16.78125 C 11.296288 18.057765 9.5 19.881347 9.5 21.90625 C 9.5 25.763206 15.993702 28.874999 24 28.875 C 32.006296 28.874999 38.500001 25.763206 38.5 21.90625 C 38.5 19.867215 36.67616 18.027701 33.78125 16.75 L 32.84375 13.53125 C 32.843748 12.973212 32.386082 12.5625 31.8125 12.5625 L 16.125 12.5625 z " inkscape:radius="-0.44194174" sodipodi:type="inkscape:offset" transform="translate(0.625425,-5.3536307)" /> <path transform="matrix(0.449978,0,0,0.349909,16.989056,6.8610593)" d="m 24.748736,25.107418 c 0,2.367553 -3.482407,4.286835 -7.778174,4.286835 -4.295767,0 -7.7781744,-1.919282 -7.7781744,-4.286835 0,-2.367553 3.4824074,-4.286835 7.7781744,-4.286835 4.295767,0 7.778174,1.919282 7.778174,4.286835 z" sodipodi:ry="4.2868347" sodipodi:rx="7.7781744" sodipodi:cy="25.107418" sodipodi:cx="16.970562" id="path8595-0" style="opacity:0.9;color:#000000;fill:#000000;fill-opacity:0.05303028;fill-rule:nonzero;stroke:url(#linearGradient8603-0);stroke-width:2.52015233;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:1.4;marker:none;visibility:visible;display:inline;overflow:visible" sodipodi:type="arc" /> <path transform="matrix(1.411772,0,0,0.969697,-2.389342,-4.5051457)" d="m 8.15625,30.578125 c 0,0.284772 -0.2378487,0.515625 -0.53125,0.515625 -0.2934013,0 -0.53125,-0.230853 -0.53125,-0.515625 0,-0.284772 0.2378487,-0.515625 0.53125,-0.515625 0.2934013,0 0.53125,0.230853 0.53125,0.515625 z" sodipodi:ry="0.515625" sodipodi:rx="0.53125" sodipodi:cy="30.578125" sodipodi:cx="7.625" id="path8611-4" style="color:#000000;fill:url(#radialGradient8619-8);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;marker:none;visibility:visible;display:inline;overflow:visible" sodipodi:type="arc" /> <path transform="matrix(-2.628602,0,0,1.777765,61.41852,-29.131021)" d="m 8.15625,30.578125 c 0,0.284772 -0.2378487,0.515625 -0.53125,0.515625 -0.2934013,0 -0.53125,-0.230853 -0.53125,-0.515625 0,-0.284772 0.2378487,-0.515625 0.53125,-0.515625 0.2934013,0 0.53125,0.230853 0.53125,0.515625 z" sodipodi:ry="0.515625" sodipodi:rx="0.53125" sodipodi:cy="30.578125" sodipodi:cx="7.625" id="path8660-8" style="color:#000000;fill:url(#radialGradient8664-0);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.46259445;marker:none;visibility:visible;display:inline;overflow:visible" sodipodi:type="arc" /> <path transform="matrix(1.411772,0,0,0.969697,30.610656,-4.5051457)" d="m 8.15625,30.578125 c 0,0.284772 -0.2378487,0.515625 -0.53125,0.515625 -0.2934013,0 -0.53125,-0.230853 -0.53125,-0.515625 0,-0.284772 0.2378487,-0.515625 0.53125,-0.515625 0.2934013,0 0.53125,0.230853 0.53125,0.515625 z" sodipodi:ry="0.515625" sodipodi:rx="0.53125" sodipodi:cy="30.578125" sodipodi:cx="7.625" id="path8662-7" style="color:#000000;fill:url(#radialGradient8666-9);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;marker:none;visibility:visible;display:inline;overflow:visible" sodipodi:type="arc" /> <path transform="matrix(-2.628602,0,0,1.777765,32.418516,-46.131021)" d="m 8.15625,30.578125 c 0,0.284772 -0.2378487,0.515625 -0.53125,0.515625 -0.2934013,0 -0.53125,-0.230853 -0.53125,-0.515625 0,-0.284772 0.2378487,-0.515625 0.53125,-0.515625 0.2934013,0 0.53125,0.230853 0.53125,0.515625 z" sodipodi:ry="0.515625" sodipodi:rx="0.53125" sodipodi:cy="30.578125" sodipodi:cx="7.625" id="path8668-0" style="color:#000000;fill:url(#radialGradient3847);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;marker:none;visibility:visible;display:inline;overflow:visible" sodipodi:type="arc" /> <path transform="matrix(1.411772,0,0,0.969697,1.610658,-21.505151)" d="m 8.15625,30.578125 c 0,0.284772 -0.2378487,0.515625 -0.53125,0.515625 -0.2934013,0 -0.53125,-0.230853 -0.53125,-0.515625 0,-0.284772 0.2378487,-0.515625 0.53125,-0.515625 0.2934013,0 0.53125,0.230853 0.53125,0.515625 z" sodipodi:ry="0.515625" sodipodi:rx="0.53125" sodipodi:cy="30.578125" sodipodi:cx="7.625" id="path8670-8" style="color:#000000;fill:url(#radialGradient8678-2);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;marker:none;visibility:visible;display:inline;overflow:visible" sodipodi:type="arc" /> <path transform="matrix(-2.628602,0,0,1.777765,56.928326,-46.131021)" d="m 8.15625,30.578125 c 0,0.284772 -0.2378487,0.515625 -0.53125,0.515625 -0.2934013,0 -0.53125,-0.230853 -0.53125,-0.515625 0,-0.284772 0.2378487,-0.515625 0.53125,-0.515625 0.2934013,0 0.53125,0.230853 0.53125,0.515625 z" sodipodi:ry="0.515625" sodipodi:rx="0.53125" sodipodi:cy="30.578125" sodipodi:cx="7.625" id="path8672-6" style="color:#000000;fill:url(#radialGradient8680-0);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;marker:none;visibility:visible;display:inline;overflow:visible" sodipodi:type="arc" /> <path transform="matrix(1.411772,0,0,0.969697,26.120466,-21.505151)" d="m 8.15625,30.578125 c 0,0.284772 -0.2378487,0.515625 -0.53125,0.515625 -0.2934013,0 -0.53125,-0.230853 -0.53125,-0.515625 0,-0.284772 0.2378487,-0.515625 0.53125,-0.515625 0.2934013,0 0.53125,0.230853 0.53125,0.515625 z" sodipodi:ry="0.515625" sodipodi:rx="0.53125" sodipodi:cy="30.578125" sodipodi:cx="7.625" id="path8674-2" style="color:#000000;fill:url(#radialGradient8682-2);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;marker:none;visibility:visible;display:inline;overflow:visible" sodipodi:type="arc" /> <path inkscape:connector-curvature="0" id="path8700-4" d="m 40.953535,24.90777 0.874999,0.430332" style="opacity:0.4;fill:none;stroke:url(#linearGradient8716-4);stroke-width:0.29999995;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;display:inline" /> <path inkscape:connector-curvature="0" id="path9603-7" d="M 7.955611,25.342275 8.826456,24.903597" style="opacity:0.4;fill:none;stroke:url(#linearGradient9605-0);stroke-width:0.29999995;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;display:inline" /> <path inkscape:connector-curvature="0" id="path9647-9" d="m 11.888957,8.092842 0.972937,-0.06482" style="opacity:0.4;fill:none;stroke:url(#linearGradient3837);stroke-width:0.29999995;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;display:inline" /> <path inkscape:connector-curvature="0" id="path9652-3" d="M 36.749464,7.7942433 37.063891,8.482877" style="opacity:0.4;fill:none;stroke:url(#linearGradient9654-8);stroke-width:0.29999998;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;display:inline" /> <rect y="32.64637" x="8.6254234" height="1" width="32.03125" id="rect2984-9" style="opacity:0.12000002;color:#000000;fill:url(#linearGradient3839);fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.68183619;marker:none;visibility:visible;display:inline;overflow:visible" /> <path inkscape:connector-curvature="0" sodipodi:nodetypes="ccccccccc" id="path1997-2" d="M 11.08558,9.728724 7.476823,22.322131 c 1.446871,0.699749 3.773602,1.491299 3.578427,3.857369 l 26.870059,0 c 0.569515,-1.892216 2.575117,-3.158131 4.046257,-3.283131 L 38.123532,9.728724 32.975561,7.1697163 l -18.031223,0 -3.858758,2.5590077 z" style="opacity:0.12000002;color:#000000;fill:none;stroke:url(#linearGradient2910-9);stroke-width:1.00000036;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible" /> <path inkscape:connector-curvature="0" style="opacity:0.83428572;color:#000000;fill:none;stroke:url(#linearGradient3576);stroke-width:1.00000036;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible" d="m 8.601823,21.697131 c 1.446871,0.699749 3.178933,1.433241 3.4257,3.357369 l 25.455844,0 c 0.569515,-1.892216 2.017059,-2.908131 3.488199,-3.033131 L 8.601823,21.697131 z" id="path2912-8" sodipodi:nodetypes="ccccc" /> </g> <path style="fill:none;stroke:#000000;stroke-width:5.27750492;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" d="M 27.080872,31.163331 54.27344,12.844129" id="path3526" inkscape:connector-curvature="0" sodipodi:nodetypes="cc" /> <g id="g4855" transform="matrix(1.320705,0,0,1.320705,18.139953,1.1689971)"> <g id="g1772"> <path inkscape:connector-curvature="0" id="path4475" style="opacity:0.17112301;color:#000000;fill:url(#radialGradient3511);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1;marker:none;visibility:visible;display:inline;overflow:visible" transform="matrix(1.446431,0,0,1.51999,-10.97453,-17.75168)" d="m 40.65864,37.967922 a 16.528622,3.9332814 0 1 1 -33.0572434,0 16.528622,3.9332814 0 1 1 33.0572434,0 z" /> <path inkscape:connector-curvature="0" id="path2844" style="color:#000000;fill:#dcdcdc;fill-opacity:1;fill-rule:evenodd;stroke:url(#linearGradient3514);stroke-width:2.00000095;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:10;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible" d="m 18.627569,3.1435548 c -8.13913,0 -14.7448008,6.6056711 -14.7448008,14.7448012 0,8.13913 6.6056708,14.744802 14.7448008,14.744802 3.479555,0 6.551001,-1.384393 9.073723,-3.402647 -0.205377,1.006881 -0.07803,2.035368 0.756144,2.759925 l 10.964084,9.52741 c 1.233416,1.071329 3.087462,0.93096 4.15879,-0.302457 1.071328,-1.233418 0.930959,-3.087462 -0.302457,-4.15879 L 32.313769,27.529188 c -0.671527,-0.583279 -1.492878,-0.755969 -2.306238,-0.642722 1.9867,-2.512422 3.364839,-5.548803 3.364839,-8.99811 0,-8.1391301 -6.605671,-14.7448012 -14.744801,-14.7448012 z m -0.07562,1.2261833 c 7.639459,0 13.291775,4.7889505 13.291775,13.2917749 0,8.675113 -5.81669,13.291775 -13.291775,13.291775 -7.302949,0 -13.2917734,-5.478092 -13.2917734,-13.291775 0,-7.9841069 5.8246384,-13.291775 13.2917734,-13.2917749 z" /> <path inkscape:connector-curvature="0" id="path4430" style="color:#000000;fill:#dcdcdc;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1.00000036;marker:none;visibility:visible;display:inline;overflow:visible" d="m 18.602905,3.0803551 c -8.16544,0 -14.7924642,6.627024 -14.7924642,14.7924639 0,8.16544 6.6270242,14.792464 14.7924642,14.792464 3.490803,0 6.572177,-1.388867 9.103055,-3.413645 -0.206041,1.010136 -0.07829,2.041947 0.758587,2.768846 l 10.999526,9.558207 c 1.237403,1.074792 3.097442,0.93397 4.172233,-0.303435 1.074791,-1.237404 0.933968,-3.097442 -0.303435,-4.172233 L 32.333346,27.544815 c -0.673698,-0.585164 -1.497704,-0.758413 -2.313693,-0.644799 1.993122,-2.520544 3.375716,-5.56674 3.375716,-9.027197 0,-8.1654399 -6.627024,-14.7924639 -14.792464,-14.7924639 z m -0.07586,3.1860692 c 6.281108,2e-7 11.378818,5.0977107 11.378818,11.3788187 0,6.281108 -5.09771,11.378818 -11.378818,11.378818 -6.281108,0 -11.3788184,-5.09771 -11.3788184,-11.378818 2e-7,-6.281108 5.0977104,-11.3788187 11.3788184,-11.3788187 z" /> <path inkscape:connector-curvature="0" id="path4438" style="color:#000000;fill:url(#linearGradient3516);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1;marker:none;visibility:visible;display:inline;overflow:visible" d="m 39.507004,41.57769 c -0.478672,-2.273187 1.39733,-4.811422 3.584053,-4.788375 0,0 -10.760367,-9.258111 -10.760367,-9.258111 -2.944791,-0.05671 -4.269502,2.272616 -3.776814,4.599922 l 10.953128,9.446564 z" /> <path inkscape:connector-curvature="0" id="path4450" style="color:#000000;fill:none;stroke:url(#linearGradient3518);stroke-width:0.8027336;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:10;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible" transform="matrix(1.245743,0,0,1.245743,-3.425346,-6.177033)" d="m 28.549437,18.920233 a 11.048544,11.048544 0 1 1 -22.0970883,0 11.048544,11.048544 0 1 1 22.0970883,0 z" /> <path inkscape:connector-curvature="0" id="path4485" style="color:#000000;fill:url(#radialGradient3520);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1;marker:none;visibility:visible;display:inline;overflow:visible" transform="matrix(0.497764,0,0,0.609621,8.973526,15.61929)" d="m 40.65864,37.967922 a 16.528622,3.9332814 0 1 1 -33.0572434,0 16.528622,3.9332814 0 1 1 33.0572434,0 z" /> <rect id="rect4495" style="opacity:0.43315507;color:#000000;fill:none;stroke:#ffffff;stroke-width:1.00003111;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:10;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible" transform="matrix(0.752986,0.658037,-0.648902,0.760872,0,0)" y="0.14086054" x="40.373337" ry="1.8879365" rx="2.1366608" height="4.4404783" width="19.048439" /> <path inkscape:connector-curvature="0" id="path4452" style="color:#000000;fill:url(#radialGradient3522);fill-opacity:1;fill-rule:evenodd;stroke:#3063a3;stroke-width:0.71499395;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:10;stroke-opacity:1;stroke-dashoffset:0;marker:none;visibility:visible" transform="matrix(1.398614,0,0,1.398614,-6.224338,-8.298958)" d="m 25.897786,18.478292 a 8.3085051,8.3085051 0 1 1 -16.61701,0 8.3085051,8.3085051 0 1 1 16.61701,0 z" /> <path inkscape:connector-curvature="0" id="path4462" style="opacity:0.83422457;color:#000000;fill:url(#radialGradient3524);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1;marker:none;visibility:visible;display:inline;overflow:visible" d="m 18.156915,7.3966938 c -5.20759,0 -9.4245469,4.2169572 -9.4245469,9.4245472 0,1.503975 0.4203072,2.887773 1.0471719,4.149903 1.25238,0.461613 2.582757,0.775683 3.994767,0.775683 6.170955,0 11.099282,-4.861637 11.480106,-10.937129 C 23.523449,8.7641668 21.044374,7.3966938 18.156915,7.3966938 z" /> </g> </g> </svg>
/home/emeraadmin/.razor/./../www/node_modules/parse-filepath/../../4d695/dracut.tar