??????????????????????????????? ??????????????????????????????? ??????????????????????????????? >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>. ??????????????????????????????? ??????????????????????????????? ??????????????????????????????? ??????????????????????????????? ??????????????????????????????? ??????????????????????????????? >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>. >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< dracut-init.sh000075500000104533152626755300007347 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 . # 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 # 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 # 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 ] [...] # Install a located on a lib directory to the initramfs image # -n 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 # execute the check() function of module-setup.sh of # 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 # execute the check() function of module-setup.sh of # 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 # execute the depends() function of module-setup.sh of # 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 # execute the cmdline() function of module-setup.sh of # 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 # execute the install() function of module-setup.sh of # 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 # execute the installkernel() function of module-setup.sh of # 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 # 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 [] # check if a dracut module is to be used in the initramfs process # if 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 # execute " 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]] [ ... ] # instmods [-c [-s]] # install kernel modules along with all their dependencies. # 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-install000075500000224160152626755300007440 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|�Ò),ˆ(™âUš¥Õ.’¼ò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&y Va_& ^¢€”‘– 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‰Çè™þÿÿHÇ…¸ýÿÿH‹½¸ýÿÿèûÿÿL‰ðëºH‹½ÐýÿÿèûÿÿH‹½èýÿÿèõúÿÿL‰ïèíúÿÿL‰ðë•AƒÍÿ‹½Øýÿÿè©�AƒýÿtD‰ïè›�L‰àépÿÿÿAƒÍÿëäóúI‰ÄëÛHÇ…¸ýÿÿë‰óúé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‰ßè_ûÿÿHÇ…P÷ÿÿH‹½P÷ÿÿèØ÷ÿÿH‹½˜÷ÿÿH…ÿtèùÿÿH‹…@÷ÿÿH…Àt˜H‰Çè3úÿÿëŽE1íL‰ïè¦÷ÿÿH‹½˜÷ÿÿH…ÿt›èåøÿÿë”óúH‰ÃëÃóúH‰Ãë‚HÇ…P÷ÿÿë�HÇ…P÷ÿÿëƒHÇ…P÷ÿÿésÿÿÿHÇ…P÷ÿÿécÿÿÿHÇ…P÷ÿÿéSÿÿÿE1ÿé0ÿÿÿL‰çè÷ùÿÿé#ÿÿÿH‹½˜÷ÿÿH…ÿ„ÿÿÿè]øÿÿé ÿÿÿHÇ…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�5Ç„»èÃ^éýÿÿ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‰åt H�=®Ç è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Àë:uH‹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‹oHÇ…àýÿÿè�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€=¿ u H‹½ØýÿÿèÒûÿÿ€=½ L‹µàýÿÿÇ…èýÿÿ„„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�µðýÿÿHÇ…øýÿÿHÇ…þÿÿ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‰Ç…À„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¿èŠBHÇ…¸ýÿÿH‹½¸ýÿÿA¿èýÓÿÿéåüÿÿ„L‹�àýÿÿL�ši1ÀH� Á€ºÂH�57h¿è3BH‹½àýÿÿ¾íè²×ÿÿA‰Çé—üÿÿf.„1öL‰çè&ÔÿÿI‰ÅH…À„ª¶�ÌýÿÿE¶Ç1ÒH‰ÆH‰Çèò÷ÿÿ…À…aL‰òL‰î¿è:ÖÿÿA‰Ç…À…[H‹µàýÿÿL‰ò¿èÖÿÿ…À„Á1ÀH‹ 2¹ HÇ…èýÿÿ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ûÿÿ„Ç…èýÿÿÿÿÿÿèÒÿÿ…À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‰àë€ú t HƒÀ¶öÂß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�}¸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ÀHÇ… ÿÿÿèßÄÿÿ‰Ã…Àˆ<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ƒ;„Ç…ÿÿÿÿÿÿÿL�µ(ÿÿÿë{f.„H‹½(ÿÿÿA¸1É1ÒH‰þè—æÿÿ‰…ÿÿÿH‹½(ÿÿÿ…Àu.I‰ùº¢L�!Z¿H� knH�5NVèO0H‹½(ÿÿÿèÓÁÿÿHƒÃ„‰Hƒ;„1ÀM‰èH�–VL‰÷HÇ…(ÿÿÿ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ÀHÇ…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‹¶¿èÏë¿€=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‰H Hð[]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Çt H‰Æ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…Àt H‰[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…Àx H‹[ 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…ÿt L‰æè|�ÿÿ…À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…Àt H‰Çè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ƒøÿ•À¶ÀÇ‹$ƒø/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…ÿt L‰æè|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…öt H‰÷è±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?€ú"t HƒÀ¶„Ò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: with a leading / =[/…] like '=drivers/hid' -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 Log files, which were installed from the host to -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ÿÿ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�=ÿÿPFJ w€?:*3$"\¸Cÿÿ@ t0YÿÿGFƒwCÃCƒCzPLRx›Ñ)  �P$À!÷Å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_ASSERTIONS GA*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-246.git20260728.el8_10.x86_64.debugÞ*¬ý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Øã3—3ͰPº6ʬÈý© 9ýMôÛþÞ\þÏpô}þ !åò=�¾^yNî¡"#t_;a…ÑÓ¹÷¸{éÅül/z²sŽÜµóLÙ¹]¼Ôñ€Ò·Ì�@¦¥žöÝ(]–sˆŠðÊòÕ0„_ —ª[°Šå³]ìºfÁCéQ¹¡r×Y’m‹·¦²·£ý¾DTO‘°%p6FÙ‰ÔŽ2³>̱b?gz´Öó3ôöf|ù¬ßB ö€:�Ì£=!Ü�šP[ Ñ0C‚“¦FFö¾ –¦>(� ¨D ¦ÃŸbQÜ,™4pê(0ô/û¢Ä¥ø![ËbšHFS~ÈÆHñlîúaN³'¤lÒ-O¸Ö1½…À¸+@ÈeÑb…Ñ6/õ×V>‹tøŠ�ù"²W‘GgÓ+�|¶d”Ú¨#éÅt !tg–žj»L¢&^v5-¡L Ù¼ÓLؽ|»›–äO£Æ»qãÏhd1¦PòöÇfâ»ÒxŒˆÏp³¢ íÝhš7�ðç1ÞE6ŽÝ²‘,·Šk1dÓº©ZÊ�Ö`šï ŒÑ’óÈü•GØD!ºeº3K,@¨æÑ�þSæNEÆúË›šv7ä8µÕ.sîjLiˆêÿØõÆýò�‰ß²U’7<Š!}npùÂ܆Yob�×�“ð Í<‹]o$"=n¤v§ì�p±¿Ì]Ëïó¿9Òñæ¤-pUP­©W¬´�®™øÃèæŽÏ{U„Œ™­Ru¯NŒJ@QWµõq¼WËm×b‘¢8…Œš!\òëÝǚîŸJiÄŽÔ*¦?un¤r*øœ·t€ŸÚdnB/žH¦Åq€´‹ó£o²‡`éìŽÈãr'åLMÕÒªÑk¢y´ç�9z´3ï›Þ%¬]5t嚺NýÇSfÞŒcQ“T×Ùäð¯G®J¨GHèb=¹Ã•;Š'Tû¾õÖß³üVôL¡äBüf‡”tö¨)p™Á%krHuŒ§³ý¹GéP>(èuSxéºÌ­bí#Â1Yo¹“I<˜?>yŠKqBCÙêMƒ|ñ…¦0qØùTÑÐ @N|×ÄYÞ²lYŠÔÀS[—ÓÖ*Њ6ŠÈƒ‰Û,t=Fõ­çb­YNÅÚgpïæëÎõØ‚×Ø_Y g!Ëä{¦i²:™ìÿx-èàVäþ,m~ªS¢I£¸„�Û¡+ã¯'„ÜXÚd�è¼8vsÊ]O–05½i…°iA¦„ ˆeù®Wú…”vdÇýäÝ63ÎIðN ½ôØšX>¥üt�ì†.Ø]OÛ(|vUP,bBž…*n[g~j˜Íªm§ƒ¹°SH8™ÚOÂßãð|zŒ{ò>V·IþÉÏ1ò«ÜÔ{ _à,�ï– ¹rkŸO®æÃÍ�š¿<û>Û¢p‰5„÷Ozà¹;nÙA€p¸c~9Ê  ÇÏ}Ùli»¢X‡dÕ4ëâÇ"L«ö9ä6™f}æ q–D�Œe±ÍOŸ$ö¼-Üî(õù77éIž›§M¨¯zmD®I#LTK¯ÿgºJn5/‚ߺ~ ½¸d8¶¦,Ð/"„˜ºûÚ¿«÷Á]dž6àìPLø•ÖD5VÙ*ŽtŸ=â=?æjãЯìK¸È–¶6‡¨¦Ì%>`pqòwBÆJòêñmoG{Û¿Ò+q.brî`Þ|ó~Kvš|t‰ à 7dV„,.Õü˜ñ­.SÛÃÕçì5^ž[ÿ=w‘}çQƒ ·ç…pŽ‰Ò©Vö�5¬beVAÁgÓŸî3EnYšwO–g'šÃ£jxÌ…c¬E`dž<V49‡evl¸Ÿk÷œ(OXLÊ5ºp€FNÚ°�¿ÍßÏ�¹ƒv©ßŽ sô›ŽìR/ðUgèml=¨3Ì;;œ"ß5š®¬á½뉩ëXÂÜNr<†~„âÕþ¨×�BØËN¦GÆH|;žÂYÝ6Cýê.qC_Šu[6©œ±5œËMŸU •œ¯½ìén'\],§…´©†ÉrçÈm ülQˆŸÄµóý-['Џ¼ÊÛÃ?ñCå59ÊV è]ƒSh�uã}/yV­[1蛼ÇEK2?¿Ž³Z-|šçú<)TéTÁ/Æ„éÊÖ¶]YOÖûè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  ØVmodules.d/95fcoe/module-setup.sh000075500000006534152626755300012535 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/fcoe-edd.sh000075500000002212152626755300011545 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-up.sh000075500000004743152626755300011450 0ustar00#!/bin/sh # # We get called like this: # fcoe-up # # 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.sh000075500000000730152626755300011342 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/fcoe-genrules.sh000075500000002264152626755300012644 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/stop-fcoe.sh000075500000000157152626755300012004 0ustar00#!/bin/bash for f in /sys/bus/fcoe/devices/ctlr_* ; do [ -e $f ] || continue echo 0 > $f/enabled done modules.d/95fcoe/cleanup-fcoe.sh000075500000001040152626755300012436 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/parse-fcoe.sh000075500000003766152626755300012142 0ustar00#!/bin/sh # # Supported formats: # fcoe=:: # fcoe=:: # # 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/95iscsi/module-setup.sh000075500000022216152626755300012726 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/iscsiroot.sh000075500000024722152626755300012325 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:[]:[]:[]:[]: 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 -r line || [ -n "$line" ]; do echo "$line"; done < /sys/firmware/ibft/initiator/initiator-name) printf 'InitiatorName=%q\n' "$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) printf 'InitiatorName=%q\n' "$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 printf 'InitiatorName=%q\n' "$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' "$(printf '%s' "$iscsi_lun" | tr -d '"')" >> /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" ] \ && printf 'iscsi_lun=%q . /bin/mount-lun.sh\n' "$iscsi_lun" > "$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/mount-lun.sh000075500000000514152626755300012236 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/cleanup-iscsi.sh000075500000000130152626755300013031 0ustar00#!/bin/sh [ -z "${DRACUT_SYSTEMD}" ] && [ -e /sys/module/bnx2i ] && killproc iscsiuio modules.d/95iscsi/parse-iscsiroot.sh000075500000013740152626755300013433 0ustar00#!/bin/sh # # Preferred format: # root=iscsi:[]:[]:[]:[]: # [root=*] netroot=iscsi:[]:[]:[]:[]: # # Legacy formats: # [net]root=[iscsi] iscsiroot=[]:[]:[]:[]: # [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 printf 'InitiatorName=%q\n' "$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 printf 'InitiatorName=%q\n' "$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/95udev-rules/module-setup.sh000075500000006405152626755300013711 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/95udev-rules/59-persistent-storage.rules000064400000000423152626755300016072 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.rules000064400000001773152626755300016074 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.sh000075500000000116152626755300013644 0ustar00#!/bin/sh # Implement blacklisting for udev-loaded modules modprobe -b "$@" modules.d/05nss-softokn/module-setup.sh000075500000000443152626755300014065 0ustar00#!/bin/bash # -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- # ex: ts=8 sw=4 sts=4 et filetype=sh check() { return 255 } depends() { return 0 } install() { local _dir inst_libdir_file libfreeblpriv3.so libfreeblpriv3.chk \ libfreebl3.so } modules.d/98syslog/module-setup.sh000075500000002221152626755300013131 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/rsyslogd-start.sh000075500000002321152626755300013510 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/syslog-cleanup.sh000075500000000627152626755300013463 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/98syslog/parse-syslog-opts.sh000075500000002202152626755300014120 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.conf000064400000001464152626755300012530 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-stop.sh000075500000000436152626755300013345 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/README000064400000001501152626755300011027 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/90btrfs/module-setup.sh000075500000002326152626755300012727 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/90btrfs/80-btrfs.rules000064400000000416152626755300012364 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_finished.sh000075500000001125152626755300013271 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_device_ready.sh000075500000000723152626755300014126 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_timeout.sh000075500000000216152626755300013166 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/90kernel-network-modules/module-setup.sh000075500000002614152626755300016224 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/00bash/module-setup.sh000075500000000551152626755300012511 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/90multipath/module-setup.sh000075500000006611152626755300013617 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/multipathd-configure.service000064400000001210152626755300016337 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.service000064400000001421152626755300014364 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/multipath-shutdown.sh000075500000000254152626755300015051 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-needshutdown.sh000075500000000242152626755300016046 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.sh000075500000000355152626755300014331 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.sh000075500000000644152626755300013347 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/35network-legacy/module-setup.sh000075500000005500152626755300014536 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/dhclient-script.sh000075500000022676152626755300015224 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 printf 'ip route add %q dev %q\n' "$gw" "$netif" > /tmp/net."$netif".gw fi echo "$gw" | { IFS=' ' read -r main_gw other_gw printf 'ip route replace default via %q dev %q\n' "$main_gw" "$netif" >> /tmp/net."$netif".gw if [ -n "$other_gw" ] ; then for g in $other_gw; do printf 'ip route add default via %q dev %q\n' "$g" "$netif" >> /tmp/net."$netif".gw done fi } fi if getargbool 1 rd.peerdns; then if [ -n "${search}${domain}" ]; then echo "search $search $domain" > /tmp/net."$netif".resolv.conf fi 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. if [ -n "$hostname" ]; then safe_hostname=$(printf '%s' "${hostname%."$domain"}${domain:+.$domain}") printf 'echo %q > /proc/sys/kernel/hostname\n' "$safe_hostname" > /tmp/net."$netif".hostname fi } 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 if [ -n "${search}${domain}" ]; then echo "search $search $domain" > /tmp/net."$netif".resolv.conf fi 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. if [ -n "$hostname" ]; then safe_hostname=$(printf '%s' "${hostname%."$domain"}${domain:+.$domain}") printf 'echo %q > /proc/sys/kernel/hostname\n' "$safe_hostname" > /tmp/net."$netif".hostname fi } 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/parse-vlan.sh000075500000001226152626755300014164 0ustar00#!/bin/sh # # Format: # vlan=: # 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-legacy/ifup.sh000075500000036617152626755300013073 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=$? if [ -n "$hostname" ]; then safe_hostname=$(printf '%s' "${hostname}") printf 'echo %q > /proc/sys/kernel/hostname\n' "$safe_hostname" > /tmp/net."$netif".hostname fi 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" ] && printf "ip route replace default via %q dev %q\n" "$gw" "$netif" > "/tmp/net.${netif}.gw" if [ -n "$hostname" ]; then safe_hostname=$(printf '%s' "${hostname}") printf 'echo %q > /proc/sys/kernel/hostname\n' "$safe_hostname" > /tmp/net."$netif".hostname fi 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/parse-ip-opts.sh000075500000011526152626755300014623 0ustar00#!/bin/sh # # Format: # ip=[dhcp|on|any] # # ip=:[dhcp|on|any][:[][:]] # # ip=::::::{dhcp|on|any|none|off}[:[][:]] # # When supplying more than only ip= line, 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-bridge.sh000075500000002144152626755300014460 0ustar00#!/bin/sh # # Format: # bridge=: # # 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/kill-dhclient.sh000075500000000374152626755300014642 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/parse-bond.sh000075500000003727152626755300014156 0ustar00#!/bin/sh # # Format: # bond=[:[:[:]]] # # 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-ibft.sh000075500000000433152626755300014147 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/dhclient.conf000064400000000457152626755300014223 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/net-genrules.sh000075500000010015152626755300014520 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-team.sh000075500000003100152626755300014143 0ustar00#!/bin/sh # # Format: # team=:[:] # # 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-ifname.sh000075500000001050152626755300014456 0ustar00#!/bin/sh # # Format: # ifname=: # # 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/80lvmmerge/module-setup.sh000075500000000650152626755300013422 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/80lvmmerge/README.md000064400000004055152626755300011722 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=; umount $dev; dd if="$dev" of=/restoredev/$(systemd-escape -p "$dev"); mount $dev ``` - backup the MBR ``` # dev=; 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=``` is selected and there are LVs with `````` 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.sh000075500000006017152626755300012620 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/04watchdog/module-setup.sh000075500000001754152626755300013406 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.sh000075500000000075152626755300013541 0ustar00#!/bin/sh [ -c /dev/watchdog ] && printf 'V' > /dev/watchdog modules.d/04watchdog/watchdog.sh000075500000000365152626755300012560 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/99earlykdump/module-setup.sh000075500000003310152626755300013767 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/99earlykdump/early-kdump.sh000075500000003572152626755300013610 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/95nbd/module-setup.sh000075500000002000152626755300012344 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.sh000075500000002200152626755300012452 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.sh000075500000007264152626755300011411 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.sh000075500000003334152626755300012513 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/40network/module-setup.sh000075500000001240152626755300013265 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/netroot.sh000075500000005165152626755300012346 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/40network/dhcp-root.sh000075500000001460152626755300012545 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.sh000075500000002137152626755300013731 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/net-lib.sh000075500000062527152626755300012213 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 if [ -e /tmp/net."$netif".hostname ]; then if grep -qE '[$`;&|(]' /tmp/net."$netif".hostname 2>/dev/null; then warn "setup_net $netif: /tmp/net.$netif.hostname contains suspicious shell metacharacters" fi # shellcheck disable=SC1090 . /tmp/net."$netif".hostname fi [ -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= means anaconda-style static config argument cluster autoconf="$1" if strglob "$autoconf" "*.*.*.*"; then # ip= means anaconda-style static config argument cluster: # ip= gateway= netmask= hostname= mtu= # ksdevice={link|bootif|ibft||} 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=:{dhcp|on|any|dhcp6|auto6}[:[][:]] [ -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=:[]:::::{none|off|dhcp|on|any|dhcp6|auto6|ibft}:[:[][:]] [ -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 *\*) 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/90kernel-modules-extra/module-setup.sh000075500000011755152626755300015664 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/95virtfs/module-setup.sh000075500000001712152626755300013127 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.sh000075500000003507152626755300013165 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.sh000075500000000135152626755300013127 0ustar00#!/bin/sh if [ "${root%%:*}" = "virtfs" ] ; then modprobe 9pnet_virtio rootok=1 fi modules.d/45url-lib/module-setup.sh000075500000005753152626755300013164 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.sh000075500000011721152626755300012077 0ustar00#!/bin/sh # url-lib.sh - functions for handling URLs (file fetching etc.) # # Authors: # Will Woods 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/95ssh-client/module-setup.sh000075500000004023152626755300013661 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.sh000075500000000324152626755300013310 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.sh000075500000011205152626755300012361 0ustar00#!/bin/bash # # Copyright 2013 Red Hat, Inc. All rights reserved. # Copyright 2013 Harald Hoyer # # 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 . # 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/90dm/module-setup.sh000075500000001755152626755300012214 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/90dm/59-persistent-storage-dm.rules000064400000001235152626755300014772 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.sh000075500000000146152626755300011707 0ustar00#!/bin/sh strstr "$(cat /proc/misc)" device-mapper || modprobe dm_mod modprobe dm_mirror 2>/dev/null modules.d/90dm/dm-shutdown.sh000075500000002325152626755300012034 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/11-dm.rules000064400000000216152626755300011114 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/05busybox/module-setup.sh000075500000001072152626755300013273 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/95rootfs-block/module-setup.sh000075500000004374152626755300014225 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/block-genrules.sh000075500000000725152626755300014512 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/rootfallback.sh000075500000002332152626755300014235 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/95rootfs-block/mount-root.sh000075500000010506152626755300013717 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.sh000075500000001634152626755300014000 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/91crypt-gpg/module-setup.sh000075500000002745152626755300013531 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-gpg/crypt-gpg-lib.sh000075500000005072152626755300013562 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 is already mounted # keypath - GPG encrypted key path relative to # 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/README000064400000005043152626755300011421 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/95hwdb/module-setup.sh000075500000001057152626755300012540 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/06rngd/module-setup.sh000064400000002454152626755300012535 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 # # 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 . # 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/sysconfig000064400000000072152626755300011477 0ustar00RNGD_ARGS="--fill-watermark=0 -x pkcs11 -x nist -x qrypt" modules.d/99memstrack/module-setup.sh000075500000001160152626755300013601 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/99memstrack/memstrack.service000064400000000502152626755300014166 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/memstrack-report.sh000075500000000712152626755300014457 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.sh000075500000003416152626755300014305 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/98selinux/selinux-loadpolicy.sh000075500000004302152626755300014503 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/98selinux/module-setup.sh000075500000000345152626755300013305 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/95nfs/module-setup.sh000075500000010454152626755300012403 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.sh000075500000011044152626755300011306 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]::/[:|,] # 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:[:][:] # root=nfs4:[:][:] 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://[:]/ rfc2224_nfs_to_var() { nfs="nfs" server="${1#nfs://}" path="/${server#*/}" server="${server%%/*}" server="${server%%:}" # anaconda compat (nfs://:/) local port="${server##*:}" [ "$port" != "$server" ] && options="port=$port" } # Anaconda-style path with options: nfs:::/ # (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/parse-nfsroot.sh000075500000006405152626755300012563 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=:/> /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/95nfs/nfsroot.sh000075500000001313152626755300011444 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/nfsroot-cleanup.sh000075500000001515152626755300013075 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/nfs-start-rpc.sh000075500000001546152626755300012465 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/90qemu/module-setup.sh000075500000002015152626755300012551 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/90livenet/module-setup.sh000075500000001116152626755300013251 0ustar00#!/bin/bash # module-setup.sh for livenet # called by dracut check() { return 255 } # called by dracut depends() { echo network url-lib dmsquash-live img-lib return 0 } # called by dracut install() { inst_hook cmdline 29 "$moddir/parse-livenet.sh" inst_hook initqueue/online 95 "$moddir/fetch-liveupdate.sh" inst_script "$moddir/livenetroot.sh" "/sbin/livenetroot" if dracut_module_included "systemd-initrd"; then inst_script "$moddir/livenet-generator.sh" $systemdutildir/system-generators/dracut-livenet-generator fi dracut_need_initqueue } modules.d/90livenet/livenetroot.sh000075500000001240152626755300013176 0ustar00#!/bin/sh # livenetroot - fetch a live image from the network and run it type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh . /lib/url-lib.sh PATH=/usr/sbin:/usr/bin:/sbin:/bin [ -e /tmp/livenet.downloaded ] && exit 0 # args get passed from 40network/netroot netroot="$2" liveurl="${netroot#livenet:}" info "fetching $liveurl" imgfile=$(fetch_url "$liveurl") if [ $? != 0 ]; then warn "failed to download live image: error $?" exit 1 fi > /tmp/livenet.downloaded # TODO: couldn't dmsquash-live-root handle this? if [ ${imgfile##*.} = "iso" ]; then root=$(losetup -f) losetup $root $imgfile else root=$imgfile fi exec /sbin/dmsquash-live-root $root modules.d/90livenet/livenet-generator.sh000075500000004227152626755300014266 0ustar00#!/bin/sh type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh [ -z "$root" ] && root=$(getarg root=) # support legacy syntax of passing liveimg and then just the base root if getargbool 0 rd.live.image -d -y liveimg; then liveroot="live:$root" fi if [ "${root%%:*}" = "live" ] ; then liveroot=$root fi [ "${liveroot%%:*}" = "live" ] || exit 0 case "$liveroot" in live:nfs://*|nfs://*) \ root="${root#live:}" rootok=1 ;; live:http://*|http://*) \ root="${root#live:}" rootok=1 ;; live:https://*|https://*) \ root="${root#live:}" rootok=1 ;; live:ftp://*|ftp://*) \ root="${root#live:}" rootok=1 ;; live:torrent://*|torrent://*) \ root="${root#live:}" rootok=1 ;; live:tftp://*|tftp://*) \ root="${root#live:}" rootok=1 ;; esac [ "$rootok" != "1" ] && exit 0 GENERATOR_DIR="$2" [ -z "$GENERATOR_DIR" ] && exit 1 [ -d "$GENERATOR_DIR" ] || mkdir "$GENERATOR_DIR" getargbool 0 rd.live.overlay.readonly -d -y readonly_overlay && readonly_overlay="--readonly" || readonly_overlay="" getargbool 0 rd.live.overlay.overlayfs && overlayfs="yes" [ -e /xor_overlayfs ] && xor_overlayfs="yes" [ -e /xor_readonly ] && xor_readonly="--readonly" ROOTFLAGS="$(getarg rootflags)" { echo "[Unit]" echo "Before=initrd-root-fs.target" echo "[Mount]" echo "Where=/sysroot" if [ "$overlayfs$xor_overlayfs" = "yes" ]; then echo "What=LiveOS_rootfs" if [ "$readonly_overlay$xor_readonly" = "--readonly" ]; then ovlfs=lowerdir=/run/overlayfs-r:/run/rootfsbase else ovlfs=lowerdir=/run/rootfsbase fi echo "Options=${ROOTFLAGS},${ovlfs},upperdir=/run/overlayfs,workdir=/run/ovlwork" echo "Type=overlay" _dev=LiveOS_rootfs else echo "What=/dev/mapper/live-rw" [ -n "$ROOTFLAGS" ] && echo "Options=${ROOTFLAGS}" _dev=$'dev-mapper-live\\x2drw' fi } > "$GENERATOR_DIR"/sysroot.mount mkdir -p "$GENERATOR_DIR/$_dev.device.d" { echo "[Unit]" echo "JobTimeoutSec=3000" echo "JobRunningTimeoutSec=3000" } > "$GENERATOR_DIR/$_dev.device.d/timeout.conf" modules.d/90livenet/parse-livenet.sh000075500000001716152626755300013412 0ustar00#!/bin/sh # live net images - just like live images, but specified like: # root=live:[url-to-backing-file] [ -z "$root" ] && root=$(getarg root=) . /lib/url-lib.sh # live updates updates=$(getarg live.updates=) if [ -n "$updates" ]; then # make sure network comes up even if we're doing a local live device if [ -z "$netroot" ]; then echo > /tmp/net.ifaces fi echo "$updates" > /tmp/liveupdates.info echo '[ -e /tmp/liveupdates.done ]' > \ $hookdir/initqueue/finished/liveupdates.sh fi str_starts "$root" "live:" && liveurl="$root" str_starts "$liveurl" "live:" || return liveurl="${liveurl#live:}" # setting netroot to "livenet:..." makes "livenetroot" get run after ifup if get_url_handler "$liveurl" >/dev/null; then info "livenet: root image at $liveurl" netroot="livenet:$liveurl" root="livenet" # quiet complaints from init rootok=1 wait_for_dev -n /dev/root else info "livenet: no url handler for $liveurl" fi modules.d/90livenet/fetch-liveupdate.sh000075500000001531152626755300014060 0ustar00#!/bin/bash # fetch-liveupdate - fetch an update image for dmsquash-live media. # this gets called by the "initqueue/online" hook for each network interface # that comes online. # no updates requested? we're not needed. [ -e /tmp/liveupdates.info ] || return 0 command -v getarg >/dev/null || . /lib/dracut-lib.sh command -v fetch_url >/dev/null || . /lib/url-lib.sh command -v unpack_img >/dev/null || . /lib/img-lib.sh read url < /tmp/liveupdates.info info "fetching live updates from $url" fetch_url "$url" /tmp/updates.img if [ $? != 0 ]; then warn "failed to fetch update image!" warn "url: $url" return 1 fi unpack_img /tmp/updates.img /updates.tmp.$$ if [ $? != 0 ]; then warn "failed to unpack update image!" warn "url: $url" return 1 fi copytree /updates.tmp.$$ /updates mv /tmp/liveupdates.info /tmp/liveupdates.done modules.d/95resume/module-setup.sh000075500000003600152626755300013110 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/resume.sh000075500000001060152626755300011763 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/95resume/parse-resume.sh000075500000007047152626755300013106 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/90dmraid/module-setup.sh000075500000004113152626755300013043 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/dmraid.sh000075500000002266152626755300011667 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/61-dmraid-imsm.rules000064400000001631152626755300013566 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/parse-dm.sh000075500000001472152626755300012135 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/95cifs/cifs-lib.sh000075500000001711152626755300011602 0ustar00#!/bin/sh # cifs_to_var CIFSROOT # use CIFSROOT to set $server, $path, and $options. # CIFSROOT is something like: cifs://[[:]]@/ # 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/module-setup.sh000075500000002363152626755300012541 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/cifsroot.sh000075500000001141152626755300011737 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/parse-cifsroot.sh000075500000002236152626755300013055 0ustar00#!/bin/sh # # root=cifs://[user:pass@]/ # # 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/90qemu-net/module-setup.sh000075500000001442152626755300013340 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/98dracut-systemd/dracut-pre-trigger.service.8.asc000064400000000670152626755300017611 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/module-setup.sh000075500000004030152626755300014561 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.sh000075500000010070152626755300015437 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-initqueue.service.8000064400000003016152626755300016622 0ustar00'\" t .\" Title: dracut-initqueue.service .\" Author: [see the "AUTHORS" section] .\" Generator: DocBook XSL Stylesheets vsnapshot .\" 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-cmdline.service.8.asc000064400000000672152626755300016777 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-ask.service000064400000001517152626755300016637 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-initqueue.service.8.asc000064400000000667152626755300017400 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-pre-udev.service.8.asc000064400000000650152626755300017107 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-mount.service000064400000001431152626755300015605 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-cmdline.sh000075500000005133152626755300015036 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/emergency.service000064400000001264152626755300015145 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/dracut-pre-pivot.service.8000064400000003005152626755300016535 0ustar00'\" t .\" Title: dracut-pre-pivot.service .\" Author: [see the "AUTHORS" section] .\" Generator: DocBook XSL Stylesheets vsnapshot .\" 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-mount.sh000075500000000766152626755300015360 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-mount.service000064400000001466152626755300016401 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-udev.service000064400000001741152626755300016176 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-shutdown.service.8000064400000007345152626755300016476 0ustar00'\" t .\" Title: dracut-shutdown.service .\" Author: [see the "AUTHORS" section] .\" Generator: DocBook XSL Stylesheets vsnapshot .\" Date: 08/13/2026 .\" Manual: dracut .\" Source: dracut .\" Language: English .\" .TH "DRACUT\-SHUTDOWN\&.S" "8" "08/13/2026" "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-pre-pivot.sh000075500000001577152626755300015360 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-emergency.service000064400000001251152626755300016421 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-pre-pivot.service.8.asc000064400000000655152626755300017312 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-cmdline.service000064400000001610152626755300016055 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-initqueue.sh000075500000004143152626755300015433 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-pre-trigger.service000064400000001622152626755300016674 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-shutdown.service000064400000000670152626755300016322 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-pre-trigger.service.8000064400000003016152626755300017041 0ustar00'\" t .\" Title: dracut-pre-trigger.service .\" Author: [see the "AUTHORS" section] .\" Generator: DocBook XSL Stylesheets vsnapshot .\" 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-mount.service.8000064400000002773152626755300015765 0ustar00'\" t .\" Title: dracut-mount.service .\" Author: [see the "AUTHORS" section] .\" Generator: DocBook XSL Stylesheets vsnapshot .\" 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-cmdline-ask.sh000075500000000642152626755300015612 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-emergency.sh000075500000002546152626755300015406 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.service000064400000001465152626755300016462 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-pre-mount.service.8000064400000003012152626755300016534 0ustar00'\" t .\" Title: dracut-pre-mount.service .\" Author: [see the "AUTHORS" section] .\" Generator: DocBook XSL Stylesheets vsnapshot .\" 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-tmpfiles.conf000064400000000207152626755300015553 0ustar00d /run/initramfs 0755 root root - d /run/initramfs/log 0755 root root - L /var/log - - - - ../run/initramfs/log modules.d/98dracut-systemd/dracut-mount.service.8.asc000064400000000640152626755300016521 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-pre-udev.service.8000064400000003001152626755300016333 0ustar00'\" t .\" Title: dracut-pre-udev.service .\" Author: [see the "AUTHORS" section] .\" Generator: DocBook XSL Stylesheets vsnapshot .\" 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.sh000075500000002605152626755300015153 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.service.8.asc000064400000003530152626755300017233 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-pre-trigger.sh000075500000000723152626755300015652 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-cmdline.service.8000064400000003023152626755300016223 0ustar00'\" t .\" Title: dracut-cmdline.service .\" Author: [see the "AUTHORS" section] .\" Generator: DocBook XSL Stylesheets vsnapshot .\" 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-pre-pivot.service000064400000002145152626755300016373 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/98dracut-systemd/dracut-mount.sh000075500000002034152626755300014562 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.service.8.asc000064400000000662152626755300017311 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-shutdown-onfailure.service000064400000000465152626755300020306 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/99fs-lib/module-setup.sh000075500000003272152626755300012775 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/99fs-lib/fs-lib.sh000075500000014355152626755300011532 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/95fstab-sys/module-setup.sh000075500000000461152626755300013525 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.sh000075500000002405152626755300013060 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/99microcode_ctl-fw_dir_override/module-setup.sh000075500000010022152626755300017565 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/99shutdown/module-setup.sh000075500000001111152626755300013462 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.sh000075500000006066152626755300012730 0ustar00#!/bin/sh # # Licensed under the GPLv2 # # Copyright 2011, Red Hat, Inc. # Harald Hoyer ACTION="$1" [ -w /dev/console ] && exec >/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 /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/90kernel-modules/module-setup.sh000075500000007351152626755300014540 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/insmodpost.sh000075500000000301152626755300014300 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/parse-kernel.sh000075500000001631152626755300014500 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/98pollcdrom/module-setup.sh000075500000000307152626755300013607 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.sh000075500000001173152626755300013161 0ustar00#!/bin/sh # # Licensed under the GPLv2 # # Copyright 2008-2012, Red Hat, Inc. # Harald Hoyer 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/90dmsquash-live-ntfs/module-setup.sh000075500000000454152626755300015341 0ustar00#!/bin/bash command -v check() { require_binaries ntfs-3g || return 1 return 255 } depends() { echo dmsquash-live return 0 } install() { inst_multiple fusermount ulockmgr_server mount.fuse ntfs-3g dracut_need_initqueue } installkernel() { hostonly='' instmods fuse } modules.d/00systemd/module-setup.sh000075500000022232152626755300013264 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/99squash/module-setup.sh000064400000004114152626755300013116 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/99squash/init-squash.sh000075500000002176152626755300012751 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/.shchkdir000064400000000000152626755300011725 0ustar00modules.d/90dmsquash-live/module-setup.sh000075500000002377152626755300014377 0ustar00#!/bin/bash # called by dracut check() { # a live host-only image doesn't really make a lot of sense [[ $hostonly ]] && return 1 return 255 } # called by dracut depends() { # if dmsetup is not installed, then we cannot support fedora/red hat # style live images echo dm rootfs-block img-lib return 0 } # called by dracut installkernel() { instmods squashfs loop iso9660 overlay } # called by dracut install() { inst_multiple umount dmsetup blkid dd losetup blockdev find inst_multiple -o checkisomd5 inst_hook cmdline 30 "$moddir/parse-dmsquash-live.sh" inst_hook cmdline 31 "$moddir/parse-iso-scan.sh" inst_hook pre-udev 30 "$moddir/dmsquash-live-genrules.sh" inst_hook pre-udev 30 "$moddir/dmsquash-liveiso-genrules.sh" inst_hook pre-pivot 20 "$moddir/apply-live-updates.sh" inst_script "$moddir/dmsquash-live-root.sh" "/sbin/dmsquash-live-root" inst_script "$moddir/iso-scan.sh" "/sbin/iso-scan" inst_script "$moddir/dmsquash-generator.sh" $systemdutildir/system-generators/dracut-dmsquash-generator # should probably just be generally included inst_rules 60-cdrom_id.rules inst_simple "$moddir/checkisomd5@.service" "/etc/systemd/system/checkisomd5@.service" dracut_need_initqueue } modules.d/90dmsquash-live/checkisomd5@.service000064400000000414152626755300015263 0ustar00[Unit] Description=Media check on %f DefaultDependencies=no Before=shutdown.target [Service] Type=oneshot RemainAfterExit=no ExecStart=/bin/checkisomd5 --verbose %f StandardInput=tty-force StandardOutput=inherit StandardError=inherit TimeoutSec=0 SuccessExitStatus=2 modules.d/90dmsquash-live/dmsquash-live-genrules.sh000075500000001157152626755300016353 0ustar00#!/bin/sh case "$root" in live:/dev/*) { printf 'KERNEL=="%s", RUN+="/sbin/initqueue --settled --onetime --unique /sbin/dmsquash-live-root %s"\n' \ "${root#live:/dev/}" "${root#live:}" printf 'SYMLINK=="%s", RUN+="/sbin/initqueue --settled --onetime --unique /sbin/dmsquash-live-root %s"\n' \ "${root#live:/dev/}" "${root#live:}" } >> /etc/udev/rules.d/99-live-squash.rules wait_for_dev -n "${root#live:}" ;; live:*) if [ -f "${root#live:}" ]; then /sbin/initqueue --settled --onetime --unique /sbin/dmsquash-live-root "${root#live:}" fi ;; esac modules.d/90dmsquash-live/dmsquash-generator.sh000075500000005236152626755300015562 0ustar00#!/bin/sh type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh [ -z "$root" ] && root=$(getarg root=) # support legacy syntax of passing liveimg and then just the base root if getargbool 0 rd.live.image -d -y liveimg; then liveroot="live:$root" fi if [ "${root%%:*}" = "live" ] ; then liveroot=$root fi [ "${liveroot%%:*}" = "live" ] || exit 0 case "$liveroot" in live:LABEL=*|LABEL=*) \ root="${root#live:}" root="${root//\//\\x2f}" root="live:/dev/disk/by-label/${root#LABEL=}" rootok=1 ;; live:CDLABEL=*|CDLABEL=*) \ root="${root#live:}" root="${root//\//\\x2f}" root="live:/dev/disk/by-label/${root#CDLABEL=}" rootok=1 ;; live:UUID=*|UUID=*) \ root="${root#live:}" root="live:/dev/disk/by-uuid/${root#UUID=}" rootok=1 ;; live:PARTUUID=*|PARTUUID=*) \ root="${root#live:}" root="live:/dev/disk/by-partuuid/${root#PARTUUID=}" rootok=1 ;; live:PARTLABEL=*|PARTLABEL=*) \ root="${root#live:}" root="live:/dev/disk/by-partlabel/${root#PARTLABEL=}" rootok=1 ;; live:/*.[Ii][Ss][Oo]|/*.[Ii][Ss][Oo]) root="${root#live:}" root="liveiso:${root}" rootok=1 ;; live:/dev/*) rootok=1 ;; live:/*.[Ii][Mm][Gg]|/*.[Ii][Mm][Gg]) [ -f "${root#live:}" ] && rootok=1 ;; esac [ "$rootok" != "1" ] && exit 0 GENERATOR_DIR="$2" [ -z "$GENERATOR_DIR" ] && exit 1 [ -d "$GENERATOR_DIR" ] || mkdir "$GENERATOR_DIR" getargbool 0 rd.live.overlay.readonly -d -y readonly_overlay && readonly_overlay="--readonly" || readonly_overlay="" getargbool 0 rd.live.overlay.overlayfs && overlayfs="yes" [ -e /xor_overlayfs ] && xor_overlayfs="yes" [ -e /xor_readonly ] && xor_readonly="--readonly" ROOTFLAGS="$(getarg rootflags)" { echo "[Unit]" echo "Before=initrd-root-fs.target" echo "[Mount]" echo "Where=/sysroot" if [ "$overlayfs$xor_overlayfs" = "yes" ]; then echo "What=LiveOS_rootfs" if [ "$readonly_overlay$xor_readonly" = "--readonly" ]; then ovlfs=lowerdir=/run/overlayfs-r:/run/rootfsbase else ovlfs=lowerdir=/run/rootfsbase fi echo "Options=${ROOTFLAGS},${ovlfs},upperdir=/run/overlayfs,workdir=/run/ovlwork" echo "Type=overlay" _dev=LiveOS_rootfs else echo "What=/dev/mapper/live-rw" [ -n "$ROOTFLAGS" ] && echo "Options=${ROOTFLAGS}" _dev=$'dev-mapper-live\\x2drw' fi } > "$GENERATOR_DIR"/sysroot.mount mkdir -p "$GENERATOR_DIR/$_dev.device.d" { echo "[Unit]" echo "JobTimeoutSec=3000" echo "JobRunningTimeoutSec=3000" } > "$GENERATOR_DIR/$_dev.device.d/timeout.conf" modules.d/90dmsquash-live/parse-dmsquash-live.sh000075500000003060152626755300015634 0ustar00#!/bin/sh # live images are specified with # root=live:backingdev [ -z "$root" ] && root=$(getarg root=) # support legacy syntax of passing liveimg and then just the base root if getargbool 0 rd.live.image -d -y liveimg; then liveroot="live:$root" fi if [ "${root%%:*}" = "live" ] ; then liveroot=$root fi [ "${liveroot%%:*}" = "live" ] || return 1 modprobe -q loop case "$liveroot" in live:LABEL=*|LABEL=*) \ root="${root#live:}" root="${root//\//\\x2f}" root="live:/dev/disk/by-label/${root#LABEL=}" rootok=1 ;; live:CDLABEL=*|CDLABEL=*) \ root="${root#live:}" root="${root//\//\\x2f}" root="live:/dev/disk/by-label/${root#CDLABEL=}" rootok=1 ;; live:UUID=*|UUID=*) \ root="${root#live:}" root="live:/dev/disk/by-uuid/${root#UUID=}" rootok=1 ;; live:PARTUUID=*|PARTUUID=*) \ root="${root#live:}" root="live:/dev/disk/by-partuuid/${root#PARTUUID=}" rootok=1 ;; live:PARTLABEL=*|PARTLABEL=*) \ root="${root#live:}" root="live:/dev/disk/by-partlabel/${root#PARTLABEL=}" rootok=1 ;; live:/*.[Ii][Ss][Oo]|/*.[Ii][Ss][Oo]) root="${root#live:}" root="liveiso:${root}" rootok=1 ;; live:/dev/*) rootok=1 ;; live:/*.[Ii][Mm][Gg]|/*.[Ii][Mm][Gg]) [ -f "${root#live:}" ] && rootok=1 ;; esac [ "$rootok" = "1" ] || return 1 info "root was $liveroot, is now $root" # make sure that init doesn't complain [ -z "$root" ] && root="live" wait_for_dev -n /dev/root return 0 modules.d/90dmsquash-live/parse-iso-scan.sh000075500000000307152626755300014567 0ustar00#!/bin/sh # live images are specified with # root=live:backingdev isofile=$(getarg iso-scan/filename) if [ -n "$isofile" ]; then /sbin/initqueue --settled --unique /sbin/iso-scan "$isofile" fi modules.d/90dmsquash-live/iso-scan.sh000075500000001427152626755300013463 0ustar00#!/bin/sh type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh PATH=/usr/sbin:/usr/bin:/sbin:/bin isofile=$1 [ -z "$isofile" ] && exit 1 ismounted "/run/initramfs/isoscan" && exit 0 mkdir -p "/run/initramfs/isoscan" do_iso_scan() { local _name local dev for dev in /dev/disk/by-uuid/*; do _name=$(dev_unit_name "$dev") [ -e /tmp/isoscan-${_name} ] && continue > /tmp/isoscan-${_name} mount -t auto -o ro "$dev" "/run/initramfs/isoscan" || continue if [ -f "/run/initramfs/isoscan/$isofile" ]; then losetup -f "/run/initramfs/isoscan/$isofile" rm -f -- "$job" exit 0 else umount "/run/initramfs/isoscan" fi done } do_iso_scan rmdir "/run/initramfs/isoscan" exit 1 modules.d/90dmsquash-live/dmsquash-liveiso-genrules.sh000075500000000441152626755300017061 0ustar00#!/bin/sh if [ "${root%%:*}" = "liveiso" ]; then { printf 'KERNEL=="loop-control", RUN+="/sbin/initqueue --settled --onetime --unique /sbin/dmsquash-live-root `/sbin/losetup -f --show %s`"\n' \ ${root#liveiso:} } >> /etc/udev/rules.d/99-liveiso-mount.rules fi modules.d/90dmsquash-live/apply-live-updates.sh000075500000001201152626755300015462 0ustar00#!/bin/sh if [ -h /dev/root ] && [ -d /run/initramfs/live/updates -o -d /updates ]; then info "Applying updates to live image..." mount -o bind /run $NEWROOT/run # avoid overwriting symlinks (e.g. /lib -> /usr/lib) with directories for d in /updates /run/initramfs/live/updates; do [ -d "$d" ] || continue ( cd $d find . -depth -type d | while read dir; do mkdir -p "$NEWROOT/$dir" done find . -depth \! -type d | while read file; do cp -a "$file" "$NEWROOT/$file" done ) done umount $NEWROOT/run fi modules.d/90dmsquash-live/dmsquash-live-root.sh000075500000037407152626755300015521 0ustar00#!/bin/sh type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh command -v unpack_archive >/dev/null || . /lib/img-lib.sh PATH=/usr/sbin:/usr/bin:/sbin:/bin if getargbool 0 rd.live.debug -n -y rdlivedebug; then exec > /tmp/liveroot.$$.out exec 2>> /tmp/liveroot.$$.out set -x fi [ -z "$1" ] && exit 1 livedev="$1" # parse various live image specific options that make sense to be # specified as their own things live_dir=$(getarg rd.live.dir -d live_dir) [ -z "$live_dir" ] && live_dir="LiveOS" squash_image=$(getarg rd.live.squashimg) [ -z "$squash_image" ] && squash_image="squashfs.img" getargbool 0 rd.live.ram -d -y live_ram && live_ram="yes" getargbool 0 rd.live.overlay.reset -d -y reset_overlay && reset_overlay="yes" getargbool 0 rd.live.overlay.readonly -d -y readonly_overlay && readonly_overlay="--readonly" || readonly_overlay="" overlay=$(getarg rd.live.overlay -d overlay) getargbool 0 rd.writable.fsimg -d -y writable_fsimg && writable_fsimg="yes" overlay_size=$(getarg rd.live.overlay.size=) [ -z "$overlay_size" ] && overlay_size=32768 getargbool 0 rd.live.overlay.thin && thin_snapshot="yes" getargbool 0 rd.live.overlay.overlayfs && overlayfs="yes" # CD/DVD media check [ -b $livedev ] && fs=$(blkid -s TYPE -o value $livedev) if [ "$fs" = "iso9660" -o "$fs" = "udf" ]; then check="yes" fi getarg rd.live.check -d check || check="" if [ -n "$check" ]; then type plymouth >/dev/null 2>&1 && plymouth --hide-splash if [ -n "$DRACUT_SYSTEMD" ]; then p=$(dev_unit_name "$livedev") systemctl start checkisomd5@${p}.service else checkisomd5 --verbose $livedev fi if [ $? -eq 1 ]; then die "CD check failed!" exit 1 fi type plymouth >/dev/null 2>&1 && plymouth --show-splash fi ln -s $livedev /run/initramfs/livedev # determine filesystem type for a filesystem image det_img_fs() { udevadm settle >&2 blkid -s TYPE -u noraid -o value "$1" } modprobe squashfs CMDLINE=$(getcmdline) for arg in $CMDLINE; do case $arg in ro|rw) liverw=$arg ;; esac; done # mount the backing of the live image first mkdir -m 0755 -p /run/initramfs/live if [ -f $livedev ]; then # no mount needed - we've already got the LiveOS image in initramfs # check filesystem type and handle accordingly fstype=$(det_img_fs $livedev) case $fstype in squashfs) SQUASHED=$livedev;; auto) die "cannot mount live image (unknown filesystem type)" ;; *) FSIMG=$livedev ;; esac [ -e /sys/fs/$fstype ] || modprobe $fstype else if [ "$(blkid -o value -s TYPE $livedev)" != "ntfs" ]; then mount -n -t $fstype -o ${liverw:-ro} $livedev /run/initramfs/live else # Symlinking /usr/bin/ntfs-3g as /sbin/mount.ntfs seems to boot # at the first glance, but ends with lots and lots of squashfs # errors, because systemd attempts to kill the ntfs-3g process?! if [ -x "/usr/bin/ntfs-3g" ]; then ( exec -a @ntfs-3g ntfs-3g -o ${liverw:-ro} $livedev /run/initramfs/live ) | vwarn else die "Failed to mount block device of live image: Missing NTFS support" exit 1 fi fi if [ "$?" != "0" ]; then die "Failed to mount block device of live image" exit 1 fi fi # overlay setup helper function do_live_overlay() { # create a sparse file for the overlay # overlay: if non-ram overlay searching is desired, do it, # otherwise, create traditional overlay in ram l=$(blkid -s LABEL -o value $livedev) || l="" u=$(blkid -s UUID -o value $livedev) || u="" if [ -z "$overlay" ]; then pathspec="/${live_dir}/overlay-$l-$u" elif strstr $overlay ":"; then # pathspec specified, extract pathspec=${overlay##*:} fi if [ -z "$pathspec" -o "$pathspec" = "auto" ]; then pathspec="/${live_dir}/overlay-$l-$u" fi devspec=${overlay%%:*} # need to know where to look for the overlay if [ -z "$setup" -a -n "$devspec" -a -n "$pathspec" -a -n "$overlay" ]; then mkdir -m 0755 /run/initramfs/overlayfs opt='' [ -n "$readonly_overlay" ] && opt=-r mount -n -t auto $devspec /run/initramfs/overlayfs || : if [ -f /run/initramfs/overlayfs$pathspec -a -w /run/initramfs/overlayfs$pathspec ]; then OVERLAY_LOOPDEV=$(losetup -f --show $opt /run/initramfs/overlayfs$pathspec) over=$OVERLAY_LOOPDEV umount -l /run/initramfs/overlayfs || : oltype=$(det_img_fs $OVERLAY_LOOPDEV) if [ -z "$oltype" ] || [ "$oltype" = DM_snapshot_cow ]; then if [ -n "$reset_overlay" ]; then info "Resetting the Device-mapper overlay." dd if=/dev/zero of=$OVERLAY_LOOPDEV bs=64k count=1 conv=fsync 2>/dev/null fi if [ -n "$overlayfs" ]; then unset -v overlayfs [ -n "$DRACUT_SYSTEMD" ] && reloadsysrootmountunit=":>/xor_overlayfs;" fi setup="yes" else mount -n -t $oltype $opt $OVERLAY_LOOPDEV /run/initramfs/overlayfs if [ -d /run/initramfs/overlayfs/overlayfs ] && [ -d /run/initramfs/overlayfs/ovlwork ]; then ln -s /run/initramfs/overlayfs/overlayfs /run/overlayfs$opt ln -s /run/initramfs/overlayfs/ovlwork /run/ovlwork$opt if [ -z "$overlayfs" ] && [ -n "$DRACUT_SYSTEMD" ]; then reloadsysrootmountunit=":>/xor_overlayfs;" fi overlayfs="required" setup="yes" fi fi elif [ -d /run/initramfs/overlayfs$pathspec ] && [ -d /run/initramfs/overlayfs$pathspec/../ovlwork ]; then ln -s /run/initramfs/overlayfs$pathspec /run/overlayfs$opt ln -s /run/initramfs/overlayfs$pathspec/../ovlwork /run/ovlwork$opt if [ -z "$overlayfs" ] && [ -n "$DRACUT_SYSTEMD" ]; then reloadsysrootmountunit=":>/xor_overlayfs;" fi overlayfs="required" setup="yes" fi fi if [ -n "$overlayfs" ]; then modprobe overlay if [ $? != 0 ]; then if [ "$overlayfs" = required ]; then die "OverlayFS is required but not available." exit 1 fi [ -n "$DRACUT_SYSTEMD" ] && reloadsysrootmountunit=":>/xor_overlayfs;" m='OverlayFS is not available; using temporary Device-mapper overlay.' info $m unset -v overlayfs setup fi fi if [ -z "$setup" -o -n "$readonly_overlay" ]; then if [ -n "$setup" ]; then warn "Using temporary overlay." elif [ -n "$devspec" -a -n "$pathspec" ]; then [ -z "$m" ] && m=' Unable to find a persistent overlay; using a temporary one.' m="$m"$'\n All root filesystem changes will be lost on shutdown.' m="$m"$'\n Press [Enter] to continue.' printf "\n\n\n\n${m}\n\n\n" > /dev/kmsg if [ -n "$DRACUT_SYSTEMD" ]; then if type plymouth >/dev/null 2>&1 && plymouth --ping ; then if getargbool 0 rhgb || getargbool 0 splash ; then m='>>>'$'\n''>>>'$'\n''>>>'$'\n\n\n'"$m" m="${m%n.*}"$'n.\n\n\n''<<<'$'\n''<<<'$'\n''<<<' plymouth display-message --text="${m}" else plymouth ask-question --prompt="${m}" --command=true fi else m=">>>${m//.[[:space:]]/.} <<<" systemd-ask-password --timeout=0 "${m}" fi else type plymouth >/dev/null 2>&1 && plymouth --ping && plymouth --quit read -s -r -p $'\n\n'"${m}" -n 1 reply fi fi if [ -n "$overlayfs" ]; then mkdir -m 0755 /run/overlayfs mkdir -m 0755 /run/ovlwork if [ -n "$readonly_overlay" ] && ! [ -h /run/overlayfs-r ]; then info "No persistent overlay found." unset -v readonly_overlay [ -n "$DRACUT_SYSTEMD" ] && reloadsysrootmountunit="${reloadsysrootmountunit}:>/xor_readonly;" fi else dd if=/dev/null of=/overlay bs=1024 count=1 seek=$((overlay_size*1024)) 2> /dev/null if [ -n "$setup" -a -n "$readonly_overlay" ]; then RO_OVERLAY_LOOPDEV=$(losetup -f --show /overlay) over=$RO_OVERLAY_LOOPDEV else OVERLAY_LOOPDEV=$(losetup -f --show /overlay) over=$OVERLAY_LOOPDEV fi fi fi # set up the snapshot if [ -z "$overlayfs" ]; then if [ -n "$readonly_overlay" ] && [ -n "$OVERLAY_LOOPDEV" ]; then echo 0 $sz snapshot $BASE_LOOPDEV $OVERLAY_LOOPDEV P 8 | dmsetup create --readonly live-ro base="/dev/mapper/live-ro" else base=$BASE_LOOPDEV fi fi if [ -n "$thin_snapshot" ]; then modprobe dm_thin_pool mkdir -m 0755 /run/initramfs/thin-overlay # In block units (512b) thin_data_sz=$(( $overlay_size * 1024 * 1024 / 512 )) thin_meta_sz=$(( $thin_data_sz / 10 )) # It is important to have the backing file on a tmpfs # this is needed to let the loopdevice support TRIM dd if=/dev/null of=/run/initramfs/thin-overlay/meta bs=1b count=1 seek=$((thin_meta_sz)) 2> /dev/null dd if=/dev/null of=/run/initramfs/thin-overlay/data bs=1b count=1 seek=$((thin_data_sz)) 2> /dev/null THIN_META_LOOPDEV=$( losetup --show -f /run/initramfs/thin-overlay/meta ) THIN_DATA_LOOPDEV=$( losetup --show -f /run/initramfs/thin-overlay/data ) echo 0 $thin_data_sz thin-pool $THIN_META_LOOPDEV $THIN_DATA_LOOPDEV 1024 1024 | dmsetup create live-overlay-pool dmsetup message /dev/mapper/live-overlay-pool 0 "create_thin 0" # Create a snapshot of the base image echo 0 $sz thin /dev/mapper/live-overlay-pool 0 $base | dmsetup create live-rw elif [ -z "$overlayfs" ]; then echo 0 $sz snapshot $base $over PO 8 | dmsetup create live-rw fi # Create a device for the ro base of overlayed file systems. if [ -z "$overlayfs" ]; then echo 0 $sz linear $BASE_LOOPDEV 0 | dmsetup create --readonly live-base fi ln -s $BASE_LOOPDEV /dev/live-base } # end do_live_overlay() # we might have a genMinInstDelta delta file for anaconda to take advantage of if [ -e /run/initramfs/live/${live_dir}/osmin.img ]; then OSMINSQFS=/run/initramfs/live/${live_dir}/osmin.img # decompress the delta data dd if=$OSMINSQFS of=/run/initramfs/osmin.img 2> /dev/null OSMIN_SQUASHED_LOOPDEV=$( losetup -f ) losetup -r $OSMIN_SQUASHED_LOOPDEV /run/initramfs/osmin.img mkdir -m 0755 -p /run/initramfs/squashfs.osmin mount -n -t squashfs -o ro $OSMIN_SQUASHED_LOOPDEV /run/initramfs/squashfs.osmin OSMIN_LOOPDEV=$( losetup -f ) losetup -r $OSMIN_LOOPDEV /run/initramfs/squashfs.osmin/osmin umount -l /run/initramfs/squashfs.osmin fi # we might have an embedded fs image on squashfs (compressed live) if [ -e /run/initramfs/live/${live_dir}/${squash_image} ]; then SQUASHED="/run/initramfs/live/${live_dir}/${squash_image}" fi if [ -e "$SQUASHED" ]; then if [ -n "$live_ram" ]; then echo 'Copying live image to RAM...' > /dev/kmsg echo ' (this may take a minute)' > /dev/kmsg dd if=$SQUASHED of=/run/initramfs/squashed.img bs=512 2> /dev/null echo 'Done copying live image to RAM.' > /dev/kmsg SQUASHED="/run/initramfs/squashed.img" fi SQUASHED_LOOPDEV=$( losetup -f ) losetup -r $SQUASHED_LOOPDEV $SQUASHED mkdir -m 0755 -p /run/initramfs/squashfs mount -n -t squashfs -o ro $SQUASHED_LOOPDEV /run/initramfs/squashfs if [ -d /run/initramfs/squashfs/LiveOS ]; then if [ -f /run/initramfs/squashfs/LiveOS/rootfs.img ]; then FSIMG="/run/initramfs/squashfs/LiveOS/rootfs.img" elif [ -f /run/initramfs/squashfs/LiveOS/ext3fs.img ]; then FSIMG="/run/initramfs/squashfs/LiveOS/ext3fs.img" fi elif [ -d /run/initramfs/squashfs/proc ]; then FSIMG=$SQUASHED if [ -z "$overlayfs" ] && [ -n "$DRACUT_SYSTEMD" ]; then reloadsysrootmountunit=":>/xor_overlayfs;" fi overlayfs="required" else die "Failed to find a root filesystem in $SQUASHED." exit 1 fi else # we might have an embedded fs image to use as rootfs (uncompressed live) if [ -e /run/initramfs/live/${live_dir}/rootfs.img ]; then FSIMG="/run/initramfs/live/${live_dir}/rootfs.img" elif [ -e /run/initramfs/live/${live_dir}/ext3fs.img ]; then FSIMG="/run/initramfs/live/${live_dir}/ext3fs.img" fi if [ -n "$live_ram" ]; then echo 'Copying live image to RAM...' > /dev/kmsg echo ' (this may take a minute or so)' > /dev/kmsg dd if=$FSIMG of=/run/initramfs/rootfs.img bs=512 2> /dev/null echo 'Done copying live image to RAM.' > /dev/kmsg FSIMG='/run/initramfs/rootfs.img' fi fi if [ -n "$FSIMG" ]; then if [ -n "$writable_fsimg" ]; then # mount the provided filesystem read/write echo "Unpacking live filesystem (may take some time)" > /dev/kmsg mkdir -m 0755 /run/initramfs/fsimg/ if [ -n "$SQUASHED" ]; then cp -v $FSIMG /run/initramfs/fsimg/rootfs.img else unpack_archive $FSIMG /run/initramfs/fsimg/ fi FSIMG=/run/initramfs/fsimg/rootfs.img fi opt=-r # For writable DM images... if [ -z "$SQUASHED" -a -n "$live_ram" -a -z "$overlayfs" ] || [ -n "$writable_fsimg" ] || [ "$overlay" = none -o "$overlay" = None -o "$overlay" = NONE ]; then if [ -z "$readonly_overlay" ]; then opt='' setup=rw else setup=yes fi fi if [ "$FSIMG" = "$SQUASHED" ]; then BASE_LOOPDEV=$SQUASHED_LOOPDEV else BASE_LOOPDEV=$(losetup -f --show $opt $FSIMG) sz=$(blockdev --getsz $BASE_LOOPDEV) fi if [ "$setup" = rw ]; then echo 0 $sz linear $BASE_LOOPDEV 0 | dmsetup create live-rw else # Add a DM snapshot or OverlayFS for writes. do_live_overlay fi fi if [ -b "$OSMIN_LOOPDEV" ]; then # set up the devicemapper snapshot device, which will merge # the normal live fs image, and the delta, into a minimzied fs image echo "0 $sz snapshot $BASE_LOOPDEV $OSMIN_LOOPDEV P 8" | dmsetup create --readonly live-osimg-min fi if [ -n "$reloadsysrootmountunit" ]; then eval "$reloadsysrootmountunit" systemctl daemon-reload fi ROOTFLAGS="$(getarg rootflags)" if [ -n "$overlayfs" ]; then mkdir -m 0755 /run/rootfsbase if [ -n "$reset_overlay" ] && [ -h /run/overlayfs ]; then ovlfs=$(readlink /run/overlayfs) info "Resetting the OverlayFS overlay directory." rm -r -- ${ovlfs}/* ${ovlfs}/.* >/dev/null 2>&1 fi if [ -n "$readonly_overlay" ] && [ -h /run/overlayfs-r ]; then ovlfs=lowerdir=/run/overlayfs-r:/run/rootfsbase else ovlfs=lowerdir=/run/rootfsbase fi mount -r $FSIMG /run/rootfsbase if [ -z "$DRACUT_SYSTEMD" ]; then printf 'mount -t overlay LiveOS_rootfs -o%s,%s %s\n' "$ROOTFLAGS" \ "$ovlfs",upperdir=/run/overlayfs,workdir=/run/ovlwork \ "$NEWROOT" > $hookdir/mount/01-$$-live.sh fi else if [ -z "$DRACUT_SYSTEMD" ]; then [ -n "$ROOTFLAGS" ] && ROOTFLAGS="-o $ROOTFLAGS" printf 'mount %s /dev/mapper/live-rw %s\n' "$ROOTFLAGS" "$NEWROOT" > $hookdir/mount/01-$$-live.sh fi fi [ -e "$SQUASHED" ] && umount -l /run/initramfs/squashfs ln -s null /dev/root need_shutdown exit 0 modules.d/03modsign/module-setup.sh000075500000001330152626755300013233 0ustar00#!/bin/bash # # Licensed under the GPLv2 # # Copyright 2013 Red Hat, Inc. # Peter Jones # 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/03modsign/load-modsign-keys.sh000075500000000352152626755300014141 0ustar00#!/bin/sh # # Licensed under the GPLv2 # # Copyright 2013 Red Hat, Inc. # Peter Jones for x in /lib/modules/keys/* ; do [ "${x}" = "/lib/modules/keys/*" ] && break keyctl padd asymmetric "" @s < ${x} done modules.d/80lvmthinpool-monitor/module-setup.sh000075500000001100152626755300015633 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.service000064400000000506152626755300020720 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.sh000075500000002402152626755300017672 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/00warpclock/module-setup.sh000064400000001226152626755300013556 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.sh000064400000000227152626755300013120 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/04watchdog-modules/module-setup.sh000075500000003623152626755300015051 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/95fcoe-uefi/module-setup.sh000075500000000766152626755300013464 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.sh000075500000001630152626755300013725 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/50drm/module-setup.sh000075500000002514152626755300012364 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/03rescue/module-setup.sh000075500000000571152626755300013067 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/99base/module-setup.sh000075500000010013152626755300012522 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/init.sh000075500000027025152626755300011055 0ustar00#!/bin/sh # # Licensed under the GPLv2 # # Copyright 2008-2010, Red Hat, Inc. # Harald Hoyer # Jeremy Katz 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 /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 /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.sh000075500000002243152626755300012115 0ustar00#!/bin/sh # # Licensed under the GPLv2+ # # Copyright 2008-2010, Red Hat, Inc. # Harald Hoyer 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" printf '%q ' "$exe" "$@" printf '\n' } > "/tmp/$$-${job}.sh" mv -f "/tmp/$$-${job}.sh" "$hookdir/initqueue${qname}/${job}.sh" [ -z "$qname" ] && >> $hookdir/initqueue/work exit 0 modules.d/99base/loginit.sh000075500000000754152626755300011557 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/rdsosreport.sh000075500000002502152626755300012471 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/99base/parse-root-opts.sh000075500000000366152626755300013167 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/dracut-lib.sh000075500000102111152626755300012126 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 ", 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 "=", 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 # False if "getarg " returns "0", "no", or "off". # True if getarg returns any other non-empty string. # If not found, assumes - 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 # Will echo the arg if it's in range [minval - maxval]. # If it's not set or it's not valid, will set it . # Note all values are required to be >= 0 here. # 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*}" local -n _splitsep_ref="$1" _splitsep_ref="$tmp" unset -n _splitsep_ref str="${str#"$tmp"}" str="${str#$sep}" shift done if [ -n "$str" -a -n "$1" ]; then local -n _splitsep_ref="$1" _splitsep_ref="$str" unset -n _splitsep_ref fi 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 { printf 'warn dracut: FATAL: %q\n' "$*" 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 # usage: ismounted /dev/ 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:[:][:] # root=nfs4:[:][:] 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