Skip to content

Commit

Permalink
Merge pull request #4389 from rvykydal/fix-filename-dhcp-option-for-i…
Browse files Browse the repository at this point in the history
…nst-ks

dracut: read filename dhcp option from dhcpopts file
  • Loading branch information
M4rtinK committed Nov 9, 2022
2 parents 6ba0bc4 + ea3b08f commit 97b8aa8
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions dracut/fetch-kickstart-net.sh
Expand Up @@ -26,19 +26,11 @@ case $kickstart in
# Construct URL for nfs:auto.
if [ "$kickstart" = "nfs:auto" ]; then
# Construct kickstart URL from dhcp info.
# Server is next_server, or the dhcp server itself if missing.
. /tmp/net.$netif.dhcpopts
server="${new_next_server:-$new_dhcp_server_identifier}"
# Filename is dhcp 'filename' option, or '/kickstart/' if missing.
filename="/kickstart/"
# Read the dhcp lease file and see if we can find 'filename'.
{ while read line; do
val="${line#filename }"
if [ "$val" != "$line" ]; then
eval "filename=$val" # Drop quoting and semicolon.
fi
done
} < /tmp/net.$netif.lease
. /tmp/net.$netif.dhcpopts
# Server is next_server, or the dhcp server itself if missing.
server="${new_next_server:-$new_dhcp_server_identifier}"
kickstart="nfs:$server:$filename"
fi

Expand Down

0 comments on commit 97b8aa8

Please sign in to comment.