diff options
author | Helmut Grohne <helmut@subdivi.de> | 2023-02-05 16:57:32 +0100 |
---|---|---|
committer | Helmut Grohne <helmut@subdivi.de> | 2023-02-05 16:57:32 +0100 |
commit | d7796a90aebc746593b99a40fce1e6192c9e1552 (patch) | |
tree | 96089b1e4712f038ffb5a718f59f370e95c66d5c | |
parent | 164dfaaa97f75c2ef1628910b9794e93f4877013 (diff) | |
download | debvm-d7796a90aebc746593b99a40fce1e6192c9e1552.tar.gz |
debvm-create: add --skip=initsystem
Closes: #1030254
-rwxr-xr-x | bin/debvm-create | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/bin/debvm-create b/bin/debvm-create index 392b701..4d26ce9 100755 --- a/bin/debvm-create +++ b/bin/debvm-create @@ -75,6 +75,14 @@ Internally, B<mmdebstrap> creates a tar archive first and converts that to ext2, This option causes the conversion to ext2 and further steps to be skipped and the output image will be a tar archive instead. Such a tar archive is not suitable for being booted by B<debvm-run>. +=item B<initsystem> + +skips installing an init system. +When enabling this option, the resulting image will lack F</sbin/init> and the image will not be bootable by B<debvm-run> unless something else provides that path. +One would specify this option when providing the init system via other means, such as passing C<--include=sysvinit-core> to B<mmdebstrap>. +This option also implies disabling other integrations that depend on it. +At present, this will also skip B<autologin> and B<systemdnetwork>. + =item B<kernel> skips installing a linux kernel image. @@ -231,6 +239,10 @@ check_skip() { esac } +if check_skip initsystem; then + SKIP="${SKIP}autologin,systemdnetwork," +fi + if ! check_skip kernel; then set -- "--customize-hook=$SHARE_DIR/customize-kernel.sh" "$@" fi @@ -246,11 +258,14 @@ set -- \ --verbose \ --variant=apt \ "--format=$MMFORMAT" \ - --include=systemd-sysv \ "--architecture=$ARCHITECTURE" \ '--customize-hook=echo "LABEL=debvm / ext4 defaults 0 1" >"$1/etc/fstab"' \ "$@" +if ! check_skip initsystem; then + set -- --include=systemd-sysv "$@" +fi + # set up a hostname set -- \ "--customize-hook=echo $VMNAME >"'"$1/etc/hostname"' \ |