Move Build/buffalo-trx to image-commands.mk from image/mt7622.mk to use
that definition from ramips as well.
Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
Since the Yafut tool is now used for both updating the kernel on
MikroTik devices with NAND flash and preparing firmware images for
MikroTik devices with NOR flash, remove the kernel2minor utility from
the tree as it is no longer used for anything.
Signed-off-by: Michał Kępień <openwrt@kempniu.pl>
Link: https://github.com/openwrt/openwrt/pull/13453
Signed-off-by: Robert Marko <robimarko@gmail.com>
The Yafut tool now has limited capabilities for working on filesystem
images stored in regular files. This enables preparing Yaffs2 images
for devices with NOR flash using upstream Yaffs2 filesystem code instead
of the custom kernel2minor tool.
Since minimizing the size of the resulting filesystem image size is
important and upstream Yaffs2 code requires two allocator reserve blocks
to be available when writing a file to the filesystem, a trick is
employed while preparing an OpenWRT image: the blank filesystem image
that Yafut operates on initially contains two extra erase blocks that
are chopped off after the kernel file is written. This is safe to do
because Yaffs2 has a true log structure and therefore only ever writes
sequentially (and the size of the kernel file is known beforehand).
While the two extra erase blocks are necessary for writes, Yaffs2 code
seems to be perfectly capable of reading back files from a "truncated"
filesystem that does not contain these extra erase blocks.
In terms of image size, this new approach is only marginally worse than
the current kernel2minor-based one: specifically, upstream Yaffs2 code
needs to write three object headers (each of which takes up an entire
data chunk) when the kernel file is written to the filesystem:
- an object header for the kernel file when it is created,
- an object header for the root directory when the kernel file is
created,
- an updated object header for the kernel file when the latter is
fully written (so that its new size can be recorded).
kernel2minor only writes two of these headers, which is the absolute
minimum required for reading the file back. This means that the
Yafut-based approach causes firmware images to be at most one erase
block (64 kB) larger than those created using kernel2minor, but only in
the very unfortunate scenario where the size of the kernel file is
really close to a multiple of the erase block size.
The rest of the calculations performed when the empty filesystem image
is first prepared stems from the Yaffs2 layout used by MikroTik NOR
devices: each 65,536-byte erase block contains 63 chunks, each of which
consists of 1024 bytes of data followed by 16-byte Yaffs tags without
ECC data; each such group of 63 chunks is then followed by 16 bytes of
padding, which translates to "-C 1040 -B 64k -E" in the Yafut
invocation. Yaffs2 checkpoints and summaries are disabled (using
Yafut's -P and -S switches, respectively) as they are merely performance
optimizations that require extra storage space. The -L and -M switches
are used to force little-endian or big-endian byte order (respectively)
in the resulting filesystem image, no matter what byte order the build
host uses. The tr invocation is used to ensure that the filesystem
image is initialized with 0xFF bytes (which are an indicator of unused
space for Yaffs2 code).
Signed-off-by: Michał Kępień <openwrt@kempniu.pl>
Link: https://github.com/openwrt/openwrt/pull/13453
Signed-off-by: Robert Marko <robimarko@gmail.com>
We currently skip defining Host/Prepare/Default if HOST_UNPACK is not
defined.
This is mostly the case for Host packages that just provide files with
the src directory and don't need to be downloaded/extracted.
This was probably done lots of times ago due to quilt causing error as
the patches directory wasn't present.
This has changed now and quilt can correctly detect if no patches needs
to be applied (instead of terminating with error)
Always define Host/Prepare/Default to make tools/refresh correctly works
as HOST_QUILT is hardcoded enabled for this make target and will
complain for tool not prepared for quilt patches.
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Since we set the root for APK it tries to use those during the build,
which shouldn't happen since local package are used instead.
Disable the repositories by manually setting an empty repository.
Signed-off-by: Paul Spooren <mail@aparcar.org>
Skip removal of APK cache since now deprecated as APK doesn't make use
of cache anymore in our configuration.
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Due to missing quotes the script would wrongly assume APK to be enabled
and don't run post install scripts, breaking pretty much everything.
Signed-off-by: Paul Spooren <mail@aparcar.org>
A new option called `USE_APK` is added which generated APK packages
(.apk) instead of OPKG packages (.ipk).
Some features like fstools `snapshot` command are not yet ported
Signed-off-by: Paul Spooren <mail@aparcar.org>
include-prefixes were moved to a common directory in linux v4.12, see
d5d332d3f7
This is needed for bcm27xx kernel v6.6 support.
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
The needed file '.packageinfo' for creating the CycloneDX SBOM in the
imagebuilder is available in the top directory of the imagebuilder and
not in the tmp directory.
For this reason, the creation of the CycloneDX SBOM file is not available
for the imagebuilder.
To fix this, it is now first checked whether the CycloneDX SBOM should be
built at all and then second decided by checking the IB variable where the
'.packageinfo' file is to be found.
With this change, it is now possible to create the CycloneDX SBOM also for
the imagebuilder as well.
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
This is an artifact and is not needed. We have already set the
information 'Maintainer:' in the '.packageinfo-*' files.
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
Add target for Loongson LoongArch64-based boards.
LoongArch is a new RISC ISA developed by Loongson. It's a bit like
MIPS or RISC-V. LoongArch includes both 32-bit and 64-bit versions
(LoongArch32/LoongArch64).
Loongson 3A5000 and 3A6000 are the two existing CPUs of LoongArch64
and is used for PC products. It's BIOS supports ACPI and UEFI-only
boot. These CPUs supports SMP and SMT.
At present only LoongArch64 is supported by linux kernel.
Toolchain requirement:
binutils >= 2.40
gcc >= 13.1
For details, please check the following links:
https://lwn.net/Articles/861951/https://loongson.github.io/LoongArch-Documentation/README-EN.html
Signed-off-by: Weijie Gao <hackpascal@gmail.com>
Commit d82c5884c6 ("treewide: make use of new toolchain define")
changed $(TOOLCHAIN_DIR)/include to the new variable
$(TOOLCHAIN_INC_DIRS) that now can contain multiple entry.
Because of this only the first include in $(TOOLCHAIN_INC_DIRS) was
actually included with -isystem, making the other producing warning with
ignored inputs.
Fix this by parsing each entry in $(TOOLCHAIN_INC_DIRS) and adding the
-isystem prefix to correctly include them in the BPF_KERNEL_INCLUDE.
Fixes: d82c5884c6 ("treewide: make use of new toolchain define")
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
In package-defaults.mk the VERSION variable contains the final package
version, which is a combination of `PKG_VERSION`, `PKG_RELEASE` and if
used, parameters of `PKG_SOURCE_VERSION`. While this works fine for
building, within the package Makefile the content VERSION varies:
When building a package from a release tarball, the content of VERSION
contains the actual package version, however when building from source
(i.e. Git), the VERSION is overwritten by `PKG_SOURCE_VERSION`.
To fix the overwrite, this commit switches from `VERSION` in download.mk
to `SOURCE_VERSION` which isn't used anywhere else yet.
As a result, Makefiles may pass the package version to be included
inside the binary.
Signed-off-by: Paul Spooren <mail@aparcar.org>
A funny bug was discovered where if the buildroot's path
has the name of the build target within it, it will also be substituted
along with the stampfile's name for each program,
causing an attempt to touch a file in a directory that doesn't exist.
...
...
touch: cannot touch '/Volumes/touch/openwrt/staging_dir/host/stamp/.touch_installed': No such file or directory
touch: cannot touch '/Volumes/ln/openwrt/staging_dir/host/stamp/.ln_installed': No such file or directory
touch: cannot touch '/Volumes/chown/openwrt/staging_dir/host/stamp/.chown_installed': No such file or directory
make[2]: *** [Makefile:50: /Volumes/coreutils/openwrt/staging_dir/host/stamp/.coreutils_installed] Error 1
...
...
Split up the path with $(dir) and $(notdir) before substitution to fix
the syntax.
Reported-by: Georgi Valkov <gvalkov@gmail.com>
Tested-by: Georgi Valkov <gvalkov@gmail.com> # MacOS
Signed-off-by: Michael Pratt <mcpratt@pm.me>
Signed-off-by: Tony Ambardar <itugrok@yahoo.com>
Historically it's possible to leave the `SUBTARGETS` undefined and
automatically fallback to a "generic" subtarget. This however breaks
various downstream scripts which may have expectations around filenames:
While some targets with an explicit generic subtarget contain `generic`
in the filenames of artifacts, implicit "subtargets" don't.
Right now this breaks the CI[1], possibly also scripts using the ImageBuilders.
This commit removes all code that support implicit handling of
subtargets and instead requires every target to define "SUBTARGETS".
[1]: https://github.com/openwrt/openwrt/actions/runs/8592821105/job/23548273630
Signed-off-by: Paul Spooren <mail@aparcar.org>
The compression is faster to (un)pack files, make use of it.
Also add a new build prerequirement, the `zstd` to (un)pack files.
Signed-off-by: Paul Spooren <mail@aparcar.org>
[ improve commit title ]
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
This fix a long lasting bug/inconsistency with rawgit method and
dl_github_archive script.
The dl_github_archive script works by using the github generated tar.gz
instead of cloning and checkout and the tar.gz is generated by using git
archive command that parse and apply .gitattributes rules.
rawgit command never handled .gitattributes and instead made a simple git
clone and checkout causing the inconsistency.
To fix the inconsistency, add extra steps to call git archive command
and generate an intermediate tar to apply .gitattributes rules.
Also for git log format, Github shorthash length is 8 instead of the
default 7, also apply this locally for each cloned repo to produce
consistent tar.
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
The recovery image is reqired for D-Link M30 as well. So I moved it to include/image-commands.mk to be able to use it for MT7622 and filogic devices.
Signed-off-by: Roland Reinl <reinlroland+github@gmail.com>
Host packages typically are statically linked to avoid rpath issues and
to avoid libraries not being found as a result. With target packages,
both libraries make the most sense as InstallDev typically installs
both, giving packages flexibility. Default this behavior.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
Different from OPKG, APK uses a deterministic version schema which chips
the version into chunks and compares them individually. This enforces a
certain schema which was previously entirely flexible.
- Releases are added at the very and end prefixed with an `r` like
`1.2.3-r3`.
- Hashes are prefixed with a `~` like `1.2.3~abc123`.
- Dates become semantic versions, like `2024.04.01`
- Extra tags are possible like `_git`, `_alpha` and more.
For full details see the APK test list:
https://gitlab.alpinelinux.org/alpine/apk-tools/-/blob/master/test/version.data
Signed-off-by: Paul Spooren <mail@aparcar.org>
hostpkg python from packages feed can be picked when do a incremental
build because hostpkg has higher priority in PATH. It may lead build
faliure as it's heavily trimmed (e.g. lacks necessary modules).
For uboot which uses binman and intree dtc, this is forced as hostpkg
python will never provide those modules by default.
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
This reverts commit c42b915af0.
Now that rpcd uses the 'Auto-Installed' field to differentiate between
deliberately and implicitely installed packages we can remove the
hotfix.
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Commit be9023ed43 ("build: fix opkg flags in rootfs") introduced a
call to 'awk' which removes the 'user' flag from all installed
packages in the opkg status file. While is is somehow desireable when
building images directly within the buildroot, when using the
ImageBuilder dropping the 'user' flag means loosing information about
a package being deliberately selected or just implicitely pulled as a
dependency. And that then break tools like 'auc' which request only
packages having the 'user' flag from the asu server, resulting in
broken images being delivered to users.
Restore the original behavior in case of an image being created using
the ImageBuilder.
Fixes: be9023ed43 ("build: fix opkg flags in rootfs")
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Building a package in the build system or the SDK results in different
values for the `SOURCE` property, it's either `packages/<package name>`
or `feeds/base/<package name>`. The reason is that the SDK handles
`openwrt.git` as an external feed called while the build system contains
the *base* packages directly.
Since packages created with either method are (ideally) the same (bit
for bit), align the content of SOURCE. To do so this commit creates a
symlink from `feeds/base` to `$(TOPDIR)/package` and adopts the SOURCE
when building from inside the build system.
Signed-off-by: Paul Spooren <mail@aparcar.org>
Let ubinize-image append the ubinized image to the existing image
instead of replacing it.
Fixes: 6c17d71973 ("scripts: ubinize-image.sh: support static volumes, make size optional")
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
By default opkg sets the "user" flag when a package is installed,
which resulted in most packages in the rootfs having this flag
set incorrectly. This patch removes the "user" flag from all
installed packages when preparing the rootfs image.
Fixes: #14427
Signed-off-by: Justin Klaassen <justin@tidylabs.app>
Make sure ubinize-image.sh also works with more simple POSIX Shell and
allow creating complete custom images to be used as ARTIFACT/foo.img
and thereby allow including uImage.FIT, TF-A FIP and what ever else
is required on a specific board.
Fixes: 6c17d71973 ("scripts: ubinize-image.sh: support static volumes, make size optional")
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
In order to support devices having TF-A FIP image or UBI-aware U-Boot
SPL we need to include a static volume for the bootloader.
Introduce support for adding additional static volumes by prefixing
the filename with ':', eg.
UBINIZE_PARTS := fip:=$(STAGING_DIR_IMAGE)/u-boot.fip
Also add support for rootfs-in-uImage.FIT setups which don't require a
rootfs partition and make the (3rd) size parameter in UBINIZE_PARTS
optional (see example above without declared size).
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
This reverts commit 131e41614d.
Sadly it makes menuconfig fail with
tmp/.config-package.in:171: glob failed: No files found "feeds/base/utils/busybox/Config.in"
make: *** [/usr/src/openwrt/include/toplevel.mk:136: menuconfig] Error 1
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Building a package in the build system or the SDK results in different
values for the `SOURCE` property, it's either `packages/<package name>`
or `feeds/base/<package name>`. The reason is that the SDK handles
`openwrt.git` as an external feed called while the build system contains
the *base* packages directly.
Since packages created with either method are (ideally) the same (bit
for bit), align the content of SOURCE. To do so this commit creates a
symlink from `feeds/base` to `$(TOPDIR)/package` and adopts the SOURCE
when building from inside the build system.
Signed-off-by: Paul Spooren <mail@aparcar.org>
Add support for compiling DTS for the selected target. This can be
useful for testing if the DTS correctly compile and doesn't produce any
error.
This adds a new make target. To compile only DTS use:
make target/linux/dtb
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
The GCC option -fstack-protector-all is a security feature used to protect against stack-smashing attacks.
This option enhances the stack-smashing protection provided by -fstack-protector-strong.
-fstack-protector-all option applies stack protection to all functions, regardless of their characteristics.
While this offers the most comprehensive protection against stack-smashing attacks, it can significantly impact
the performance of the program because every function call includes additional checks for stack integrity.
This option can incur a performance penalty because of the extra checks added to every function call,
but it significantly enhances security, making it harder for attackers to exploit buffer overflows to execute arbitrary code.
It's particularly useful in scenarios where security is paramount and performance trade-offs are acceptable.
Signed-off-by: Cedric DOURLENT <cedric.dourlent@softathome.com>
Using PKG_URL one may set the URL for all sub packages, which is usually
shared anyway. Future packages should only use PKG_URL instead of adding
it per sub-package.
Signed-off-by: Paul Spooren <mail@aparcar.org>
The manifest should provide as much information as possible about the
package, including the project URL. With this commit the URL is stored
as it's own attribute instead of at the end of the description.
Signed-off-by: Paul Spooren <mail@aparcar.org>
Previous commits installed non-elf files into /lib/modules/$VER/.
COLLECT_KERNEL_DEBUG tries to strip all files and these two files
break the build.
Fix it by copying only kernel modules for debug info collection.
Fixes: e1d8e57614 ("kernel: include modinfo for built-in modules")
Fixes: 29f6da4340 ("kernel: include built-in module list")
Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
Partially revert changes to verbose logging that break the 'check' target
dependencies and trigger many runtime warnings like:
/home/kodidev/openwrt-project/include/toplevel.mk:213: *** mixed implicit and normal rules: deprecated syntax
Fixes: e4a43cda0 ("build: allow var.% targets to bypass the prepare steps")
Signed-off-by: Tony Ambardar <itugrok@yahoo.com>
In order to pass a status message at runtime,
which is usually listing subtargets
of a Makefile target or an error message,
from a child invocation of Make (submake)
through the parent process to the terminal,
the file descriptors 8 and 9 are opened to be used
by the functions MESSAGE and ERROR_MESSAGE.
However, there are situations where those functions
can be called while not in a submake or a subshell
or a child process which results in a shell error:
/bin/bash: 8: Bad file descriptor
Commit aee3594ffc
("verbose.mk: print ERROR messages in non-verbose")
has exposed this issue to more cases, but it is not the root cause.
To solve this, use the exit code of the first printf attempt
to the alternative file descriptors in order to tell whether
the standard file descriptors need to be used instead.
In order to get rid of the "Bad file descriptor" error, stderr is
redirected to null after grouping the two printf alternatives
into one command to combine outputs.
For ERROR_MESSAGE, the real message is redirected to stderr
after redirecting the error from the attempted printing to null.
For MESSAGE, without redirection, the Make function "shell"
will absorb the actual message from stdout and input the value into the Makefile,
therefore the dummy variable "_NULL", previously used merely for causing
a call to the MESSAGE function to trigger without writing target rules,
now has and a real value when defined, so rename it to "_MESSAGE"
as a placeholder for the real message when the output should be stdout.
When "_MESSAGE" has a value, use Make function "info" to
finally bring it from the Makefile to the terminal.
This also fixes what is likely a typo, in that
while file descriptor 9 is meant to redirect to stderr
for use in error messages like in the function ERROR_MESSAGE,
that function has printf redirecting to file descriptor 8 instead.
Fixes: a4c8d4e37 ("build: make the color of the 'configuration out of sync' warning red")
Signed-off-by: Michael Pratt <mcpratt@pm.me>
These targets are used to input variable values from the Make
context into other things like python scripts, so log messages
should be silenced and build prerequisites should be skipped.
The same thing is done for the other variable print target "val.%".
While at it, combine identical target rules into one definition.
Signed-off-by: Michael Pratt <mcpratt@pm.me>
Many NAND devices use a build recipe with "append-ubi | check-size" to
ensure factory images don't exceed the target flash partition size.
However, UBI reserves space for bad block handling and other operational
overhead, and thus 'check-size' can overestimate the space available by
several MB. In practice, this means a failed check is definitely a failure,
while a passing check is only probably a pass.
Improve the situation by teaching 'Build/append-ubi' to check image sizes
while accounting for UBI reserved blocks. Add new device variable NAND_SIZE
and use with existing IMAGE_SIZE to derate the available space. Each UBI
device reserves 20 PEBs per 1024 PEBs of the entire NAND device for bad
blocks, plus an additional 4 PEBs overhead.
Many devices can transparently enable this check by setting NAND_SIZE based
on their flash storage, and may then remove any unneeded 'check-size'.
Link: http://www.linux-mtd.infradead.org/doc/ubi.html#L_overhead
Suggested-by: Shiji Yang <yangshiji66@qq.com>
Suggested-by: Robert Marko <robimarko@gmail.com>
Signed-off-by: Tony Ambardar <itugrok@yahoo.com>
Current factory image sizes for Linksys devices are 256-byte aligned. This
is not an issue writing factory images from the OpenWrt or Linksys GUIs,
but can lead to failures using a TFTP client from the Linksys bootloader:
NAND write: device 1 offset 0x2800000, size 0xc00100
Attempt to write to non page aligned data
NAND write to offset 2800000 failed -22
0 bytes written: ERROR
Simplify Linksys footer creation by migrating to a makefile build recipe,
and pre-pad the footer (with 0xFF) to ensure the final image is $(PAGESIZE)
aligned. Finally, remove the old linksys-image.sh script no longer needed.
Linksys footer details are given below for future reference. The 256-byte
footer is appended to factory images and tested by both the Linksys
Upgrader (observed in EA6350v3) and OpenWrt sysupgrade.
Footer format:
.LINKSYS. Checked by Linksys upgrader before continuing. (9 bytes)
<VERSION> Upgrade version number, unchecked so arbitrary. (8 bytes)
<TYPE> Model of device, space padded (0x20). (15 bytes)
<CRC> CRC checksum of factory image to flash. (8 bytes)
<padding> Padding ('0' + 0x20 * 7) (8 bytes)
<signature> Signature of signer, unchecked so arbitrary. (16 bytes)
<padding> Padding with nulls (0x00) (192 bytes)
Link: https://github.com/openwrt/openwrt/pull/11405#issuecomment-1358510123
Link: https://github.com/openwrt/openwrt/pull/11405#issuecomment-1587517739
Reported-by: Stijn Segers <foss@volatilesystems.org>
Reported-by: Wyatt Martin <wawowl@gmail.com>
Signed-off-by: Tony Ambardar <itugrok@yahoo.com>
Add the make function 'exp_units' for helping evaluate k/m/g size units in
expressions, and use this to consistently replace many ad hoc substitutions
like '$(subst k,* 1024,$(subst m, * 1024k,$(IMAGE_SIZE)))' in makefiles.
Signed-off-by: Tony Ambardar <itugrok@yahoo.com>
Some patched u-boots may have problems with parallel build.
Do not enforce parallel build here so one can set PKG_BUILD_PARALLEL:=0
in the specific u-boot Makefile also before including the u-boot.mk.
Signed-off-by: Martin Schiller <ms@dev.tdt.de>
This reverts commit 7ceb76ca3a.
Python 3.12 removes the distutils package and is therefore not
compatible. We have to check downstream what relies on distutils before
adding actual support for Python 3.12. Sorry for the noise.
With this in-place, the macOS CI job fails and turns things red, revert
for now.
Signed-off-by: Paul Spooren <mail@aparcar.org>
creates SGE encrypted factory images
to use via the D-Link web interface
rename the old factory unencrypted images to recovery
for use in the recovery console when recovery is needed
DIR-1935-A1 , DIR-853-A1 , DIR-853-A3 , DIR-867-A1 ,
DIR-878-A1 and DIR-882-A1
Signed-off-by: Alan Luck <luckyhome2008@gmail.com>
Changes introduced in commit d604a07225 ("build: add CycloneDX SBOM
JSON support") broke ImageBuilder:
Cannot open '/openwrt-imagebuilder-ath79-generic.Linux-x86_64/tmp/.packageinfo': No such file or directory
So lets fix it by wrapping the BOM generation behind condition of IB
feature check.
Fixes: #13881
Fixes: d604a07225 ("build: add CycloneDX SBOM JSON support")
Signed-off-by: Petr Štetiar <ynezz@true.cz>
`true` might be a shell built-in, or simply not accessible in the hardcoded locations.
Replace it with a custom script that does nothing.
Signed-off-by: Ilya Katsnelson <me@0upti.me>
CycloneDX is an open source standard developed by the OWASP foundation.
It supports a wide range of development ecosystems, a comprehensive set
of use cases, and focuses on automation, ease of adoption, and
progressive enhancement of SBOMs (Software Bill Of Materials) throughout
build pipelines.
So lets add support for CycloneDX SBOM for packages and images
manifests.
Signed-off-by: Petr Štetiar <ynezz@true.cz>
There is no standard for ABI versioning, so its not possible to find out
from `libext2fs2`, `libiwinfo20230701` or `libss2` package names if
thats just package name or package name with ABI version included. To
help with the decision, lets make ABI version aviable in package index.
Signed-off-by: Petr Štetiar <ynezz@true.cz>
Common Platform Enumeration (CPE) is a structured naming scheme for
information technology systems, software, and packages.
In order for the information to be processed further, it should also be
available in package index files.
Signed-off-by: Petr Štetiar <ynezz@true.cz>
Kernel module packages compiling is not cached (e.g. mac80211)
even with CONFIG_CCACHE on.
CC should be set to KERNEL_CC in KERNEL_MAKE_FLAGS at kernel.mk
to allow kernel module packages using ccache.
Signed-off-by: Zeyu Dong <dzy201415@gmail.com>
Make use of new toolchain define. TOOLCHAIN_DIR should be used only for
toolchain related packages and for everything else TOOLCHAIN_ROOT_DIR
and other define should be used instead.
Switch to new entry where possible.
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
The current code fails if we have package or host tools with no patches
to apply. The error printend is the following: (taking ubus as an
example)
make[2]: Entering directory '/home/ansuel/openwrt-ansuel/openwrt/scripts/config'
make[2]: 'conf' is up to date.
make[2]: Leaving directory '/home/ansuel/openwrt-ansuel/openwrt/scripts/config'
make[1]: Entering directory '/home/ansuel/openwrt-ansuel/openwrt'
make[2]: Entering directory '/home/ansuel/openwrt-ansuel/openwrt/package/system/ubus'
The source directory contains no quilt patches.
make[2]: *** [Makefile:81: quilt-check] Error 1
make[2]: Leaving directory '/home/ansuel/openwrt-ansuel/openwrt/package/system/ubus'
time: package/system/ubus/refresh#0.06#0.00#0.07
ERROR: package/system/ubus failed to build.
make[1]: *** [package/Makefile:120: package/system/ubus/refresh] Error 1
make[1]: Leaving directory '/home/ansuel/openwrt-ansuel/openwrt'
make: *** [/home/ansuel/openwrt-ansuel/openwrt/include/toplevel.mk:232: package/ubus/refresh] Error 2
We exit 1 after saying that there are no patches because later in the
function quilt pop fails to execute.
Having no patches for a package and calling refresh should not be
a critical error and the function should just do nothing.
To handle this improve quilt.mk with the following addition.
- If we don't have any patch for the package, we print a warning and we
create an empty series. This is useful to trick quilt and make it do
nothing.
We also create a status file .quilt_no_patch to detect in the other
function that we don't have patches to handle.
- In refresh makefile target, we check if .quilt_no_patch exist and
we skip quilt cleanup if this exist.
- In RefreshDir function we change the logic and now we delete the
patches directory and not only the content. This is done as a cleanup
to clean case with empty patches directory.
- In RefreshDir we check if .quilt_no_patch exist and we skip creating
the patches directory and copying the refreshed patches.
- In RefreshDir we delete at the end any trace of .quilt_no_patch if
present.
This is needed to support run like package/refresh that will run the
refresh process on any package present in the buildroot.
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
To better reference them for diagnostic use, reference the PATCH_DIR and
FILES_DIR with the absolute path instead of using ./ and reference by
the relative location.
No behaviour change intended.
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
When cmake is invoked to build a package it usually reports a warning
about unused variables passed to it. This is caused by openwrt passing
all supported variables to cmake, even if they are not all required by
the package being compiled.
To reduce clutter when compiling such packages these warnings are now
suppressed.
Approved-by: Rosen Penev <rosenp@gmail.com>
Reviewed-by: Robert Marko <robimarko@gmail.com>
Signed-off-by: Tjalling Hattink <t.hattink@fugro.com>
Currently, the same information is stored at the Packages.manifest in
the 'Package:' variable and also additionally in the 'SourceName:' variable.
So we have for Packages.manifest for strongswan-charon-cmd:
```
Package: strongswan-charon-cmd
Version: 5.9.11-1
SourceName: strongswan-charon-cmd
License: GPL-2.0-or-later
Section: net
```
This is not correct. Several installable packages are built from the same
strongswan source. Therefore it makes more sense that the source name is
really the source name. In this case the it is 'strongswan'.
After this change the Packages.manifest for strongswan-charon-cmd:
```
Package: strongswan-charon-cmd
Version: 5.9.11-1
SourceName: strongswan
License: GPL-2.0-or-later
Section: net
```
In summary. The 'Package' name is the name of the package to be installed
on the target system. The 'SourceName' is the compile unit from which the
package was build from. This must be the same for all installable
packages built from the same compile unit. This commit fixes that.
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
Changelog: https://cdn.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.1.49
All no patches automatically rebased, just update to checksum for new version.
Build system: x86/64
Build-tested: x86/64/AMD Cezanne
Run-tested: x86/64/AMD Cezanne
Signed-off-by: John Audia <therealgraysky@proton.me>
Changelog: https://cdn.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.1.48
No patches changed in this bump, only update was to checksum.
Build system: x86/64
Build-tested: x86/64/AMD Cezanne, filogic/xiaomi_redmi-router-ax6000-ubootmod
Run-tested: x86/64/AMD Cezanne, filogic/xiaomi_redmi-router-ax6000-ubootmod
Signed-off-by: John Audia <therealgraysky@proton.me>
Now that most cases do the same thing in SetupHostCommand, merge them
together into one. To allow moving the generic symlink check, invert the
check and let it check for relative links by matching on link targets
that do not start with a slash.
This then allows us to also drop the absolute link case, shortening the
case statement further.
This reorders the check to
* if it is not a symlink, do not change it
* if it is a symlink and it points to the found command, do not change it
* if it is a symlink with a relative path, do not change it
* else, update/replace it
Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
To avoid replacing host built binaries with symlinks again, a check for
an appropriate stamp was added in 729909c07f ("prereq-build: do not
replace binaries with symlinks"). Unfortunately the stamp directory does
not exist in the SDK, so the fix was ineffective there.
This caused the packages builders to e.g. use the host tar again, which
in turn made the tarballs created different since it may lack
reproducibility fixes, or implement these differently, causing spurious
hash failures on source repository based packages.
Fix this by dropping the stamp dir check, and just check that the file
is usable.
Fixes: 729909c07f ("prereq-build: do not replace binaries with symlinks")
Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
The current minimum OS requirement for OpenWrt is Ubuntu 18.04, which
includes 7 and 8. 8 is necessary for ccache.
gcc and g+++ are now symlinked to staging_dir, similar to Python.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
Currently the git protocol downloads all submodules of the target
repository. This can be unwieldy for repositories with a lot of submodules
where only a subset are required in the context of the OpenWrt build.
This change adds a PKG_SOURCE_SUBMODULES variable to configure this
behavior. It takes a space-separated list of submodule paths, or the word
"skip" to disable submodule downloads entirely. The default is to download
all submodules, i.e. preserving current behavior.
Signed-off-by: Karsten Sperling <ksperling@apple.com>
Stable kernel git log:
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/log/?h=v6.1.38
No patches needed to be rebased. Just updated checksum.
Build system: x86_64
Build-tested: x86_64/AMD Ryzen 7
Run-tested: x86_64/AMD Ryzen 7
Signed-off-by: John Audia <therealgraysky@proton.me>
[add link to stable kernel git log]
Signed-off-by: Nick Hainke <vincent@systemli.org>
Manually rebased:
generic/hack-6.1/220-arm-gc_sections.patch
armsr/patches-6.1/221-armsr-disable_gc_sections_armv7.patch
All other patches automatically rebased.
Signed-off-by: John Audia <therealgraysky@proton.me>
All patches automatically rebased.
Acknowledgment to @john-tho for the changes to fs.mk to accommodate new paths
introduced in 29429a1f58
Build system: x86_64
Build-tested: bcm2711/RPi4B
Run-tested: bcm2711/RPi4B
Signed-off-by: John Audia <therealgraysky@proton.me>
If CONFIG_USE_MOLD is set, all target packages will use the mold linker.
Except the ones which opted-out via setting PKG_BUILD_FLAGS:=no-mold.
Signed-off-by: Andre Heider <a.heider@gmail.com>
If a kernel package was defined where all KCONFIG symbols were dynamic,
and versioned, no FILES would be installed, as the foreach evaluation was
providing the value of the variable defined by the KCONFIG symbol name
including the version test
Fix this by calling the version_filter function on the list of KCONFIG
variable names run through by foreach
Example, kernel 6.1:
KCONFIG:=CONFIG_OLD@lt6.1 CONFIG_NEW@ge6.1
filter-out any KCONFIG settings forced by package:
CONFIG_OLD@lt6.1 CONFIG_NEW@ge6.1
there are dynamic settings, so for each of them,
get the value of the make variable defined by symbol name:
CONFIG_OLD@lt6.1 is not set
CONFIG_NEW@ge6.1 is not set
versus
CONFIG_OLD is not set
CONFIG_NEW=m
test if any of these are m, or y
if yes, install files, otherwise, nothing to install
Signed-off-by: John Thomson <git@johnthomson.fastmail.com.au>
These fields are used for EAX12 and EX6250v2 series, and perhaps other
devices. Compatibility is preserved with the WAX202 and WAX206.
In addition, adds the related vars to DEVICE_VARS so that the variables
work correctly with multiple devices.
References in GPL source:
https://www.downloads.netgear.com/files/GPL/EAX12_EAX11v2_EAX15v2_GPL_V1.0.3.34_src.tar.gz
* tools/imgencoder/src/gj_enc.c
Contains code that generates the encrypted image.
Signed-off-by: Wenli Looi <wlooi@ucalgary.ca>
Device specifications:
======================
* Qualcomm/Atheros AR9344
* 128 MB of RAM
* 16 MB of SPI NOR flash
* 2x 10/100 Mbps Ethernet
* 2T2R 2.4/5 GHz Wi-Fi
* 4x GPIO-LEDs (1x wifi, 2x ethernet, 1x power)
* 1x GPIO-button (reset)
* 2x fast ethernet
- lan1
+ builtin switch port 1
+ used as WAN interface
- lan2
+ builtin switch port 2
+ used as LAN interface
* 9-30V DC
* external antennas
Flashing instructions:
======================
Log in to https://192.168.127.253/
Username: admin
Password: moxa
Open Maintenance > Firmware Upgrade and install the factory image.
Serial console access:
======================
Connect a RS232-USB converter to the maintenance port.
Pinout: (reset button left) [GND] [NC] [RX] [TX]
Firmware Recovery:
==================
When the WLAN and SYS LEDs are flashing, the device is in recovery mode.
Serial console access is required to proceed with recovery.
Download the original image from MOXA and rename it to 'awk-1137c.rom'.
Set up a TFTP server at 192.168.127.1 and connect to a lan port.
Follow the instructions on the serial console to start the recovery.
Signed-off-by: Maximilian Martin <mm@simonwunderlich.de>
Make it possible to easily customize U-Boot config options via new
`UBOOT_CUSTOMIZE_CONFIG` variable, so we don't need to patch config
files or override config step with shell hackery.
This generic approach uses `config` CLI to tweak the .config as needed,
for example:
UBOOT_CUSTOMIZE_CONFIG := \
--enable CMD_EFIDEBUG \
--enable CMD_BOOTMENU \
--enable AUTOBOOT \
--enable AUTOBOOT_MENU_SHOW \
--disable AUTOBOOT_KEYED \
--disable AUTOBOOT_USE_MENUKEY \
--disable BOOTMENU_DISABLE_UBOOT_CONSOLE \
--set-val BOOTDELAY 2
Signed-off-by: Petr Štetiar <ynezz@true.cz>
Handle compiling device tree overlay blobs separate to allow for
overlays being compiled with different parameters, mostly to safe
space.
Allow defining DEVICE_DTC_FLAGS and DEVICE_DTCO_FLAGS as per-device
parameters to be passed to dtc. Previously some boards directly used
DTC_FLAGS in their build recipe which then also affected other boards.
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Instead of generating full config nodes incl. kernel, generate minimal
config nodes for device tree overlays to be applied to the main config.
In this way, multiple device tree overlays can be applied more easily.
While at it change filenames to upstream style, ie. use dtso and dtbo
suffix for device tree overlays.
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Some individual build items install a group of programs
instead of a program matching the name of the build item.
Add support for installing stampfiles for each of the
programs installed by that build item,
which will allow more control and awareness
of what is installed by the rest of the build system,
if, for example, prereq symlink checks are looking
for the same program which is built already.
Signed-off-by: Michael Pratt <mcpratt@pm.me>
Some programs installed to staging_dir/host/bin
also install some symlinks to itself
for an alternative name.
Some of those new symlinks are overwriting
symlinks that were installed by prereq stage.
If prereq stage were to somehow be run again,
it should not be overwriting symlinks
that point to programs that are already built.
To filter that out, catch all symlinks
after first catching all symlinks
that have an absolute target
after all other cases in the case statement,
make sure it is not broken, and if so exit successfully.
Suggested-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
Signed-off-by: Michael Pratt <mcpratt@pm.me>
Some programs, like bash and patch, are checked by prereq stage
and have a symlink installed, but then is later built from source.
Now that the prereq-build checks are not successful
just by finding the file alone, it is possible for
a new symlink to overwrite the installed binary.
If a normal file is found in staging_dir/host/bin,
let the check look for the associated stampfile, and if found,
skip creation of a symlink and exit successfully.
Suggested-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
Signed-off-by: Michael Pratt <mcpratt@pm.me>
This reverts commit 7855378fcd.
The return "exit 1" was intentional and actually just
makes the symlink checks much more strict.
This new level of strictness added to the checks revealed
what was a confusing regression with prereq stage that
already existed but was not presenting itself
because of the simple way that checks used to be done before.
Either way, reverting to "exit 0" was a nice workaround
until the true root cause was discovered, so as to not interfere
with others' pull requests and builds in the meantime.
It turns out that this problem was the inconsistent value of $PATH
between different commands within the SetupHostCommand recipe,
now fixed in the parent commit, using the variable created
in the parent of the parent commit.
Ref: f75204036c ("prereq-build: allow host command symlinks to update")
Signed-off-by: Michael Pratt <mcpratt@pm.me>
In the recipe SetupHostCommand for checking
and creating symlinks, $PATH was only overridden
for one of several commands.
This causes the symlinks to be included
in the paths to pick a program from
when the check was repeated, because
staging_dir/host/bin was included in $PATH,
but only *sometimes*.
When the check ran again, the command succeded
with a $PATH including the symlink,
(eval "$$$$$$$$cmd")
while the path to the program was evaluated
with a $PATH NOT including the symlink,
(bin=...)
causing the symlink to be relinked incorrectly,
instead of passing as exactly the same.
Coincidentally, this was only a problem
if the symlink targeted the alternative
program with a different name.
By overriding the value of $PATH at the invocation of Make,
it will apply to the entire environment of the checks.
Signed-off-by: Michael Pratt <mcpratt@pm.me>
Add a variable that stores the original value of $PATH
in the host system's shell, before Make alters it.
This can be useful for when it is necessary
to ignore symlinks and programs made by the build system.
Define this new variable before all instances of
'export PATH:=' or similar.
Signed-off-by: Michael Pratt <mcpratt@pm.me>
When the split was done, the case for testing kernel version wasn't
handled and only the to-be-compiled kernel version details files was
included. This cause the kernel Linux-Testing-Version output from
makefile target DUMP to report only the kernel version without the minor
version (example 6.1 instead of 6.1.29).
This value is expected with the full kernel version and this cause the
dump-target-info.pl script to not correctly identify if a target have a
testing kernel for the kernels calls.
Fix this regression by correctly including the kernel details files if
the target declare support for a testing kernel version.
Fixes: 0765466a42 ("kernel: split kernel version to dedicated files")
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
A package may run git as part of its build process, and if the package
source code is not from a git checkout, then git may traverse up the
directory tree to find buildroot's repository directory (.git).
For instance, Poetry Core, a Python build backend, will read the
contents of .gitignore for paths to exclude when creating a Python
package. If it finds buildroot's .gitignore file, then Poetry Core will
exclude all of the package's files[1].
This exports GIT_CEILING_DIRECTORIES for both package and host builds so
that git will not traverse beyond $(BUILD_DIR)/$(BUILD_DIR_HOST).
[1]: https://github.com/python-poetry/poetry/issues/5547
Signed-off-by: Jeffery To <jeffery.to@gmail.com>
OpenSSL fails to compile in Fedora 38 container due to the following:
Can't locate IPC/Cmd.pm in @INC (you may need to install the IPC::Cmd module) (@INC contains: /openwrt/build_dir/target-x86_64_musl/openssl-3.0.8/util/perl /usr/local/lib64/perl5/5.36 /usr/local/share/perl5/5.36 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 /openwrt/build_dir/target-x86_64_musl/openssl-3.0.8/external/perl/Text-Template-1.56/lib) at /openwrt/build_dir/target-x86_64_musl/openssl-3.0.8/util/perl/OpenSSL/config.pm line 19.
BEGIN failed--compilation aborted at /openwrt/build_dir/target-x86_64_musl/openssl-3.0.8/util/perl/OpenSSL/config.pm line 19.
Compilation failed in require at ./Configure line 23.
BEGIN failed--compilation aborted at ./Configure line 23.
Seems like `dnf install -y perl-IPC-Cmd` fixes the issue.
So lets fix it by checking for Perl IPC::Cmd host module availability.
Signed-off-by: Petr Štetiar <ynezz@true.cz>