summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xbin/debvm-create16
-rwxr-xr-xshare/customize-autologin.sh8
2 files changed, 18 insertions, 6 deletions
diff --git a/bin/debvm-create b/bin/debvm-create
index 1c7c29d..bfc02e3 100755
--- a/bin/debvm-create
+++ b/bin/debvm-create
@@ -31,12 +31,13 @@ No user account is created and root can login without specifying a password.
Set the hostname of the virtual machine.
By default, the hostname is B<testvm>.
-=item B<--initsystem>=B<systemd> | B<busybox> | B<runit> | B<sysv> | B<none>
+=item B<--initsystem>=B<systemd> | B<busybox> | B<finit> | B<runit> | B<sysv> | B<none>
Select an init system to be used.
The default is B<systemd> independently of the Debian release.
Note that when selecting B<none>, the resulting image will not be bootable unless something else takes care of creating F</sbin/init>.
Automatic customizations that are specific to a particular init system will be skipped when a different init system is selected.
+When using the B<finit> init system consider passing B<--include=finit-plugins> to B<mmdebstrap>.
=item B<-k> F<sshkey>, B<--sshkey>=F<sshkey>
@@ -69,7 +70,7 @@ The following tasks may be skipped.
Skips adding a the customize-autologin.sh to B<mmdebstrap> that configures
automatic root login on a serial console and also parses the C<TERM> kernel
cmdline and passes it as C<TERM> to B<agetty>.
-This is specific to using B<runit>, B<systemd> or B<sysv> as init system.
+This is specific to using B<finit>, B<runit>, B<systemd> or B<sysv> as init system.
=item B<ext4>
@@ -80,7 +81,7 @@ Such a tar archive is not suitable for being booted by B<debvm-run>.
=item B<ifupdown>
skips installing B<ifupdown> configuration to automatically configure wired interfaces.
-This is specific to using B<runit> or B<sysv> as init system.
+This is specific to using B<finit>, B<runit> or B<sysv> as init system.
=item B<initsystem>
@@ -209,10 +210,10 @@ opt_hostname() {
}
opt_initsystem() {
case "$1" in
- busybox|none|runit|systemd|sysv)
+ busybox|finit|none|runit|systemd|sysv)
;;
*)
- die "value for --initsystem must be one of systemd, busybox, none, runit or sysv"
+ die "value for --initsystem must be one of systemd, busybox, finit, none, runit or sysv"
;;
esac
INITSYSTEM=$1
@@ -319,6 +320,9 @@ case "$INITSYSTEM" in
"$@"
SKIP="${SKIP}autologin,"
;;
+ finit)
+ set -- --include=finit-sysv,mount "$@"
+ ;;
none)
SKIP="${SKIP}autologin,"
;;
@@ -352,7 +356,7 @@ if test "$INITSYSTEM" = systemd && ! check_skip systemdnetwork; then
'--include=?not(?virtual)?exact-name(libnss-resolve)' \
"--customize-hook=$SHARE_DIR/customize-resolved.sh" \
"$@"
-elif test "$INITSYSTEM" = sysv -o "$INITSYSTEM" = runit && ! check_skip ifupdown; then
+elif test "$INITSYSTEM" = sysv -o "$INITSYSTEM" = runit -o "$INITSYSTEM" = finit && ! check_skip ifupdown; then
set -- \
'--include=ifupdown,isc-dhcp-client' \
"--customize-hook=$SHARE_DIR/customize-ifupdown.sh" \
diff --git a/share/customize-autologin.sh b/share/customize-autologin.sh
index da40342..7b7a130 100755
--- a/share/customize-autologin.sh
+++ b/share/customize-autologin.sh
@@ -64,5 +64,13 @@ if test "$(dpkg-query --root "$TARGET" -f '${db:Status-Status}' -W runit-init 2>
exit 0
fi
+if test "$(dpkg-query --root "$TARGET" -f '${db:Status-Status}' -W finit-sysv 2>/dev/null)" = installed; then
+ echo "tty [12345] @console noclear nowait nologin" >> "$TARGET/etc/finit.d/getty.conf"
+ # delete tty1, which could be /dev/console
+ sed -i -e '/\/dev\/tty1 /d' "$TARGET/etc/finit.d/getty.conf"
+
+ exit 0
+fi
+
echo "failed: init system not recognized by autologin customization" 1>&2
exit 1