mirror of
ssh://git.janware.com/srv/git/janware/proj/jw-pkg
synced 2026-01-15 12:03:31 +01:00
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 <jan@janware.com>
This commit is contained in:
parent
5ddb4fd136
commit
384950181b
1 changed files with 11 additions and 1 deletions
|
|
@ -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 || {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue