12 Commits

Author SHA1 Message Date
Attila Lendvai
85e367523a update to openwrt 18.06.1
tested with ./build.sh ar71xx generic tl-wr1043nd-v1
2019-01-06 18:40:27 +01:00
Attila Lendvai
38a96e37e0 small note into the usage about the imagebuilder URL 2018-07-18 10:17:01 +02:00
Attila Lendvai
0381c6f40b small adjustments after the lede -> openwrt re-rename. 2018-06-26 23:26:25 +02:00
Martin Friedrich
a761fb7630 Changed to openwrt imagebuilder, back to release instead of snapshots 2018-06-26 22:40:35 +02:00
Martin Friedrich
e96f2d38cc Changed to openwrt imagebuilder, back to release instead of snapshots 2018-06-26 22:40:35 +02:00
Martin Friedrich
4a1e765a85 Changed README to openwrt imagebuilder (snapshot) 2018-06-26 22:40:35 +02:00
Martin Friedrich
31d0688c7c change to openwrt imagebuilder (snapshot) 2018-06-26 22:40:35 +02:00
Attila Lendvai
68a222edc6 small fix: creating the symping to packages dir at the end of the build. 2017-05-14 20:17:58 +02:00
Attila Lendvai
8e64a64186 Update README.md 2017-04-21 03:09:09 +02:00
Attila Lendvai
a02567b2fd Update readme for LEDE 2017-04-21 02:28:41 +02:00
Attila Lendvai
6d0547b26b update for LEDE release 17.01.1 2017-04-21 00:42:39 +02:00
Attila Lendvai
b8627f3eb3 build.sh now uses the lede-project.org imagebuilder 2016-12-12 18:39:04 +01:00
2 changed files with 27 additions and 35 deletions

View File

@@ -17,18 +17,20 @@ So that e.g. customers can buy a router on their own, flash our custom
firmware, plug in a pendrive, and manage their SIP (telephony) node firmware, plug in a pendrive, and manage their SIP (telephony) node
from our webapp. from our webapp.
I've extracted the generic parts from the above mentioned auto-provision
project because I thought it's useful enough for making it public.
# How # How
### Building ### Building
To build issue the following command: `./build.sh architecture variant device-profile`, e.g.: To build it, issue the following command: `./build.sh architecture variant device-profile`, e.g.:
* `./build.sh ar71xx generic TLWDR4300` * `./build.sh ar71xx generic tl-wr1043nd-v2`
* `./build.sh ramips mt7621 ZBT-WG3526`
Results will be under `build/OpenWrt-ImageBuilder-${architecture}_${variant}-for-linux-x86_64/bin/`. Results will be under `build/openwrt-imagebuilder-${release}-${architecture}-${variant}.Linux-x86_64/bin/`.
To see a list of available targets, run this in the ImageBuilder dir: `make info`. To see a list of available targets, run `make info` in the ImageBuilder dir.
If you want to change which OpenWRT version is used, then edit the relevant variables in `build.sh` (`RELEASE`, and `RELEASE_NAME`). If you want to change which OpenWRT version is used, then edit the relevant variable(s) in `build.sh`.
### Setup stages ### Setup stages
@@ -37,7 +39,7 @@ sources for details: [autoprovision-functions.sh](image-extras/common/root/autop
#### Stage 1: setup extroot #### Stage 1: setup extroot
At the first boot after flashing the firmware the autoprovision script will When the custom firmware first boots, the autoprovision script will
wait for anything (!) in `/dev/sda` to show up (that is >= 512M), then erase wait for anything (!) in `/dev/sda` to show up (that is >= 512M), then erase
it and set up a `swap`, an `extroot`, and a `data`filesystem (for the remaining it and set up a `swap`, an `extroot`, and a `data`filesystem (for the remaining
space), and then reboot. space), and then reboot.
@@ -46,7 +48,7 @@ space), and then reboot.
Once it booted into the new extroot, it will continuously attempt to install Once it booted into the new extroot, it will continuously attempt to install
some OpenWRT packages until an internet connection is set up on the router some OpenWRT packages until an internet connection is set up on the router
(either by using ssh or LuCI if you could fit it into the firmware). (either by using ssh or the web UI (LuCI)).
### Login ### Login
@@ -70,24 +72,20 @@ probably want to customize this script here and there; search for
Most importantly, **set up a password and maybe an ssh key**. Most importantly, **set up a password and maybe an ssh key**.
I've extracted this from a project of mine where OpenWRT nodes auto-provision
themselves in 3 stages (stage 3 was a Python script for an app-level sync feature),
but I thought it's useful enough for making it public.
At the time of writing it only supports a few `ar71xx` routers out of the box, At the time of writing it only supports a few `ar71xx` routers out of the box,
but it's easy to extend it. but it's easy to extend it.
## Tested with ## Tested with
[OpenWRT Chaos Calmer 15.05 RC1](https://downloads.openwrt.org/chaos_calmer/15.05-rc1/) [OpenWRT 17.01.4](https://downloads.openwrt.org/releases/)
on a TP-Link WDR4300. on a TP-Link WR-1043nd-v2.
# Troubleshooting # Troubleshooting
## Which file should I flash? ## Which file should I flash?
You should consult the [OpenWRT documentation](https://wiki.openwrt.org/doc/howto/user.beginner). You should consult the [OpenWRT documentation](https://wiki.openwrt.org/doc/howto/user.beginner).
The produced firmware files should be somewhere around ```build/OpenWrt-ImageBuilder-15.05-ar71xx-generic.Linux-x86_64/bin/ar71xx```. The produced firmware files should be somewhere around ```build/openwrt-imagebuilder-17.01.4-ar71xx-generic.Linux-x86_64/bin/ar71xx```.
In short: In short:
@@ -97,7 +95,7 @@ In short:
* You must carefully pick the proper firmware file for your **hardware version**! I advise you * You must carefully pick the proper firmware file for your **hardware version**! I advise you
to look up the wiki page for your hardware on the [OpenWRT wiki](https://wiki.openwrt.org), to look up the wiki page for your hardware on the [OpenWRT wiki](https://wiki.openwrt.org),
because most of them have a table of the released hardawre versions with comments on their because most of them have a table of the released hardware versions with comments on their
status (sometimes new hardware revisions are only supported by the latest OpenWRT, which is status (sometimes new hardware revisions are only supported by the latest OpenWRT, which is
not released yet). not released yet).

View File

@@ -25,27 +25,21 @@ BUILD=`absolutize $BUILD`
### ###
### chose a release ### chose a release
### ###
RELEASE_NAME="chaos_calmer" RELEASE="18.06.1"
RELEASE="15.05"
#RELEASE_NAME="snapshots" IMGBUILDER_NAME="openwrt-imagebuilder-${RELEASE}-${TARGET_ARCHITECTURE}-${TARGET_VARIANT}.Linux-x86_64"
#RELEASE="trunk"
if [ $RELEASE = "trunk" ]; then
IMGBUILDER_NAME="OpenWrt-ImageBuilder-${TARGET_ARCHITECTURE}-${TARGET_VARIANT}.Linux-x86_64"
else
IMGBUILDER_NAME="OpenWrt-ImageBuilder-${RELEASE}-${TARGET_ARCHITECTURE}-${TARGET_VARIANT}.Linux-x86_64"
fi
IMGBUILDER_DIR="${BUILD}/${IMGBUILDER_NAME}" IMGBUILDER_DIR="${BUILD}/${IMGBUILDER_NAME}"
IMGBUILDER_ARCHIVE="${IMGBUILDER_NAME}.tar.bz2" IMGBUILDER_ARCHIVE="${IMGBUILDER_NAME}.tar.xz"
IMGTEMPDIR="${BUILD}/openwrt-build-image-extras" IMGTEMPDIR="${BUILD}/image-extras"
IMGBUILDERURL="https://downloads.openwrt.org/${RELEASE_NAME}/${RELEASE}/${TARGET_ARCHITECTURE}/${TARGET_VARIANT}/${IMGBUILDER_ARCHIVE}" IMGBUILDERURL="https://downloads.openwrt.org/releases/${RELEASE}/targets/${TARGET_ARCHITECTURE}/${TARGET_VARIANT}/${IMGBUILDER_ARCHIVE}"
if [ -z ${TARGET_DEVICE} ]; then if [ -z ${TARGET_DEVICE} ]; then
echo "Usage: $0 architecture variant device-profile" echo "Usage: $0 architecture variant device-profile"
echo " e.g.: $0 ar71xx generic TLWDR4300" echo " e.g.: $0 ar71xx generic tl-wr1043nd-v2"
echo " $0 ramips mt7621 ZBT-WG3526" echo " $0 ramips mt7621 zbt-wg3526"
echo " $0 bcm53xx generic dlink-dir-885l"
echo " (this last one will not work without editing build.sh, details: https://github.com/attila-lendvai/openwrt-auto-extroot/pull/15#issuecomment-405847440)"
echo " to get a list of supported devices issue a 'make info' in the OpenWRT image builder directory:" echo " to get a list of supported devices issue a 'make info' in the OpenWRT image builder directory:"
echo " '${IMGBUILDER_DIR}'" echo " '${IMGBUILDER_DIR}'"
kill -INT $$ kill -INT $$
@@ -79,8 +73,8 @@ fi
if [ ! -e ${IMGBUILDER_DIR} ]; then if [ ! -e ${IMGBUILDER_DIR} ]; then
pushd ${BUILD} pushd ${BUILD}
# --no-check-certificate if needed # --no-check-certificate if needed
wget --continue ${IMGBUILDERURL} wget --continue ${IMGBUILDERURL}
tar jvxf ${IMGBUILDER_ARCHIVE} xz -d <${IMGBUILDER_ARCHIVE} | tar vx
popd popd
fi fi
@@ -88,8 +82,8 @@ pushd ${IMGBUILDER_DIR}
make image PROFILE=${TARGET_DEVICE} PACKAGES="${PREINSTALLED_PACKAGES}" FILES=${IMGTEMPDIR} make image PROFILE=${TARGET_DEVICE} PACKAGES="${PREINSTALLED_PACKAGES}" FILES=${IMGTEMPDIR}
pushd bin/${TARGET_ARCHITECTURE}/ pushd bin/targets/${TARGET_ARCHITECTURE}/
ln -s ../../packages . ln -s ../../../packages .
popd popd
popd popd