This allows an optional tag to be put in the .config file which is
included in the filename of the resulting images, so it's easier to
build images with different functionality for the same target hardware.
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Link: https://github.com/openwrt/openwrt/pull/20984
Signed-off-by: Petr Štetiar <ynezz@true.cz>
Downloading packages from git requires zstd to compress their tarballs.
Make sure that zstd from host tools is compiled when running make
download. Otherwise, either the download would fail because zstd is not
present or a random version from the host would be used leading to hash
mismatches.
Signed-off-by: Andreas Gnau <andreas.gnau@iopsys.eu>
Link: https://github.com/openwrt/openwrt/pull/21125
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Move .quilt_used from kernel-defaults.mk to quilt.mk.
This is done to be consistent with the parallel Build/Patch/Default and
Host/Patch/Default and permit better Quilt handling on any package that
might use Kernel/Patch/Default.
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
This reverts commit 61bfcc4bd7.
The change was wrong as it was placed on the wrong define section.
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Move .quilt_used from kernel-defaults.mk to quilt.mk.
This is done to be consistent with the parallel Build/Patch/Default and
Host/Patch/Default and permit better Quilt handling on any package that
might use Kernel/Patch/Default.
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
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>