summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjandob2015-11-27 14:43:19 +0100
committerjandob2015-11-27 14:43:19 +0100
commit171fc3a219dbf2025bd4edae8c88695a2c5b312d (patch)
treeaf661a4abbc77be9c8d3f3d514583f56d13494da
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
-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
-rw-r--r--dev-tools/example-openslx.config2
-rw-r--r--dev-tools/virtualBoxTFTPRoot/pxelinux.cfg/default9
5 files changed, 39 insertions, 15 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
diff --git a/dev-tools/example-openslx.config b/dev-tools/example-openslx.config
index f93fa82f..4db11c6b 100644
--- a/dev-tools/example-openslx.config
+++ b/dev-tools/example-openslx.config
@@ -3,7 +3,7 @@ SLX_DNBD3_SERVERS='132.230.4.201,132.230.4.202,10.0.2.2'
SLX_DNBD3_RID='0'
SLX_DNBD3_DEVICE='/dev/dnbd0'
SLX_DNBD3_IMAGE='archLinux.vmdk'
-SLX_SYSTEM_PARTITION_LABEL='system'
+SLX_SYSTEM_PARTITION_IDENTIFIER='system'
SLX_PERSISTENT_PARTITION_PATTERN_LABEL_UUID_TYPE=''
SLX_TMP_PARTITION_PATTERN_LABEL_UUID_TYPE=''
SLX_RAMDISK_SIZE=524288
diff --git a/dev-tools/virtualBoxTFTPRoot/pxelinux.cfg/default b/dev-tools/virtualBoxTFTPRoot/pxelinux.cfg/default
index 36bc382e..3371b5ed 100644
--- a/dev-tools/virtualBoxTFTPRoot/pxelinux.cfg/default
+++ b/dev-tools/virtualBoxTFTPRoot/pxelinux.cfg/default
@@ -3,18 +3,19 @@ TIMEOUT 300
ALLOWOPTIONS 0
PROMPT 0
-MENU TITLE My PXE Boot Menu
+MENU TITLE Janosch und Torbens Bastelspassmenu
LABEL arch
MENU LABEL ^arch network boot
KERNEL /archLinux-vmlinuz-linux
-APPEND initrd=/archLinux-initramfs-test.img root=PARTLABEL=system rw rootflags=subvol=root loglevel=2 acpi_osi="!Windows 2012" rd.info rd.break ip=10.0.2.15::10.0.2.2:255.255.255.0 vconsole.font=latarcyrheb-sun16 vconsole.keymap=de-latin1-nodeadkeys rd.locale.LANG=de_DE.UTF-8 slxsrv=10.0.2.2:80,10.0.2.2:8080,10.0.2.2:8008,10.0.2.2:8090,10.0.2.2:8280,10.0.2.2:8888 slxbase=archLinux/ vga=current
+APPEND initrd=/archLinux-initramfs-test.img loglevel=2 acpi_osi="!Windows 2012" rd.info rd.break ip=10.0.2.15::10.0.2.2:255.255.255.0 vconsole.font=latarcyrheb-sun16 vconsole.keymap=de-latin1-nodeadkeys rd.locale.LANG=de_DE.UTF-8 slxsrv=10.0.2.2:80,10.0.2.2:8080,10.0.2.2:8008,10.0.2.2:8090,10.0.2.2:8280,10.0.2.2:8888 slxbase=archLinux/ vga=current
+SYSAPPEND 2
LABEL ubuntu
MENU LABEL ^ubuntu network boot
KERNEL /ubuntu-vmlinuz-linux
-APPEND initrd=/ubuntu-initramfs-test.img root=PARTLABEL=system rw rootflags=subvol=root loglevel=2 acpi_osi="!Windows 2012" rd.info rd.break ip=10.0.2.15::10.0.2.2:255.255.255.0 vconsole.keymap=de-latin1-nodeadkeys rd.locale.LANG=de_DE.UTF-8 net.ifnames=1 slxsrv=10.0.2.2:80,10.0.2.2:8080,10.0.2.2:8008,10.0.2.2:8090,10.0.2.2:8280,10.0.2.2:8888 slxbase=ubuntu/ vga=current
-# TODO vconsole.font=latarcyrheb-sun16
+APPEND initrd=/ubuntu-initramfs-test.img loglevel=2 acpi_osi="!Windows 2012" rd.info rd.break ip=10.0.2.15::10.0.2.2:255.255.255.0 vconsole.font=latarcyrheb-sun16 vconsole.keymap=de-latin1-nodeadkeys rd.locale.LANG=de_DE.UTF-8 net.ifnames=1 slxsrv=10.0.2.2:80,10.0.2.2:8080,10.0.2.2:8008,10.0.2.2:8090,10.0.2.2:8280,10.0.2.2:8888 slxbase=ubuntu/ vga=current
+SYSAPPEND 2
LABEL BootNormal
MENU LABEL ^Boot Normal (HDD)