Commit Graph

1263 Commits

Author SHA1 Message Date
Tianling Shen
5d440b37a5
Merge Official Source
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-04-13 17:06:01 +08:00
Olliver Schinagl
98235e60ed scripts/kernel_bump: Delete merge commit
While we have included the needed changes via a merge commit, there is
no need to keep it. Lets drop the merge commit, which we can do as we
haven't pushed anything.

Signed-off-by: Olliver Schinagl <oliver@schinagl.nl>
2024-04-12 18:20:53 +02:00
Olliver Schinagl
71c663bcfd scripts/kernel_bump: Allow bumping sub-targets
Some targets may need to bump specific sub-targets only. So lets offer
this as an option.

Signed-off-by: Olliver Schinagl <oliver@schinagl.nl>
2024-04-12 18:20:53 +02:00
Olliver Schinagl
b62aafc99a scripts/kernel_bump: Use the git index to find the needed config files
The current solution using `find` introduces a racecondition, where `find`
and `git mv` get in each others way. While this could be fixed with
more-utils sponge command (or even sort -u) to buffer the output of
find.

However, a much better approach, is to query the git index directly,
which will not change, and is far more accurate.

Signed-off-by: Olliver Schinagl <oliver@schinagl.nl>
2024-04-12 18:20:53 +02:00
Olliver Schinagl
8ed187e471 scripts/kernel_bump: Use git to obtain the list of files
Instead of looping of a directory to find directories related to kernel
changes, use the git index instead.

Signed-off-by: Olliver Schinagl <oliver@schinagl.nl>
2024-04-12 18:20:52 +02:00
Olliver Schinagl
9e6c4392f8 scripts/kernel_bump: Allow for migrating only configuration files
In some cases, we want to only migrate configuration files, e.g. if the
kernel was bumped already. Lets add a flag for this case to offer
flexibility. By default we will migrate configuration flags as before.

Signed-off-by: Olliver Schinagl <oliver@schinagl.nl>
2024-04-12 18:20:52 +02:00
Olliver Schinagl
9f0cc3eb11 scripts/kernel_bump: Run script relative to the script dir
Determine the target directory based on the script location, which might
work better in some cases, but at least also allows the script to be ran
from with any location in the OpenWRT repository.

Signed-off-by: Olliver Schinagl <oliver@schinagl.nl>
2024-04-12 18:20:52 +02:00
Olliver Schinagl
f9ac106779 scripts/kernel_bump: Do no run on dirty repositories
We want to avoid starting a process when we know it will fail later.

Signed-off-by: Olliver Schinagl <oliver@schinagl.nl>
2024-04-12 18:20:52 +02:00
Olliver Schinagl
ed896c32b0 scripts/kernel_bump: Improve omitted version error
If a version string was not supplied, we currently print an empty
string. We can do better here. Also by popular demand, print the usage
information in case of error.

Signed-off-by: Olliver Schinagl <oliver@schinagl.nl>
2024-04-12 18:20:52 +02:00
Olliver Schinagl
03f2f530a0 scripts/kernel_bump: Always drop v prefix
Naivly and lazyly the leading v was only dropped from optarg, not from any
environment variable.

Lets do this properly and ensure a leading 'v' is always dropped.

Signed-off-by: Olliver Schinagl <oliver@schinagl.nl>
2024-04-12 18:20:52 +02:00
Olliver Schinagl
1bbc249266 scripts/kernel_bump: Drop unused function
No need to keep unused empty functions. A left over from early development.

Signed-off-by: Olliver Schinagl <oliver@schinagl.nl>
2024-04-12 18:20:52 +02:00
Olliver Schinagl
7b7f170216 scripts/kernel_bump: Avoid potential copyright claim
Due to potential fears of copyright infringement noted by Elliott
Mitchell [0], rewrite our message to belong to OpenWRT.

Note, AI was used to aid in construction of this sentence.

[0]: https://lists.openwrt.org/pipermail/openwrt-devel/2024-March/042422.html

Signed-off-by: Olliver Schinagl <oliver@schinagl.nl>
2024-04-12 18:20:52 +02:00
Tianling Shen
a0227dddf3
Merge Official Source
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-04-10 17:14:10 +08:00
Robert Marko
204823ac28 scripts/dl_github_archive: use tar -I for ZSTD
Instead of relying on env variables for setting the ZSTD compression
configuration we can simply do what we do for IB, SDK and the rest and
use tar -I to pass "zstd -T0 --ultra -20" directly.

This makes it rather clear what is being done and allows to drop the
zstd CLI max level override as its usually capped at level 19.

Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-04-09 18:39:36 +02:00
Tianling Shen
458bdf28b5
Merge Official Source
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-04-07 17:45:08 +08:00
Stijn Tintel
7f85104ebb scripts: add .tar.zst to dl_cleanup extensions
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
2024-04-06 17:07:32 +03:00
Christian Marangi
c922c78094 scripts/dl_github_archive: add support for packing zstd archive
Add support for packing .zst archive when creating Github mirror tar.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2024-04-06 11:24:18 +02:00
Tianling Shen
7b72cd5093
scripts/download.pl: remove deprecated onedrive mirror
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-03-30 21:15:06 +08:00
ZiMing Mo
f761272538
Merge Official Source
Signed-off-by: ZiMing Mo <msylgj@immortalwrt.org>
2024-03-14 21:41:17 +08:00
Olliver Schinagl
3561015efd scripts: Kernel bumper script
For years, we have struggled and been frustrated at loosing history of
files in git, due to the 'copy + add' strategy. This could have been
prevented with a double-commit 'mv + add' trick.

On the mailing list [0] the discussion was started to put the
instructions in a wiki. Instead, it is much better to just script it and
put it in the repo.

Instead of doing mv + copy, which leads to two commits, but no history
on the copied files, it uses move, + copy and merge, which results in
three (merge) commits, but keeps the history of all files. As always
with renames, `--follow` will be needed.

The tool is trivial and works either in the OpenWrt git root directory,
or in the actual target directory.

Tested on the `realtek` and generic targets.

Note, that the tool does not do any of the labor needed after the move,
such as updating configs, dropping patches etc.

To make sure this script is easily found by any developer, who just
wants to do a kernel bump, the script is added here and not to
maintainer-tools repo as those scripts are a little bit more specialized.
Bumping a kernel is a trivial task that often regular developers do,
where most do not even know the existence of maintainer tools, are not
part of the main repo they'd clone, not part of the docker container
they'd use and so discoverability is probably much more important.

[0]: https://lists.openwrt.org/pipermail/openwrt-devel/2023-October/041673.html

Signed-off-by: Olliver Schinagl <oliver@schinagl.nl>
Tested-by: Robert Marko <robimarko@gmail.com>
Tested-by: Weijie Gao <hackpascal@gmail.com>
2024-03-11 09:53:01 +01:00
Tianling Shen
7e50806c6e
Merge Official Source
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-03-02 19:31:31 +08:00
Eneas U de Queiroz
65a3eb28d5 build: scripts/config - update to kconfig-v6.6.16
The main goal here is to keep this close to upstream.

Changes include:
 - allow symbols implied by y to become m
 - make 'imply' obey the direct dependency
 - allow only 'config', 'comment', and 'if' inside 'choice'
 - qconf: make search fully work again on split mode
 - qconf: navigate menus on hyperlinks
 - remove '---help---' support
 - qconf: allow to edit "int", "hex", "string" menus in-place
 - qconf: drop Qt4 support
 - nconf: fix core dump when searching in empty menu
 - nconf: stop endless search loops
 - Create links to main menu items in search
 - fix segmentation fault in menuconfig search
 - nconf: Add search jump feature
 - port qconf to work with Qt6 in addition to Qt5
 - fix possible buffer overflow
 - fix memory leak from range properties

Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
2024-03-01 19:02:00 +01:00
Cedric DOURLENT
84331215e5 build: fix kernel component in CycloneDX SBOM
As stated in the cycloneDX documentation, the field "type" is mandatory for all components.

More details here (https://cyclonedx.org/docs/1.5/json/#components_items_type)

Signed-off-by: Cedric DOURLENT <cedric.dourlent@softathome.com>
2024-03-01 16:42:34 +01:00
Tianling Shen
18d94c89e7
Merge Official Source
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-02-28 20:54:11 +08:00
Michael Seibt
404c76f78a build: fix shebang line
Remove space between sharp-exclamation and interpreter.

Signed-off-by: Michael Seibt <github@roboschmie.de>
2024-02-28 12:31:33 +08:00
Tianling Shen
acb88c40ea
Merge Official Source
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-02-23 23:28:51 +08:00
Oto Šťáva
1e93208bd2
build: add explicit --no-show-signature for git
When `log.showSignature` is set, it causes the `SOURCE_DATE_EPOCH` to
include a textual signature description on OpenPGP-signed commits,
because Git prints the description into stdout. This then causes some
scripts to fail because they cannot parse the date from the variable.

Adding an explicit `--no-show-signature` prevents the signatures from
being displayed even when one has Git configured to show them by
default, fixing the scripts.

Signed-off-by: Oto Šťáva <oto.stava@gmail.com>
2024-02-20 20:57:53 +01:00
Tianling Shen
d2439a54dc
Merge Official Source
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-02-19 12:08:24 +08:00
Daniel Golle
67beab2b2b scripts: ubinize-image.sh: fix on POSIX shell, allow custom images
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>
2024-02-16 05:32:51 +00:00
Daniel Golle
6c17d71973 scripts: ubinize-image.sh: support static volumes, make size optional
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>
2024-02-15 19:30:08 +00:00
Tianling Shen
1a52d50a77
Merge Official Source
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-01-24 11:22:29 +08:00
Felix Fietkau
7ad6e8c312 scripts/rstrip.sh: ignore /lib/firmware
On some platforms, some firmware files might look like executables.
These need to be ignored in order to avoid messing them up.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2024-01-22 13:01:31 +01:00
Tianling Shen
9ec7fefa35
Merge Official Source
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-01-09 20:21:38 +08:00
Paul Spooren
49e8f53298 scripts: fix installed-size calculation
Previously the script would calculate the size of the compressed archive
which isn't the size installed in the overlayfs.

This commit uses zcat in combination with wc to calculate the
umcompressed size.

Signed-off-by: Paul Spooren <mail@aparcar.org>
2024-01-08 14:08:06 +01:00
Paul Spooren
751791d545 packages: store URL in Manifest
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>
2024-01-08 14:06:38 +01:00
Michael Pratt
fd3376c5ee
build: ensure silent Make behavior for json scripts
Run the invocation of Make with verbosity in order to
prevent the printing of Makefile level and subtarget status.
e.g.  make[3] -C target/linux val.DEFAULT_PACKAGES val.ARCH_PACKAGES

Remove piping of stderr, which is only useful when using
the "communicate" method over the "run" method,
and this script would not be written to handle a captured error anyway.

For error testing, stdout and stderr can be set to a file object
with the open() function like this:

out = open('json_out', 'w')
err = open('json_err', 'w')

...
...
stdout=out,
stderr=err,

Signed-off-by: Michael Pratt <mcpratt@pm.me>
2024-01-05 16:25:14 +01:00
Tianling Shen
56525919b4
Merge Official Source
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2023-11-27 22:10:34 +08:00
Tony Ambardar
cd5e0134b6 image: fix Linksys image alignment and simplify footer creation
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>
2023-11-26 18:37:20 +01:00
Tianling Shen
52e0fddb99
Merge Official Source
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2023-11-25 18:13:06 +08:00
Mikhail Zhilkin
28d32244e1 scripts: sercomm-pid.py: use uppercase hwid in pid
Sercomm uses uppercase for hexadecimal representation of the device
hardware IDs in factory image PID. This commit brings the sercomm-pid.py
script into compliance with the original Sercomm algorithm.

Example
-------
+--------+-------------+-----------+-------------+
| Device | PID (before | PID       | PID (after  |
| HWID   | the commit) | (Sercomm) | the commit) |
+--------+-------------+-----------+-------------+
| CPJ    | 43 50 4a    | 43 50 4A  | 43 50 4A    |
+--------+-------------+-----------+-------------+

Signed-off-by: Mikhail Zhilkin <csharper2005@gmail.com>
2023-11-25 01:11:18 +01:00
Tianling Shen
e4b2ac8644
Merge Official Source
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2023-11-16 13:41:26 +08:00
Christian Marangi
943c153cdd
scripts/dump-target-info.pl: add new function to DUMP devices
Add new function to dump-targer-info.pl to DUMP devices provided a
matching target/subtarget.

Example:

./scripts/dump-targer-info.pl devices ipq806x/generic

will produce the sorted list of devices defined in the following format:

device_id device_name

Devices may have alternative names, the script will dump each
alternative name in the same line of device_id.

Following the pattern:

device_id "PRIMARY DEVICE NAME" "ALT0 DEVICE NAME" "ALT1 DEVICE NAME" ...

Example:

tplink_ad7200 "TP-Link AD7200 v1/v2" "TP-Link Talon AD7200 v1/v2"

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2023-11-15 10:59:23 +01:00
Tianling Shen
991f4d42ac
Merge Official Source
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2023-11-13 12:38:34 +08:00
Christian Marangi
9e49e0a6c4
scripts/getver.sh: prevent asking for negative rev-parse
With the case of asking an invalid version that is too big, getver.sh
might return an invalid output in the form of HEAD~-2260475641.

This is caused by BASE_REV - GET_REV using a negative number.

Prevent this by checking if BASE_REV - GET_REV actually return 0 or a
positive number and set REV variable accordingly. With the following
change, invalid revision number will result in unknown printed instead
of the invalid HEAD~-NUMBERS output.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2023-11-12 16:19:04 +01:00
Tianling Shen
ace2d912d7
Merge Official Source
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2023-11-04 12:55:50 +08:00
Ilya Katsnelson
2c22589782 build: replace true with a custom noop script
`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>
2023-11-03 23:06:07 +01:00
Tianling Shen
2e4a94099a
Merge Official Source
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2023-11-03 15:10:06 +08:00
Sandro Jäckel
376f1c80a9 build: use long hashes when generating feed.buildinfo
Short hashes are not guaranteed to be unambiguous forever and could
collide if the repo grows over time. Git also estimates how many
characters are roughly required to prevent such a collision and slowly
increases the amount of characters beginning from 6, OpenWrt is already
at 8. Lets use the full hash the have a predictable length and keep
hashes unambiguous forever.

Signed-off-by: Sandro Jäckel <sandro.jaeckel@gmail.com>
2023-11-02 12:40:44 +01:00
Tianling Shen
3f9bf2c41b
Merge Official Source
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2023-11-02 12:47:23 +08:00
Petr Štetiar
d604a07225
build: add CycloneDX SBOM JSON support
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>
2023-11-01 11:14:41 +00:00