From fa1774a4e69b0237212d9d6f10df236d73842249 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Tue, 1 Oct 2013 20:16:24 +0200 Subject: [PATCH] Remove batman-adv specific parts of gluon-core --- .../files/lib/gluon/core/sysconfig/.keep | 0 .../files/lib/gluon/functions/sysconfig.sh | 10 +++++ .../gluon/upgrade/core/initial/001-sysconfig | 20 ++++++++++ .../upgrade/core/initial/011-gluon-network | 38 +------------------ .../gluon-core/files/lib/upgrade/keep.d/gluon | 2 + 5 files changed, 34 insertions(+), 36 deletions(-) create mode 100644 package/gluon-core/files/lib/gluon/core/sysconfig/.keep create mode 100644 package/gluon-core/files/lib/gluon/functions/sysconfig.sh create mode 100644 package/gluon-core/files/lib/gluon/upgrade/core/initial/001-sysconfig diff --git a/package/gluon-core/files/lib/gluon/core/sysconfig/.keep b/package/gluon-core/files/lib/gluon/core/sysconfig/.keep new file mode 100644 index 00000000..e69de29b diff --git a/package/gluon-core/files/lib/gluon/functions/sysconfig.sh b/package/gluon-core/files/lib/gluon/functions/sysconfig.sh new file mode 100644 index 00000000..40acf689 --- /dev/null +++ b/package/gluon-core/files/lib/gluon/functions/sysconfig.sh @@ -0,0 +1,10 @@ +SYSCONFIGDIR=/lib/gluon/core/sysconfig + + +sysconfig() { + cat "$SYSCONFIGDIR/$1" +} + +sysconfig_set() { + echo -n "$2" > "$SYSCONFIGDIR/$1" +} diff --git a/package/gluon-core/files/lib/gluon/upgrade/core/initial/001-sysconfig b/package/gluon-core/files/lib/gluon/upgrade/core/initial/001-sysconfig new file mode 100644 index 00000000..1affcb46 --- /dev/null +++ b/package/gluon-core/files/lib/gluon/upgrade/core/initial/001-sysconfig @@ -0,0 +1,20 @@ +#!/bin/sh + +. /lib/gluon/functions/sysconfig.sh +. /lib/ar71xx.sh + + +get_primary_mac() { + case "$(ar71xx_board_name)" in + tl-wdr3600|tl-wdr4300) + cat /sys/class/ieee80211/phy1/macaddress + ;; + *) + cat /sys/class/ieee80211/phy0/macaddress + ;; + esac +} + + +sysconfig_set lan_ifname "$(uci get network.lan.ifname)" +sysconfig_set primary_mac "$(get_primary_mac)" diff --git a/package/gluon-core/files/lib/gluon/upgrade/core/initial/011-gluon-network b/package/gluon-core/files/lib/gluon/upgrade/core/initial/011-gluon-network index c2086228..28211d71 100755 --- a/package/gluon-core/files/lib/gluon/upgrade/core/initial/011-gluon-network +++ b/package/gluon-core/files/lib/gluon/upgrade/core/initial/011-gluon-network @@ -1,9 +1,7 @@ #!/bin/sh -. /lib/ar71xx.sh -local lan_ifname="$(uci get network.lan.ifname)" -local board="$(ar71xx_board_name)" +. /lib/gluon/functions/sysconfig.sh uci -q batch <