Commit Graph

3988 Commits

Author SHA1 Message Date
Jascha Sundaresan
46ab9f3f1c filogic: add support for Netgear EAX17
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>
2025-11-24 00:57:19 +01:00
Nick Hainke
557c174a3c toolchain: gcc: add fanalyzer config option
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>
2025-11-23 09:33:15 +01:00
Christian Marangi
f9802d70c6
package: drop creating spurious tmp directory in feed directory
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>
2025-11-22 10:01:55 +01:00
Christian Marangi
ed4aabf425
Revert "package: drop creating spurious tmp directory in feed directory"
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>
2025-11-22 09:58:26 +01:00
Christian Marangi
cea8507dcc
package: drop creating spurious tmp directory in feed directory
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>
2025-11-21 23:34:02 +01:00
Robert Marko
f4ff823435 include: rootfs: fix APK compressed scripts tarball support
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>
2025-11-19 13:51:04 +01:00
Hauke Mehrtens
a2a78c04f8 build: Add support for linking with DT_RELR
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>
2025-11-18 23:17:09 +01:00
Eric Fahlgren
5d85657f6d apk-tools: implement compression of on-device scripts.tar
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>
2025-11-18 17:25:06 +01:00
Kacper Ludwinski
ba041eb451
prereq-build: add Python 3.13 support
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>
2025-11-12 12:11:15 +01:00
Christian Marangi
b29cf08a1e
openssl: add MODULES_DIR MACRO for provider
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>
2025-11-11 23:58:54 +01:00
Andy Chiang
631d535282 toplevel.mk: use relative path for feeds/base symlink
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>
2025-11-10 15:20:34 +01:00
Matthias Franck
2df73702c5 include: download.mk: do not check PKG_MIRROR_HASH when set to "skip"
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>
2025-11-07 12:25:42 +01:00
Eneas U de Queiroz
e495645135
cmake: set CMAKE_FIND_ROOT_PATH_MODE_PROGRAM=NEVER
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>
2025-11-05 16:57:51 +01:00
Hauke Mehrtens
93f86627c4 build: Add _FORTIFY_SOURCE=3 support
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>
2025-10-26 01:43:01 +02:00
Christian Marangi
5a42ed1138
image: move mkits.sh outside lock section
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>
2025-10-23 18:14:01 +02:00
Christian Marangi
c70894c855
scripts/mkits.sh: move out .pagesync generation for RootFS blob
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>
2025-10-23 18:14:01 +02:00
Christian Marangi
3de1bbd5ae
image: fix race between mkits.sh and mkimage in .itb squashfs generation
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>
2025-10-23 18:14:00 +02:00
Christian Marangi
330d17f52d
build: handle --root feeds script feature
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>
2025-10-20 13:50:15 +02:00
Rosen Penev
df950f4cfd prereq: use staging_dir's compiler
Fixes compilation with missing OS GCC.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/20350
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-10-20 00:55:06 +02:00
Paul Spooren
084697eb62 package: do not sign individual APK packages
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>
2025-10-09 12:52:43 +02:00
Paul Spooren
4bef775c70 packages: bump APK to improve reproducibility
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>
2025-10-08 11:13:33 +02:00
Sven Eckelmann (Plasma Cloud)
c7c54f3134 ramips: add support for Plasma Cloud PAX1800-Lite
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>
2025-10-04 20:30:36 +02:00
Paul Spooren
16416782f1 include: make APK packing mtime reproducible
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>
2025-09-30 14:48:13 +02:00
John Thomson
097049552a image: adapt mikrotik yafut to allow switch to bootimage YAFFS path
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>
2025-09-29 17:34:51 +01:00
John Thomson
f473d15816 build: add Mikrotik NOR RouterBOOT v7 image build
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>
2025-09-29 17:34:51 +01:00
Hauke Mehrtens
878f31c210 build: remove iwinfo dependency
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>
2025-09-27 22:04:57 +02:00
Bjørn Mork
ae9c9d0f8e build: parsing "git log" breaks with gpg signature verification
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>
2025-09-23 21:49:54 +02:00
Marcos Alano
67345ead6c build: Add compatibility with uutils' coreutils
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>
2025-09-08 14:41:38 +02:00
Paul Spooren
44f76177d5 include: make APK .list files even more reproducible
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>
2025-08-27 03:27:55 +02:00
Simonas Tamošaitis
53d8303a79 images: move append-teltonika-metadata to image-commands.mk
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>
2025-08-24 17:52:25 +02:00
Paul Spooren
aff2f09623 include: make APK .list files reproducible
The order may vary between builds, a re-build showed that error locally. Run
`sort` to have this fixed.

Signed-off-by: Paul Spooren <mail@aparcar.org>
2025-08-22 09:05:46 +02:00
Felix Fietkau
042996b46b build: stricter hash validation on download
Check the hash after packing the checkout and fail the build if it
does not match.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2025-08-02 16:41:08 +02:00
Sven Wegener
2684fe31d0 build: use --no-print-directory for dumping subtargets
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>
2025-07-30 23:31:26 +02:00
Michael Pratt
f197b5827a prereq: prefer existing built coreutils as symlink target
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>
2025-07-26 14:38:08 +02:00
Michael Pratt
660e398f92 prereq: add support for creating relative symlinks
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>
2025-07-26 14:38:08 +02:00
Eric Fahlgren
ac9a97e49b build: call ipkg-remove using xargs if #args>=512
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>
2025-07-25 08:41:27 +02:00
Daniel Golle
85f27367ea targets: add USES_PM auto-feature
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>
2025-07-20 12:16:13 +01:00
Daniel Golle
801529f725 targets: add PINCTRL_SUPPORT auto-feature
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>
2025-07-19 13:54:22 +01:00
Felix Fietkau
642d568b0f build: fix ipkg-remove: add support for removing apk files
Use apk adbdump to extract metadata from .apk files to derive the real
package name.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2025-07-15 20:48:45 +02:00
Felix Fietkau
5adc663af6 image: only calculate EROFS_PCLUSTERSIZE when needed
Fixes shell warning on any makefile including image.mk when EROFS
is not enabled

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2025-07-06 10:32:44 +02:00
Gao Xiang
f7fa414d3b
image: add support for EROFS rootfs image generation
Add support for generating EROFS rootfs images.

The EROFS filesystem can offer competitive I/O performance while
minimizing final image size when using the MicroLZMA compressor.

Target platform: linux-x86_generic (target-i386_pentium4_musl)

Filesystem     Image Size
=============  ==========
root.erofs     4882432
root.ext4      109051904
root.squashfs  4903302

Co-Developed-by: Gao Xiang <hsiangkao@linux.alibaba.com>
Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
Link: https://github.com/openwrt/openwrt/pull/19244
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2025-07-05 15:24:54 +02:00
Stijn Tintel
9105c2d568 u-boot.mk: support Python 3.12 and 3.13
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>
2025-07-01 20:07:46 +03:00
Ondrej Cierny
d4d5fbd375 download: improve rawgit tar reliability
Packages that depend on rawgit can fail on systems with the tar UID
issue (https://bugzilla.redhat.com/show_bug.cgi?id=913406).
Fix this by adding tar flags to overwrite UID/GID, as in the
dl_tar_pack method.

Signed-off-by: Ondrej Cierny <o.cierny@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/19243
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-06-30 10:39:05 +02:00
INAGAKI Hiroshi
4392d1a92b build: add dtb support for sysupgrade-tar
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>
2025-06-22 22:17:20 +02:00
Eric Fahlgren
a61a2a9291 package: include abiversion tag in package metadata
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>
2025-06-22 11:41:23 +02:00
George Sapkin
03880e2551 include/package-pack: add missing apk package lifecycle events
- 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_package
Fixes: #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>
2025-06-13 10:46:16 +02:00
Andreas Gnau
49843b31bc uboot-mk: Enable specifying defconfig fragments
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>
2025-06-07 21:10:28 +02:00
Jan Pazdziora
2f741ab8b1 prereq-build: fix typo on the IPC::Cmd module message
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>
2025-06-07 15:24:06 +02:00
Shiji Yang
a9972ae53e build: image: support specifying mksquashfs4 parallel threads
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>
2025-06-05 21:28:03 +02:00
Robert Marko
d0d1f19068 image: only filter out images when ImageBuilder is used
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>
2025-05-24 12:24:48 +02:00