Initial commit with rpi-4, archer-c7-v2 and tl-wdr-3600-v1

This commit is contained in:
Mads Meisner-Jensen
2021-05-15 14:48:49 +02:00
commit 0176f0668f
7 changed files with 625 additions and 0 deletions

138
README.md Normal file
View File

@@ -0,0 +1,138 @@
% OpenWRT Image Buildomatic
# Overview
This shell script uses the official
[OpenWrt Image Builder](https://openwrt.org/docs/guide-user/additional-software/imagebuilder)
to quickly generate/build an OpenWRT device image with extra pre-installed
packages, files or configuration included in the final image.
This means that to build your very own, let's say Raspberry Pi 4,
OpenWRT image, you just need these three lines:
```
git clone https://github.com/mmeisner/openwrt-image-buildomatic
cd openwrt-image-buildomatic
./oi-build -b -c rpi-4
```
...and then after a minute you will have an image you can write to an SD-card,
insert it into your RPi4 and run your Internet connection with 940Mbps
throughput, with Wireguard.
As the saying goes: The cool guys build from source, the impatient guys
use the image builder.
See the device configuration files in the `configs` folder for how simple
it is.
## The OpenWRT Image Builder
The *OpenWRT Image Builder* is like the normal OpenWRT build system except
it does not build from source code but downloads a pre-built binary image
and packages and combines those into a new image that can be used to update
your OpenWRT device; Instead of taking hours to build an image from source,
it takes mere seconds to build an image - depending on your download speed.
The OpenWRT image builder is already very easy to use, so the only thing that
this script adds, is automated download and execution of the image builder
— plus a convenient way to specify your configuration in a simple
textual file (actually merely a shell script with a few variables).
In the configuration file you can specify:
- **`RELEASE`** is the release to use, e.g. `21.02-rc1`, `19.07`, `snapshot`, etc.
- **`TARGET`** is the CPU architecture such as *`x86`*,
*`ath79`* (for Archer C7), *`bcm27xx`* (for Raspberry PI), etc.
- **`PROFILE`** is the device name to make an image for e.g. *`rpi4`* or *`archer-c7-v2`*
- **`PACKAGES`** is a list of additional packages to include in the image.
Full list per release is here: [OpenWrt Packages](https://openwrt.org/packages/start)
- **`FILES`** is the path to a directory containing additional files you
want to add to the final image. The directory should be organized as
a normal rootfs. It could contain some useful home-made scripts or
`uci-defaults` files for predefined configuration at first boot (see
[UCI defaults](https://openwrt.org/docs/guide-developer/uci-defaults))
Please note that as stated on the
[OpenWrt Image Builder](https://openwrt.org/docs/guide-user/additional-software/imagebuilder)
page, *prebuilt snapshot images do not come with any web interface or GUI*.
This means that `PACKAGES` should at least contain `luci` if you want the web GUI!
Here are some of the OpenWRT [Release Builds](https://openwrt.org/releases/start)
and devices that the script works with (as of May 2021):
- Releases:
- *snapshot* (snapshot, next upcoming release)
- *21.02.0-rc1* (release candidate)
- *19.07*
- Some popular devices:
- *Raspberry Pi 4*
- *Archer C7*
OpenWRT [Index of /releases/](https://downloads.openwrt.org/releases/)
# Other Useful OpenWRT Projects and Resources
This section lists various other resources on the Internet which can be useful
with regard to installing or upgrading your OpenWRT router.
* [uciparse · PyPI](https://pypi.org/project/uciparse/)
These tools were written to ease OpenWRT upgrades, making it easier to see
the differences between two config files. As of this writing (mid-2020),
OpenWRT upgrades often don't normalize upgraded config files in the same
way from version to version
## Raspberry Pi 4 Network Performance Tuning
* [(15) BIFRÖST Part 2 - RPi 4B Hybrid Bridging Router - Tuning Linux Network for Gigabit Line Speed | LinkedIn](https://www.linkedin.com/pulse/bifr%C3%B6st-rpi-4b-hybrid-routing-bridge-tuning-linux-network-corner/?trk=read_related_article-card_title)
very detailed article about tuning RPi4 network performance using IRQ
CPU pinning and other tricks. Kind of a hardwired ues of `irqbalance`
## Post Install Actions
* [[OpenWrt Wiki] UCI defaults](https://openwrt.org/docs/guide-developer/uci-defaults)
describes how to setup some defaults at first boot
* [[OpenWrt Wiki] Opkg extras](https://openwrt.org/docs/guide-user/advanced/opkg_extras)
provides a way to reinstall user-installed packages after an upgrade
* [[OpenWrt Wiki] UCI extras](https://openwrt.org/docs/guide-user/advanced/uci_extras)
describes how to add files to `/etc/uci-defaults` which can configure
your OpenWRT install after an initial install or upgrade.
* [[OpenWrt Wiki] Opkg extras](https://openwrt.org/docs/guide-user/advanced/opkg_extras)
extends `opkg` to — among other things — handle user-installed packages
* [How to automate upgrade? - For Developers - OpenWrt Forum](https://forum.openwrt.org/t/how-to-automate-upgrade/72636/12)
has some pointers on how to re-install user installed packages when updating.
## OpenWRT Remote Control Projects
* [jumpscale7/openwrt-remote-manager: GitHub](https://github.com/jumpscale7/openwrt-remote-manager)
A Python module for remotely managing an OpenWRT instance. 22 stars, 6 forks, last active 2015.
Requires package `luci-mod-rpc` installed on your OpenWRT
* [fbradyirl/openwrt-luci-rpc](https://github.com/fbradyirl/openwrt-luci-rpc)
* Good docs, 17 stars, 10 forks, last active 2021-Mar
* Only an RPC transport. All functions must be implemented on top of that.
* [openwrt-luci-rpc · PyPI](https://pypi.org/project/openwrt-luci-rpc/)
* [Noltari/python-ubus-rpc](https://github.com/Noltari/python-ubus-rpc).
* Python module implementing an interface to the OpenWrt ubus RPC API.
* Looks pretty sweet. 0 stars, 0 forks, 2021-feb-17.
* Limited number of functions implemented.
* [openwrt-ubus-rpc · PyPI](https://pypi.org/project/openwrt-ubus-rpc/)
* [jianingy/openwrt-wac: GitHub](https://github.com/jianingy/openwrt-wac)
A simple command line tool for managing groups of OpenWRT based routers.
* 3 stars, 1 fork, last active 2016
* [openwrt-wac · PyPI](https://pypi.org/project/openwrt-wac/)
## Some Useful OpenWRT Settings
Disable DHCP server on LAN: `uci set dhcp.lan.ignore=1 && uci commit && /etc/init.d/dnsmasq restart`
# Similar projects
* [Github ansemjo/openwrtbuilder](https://gist.github.com/ansemjo/cb41677a76f1c063527744438b03b932)
*OpenWRT builder - using the imagebuilder to compile a custom image*
is a small, simple shell script that does pretty much the same as this script
although with command-line arguments instead of a configuration file.
----
Convert this markdown doc to HTML with pandoc:
pandoc --toc --self-contained -t html -o README.html README.md