Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Juul committed Jul 19, 2013
0 parents commit 591780a
Show file tree
Hide file tree
Showing 9 changed files with 152 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
@@ -0,0 +1,2 @@
*~
\#*\#
32 changes: 32 additions & 0 deletions LICENSE
@@ -0,0 +1,32 @@
Copyright (C) 2009-2011 wlan slovenija, open wireless network of Slovenia
Copyright (C) 2013 Marc Juul Christoffersen

This program is free software: you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
Foundation, either version 3 of the License, or (at your option) any later
version.

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. If not, see <http://www.gnu.org/licenses/>.

Together with the source code this program may contain also additional content.
Unless specified otherwise, this content is available under Creative Commons
Attribution-ShareAlike license, either version 3.0 of the license, or (at your
option) any later version. You are free to copy, distribute, transmit, adapt
and/or commercially use this content or part(s) of it, provided you publicly,
clearly and visibly attribute wlan slovenija, open wireless network of
Slovenia, and provide a link to its website <http://wlan-si.net/>, if
applicable. If you alter, transform, or build upon this content or part(s) of
it, you may distribute the results only under the same or similar license to
this one.

For more information about Creative Commons Attribution-ShareAlike license see
<http://creativecommons.org/>.

This program may contain, use, link to and/or distribute also parts under third
party copyright with possibly different licensing conditions. Make sure you
check and respect also those conditions.
28 changes: 28 additions & 0 deletions README
@@ -0,0 +1,28 @@
The sudo mesh firmware builder.

NOTICE: This is still a work in progress. Don't expect it to work.

Only contains patches and build scripts.

What the prepare script does:

1. Downloads OpenWRT

2. Patches OpenWRT with sudo mesh patches (actually we don't yet have any patches).

3. Adds a feed to get OpenWRT to pull in the sudomesh/openwrt-packages feed from github.
The openwrt-packages contains references to the code for the actual sudo mesh openwrt-packages
(that each have their own github repositories).

What the build_package script does:

Builds a single package for the specified platform, e.g.:

build_package -a atheros internetisdownredirect

The built packages will end up in the built_packages/ directory

What the build script does:

Nothing right now, but in the future it will build OpenWRT firmwares for the target platforms
as specified in the openwrt/architectures file.
5 changes: 5 additions & 0 deletions build
@@ -0,0 +1,5 @@
#!/bin/sh

# base on:
# https://github.com/wlanslovenija/firmware-core/blob/master/scripts/build
echo "Not yet implemented"
3 changes: 3 additions & 0 deletions build_package
@@ -0,0 +1,3 @@
#!/bin/sh

echo "Not yet implemented"
2 changes: 2 additions & 0 deletions openwrt_config/architectures
@@ -0,0 +1,2 @@
atheros
ar71xx
10 changes: 10 additions & 0 deletions openwrt_config/packages
@@ -0,0 +1,10 @@

ip
iptables
tc
kmod-lib-crc16
kmod-l2tp
kmod-l2tp-ip
kmod-l2tp-eth
kmod-batman-adv

1 change: 1 addition & 0 deletions openwrt_config/version
@@ -0,0 +1 @@
branches/attitude_adjustment:36827
69 changes: 69 additions & 0 deletions prepare
@@ -0,0 +1,69 @@
#!/bin/bash

# sudomesh firmware prepare script
# based on wlanslovenija prepare script


BUILD_DIR=built_firmware

echo "Checking dependencies"

#if [ ! command -v quilt ]; then
# echo "quilt not found."
# exit 1
#fi

echo "Checking working directory"
if [[ ! -d openwrt_config ]]; then
echo "Invalid working directory!"
exit 1
fi

workdir=$(pwd)
mkdir -p ${BUILD_DIR}

# Get version identifier
firmware_version=$(git describe --always)

openwrt_version=$(cat openwrt_config/version)
openwrt_path=$(echo $openwrt_version | cut -d ':' -f 1)
openwrt_path_name="${openwrt_path//\//-}"
openwrt_path_name="${openwrt_path_name//_/-}"
openwrt_rev=$(echo $openwrt_version | cut -d ':' -f 2)

echo "OpenWRT path: ${openwrt_path}"
echo "OpenWRT revision: ${openwrt_rev}"
echo "Checking out OpenWRT into ${BUILD_DIR}, this could take some time"

OPENWRT_CHECKOUT_DIR=${workdir}/${BUILD_DIR}/openwrt
rm -rf ${OPENWRT_CHECKOUT_DIR}
svn co -q -r ${openwrt_rev} svn://svn.openwrt.org/openwrt/${openwrt_path} ${OPENWRT_CHECKOUT_DIR}

echo "Purging .svn files from repository"
find ${OPENWRT_CHECKOUT_DIR} -name .svn -type d -exec rm -rf "{}" \; 2>/dev/null

# Inject feeds and configurations
echo "Configuring feeds"
echo "src-git sudomesh git://github.com/sudomesh/openwrt-packages.git" > ${OPENWRT_CHECKOUT_DIR}/feeds.conf
echo "src-svn openwrt svn://svn.openwrt.org/openwrt/packages" >> ${OPENWRT_CHECKOUT_DIR}/feeds.conf
echo "src-git routing git://github.com/openwrt-routing/packages.git" >> ${OPENWRT_CHECKOUT_DIR}/feeds.conf

echo "Changing work directory to openwrt"
cd ${OPENWRT_CHECKOUT_DIR}

#echo "Applying patches for OpenWRT base tree..."

#ln -s ${workdir}/openwrt/patches/${openwrt_path_name} patches
#quilt push -f -a

# Importing feeds
echo "Importing feeds"
./scripts/feeds update -a > /dev/null
./scripts/feeds install -a -p sudomesh

for package in $(cat ${workdir}/openwrt/packages); do
./scripts/feeds install ${package}
done

# Preparation is now completed
echo "Preparation completed, you may now build the firmware or build single packages."

0 comments on commit 591780a

Please sign in to comment.