From 384950181bd7575fdd6d2e0e104315ca58402c1a Mon Sep 17 00:00:00 2001 From: Jan Lindemann Date: Thu, 29 Sep 2016 14:45:09 +0000 Subject: [PATCH] integrate-distro.sh: Add option -f This allows mount failures without -f if the target directory doesn't exist. Otherwise typos led to creation of those directories. Signed-off-by: Jan Lindemann --- scripts/integrate-distro.sh | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/scripts/integrate-distro.sh b/scripts/integrate-distro.sh index 8b9ff1a2..24716691 100644 --- a/scripts/integrate-distro.sh +++ b/scripts/integrate-distro.sh @@ -412,6 +412,7 @@ usage() $myname [options] [install|mount|unmount|mkinitrd|fs] options: + -f -d target-device -n target-name -p file with root password @@ -437,7 +438,7 @@ usage() get_opts() { - set -- `getopt 'hd:n:a:p:k:u:w:s:r:' $*` + set -- `getopt 'hd:n:a:p:k:u:w:s:r:f' $*` while [ "$1" != -- ] ; do case "$1" in -h) @@ -479,6 +480,9 @@ get_opts() env_ssh_auth_sock=$2 shift ;; + -f) + o_force=1 + ;; *) usage 1 ;; @@ -644,6 +648,12 @@ assert_not_mounted() setup_bind_mounts() { + [ -d "$root" ] || { + [ "$o_force" ] || { + echo "directory \"$root\" does not exist" + exit 1 + } + } local fs for fs in /dev /sys /proc /srv/ftp; do check_mount $fs || {