summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorHelmut Grohne <helmut@subdivi.de>2023-03-06 10:15:06 +0100
committerHelmut Grohne <helmut@subdivi.de>2023-03-06 10:15:06 +0100
commit297962aec78617e9316a9bfcfa212e5b64cb11c2 (patch)
treeef74ffc320b390813ebe853c4a5a3a3486540a5c /bin
parentdc972d6e1b1afb3f88319f55dc410c57c3f58563 (diff)
downloaddebvm-297962aec78617e9316a9bfcfa212e5b64cb11c2.tar.gz
debvm-create: deprecate and hide the -a option
At this point, we only forward -a to mmdebstrap. It's not actually that helpful to have this option on both levels, so just keep it on the mmdebstrap level.
Diffstat (limited to 'bin')
-rwxr-xr-xbin/debvm-create24
1 files changed, 14 insertions, 10 deletions
diff --git a/bin/debvm-create b/bin/debvm-create
index 521ad36..1c7c29d 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<debvm-create> [B<-a> I<architecture>] [B<-h> I<hostname>] [B<-k> F<sshkey>] [B<-o> F<output>] [B<-r> I<release>] [B<-s> <task>] [B<-z> I<size>] [B<--> I<mmdebstrap options>]
+B<debvm-create> [B<-h> I<hostname>] [B<-k> F<sshkey>] [B<-o> F<output>] [B<-r> I<release>] [B<-s> <task>] [B<-z> I<size>] [B<--> I<mmdebstrap options>]
=head1 DESCRIPTION
@@ -26,12 +26,6 @@ No user account is created and root can login without specifying a password.
=over 8
-=item B<-a> I<architecture>, B<--architecture>=I<architecture>
-
-Specify a Debian architecture name.
-By default, the native architecture is being used.
-A suitable kernel image is automatically selected and installed into the image.
-
=item B<-h> I<hostname>, B<--hostname>=I<hostname>
Set the hostname of the virtual machine.
@@ -131,11 +125,16 @@ All options beyond a double dash are passed to B<mmdebstrap> after the suite and
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<mmdebstrap>'s B<--include> option.
Any positional arguments passed here will be treated as mirror specifications by B<mmdebstrap>.
+In particular, you can also change the architecture of the resulting image using the B<--architecture> option.
=back
=head1 EXAMPLES
+When creating an image with multiple architectures, the kernel selection will prefer the sibling 64bit architecture.
+
+ debvm-create ... -- --architecture=armhf,arm64
+
In order to create images for Debian ports architectures, you can pass two options to mmdebstrap.
debvm-create ... -- http://deb.debian.org/debian-ports --keyring=/usr/share/keyrings/debian-ports-archive-keyring.gpg
@@ -172,7 +171,7 @@ POD2MAN
set -u
-ARCHITECTURE=$(dpkg --print-architecture)
+ARCHITECTURE=
IMAGE=rootfs.ext4
INITSYSTEM=systemd
SIZE=1G
@@ -193,7 +192,7 @@ die() {
exit 1
}
usage() {
- die "usage: $0 [-a architecture] [-h hostname] [-k sshkey] [-o output] [-r release] [-s task] [-z size] [-- mmdebstrap options]"
+ die "usage: $0 [-h hostname] [-k sshkey] [-o output] [-r release] [-s task] [-z size] [-- mmdebstrap options]"
}
usage_error() {
echo "error: $*" 1>&2
@@ -201,6 +200,8 @@ usage_error() {
}
opt_architecture() {
+ # This option only exists for backwards-compatibility.
+ # You can pass it as mmdebstrap option instead.
ARCHITECTURE=$1
}
opt_hostname() {
@@ -303,10 +304,13 @@ set -- \
--verbose \
--variant=apt \
"--format=$MMFORMAT" \
- "--architecture=$ARCHITECTURE" \
'--customize-hook=echo "LABEL=debvm / ext4 defaults 0 0" >"$1/etc/fstab"' \
"$@"
+if test -n "$ARCHITECTURE"; then
+ set -- "--architecture=$ARCHITECTURE" "$@"
+fi
+
case "$INITSYSTEM" in
busybox)
set -- \