From 3541f12849b277a2405a4d3bf692cf62f2045126 Mon Sep 17 00:00:00 2001 From: torben Date: Thu, 9 Apr 2015 03:27:39 +0200 Subject: Adding functions library. --- testModule/busybox | Bin 0 -> 931664 bytes testModule/library.sh | 38 ++++++++++++++++++++++++++++++++++++++ testModule/module-setup.sh | 5 ++++- testModule/parse-ip.sh | 30 ++++++++++-------------------- 4 files changed, 52 insertions(+), 21 deletions(-) create mode 100755 testModule/busybox create mode 100644 testModule/library.sh (limited to 'testModule') diff --git a/testModule/busybox b/testModule/busybox new file mode 100755 index 00000000..1212ae20 Binary files /dev/null and b/testModule/busybox differ diff --git a/testModule/library.sh b/testModule/library.sh new file mode 100644 index 00000000..d3f97aff --- /dev/null +++ b/testModule/library.sh @@ -0,0 +1,38 @@ +cat /proc/cmdline >/tmp/cmdline + +replace_cmd() { + sed --regexp-extended "s/$1=[^ ]*/$1=$2/g" /tmp/cmdline -i +} + +getcmdline() { + local _line + local _i + local CMDLINE_ETC_D + local CMDLINE_ETC + unset _line + + if [ -e /etc/cmdline ]; then + while read -r _line; do + CMDLINE_ETC="$CMDLINE_ETC $_line"; + done /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 -- cgit v1.2.3-55-g7522