Wie baut ihr eure Firmware (inbesondere Futro)

Ich habe folgendes Skript um mir das bauen zu erleichtern und es reproduzierbarer zu machen.

#!/bin/bash
# 2015-16 Malte Moeller: Basic Script to build all targets

if [ $# -ne 5 ]; then
        echo "Required Paramater: <GLUON_RELEASE> <branch> <number> <broken> <gracetime in days>"
	echo "e.g. 2015.1.2 beta 06 1 3"
        exit 1;
fi

GLUON_RELEASE=v$1
BRANCH=$2
NUM=$3
BROKEN=$4
PRIORITY=$5

RELEASE_TAG="$GLUON_RELEASE.${BRANCH:0:1}.$NUM"
FFAC_RELEASE="${GLUON_RELEASE:1}-$BRANCH$NUM"

echo $RELEASE_TAG
echo $GLUON_RELEASE
echo $FFAC_RELEASE

cd gluon
git pull
git checkout $GLUON_RELEASE

cd site
git pull
git checkout $RELEASE_TAG
cd ..

make clean GLUON_TARGET=ar71xx-generic
make clean GLUON_TARGET=ar71xx-nand
make clean GLUON_TARGET=mpc85xx-generic
make clean GLUON_TARGET=x86-kvm_guest
make clean GLUON_TARGET=x86-generic

make update

make GLUON_BRANCH=$BRANCH GLUON_RELEASE=$FFAC_RELEASE BROKEN=$BROKEN GLUON_TARGET=ar71xx-generic -j 8
make GLUON_BRANCH=$BRANCH GLUON_RELEASE=$FFAC_RELEASE BROKEN=$BROKEN GLUON_TARGET=ar71xx-nand -j 8
make GLUON_BRANCH=$BRANCH GLUON_RELEASE=$FFAC_RELEASE BROKEN=$BROKEN GLUON_TARGET=mpc85xx-generic -j 8
make GLUON_BRANCH=$BRANCH GLUON_RELEASE=$FFAC_RELEASE BROKEN=$BROKEN GLUON_TARGET=x86-kvm_guest -j 8
echo "CONFIG_PATA_ATIIXP=y" >> openwrt/target/linux/x86/generic/config-3.10
make GLUON_BRANCH=$BRANCH GLUON_RELEASE=$FFAC_RELEASE BROKEN=$BROKEN GLUON_TARGET=x86-generic -j 8
sed -i '/CONFIG_PATA_ATIIXP=y/d' openwrt/target/linux/x86/generic/config-3.10

cd images/sysupgrade
rm md5sum
rm *.manifest
md5sum * >> md5sums
cd ../factory
rm md5sum
rm *.manifest
md5sum * >> md5sums
cd ../..

make manifest GLUON_BRANCH=$BRANCH BROKEN=$BROKEN GLUON_PRIORITY=$5

Durch den Futro musste ich den bösen Hack mit echo und sed um das x86 Target herum einfügen. Wie macht ihr das, habt ihr vielleicht eine schönere Lösung?

pbb@octavus ~/g/site> cat build.sh 
#!/bin/bash

#replace $2 with $3 in directory $1 recursively
function replace {
	find $1 -type f -print0 | xargs -0 sed -i "s;$2;$3;g"
}

#copy template $1 to sitecode $2 and replace SITECODE with $2, NAME with $3, and WEBSITE with $4
function makesite {
	DIR=assembled/$1/$2
	rm -rf $DIR
	mkdir -p assembled/$1
	cp -r templates/$1 $DIR
	replace $DIR SITECODE "$2"
	replace $DIR NAME "$3"
	replace $DIR WEBSITE "$4"
	replace $DIR BRANCH "$BRANCH"
}

function sites {
	rm -rf assembled
	while read L
	do
		makesite $L
	done < sites
	echo --- sites assembled ---
}

function image {
	cd $GLUON_DIR
	ARGS=GLUON_SITEDIR="$HOME_DIR/assembled/$1/$2" GLUON_IMAGEDIR="$GLUON_DIR/output/images/$1/$2" GLUON_MODULEDIR="$GLUON_DIR/output/modules"
	make -j10 $ARGS
	make manifest
	cd $HOME_DIR
}

function images {
	while read L
	do
		image $L
	done < sites
}

HOME_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
GLUON_DIR="$HOME_DIR/.."
$@
pbb@octavus ~/g/site> cat sites 
gl lln Leichlingen "https://freifunk-leichlingen.net/"
gl bgl "Bergisch Gladbach" "http://freifunk-bergisch-gladbach.de/"
gl bcd Burscheid "http://freifunk-burscheid.de/"
gl ode Odenthal "http://odenthal.de/freifunk.html"
gl ovr Overath "http://gl.wupper.ffrl.de"
gl rrh Rösrath "http://gl.wupper.ffrl.de"

in the worx
wenn fertig auch auf Github erhältlich