Hardware
--------
SOC: MediaTek MT7981
RAM: 512MB DDR4
FLASH: 128MB SPI-NAND
WIFI: Mediatek MT7915 (integrated) 2x2 802.11ax 2.4 / 5 GHz
ETH: Mediatek MT7981 internal 1 GbE PHY
UART: 3V3 115200 8N1 (Pinout silkscreened / Do not connect VCC)
Installation
------------
1. Download the OpenWrt initramfs image. Copy the image to a TFTP server
2. Connect the TFTP server to the EAX17. Conect to the serial console,
interrupt the autoboot process by pressing '0' when prompted.
3. Download & Boot the OpenWrt initramfs image.
$ tftpboot openwrt.bin
$ bootm
4. Wait for OpenWrt to boot. Transfer the sysupgrade image to the device
using scp and install using sysupgrade.
$ sysupgrade -n <path-to-sysupgrade.bin>
Signed-off-by: Jascha Sundaresan <flizarthanon@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/20354
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Add gcc config option for fanalyzer. As a result of this option, a static
analysis of the program flow is conducted, allowing interprocedural paths
to be identified and warnings to be issued if problems are identified.
Link: https://github.com/openwrt/openwrt/pull/12576
Signed-off-by: Nick Hainke <vincent@systemli.org>
In implementing APK support it seems a a leftover was never removed that
creates an unused tmp directory in the package feed directory.
Drop it as it's not used anywhere. What is actually needed is the
creation of the $$(PDIR_$(1)) directory for the feed package directory
in the bin/packages directory.
This was a side effect of using INSTALL_DIR on $$(PDIR_$(1))/tmp that
indirectly creates the $$(PDIR_$(1)) parent directory.
Fixes: d788ab376f ("build: add APK package build capabilities")
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
This reverts commit cea8507dcc.
This actually cause package pack error on every package outside the
target directory.
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
In implementing APK support it seems a a leftover was never removed that
creates an unused tmp directory in the package feed directory.
Drop it as it's not used anywhere.
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
APK will generate the compressed scripts.tar by default, however we rely
on using TAR support for updating the tarball on the fly and this does not
work when tarball is compressed and will cause the following errors:
staging_dir/host/bin/tar: Cannot update compressed archives
Try /staging_dir/host/bin/tar --help' or
staging_dir/host/bin/tar --usage' for more information.
So, lets simply decompress the scripts.tar.gz before usage and then
compress it after we are done.
Fixes: 5d85657f6d ("apk-tools: implement compression of on-device scripts.tar")
Signed-off-by: Robert Marko <robimarko@gmail.com>
This adds the -Wl,-z,pack-relative-relocs linking options.
This reduces the size of some binaries.
This is only supported on i386, x86_64, aarch64 and loongarch64 in
binutils. This feature is not support for MIPS.
musl libc supports it since version 1.2.4 .
glibc supports it since vesion 2.36.
binutils ld supports it since version 2.38 for x86 and since version
2.43 for LoongArch.
This reduces the size of the armsr default root file system from
5,262,198 bytes to 5,200,950 bytes by 61,248 bytes.
Link: https://github.com/openwrt/openwrt/pull/20679
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Default behavior for apk was to create an uncompressed scripts.tar
file. Due to the structure of tar files, with fixed block
size and null padding, this file becomes very large on OpenWrt
installations where there are typically two scripts per package.
This could cause the raw tar file to easily grow to over 500KB,
whereas the compressed file is generally around 20-30KB.
When stored in the /rom partition of a squashfs device, the file
is compressed and this is not an issue. But, as soon as you add
or delete a package, the scripts.tar file is fully expanded into
the /overlay partition and can cause issues on small-flash devices.
This issue was addressed in an upstream commit by detecting
whether the scripts.tar file is compressed (its name must be
exactly 'scripts.tar.gz'), and then retaining that compression by
reading/writing the file using a compressed stream.
This commit applies a cherrypicked patch for the upstream commit, and
compresses the scripts.tar during construction of the device rootfs.
Fixes: https://github.com/openwrt/openwrt/issues/17108
Link: 012cdcfdf9
Signed-off-by: Eric Fahlgren <ericfahlgren@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/20795
Signed-off-by: Robert Marko <robimarko@gmail.com>
Add support for Python version 3.13 to include/prereq-build.mk.
One of the reasons for this change is that
Ubuntu 25.04 ships with Python 3.13 as default version.
Let's support it.
Signed-off-by: Kacper Ludwinski <kacper@ludwinski.dev>
Link: https://github.com/openwrt/openwrt/pull/20735
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Add MODULES_DIR MACRO for provider useful if the relevant package
require to define the default OpenSSL MODULES_PATH.
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Currently, feeds/base is created as an absolute symlink to $(TOPDIR)/package.
If the OpenWrt source tree is copied to another location for building (while keeping the old tree), the symlink will still point to the package directory in the old tree.
Using a relative symlink ensures that feeds/base always points to the package directory within the current OpenWrt source tree, improving portability and avoiding incorrect links.
Signed-off-by: Andy Chiang <AndyChiang_git@outlook.com>
Link: https://github.com/openwrt/openwrt/pull/20297
Signed-off-by: Robert Marko <robimarko@gmail.com>
In commit 042996b46b compilation of git repos is made to fail when PKG_MIRROR_HASH is not correct.
It looks like it was forgotten that in openwrt there is a posibility to set the PKG_MIRROR_HASH to "skip".
In this case the hash check should not be performed and compilation should continue as expected.
This is especially very usefull when doing local testing and development with git repos.
Signed-off-by: Matthias Franck <matthias.franck@softathome.com>
Link: https://github.com/openwrt/openwrt/pull/20655
Signed-off-by: Robert Marko <robimarko@gmail.com>
According to CMake documentation[1]:
[CMAKE_FIND_ROOT_PATH] is a list of directories that contain the
target environment.
[CMAKE_FIND_ROOT_PATH_MODE_PROGRAM] sets the default behavior for the
find_program command.
In most cases, find_program is used to search for an executable which
will then be executed, e.g. using execute_process or
add_custom_command. So in most cases an executable from the build host
is required, so setting CMAKE_FIND_ROOT_PATH_MODE_PROGRAM to NEVER is
normally preferred.
Since CMAKE_FIND_ROOT_PATH is set to the target staging dir, and the
toolchain root dir, it will find target programs before the host ones.
An example of this problem is if you try to build antiblock from the
packages feed after llvm from the video feeds is built. Antiblock will
search for clang-format, pickup the target version, and fail to build.
Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
[1] https://cmake.org/cmake/help/book/mastering-cmake/chapter/Cross%20Compiling%20With%20CMake.html
Link: https://github.com/openwrt/openwrt/pull/20656
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Add support for _FORTIFY_SOURCE level 3.
This is supported with glibc and with musl libc.
Link: https://github.com/openwrt/openwrt/pull/20313
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
As mkits.sh only generates the relevant DTS for mkimage and is
specific for the building image, we can move it outside the locked
section as it doesn't do any operation that can be used concurrently by
others.
This won't have any real impact but clean the code making it clear what
needs to be protected and what can be executed concurrently.
Link: https://github.com/openwrt/openwrt/pull/20492
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
It's expected the mkits.sh script to generate only the relevant DTS
entry and have all the blob already prepared to use for mkimage.
This is not the case for the RootFS case where the script generates a
.pagesync with the dd command.
To better handle this, drop the dd command and instead error out if the
.pagesync blob is not found if RootFS is used.
Adapt the generic fit build in image-commands.mk to call the dd for
.pagesync right before mkits.sh.
Link: https://github.com/openwrt/openwrt/pull/20492
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
With further investigation it was found a race in generating .itb images
that include a RootFS caused by the mkits.sh and the mkimage.
Due to the fact that mkits.sh generates a .pagesync image of the passed
rootfs, it can happen that, concurrently, mkimage can be called at the
same time mkits.sh is creating another .pagesync for the same rootfs.
This cause mkimage to use an half made rootfs.pagesync creating a
corrupted image.
To address this, also protect the mkimage with the same lock used for
mkits.sh preventing any kind of concurrent usage/generation of the
rootfs.pagesync blob
Fixes: 52cc9d82f1 ("kernel: rework Initramfs locking logic")
Link: https://github.com/openwrt/openwrt/pull/20492
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Rework the package SOURCE entry handling to account for the --root feeds
script feature.
Move the SOURCE entry string manipulation logic outside package-defaults.mk
in package.mk and limit only to non DUMP scenario to not pollute the .mk
too much.
Restructure the previous logic and add a new additional condition.
If we detect the package comes from a feed, replace any feed path that
have the _root prefix to the feed name with the non-root variant (the
feeds script create a symbolic link to it) and point the package SOURCE
entry to what the symbolic link points to.
Example:
Feed link: feeds/base_root/package -> feeds/base
Package: feeds/base_root/package/system/uci -> feeds/base/system/uci
Link: https://github.com/openwrt/openwrt/pull/20459
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
APK, unlike OPKG, can sign individual packages and not just indexes.
Since OpenWrt uses a distributed build infrastructure and only the build
master owns the private keys, signing of individual buildworkers doesn't
work. Right now, each buildworker creates a temporary build key to sign
packages, then transmits the package index to the buildmaster for a
signature.
As a result, all individual packages contain a nonsensical signature,
making them harder to reproduce. This commit removes the individual
package signing.
Since APK requires signatures per default, explicitly allow installation
of unsigned packages during the build process.
The config option here is for historical reasons misleading,
SIGNED_PACKAGES refers to the package index, not the individual
packages.
Signed-off-by: Paul Spooren <mail@aparcar.org>
The package bump to version rc6 incorporates two recent changes, first, the
stored `mtime` honors SOURCE_DATE_EPOCH, making a prior "touch" obsolete.
Secondly the order of files added to created packages is now sorted, improving
reproducibility, too.
Signed-off-by: Paul Spooren <mail@aparcar.org>
Plasma Cloud PAX1800-Lite is a dual-band Wi-Fi 6 router, based on MediaTek
MT7621A + MT79x5D platform.
Specifications:
- SOC: MT7621AT (880 MHz)
- DRAM: DDR3 448 MiB (Nanya NT5CC256M16DP-DI)
- Flash: 2 MiB SPI NOR (S25FL016K) + 128 MB SPI NAND (W25N02KVZEIR)
- Ethernet: 1x 10/100/1000 Mbps (SOC's built-in switch, with PoE+)
- Wi-Fi: 2x2:2 2.4/5 GHz (MT7905DAN + MT7975DN)
(MT7905DAN doesn't support background DFS scan/BT)
- LED: tri-color LED for status (red, blue, green)
- Buttons: 1x (reset)
- Antenna: 4x internal, non-detachable omnidirectional
- UART: 1x 4-pin (2.54 mm pitch, marked as "3V3 G/RX GND W/TX")
- Power: 12 V DC/2 A (DC jack)
MAC addresses:
WAN: 54:9C:27:xx:xx:00 (factory 0x3fff4, device label)
2.4 GHz: 54:9C:27:xx:xx:02 (factory 0x4, device label +2)
5 GHz: 54:9C:27:xx:xx:08 (factory 0xa, device label +8)
Flashing instructions:
======================
Various methods can be used to install the actual image on the flash.
Two easy ones are:
ap51-flash
----------
The tool ap51-flash (https://github.com/ap51-flash/ap51-flash) should be
used to transfer the image to the u-boot when the device boots up.
initramfs from TFTP
-------------------
The serial console (115200 8N1) must be used to access the u-boot shell
during bootup. It can then be used to first boot up the initramfs image
from a TFTP server (here with the IP 192.168.1.21):
setenv serverip 192.168.1.21
setenv ipaddr 192.168.1.1
tftpboot 0x83001000 <filename-of-initramfs-kernel>.bin && bootm $fileaddr
The actual sysupgrade image can then be transferred (on the LAN port) to the
device via
scp <filename-of-squashfs-sysupgrade>.bin root@192.168.1.1:/tmp/
On the device, the sysupgrade must then be started using
sysupgrade -n /tmp/<filename-of-squashfs-sysupgrade>.bin
Signed-off-by: Sven Eckelmann (Plasma Cloud) <se@simonwunderlich.de>
Link: https://github.com/openwrt/openwrt/pull/20152
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
APK kindly stores the mtime of each containing file in created packages,
breaking reproducibility. As a fix, touch all files of the package with the
timestamp of PKGSOURCE_DATE_EPOCH, which contains the timestamp based on the
last package modification.
Over at OPKG, something similar is done by setting mtime in the tar command,
see the `ipkg-build` script.
To tackle this in APK directly, some changes are suggested. However until this
is merged, we should fix it downstream.
https://gitlab.alpinelinux.org/alpine/apk-tools/-/merge_requests/348
Signed-off-by: Paul Spooren <mail@aparcar.org>
Adjust the YAFFS file path written depending on the sysupgrade
filename.
Default to kernel (for ELF), switch to bootimage (for NPK) if image name
has v7.
Signed-off-by: John Thomson <git@johnthomson.fastmail.com.au>
Add build step 'kernel-pack-npk' which uses 'npk_pack_kernel' which is now
part of firmware-utils to enable wrapping the kernel inside a MikroTik NPK
package.
Signed-off-by: John Thomson <git@johnthomson.fastmail.com.au>
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Do not always try to include iwinfo in the images when wpa supplicant or
Broadcom nas is also included. iwinfo is incompatible with current
default configuration.
iwinfo is only build when CONFIG_WIFI_SCRIPTS_UCODE is not set. If
CONFIG_WIFI_SCRIPTS_UCODE is not set kmod-cfg80211 depends on iwinfo,
so it should be included in all images with wifi drivers.
The CONFIG_WIFI_SCRIPTS_UCODE option was recently changed to be active
by default.
This should fix the current buildbot build failures.
This reverts commit 6435b8bb27 ("build: include iwinfo by default
if nas or wpad(-mini) is selected")
Fixes: 04e9929c47 ("wifi-scripts: enable ucode scripts by default")
Link: https://github.com/openwrt/openwrt/pull/20211
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Parsing "git log" is fragile. The actual output depends on both global and
local configuration files. Enabling "log.showSignature" makes "git log" prefix
signed commits with multiple lines of gpg verify output, regardless of the
configured log format.
Add "--no-show-signature" to "git log" commands to work around this particular
issue.
Signed-off-by: Bjørn Mork <bjorn@mork.no>
Link: https://github.com/openwrt/openwrt/pull/20127
Signed-off-by: Robert Marko <robimarko@gmail.com>
Add support so openwrt can be compiled using
coreutils from GNU or uutils.
Signed-off-by: Marcos Alano <marcoshalano@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/19883
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
This commit fixes "aff2f096235 include: make APK .list files reproducible"
since it would create the .list file while `find` still runs. This causes the
.list file to be part of itself. As an alternative, write the file to a
temporary folder first and then move it.
Fix: aff2f09623 include: make APK .list files reproducible
Signed-off-by: Paul Spooren <mail@aparcar.org>
Move append-teltonika-metadata to image-commands.mk and unify over different targets.
This method can be used to create valid "factory" images for most of Teltonika devices.
Signed-off-by: Simonas Tamošaitis <simsasss@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/19401
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Or else we end up with "Entering directory" and "Leaving directory" from make in tmp/.targetinfo
Signed-off-by: Sven Wegener <sven.wegener@stealer.net>
Link: https://github.com/openwrt/openwrt/pull/19326
Signed-off-by: Robert Marko <robimarko@gmail.com>
For the utilities provided by coreutils
but required before coreutils is built,
if coreutils is actually built already, prefer a symlink to
the built versions instead of the host machine's version.
Tested-by: Georgi Valkov <gvalkov@gmail.com> # macOS
Signed-off-by: Michael Pratt <mcpratt@pm.me>
Link: https://github.com/openwrt/openwrt/pull/16522
Signed-off-by: Robert Marko <robimarko@gmail.com>
For targets that install symlinks, like coreutils,
if the links happen to be deleted, let prereq stage
be capable of creating them again with a relative path.
Tested-by: Georgi Valkov <gvalkov@gmail.com> # macOS
Signed-off-by: Michael Pratt <mcpratt@pm.me>
Link: https://github.com/openwrt/openwrt/pull/16522
Signed-off-by: Robert Marko <robimarko@gmail.com>
The wildcard call to clean up luci package (luci*) can pick up over
2,300 files when the full tree is built. Running make package/luci/clean
or a second run of make package/luci/compile would fail with an
'Argument list too long' error.
To avoid that, a maybe_use_xargs function was created that runs the
command straight as usual if the number of arguments is < 512, or saves
the list in a temporary file and feeds it to xargs otherwise.
This is an update to current file names and resubmission of
https://lists.openwrt.org/pipermail/openwrt-devel/2020-February/027525.html
Fixes: https://github.com/openwrt/openwrt/issues/19510
Fixes: https://github.com/openwrt/luci/issues/7869
Authored-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
Signed-off-by: Kuan-Yi Li <kyli@abysm.org>
Signed-off-by: Eric Fahlgren <ericfahlgren@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/19516
Signed-off-by: Nick Hainke <vincent@systemli.org>
Not all targets support power management, some older or more simple
targets don't have CONFIG_PM set. Allow kernel module packages to
depend on USES_PM to only be available on targets which got
CONFIG_PM=y in their kernel config.
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Not all targets have CONFIG_PINCTRL=y set in their kernel config.
Let's introduce a feature for that so kernel module packages which
select or depend on CONFIG_PINCTRL=y may depend on that, so we can
try to prevent leaking CONFIG_PINCTRL=y also into targets which do
not require it.
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Fixes the following build problem on systems with Python 3.12 or 3.13:
Checking 'python3-setuptools'... failed.
Checking 'swig'... ok.
u-boot: Please install the Python3 setuptools module
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
Add dtb support for Build/sysupgrade-tar definition and
sysupgrade-tar.sh script.
This changes are required for updating dtb separately.
Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/16904
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
OpenWrt library packages are often named using their ABI version,
for example 'libubus20250102'. Updates that cause the ABI version
to change result in changes to the package name. This makes it
impossible for downstream tools to determine when a package update
is available without further information.
The opkg package manager stores the ABI version as part of its
package metadata in the ABIVersion field. This makes extraction
of the canonical name of the package possible, allowing various
versions of a package to be associated with one another, their
versions or build dates compared.
We add a custom tag 'openwrt:abiversion=<ABI version>' to the
apk v3 package metadata, restoring the status quo and making it
functionally backwards compatible with opkg (the tag format was
selected per the guidelines in the apk-tools documentation).
Links: 1925de55be
Signed-off-by: Eric Fahlgren <ericfahlgren@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/19082
Signed-off-by: Robert Marko <robimarko@gmail.com>
- pre-install calls preinst
- pre-upgrade calls preinst with PKG_UPGRADE=1
- post-upgrade calls postinst with PKG_UPGRADE=1
- prerm and postrm from the previous version of a package are NOT
executed on upgrade, so packages are expected to handle their own
migrations in the new versions
Link: https://wiki.alpinelinux.org/wiki/Creating_an_Alpine_packageFixes: #18527
Reported-by: Dobroslaw Kijowski <dobo90@gmail.com>
Suggested-by: Eric Fahlgren <ericfahlgren@gmail.com>
Suggested-by: Jonas Gorski <jonas.gorski@gmail.com>
Suggested-by: Thomas Richard <thomas.richard@bootlin.com>
Signed-off-by: George Sapkin <george@sapk.in>
Link: https://github.com/openwrt/openwrt/pull/18531
Signed-off-by: Robert Marko <robimarko@gmail.com>
U-Boot allows specifying additional KConfig fragments to be applied on
top of a defconfig. These are usually located in the board
sub-directory.
make foo_defconfig bar.config baz.config
Add support for specifying additional KConfig fragments using the
UBOOT_CONFIG variable. Treat the first word in UBOOT_CONFIG as the name
of the defconfig, any additional words as additional fragments.
This can be useful to distinguish between different variants of U-Boot
builds such as different RAM, storage (NAND/eMMC), security etc.
While c05c0699d4 (u-boot.mk: add support for config customization,
2023-06-02) already added means to modify specific KConfig options
directly from the OpenWrt Makefile, leveraging existing fragments the
U-Boot source-dir provides a more convenient way to extend the config
when customising more than just one or two options. Furthermore it is
desirable to leverage existing fragments from upstream U-Boot where they
exist.
Signed-off-by: Andreas Gnau <andreas.gnau@iopsys.eu>
Link: https://github.com/openwrt/openwrt/pull/18963
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Perl modules use double-colon naming.
Signed-off-by: Jan Pazdziora <jan.pazdziora@code.adelton.com>
Link: https://github.com/openwrt/openwrt/pull/19047
Signed-off-by: Robert Marko <robimarko@gmail.com>
By enabling multi-threading file reading, the squashfs rootfs build
process can be greatly accelerated. We use 4 as the default thread
number. This is the default value for squashfs4 tool 4.7 if we don't
append "-block-readers" or "-small-readers" options.
For more test results:
https://github.com/plougher/squashfs-tools/blob/4.7/Documentation/4.7/README
Signed-off-by: Shiji Yang <yangshiji66@outlook.com>
Link: https://github.com/openwrt/openwrt/pull/19019
Signed-off-by: Nick Hainke <vincent@systemli.org>
Currently, we are filtering out images if DEFAULT:=n or BROKEN:=y are set,
so if you are building from scratch and want to build custom images that
are stripped down to fit, you must edit the image recipe or its just
filtered out.
So, to allow this behaviour when building from scratch as we can assume
that person doing that knows what they are attempting to do lets just limit
the filtering to ImageBuilder.
Fixes: f060615a78 ("image: respect DEFAULT and BROKEN when Default profile is selected")
Signed-off-by: Robert Marko <robimarko@gmail.com>