try odhcpd

This commit is contained in:
iceBear67
2026-06-22 13:08:49 +08:00
parent 72d0425550
commit 246f127773
2 changed files with 4 additions and 8 deletions

View File

@@ -1,6 +1,6 @@
#!/bin/sh
IMAGE_NAME="${IMAGE_NAME:=alpine-vm}"
IMAGE_SIZE="${IMAGE_SIZE:-1G}"
IMAGE_SIZE="${IMAGE_SIZE:-512M}"
IMAGE_FORMAT="${IMAGE_FORMAT:=raw}"
ALPINE_BRANCH="${ALPINE_BRANCH:=latest-stable}"
KERNEL_FLAVOR="${KERNEL_FLAVOR:=virt}"
@@ -31,7 +31,7 @@ alpine-make-vm-image \
--fs-skel-dir "$OVERLAY_DIR" \
--fs-skel-chown root:root \
--script-chroot \
--packages "git curl docker cronie dhcpcd" \
--packages "git curl docker cronie" \
"$IMAGE_FILE" \
"$CONFIGURE_SH" | tee $TMP

View File

@@ -2,9 +2,5 @@ auto lo
iface lo inet loopback
auto eth0
iface eth0 inet manual
pre-up ip link set dev eth0 up
up dhcpcd --nobackground --ipv4only --waitip=4 eth0
down dhcpcd --release eth0
post-down ip link set dev eth0 down
iface eth0 inet dhcp
post-up ip route del default || true; ip route add default via GATEWAY_ADDRESS