From: Harald Hoyer Date: Thu, 23 Aug 2012 10:13:02 +0000 (+0200) Subject: moved the /etc/host_devs write out to 99base X-Git-Tag: 024~99 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=73088e46f72af142f810460aac4509579c80a673;p=thirdparty%2Fdracut.git moved the /etc/host_devs write out to 99base also removed some left-over debugging code --- diff --git a/dracut-functions.sh b/dracut-functions.sh index f2832c8af..c328f9fc5 100755 --- a/dracut-functions.sh +++ b/dracut-functions.sh @@ -455,7 +455,6 @@ for_each_host_dev_and_slaves_all() local _ret=1 for _dev in ${host_devs[@]}; do [[ -b "$_dev" ]] || continue - echo host_devs: $_dev if check_block_and_slaves_all $_func $(get_maj_min $_dev); then _ret=0 fi @@ -469,7 +468,6 @@ for_each_host_dev_and_slaves() local _dev for _dev in ${host_devs[@]}; do [[ -b "$_dev" ]] || continue - echo host_devs: $_dev check_block_and_slaves_all $_func $(get_maj_min $_dev) && return 0 done return 1 diff --git a/dracut.sh b/dracut.sh index a6f619322..7148d0f3c 100755 --- a/dracut.sh +++ b/dracut.sh @@ -906,22 +906,6 @@ done dinfo "*** Including modules done ***" -get_persistent_dev() { - local i _tmp - local _dev=${1##*/} - - for i in /dev/disk/by-id/*; do - _tmp=$(readlink $i) - [ "${_tmp##*/}" = "$_dev" ] && echo $i && return - done -} - -## save host_devs which we need bring up -for _dev in ${host_devs[@]}; do - _pdev=$(get_persistent_dev $_dev) - [ -n "$_pdev" ] && echo $_pdev >> $initdir/etc/host_devs -done - ## final stuff that has to happen if [[ $no_kernel != yes ]]; then diff --git a/modules.d/99base/module-setup.sh b/modules.d/99base/module-setup.sh index 196f6cf71..8a1810072 100755 --- a/modules.d/99base/module-setup.sh +++ b/modules.d/99base/module-setup.sh @@ -11,6 +11,19 @@ depends() { return 0 } +get_persistent_dev() { + local i _tmp + local _dev=${1##*/} + + for i in /dev/disk/by-id/*; do + _tmp=$(readlink $i) + if [ "$i" = "$_dev" ]; then + echo $i + return + fi + done +} + install() { local _d dracut_install mount mknod mkdir pidof sleep chroot \ @@ -41,7 +54,14 @@ install() { dracut_install switch_root || dfatal "Failed to install switch_root" inst_simple "$moddir/dracut-lib.sh" "/lib/dracut-lib.sh" + + ## save host_devs which we need bring up inst_hook cmdline 00 "$moddir/wait-host-devs.sh" + for _dev in ${host_devs[@]}; do + _pdev=$(get_persistent_dev $_dev) + [ -n "$_pdev" ] && echo $_pdev >> $initdir/etc/host_devs + done + inst_hook cmdline 10 "$moddir/parse-root-opts.sh" mkdir -p "${initdir}/var" [ -x /lib/systemd/systemd-timestamp ] && inst /lib/systemd/systemd-timestamp