summaryrefslogtreecommitdiffstats
path: root/testModule/parse-ip.sh
diff options
context:
space:
mode:
Diffstat (limited to 'testModule/parse-ip.sh')
-rw-r--r--testModule/parse-ip.sh30
1 files changed, 10 insertions, 20 deletions
diff --git a/testModule/parse-ip.sh b/testModule/parse-ip.sh
index 75fca7b2..2f720c57 100644
--- a/testModule/parse-ip.sh
+++ b/testModule/parse-ip.sh
@@ -1,19 +1,12 @@
# Converts ip configuration format given by the pxe pre boot provider to a
# dracut compatible static ip configuration.
-temporary_kernel_commandline_file_path='/temporary_kernel_commandline.txt'
-warn
-warn 'Running ip kernel command line transformation.'
-warn
-
for parameter in $(getargs ip=); do
+ local temp="$parameter:"
set --
- while [ -n "$parameter" ]; do
- set -- "$@" "${parameter%%:*}"
- parameter=${parameter#*:}
- warn
- warn JAU
- warn
+ while [ -n "$temp" ]; do
+ set -- "$@" "${temp%%:*}"
+ temp=${temp#*:}
done
[ -n "$1" ] && ip=$1
@@ -21,17 +14,14 @@ for parameter in $(getargs ip=); do
[ -n "$3" ] && broadcast_ip=$3
[ -n "$4" ] && net_mask=$4
- warn
warn "PXE given net configuration: ip: $ip server_ip: $server_ip broadcast_ip: $broadcast_ip net_mask: $net_mask"
- warn
# TODO
- gateway_ip="$broadcast_ip"
- echo "ip=$ip::$gateway_ip:$net_mask:dracut_test_client:enp0s3:none" > /etc/cmdline
- warn
- warn "Converted ip configuration: \"$ip\"."
- warn
+ local gateway_ip="$broadcast_ip"
+ repace_cmd test "$ip::$gateway_ip:$net_mask:dracut_test_client:enp0s3:none"
done
-#cat /proc/cmdline | sed --regexp-extended 's/ ip=[^ ]+//g' \
+# 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 --bind -o ro "$temporary_kernel_commandline_file_path" /proc/cmdline
+#mount -n --rbind -o ro "$temporary_kernel_commandline_file_path" /proc/cmdline