diff --git a/LICENSE b/LICENSE index 5c8e9377..b287f312 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,6 @@ Part of AREDN -- Used for creating Amateur Radio Emergency Data Networks + +Copyright (C) 2018 Joe Ayers Copyright (C) 2015 Conrad Lara See Contributors file for additional contributors diff --git a/Makefile b/Makefile new file mode 100644 index 00000000..48319058 --- /dev/null +++ b/Makefile @@ -0,0 +1,173 @@ +include config.mk +include openwrt.mk + +# get main- and subtarget name from TARGET +MAINTARGET=$(word 1, $(subst -, ,$(TARGET))) +SUBTARGET=$(word 2, $(subst -, ,$(TARGET))) + +GIT_BRANCH=$(shell git symbolic-ref HEAD | sed -e 's,.*/\(.*\),\1,') +GIT_COMMIT=$(shell git rev-parse --short HEAD) + +# set dir and file names +TOP_DIR=$(shell pwd) +OPENWRT_DIR=$(TOP_DIR)/openwrt +TARGET_CONFIG=$(TOP_DIR)/configs/common.config $(TOP_DIR)/configs/$(MAINTARGET)-$(SUBTARGET).config +UMASK=umask 022 + +# set variables based on private or travis-ci build +ifeq ($(TRAVIS),true) +$(info Travis-CI build ...) +FW_VERSION=$(TRAVIS_BUILD_NUMBER)-$(TRAVIS_COMMIT) +FW_REPO=$(TRAVIS_BUILD_PACKAGES) +else +FW_VERSION=$(PRIVATE_BUILD_VERSION)-$(GIT_BRANCH)-$(GIT_COMMIT) +FW_REPO=$(PRIVATE_BUILD_PACKAGES) +endif + +# test for existing $TARGET-config or abort +ifeq ($(wildcard $(TOP_DIR)/configs/$(TARGET).config),) +$(error config for $(TARGET) not defined) +endif + +default: compile + +# clone openwrt +$(OPENWRT_DIR): .stamp-openwrt-removed + git clone $(OPENWRT_SRC) $(OPENWRT_DIR) + cd $(OPENWRT_DIR); git checkout $(OPENWRT_COMMIT) + ln -sf $(TOP_DIR)/patches $(OPENWRT_DIR)/ + ln -sf $(TOP_DIR)/files $(OPENWRT_DIR)/ + touch .stamp-openwrt-cleaned + rm -f .stamp-unpatched + +# when updating openwrt.mk to point to another repo +.stamp-openwrt-removed: openwrt.mk + rm -rf $(OPENWRT_DIR) + rm -f .stamp* + touch $@ + +# clean up openwrt working copy +openwrt-clean: stamp-clean-openwrt-cleaned .stamp-openwrt-cleaned +.stamp-openwrt-cleaned: | $(OPENWRT_DIR) openwrt-clean-bin + cd $(OPENWRT_DIR); \ + ./scripts/feeds clean && \ + git clean -dff && git fetch && git reset --hard HEAD && \ + rm -rf .config feeds.conf build_dir/target-* logs/ + rm -rf $(TOP_DIR)/results + rm -f $(TOP_DIR)/.pc + rm -f .stamp-unpatched + ln -sf $(TOP_DIR)/patches $(OPENWRT_DIR)/ + ln -sf $(TOP_DIR)/files $(OPENWRT_DIR)/ + touch $@ + +openwrt-clean-bin: + rm -rf $(OPENWRT_DIR)/bin + rm -rf $(TOP_DIR)/firmware/* + +# update openwrt and checkout specified commit +openwrt-update: .stamp-openwrt-updated .stamp-unpatched +.stamp-openwrt-updated: stamp-clean-openwrt-updated .stamp-openwrt-cleaned + cd $(OPENWRT_DIR); git checkout --detach $(OPENWRT_COMMIT) + rm -f .stamp-unpatched + touch $@ + +# feeds +$(OPENWRT_DIR)/feeds.conf: feeds.conf + cp $(TOP_DIR)/feeds.conf $@ + cat $(OPENWRT_DIR)/feeds.conf.default >> $@ + +# update feeds +feeds-update: stamp-clean-feeds-updated .stamp-feeds-updated +.stamp-feeds-updated: $(OPENWRT_DIR)/feeds.conf + cd $(OPENWRT_DIR); ./scripts/feeds uninstall -a + cd $(OPENWRT_DIR); ./scripts/feeds update -a + cd $(OPENWRT_DIR); ./scripts/feeds install -p arednpackages olsrd + cd $(OPENWRT_DIR); ./scripts/feeds install perl + cd $(OPENWRT_DIR); ./scripts/feeds install -p arednpackages vtun + cd $(OPENWRT_DIR); ./scripts/feeds install -a -p arednpackages + cd $(OPENWRT_DIR); ./scripts/feeds install snmpd + cd $(OPENWRT_DIR); ./scripts/feeds install ntpclient + cd $(OPENWRT_DIR); ./scripts/feeds install socat + cd $(OPENWRT_DIR); ./scripts/feeds install xinetd + cd $(OPENWRT_DIR); ./scripts/feeds install luci-base + cd $(OPENWRT_DIR); ./scripts/feeds install luci-lib-nixio + cd $(OPENWRT_DIR); ./scripts/feeds install luci-lib-ip + cd $(OPENWRT_DIR); ./scripts/feeds install luci-lib-jsonc + cd $(OPENWRT_DIR); ./scripts/feeds install luaposix + touch $@ + +# prepare patch +pre-patch: stamp-clean-pre-patch .stamp-pre-patch +.stamp-pre-patch: $(wildcard $(TOP_DIR)/patches/*) | $(OPENWRT_DIR) + rm -f .stamp-unpatched + touch $@ + +# patch openwrt working copy +patch: stamp-clean-patched .stamp-patched +.stamp-patched: .stamp-pre-patch .stamp-unpatched + cd $(OPENWRT_DIR); quilt push -a || [ $$? = 2 ] && true + rm -rf $(OPENWRT_DIR)/tmp + touch $@ + +.stamp-build_rev: .FORCE +ifneq (,$(wildcard .stamp-build_rev)) +ifneq ($(shell cat .stamp-build_rev),$(FW_VERSION)) + echo $(FW_VERSION) | diff >/dev/null -q $@ - || echo -n $(FW_VERSION) >$@ +endif +else + echo -n $(FW_VERSION) >$@ +endif + +# openwrt config +$(OPENWRT_DIR)/.config: .stamp-feeds-updated $(TARGET_CONFIG) .stamp-build_rev + cat $(TARGET_CONFIG) >$(OPENWRT_DIR)/.config + echo "CONFIG_VERSION_NUMBER=\"$(FW_VERSION)\"" >>$(OPENWRT_DIR)/.config + echo "$(FW_VERSION)" >$(TOP_DIR)/files/etc/mesh-release + echo "CONFIG_VERSION_REPO=\"$(FW_REPO)\"" >>$(OPENWRT_DIR)/.config + $(UMASK); \ + $(MAKE) -C $(OPENWRT_DIR) defconfig + +# prepare openwrt .config +prepare: stamp-clean-prepared .stamp-prepared +.stamp-prepared: .stamp-patched .stamp-feeds-updated $(OPENWRT_DIR)/.config + touch $@ + +# compile +compile: stamp-clean-compiled .stamp-compiled +.stamp-compiled: .stamp-prepared .stamp-feeds-updated openwrt-clean-bin | $(TOP_DIR)/firmware + $(TOP_DIR)/scripts/tests-prebuild.sh + $(UMASK); \ + $(MAKE) -C $(OPENWRT_DIR) $(MAKE_ARGS) + rm -f $(TOP_DIR)/firmware/AREDN* + for FILE in $(TOP_DIR)/firmware/openwrt*; do \ + [ -e "$$FILE" ] || continue; \ + NEWNAME="$${FILE/openwrt-/AREDN-}"; \ + NEWNAME="$${NEWNAME/ar71xx-generic-/}"; \ + NEWNAME="$${NEWNAME/squashfs-/}"; \ + mv "$$FILE" "$$NEWNAME"; \ + done; + $(TOP_DIR)/scripts/tests-postbuild.sh + +$(TOP_DIR)/firmware: + ln -sf $(OPENWRT_DIR)/bin/ar71xx $(TOP_DIR)/firmware + +stamp-clean-%: + rm -f .stamp-$* + +stamp-clean: + rm -f .stamp-* + +# unpatch needs "patches/" in openwrt +.stamp-unpatched: +# RC = 2 of quilt --> nothing to be done + cd $(OPENWRT_DIR); quilt pop -a -f || [ $$? = 2 ] && true + rm -rf $(OPENWRT_DIR)/tmp + rm -f .stamp-patched + touch $@ + +clean: stamp-clean .stamp-openwrt-cleaned + + +.PHONY: openwrt-clean openwrt-clean-bin openwrt-update patch feeds-update prepare compile stamp-clean clean +.NOTPARALLEL: +.FORCE: diff --git a/README.md b/README.md new file mode 100644 index 00000000..51c19269 --- /dev/null +++ b/README.md @@ -0,0 +1,111 @@ +# Amateur Radio Emergency Data Network AREDN(tm) Firmware + +http://www.aredn.org + +## Build Information + +The AREDN firmware is based on OpenWrt/LEDE with additional packages and patches. +A Makefile automates the entire process to create firmware images. + +### Build Prerequisites + +Please take a look at the [OpenWrt documentation](https://openwrt.org/docs/guide-developer/install-buildsystem) +for a complete and up to date list of packages for your operating system. + +On Ubuntu/Debian: +``` +apt-get install git subversion build-essential libncurses5-dev \ + zlib1g-dev gawk unzip libxml-perl flex wget gettext quilt \ + python libssl-dev shellcheck lua5.1 +``` + +On openSUSE: +``` +zypper install --type pattern devel_basis +zypper install git subversion ncurses-devel zlib-devel gawk unzip \ + perl-libxml-perl flex wget gettext-runtime quilt python \ + libopenssl-devel shellcheck lua51 +``` + +### Building firmware images + +To obtain the source and build the firmware locally use: + +```bash +git clone https://github.com/aredn/aredn_ar71xx.git +cd aredn_ar71xx +vi config.mk # enter your callsign, etc. +make +``` + +Building the images may take minutes or hours depending on the machine. +For more details see [build options](http://wiki.openwrt.org/doc/howto/build#make_options). +Review the build options in config.mk: `-j `. +`V=s` will give more verbose error messages. + +An internet connection is required during the build process. A good internet +connection can improve the build time. + +You need approximately 12GB of space for the build. + +### Directory Layout + +``` +Included in the git Repo: +config.mk <- build settings +openwrt.mk <- which openwrt repo and branch/tag/commit to use +feeds.conf/ <- custom package feeds (edit to point to your clone of aredn_packages) +files/ <- file system in AERDN created images, most customizations go here +patches/ <- patches to openwrt go here +scripts/ <- tests and other scripts called from the build +configs/ <- definitions of features in the devices' kernel and what packages to include +Makefile <- the build definition +README.md <- this file + +Created by the build: +openwrt/ <- cloned openwrt repository +firmware/ <- the build will place the images here +results/ <- code checks and other test results in jUnit xml format +``` + +### Patches with quilt + +The patches directory contains quilt patches that are applied on top of the +openwrt git repo defined in config.mk. + +If a patch is not yet included upstream, it can be placed in the `patches` directory with +the `quilt` tool. Please configure `quilt` as described in +[OpenWrt Quilt](https://openwrt.org/docs/guide-developer/use-patches-with-buildsystem?s[]=quilt). + +#### Add, modify or delete a patch + +Switch to the openwrt directory: + +```bash +cd openwrt +``` +Now you can use the `quilt` commands. + +##### Example: add a patch + +```bash +quilt push -a # apply all patches +quilt new 008-awesome.patch # tell quilt to create a new patch +quilt edit somedir/somefile1 # edit files +quilt edit somedir/somefile2 +quilt refresh # creates/updates the patch file +``` + +## Submitting new features and patches to AREDN + +The highlevel steps to submit to this repository https://github.com/aredn/aredn_ar71xx are: + +1) create a github account and 'fork' this repo +2) git commit a change into your fork, e.g. http://github.com/ae6xe/aredn_ar71xx +3) create a pull request for http://github.com/aredn/aredn_ar71xx to consider your change + +## Submitting Bug Reports + +Please submit all issues to http://github.com/aredn/aredn_ar71xx/issues + + diff --git a/build/buildsteps/001-prepbuild b/build/buildsteps/001-prepbuild deleted file mode 100755 index 23ba9478..00000000 --- a/build/buildsteps/001-prepbuild +++ /dev/null @@ -1,55 +0,0 @@ -#!/bin/sh - -cd "$BUILDROOTBASE" - - - -# Prep the feeds file -AREDN_PACKAGES_DIR=$(readlink -f "$BUILDROOTBASE/../aredn_packages") - -if [ -n "$GERRIT_PROJECT" ] && [ "$GERRIT_PROJECT" = "aredn_packages" ] -then - # This is a Gerrit build for aredn_packages, lets run the single commit - echo "src-git arednpackages file://$AREDN_PACKAGES_DIR^$GERRIT_PATCHSET_REVISION" > feeds.conf -else - # If $GIT_BRANCH is set lets try and check locally to be sure the branch exists. If we haven't checked out aredn_packages - # locally then lets assume this may not be in the build environment and fall back to some sane defaults. - if [ -n "$GIT_BRANCH" ] && [ -d "$AREDN_PACKAGES_DIR" ] && [ -n "$(git --git-dir="$AREDN_PACKAGES_DIR/.git" branch --list -r "$GIT_BRANCH")" ] - then - BASE_BRANCH=$(echo "$GIT_BRANCH"|sed 's/.*\///') - else - case $GIT_BRANCH in - origin/release-* ) BASE_BRANCH="master";; - origin/hotfix-* ) BASE_BRANCH="master";; - origin/master ) BASE_BRANCH="master";; - * ) BASE_BRANCH="develop";; - esac - fi - echo "src-git arednpackages git://git.aredn.org/aredn_packages;$BASE_BRANCH" > feeds.conf -fi - - -cat feeds.conf.default >> feeds.conf -./scripts/feeds update -a -./scripts/feeds install -p arednpackages olsrd -./scripts/feeds install perl -./scripts/feeds install -p arednpackages vtun -./scripts/feeds install -a -p arednpackages -./scripts/feeds install snmpd -./scripts/feeds install ntpclient -./scripts/feeds install socat -./scripts/feeds install xinetd -./scripts/feeds install luci-base -./scripts/feeds install luci-lib-nixio -./scripts/feeds install luci-lib-ip -./scripts/feeds install luci-lib-jsonc -./scripts/feeds install luaposix - -SHORT_COMMIT=$(echo "$GIT_COMMIT" | awk '{ string=substr($0, 1, 8); print string; }' ) -SHORT_BRANCH=$(echo "$GIT_BRANCH" | awk 'match($0,"/"){print substr($0,RSTART+1)}') - -if [ ! -z "$BUILD_SET_VERSION" ]; then - echo "$BUILD_SET_VERSION" > "$BUILDROOTBASE/files/etc/mesh-release" -else - echo "${SHORT_BRANCH}-${BUILD_NUMBER}-${SHORT_COMMIT}" > "$BUILDROOTBASE/files/etc/mesh-release" -fi diff --git a/build/buildsteps/002-makekconfig b/build/buildsteps/002-makekconfig deleted file mode 100755 index c90bb755..00000000 --- a/build/buildsteps/002-makekconfig +++ /dev/null @@ -1,45 +0,0 @@ -#!/bin/sh -<<'LICENSE' - Part of AREDN -- Used for creating Amateur Radio Emergency Data Networks - Copyright (C) 2015 Conrad Lara - See Contributors file for additional contributors - - 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 version 3 of the License. - - 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 . - - Additional Terms: - - Additional use restrictions exist on the AREDN(TM) trademark and logo. - See AREDNLicense.txt for more info. - - Attributions to the AREDN Project must be retained in the source code. - If importing this code into a new or existing project attribution - to the AREDN project must be added to the source code. - - You must not misrepresent the origin of the material contained within. - - Modified versions must be modified to attribute to the original source - and be marked in reasonable ways as differentiate it from the original - version. - -LICENSE - -. "$SCRIPTBASE/sh2ju.sh" - -rm "$BUILDROOTBASE/.config" 2> /dev/null - -touch "$BUILDROOTBASE/.config" - -for file in "$SCRIPTBASE"/buildsteps/kconfig/* -do - $file >> "$BUILDROOTBASE/.config" -done diff --git a/build/buildsteps/003-buildimage.sh b/build/buildsteps/003-buildimage.sh deleted file mode 100755 index 03b7b3bc..00000000 --- a/build/buildsteps/003-buildimage.sh +++ /dev/null @@ -1,40 +0,0 @@ -#!/bin/sh - -cd "$BUILDROOTBASE" - - -make defconfig -# Tools Build -make IGNORE_ERRORS=m V=99 BUILD_LOG=1 tools/install -j3 -# toolchain build -make IGNORE_ERRORS=m V=99 BUILD_LOG=1 toolchain/install -#kernel compile -make IGNORE_ERRORS=m V=99 BUILD_LOG=1 target/compile -j3 -# package compile -make IGNORE_ERRORS=m V=99 BUILD_LOG=1 package/compile -j3 -#package installation -make IGNORE_ERRORS=m V=99 BUILD_LOG=1 package/install -j3 -#package index -make IGNORE_ERRORS=m V=99 BUILD_LOG=1 package/index -#image generation -make IGNORE_ERRORS=m V=99 BUILD_LOG=1 target/install -j3 - -SHORT_COMMIT=$(echo "$GIT_COMMIT" | awk '{ string=substr($0, 1, 8); print string; }' ) -SHORT_BRANCH=$(echo "$GIT_BRANCH" | awk 'match($0,"/"){print substr($0,RSTART+1)}') - -if [ ! -z "$BUILD_SET_VERSION" ]; then - MYBUILDNAME="$BUILD_SET_VERSION" -else - MYBUILDNAME="${SHORT_BRANCH}-${BUILD_NUMBER}-${SHORT_COMMIT}" -fi - -# Rename the images -find bin/ar71xx/ -not -path "*/packages/*" -type f | while read FILE -do - NEWNAME=$(echo "$FILE" | sed -r "s/openwrt-.*ar71xx-(generic)|(mikrotik)|(nand)/AREDN-$MYBUILDNAME/g") - if [ "$FILE" != "$NEWNAME" ] - then - mv "$FILE" "$NEWNAME" - fi -done - diff --git a/build/buildsteps/kconfig/001-architecture b/build/buildsteps/kconfig/001-architecture deleted file mode 100755 index bd2b5592..00000000 --- a/build/buildsteps/kconfig/001-architecture +++ /dev/null @@ -1,41 +0,0 @@ -#!/bin/sh -<<'LICENSE' - Part of AREDN -- Used for creating Amateur Radio Emergency Data Networks - Copyright (C) 2015 Conrad Lara - See Contributors file for additional contributors - - 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 version 3 of the License. - - 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 . - - Additional Terms: - - Additional use restrictions exist on the AREDN(TM) trademark and logo. - See AREDNLicense.txt for more info. - - Attributions to the AREDN Project must be retained in the source code. - If importing this code into a new or existing project attribution - to the AREDN project must be added to the source code. - - You must not misrepresent the origin of the material contained within. - - Modified versions must be modified to attribute to the original source - and be marked in reasonable ways as differentiate it from the original - version. - -LICENSE - -# For now lets just return static entries -cat << EOF -CONFIG_TARGET_ar71xx=y -CONFIG_TARGET_ar71xx_Default=y -CONFIG_ARCH=mips -EOF diff --git a/build/buildsteps/kconfig/002-ath9kregd b/build/buildsteps/kconfig/002-ath9kregd deleted file mode 100755 index 4939c9e9..00000000 --- a/build/buildsteps/kconfig/002-ath9kregd +++ /dev/null @@ -1,39 +0,0 @@ -#!/bin/sh -<<'LICENSE' - Part of AREDN -- Used for creating Amateur Radio Emergency Data Networks - Copyright (C) 2015 Conrad Lara - See Contributors file for additional contributors - - 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 version 3 of the License. - - 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 . - - Additional Terms: - - Additional use restrictions exist on the AREDN(TM) trademark and logo. - See AREDNLicense.txt for more info. - - Attributions to the AREDN Project must be retained in the source code. - If importing this code into a new or existing project attribution - to the AREDN project must be added to the source code. - - You must not misrepresent the origin of the material contained within. - - Modified versions must be modified to attribute to the original source - and be marked in reasonable ways as differentiate it from the original - version. - -LICENSE - -# For now lets just return static entries -cat << EOF -CONFIG_ATH_USER_REGD=y -EOF diff --git a/build/buildsteps/kconfig/099-release_version b/build/buildsteps/kconfig/099-release_version deleted file mode 100755 index 000185b3..00000000 --- a/build/buildsteps/kconfig/099-release_version +++ /dev/null @@ -1,53 +0,0 @@ -#!/bin/sh -<<'LICENSE' - Part of AREDN -- Used for creating Amateur Radio Emergency Data Networks - Copyright (C) 2016 Conrad Lara - See Contributors file for additional contributors - - 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 version 3 of the License. - - 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 . - - Additional Terms: - - Additional use restrictions exist on the AREDN(TM) trademark and logo. - See AREDNLicense.txt for more info. - - Attributions to the AREDN Project must be retained in the source code. - If importing this code into a new or existing project attribution - to the AREDN project must be added to the source code. - - You must not misrepresent the origin of the material contained within. - - Modified versions must be modified to attribute to the original source - and be marked in reasonable ways as differentiate it from the original - version. - -LICENSE - -if [ ! -z "$BUILD_SET_VERSION" ]; then - MYBUILDNAME="$BUILD_SET_VERSION" -else - SHORT_COMMIT=$(echo "$GIT_COMMIT" | awk '{ string=substr($0, 1, 8); print string; }' ) - SHORT_BRANCH=$(echo "$GIT_BRANCH" | awk 'match($0,"/"){print substr($0,RSTART+1)}') - MYBUILDNAME="${SHORT_BRANCH}-${BUILD_NUMBER}-${SHORT_COMMIT}" -fi - -cat << EOF -CONFIG_IMAGEOPT=y -CONFIG_VERSIONOPT=y -CONFIG_VERSION_NUMBER="$MYBUILDNAME" -EOF - -if [ ! -z "$BUILD_SET_VERSION" ]; then - hashedpath=$(echo "$BUILD_SET_VERSION" |awk -F'.' '{print $1"/"$2"/"$0}') - echo "CONFIG_VERSION_REPO=\"http://downloads.aredn.org/releases/${hashedpath}/%S/packages\"" -fi diff --git a/build/makeimage.sh b/build/makeimage.sh deleted file mode 100755 index 9d176194..00000000 --- a/build/makeimage.sh +++ /dev/null @@ -1,70 +0,0 @@ -#!/bin/sh -<<'LICENSE' - Part of AREDN -- Used for creating Amateur Radio Emergency Data Networks - Copyright (C) 2015 Conrad Lara - See Contributors file for additional contributors - - 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 version 3 of the License. - - 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 . - - Additional Terms: - - Additional use restrictions exist on the AREDN(TM) trademark and logo. - See AREDNLicense.txt for more info. - - Attributions to the AREDN Project must be retained in the source code. - If importing this code into a new or existing project attribution - to the AREDN project must be added to the source code. - - You must not misrepresent the origin of the material contained within. - - Modified versions must be modified to attribute to the original source - and be marked in reasonable ways as differentiate it from the original - version. - -LICENSE - -SCRIPTBASE=$(dirname "$(readlink -f "$0")") -export SCRIPTBASE - -if [ "$1" != "" ] -then - BUILDROOTBASE=$1 -else - BUILDROOTBASE="$PWD" -fi - -export BUILDROOTBASE - -if [ ! -d "$BUILDROOTBASE" ] -then - - echo "ERROR: $BUILDROOTBASE doesn't exist" - exit 1; -fi - -# Run pre-tests -"$SCRIPTBASE"/tests-prebuild.sh "${BUILDROOTBASE}/files" - -for file in $SCRIPTBASE/buildsteps/* -do - if ( [ -x "$file" ] && [ -f "$file" ] ); then - echo "BUILDSTEP: $file" - $file - fi -done - -# Run post-build tests -"$SCRIPTBASE"/tests-postbuild.sh "${BUILDROOTBASE}/files" - - -exit 0 diff --git a/config.mk b/config.mk new file mode 100644 index 00000000..9978993f --- /dev/null +++ b/config.mk @@ -0,0 +1,19 @@ +# default parameters for Makefile + +# What version will show in the AREDN firmware 'Node Status" UI page? +PRIVATE_BUILD_VERSION=NoCall + +# build options: -j# for (# of cores +1) on build machine, V=s for verbose output +# https://wiki.openwrt.org/doc/howto/build#make_options (archive) +# https://openwrt.org/docs/guide-developer/usebuildsytem (openwrt-lede merge) +# example "MAKE_ARGS=-j33 V=s IGNORE_ERRORS=m BUILD_LOG=1" +MAKE_ARGS=-j3 + +# Where will the installed image find add-on Packages to download? +# This URL must contain the packages from this build +# downloading packages within the AREDN UI uses signatures +PRIVATE_BUILD_PACKAGES=http://downloads.arednmesh.org/snapshots/trunk/%S/packages + +# These options are for more complex changes +SHELL:=$(shell which bash) +TARGET=ar71xx-generic diff --git a/configs/ar71xx-generic.config b/configs/ar71xx-generic.config new file mode 100644 index 00000000..804c8ad6 --- /dev/null +++ b/configs/ar71xx-generic.config @@ -0,0 +1,3 @@ +CONFIG_TARGET_ar71xx=y +CONFIG_TARGET_ar71xx_Default=y +CONFIG_ARCH=mips diff --git a/build/buildsteps/kconfig/003-packages b/configs/common.config old mode 100755 new mode 100644 similarity index 54% rename from build/buildsteps/kconfig/003-packages rename to configs/common.config index 77e3fe03..f1bcbf57 --- a/build/buildsteps/kconfig/003-packages +++ b/configs/common.config @@ -1,42 +1,4 @@ -#!/bin/sh -<<'LICENSE' - Part of AREDN -- Used for creating Amateur Radio Emergency Data Networks - Copyright (C) 2015 Conrad Lara - See Contributors file for additional contributors - - 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 version 3 of the License. - - 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 . - - Additional Terms: - - Additional use restrictions exist on the AREDN(TM) trademark and logo. - See AREDNLicense.txt for more info. - - Attributions to the AREDN Project must be retained in the source code. - If importing this code into a new or existing project attribution - to the AREDN project must be added to the source code. - - You must not misrepresent the origin of the material contained within. - - Modified versions must be modified to attribute to the original source - and be marked in reasonable ways as differentiate it from the original - version. - -LICENSE - -# For now lets just return static entries - -# Kernel Config entries for packages that should be a part of the build -cat <<'EOF' +CONFIG_ATH_USER_REGD=y CONFIG_ALL=y CONFIG_PACKAGE_bridge=y CONFIG_PACKAGE_busybox=y @@ -101,4 +63,6 @@ CONFIG_PACKAGE_libjson-c=y CONFIG_PACKAGE_libnl_tiny=y CONFIG_PACKAGE_libiwinfo-lua=y CONFIG_PACKAGE_luaposix=y -EOF +CONFIG_IMAGEOPT=y +CONFIG_VERSIONOPT=y + diff --git a/feeds.conf b/feeds.conf new file mode 100644 index 00000000..16252485 --- /dev/null +++ b/feeds.conf @@ -0,0 +1 @@ +src-git arednpackages git://github.com/aredn/aredn_packages;Jenkins-176 diff --git a/openwrt.mk b/openwrt.mk new file mode 100644 index 00000000..ea72648e --- /dev/null +++ b/openwrt.mk @@ -0,0 +1,6 @@ +# what openwrt git repo will be used? +OPENWRT_SRC=https://github.com/aredn/arednbase + +# what branch, tag or commit in this repo? +OPENWRT_COMMIT=Jenkins-176 + diff --git a/patches/PATCHES.rst b/patches/PATCHES.rst new file mode 100644 index 00000000..8018a73f --- /dev/null +++ b/patches/PATCHES.rst @@ -0,0 +1,16 @@ +PATCHES +####### + +Please add patches in the folowing structure + + +- 0xx - OpenWRT / LEDE related (upstream) +- 1xx - packages (upstream) +- 2xx - LUCI (upstream) +- 3xx - routing (upstream) +- 4xx - reserved +- 5xx - reserved +- 6xx - build system changes to support this build system +- 7xx - AREDN specific +- 8xx - other +- 9xx - reserved diff --git a/patches/series b/patches/series new file mode 100644 index 00000000..e69de29b diff --git a/build/LICENSE.sh2ju b/scripts/LICENSE.sh2ju similarity index 100% rename from build/LICENSE.sh2ju rename to scripts/LICENSE.sh2ju diff --git a/build/sh2ju.sh b/scripts/sh2ju.sh similarity index 100% rename from build/sh2ju.sh rename to scripts/sh2ju.sh diff --git a/build/tests-postbuild.sh b/scripts/tests-postbuild.sh similarity index 100% rename from build/tests-postbuild.sh rename to scripts/tests-postbuild.sh diff --git a/build/tests-prebuild.sh b/scripts/tests-prebuild.sh similarity index 100% rename from build/tests-prebuild.sh rename to scripts/tests-prebuild.sh diff --git a/build/tests/postbuild/700-imagename.sh b/scripts/tests/postbuild/700-imagename.sh similarity index 80% rename from build/tests/postbuild/700-imagename.sh rename to scripts/tests/postbuild/700-imagename.sh index 4ea08cbd..5a9a5ecc 100755 --- a/build/tests/postbuild/700-imagename.sh +++ b/scripts/tests/postbuild/700-imagename.sh @@ -49,22 +49,10 @@ STATICFILESCOUNT=9 . "$SCRIPTBASE/sh2ju.sh" -# Set the MYBUILDNAME var for later -SHORT_COMMIT=$(echo "$GIT_COMMIT" | awk '{ string=substr($0, 1, 8); print string; }' ) -SHORT_BRANCH=$(echo "$GIT_BRANCH" | awk 'match($0,"/"){print substr($0,RSTART+1)}') - -if [ ! -z "$BUILD_SET_VERSION" ]; then - MYBUILDNAME="$BUILD_SET_VERSION" -else - MYBUILDNAME="${SHORT_BRANCH}-${BUILD_NUMBER}-${SHORT_COMMIT}" -fi - - - # Make sure no files named openwrt* in output directory # Could mean an image rename problem or that the buildroot # was not clean before making images -if [ "$(find ./bin/* -maxdepth 2 -regex '.*bin/.*[Oo][Pp][Ee][Nn][Ww][Rr][Tt].*' | wc -l)" -eq "0" ] +if [ "$(find ./openwrt/bin/* -maxdepth 2 -regex '\./openwrt/bin.*[Oo][Pp][Ee][Nn][Ww][Rr][Tt].*' | wc -l)" -eq "0" ] then juLog -name="no_firmware_images_named_openwrt" true else @@ -79,7 +67,7 @@ fi ## STATICFILESCOUNT + NUMBEROFIMAGESCOUNT * 2 for sysupgrade and factory files EXPECTEDFILESCOUNT=$(( STATICFILESCOUNT + NUMBEROFIMAGESCOUNT * 2 )) -if [ "$(find ./bin/* -maxdepth 2 -regex ".*bin/.*AREDN-$MYBUILDNAME.*" | wc -l)" -eq "$EXPECTEDFILESCOUNT" ] +if [ "$(find ./openwrt/bin/* -maxdepth 2 -regex ".*AREDN-.*" | wc -l)" -eq "$EXPECTEDFILESCOUNT" ] then juLog -name="AREDN_image_files_exist" true else diff --git a/build/tests/prebuild/001-cgibin.sh b/scripts/tests/prebuild/001-cgibin.sh similarity index 98% rename from build/tests/prebuild/001-cgibin.sh rename to scripts/tests/prebuild/001-cgibin.sh index cc690414..49ff4674 100755 --- a/build/tests/prebuild/001-cgibin.sh +++ b/scripts/tests/prebuild/001-cgibin.sh @@ -36,7 +36,7 @@ LICENSE . "$SCRIPTBASE/sh2ju.sh" -# Make sure shellchheck is installed and in path. +# Make sure shellcheck is installed and in path. juLog -name="cgibin_shellcheckexists" which shellcheck SHELLCHECKNOTEXISTS=$? diff --git a/build/tests/prebuild/002-usrlocalbin.sh b/scripts/tests/prebuild/002-usrlocalbin.sh similarity index 100% rename from build/tests/prebuild/002-usrlocalbin.sh rename to scripts/tests/prebuild/002-usrlocalbin.sh diff --git a/build/tests/prebuild/003-usrlibluaaredn.sh b/scripts/tests/prebuild/003-usrlibluaaredn.sh similarity index 100% rename from build/tests/prebuild/003-usrlibluaaredn.sh rename to scripts/tests/prebuild/003-usrlibluaaredn.sh