From 19663abd61b8bfc1ac3fbbdbf3aeec297bc5316e Mon Sep 17 00:00:00 2001 From: Helmut Grohne Date: Thu, 23 Feb 2023 21:23:48 +0100 Subject: debvm-create: also support --initsystem=busybox Reported-by: Johannes Schauer Marin Rodrigues --- bin/debvm-create | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'bin/debvm-create') diff --git a/bin/debvm-create b/bin/debvm-create index fffa494..89256eb 100755 --- a/bin/debvm-create +++ b/bin/debvm-create @@ -37,7 +37,7 @@ A suitable kernel image is automatically selected and installed into the image. Set the hostname of the virtual machine. By default, the hostname is B. -=item B<--initsystem>=B | B | B | B +=item B<--initsystem>=B | B | B | B | B Select an init system to be used. The default is B independently of the Debian release. @@ -75,6 +75,7 @@ The following tasks may be skipped. Skips adding a the customize-autologin.sh to B that configures automatic root login on a serial console and also parses the C kernel cmdline and passes it as C to B. +This is specific to using B, B or B as init system. =item B @@ -184,10 +185,10 @@ opt_hostname() { } opt_initsystem() { case "$1" in - systemd|sysv|runit|none) + busybox|none|runit|systemd|sysv) ;; *) - die "value for --initsystem must be one of systemd, sysv or none" + die "value for --initsystem must be one of systemd, busybox, none, runit or sysv" ;; esac INITSYSTEM=$1 @@ -284,6 +285,16 @@ set -- \ "$@" case "$INITSYSTEM" in + busybox) + set -- \ + --include=busybox \ + '--customize-hook=ln -s /bin/busybox $1/sbin/init' \ + "$@" + SKIP="${SKIP}autologin," + ;; + none) + SKIP="${SKIP}autologin," + ;; runit) set -- --include=runit-init,passwd "$@" ;; @@ -347,7 +358,7 @@ if ! check_skip usrmerge; then set -- --hook-dir=/usr/share/mmdebstrap/hooks/maybe-merged-usr "$@" fi -if test "$INITSYSTEM" != none && ! check_skip autologin; then +if ! check_skip autologin; then set -- "--customize-hook=$SHARE_DIR/customize-autologin.sh" "$@" fi -- cgit v1.2.3