From 7a2b4669765963b76e0a8127f7a3b05ce6e79781 Mon Sep 17 00:00:00 2001 From: Jochen Sprickerhof Date: Sun, 15 Jan 2023 20:17:55 +0100 Subject: Drop mirror option It is not needed and can also be done with: debvm-create -- "deb http://ftp.de.debian.org/debian/ unstable main" --- bin/debvm-create | 21 +++++---------------- 1 file changed, 5 insertions(+), 16 deletions(-) (limited to 'bin') diff --git a/bin/debvm-create b/bin/debvm-create index b34399b..3da90a5 100755 --- a/bin/debvm-create +++ b/bin/debvm-create @@ -11,7 +11,7 @@ debvm-create - Create a VM image for various Debian releases and architectures =head1 SYNOPSIS -B [B<-a> I] [B<-h> I] [B<-k> F] [B<-m> I] [B<-o> F] [B<-r> I] [B<-s> ] [B<-z> I] [B<--> I] +B [B<-a> I] [B<-h> I] [B<-k> F] [B<-m> [B<-o> F] [B<-r> I] [B<-s> ] [B<-z> I] [B<--> I] =head1 DESCRIPTION @@ -44,11 +44,6 @@ This option also causes the ssh server to be installed. By default, no key or server is installed. To connect to the vm, pass a port number to B with the B<-s> option. -=item B<-m> I, B<--mirror>=I - -Specify the Debian mirror to be used for downloading packages and to be configured inside the virtual machine image. -By default, L is being used. - =item B<-o> F, B<--output>=F Specify the file name of the resulting virtual machine image. @@ -117,7 +112,6 @@ set -u ARCHITECTURE=$(dpkg --print-architecture) IMAGE=rootfs.ext4 INCLUDE_PACKAGES=init -MIRROR="http://deb.debian.org/debian" SIZE=$((1024*1024*1024)) SKIP=, SSHKEY= @@ -136,7 +130,7 @@ die() { exit 1 } usage() { - die "usage: $0 [-a architecture] [-h hostname] [-k sshkey] [-m mirror] [-o output] [-r release] [-s task] [-z size_in_GB] [-- mmdebstrap options]" + die "usage: $0 [-a architecture] [-h hostname] [-k sshkey] [-o output] [-r release] [-s task] [-z size_in_GB] [-- mmdebstrap options]" } usage_error() { echo "error: $*" 1>&2 @@ -149,9 +143,6 @@ opt_architecture() { opt_hostname() { VMNAME=$1 } -opt_mirror() { - MIRROR=$1 -} opt_skip() { SKIP="$SKIP$1," } @@ -173,7 +164,6 @@ while getopts :a:h:k:m:o:r:s:z:-: OPTCHAR; do a) opt_architecture "$OPTARG" ;; h) opt_hostname "$OPTARG" ;; k) opt_sshkey "$OPTARG" ;; - m) opt_mirror "$OPTARG" ;; o) opt_output "$OPTARG" ;; r) opt_release "$OPTARG" ;; s) opt_skip "$OPTARG" ;; @@ -183,12 +173,12 @@ while getopts :a:h:k:m:o:r:s:z:-: OPTCHAR; do help) usage ;; - architecture|hostname|mirror|output|release|size|skip|sshkey) + architecture|hostname|output|release|size|skip|sshkey) test "$OPTIND" -gt "$#" && usage_error "missing argument for --$OPTARG" "opt_$OPTARG" "$(nth_arg "$OPTIND" "$@")" OPTIND=$((OPTIND+1)) ;; - architecture=*|hostname=*|mirror=*|output=*|release=*|size=*|skip=*|sshkey=*) + architecture=*|hostname=*|output=*|release=*|size=*|skip=*|sshkey=*) "opt_${OPTARG%%=*}" "${OPTARG#*=}" ;; *) @@ -341,8 +331,7 @@ fi set -- "--customize-hook=$SHARE_DIR/customize-autologin.sh" "$@" -# suite target mirror -set -- "$@" "$SUITE" "$IMAGE" "deb $MIRROR $SUITE main" +set -- "$SUITE" "$IMAGE" "$@" set -ex -- cgit v1.2.3 From 54d41b49ea8b732f7ccd580f5c447a43200055ad Mon Sep 17 00:00:00 2001 From: Johannes Schauer Marin Rodrigues Date: Sun, 15 Jan 2023 19:29:20 +0000 Subject: Apply 1 suggestion(s) to 1 file(s) --- bin/debvm-create | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'bin') diff --git a/bin/debvm-create b/bin/debvm-create index 3da90a5..d85f82c 100755 --- a/bin/debvm-create +++ b/bin/debvm-create @@ -11,7 +11,7 @@ debvm-create - Create a VM image for various Debian releases and architectures =head1 SYNOPSIS -B [B<-a> I] [B<-h> I] [B<-k> F] [B<-m> [B<-o> F] [B<-r> I] [B<-s> ] [B<-z> I] [B<--> I] +B [B<-a> I] [B<-h> I] [B<-k> F] [B<-o> F] [B<-r> I] [B<-s> ] [B<-z> I] [B<--> I] =head1 DESCRIPTION -- cgit v1.2.3 From c485761592a569f59be3f6d1968eff91bf741b68 Mon Sep 17 00:00:00 2001 From: Helmut Grohne Date: Sun, 15 Jan 2023 21:25:09 +0100 Subject: debvm-create: carefully handle a -o filename starting with a dash --- bin/debvm-create | 1 + 1 file changed, 1 insertion(+) (limited to 'bin') diff --git a/bin/debvm-create b/bin/debvm-create index d85f82c..2555a8e 100755 --- a/bin/debvm-create +++ b/bin/debvm-create @@ -151,6 +151,7 @@ opt_sshkey() { } opt_output() { IMAGE=$1 + test "${IMAGE#-}" = "$IMAGE" || IMAGE="./$IMAGE" } opt_release() { SUITE=$1 -- cgit v1.2.3 From bebff47fac1e3c80790ad0c67b96a05eefd444ea Mon Sep 17 00:00:00 2001 From: Helmut Grohne Date: Sun, 15 Jan 2023 21:32:49 +0100 Subject: debvm-create: actually drop -m from the getopts invocation Fixes: 7a2b46697659 ("Drop mirror option") --- bin/debvm-create | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'bin') diff --git a/bin/debvm-create b/bin/debvm-create index 2555a8e..47ebde6 100755 --- a/bin/debvm-create +++ b/bin/debvm-create @@ -160,7 +160,7 @@ opt_size() { SIZE=$(($1*1024*1024*1024)) } -while getopts :a:h:k:m:o:r:s:z:-: OPTCHAR; do +while getopts :a:h:k:o:r:s:z:-: OPTCHAR; do case "$OPTCHAR" in a) opt_architecture "$OPTARG" ;; h) opt_hostname "$OPTARG" ;; -- cgit v1.2.3 From da8e17075d74c79822cb47a5be56f04109c50e94 Mon Sep 17 00:00:00 2001 From: Helmut Grohne Date: Sun, 15 Jan 2023 21:33:39 +0100 Subject: debvm-create: update documentation for dropped mirror option --- bin/debvm-create | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'bin') diff --git a/bin/debvm-create b/bin/debvm-create index 47ebde6..09ee897 100755 --- a/bin/debvm-create +++ b/bin/debvm-create @@ -94,9 +94,10 @@ The default is 1 GB. =item B<--> I -All options beyond a double dash are passed to B before the suite, target and mirror specification. +All options beyond a double dash are passed to B after the suite and target specification. This can be used to provide additional hooks for image customization. You can also request additional packages to be installed into the image using B's B<--include> option. +Any positional arguments passed here will be treated as mirror specifications by B. =back -- cgit v1.2.3