summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorHelmut Grohne <helmut@subdivi.de>2023-01-17 07:35:14 +0100
committerHelmut Grohne <helmut@subdivi.de>2023-01-17 07:35:14 +0100
commit770141416d6750a484ea547eb9e102911c1a7610 (patch)
treeb12c2335a11562b08afab3063a520f5eb1eee9cd /bin
parent3e40dfbf11cf0970872ce5d0e49d38a515125e5c (diff)
downloaddebvm-770141416d6750a484ea547eb9e102911c1a7610.tar.gz
debvm-create: avoid splitting features to multiple code locations
Diffstat (limited to 'bin')
-rwxr-xr-xbin/debvm-create21
1 files changed, 7 insertions, 14 deletions
diff --git a/bin/debvm-create b/bin/debvm-create
index cf92b7c..dc6a463 100755
--- a/bin/debvm-create
+++ b/bin/debvm-create
@@ -234,18 +234,6 @@ if ! check_skip kernel; then
set -- "--include=?or(?exact-name(linux-image-cloud-$KERNEL_ARCH),?exact-name(linux-image-$KERNEL_ARCH),?exact-name(linux-image-generic))" "$@"
fi
-if test -n "$SSHKEY"; then
- set -- --include=openssh-server "$@"
-fi
-
-if ! check_skip systemdnetwork; then
- # add a DNS resolver
- set -- \
- '--include=?exact-name(libnss-resolve)' \
- "--customize-hook=$SHARE_DIR/customize-resolved.sh" \
- "$@"
-fi
-
# construct mmdebstrap options as $@:
set -- \
--verbose \
@@ -266,13 +254,18 @@ set -- \
set -- '--customize-hook=chroot "$1" passwd --delete root' "$@"
if ! check_skip systemdnetwork; then
- # dhcp on all network interfaces
- set -- "--customize-hook=$SHARE_DIR/customize-networkd.sh" "$@"
+ # dhcp on all network interfaces, and add a dns resolver
+ set --
+ "--customize-hook=$SHARE_DIR/customize-networkd.sh" \
+ '--include=?exact-name(libnss-resolve)' \
+ "--customize-hook=$SHARE_DIR/customize-resolved.sh" \
+ "$@"
fi
# add ssh key for root
if test -n "$SSHKEY"; then
set -- \
+ --include=openssh-server \
'--customize-hook=mkdir -m700 -p "$1/root/.ssh"' \
"--customize-hook=upload $SSHKEY /root/.ssh/authorized_keys" \
"$@"