You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

27 lines
702 B

#!/bin/sh
[ "$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}"
}
[ -e "$root" ] && mount $fstype -o "$rflags" "$root" "$NEWROOT" && \
ROOTFS_MOUNTED=yes