[PATCH f17-branch 3/3] make ks=file:... parse kickstart earlier (#806931)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.
---
 dracut/kickstart-genrules.sh       |   11 -----------
 dracut/parse-anaconda-kickstart.sh |   20 +++++++++++++++++---
 2 files changed, 17 insertions(+), 14 deletions(-)

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:<path> (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..0b61bd4 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,22 @@ 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>" - "path:<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
+            > /tmp/ks.cfg.done
+        else
+            warn "inst.ks='$kickstart'"
+            warn "can't find $kspath!"
+        fi
+    ;;
 esac
 export kickstart
 
-- 
1.7.7.6

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list


[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux