diff --git a/config/packages.list b/config/packages.list index 5f2e547..db74e3d 100644 --- a/config/packages.list +++ b/config/packages.list @@ -21,6 +21,7 @@ util-linux # Essential networking (for Zero-OS connectivity) iproute2 ethtool +nftables # Filesystem support (minimal) btrfs-progs diff --git a/config/zinit/gettyconsole.yaml b/config/zinit/gettyconsole.yaml index 2b921bc..006ac89 100644 --- a/config/zinit/gettyconsole.yaml +++ b/config/zinit/gettyconsole.yaml @@ -1,2 +1,2 @@ -exec: /sbin/getty console -restart: always \ No newline at end of file +exec: /sbin/getty -L 115200 console vt100 +restart: always diff --git a/config/zinit/init/network.sh b/config/zinit/init/network.sh new file mode 100755 index 0000000..21dffba --- /dev/null +++ b/config/zinit/init/network.sh @@ -0,0 +1,7 @@ +#!/bin/sh +set -e +# Ensure dhcpcd user/group exist (some builds expect to drop privileges) +if ! getent group dhcpcd >/dev/null 2>&1; then addgroup -S dhcpcd 2>/dev/null || true; fi +if ! getent passwd dhcpcd >/dev/null 2>&1; then adduser -S -H -D -s /sbin/nologin -G dhcpcd dhcpcd 2>/dev/null || true; fi +# Exec dhcpcd (will run as root if it cannot drop to dhcpcd user) +exec dhcpcd "" diff --git a/config/zinit/init/ntpd.sh b/config/zinit/init/ntpd.sh index 52e4d30..8c03c0c 100755 --- a/config/zinit/init/ntpd.sh +++ b/config/zinit/init/ntpd.sh @@ -1,10 +1,24 @@ #!/bin/sh +set -e -ntp_flags=$(grep -o 'ntp=.*' /proc/cmdline | sed 's/^ntp=//') +# Ensure /etc/ntp.conf exists for tools/hooks expecting it +if [ -f /etc/ntpd.conf ] && [ ! -e /etc/ntp.conf ]; then + ln -sf /etc/ntpd.conf /etc/ntp.conf +fi +# dhcpcd hook may write into /var/lib/ntp +mkdir -p /var/lib/ntp + +# Extract ntp=... from kernel cmdline if present +ntp_flags="" params="" -if [ -n "$ntp_flags" ]; then - params=$(echo "-p $ntp_flags" | sed s/,/' -p '/g) +if [ -n "" ]; then + # Convert comma-separated list into multiple -p args + params="-p " +else + # Sensible defaults when no ntp= is provided + params="-p time.google.com -p time1.google.com -p time2.google.com -p time3.google.com" fi -exec ntpd -n $params \ No newline at end of file +# BusyBox ntpd uses -p servers on CLI; /etc/ntp.conf symlink above helps alternative daemons. +exec ntpd -n diff --git a/config/zinit/network.yaml b/config/zinit/network.yaml index f272134..b2d43eb 100644 --- a/config/zinit/network.yaml +++ b/config/zinit/network.yaml @@ -1,5 +1,5 @@ -exec: dhcpcd eth0 +exec: sh /etc/zinit/init/network.sh eth0 after: - depmod - udevd - - udev-trigger \ No newline at end of file + - udev-trigger diff --git a/config/zinit/ntp.yaml b/config/zinit/ntp.yaml index e7164e8..43f6699 100644 --- a/config/zinit/ntp.yaml +++ b/config/zinit/ntp.yaml @@ -1,3 +1,3 @@ exec: sh /etc/zinit/init/ntpd.sh after: - - network \ No newline at end of file + - network diff --git a/config/zinit/shm.yaml b/config/zinit/shm.yaml index 7919fea..5d14539 100644 --- a/config/zinit/shm.yaml +++ b/config/zinit/shm.yaml @@ -1,2 +1,5 @@ exec: /etc/zinit/init/shm.sh -oneshot: true \ No newline at end of file +oneshot: true +after: + - firmware + - modules \ No newline at end of file diff --git a/scripts/functionlist.md b/scripts/functionlist.md index ad5ad09..bafb772 100644 --- a/scripts/functionlist.md +++ b/scripts/functionlist.md @@ -107,4 +107,6 @@ File: [scripts/lib/testing.sh](scripts/lib/testing.sh) - [testing_cloud_hypervisor_basic()](scripts/lib/testing.sh:171) - [testing_cloud_hypervisor_serial()](scripts/lib/testing.sh:206) - [testing_analyze_boot_log()](scripts/lib/testing.sh:227) -- [testing_run_all()](scripts/lib/testing.sh:299) \ No newline at end of file +- [testing_run_all()](scripts/lib/testing.sh:299) + +