From 360a9538c561d4c29182a2124ae0f3b05ed46fb6 Mon Sep 17 00:00:00 2001 From: David Oberhollenzer Date: Fri, 20 Jul 2018 17:43:39 +0200 Subject: [PATCH] Bump init version Signed-off-by: David Oberhollenzer --- board/alix/INIT | 3 ++- board/rpi3/INIT | 3 ++- pkg/init/build | 42 +++++++++++++++++++++++++++------------ pkg/init/rootfs_files.txt | 14 +++++++++++++ 4 files changed, 47 insertions(+), 15 deletions(-) diff --git a/board/alix/INIT b/board/alix/INIT index fff73b2..7816491 100644 --- a/board/alix/INIT +++ b/board/alix/INIT @@ -1,4 +1,5 @@ GETTY_TTY="ttyS0" HWCLOCK="yes" DHCP_PORTS="" -SERVICES="" \ No newline at end of file +SERVICES="" +MODULES="" \ No newline at end of file diff --git a/board/rpi3/INIT b/board/rpi3/INIT index 7b4b14c..037e017 100644 --- a/board/rpi3/INIT +++ b/board/rpi3/INIT @@ -1,4 +1,5 @@ GETTY_TTY="tty1 tty2 tty3 tty4 tty5 tty6 tty7" DHCP_PORTS="" HWCLOCK="no" -SERVICES="" \ No newline at end of file +SERVICES="" +MODULES="" \ No newline at end of file diff --git a/pkg/init/build b/pkg/init/build index ecdfb13..d64cf77 100755 --- a/pkg/init/build +++ b/pkg/init/build @@ -1,8 +1,8 @@ -VERSION="0.4" +VERSION="0.5" SRCDIR="init-${VERSION}" TARBALL="${SRCDIR}.tar.xz" URL="http://infraroot.at/pygos" -SHA256SUM="a128be18bbabca600e0553ec539e953eda0a467a337826d520c5fe3ef893ab03" +SHA256SUM="ea964c7ef150c14987bce0eff10b80a5e071b0ac451fe2e3d9e12915d5a2f987" DEPENDS="toolchain" prepare() { @@ -32,17 +32,32 @@ deploy() { include_merge "INIT" if [ "x$HWCLOCK" == "xyes" ]; then - ln -s "/share/init/hwclock" "$DEPLOY/etc/init.d/hwclock" - echo "etc/init.d/hwclock m 777 0 0" >> "$DEPLOY/rootfs_files.txt" + 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" + 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" + + mkdir -p "$DEPLOY/var/lib" + date --utc +%m%d%H%M%Y.%S > "$DEPLOY/var/lib/swclock" + echo "var/lib/swclock m 644 0 0" >> "$DEPLOY/rootfs_files.txt" fi svc=$(file_path_override "ifrename") if [ ! -z "$svc" ]; then cp "$svc" "$DEPLOY/etc/netcfg/ifrename" - ln -s "/share/init/ifrename" "$DEPLOY/etc/init.d/ifrename" - echo "etc/netcfg/ifrename m 644 0 0" >> "$DEPLOY/rootfs_files.txt" - echo "etc/init.d/ifrename m 777 0 0" >> "$DEPLOY/rootfs_files.txt" + SERVICES="$SERVICES ifrename" + fi + + svc=$(file_path_override "nftables.rules") + if [ ! -z "$svc" ]; then + cp "$svc" "$DEPLOY/etc/nftables.rules" + echo "etc/nftables.rules m 644 0 0" >> "$DEPLOY/rootfs_files.txt" + SERVICES="$SERVICES nft" fi svc=$(file_path_override "interfaces") @@ -65,11 +80,7 @@ deploy() { done if [ ! -z "$DHCP_PORTS" ]; then - ln -s "/share/init/dhcpcdmaster" \ - "$DEPLOY/etc/init.d/dhcpcdmaster" - - echo "etc/init.d/dhcpcdmaster m 777 0 0" >> \ - "$DEPLOY/rootfs_files.txt" + SERVICES="$SERVICES dhcpcdmaster" fi for svc in $DHCP_PORTS; do @@ -84,7 +95,12 @@ deploy() { echo "etc/init.d/$svc m 777 0 0" >> "$DEPLOY/rootfs_files.txt" done - unset -v i GETTY_TTY HWCLOCK DHCP_PORTS SERVICES + touch "$DEPLOY/etc/modules" + for svc in $MODULES; do + echo "$svc" >> "$DEPLOY/etc/modules" + done + + unset -v i GETTY_TTY HWCLOCK DHCP_PORTS SERVICES MODULES } check_update() { diff --git a/pkg/init/rootfs_files.txt b/pkg/init/rootfs_files.txt index 7e4515d..85e341d 100644 --- a/pkg/init/rootfs_files.txt +++ b/pkg/init/rootfs_files.txt @@ -11,6 +11,8 @@ lib/libexec/init/devfs.sh m 555 0 0 lib/libexec/init/trymount.sh m 555 0 0 lib/libexec/init/ifrename.sh m 555 0 0 lib/libexec/init/ifcfg.sh m 555 0 0 +lib/libexec/init/ifdown.sh m 555 0 0 +lib/libexec/init/modules_load.sh m 555 0 0 lib/libexec/init/overlay.sh m 555 0 0 share/init m 555 0 0 share/init/agetty m 444 0 0 @@ -39,7 +41,15 @@ share/init/usyslogd m 444 0 0 share/init/mountusr m 444 0 0 share/init/tmpfsrun m 444 0 0 share/init/tmpfsvar m 444 0 0 +share/init/network m 444 0 0 +share/init/ifdown m 444 0 0 +share/init/modules m 444 0 0 +share/init/hostapd m 444 0 0 +share/init/swclock m 444 0 0 +share/init/swclocksave m 444 0 0 +share/init/nft m 444 0 0 etc/netcfg m 755 0 0 +etc/modules m 644 0 0 etc/initd.env m 644 0 0 etc/init.d m 755 0 0 etc/init.d/loopback m 777 0 0 @@ -63,3 +73,7 @@ etc/init.d/mountusr m 777 0 0 etc/init.d/tmpfsrun m 777 0 0 etc/init.d/tmpfsvar m 777 0 0 etc/init.d/usyslogd m 777 0 0 +etc/init.d/modules m 777 0 0 +etc/init.d/network m 777 0 0 +etc/init.d/ifdown@shutdown m 777 0 0 +etc/init.d/ifdown@reboot m 777 0 0