diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..74c36c8 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +*~ +\#*\# diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..8c8b8c6 --- /dev/null +++ b/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 . + +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 , 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 +. + +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. diff --git a/README b/README new file mode 100644 index 0000000..efa38fb --- /dev/null +++ b/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. diff --git a/build b/build new file mode 100755 index 0000000..6edc86b --- /dev/null +++ b/build @@ -0,0 +1,5 @@ +#!/bin/sh + +# base on: +# https://github.com/wlanslovenija/firmware-core/blob/master/scripts/build +echo "Not yet implemented" \ No newline at end of file diff --git a/build_package b/build_package new file mode 100755 index 0000000..da6d9ab --- /dev/null +++ b/build_package @@ -0,0 +1,3 @@ +#!/bin/sh + +echo "Not yet implemented" \ No newline at end of file diff --git a/openwrt_config/architectures b/openwrt_config/architectures new file mode 100644 index 0000000..b8bb291 --- /dev/null +++ b/openwrt_config/architectures @@ -0,0 +1,2 @@ +atheros +ar71xx diff --git a/openwrt_config/packages b/openwrt_config/packages new file mode 100644 index 0000000..a0d18a0 --- /dev/null +++ b/openwrt_config/packages @@ -0,0 +1,10 @@ + +ip +iptables +tc +kmod-lib-crc16 +kmod-l2tp +kmod-l2tp-ip +kmod-l2tp-eth +kmod-batman-adv + diff --git a/openwrt_config/version b/openwrt_config/version new file mode 100644 index 0000000..a6b284b --- /dev/null +++ b/openwrt_config/version @@ -0,0 +1 @@ +branches/attitude_adjustment:36827 diff --git a/prepare b/prepare new file mode 100755 index 0000000..584b61b --- /dev/null +++ b/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."