summaryrefslogtreecommitdiff
path: root/share
diff options
context:
space:
mode:
authorHelmut Grohne <helmut@subdivi.de>2023-02-20 14:28:45 +0100
committerHelmut Grohne <helmut@subdivi.de>2023-02-20 14:28:45 +0100
commitdeb6f69095495efc775569c0c8f0846af3512508 (patch)
tree7a5808cdedc30c2f7731f90a0549e5479b67489f /share
parentb4d773ef93ec3474048f73b880abf4a58be31a98 (diff)
downloaddebvm-deb6f69095495efc775569c0c8f0846af3512508.tar.gz
debvm-create: add --initsystem option
This option allows changing the init system. The notable addition is sysv.
Diffstat (limited to 'share')
-rwxr-xr-xshare/customize-ifupdown.sh18
1 files changed, 18 insertions, 0 deletions
diff --git a/share/customize-ifupdown.sh b/share/customize-ifupdown.sh
new file mode 100755
index 0000000..c556d43
--- /dev/null
+++ b/share/customize-ifupdown.sh
@@ -0,0 +1,18 @@
+#!/bin/sh
+# Copyright 2023 Helmut Grohne <helmut@subdivi.de>
+# SPDX-License-Identifier: MIT
+#
+# This is a mmdebstrap customize hook that configures ifupdown for dhcp.
+# It expects ifupdown and isc-dhcp-client to be installed.
+
+set -eu
+
+TARGET=$1
+
+IFFILE=interfaces
+test -d "$TARGET/etc/network/interfaces.d" && IFFILE="interfaces.d/eth"
+
+cat >"$TARGET/etc/network/$IFFILE" <<EOF
+auto /enp*=eth
+iface eth inet dhcp
+EOF