While testing the fix from PR #231 (commit bc6378b here) I found some other problems, so here's a new version with some followup fixes.
From: Will Woods wwoods@redhat.com
Commit 5d016ef added support for doing cdrom-swapping while doing "inst.ks=cdrom[:...]". But it turns out that if you're slow to swap the discs, we'll hit dracut's retry timeout and it'll drop to the emergency shell.
So, in response to User Requests, we now disable the timeout entirely when using "inst.ks=cdrom[:...]"; dracut will wait forever for the kickstart and/or installer media, and if anything goes wrong you're just stuck and you'll need to reset.
Resolves: rhbz#1168902 --- dracut/kickstart-genrules.sh | 6 ++++++ 1 file changed, 6 insertions(+)
diff --git a/dracut/kickstart-genrules.sh b/dracut/kickstart-genrules.sh index 3b83d6c1..7edfacd 100755 --- a/dracut/kickstart-genrules.sh +++ b/dracut/kickstart-genrules.sh @@ -19,6 +19,12 @@ case "${kickstart%%:*}" in when_diskdev_appears "$ksdev" \ fetch-kickstart-disk $env{DEVNAME} "$kspath" fi + # "cdrom:" also means "wait forever for kickstart" because rhbz#1168902 + if [ "$kstype" = "cdrom" ]; then + # if we reset main_loop to 0 every loop, we never hit the timeout. + # (see dracut's dracut-initqueue.sh for details on the mainloop) + echo "main_loop=0" > "$hookdir/initqueue/ks-cdrom-wait-forever.sh" + fi wait_for_kickstart ;; bd) # bd:<dev>:<path> - biospart (TODO... if anyone uses this anymore)
Added label: master.
From: Will Woods wwoods@redhat.com
fetch-kickstart-disk and anaconda-diskroot are *executed*, not sourced, so they don't get the default dracut environment, so "$kickstart" isn't set, so "str_starts $kickstart cdrom" is always false, so the user never gets any of the "Please insert CDROM containing '$path'..." messages.
Set "$kickstart" from the boot args, and then this all works as expected.
Related: rhbz#1168902 --- dracut/anaconda-diskroot | 1 + dracut/fetch-kickstart-disk | 1 + 2 files changed, 2 insertions(+)
diff --git a/dracut/anaconda-diskroot b/dracut/anaconda-diskroot index 36fd49e..4ae7112 100755 --- a/dracut/anaconda-diskroot +++ b/dracut/anaconda-diskroot @@ -32,6 +32,7 @@ run_checkisomd5() {
dev="$1" path="$2" # optional, could be empty +kickstart="$(getarg ks= inst.ks=)"
[ -e "/dev/root" ] && exit 1 # we already have a root device!
diff --git a/dracut/fetch-kickstart-disk b/dracut/fetch-kickstart-disk index 37a1050..7eb769e 100755 --- a/dracut/fetch-kickstart-disk +++ b/dracut/fetch-kickstart-disk @@ -6,6 +6,7 @@ command -v getarg >/dev/null || . /lib/dracut-lib.sh
dev="$1" path="${2:-/ks.cfg}" +kickstart="$(getarg ks= inst.ks=)"
[ -e /tmp/ks.cfg.done ] && exit 1 [ -b "$dev" ] || exit 1
From: Will Woods wwoods@redhat.com
anaconda-lib has the `when_any_cdrom_appears` function for this exact purpose, so use that instead of handcrafting the udev rule. --- dracut/repo-genrules.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/dracut/repo-genrules.sh b/dracut/repo-genrules.sh index 55abd32..9f1d40e 100755 --- a/dracut/repo-genrules.sh +++ b/dracut/repo-genrules.sh @@ -14,9 +14,8 @@ case "$root" in ;; anaconda-auto-cd) # special catch-all rule for CDROMs - echo 'ENV{ID_CDROM}=="1",' \ - 'RUN+="/sbin/initqueue --settled --onetime' \ - '/sbin/anaconda-diskroot $env{DEVNAME}"' >> $rulesfile + when_any_cdrom_appears \ + anaconda-diskroot $env{DEVNAME} # HACK: anaconda demands that CDROMs be mounted at /mnt/install/source ln -s repo /run/install/source ;;
These all look good to me.
Added label: ACK.
Closed.
anaconda-patches@lists.fedorahosted.org