<feed xmlns='http://www.w3.org/2005/Atom'>
<title>staging/stintel/package/Makefile, branch master</title>
<subtitle>Staging tree of Stijn Tintel</subtitle>
<id>https://git.openwrt.org/openwrt/staging/stintel/atom?h=master</id>
<link rel='self' href='https://git.openwrt.org/openwrt/staging/stintel/atom?h=master'/>
<link rel='alternate' type='text/html' href='https://git.openwrt.org/openwrt/staging/stintel/'/>
<updated>2026-09-22T16:18:58Z</updated>
<entry>
<title>package: reuse the rootfs if its inputs did not change</title>
<updated>2026-09-22T16:18:58Z</updated>
<author>
<name>John Crispin</name>
</author>
<published>2026-09-18T18:33:52Z</published>
<link rel='alternate' type='text/html' href='https://git.openwrt.org/openwrt/staging/stintel/commit/?id=48c1e36bf2b8cbe1bfa07cc129cbc833d977d501'/>
<id>urn:sha1:48c1e36bf2b8cbe1bfa07cc129cbc833d977d501</id>
<content type='text'>
The rootfs is installed from scratch on every build: apk add, then the
post-install and init scripts of every package, one after the other.
This takes about 1.5 s, even if no package changed.

Build a key from the package index, which holds a hash of every
package, the install list, .config, SOURCE_DATE_EPOCH, the files
overlay, apk, tar, gzip and the Makefiles that create the rootfs. Save
a copy of the rootfs with the key, and restore it from the copy if the
key did not change. Later build steps modify the rootfs, so it is
always restored from the copy and never reused in place.

prepare_rootfs runs tar and gzip over the apk script archive, so the
key holds those two host tools as well. With mklibs it also runs
rstrip.sh, which the key then holds too.

The install list now holds the base-files, libc and kernel versions
too, so that the key can use it. Only the APK path uses the cache.

The copy costs disk: the build directory carries the root filesystem
twice, once as root and root.orig and once in the cache.

Signed-off-by: John Crispin &lt;john@phrozen.org&gt;
</content>
</entry>
<entry>
<title>build: merge the packages only when the set of packages changed</title>
<updated>2026-09-22T16:18:58Z</updated>
<author>
<name>John Crispin</name>
</author>
<published>2026-09-22T10:03:03Z</published>
<link rel='alternate' type='text/html' href='https://git.openwrt.org/openwrt/staging/stintel/commit/?id=8d2564302560bea292ba4050df444404e32527ef'/>
<id>urn:sha1:8d2564302560bea292ba4050df444404e32527ef</id>
<content type='text'>
package/merge deletes the symlink farm of every built package and creates
it again on every build. package/merge-index then reads all of those
packages to create the index. With two thousand packages both steps take a
third of a second, and the cost grows with the size of the configuration.

Record the name, the size and the timestamp of every package file. Skip
both steps while that list is unchanged and the index is present. A rebuild
of the symlinks drops the index, so merge-index creates it again.

This takes the time of package/install on an unchanged tree from 1.05 s to
0.60 s for the OpenWrt One.

Signed-off-by: John Crispin &lt;john@phrozen.org&gt;
</content>
</entry>
<entry>
<title>build: rebuild the package index only when a package changed</title>
<updated>2026-09-22T16:18:58Z</updated>
<author>
<name>John Crispin</name>
</author>
<published>2026-09-20T16:28:44Z</published>
<link rel='alternate' type='text/html' href='https://git.openwrt.org/openwrt/staging/stintel/commit/?id=3054effc90f343ebd2c2eae9319de4b671052836'/>
<id>urn:sha1:3054effc90f343ebd2c2eae9319de4b671052836</id>
<content type='text'>
package/index runs apk mkndx and make-index-json.py over every package
on each build, which takes 1.2 s of a no-op build of this tree with 1258
packages. The result depends only on the package files.

Skip the pass while packages.adb and index.json exist and no package
file, and no directory, is newer than index.json. The directory covers a
package that was added or removed, because neither changes a file that
is left. The comparison uses index.json rather than packages.adb,
because apk mkndx writes packages.adb through a rename, which sets the
mtime of the directory to that of the file it wrote. The directory would
then tie with packages.adb and the skip would rest on the two comparing
equal. index.json is written after it, so the directory is older.

Signed-off-by: John Crispin &lt;john@phrozen.org&gt;
</content>
</entry>
<entry>
<title>build: clean the package root dir only if the packages can have changed</title>
<updated>2026-09-22T16:18:58Z</updated>
<author>
<name>John Crispin</name>
</author>
<published>2026-09-19T09:32:20Z</published>
<link rel='alternate' type='text/html' href='https://git.openwrt.org/openwrt/staging/stintel/commit/?id=bc2e85eb8df05e8e1e5a7542c243b33fcbbf6365'/>
<id>urn:sha1:bc2e85eb8df05e8e1e5a7542c243b33fcbbf6365</id>
<content type='text'>
The stamp of package/cleanup depends on tmp/.build, which is touched on
every make call, so every build deletes $(STAGING_DIR_ROOT) and every
package copies its files into it again, one after the other under a
lock. With all packages selected, this takes 5 s of a build that has
nothing to do, most of it in the 1102 kmods of package/kernel/linux.

Only clean it if .config, the package metadata or a file below package/
changed since the last cleanup. An edit of the source in a build
directory alone does not clean it, so a file that such an edit removes
from a package stays until then. make package/cleanup cleans it at any
time.

Signed-off-by: John Crispin &lt;john@phrozen.org&gt;
</content>
</entry>
<entry>
<title>build: add CycloneDX SBOM processing to apk</title>
<updated>2026-05-17T10:21:09Z</updated>
<author>
<name>Florian Eckert</name>
</author>
<published>2025-09-30T12:49:52Z</published>
<link rel='alternate' type='text/html' href='https://git.openwrt.org/openwrt/staging/stintel/commit/?id=10d9dbe838447b79a616cf4b0e149b7e398df46a'/>
<id>urn:sha1:10d9dbe838447b79a616cf4b0e149b7e398df46a</id>
<content type='text'>
Currently, there is no SBOM generation in imagebuilder when the package
system 'apk' is used. This commit adds this feature back. This already
worked for the package system 'opkg'.

Furthermore, generating the SBOM using perl is not reproducible if the
input data has not changed. A different file is always generated. This is
not the case with Python. For this reason, Python is now used to generate
the SBOM for the imagebuilder.

The script has already been prepared so that it can also process the opkg
package system for generating the SBOM.

Signed-off-by: Florian Eckert &lt;fe@dev.tdt.de&gt;
</content>
</entry>
<entry>
<title>build: propagate errors when generating apk indexes</title>
<updated>2026-02-13T20:17:21Z</updated>
<author>
<name>Matt Merhar</name>
</author>
<published>2026-02-11T19:33:15Z</published>
<link rel='alternate' type='text/html' href='https://git.openwrt.org/openwrt/staging/stintel/commit/?id=fcb07b00ec22b90fc0cd790701982018ee345366'/>
<id>urn:sha1:fcb07b00ec22b90fc0cd790701982018ee345366</id>
<content type='text'>
The build would continue even if the some of the intermediate commands
failed, as long as the last command in the final iteration of the loop
was successful.

Add 'set -e' to the subshell so that we immediately exit. Previously,
only the exit status of the final make-index-json.py mattered.

Fixes: https://github.com/openwrt/openwrt/issues/21981
Signed-off-by: Matt Merhar &lt;mattmerhar@protonmail.com&gt;
Link: https://github.com/openwrt/openwrt/pull/21993
Signed-off-by: Robert Marko &lt;robimarko@gmail.com&gt;
</content>
</entry>
<entry>
<title>build: use STAGING_DIR for special APK package versions</title>
<updated>2026-02-01T10:16:54Z</updated>
<author>
<name>Jonas Gorski</name>
</author>
<published>2026-01-14T19:19:30Z</published>
<link rel='alternate' type='text/html' href='https://git.openwrt.org/openwrt/staging/stintel/commit/?id=a4e92f0484f365565072162dad3eeaca0e38b709'/>
<id>urn:sha1:a4e92f0484f365565072162dad3eeaca0e38b709</id>
<content type='text'>
Removing tmp/ after having built base-files or toolchain currently
breaks rootfs generation:

$ rm -rf tmp
$ make V=w
...
 make[2] package/install
cat: .../openwrt/tmp/base-files.version: No such file or directory
cat: .../openwrt/openwrt/tmp/libc.version: No such file or directory
ERROR: 'base-files=' is not a valid world dependency, format is name(@tag)([&lt;&gt;~=]version)
make[2]: *** [package/Makefile:100: package/install] Error 99

The only way to recover from here is to clean toolchain and base-files via

$ make package/{base-files,toolchain}/clean

tmp is supposed to be ephemeral, so clearing it is an expected action,
which normally just triggers a regeneration of all files there.

Fix this by moving the version files to $(STAGING_DIR).

Fixes: 63e178f067 ("build: lock versions for special APK packages")
Signed-off-by: Jonas Gorski &lt;jonas.gorski@gmail.com&gt;
Link: https://github.com/openwrt/openwrt/pull/21803
Signed-off-by: Robert Marko &lt;robimarko@gmail.com&gt;
</content>
</entry>
<entry>
<title>build: avoid errors during release candidate kernel packaging</title>
<updated>2025-12-20T10:06:47Z</updated>
<author>
<name>Markus Stockhausen</name>
</author>
<published>2025-12-19T06:34:54Z</published>
<link rel='alternate' type='text/html' href='https://git.openwrt.org/openwrt/staging/stintel/commit/?id=d34cef823e103240516f01a54a3f01a09d9f36ed'/>
<id>urn:sha1:d34cef823e103240516f01a54a3f01a09d9f36ed</id>
<content type='text'>
The build system allows to use Linux release candidate kernels (-rcX).
For this a target/linux/generic/kernel-6.XY as follows is needed:

LINUX_VERSION-6.XY = -rc1
LINUX_KERNEL_HASH-6.XY-rc1 = 18ba6ebd72f46b881e0d73e390b2888b7b43...

Sadly the builds fail with a packaging error.

fakeroot /home/openwrt/openwrt/openwrt/staging_dir/host/bin/apk
mkpkg --info "name:kernel" --info "version:6.15-rc1~c4bf...1f6-r1"
ERROR: info field 'version' has invalid value: package version is invalid

The apk metadata specification reads:

"... Currently the APK version specification is as follows:
number{.number}...{letter}{_suffix{number}}...{~hash}{-r#} ...
Optionally one or more _suffix{number} components can follow.
The list of valid suffixes (and their sorting order) is: alpha,
beta, pre, rc, &lt;no suffix&gt;, cvs, svn, git, hg, p."

Given that the kernel uses "-rcX" naming scheme and apk requires
"_rcX" instead, simply translate the dash to an underscore for
these builds.

Signed-off-by: Markus Stockhausen &lt;markus.stockhausen@gmx.de&gt;
Link: https://github.com/openwrt/openwrt/pull/21214
Signed-off-by: Robert Marko &lt;robimarko@gmail.com&gt;
</content>
</entry>
<entry>
<title>package: do not sign individual APK packages</title>
<updated>2025-10-09T10:52:43Z</updated>
<author>
<name>Paul Spooren</name>
</author>
<published>2025-10-08T09:42:51Z</published>
<link rel='alternate' type='text/html' href='https://git.openwrt.org/openwrt/staging/stintel/commit/?id=084697eb62f8fae6185af285e12f5cd0268114de'/>
<id>urn:sha1:084697eb62f8fae6185af285e12f5cd0268114de</id>
<content type='text'>
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 &lt;mail@aparcar.org&gt;
</content>
</entry>
<entry>
<title>package: generate sha256sums by default</title>
<updated>2025-10-03T09:00:23Z</updated>
<author>
<name>Paul Spooren</name>
</author>
<published>2025-10-01T13:22:38Z</published>
<link rel='alternate' type='text/html' href='https://git.openwrt.org/openwrt/staging/stintel/commit/?id=06be7f59285b57f3401a8891ebe857d25806d16c'/>
<id>urn:sha1:06be7f59285b57f3401a8891ebe857d25806d16c</id>
<content type='text'>
Right now the sha256sums are only created for the targets/ folder (i.e.
firmware images) and only the buildbot generates those sha256sums. Instead, let
the build system create the sha256sums directly.

Signed-off-by: Paul Spooren &lt;mail@aparcar.org&gt;
</content>
</entry>
</feed>
