summaryrefslogtreecommitdiffstats
path: root/testModule/hooks/cmdline.sh
blob: c38f9ae7b75f37466a2ad4819bf5b47c43c5bc93 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# giev powa
echo 1 > /proc/sys/kernel/sysrq

# 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