Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix download of stage2 image from .treeinfo #5773

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions dracut/anaconda-lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ config_get() {
\[*\]*) cursec="${line#[}"; cursec="${cursec%%]*}" ;;
*=*) k="${line%%=*}"; v="${line#*=}" ;;
esac
# trim leading and trailing whitespace characters
k=$(echo "$k" | sed 's/^ *//;s/ *$//')
v=$(echo "$v" | sed 's/^ *//;s/ *$//')

if [ "$cursec" = "$section" ] && [ "$k" == "$key" ]; then
echo "$v"
break
Expand Down Expand Up @@ -108,6 +112,10 @@ anaconda_net_root() {
local repo="$1"
info "anaconda: fetching stage2 from $repo"

# Remove last `/` from repo to enable cunstructs like ...os/../BaseOS/image/install.img
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/cunstructs/constructs/ ?

# Otherwise curl will fail to work with `...os//../BaseOS...`
repo=${repo%/}

# Try to get the local path to stage2 from treeinfo.
treeinfo=$(fetch_url "$repo/.treeinfo" 2> /tmp/treeinfo_err) && \
stage2=$(config_get stage2 mainimage < "$treeinfo")
Expand Down