[PATCH f17-branch 3/5] support {stage2, repo}=.../path/to/file.img (#808499)

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

 



preupgrade uses stage2=hd:XXX:/path/upgrade.img, so we need to handle
that.

stage2=XXX overrides repo=XXX, if both are present.
---
 dracut/anaconda-lib.sh           |    1 +
 dracut/anaconda-netroot.sh       |    4 ++--
 dracut/parse-anaconda-options.sh |    1 -
 dracut/parse-anaconda-repo.sh    |    9 +++++++--
 4 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/dracut/anaconda-lib.sh b/dracut/anaconda-lib.sh
index 1083bcb..132045e 100755
--- a/dracut/anaconda-lib.sh
+++ b/dracut/anaconda-lib.sh
@@ -32,6 +32,7 @@ find_iso() {
 }
 
 find_runtime() {
+    [ -f "$1" ] && [ "${1%.iso}" == "$1" ] && echo "$1" && return
     local ti_img="" dir="$1"
     [ -e $dir/.treeinfo ] && \
         ti_img=$(config_get stage2 mainimage < $dir/.treeinfo)
diff --git a/dracut/anaconda-netroot.sh b/dracut/anaconda-netroot.sh
index a7bdb15..7b8f21d 100755
--- a/dracut/anaconda-netroot.sh
+++ b/dracut/anaconda-netroot.sh
@@ -5,10 +5,10 @@
 command -v getarg >/dev/null || . /lib/dracut-lib.sh
 
 # get repo info
-repo=$(getarg repo= inst.repo=)
+splitsep ":" "$root" prefix repo
 
 # no repo? non-net root? we're not needed here.
-[ "$root" = "anaconda-net" ] && [ -n "$repo" ] || return 0
+[ "$prefix" = "anaconda-net" ] && [ -n "$repo" ] || return 0
 # already done? don't run again.
 [ -e /dev/root ] && return 0
 
diff --git a/dracut/parse-anaconda-options.sh b/dracut/parse-anaconda-options.sh
index 57c88ee..6188379 100755
--- a/dracut/parse-anaconda-options.sh
+++ b/dracut/parse-anaconda-options.sh
@@ -65,7 +65,6 @@ check_depr_args() {
 }
 
 check_depr_arg "serial" "console=ttyS0"
-check_depr_arg "stage2=" "root=live:%s"
 check_depr_args "blacklist=" "inst.blacklist=%s"
 check_depr_arg "nofirewire" "inst.blacklist=firewire_ohci"
 
diff --git a/dracut/parse-anaconda-repo.sh b/dracut/parse-anaconda-repo.sh
index 1b0445a..96de458 100755
--- a/dracut/parse-anaconda-repo.sh
+++ b/dracut/parse-anaconda-repo.sh
@@ -5,16 +5,21 @@
 getarg root= >/dev/null && return
 
 repo="$(getarg repo= inst.repo=)"
+stage2="$(getarg stage2= inst.stage2=)"
+
+arg="repo"
+# default to using repo, but if we have stage2=, use that
+[ -n "$stage2" ] && arg="stage2" && repo="$stage2"
 
 if [ -n "$repo" ]; then
     splitsep ":" "$repo" repotype rest
     case "$repotype" in
         http|https|ftp|nfs|nfs4|nfsiso)
-            set_neednet; root="anaconda-net" ;;
+            set_neednet; root="anaconda-net:$repo" ;;
         hd|cd|cdrom)
             [ -n "$rest" ] && root="anaconda-disk:$rest" ;;
         *)
-            warn "Invalid value for 'inst.repo': $repo" ;;
+            warn "Invalid value for 'inst.$arg': $repo" ;;
     esac
 fi
 
-- 
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