From cf0dc244633a7645e60df1d1783bb5d2372bdafc Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Tue, 30 Jun 2020 21:27:53 +0200 Subject: [PATCH] gluon-setup-mode: create symlinks in install script The package rebuild logic of OpenWrt only checks regular files. Avoid symlinks in the files directory to make rebuilds more robust. --- package/gluon-setup-mode/Makefile | 21 +++++++++++++++++++ .../files/lib/gluon/setup-mode/rc.d/K89log | 1 - .../lib/gluon/setup-mode/rc.d/K90network | 1 - .../files/lib/gluon/setup-mode/rc.d/K98boot | 1 - .../files/lib/gluon/setup-mode/rc.d/K99umount | 1 - .../lib/gluon/setup-mode/rc.d/S00sysfixtime | 1 - .../files/lib/gluon/setup-mode/rc.d/S10boot | 1 - .../files/lib/gluon/setup-mode/rc.d/S10system | 1 - .../files/lib/gluon/setup-mode/rc.d/S11sysctl | 1 - .../files/lib/gluon/setup-mode/rc.d/S12log | 1 - .../files/lib/gluon/setup-mode/rc.d/S95done | 1 - 11 files changed, 21 insertions(+), 10 deletions(-) delete mode 120000 package/gluon-setup-mode/files/lib/gluon/setup-mode/rc.d/K89log delete mode 120000 package/gluon-setup-mode/files/lib/gluon/setup-mode/rc.d/K90network delete mode 120000 package/gluon-setup-mode/files/lib/gluon/setup-mode/rc.d/K98boot delete mode 120000 package/gluon-setup-mode/files/lib/gluon/setup-mode/rc.d/K99umount delete mode 120000 package/gluon-setup-mode/files/lib/gluon/setup-mode/rc.d/S00sysfixtime delete mode 120000 package/gluon-setup-mode/files/lib/gluon/setup-mode/rc.d/S10boot delete mode 120000 package/gluon-setup-mode/files/lib/gluon/setup-mode/rc.d/S10system delete mode 120000 package/gluon-setup-mode/files/lib/gluon/setup-mode/rc.d/S11sysctl delete mode 120000 package/gluon-setup-mode/files/lib/gluon/setup-mode/rc.d/S12log delete mode 120000 package/gluon-setup-mode/files/lib/gluon/setup-mode/rc.d/S95done diff --git a/package/gluon-setup-mode/Makefile b/package/gluon-setup-mode/Makefile index ff1c730b..67747957 100644 --- a/package/gluon-setup-mode/Makefile +++ b/package/gluon-setup-mode/Makefile @@ -17,4 +17,25 @@ define Package/gluon-setup-mode/description Offline mode to perform basic setup in a secure manner. endef +init_links := \ + K89log \ + K98boot \ + K99umount \ + S00sysfixtime \ + S10boot \ + S10system \ + S11sysctl \ + S12log \ + S95done + +define Package/gluon-setup-mode/install + $(Gluon/Build/Install) + + $(LN) S20network $(1)/lib/gluon/setup-mode/rc.d/K90network + + for link in $(init_links); do \ + $(LN) "/etc/init.d/$$$${link:3}" "$(1)/lib/gluon/setup-mode/rc.d/$$$${link}"; \ + done +endef + $(eval $(call BuildPackageGluon,gluon-setup-mode)) diff --git a/package/gluon-setup-mode/files/lib/gluon/setup-mode/rc.d/K89log b/package/gluon-setup-mode/files/lib/gluon/setup-mode/rc.d/K89log deleted file mode 120000 index 1e0c5ac0..00000000 --- a/package/gluon-setup-mode/files/lib/gluon/setup-mode/rc.d/K89log +++ /dev/null @@ -1 +0,0 @@ -/etc/init.d/log \ No newline at end of file diff --git a/package/gluon-setup-mode/files/lib/gluon/setup-mode/rc.d/K90network b/package/gluon-setup-mode/files/lib/gluon/setup-mode/rc.d/K90network deleted file mode 120000 index 0a43e66b..00000000 --- a/package/gluon-setup-mode/files/lib/gluon/setup-mode/rc.d/K90network +++ /dev/null @@ -1 +0,0 @@ -S20network \ No newline at end of file diff --git a/package/gluon-setup-mode/files/lib/gluon/setup-mode/rc.d/K98boot b/package/gluon-setup-mode/files/lib/gluon/setup-mode/rc.d/K98boot deleted file mode 120000 index 64aea5e8..00000000 --- a/package/gluon-setup-mode/files/lib/gluon/setup-mode/rc.d/K98boot +++ /dev/null @@ -1 +0,0 @@ -/etc/init.d/boot \ No newline at end of file diff --git a/package/gluon-setup-mode/files/lib/gluon/setup-mode/rc.d/K99umount b/package/gluon-setup-mode/files/lib/gluon/setup-mode/rc.d/K99umount deleted file mode 120000 index b02f4892..00000000 --- a/package/gluon-setup-mode/files/lib/gluon/setup-mode/rc.d/K99umount +++ /dev/null @@ -1 +0,0 @@ -/etc/init.d/umount \ No newline at end of file diff --git a/package/gluon-setup-mode/files/lib/gluon/setup-mode/rc.d/S00sysfixtime b/package/gluon-setup-mode/files/lib/gluon/setup-mode/rc.d/S00sysfixtime deleted file mode 120000 index a4fb1d5b..00000000 --- a/package/gluon-setup-mode/files/lib/gluon/setup-mode/rc.d/S00sysfixtime +++ /dev/null @@ -1 +0,0 @@ -/etc/init.d/sysfixtime \ No newline at end of file diff --git a/package/gluon-setup-mode/files/lib/gluon/setup-mode/rc.d/S10boot b/package/gluon-setup-mode/files/lib/gluon/setup-mode/rc.d/S10boot deleted file mode 120000 index 64aea5e8..00000000 --- a/package/gluon-setup-mode/files/lib/gluon/setup-mode/rc.d/S10boot +++ /dev/null @@ -1 +0,0 @@ -/etc/init.d/boot \ No newline at end of file diff --git a/package/gluon-setup-mode/files/lib/gluon/setup-mode/rc.d/S10system b/package/gluon-setup-mode/files/lib/gluon/setup-mode/rc.d/S10system deleted file mode 120000 index 81e8836f..00000000 --- a/package/gluon-setup-mode/files/lib/gluon/setup-mode/rc.d/S10system +++ /dev/null @@ -1 +0,0 @@ -/etc/init.d/system \ No newline at end of file diff --git a/package/gluon-setup-mode/files/lib/gluon/setup-mode/rc.d/S11sysctl b/package/gluon-setup-mode/files/lib/gluon/setup-mode/rc.d/S11sysctl deleted file mode 120000 index b4ac535e..00000000 --- a/package/gluon-setup-mode/files/lib/gluon/setup-mode/rc.d/S11sysctl +++ /dev/null @@ -1 +0,0 @@ -/etc/init.d/sysctl \ No newline at end of file diff --git a/package/gluon-setup-mode/files/lib/gluon/setup-mode/rc.d/S12log b/package/gluon-setup-mode/files/lib/gluon/setup-mode/rc.d/S12log deleted file mode 120000 index 1e0c5ac0..00000000 --- a/package/gluon-setup-mode/files/lib/gluon/setup-mode/rc.d/S12log +++ /dev/null @@ -1 +0,0 @@ -/etc/init.d/log \ No newline at end of file diff --git a/package/gluon-setup-mode/files/lib/gluon/setup-mode/rc.d/S95done b/package/gluon-setup-mode/files/lib/gluon/setup-mode/rc.d/S95done deleted file mode 120000 index c9f30277..00000000 --- a/package/gluon-setup-mode/files/lib/gluon/setup-mode/rc.d/S95done +++ /dev/null @@ -1 +0,0 @@ -/etc/init.d/done \ No newline at end of file