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

dracut: read filename dhcp option from dhcpopts file #4389

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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