summaryrefslogtreecommitdiffstats
path: root/builder
diff options
context:
space:
mode:
authorjandob2015-11-27 14:43:19 +0100
committerjandob2015-11-27 14:43:19 +0100
commit171fc3a219dbf2025bd4edae8c88695a2c5b312d (patch)
treeaf661a4abbc77be9c8d3f3d514583f56d13494da /builder
parentassume row disk if no partition hint is given in the configuration (diff)
parentFix. (diff)
downloadsystemd-init-171fc3a219dbf2025bd4edae8c88695a2c5b312d.tar.gz
systemd-init-171fc3a219dbf2025bd4edae8c88695a2c5b312d.tar.xz
systemd-init-171fc3a219dbf2025bd4edae8c88695a2c5b312d.zip
merge
Diffstat (limited to 'builder')
-rwxr-xr-xbuilder/dnbd3-rootfs/hooks/cmdline/prepare-kernel-command-line-parameter.sh36
-rwxr-xr-xbuilder/dnbd3-rootfs/hooks/mount/mount-root-device.sh3
-rwxr-xr-xbuilder/dnbd3-rootfs/hooks/pre-mount/prepare-root-partition.sh4
3 files changed, 33 insertions, 10 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 19737eaa..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,8 +7,24 @@ 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:---------------------------' \
+ "$SLX_INITIAL_KERNEL_COMMAND_LINE" \
+ '----------------------------------------------------------------------'
local parameter
+for parameter in $(getargs BOOTIF=); do
+ info "PXE given boot interface $parameter"
+ 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: $dracut_interface_name"
+ echo " ifname=$dracut_interface_name" >> \
+ "${writeable_proc_cmdline_path}cmdline"
+done
+local parameter
for parameter in $(getargs ip=); do
local temp="$parameter:"
set --
@@ -21,16 +39,18 @@ for parameter in $(getargs ip=); do
[ -n "$4" ] && net_mask=$4
info "PXE given net configuration: ip: $ip server_ip: $server_ip gateway_ip: $gateway_ip net_mask: $net_mask"
- # TODO arch needs enp0s3 and ubuntu needs eth0 here!
- local final_dracut_ip_configuration="$ip::$gateway_ip:$net_mask::enp0s3:off"
- info "Final dracut ip configuration is: $final_dracut_ip_configuration"
- sed --regexp-extended "s/ip=[^ ]*/ip=$final_dracut_ip_configuration/g" \
- /proc/cmdline > "${writeable_proc_cmdline_path}cmdline"
+ 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" \
+ --in-place "${writeable_proc_cmdline_path}cmdline"
done
-if [ -z "$final_dracut_ip_configuration" ]; then
+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
@@ -47,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 '------------------------------------------------------------------------'
diff --git a/builder/dnbd3-rootfs/hooks/mount/mount-root-device.sh b/builder/dnbd3-rootfs/hooks/mount/mount-root-device.sh
index 3da6e07c..97059aae 100755
--- a/builder/dnbd3-rootfs/hooks/mount/mount-root-device.sh
+++ b/builder/dnbd3-rootfs/hooks/mount/mount-root-device.sh
@@ -1,5 +1,4 @@
mount /dev/mapper/root "$NEWROOT" $SLX_MOUNT_ROOT_OPTIONS && \
# Write fstab for recognized system partition.
-# TODO make ubuntu compatible
-sed --in-place --quiet "/^LABEL=${SLX_SYSTEM_PARTITION_LABEL}.*/!s/.*//" \
+sed --in-place --quiet "/${SLX_SYSTEM_PARTITION_IDENTIFIER}.*/!s/.*//" \
"$NEWROOT/etc/fstab"
diff --git a/builder/dnbd3-rootfs/hooks/pre-mount/prepare-root-partition.sh b/builder/dnbd3-rootfs/hooks/pre-mount/prepare-root-partition.sh
index ad227bcc..63ef7d1f 100755
--- a/builder/dnbd3-rootfs/hooks/pre-mount/prepare-root-partition.sh
+++ b/builder/dnbd3-rootfs/hooks/pre-mount/prepare-root-partition.sh
@@ -28,9 +28,9 @@ local nbd_device='/dev/nbd0'
systemd-preserve-process-marker qemu-nbd --connect="$nbd_device" \
"$SLX_DNBD3_DEVICE" --read-only
-if [ -n $SLX_SYSTEM_PARTITION_LABEL ]; then
+if [ -n $SLX_SYSTEM_PARTITION_IDENTIFIER ]; then
local read_only_partition="$(utils.create_partition_via_offset \
- "$nbd_device" "$SLX_SYSTEM_PARTITION_LABEL")"
+ "$nbd_device" "$SLX_SYSTEM_PARTITION_IDENTIFIER")"
else # assume raw disk
local read_only_partition="$nbd_device"
fi