diff --git a/pkg/init-scripts/40-ntpsetdate b/pkg/init-scripts/40-ntpsetdate deleted file mode 100644 index be088c5..0000000 --- a/pkg/init-scripts/40-ntpsetdate +++ /dev/null @@ -1,7 +0,0 @@ -case "$reason" in -BOUND*) - /lib/libexec/init/setntpdate.sh - ;; -*) - ;; -esac diff --git a/pkg/init-scripts/build b/pkg/init-scripts/build index 29e300d..ba69449 100755 --- a/pkg/init-scripts/build +++ b/pkg/init-scripts/build @@ -1,8 +1,8 @@ -VERSION="1" +VERSION="2" SRCDIR="init-scripts-${VERSION}" TARBALL="${SRCDIR}.tar.xz" URL="http://infraroot.at/pygos" -SHA256SUM="2536e6520fb33058750cb741709177b166eac3025a63592cf59ea097bd42c4f7" +SHA256SUM="7522e65dcd8dfc6bdb1dc4268e0198926580e422a254deb9cabd06b18a6c1b9e" DEPENDS="toolchain" prepare() { @@ -10,7 +10,44 @@ prepare() { } build() { - run_configure "$1" + local extra_flags="" + + cp "$SCRIPTDIR/pkg/$PKGNAME/rootfs_files.txt" "./rootfs_files.txt" + include_merge "INIT" + + if [ "x$HWCLOCK" != "xyes" ]; then + extra_flags="$extra_flags --enable-swclock" + + cat <<_EOF >> "rootfs_files.txt" +etc/crontab.d/swclock m 644 0 0 +etc/init.d/swclock m 777 0 0 +etc/init.d/swclocksave@reboot m 777 0 0 +etc/init.d/swclocksave@shutdown m 777 0 0 +share/init/swclock m 444 0 0 +share/init/swclocksave m 444 0 0 +var/lib/swclock m 644 0 0 +_EOF + fi + + if [ ! -z "$DHCP_PORTS" ]; then + extra_flags="$extra_flags --enable-dhcpclient" + cat <<_EOF >> "rootfs_files.txt" +etc/init.d/dhcpcdmaster m 777 0 0 +share/init/dhcpcd m 444 0 0 +share/init/dhcpcdmaster m 444 0 0 +_EOF + + if [ "x$HWCLOCK" != "xyes" ]; then + cat <<_EOF >> "rootfs_files.txt" +lib/libexec/dhcpcd-hooks m 555 0 0 +lib/libexec/dhcpcd-hooks/40-ntpsetdate m 444 0 0 +_EOF + fi + fi + + run_configure "$1" "$extra_flags" + + unset -v i GETTY_TTY HWCLOCK DHCP_PORTS SERVICES MODULES } deploy() { @@ -19,35 +56,15 @@ deploy() { local svc make DESTDIR="$DEPLOY" install - cp "$SCRIPTDIR/pkg/$PKGNAME/rootfs_files.txt" "$DEPLOY" - - mkdir -p "$DEPLOY/lib/libexec/dhcpcd-hooks" - cp "$SCRIPTDIR/pkg/$PKGNAME/40-ntpsetdate" "$DEPLOY/lib/libexec/dhcpcd-hooks" + cp "./rootfs_files.txt" "$DEPLOY" include_merge "INIT" if [ "x$HWCLOCK" == "xyes" ]; then SERVICES="$SERVICES hwclock" else - SERVICES="$SERVICES swclock" - ln -s "/share/init/swclocksave" "$DEPLOY/etc/init.d/swclocksave@shutdown" - ln -s "/share/init/swclocksave" "$DEPLOY/etc/init.d/swclocksave@reboot" - ln -s "/share/init/swclocksave.gcron" "$DEPLOY/etc/gcron.d/swclocksave" - mkdir -p "$DEPLOY/var/lib" date --utc +%m%d%H%M%Y.%S > "$DEPLOY/var/lib/swclock" - - echo "etc/init.d/swclocksave@shutdown m 777 0 0" >> "$DEPLOY/rootfs_files.txt" - echo "etc/init.d/swclocksave@reboot m 777 0 0" >> "$DEPLOY/rootfs_files.txt" - echo "etc/gcron.d/swclocksave m 777 0 0" >> "$DEPLOY/rootfs_files.txt" - echo "var/lib/swclock m 644 0 0" >> "$DEPLOY/rootfs_files.txt" - - if [ -z "$DHCP_PORTS" ]; then - ln -s "/share/init/ntpsetdate.gcron" "$DEPLOY/etc/gcron.d/ntpsetdate" - echo "etc/gcron.d/ntpsetdate m 755 0 0" >> "$DEPLOY/rootfs_files.txt" - else - echo "lib/libexec/dhcpcd-hooks/40-ntpsetdate m 555 0 0" >> "$DEPLOY/rootfs_files.txt" - fi fi svc=$(file_path_override "ifrename") @@ -85,8 +102,6 @@ deploy() { done if [ ! -z "$DHCP_PORTS" ]; then - SERVICES="$SERVICES dhcpcdmaster" - for svc in $DHCP_PORTS; do ln -s "/share/init/dhcpcd" "$DEPLOY/etc/init.d/dhcpcd@$svc" echo "etc/init.d/dhcpcd@$svc m 777 0 0" >> "$DEPLOY/rootfs_files.txt" diff --git a/pkg/init-scripts/rootfs_files.txt b/pkg/init-scripts/rootfs_files.txt index f465a13..81b5c28 100644 --- a/pkg/init-scripts/rootfs_files.txt +++ b/pkg/init-scripts/rootfs_files.txt @@ -1,4 +1,3 @@ -etc/gcron.d m 755 0 0 etc/init.d m 755 0 0 etc/init.d/devfs m 777 0 0 etc/init.d/gcrond m 777 0 0 @@ -43,8 +42,6 @@ share/init m 555 0 0 share/init/agetty m 444 0 0 share/init/consolefont m 444 0 0 share/init/devfs m 444 0 0 -share/init/dhcpcd m 444 0 0 -share/init/dhcpcdmaster m 444 0 0 share/init/dnsmasq m 444 0 0 share/init/gcrond m 444 0 0 share/init/hostapd m 444 0 0 @@ -60,15 +57,11 @@ share/init/mountusr m 444 0 0 share/init/network m 444 0 0 share/init/nft m 444 0 0 share/init/nginx m 444 0 0 -share/init/ntpsetdate.gcron m 444 0 0 share/init/procfs m 444 0 0 share/init/sigkill m 444 0 0 share/init/sigterm m 444 0 0 share/init/sshd m 444 0 0 share/init/sshd_keygen m 444 0 0 -share/init/swclock m 444 0 0 -share/init/swclocksave m 444 0 0 -share/init/swclocksave.gcron m 444 0 0 share/init/sync m 444 0 0 share/init/sysctl m 444 0 0 share/init/sysfs m 444 0 0