--mount and --unmount options added.

This commit is contained in:
Luka Vandervelden 2019-09-03 13:22:58 +02:00
parent e951e61e93
commit a871efebdc

View File

@ -75,7 +75,7 @@ function rootfs/unmount {
function installer/parse-opts {
local failure=false
zparseopts -D -E -- -root:=root r:=root -help=help h=help
zparseopts -D -E -- -root:=root r:=root -help=help h=help m=mount -mount=mount u=unmount -unmount=unmount
root=${root[-1]}
[[ ! $root ]] && failure=true
@ -86,6 +86,8 @@ function installer/parse-opts {
echo "usage: $0 [options]"
echo
echo " -r DIR, --root DIR Specifies where to bootstrap the rootfs."
echo " -m, --mount Use with -r to only mount a rootfs without bootstrapping it."
echo " -u, --unmount Use with -r to only unmount a rootfs without bootstrapping it."
echo " -h, --help Prints this message and exits."
if $help; then
@ -104,10 +106,22 @@ function installer/parse-opts {
if [[ -z "$WEIRDOS_SOURCE" ]]; then
installer/parse-opts "$@"
if [[ -n "$mount" ]]; then
rootfs/mount "$root"
exit 0
fi
if [[ -n "$unmount" ]]; then
rootfs/unmount "$root"
exit 0
fi
# INITIAL SYSTEM BOOTSTRAP
##fs/setup
##fs/mount
rootfs/setup "$root"
rootfs/mount "$root"
##syslinux/setup