adds a 'support' package for scripts not neccessary

Submitted by Tobias Klaus on April 29, 2016, 11:34 a.m.

Details

Message ID 1461929676-9539-2-git-send-email-tk+ff@meskal.net
State Superseded, archived
Headers show

Commit Message

Tobias Klaus April 29, 2016, 11:34 a.m.
First functionality is the possibility to have a file
/etc/init.d/fff-userconfig on the nodes that is execeuted
on each reboot and survives sysupgrades
---
 src/packages/fff/fff-support/Makefile              | 41 ++++++++++++++++++++++
 .../fff-support/files/etc/init.d/fff-userconfig    | 14 ++++++++
 src/packages/fff/fff/Makefile                      |  3 +-
 3 files changed, 57 insertions(+), 1 deletion(-)
 create mode 100644 src/packages/fff/fff-support/Makefile
 create mode 100755 src/packages/fff/fff-support/files/etc/init.d/fff-userconfig

Patch hide | download patch | download mbox

diff --git a/src/packages/fff/fff-support/Makefile b/src/packages/fff/fff-support/Makefile
new file mode 100644
index 0000000..7bc4581
--- /dev/null
+++ b/src/packages/fff/fff-support/Makefile
@@ -0,0 +1,41 @@ 
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=fff-support
+PKG_VERSION:=0.0.1
+PKG_RELEASE:=1
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/fff-support
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/fff-support
+    SECTION:=base
+    CATEGORY:=Freifunk
+    TITLE:=Freifunk-Franken Random
+    URL:=http://www.freifunk-franken.de
+    DEPENDS:=+@BUSYBOX_CONFIG_ASH
+endef
+
+define Package/fff-support/description
+    This is the Freifunk Franken Firmware support package
+    This packages provides smaller convenience scripts,
+		not essential to the operation of the Firmware
+endef
+
+define Build/Prepare
+    echo "all: " > $(PKG_BUILD_DIR)/Makefile
+endef
+
+define Build/Configure
+    # nothing
+endef
+
+define Build/Compile
+    # nothing
+endef
+
+define Package/fff-support/install
+    $(CP) ./files/* $(1)/
+endef
+
+$(eval $(call BuildPackage,fff-support))
diff --git a/src/packages/fff/fff-support/files/etc/init.d/fff-userconfig b/src/packages/fff/fff-support/files/etc/init.d/fff-userconfig
new file mode 100755
index 0000000..68f3fb2
--- /dev/null
+++ b/src/packages/fff/fff-support/files/etc/init.d/fff-userconfig
@@ -0,0 +1,14 @@ 
+#!/bin/sh /etc/rc.common
+# Copyright (C) 2006 OpenWrt.org
+
+START=96
+boot() {
+  LOCALCONFIGSCRIPT="/etc/rc.local.fff_userconfig"
+  #add LOCALCONFIGSCRIPT to sysupgrade regardless if it already exists or not to prevent data loss
+  grep -q ^"${LOCALCONFIGSCRIPT}"$ /etc/sysupgrade.conf || echo "$LOCALCONFIGSCRIPT" >> /etc/sysupgrade.conf
+
+  # process user commands
+	[ -f "${LOCALCONFIGSCRIPT}" ] && {
+		sh /etc/rc.local.fff_userconfig
+	}
+}
diff --git a/src/packages/fff/fff/Makefile b/src/packages/fff/fff/Makefile
index e709987..80ae83b 100644
--- a/src/packages/fff/fff/Makefile
+++ b/src/packages/fff/fff/Makefile
@@ -20,7 +20,8 @@  define Package/fff-base
              +fff-uradvd \
              +fff-batman-adv-legacy \
              +fff-fastd \
-             +fff-firewall
+             +fff-firewall \
+             +fff-support
 endef
 
 define Package/fff-base/description

Comments

Jan Kraus April 30, 2016, 9:40 a.m.
Hi,

Anmerkungen Inline...

Am Freitag, den 29.04.2016, 13:34 +0200 schrieb Tobias Klaus:
> First functionality is the possibility to have a file
> /etc/init.d/fff-userconfig on the nodes that is execeuted
> on each reboot and survives sysupgrades
> ---
>  src/packages/fff/fff-support/Makefile              | 41 ++++++++++++++++++++++
>  .../fff-support/files/etc/init.d/fff-userconfig    | 14 ++++++++
>  src/packages/fff/fff/Makefile                      |  3 +-
>  3 files changed, 57 insertions(+), 1 deletion(-)
>  create mode 100644 src/packages/fff/fff-support/Makefile
>  create mode 100755 src/packages/fff/fff-support/files/etc/init.d/fff-userconfig
> 
> diff --git a/src/packages/fff/fff-support/Makefile b/src/packages/fff/fff-support/Makefile
> new file mode 100644
> index 0000000..7bc4581
> --- /dev/null
> +++ b/src/packages/fff/fff-support/Makefile
> @@ -0,0 +1,41 @@
> +include $(TOPDIR)/rules.mk
> +
> +PKG_NAME:=fff-support
> +PKG_VERSION:=0.0.1
> +PKG_RELEASE:=1
> +
> +PKG_BUILD_DIR:=$(BUILD_DIR)/fff-support
> +
> +include $(INCLUDE_DIR)/package.mk
> +
> +define Package/fff-support
> +    SECTION:=base
> +    CATEGORY:=Freifunk
> +    TITLE:=Freifunk-Franken Random
Hier sollte vermutlich anderer Titel stehen...
> +    URL:=http://www.freifunk-franken.de
> +    DEPENDS:=+@BUSYBOX_CONFIG_ASH
> +endef
> +
> +define Package/fff-support/description
> +    This is the Freifunk Franken Firmware support package
> +    This packages provides smaller convenience scripts,
> +		not essential to the operation of the Firmware
> +endef
> +
> +define Build/Prepare
> +    echo "all: " > $(PKG_BUILD_DIR)/Makefile
> +endef
> +
> +define Build/Configure
> +    # nothing
> +endef
> +
> +define Build/Compile
> +    # nothing
> +endef
> +
> +define Package/fff-support/install
> +    $(CP) ./files/* $(1)/
> +endef
> +
> +$(eval $(call BuildPackage,fff-support))
> diff --git a/src/packages/fff/fff-support/files/etc/init.d/fff-userconfig b/src/packages/fff/fff-support/files/etc/init.d/fff-userconfig
> new file mode 100755
> index 0000000..68f3fb2
> --- /dev/null
> +++ b/src/packages/fff/fff-support/files/etc/init.d/fff-userconfig
> @@ -0,0 +1,14 @@
> +#!/bin/sh /etc/rc.common
> +# Copyright (C) 2006 OpenWrt.org
> +
> +START=96
> +boot() {
> +  LOCALCONFIGSCRIPT="/etc/rc.local.fff_userconfig"
> +  #add LOCALCONFIGSCRIPT to sysupgrade regardless if it already exists or not to prevent data loss
> +  grep -q ^"${LOCALCONFIGSCRIPT}"$ /etc/sysupgrade.conf || echo "$LOCALCONFIGSCRIPT" >> /etc/sysupgrade.conf
> +
> +  # process user commands
> +	[ -f "${LOCALCONFIGSCRIPT}" ] && {
> +		sh /etc/rc.local.fff_userconfig
> +	}
> +}
> diff --git a/src/packages/fff/fff/Makefile b/src/packages/fff/fff/Makefile
> index e709987..80ae83b 100644
> --- a/src/packages/fff/fff/Makefile
> +++ b/src/packages/fff/fff/Makefile
> @@ -20,7 +20,8 @@ define Package/fff-base
>               +fff-uradvd \
>               +fff-batman-adv-legacy \
>               +fff-fastd \
> -             +fff-firewall
> +             +fff-firewall \
> +             +fff-support
Wie schon im anderen Patch geschrieben, hätte ich das hier ungern drin.
Die "Poweruser", die das nutzen würden, bauen sich sowieso ihre eigene
Firmware und wir müssen die standard-Version ja nicht unnötig aufblasen.

Grüße Jan
>  endef
>  
>  define Package/fff-base/description
> -- 
> 2.8.1
>