Instead of relying on .config symbols for metadata, alter the DEFAULT
variable of affected packages. Fixes enabling opkg vs apk among others.
Signed-off-by: Felix Fietkau <nbd@nbd.name>
This commit solves multiple issues. First of just install the three
special packages base-files, libc and kernel directly from the index. In
upstream indexes, those will never appear to prevent accidental upgrades
may breaking the system.
Next, enable caching for the ImageBuilder, which speeds up consecutive
builds from ~33 seconds to ~5 seconds. Using cache however makes APK
create the folder `/var/cache/apk/` which conflicts with the base-files
installation, which ships a symlink from `/var` to `/tmp`, so specify
`--no-cache` for the rootfs initialization.
Lastly, drop the use of `apk update` since APK automatically does that.
Signed-off-by: Paul Spooren <mail@aparcar.org>
This reverts commit 21b5ac862e.
The approach is flawed and cannot work in the ImageBuilder.
Using /etc/uci-defaults/ which is run on the target is the only
possible way.
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
post-install scripts may need to call executables installed to
STAGING_DIR_HOSTPKG which is not part of the PATH set to TARGET_PATH in
rules.mk.
Set PATH for post-install scripts to TARGET_PATH_PKG.
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Link: https://github.com/openwrt/openwrt/pull/16865
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Ignore errors in more image commands to handle case where the image is
too big and check-image validation fails.
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Rework tplink-v2-header and tplink-v2-image Build define to ignore error
if mktplinkfw2 errors out.
This is to handle situation when the image is too big and can't be
generated or prev check-image calls deleted the source file as it's too
big.
This aligns to the pattern used by tplink-v1-image.
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Correctly ignore Initramfs image copy on error. This follows the pattern with
sysupgrade image where an image might fail as it's too big or the
generation command fails and there is nothing to copy to the bin
directory.
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Previously APK would complain as it wasn't sure which package to
install by default when multiple packages would provide the same name.
Now, give the package a higher provider priority to make APK
automatically select the "default" package.
Signed-off-by: Paul Spooren <mail@aparcar.org>
Adding a version to the provides causes it to conflict with other
packages that provides the same package, further details are available
here: https://gitlab.alpinelinux.org/alpine/apk-tools/-/blob/master/doc/apk-package.5.scd#L199
This was intitally done, if I remember correctly, to support depending
on the specific kernel modules. Due to patches to APK, versions
containing hashes work now, too, so this is no longer required.
Only add the version to packages that define an ABI version since other
packages depend against the package name plus ABI version.
While at it, format the now rather complex call.
Fixes: https://github.com/openwrt/openwrt/issues/16795
Signed-off-by: Paul Spooren <mail@aparcar.org>
It seems some target started declaring package in DEVICE_PACKAGES just
to call InstallDev and generate binary for the image firmware.
This is very much used by layerscape target where trusted-firmware-a and
dependency are called for final image generation.
This is problematic for APK since it's more sensible to non exisiting
package.
To handle this, introduce a prefix '~' for a package that will signal to
build the package but not install it in the final image.
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Complete support for local signing keys for APK.
A local key will be always generated, mkndx is always called with
--allow-untrusted as it needs to replace the sign key with the new local
one.
With CONFIG_SIGNATURE_CHECK the local index is signed with the local
key. Local public key is added with the ADD_LOCAL_KEY option.
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
To better support imagebuilder declaring --repositories-file on calling
apk macro, detach this and --repository from rootfs.mk macro and move it
to package Makefile and image.mk where they are used to permit a more
generic usage.
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Set missing Maintainer and URL info for .apk creation.
Fixes: d788ab376f ("build: add APK package build capabilities")
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Remove whitespace for Description info for .apk creation
Fixes: b6bbc76c0b ("include/package-pack: set missing Description on .apk creation")
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Set missing description info on .apk creation. This was probably a TODO
that wasn't notice when the final implementation was pushed.
Fixes: d788ab376f ("build: add APK package build capabilities")
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
This commit adds the build date during compilation to the os-release file.
This information can then be used later to output this via the the ubus,
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
Link: https://github.com/openwrt/openwrt/pull/15987
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Disable for host to avoid having to use rpath hacks.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/16586
Signed-off-by: Robert Marko <robimarko@gmail.com>
In the case of multi-core compilation, the warning prompts to add a "+" sign.
````
warning: jobserver unavailable: using -j1. Add `+' to parent make rule.
`````
Signed-off-by: Zxl hhyccc <zxlhhy@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/16598
Signed-off-by: Robert Marko <robimarko@gmail.com>
We have <netinet/sctp.h> header in lksctp-tools package,
but having this var set to 'no' prevents package's configure
to detect it.
Signed-off-by: Aleksey Vasilenko <aleksey.vasilenko@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/16441
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Drop config and files for Linux 5.15.
Signed-off-by: Mieczyslaw Nalewaj <namiltd@yahoo.com>
Link: https://github.com/openwrt/openwrt/pull/16417
Signed-off-by: Robert Marko <robimarko@gmail.com>
Now that we copy and then delete the Per-Device rootfs linux directory,
it's not valid anymore placing the generated cpio there as artifacts
or subsequent commands need the generated cpio.
To handle this, rework Initramfs compile cpio handling by placing them in
the KERNEL_BUILD_DIR but add to the name the rootfs HASH ID.
To also prevent race condition, generate and access these file under a
lock to prevent fit command to reference a cpio while a parallel
execution is genereting it.
Fixes: 52cc9d82f1 ("kernel: rework Initramfs locking logic")
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Fix flock name for gen-initramfs lock as $(2) starts with .HASH making
the lock name gen-initramfs-.HASH.flock
Fix this to a better name of gen-initramfs.HASH.flock
Fixes: 52cc9d82f1 ("kernel: rework Initramfs locking logic")
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Fix wrong rework for Initramfs cpio xz compression where it was wrongly
dropped the Per-Device linux directory if condition.
Fixes: 52cc9d82f1 ("kernel: rework Initramfs locking logic")
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
To speedup compilation of Per-Device Initramfs, copy the kernel build
directory for each rootfs ID.
This permits concurrent execution of kernel build without conflicting
with each other at the expense of additional disk space usage.
To limit disk space usage, the copied kernel directory is deleted after
the Per-Device Initramfs image is generated and saved.
Link: https://github.com/openwrt/openwrt/pull/16404
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Rework CompileImage/Initramfs locking logic to fix race condition on
concurrent access/compilation.
Rework each intermediate step and group them under one single execution
block. Protect this with a new lock, 'gen-initramfs' and rename the
compile initramfs to compile-initramfs lock name.
This is done to handle corner case scenario where a rootfs with the same
hash ID is generated at the same time. To handle this, we execute
everything under lock and use a specific hash ID lock to prevent
concurrent access/compilation.
Link: https://github.com/openwrt/openwrt/pull/16404
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
- specify CC target explicitly
Signed-off-by: Konstantin Demin <rockdrilla@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/15703
Signed-off-by: Robert Marko <robimarko@gmail.com>