summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortorben2015-11-19 14:02:03 +0100
committertorben2015-11-19 14:02:03 +0100
commit1e8f8245a299be2487dc1cca1956709b27062d9d (patch)
tree0108982d401e7c63d0875b4b6106473fc0c5ec11
parentadd bash library rebash (diff)
downloadsystemd-init-1e8f8245a299be2487dc1cca1956709b27062d9d.tar.gz
systemd-init-1e8f8245a299be2487dc1cca1956709b27062d9d.tar.xz
systemd-init-1e8f8245a299be2487dc1cca1956709b27062d9d.zip
Add openslx configuration parameter.
-rwxr-xr-xbuilder/dnbd3-rootfs/hooks/cmdline/enable-sysrq.sh2
-rwxr-xr-xbuilder/dnbd3-rootfs/hooks/cmdline/prepare-kernel-command-line-parameter.sh37
-rwxr-xr-xbuilder/dnbd3-rootfs/hooks/cmdline/set-dracut-environment-variables.sh4
-rwxr-xr-xbuilder/dnbd3-rootfs/hooks/pre-mount/fetch-config.sh2
-rwxr-xr-xdev-tools/openslxTFTPRoot/pxelinux.cfg/default4
-rw-r--r--dev-tools/virtualBoxTFTPRoot/pxelinux.cfg/default3
6 files changed, 29 insertions, 23 deletions
diff --git a/builder/dnbd3-rootfs/hooks/cmdline/enable-sysrq.sh b/builder/dnbd3-rootfs/hooks/cmdline/enable-sysrq.sh
index f779aa7a..30b12ea0 100755
--- a/builder/dnbd3-rootfs/hooks/cmdline/enable-sysrq.sh
+++ b/builder/dnbd3-rootfs/hooks/cmdline/enable-sysrq.sh
@@ -1,2 +1,2 @@
-# enables magic sysrq keys
+# Enables magic sysrq kernel supported key combinations.
echo 1 > /proc/sys/kernel/sysrq
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 6d6b9950..5f62a8cd 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,10 +1,13 @@
-command -v warn >/dev/null || . /lib/dracut-lib.sh
+command -v warn &> /dev/null || . /lib/dracut-lib.sh
-# fakes the cmdline to fix the ip parsing in darcut's net-lib.sh
-[ -d /fake ] || mkdir /fake
-
-# need to be a tmpfs for the hack to work
-mount -t tmpfs tmpfs /fake
+set -e
+# This location will be used to have a writable kernel command line file
+# location.
+local writeable_proc_cmdline_path='/writable_proc_cmdline/'
+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"
for parameter in $(getargs ip=); do
local temp="$parameter:"
@@ -19,16 +22,20 @@ for parameter in $(getargs ip=); do
[ -n "$3" ] && gateway_ip=$3
[ -n "$4" ] && net_mask=$4
- warn "PXE given net configuration: ip: $ip server_ip: $server_ip gateway_ip: $gateway_ip net_mask: $net_mask"
- local final_dracut_ip_config="$ip::$gateway_ip:$net_mask::enp0s3:off"
- warn "Final dracut ip config: $final_dracut_ip_config"
- sed --regexp-extended "s/ip=[^ ]*/ip=$final_dracut_ip_config/g" /proc/cmdline > /fake/cmdline
+ info "PXE given net configuration: ip: $ip server_ip: $server_ip gateway_ip: $gateway_ip net_mask: $net_mask"
+ 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"
done
+mount --options bind /fake/cmdline /proc/cmdline
-# bind mount it. Can we trust mount return codes here?
-# # if so, we should check what we get in $?
-mount -o bind /fake/cmdline /proc/cmdline
+for parameter in $(getargs slxsrv=); do
+ slxsrv="$parameter"
+done
+for parameter in $(getargs slxbase=); do
+ slxbase="$parameter"
+done
-grep ':enp0s3:off' /proc/cmdline || \
- warn 'Overwriting kernel commandline did not work.'
+set +e
diff --git a/builder/dnbd3-rootfs/hooks/cmdline/set-dracut-environment-variables.sh b/builder/dnbd3-rootfs/hooks/cmdline/set-dracut-environment-variables.sh
index 6deeb78f..c47af818 100755
--- a/builder/dnbd3-rootfs/hooks/cmdline/set-dracut-environment-variables.sh
+++ b/builder/dnbd3-rootfs/hooks/cmdline/set-dracut-environment-variables.sh
@@ -1,5 +1,5 @@
-# set rootok and root as dracut expects them to be set by
-# the module preparing the root filesystem.
+# Set rootok and root as dracut expects them to be set by the module preparing
+# the root filesystem.
rootok=1
root=block:/dev/devicemapper/root
diff --git a/builder/dnbd3-rootfs/hooks/pre-mount/fetch-config.sh b/builder/dnbd3-rootfs/hooks/pre-mount/fetch-config.sh
index 91662d6c..e0987711 100755
--- a/builder/dnbd3-rootfs/hooks/pre-mount/fetch-config.sh
+++ b/builder/dnbd3-rootfs/hooks/pre-mount/fetch-config.sh
@@ -1,4 +1,4 @@
-# Load dracut library if not already loaded.
+# Load dracUT library if not already loaded.
command -v getarg >/dev/null || . /lib/dracut-lib.sh
# read SLX_SERVER and SLX_BASE from the kernel command line
diff --git a/dev-tools/openslxTFTPRoot/pxelinux.cfg/default b/dev-tools/openslxTFTPRoot/pxelinux.cfg/default
index 530ffa56..3f8c998f 100755
--- a/dev-tools/openslxTFTPRoot/pxelinux.cfg/default
+++ b/dev-tools/openslxTFTPRoot/pxelinux.cfg/default
@@ -62,7 +62,7 @@ LABEL net
MENU LABEL ^Dracut TEST Torben
KERNEL http://132.230.4.201:8080/vmlinuz-linux
INITRD http://132.230.4.201:8080/initramfs-test.img
- APPEND root=PARTLABEL=system rw rootflags=subvol=root loglevel=2 acpi_osi="!Windows 2012" rd.info rd.break vconsole.font=latarcyrheb-sun16 vconsole.keymap=de slxsrv=132.230.4.2 slxbase=boot/openslx-kiosk vga=current
+ APPEND root=PARTLABEL=system rw rootflags=subvol=root loglevel=2 acpi_osi="!Windows 2012" rd.info rd.break vconsole.font=latarcyrheb-sun16 vconsole.keymap=de slxsrv=132.230.4.2 slxbase=/ vga=current
IPAPPEND 3
MENU DEFAULT
@@ -70,6 +70,6 @@ LABEL net
MENU LABEL ^Dracut TEST Janosch
KERNEL http://132.230.4.202:8080/vmlinuz-linux
INITRD http://132.230.4.202:8080/initramfs-test.img
- APPEND root=PARTLABEL=system rw rootflags=subvol=root loglevel=2 acpi_osi="!Windows 2012" rd.info rd.break vconsole.font=latarcyrheb-sun16 vconsole.keymap=de slxsrv=132.230.4.2 slxbase=boot/openslx-kiosk vga=current
+ APPEND root=PARTLABEL=system rw rootflags=subvol=root loglevel=2 acpi_osi="!Windows 2012" rd.info rd.break vconsole.font=latarcyrheb-sun16 vconsole.keymap=de slxsrv=132.230.4.2 slxbase=/ vga=current
IPAPPEND 3
MENU DEFAULT
diff --git a/dev-tools/virtualBoxTFTPRoot/pxelinux.cfg/default b/dev-tools/virtualBoxTFTPRoot/pxelinux.cfg/default
index 02fac4d6..9785b1a7 100644
--- a/dev-tools/virtualBoxTFTPRoot/pxelinux.cfg/default
+++ b/dev-tools/virtualBoxTFTPRoot/pxelinux.cfg/default
@@ -8,8 +8,7 @@ MENU TITLE My PXE Boot Menu
LABEL arch
MENU LABEL ^arch network boot
KERNEL /vmlinuz-linux
-APPEND initrd=/initramfs-test.img root=PARTLABEL=system rw rootflags=subvol=root quiet loglevel=2 acpi_osi="!Windows 2012" rd.info rd.break ip=10.0.2.15:132.230.4.6:10.0.2.2:255.255.255.0 vconsole.font=latarcyrheb-sun16 vconsole.keymap=de slxsrv=132.230.4.2 slxbase=boot/openslx-kiosk vga=current
-# BOOTIF=01-00-19-99-f7-fa-f4
+APPEND initrd=/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:132.230.4.6:10.0.2.2:255.255.255.0 vconsole.font=latarcyrheb-sun16 vconsole.keymap=de slxsrv=132.230.4.2 slxbase=/ vga=current
LABEL BootNormal
MENU LABEL ^Boot Normal (HDD)