blob: aca0e0c701c605d712cd4d9677c845dd11873993 (
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
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
|
# 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"
echo '-----------------------Kernel-Command-Line:-----------------------------'
cat /proc/cmdline
echo '------------------------------------------------------------------------'
local parameter
for parameter in $(getargs BOOTIF=); do
info "PXE given boot interface $parameter"
local 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: $interface_name"
echo " ifname=$interface_name" >> "${writeable_proc_cmdline_path}cmdline"
done
local parameter
for parameter in $(getargs ip=); do
local temp="$parameter:"
set --
while [ -n "$temp" ]; do
set -- "$@" "${temp%%:*}"
temp=${temp#*:}
done
[ -n "$1" ] && ip=$1
[ -n "$2" ] && server_ip=$2
[ -n "$3" ] && gateway_ip=$3
[ -n "$4" ] && net_mask=$4
info "PXE given net configuration: ip: $ip server_ip: $server_ip gateway_ip: $gateway_ip net_mask: $net_mask"
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" \
/proc/cmdline > "${writeable_proc_cmdline_path}cmdline"
done
if [ -z "$dracut_ip_configuration" ]; then
warn 'No "ip" parameter found in the kernel command line.'
fi
mount --options bind "${writeable_proc_cmdline_path}cmdline" /proc/cmdline
for parameter in $(getargs slxsrv=); do
SLX_SERVER="$parameter"
done
for parameter in $(getargs slxbase=); do
SLX_SERVER_BASE="$parameter"
done
if [ -z "$SLX_SERVER" ]; then
warn 'No "slxsrv" parameter found in the kernel command line.'
return 1
fi
if [ -z "$SLX_SERVER_BASE" ]; then
warn 'No "slxbase" parameter found in the kernel command line.'
return 1
fi
|