Skip to content

Instantly share code, notes, and snippets.

@stefanauss
Created August 14, 2014 20:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stefanauss/4a56603db80b41f46f03 to your computer and use it in GitHub Desktop.
Save stefanauss/4a56603db80b41f46f03 to your computer and use it in GitHub Desktop.
NinucsWrt Release Script
#!/bin/bash
#
# NinucsWrt Release Script -- This is the script used to automate the compiling
# of the NinucsWrt firmware for all supported models and branches.
#
# Copyright (C) 2014 Hacklab Cosenza <ninux@hlcs.it>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3
# as published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program (see the file COPYING included with this
# distribution); if not, write to the Free Software Foundation, Inc.,
# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
#
# This script assumes there already is a folder named ninucswrt-$branch for
# each of the supported branches.
# In this folder you have to place, with the correst naming pattern:
# * config files for each supported device (config_$devrev)
# * patch files in the unified diff format (NNN_patch-name.patch)
# Launch the script and it will checkout, patch and iterate compiling for each
# device in a branch, and then restart the process for next branch.
#
ROOT_DIR=`pwd`
BRANCHES=(attitude_adjustment barrier_breaker)
attitude_adjustment_SUPPORTED_DEVICES=(
tl-wr841n-v8 \
tl-wr1043nd-v1 \
tl-wr740n-v4 \
tl-wr741nd-v4 \
tl-wdr3600-v1 \
tl-wdr4300-v1
)
barrier_breaker_SUPPORTED_DEVICES=(
tl-wr841n-v8 \
tl-wr841n-v9 \
tl-wr1043nd-v1 \
tl-wr1043nd-v2 \
tl-wr740n-v4 \
tl-wr741nd-v4 \
tl-wdr3600-v1 \
tl-wdr4300-v1
)
THREADS=3
for branch in ${BRANCHES[@]}
do
cd $ROOT_DIR
if [ ! -d "$branch" ]
then
svn co svn://svn.openwrt.org/openwrt/branches/$branch
else
for patch in $ROOT_DIR/ninucswrt-$branch/*.patch
do
cd $ROOT_DIR/$branch
patch -p0 -R < $patch
done
fi
cd $ROOT_DIR/$branch
svn up
./scripts/feeds uninstall -a
./scripts/feeds update
./scripts/feeds install -a
for patch in $ROOT_DIR/ninucswrt-$branch/*.patch
do
patch -p0 < $patch
done
for devrev in $(eval echo \$\{${branch}_SUPPORTED_DEVICES[@]\})
do
rm .config
ln -s ../ninucswrt-$branch/config_$devrev .config
make -j $THREADS
cp bin/ar71xx/openwrt-ar71xx-generic-$devrev-squashfs-factory.bin ../ninucswrt-$branch/ninucswrt-ar71xx-generic-$devrev-squashfs-factory.bin
cp bin/ar71xx/openwrt-ar71xx-generic-$devrev-squashfs-sysupgrade.bin ../ninucswrt-$branch/ninucswrt-ar71xx-generic-$devrev-squashfs-sysupgrade.bin
done
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment