diff options
| author | Jonathan Bauer | 2015-04-14 17:58:50 +0200 |
|---|---|---|
| committer | Jonathan Bauer | 2015-04-14 17:58:50 +0200 |
| commit | e4c036d247389cfaeb3da8675ce53f53bef90afe (patch) | |
| tree | ae1c87aeb940147cb258c4b540ad920880781ac0 /testModule/hooks/cmdline.sh | |
| parent | static qemu-nbd (diff) | |
| parent | Some tries to fix kernel panic. (diff) | |
| download | systemd-init-e4c036d247389cfaeb3da8675ce53f53bef90afe.tar.gz systemd-init-e4c036d247389cfaeb3da8675ce53f53bef90afe.tar.xz systemd-init-e4c036d247389cfaeb3da8675ce53f53bef90afe.zip | |
Merge branch 'master' of git.openslx.org:openslx-ng/systemd-init
Diffstat (limited to 'testModule/hooks/cmdline.sh')
| -rw-r--r-- | testModule/hooks/cmdline.sh | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/testModule/hooks/cmdline.sh b/testModule/hooks/cmdline.sh new file mode 100644 index 00000000..340467df --- /dev/null +++ b/testModule/hooks/cmdline.sh @@ -0,0 +1,29 @@ +# Converts ip configuration format given by the pxe pre boot provider to a +# dracut compatible static ip configuration. + +source /usr/lib/test-library.sh + +for parameter in $(getargs ip=); do + local temp="$parameter:" + set -- + while [ -n "$temp" ]; do + set -- "$@" "${temp%%:*}" + temp=${temp#*:} + done + + [ -n "$1" ] && ip=$1 + [ -n "$2" ] && server_ip=$2 + [ -n "$3" ] && gateway_ip=$3 + [ -n "$4" ] && net_mask=$4 + + warn "PXE given net configuration: ip: $ip server_ip: $server_ip gateway_ip: $gateway_ip net_mask: $net_mask" + local final_dracut_ip_config="$ip::$gateway_ip:$net_mask:dracut_test_client:enp0s3:none" + warn "Final dracut ip config: $final_dracut_ip_config" + replace_cmd ip "$final_dracut_ip_config" +done + +# NOTE: Doesn't work since dracuts needed version of mount doesn't support +# binds. +#cat /proc/cmdline | sed --regexp-extended 's/ip=[^ ]+//g' \ +# >"$temporary_kernel_commandline_file_path" && \ +#mount -n --rbind -o ro "$temporary_kernel_commandline_file_path" /proc/cmdline |
