summaryrefslogtreecommitdiffstats
path: root/builder
diff options
context:
space:
mode:
authortorben2015-11-27 14:10:44 +0100
committertorben2015-11-27 14:10:44 +0100
commitb71a35df98237cc8be47940b6d386714e4170f12 (patch)
treed8e42510753ea60b061d909a2036c2c0c5c558ad /builder
parentFix bootname. (diff)
downloadsystemd-init-b71a35df98237cc8be47940b6d386714e4170f12.tar.gz
systemd-init-b71a35df98237cc8be47940b6d386714e4170f12.tar.xz
systemd-init-b71a35df98237cc8be47940b6d386714e4170f12.zip
Improve boot interface.
Diffstat (limited to 'builder')
-rwxr-xr-xbuilder/dnbd3-rootfs/hooks/cmdline/prepare-kernel-command-line-parameter.sh27
1 files changed, 20 insertions, 7 deletions
diff --git a/builder/dnbd3-rootfs/hooks/cmdline/prepare-kernel-command-line-parameter.sh b/builder/dnbd3-rootfs/hooks/cmdline/prepare-kernel-command-line-parameter.sh
index aca0e0c7..93713edd 100755
--- a/builder/dnbd3-rootfs/hooks/cmdline/prepare-kernel-command-line-parameter.sh
+++ b/builder/dnbd3-rootfs/hooks/cmdline/prepare-kernel-command-line-parameter.sh
@@ -1,3 +1,5 @@
+SLX_INITIAL_KERNEL_COMMAND_LINE="$(cat /proc/cmdline)"
+
# This location will be used to have a writable kernel command line file
# location.
local writeable_proc_cmdline_path='/writable_proc_cmdline/'
@@ -5,18 +7,22 @@ mkdir --parents "$writeable_proc_cmdline_path"
# NOTE: The fake writeable overlay have to be a temporary filesystem for the
# hack to work.
mount --types tmpfs tmpfs "$writeable_proc_cmdline_path"
+echo "$SLX_INITIAL_KERNEL_COMMAND_LINE" > \
+ "${writeable_proc_cmdline_path}/cmdline"
-echo '-----------------------Kernel-Command-Line:-----------------------------'
-cat /proc/cmdline
-echo '------------------------------------------------------------------------'
+echo \
+ '-----------------------Kernel-Command-Line:---------------------------' \
+ "$SLX_INITIAL_KERNEL_COMMAND_LINE" \
+ '----------------------------------------------------------------------'
local parameter
for parameter in $(getargs BOOTIF=); do
info "PXE given boot interface $parameter"
- local interface_name="bootnet:$(echo $parameter | sed --regexp-extended \
+ local dracut_interface_name="bootnet:$(echo $parameter | sed --regexp-extended \
's/[0-9]{2}-(([0-9]{2}-){5}[0-9]{2})/\1/' | sed s/-/:/g)"
- info "Dracut interface name is: $interface_name"
- echo " ifname=$interface_name" >> "${writeable_proc_cmdline_path}cmdline"
+ info "Dracut interface name is: $dracut_interface_name"
+ echo " ifname=$dracut_interface_name" >> \
+ "${writeable_proc_cmdline_path}cmdline"
done
local parameter
for parameter in $(getargs ip=); do
@@ -36,12 +42,15 @@ for parameter in $(getargs ip=); do
local dracut_ip_configuration="$ip::$gateway_ip:$net_mask::bootnet:off"
info "Dracut ip configuration is: $dracut_ip_configuration"
sed --regexp-extended "s/ip=[^ ]*/ip=$dracut_ip_configuration/g" \
- /proc/cmdline > "${writeable_proc_cmdline_path}cmdline"
+ --in-place "${writeable_proc_cmdline_path}cmdline"
done
if [ -z "$dracut_ip_configuration" ]; then
warn 'No "ip" parameter found in the kernel command line.'
fi
+if [ -z "$dracut_interface_name" ]; then
+ warn 'No "BOOTIF" parameter found in the kernel command line.'
+fi
mount --options bind "${writeable_proc_cmdline_path}cmdline" /proc/cmdline
for parameter in $(getargs slxsrv=); do
@@ -58,3 +67,7 @@ if [ -z "$SLX_SERVER_BASE" ]; then
warn 'No "slxbase" parameter found in the kernel command line.'
return 1
fi
+
+echo '-----------------------Dracut-Kernel-Command-Line:----------------------'
+cat /proc/cmdline
+echo '------------------------------------------------------------------------'