getarg 'break=pre-udev' && emergency_shell
source_all pre-udev
-
-[ "$root" ] || {
- root=$(getarg root=)
- case $root in
- LABEL=*) root=${root#LABEL=}
- root="$(echo $root |sed 's,/,\\x2f,g')"
- root="/dev/disk/by-label/${root}" ;;
- UUID=*) root="/dev/disk/by-uuid/${root#UUID=}" ;;
- '') echo "Warning: no root specified"
- root="/dev/sda1" ;;
- esac
-}
-
-[ "$rflags" ] || {
- if rflags="$(getarg rootflags=)"; then
- getarg rw && rflags="${rflags},rw" || rflags="${rflags},ro"
- else
- getarg rw && rflags=rw || rflags=ro
- fi
-}
-
-[ "$fstype" ] || {
- fstype="$(getarg rootfstype=)" && fstype="-t ${fstype}"
-}
-
-resume=$(getarg resume=) && ! getarg noresume && [ -b "$resume" ] && {
- # parsing the output of ls is Bad, but until there is a better way...
- (
- echo -e 'NAME=="'${resume#/dev/}'", RUN+="/bin/sh -c \047 echo %M:%m > /sys/power/resume \047 "'
- echo -e 'SYMLINK=="'${resume#/dev/}'", RUN+="/bin/sh -c \047 echo %M:%m > /sys/power/resume \047 "'
- ) >> /lib/udev/rules.d/99-resume.rules
-}
-
-(
- echo -e ' NAME=="'${root#/dev/}'", RUN+="/bin/sh -c \047 mount '$fstype' -o '$rflags' '$root' '$NEWROOT' \047 " '
- echo -e ' SYMLINK=="'${root#/dev/}'", RUN+="/bin/sh -c \047 mount '$fstype' -o '$rflags' '$root' '$NEWROOT' \047 " '
-) >> /lib/udev/rules.d/99-mount.rules
-
# start up udev and trigger cold plugs
udevd --daemon
udevadm trigger >/dev/null 2>&1