From 638ae3d070c1c200be863d6c5d61322e28f33d28 Mon Sep 17 00:00:00 2001 From: Will Woods Date: Mar 27 2012 23:23:49 +0000 Subject: make ks=file:... parse kickstart earlier (#806931) ks=file:... was parsing the kickstart *after* the 'cmdline' hook finished, so the new arguments weren't being used. Move the parsing into the 'cmdline' hook so the new arguments can get used by the rest of dracut. --- diff --git a/dracut/kickstart-genrules.sh b/dracut/kickstart-genrules.sh index c3e04c7..87a08b7 100755 --- a/dracut/kickstart-genrules.sh +++ b/dracut/kickstart-genrules.sh @@ -2,17 +2,6 @@ # generate udev rules for fetching kickstarts. case "${kickstart%%:*}" in - file|path) # file: (we accept path: but that's deprecated) - splitsep ":" "$kickstart" kstype kspath - if [ -f "$kspath" ]; then - cp $kspath /tmp/ks.cfg - parse_kickstart /tmp/ks.cfg - unset CMDLINE - else - warn "inst.ks='$kickstart'" - warn "can't find $kspath!" - fi - ;; http|https|ftp|nfs) # handled by fetch-kickstart-net in the online hook wait_for_kickstart diff --git a/dracut/parse-anaconda-kickstart.sh b/dracut/parse-anaconda-kickstart.sh index f530f99..c426ced 100755 --- a/dracut/parse-anaconda-kickstart.sh +++ b/dracut/parse-anaconda-kickstart.sh @@ -2,7 +2,7 @@ # parse-anaconda-kickstart.sh: handle kickstart settings # no need to do this twice -[ -f /tmp/ks.cfg ] && return +[ -f /tmp/ks.cfg.done ] && return # inst.ks: provide a "URI" for the kickstart file kickstart="$(getarg ks= inst.ks=)" @@ -12,8 +12,23 @@ fi # no root? the kickstart will probably tell us what our root device is. [ "$kickstart" ] && [ -z "$root" ] && root="anaconda-kickstart" -case "$kickstart" in - http:*|https:*|ftp:*|nfs:*|nfs4:*) set_neednet ;; +case "${kickstart%%:*}" in + http|https|ftp|nfs|nfs4) # network kickstart? set "neednet"! + set_neednet + ;; + file|path) # "file:" - "path:" is accepted but deprecated + splitsep ":" "$kickstart" kstype kspath + if [ -f "$kspath" ]; then + info "anaconda: parsing kickstart $kspath" + cp $kspath /tmp/ks.cfg + parse_kickstart /tmp/ks.cfg + [ "$root" = "anaconda-kickstart" ] && root="" + > /tmp/ks.cfg.done + else + warn "inst.ks='$kickstart'" + warn "can't find $kspath!" + fi + ;; esac export kickstart