From d46fd801bfade7f69f79b3846d4413c0278fffaa Mon Sep 17 00:00:00 2001 From: torben Date: Mon, 4 May 2015 13:52:03 +0200 Subject: Pepare merge. --- testModule/hooks/cmdline.sh | 29 ----------------------------- testModule/hooks/cmdlineOLD.sh | 30 ++++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+), 29 deletions(-) delete mode 100755 testModule/hooks/cmdline.sh create mode 100755 testModule/hooks/cmdlineOLD.sh (limited to 'testModule/hooks') diff --git a/testModule/hooks/cmdline.sh b/testModule/hooks/cmdline.sh deleted file mode 100755 index 340467df..00000000 --- a/testModule/hooks/cmdline.sh +++ /dev/null @@ -1,29 +0,0 @@ -# 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 diff --git a/testModule/hooks/cmdlineOLD.sh b/testModule/hooks/cmdlineOLD.sh new file mode 100755 index 00000000..95f6f6a6 --- /dev/null +++ b/testModule/hooks/cmdlineOLD.sh @@ -0,0 +1,30 @@ +# 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:$server_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" + echo "root-path=nfs:$server_ip:/">>/tmp/cmdline +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 -- cgit v1.2.3-55-g7522