forked from freifunk-franken/firmware
Generalize handling of feeds and packages
* Simplifies adding new feeds and packages * Better separation of implementation and configuration * get rid of having to modifiy another file when adding feeds(build_patches/feed.conf)
This commit is contained in:
parent
a355145758
commit
46232cea1a
|
@ -1,6 +0,0 @@
|
||||||
src-link openwrt PATH/openwrt
|
|
||||||
src-link routing PATH/routing
|
|
||||||
src-link tunneldigger PATH/tunneldigger
|
|
||||||
src-link fastd PATH/fastd
|
|
||||||
src-link libremap PATH/libremap
|
|
||||||
src-link packagesol PATH/ffol
|
|
97
buildscript
97
buildscript
|
@ -7,6 +7,41 @@ OPENWRTURL=svn://svn.openwrt.org/openwrt/branches/barrier_breaker
|
||||||
PACKAGEREV=${OPENWRTREV}
|
PACKAGEREV=${OPENWRTREV}
|
||||||
PACKAGEURL=svn://svn.openwrt.org/openwrt/packages
|
PACKAGEURL=svn://svn.openwrt.org/openwrt/packages
|
||||||
|
|
||||||
|
## Feed definition [0]: name aka directory [1]: type git vs svn [2]: url [3]: revision evtl [4]: Patches
|
||||||
|
|
||||||
|
#official openwrt packages
|
||||||
|
OPENWRT=(openwrt
|
||||||
|
svn
|
||||||
|
svn://svn.openwrt.org/openwrt/packages
|
||||||
|
$OPENWRTREV)
|
||||||
|
OPENWRT_PKGS="bridge ethtool gpioctl-sysfs horst libugpio mii-tool wavemon kmod-gpiotoggling"
|
||||||
|
|
||||||
|
#official openwrt routing packages
|
||||||
|
ROUTING=(routing
|
||||||
|
git
|
||||||
|
https://github.com/openwrt-routing/packages.git
|
||||||
|
44318d05898069300ce2ad6eb05eb40f232e7123
|
||||||
|
../../../build_patches/0001-batman-adv-no-rebroadcast-option.patch)
|
||||||
|
ROUTING_PKGS="alfred kmod-batman-adv kmod-batgat"
|
||||||
|
|
||||||
|
FASTD=(fastd
|
||||||
|
git
|
||||||
|
git://git.metameute.de/lff/pkg_fastd
|
||||||
|
v14-1)
|
||||||
|
FASTD_PKGS="fastd libuecc"
|
||||||
|
|
||||||
|
LIBREMAP=(libremap
|
||||||
|
git
|
||||||
|
https://github.com/libremap/libremap-agent-openwrt.git
|
||||||
|
7194289d4b8a009df10613a3a88dc841fa26f423)
|
||||||
|
LIBREMAP_PKGS="libremap-agent"
|
||||||
|
|
||||||
|
FFOL=(ffol
|
||||||
|
'local'
|
||||||
|
${PWD}/src/packages/ffol/)
|
||||||
|
FFOL_PKGS="nodewatcher"
|
||||||
|
|
||||||
|
FEEDS=(OPENWRT ROUTING FASTD LIBREMAP FFOL)
|
||||||
|
|
||||||
checkout_svn(){
|
checkout_svn(){
|
||||||
local DIRECTORY=$1
|
local DIRECTORY=$1
|
||||||
|
@ -69,22 +104,32 @@ get_source() {
|
||||||
#Get the OpenWrt Core Source for Firmware
|
#Get the OpenWrt Core Source for Firmware
|
||||||
checkout_svn openwrt $OPENWRTURL $OPENWRTREV
|
checkout_svn openwrt $OPENWRTURL $OPENWRTREV
|
||||||
|
|
||||||
#checkout needed package feeds
|
|
||||||
test -d packages || mkdir packages
|
test -d packages || mkdir packages
|
||||||
cd packages
|
cd packages
|
||||||
|
|
||||||
#get official openwrt package feed
|
#checkout needed package feeds
|
||||||
checkout_svn openwrt $PACKAGEURL $PACKAGEREV
|
for FEEDVAR in ${FEEDS[@]} ; do
|
||||||
|
FEED=$FEEDVAR[@] FEED=( ${!FEED} )
|
||||||
|
|
||||||
#get official openwrt routing package feed
|
local NAME=${FEED[0]}
|
||||||
checkout_git routing https://github.com/openwrt-routing/packages.git 44318d05898069300ce2ad6eb05eb40f232e7123
|
local TYPE=${FEED[1]}
|
||||||
git -C routing am --whitespace=nowarn ../../../build_patches/0001-batman-adv-no-rebroadcast-option.patch
|
local URL=${FEED[2]}
|
||||||
|
local REV=${FEED[3]}
|
||||||
|
local PATCH=${FEED[4]}
|
||||||
|
|
||||||
#checkout package feed containing fastd
|
echo Adding Feed $NAME
|
||||||
checkout_git fastd git://git.metameute.de/lff/pkg_fastd v14-1
|
if [[ $TYPE == "svn" ]] ; then
|
||||||
|
checkout_svn $NAME $URL $REV
|
||||||
#checkout libremap package feed
|
elif [[ $TYPE == "git" ]] ; then
|
||||||
checkout_git libremap https://github.com/libremap/libremap-agent-openwrt.git 7194289d4b8a009df10613a3a88dc841fa26f423
|
checkout_git $NAME $URL $REV
|
||||||
|
# Patches for feeds could be stored in known directories like build_patches/$NAME/
|
||||||
|
# That way multiple patches for one feed could be supported
|
||||||
|
if [ ! -z "$PATCH" ] ; then
|
||||||
|
echo Patching $PATCH
|
||||||
|
git -C $NAME am --whitespace=nowarn $PATCH
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
cd .. # packages
|
cd .. # packages
|
||||||
cd .. # src
|
cd .. # src
|
||||||
|
@ -98,18 +143,32 @@ prepare() {
|
||||||
/bin/rm -rf $target
|
/bin/rm -rf $target
|
||||||
svn export src/openwrt $target
|
svn export src/openwrt $target
|
||||||
|
|
||||||
#apply own feeds.conf
|
## generate own feeds.conf
|
||||||
sed -e"s|PATH|$(pwd)/src/packages|g" ./build_patches/feeds.conf > $target/feeds.conf
|
#this local variable should be globally configure variable used in get_source and here
|
||||||
|
local PACKAGEBASE=${PWD}/src/packages
|
||||||
|
rm -f $target/feeds.conf
|
||||||
|
for FEEDVAR in ${FEEDS[@]} ; do
|
||||||
|
FEED=$FEEDVAR[@] FEED=( ${!FEED} )
|
||||||
|
local NAME=${FEED[0]}
|
||||||
|
echo adding $NAME to package feeds
|
||||||
|
echo src-link $NAME $PACKAGEBASE/$NAME >> $target/feeds.conf
|
||||||
|
done
|
||||||
|
|
||||||
|
echo cleaning feeds
|
||||||
test -d $target/feeds && /bin/rm -rf $target/feeds
|
test -d $target/feeds && /bin/rm -rf $target/feeds
|
||||||
|
|
||||||
$target/scripts/feeds update
|
$target/scripts/feeds update
|
||||||
|
|
||||||
$target/scripts/feeds install -p packagesol nodewatcher
|
for FEEDVAR in ${FEEDS[@]} ; do
|
||||||
$target/scripts/feeds install -p fastd fastd libuecc
|
FEED=$FEEDVAR[@] FEED=( ${!FEED} )
|
||||||
$target/scripts/feeds install -p libremap libremap-agent
|
local NAME=${FEED[0]}
|
||||||
$target/scripts/feeds install -p routing alfred kmod-batman-adv kmod-batgat
|
local PACKAGESVAR=${FEEDVAR}_PKGS
|
||||||
$target/scripts/feeds install -p openwrt bridge ethtool gpioctl-sysfs horst libugpio mii-tool wavemon kmod-gpiotoggling
|
|
||||||
|
if [[ -n "${!PACKAGESVAR}" ]] ; then
|
||||||
|
echo adding ${!PACKAGESVAR} from feed $NAME to available packages
|
||||||
|
$target/scripts/feeds install -p $NAME ${!PACKAGESVAR}
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
# todo evaluate this with the new openwrt
|
# todo evaluate this with the new openwrt
|
||||||
# This changes the default behavior of sysupgrade to not save the config
|
# This changes the default behavior of sysupgrade to not save the config
|
||||||
|
|
Loading…
Reference in New Issue