[RFC PATCH v4 10/10] Removed unnecessary community files
Jan Kraus
mayosemmel at googlemail.com
Fr Aug 19 20:45:22 CEST 2016
Signed-off-by: Jan Kraus <mayosemmel at gmail.com>
---
buildscript | 46 ++--------------------
community/franken.cfg | 2 -
.../fff/fff-hoods/files/usr/sbin/configurehood | 7 ++++
.../fff/fff-sysupgrade/files/etc/sysupgrade.sh | 2 +-
.../files/etc/uci-defaults/51-fff-timeserver | 6 ---
5 files changed, 12 insertions(+), 51 deletions(-)
delete mode 100644 community/franken.cfg
delete mode 100755 src/packages/fff/fff-timeserver/files/etc/uci-defaults/51-fff-timeserver
diff --git a/buildscript b/buildscript
index fcd5998..79afece 100755
--- a/buildscript
+++ b/buildscript
@@ -184,13 +184,12 @@ prebuild() {
while IFS= read -r -d '' template
do
echo "Translating $template .."
- $tpl_translate "$template" > "$(dirname "$template")"/"$(basename "$template" .tpl)"
- /bin/rm "$template"
+ mv "$template" "$(dirname "$template")"/"$(basename "$template" .tpl)"
done < <(find "${target}/files" -name '*.tpl' -print0)
#insert actual firware version informations into release file
version=$(git describe --tags --dirty)
- community=$(basename "$(realpath selected_community)" .cfg)
+ community="FFF"
{
echo "FIRMWARE_VERSION=\"$version\""
@@ -200,8 +199,6 @@ prebuild() {
echo "OPENWRT_FEEDS_PACKAGES_REVISION=\"${PACKAGEREV}\""
} > "$target"/files/etc/firmware_release
- cp selected_community "$target"/files/etc/community.cfg
-
opath=$(pwd)
cd "$target"
make defconfig
@@ -333,18 +330,6 @@ loadBSP()
. selected_bsp
}
-loadCommunity()
-{
- echo "Working with $(/bin/ls -l selected_community | awk '{ print $11 }')"
- tpl_translate=$(awk -F= 'BEGIN{printf("sed")} /^.+$/{gsub("/", "\\/", $0); printf(" -es/\\${%s}/%s/g",$1,$2)}' selected_community)
-}
-
-setCommunity() {
- /bin/rm -rf selected_community
- /bin/ln -s "$1" selected_community
- loadCommunity
-}
-
setBSP()
{
/bin/rm -rf selected_bsp
@@ -360,19 +345,13 @@ buildall() {
done
}
-if [ "$1" != "selectbsp" -a "$1" != "selectcommunity" ]; then
+if [ "$1" != "selectbsp" ]; then
if [ ! -h selected_bsp ]; then
echo "Please select a Board-Support-Package using:"
echo "$0 selectbsp"
exit
fi
- if [ ! -h selected_community ]; then
- echo "Please select a community file using:"
- echo "$0 selectcommunity"
- exit
- fi
loadBSP
- loadCommunity
echo
fi
@@ -393,22 +372,6 @@ case "$1" in
fi
fi
;;
- "selectcommunity")
- if [ "$2" = "help" ] || [ "$2" = "" ]; then
- echo "Select a Community-File:"
- echo
- echo "Usage: $0 $1 <community-file>"
- echo "available community-files: "
- /bin/ls community/*.cfg
- echo
- else
- if [ ! -f "$2" ]; then
- echo "Could not find $2"
- else
- setCommunity "$2"
- fi
- fi
- ;;
"prepare")
if [ "$2" = "help" ] || [ "$2" = "x" ]; then
echo "This option fetches the sources for the images and configurates the build so that it can be compiled"
@@ -456,7 +419,7 @@ case "$1" in
;;
"buildall")
if [ "$2" = "help" ]; then
- echo "This option builds the firmware for all routers of a given community."
+ echo "This option builds the firmware for all routers."
echo
echo "Usage: $0 $1 [fast]"
echo
@@ -479,7 +442,6 @@ case "$1" in
echo
echo "Usage: $0 command"
echo "command:"
- echo " selectcommunity <community-file>"
echo " selectbsp <bsp-file>"
echo " prepare"
echo " config openwrt"
diff --git a/community/franken.cfg b/community/franken.cfg
deleted file mode 100644
index b5ad7e1..0000000
--- a/community/franken.cfg
+++ /dev/null
@@ -1,2 +0,0 @@
-NTPD_IP=fe80::ff:feee:1%br-mesh
-UPGRADE_PATH=http://[fe80::ff:feee:1%br-mesh]/dev/firmware/current
\ No newline at end of file
diff --git a/src/packages/fff/fff-hoods/files/usr/sbin/configurehood b/src/packages/fff/fff-hoods/files/usr/sbin/configurehood
index ea3f4fe..892ea11 100755
--- a/src/packages/fff/fff-hoods/files/usr/sbin/configurehood
+++ b/src/packages/fff/fff-hoods/files/usr/sbin/configurehood
@@ -4,6 +4,7 @@ HOODDIR=/etc/hoods
. /usr/share/libubox/jshn.sh
. /lib/functions/fff/wireless
+. /lib/functions/fff/timeserver
myLat=$(uci get 'system. at system[0].latitude')
myLon=$(uci get 'system. at system[0].longitude')
@@ -84,9 +85,15 @@ json_get_var channel5 channel5
json_get_var mode5 mode5
json_get_var type5 type5
json_get_var protocol protocol
+json_get_var upgrade_path upgrade_path
+json_get_var ntp_ip ntp_ip
echo "Setting hood name: $hood"
uci set system. at system[0].hood=$hood
+echo "Setting upgrade path $upgrade_path"
+uci set system. at system[0].upgrade_path="$upgrade_path"
+
+setTimeserver "$ntp_ip"
if ! wifiDelAll; then
echo "Can't delete current wifi setup"
diff --git a/src/packages/fff/fff-sysupgrade/files/etc/sysupgrade.sh b/src/packages/fff/fff-sysupgrade/files/etc/sysupgrade.sh
index e6bc7d9..8258982 100755
--- a/src/packages/fff/fff-sysupgrade/files/etc/sysupgrade.sh
+++ b/src/packages/fff/fff-sysupgrade/files/etc/sysupgrade.sh
@@ -3,7 +3,7 @@ cd /tmp/
. /etc/firmware_release
-. /etc/community.cfg
+UPGRADE_PATH="$(uci get system. at system[0].upgrade_path)"
BOARD=$(uci get board.model.name)
diff --git a/src/packages/fff/fff-timeserver/files/etc/uci-defaults/51-fff-timeserver b/src/packages/fff/fff-timeserver/files/etc/uci-defaults/51-fff-timeserver
deleted file mode 100755
index d2893cb..0000000
--- a/src/packages/fff/fff-timeserver/files/etc/uci-defaults/51-fff-timeserver
+++ /dev/null
@@ -1,6 +0,0 @@
-#!/bin/sh
-
-. /lib/functions/fff/timeserver
-. /etc/community.cfg
-
-setTimeserver "${NTPD_IP}"
--
2.1.4
Mehr Informationen über die Mailingliste franken-dev