2 # -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
3 # ex: ts=8 sw=4 sts=4 et filetype=sh
5 if [ -f /dracut-state.sh
]; then
6 .
/dracut-state.sh
2>/dev
/null
8 type getarg
>/dev
/null
2>&1 || .
/lib
/dracut-lib.sh
10 [ -f /etc
/initrd-release
] && .
/etc
/initrd-release
11 [ -n "$VERSION" ] && info
"dracut-$VERSION"
13 if ! getargbool
1 'rd.hostonly'; then
17 getargbool
0 rd.udev.log-priority
=info
-d rd.udev.info
-d -n -y rdudevinfo
&& echo 'udev_log="info"' >> /etc
/udev
/udev.conf
18 getargbool
0 rd.udev.log-priority
=debug
-d rd.udev.debug
-d -n -y rdudevdebug
&& echo 'udev_log="debug"' >> /etc
/udev
/udev.conf
20 source_conf
/etc
/conf.d
24 rflags
="$(getarg rootflags=)"
25 getargbool
0 ro
&& rflags
="${rflags},ro"
26 getargbool
0 rw
&& rflags
="${rflags},rw"
29 fstype
="$(getarg rootfstype=)"
30 if [ -z "$fstype" ]; then
38 make_trace_mem
"hook cmdline" '1+:mem' '1+:iomem' '3+:slab'
39 # run scriptlets to parse the command line
40 getarg
'rd.break=cmdline' -d 'rdbreak=cmdline' && emergency_shell
-n cmdline
"Break before cmdline"
43 [ -f /lib
/dracut
/parse-resume.sh
] && .
/lib
/dracut
/parse-resume.sh
46 block
:LABEL
=*|LABEL
=*)
48 root
="$(echo $root | sed 's,/,\\x2f,g')"
49 root
="block:/dev/disk/by-label/${root#LABEL=}"
53 root
="block:/dev/disk/by-uuid/${root#UUID=}"
55 block
:PARTUUID
=*|PARTUUID
=*)
57 root
="block:/dev/disk/by-partuuid/${root#PARTUUID=}"
59 block
:PARTLABEL
=*|PARTLABEL
=*)
61 root
="block:/dev/disk/by-partlabel/${root#PARTLABEL=}"
68 [ -z "$root" ] && die
"No or empty root= argument"
69 [ -z "$rootok" ] && die
"Don't know how to handle 'root=$root'"
71 export root rflags fstype netroot NEWROOT
73 export -p > /dracut-state.sh