summaryrefslogtreecommitdiffstats
path: root/testModule/hooks/cmdline
diff options
context:
space:
mode:
authorJonathan Bauer2015-05-06 18:13:52 +0200
committerJonathan Bauer2015-05-06 18:13:52 +0200
commitb3312f86061a0d887233f5068cbc335aa2612bed (patch)
tree32a0bace5eb6a7afeb29dae80d7f01fefecb36cc /testModule/hooks/cmdline
parentMerge branch 'master' of git.openslx.org:openslx-ng/systemd-init (diff)
downloadsystemd-init-b3312f86061a0d887233f5068cbc335aa2612bed.tar.gz
systemd-init-b3312f86061a0d887233f5068cbc335aa2612bed.tar.xz
systemd-init-b3312f86061a0d887233f5068cbc335aa2612bed.zip
current state: udev disk detection still not done!
also improved module structure and code commentary
Diffstat (limited to 'testModule/hooks/cmdline')
-rwxr-xr-xtestModule/hooks/cmdline/enable-sysrq.sh2
-rwxr-xr-xtestModule/hooks/cmdline/expand-kcl-ip.sh20
-rwxr-xr-xtestModule/hooks/cmdline/mark-root-device.sh9
3 files changed, 31 insertions, 0 deletions
diff --git a/testModule/hooks/cmdline/enable-sysrq.sh b/testModule/hooks/cmdline/enable-sysrq.sh
new file mode 100755
index 00000000..f779aa7a
--- /dev/null
+++ b/testModule/hooks/cmdline/enable-sysrq.sh
@@ -0,0 +1,2 @@
+# enables magic sysrq keys
+echo 1 > /proc/sys/kernel/sysrq
diff --git a/testModule/hooks/cmdline/expand-kcl-ip.sh b/testModule/hooks/cmdline/expand-kcl-ip.sh
new file mode 100755
index 00000000..8be1c718
--- /dev/null
+++ b/testModule/hooks/cmdline/expand-kcl-ip.sh
@@ -0,0 +1,20 @@
+# fakes the cmdline to fix the ip parsing when using
+# syslinux's IPAPPEND 1 mask
+[ -d /fake ] || mkdir /fake
+
+# need to be a tmpfs for the hack to work
+mount -t tmpfs tmpfs /fake
+
+# append ':hiwi:eth0:none' to the 'ip=' parameter we got
+# from syslinux's IPAPPEND 1
+sed 's/\(ip=\([0-9]\{1,3\}\.\)\{3\}[0-9]\{1,3\}:\([0-9]\{1,3\}\.\)\{3\}[0-9]\{1,3\}:\([0-9]\{1,3\}\.\)\{3\}[0-9]\{1,3\}:\([0-9]\{1,3\}\.\)\{3\}[0-9]\{1,3\}\)/\1:hiwi:eno1:none/' /proc/cmdline > /fake/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
+
+# check if it worked
+if ! grep 'hiwi:eth0:none' /proc/cmdline; then
+ command -v warn >/dev/null || . /lib/dracut-lib.sh
+ warn 'Haxing cmdline did not work :( sad pandaz...'
+fi
diff --git a/testModule/hooks/cmdline/mark-root-device.sh b/testModule/hooks/cmdline/mark-root-device.sh
new file mode 100755
index 00000000..b7282521
--- /dev/null
+++ b/testModule/hooks/cmdline/mark-root-device.sh
@@ -0,0 +1,9 @@
+# set rootok and root as dracut expects them to be set by
+# the module preparing the root filesystem.
+#
+# Once the root filesystem is mounted per dnbd3 and
+# exported as qcow2 per nbd, /dev/root will be a symlink
+# to /dev/nbd0 as this is then our rootfs-device
+rootok=1
+root=block:/dev/root
+