From fb02359bc38612bac2f342091188f6535b243f04 Mon Sep 17 00:00:00 2001 From: Brian C. Lane Date: Feb 07 2014 22:30:39 +0000 Subject: driverdisk: Use getargs instead of the env variable (#1035663) This makes it easier to change what dd args are being passed. Also rename dd-net.done to dd_net.done for consistency in /tmp/dd_* naming usage. Related: rhbz#1035663 --- diff --git a/dracut/README-dd b/dracut/README-dd index 0103b56..2c3a1be 100644 --- a/dracut/README-dd +++ b/dracut/README-dd @@ -6,7 +6,7 @@ modules before the rest of the installer is executed. cmdline hook parse-anaconda-dd.sh - parses the inst.dd/dd arguments for URIs and saves all of them into $dd_args + parses the inst.dd/dd arguments for URIs and saves all of them into /tmp/dd_args and calls set_neednet if network is needed to retrieve a driver rpm The files will be downloaded when the network device online hook is executed. diff --git a/dracut/driver-updates.sh b/dracut/driver-updates.sh index 3765575..99ca245 100755 --- a/dracut/driver-updates.sh +++ b/dracut/driver-updates.sh @@ -10,7 +10,10 @@ udevadm settle blkid -t LABEL=OEMDRV > /dev/null blkid_rc=$? -# dd_args will have been set by parse-anaconda-dd.sh cmdline hook +command -v getarg >/dev/null || . /lib/dracut-lib.sh +dd_args="$(getargs dd= inst.dd=)" + +# /tmp/dd_args will have been set by parse-anaconda-dd.sh cmdline hook if [ -n "$dd_args" -o $blkid_rc -eq 0 ]; then command -v getarg >/dev/null || . /lib/dracut-lib.sh . /lib/anaconda-lib.sh diff --git a/dracut/fetch-driver-net.sh b/dracut/fetch-driver-net.sh index 9e46a95..5adc39b 100755 --- a/dracut/fetch-driver-net.sh +++ b/dracut/fetch-driver-net.sh @@ -6,14 +6,13 @@ netif="$1" # We already processed the dd_args - exit -[ -e /tmp/dd-net.done ] && return 0 +[ -e /tmp/dd_net.done ] && return 0 -# no dd requested - exit +command -v getarg >/dev/null || . /lib/dracut-lib.sh +dd_args="$(getargs dd= inst.dd=)" [ -n "$dd_args" ] || return 0 -command -v getarg >/dev/null || . /lib/dracut-lib.sh . /lib/url-lib.sh - dd_repo=/tmp/DD-net/ for dd in $dd_args; do case "${dd%%:*}" in @@ -28,4 +27,4 @@ for dd in $dd_args; do ;; esac done -echo > /tmp/dd-net.done +echo > /tmp/dd_net.done diff --git a/dracut/parse-anaconda-dd.sh b/dracut/parse-anaconda-dd.sh index df02bc1..ebabd07 100755 --- a/dracut/parse-anaconda-dd.sh +++ b/dracut/parse-anaconda-dd.sh @@ -2,7 +2,7 @@ # parse-anaconda-dd.sh: handle driver update disk settings # no need to do this twice -[ -f /tmp/dd-net.done ] && return +[ -f /tmp/dd_net.done ] && return command -v getarg >/dev/null || . /lib/dracut-lib.sh @@ -16,4 +16,3 @@ for dd in $dd_args; do ;; esac done -export dd_args