1212 Commits

Author SHA1 Message Date
Tianling Shen
fab49a1289
Merge Official Source
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-07-12 11:33:56 +08:00
Sahil Dhiman
4df592f7a3 scripts: Add GNU ftp mirror redirector for GNU and Savannah
Add GNU's redirector which automatically redirect user to nearby online
mirror.

Signed-off-by: Sahil Dhiman <sahil@hopbox.in>
Link: https://github.com/openwrt/openwrt/pull/15557
Signed-off-by: Robert Marko <robimarko@gmail.com>
(cherry picked from commit 6510eb3b5d612ea7a70c4a8d9b83639e3b46e221)
Link: https://github.com/openwrt/openwrt/pull/15898
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-07-08 21:13:26 +02:00
Christian Marangi
f8690ca0db scripts/ext-toolchain: add missing libc library specs
Add missing libc library spec that weren't added to the ext-toolchain
script when the library were introduced in the packages libs toolchain
Makefile.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
(cherry picked from commit 8cad52a267bffe384a119f3e5ae1892e8580a981)
Link: https://github.com/openwrt/openwrt/pull/15898
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-07-08 21:13:25 +02:00
Tianling Shen
565f2a0367
Merge Official Source
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-06-26 02:25:18 +08:00
Roman Azarenko
cc0527b362
build: add explicit timezone in CycloneDX SBOM
The sender domain has a DMARC Reject/Quarantine policy which disallows
sending mailing list messages using the original "From" header.

To mitigate this problem, the original message has been wrapped
automatically by the mailing list software.
Per the CycloneDX 1.4 spec, the `metadata.timestamp` field contains
the date/time when the BOM was created [1].

Before the change, the value generated by the package-metadata.pl
script would look like this:

	2024-06-03T15:51:10

CycloneDX 1.4 relies on the JSON Schema specification version draft-07,
which defines the `date-time` format [2] as derived from RFC 3339,
section 5.6 [3]. In this format, the `time-offset` component is required,
however in the original version of package-metadata.pl it is omitted.

This is causing problems with OWASP Dependency-Track version 4.11.0 or
newer, where it now validates submitted SBOMs against the JSON schema
by default [4]. SBOMs with incorrect timestamp values are rejected with
the following error:

	{
	    "detail": "Schema validation failed",
	    "errors": [
	        "$.metadata.timestamp: 2024-06-03T15:51:10 is an invalid date-time"
	    ],
	    "status": 400,
	    "title": "The uploaded BOM is invalid"
	}

Add explicit `Z` (UTC) timezone offset in the `timestamp` field
to satisfy the CycloneDX schema.

[1]: https://github.com/CycloneDX/specification/blob/1.4/schema/bom-1.4.schema.json#L116-L121
[2]: https://json-schema.org/draft-07/draft-handrews-json-schema-validation-01#rfc.section.7.3.1
[3]: https://datatracker.ietf.org/doc/html/rfc3339#section-5.6
[4]: https://github.com/DependencyTrack/dependency-track/pull/3522

Signed-off-by: Roman Azarenko <roman.azarenko@iopsys.eu>
(cherry picked from commit 2ded629864de779df8ddd0224a875edf17f9fea5)
Link: https://github.com/openwrt/openwrt/pull/15693
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2024-06-20 14:58:17 +02:00
Tianling Shen
68ccc7e8a7
Merge Official Source
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-04-19 16:32:19 +08:00
Cedric DOURLENT
340e3dc453
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>
(cherry picked from commit 84331215e57090a9cdae4af75af2539c39cd7de7)
2024-04-17 04:34:36 +00:00
Tianling Shen
01188f473d
scripts/download.pl: remove deprecated onedrive mirror
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
(cherry picked from commit 7b72cd509305972988669d81f227fe76c4caa5d6)
2024-03-30 21:15:20 +08:00
Tianling Shen
c9365b3c27
Merge Official Source
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-02-27 18:48:09 +08:00
Oto Šťáva
60768064ce
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>
(cherry picked from commit 1e93208bd2c605704b19fe8b04025c20c17e808d)
2024-02-20 20:58:41 +01:00
Tianling Shen
2c767ac1a7
Merge Official Source
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2023-11-27 22:45:01 +08:00
Mikhail Zhilkin
dae399196b 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>
(cherry picked from commit 28d32244e122051ec88551e831fb9cf34da7cd76)
2023-11-27 02:02:35 +01:00
Tianling Shen
7fb31f2164
Merge Official Source
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2023-11-16 13:43:08 +08:00
Christian Marangi
c7b6cfac40
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>
(cherry picked from commit 943c153cdd695904b9b7fe44800fc3546644973e)
2023-11-15 11:00:19 +01:00
Tianling Shen
695bf40a48
Merge Official Source
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2023-11-13 12:40:17 +08:00
Christian Marangi
101988c61a
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>
(cherry picked from commit 9e49e0a6c4535d345084cc62c594be5cad23b911)
2023-11-12 16:19:39 +01:00
Tianling Shen
73eac7e437
Merge Official Source
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2023-11-04 12:58:38 +08:00
Petr Štetiar
21e5db97c4
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>
(cherry picked from commit d604a07225c5c82b942cd3374cc113ad676a2519)
2023-11-02 14:44:47 +00:00
Petr Štetiar
4ef8899c7a
package-dumpinfo,metadata: add ABI version information to package index
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>
(cherry picked from commit 649655f427932fe79b96a41f883c8054b1806191)
2023-11-02 14:44:46 +00:00
Petr Štetiar
fdeb7d6dd0
package-metadata: add CPE information to JSON package manifests
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 JSON package manifests.

Signed-off-by: Petr Štetiar <ynezz@true.cz>
(cherry picked from commit 8562c65ff8aae3899cdb190319709500b7651492)
2023-11-02 14:44:45 +00:00
Tianling Shen
61593e4432
Merge Official Source
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2023-08-16 14:36:39 +08:00
Hauke Mehrtens
c57275df67 scripts: qemustart: Fix x86/legacy bootup
The ide-drive option was renamed to ide-hd in qemu 6.0.
With this change qemu is starting again on Debian 12.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit 497012ab4eb1f37cbbbff9a766d2fecdb43dd0db)
2023-08-15 17:19:05 +02:00
Tianling Shen
c51a6a60a1
download.pl: remove duplicate mirrors
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
(cherry picked from commit a32e32a1e3bee4dc2fcd505cb7eba12692816f8f)
2023-08-15 15:29:03 +08:00
Tianling Shen
f7758ffc48
Merge Official Source
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2023-07-31 01:08:51 +08:00
David Bauer
5ded0a3975 scripts: use sep-char for hash nodes
U-Boot with enabled secure-boot will not boot images with the
@-character used for hash node-names.

Use the existing separation character configurable for each device.

Signed-off-by: David Bauer <mail@david-bauer.net>
(cherry picked from commit 2b133ab19cd5d741f3191f917c607667943f5f58)
2023-07-26 15:39:24 +02:00
Tianling Shen
a3639e76d6
Merge Official Source
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2023-07-24 18:07:07 +08:00
David Bauer
476bf135fc mediatek: add support for ZyXEL NWA50AX Pro
Hardware
--------
CPU:    Mediatek MT7981
RAM:    512M DDR4
FLASH:  256M NAND
ETH:    MaxLinear GPY211 (2.5GbE N Base-T)
WiFi:   Mediatek MT7981 (2.4GHz 2T2R:2 5GHz 3T3R:2 802.11ax)
BTN:    1x Reset
LED:    1x Multi-Color

UART Console
------------
Available below the rubber cover next to the ethernet port.

Settings: 115200 8N1

Layout:

<12V> <LAN> GND-RX-TX-VCC

Logic-Level is 3V3. Don't connect VCC to your UART adapter!

Installation Web-UI
-------------------
Upload the Factory image using the devices Web-Interface.

As the device uses a dual-image partition layout, OpenWrt can only
installed on Slot A. This requires the current active image prior
flashing the device to be on Slot B.

In case this is not the case, OpenWrt will boot only one time, returning
to the ZyXEL firmware the second boot.

If this happens, first install a ZyXEL firmware upgrade of any version
and install OpenWrt after that.

Installation TFTP / Recovery
----------------------------
This installation routine is especially useful in case of a bricked
device.

Attach to the UART console header of the device. Interrupt the boot
procedure by pressing Enter.

The bootloader has a reduced command-set available from CLI, but more
commands can be executed by abusing the atns command.

Boot a OpenWrt initramfs image available on a TFTP server at
192.168.1.66. Rename the image to nwa50axpro-openwrt-initramfs.bin.

 $ atnf nwa50axpro-openwrt-initramfs.bin
 $ atna 192.168.1.88
 $ atns "192.168.1.66; tftpboot; setenv fdt_high 0xffffffffffffffff;
   bootm"

Upon booting, set the booted image to the correct slot:

 $ zyxel-bootconfig /dev/mtd9 get-status
 $ zyxel-bootconfig /dev/mtd9 set-image-status 0 valid
 $ zyxel-bootconfig /dev/mtd9 set-active-image 0

Copy the OpenWrt sysupgrade image to the device using scp.
Write the sysupgrade image to NAND using sysupgrade.

 $ sysupgrade -n image.bin

Signed-off-by: David Bauer <mail@david-bauer.net>
(cherry picked from commit f0445746f6fd96fc7c5394b238153bd2ff22bc5b)
2023-07-23 16:10:08 +02:00
Tianling Shen
df817c0c5f
Merge Official Source
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2023-07-17 01:40:47 +08:00
Adones Pitogo
4ab8abfbf7 build: fix generation of large .vdi images
Instead of loading the whole image into the memory when generating the
sha256 sum, we load the file in chunks and update the hash incrementally
to avoid MemoryError in python. Also remove a stray empty line.

Fixes: #13056
Signed-off-by: Adones Pitogo <pitogo.adones@gmail.com>
(mention empty line removal, adds Fixes from PR)
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
(cherry picked from commit bdb4b78210cfb6bc8a6cda62fc990dd45ec3054c)
2023-07-15 22:24:50 +02:00
Tianling Shen
39f1f2670f
Merge Official Source
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2023-07-14 14:34:42 +08:00
Daniel Golle
50507f5af3 scripts/mkits.sh: DT overlays don't need a loadaddr
DT overlays do not need relocation in order to be applied, so drop
defining the load address for dtbos.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
(cherry picked from commit cff3786bd54cec8276f1fd08d5c6697846f393a5)
2023-07-13 12:05:28 +01:00
Wenli Looi
977ee439d7 image: add additional fields to Netgear encrypted image
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>
(cherry picked from commit 0a1ebccc8702cadc50bc096f1e185472f3927786)
2023-07-13 12:05:28 +01:00
Tianling Shen
d415f95aff
Merge Official Source
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2023-06-20 13:29:06 +08:00
Mikhail Zhilkin
63942b569e scripts: sercomm-kernel-header.py: improve compatibility
This improves compatibility with the elder stock firmwares of the
following devices, which have not yet been merged into OpenWrt:
 - Beeline SmartBox Pro
 - Beeline SmartBox Turbo+
 - WiFire S1500.NBN

Without this, OpenWrt factory image installation may fail.

Signed-off-by: Mikhail Zhilkin <csharper2005@gmail.com>
Signed-off-by: Maximilian Weinmann <x1@disroot.org>
(cherry picked from commit 35a4418d3966ccf6229916b0021bd18871ef22dd)
2023-06-17 12:59:37 +02:00
Tianling Shen
bb536758ea
Merge Official Source
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2023-06-14 15:08:29 +08:00
Mathew McBride
ded67a320c
scripts: qemustart: change armvirt references to armsr
The armvirt target has been renamed to 'armsr' (Arm SystemReady)
after inclusion of EFI support.
Change references (including subtargets) accordingly.

Signed-off-by: Mathew McBride <matt@traverse.com.au>
(cherry picked from commit 36bf9d861082d30fdb1cf1d00f819e60b8bb84a7)
2023-06-13 14:14:34 +02:00
Mathew McBride
ddb8845bd6
scripts: gen_image_generic: allow the partition types to be set
The use case for this is to set the kernel partition as the
EFI system partition. Versions of U-Boot with the
EFI boot manager (eficonfig and efidebug commands) will
store their boot order data on the ESP.

Signed-off-by: Mathew McBride <matt@traverse.com.au>
(cherry picked from commit 701d774f54aef2f9fe3c584700773dcb260dd03c)
2023-06-13 14:12:27 +02:00
Tianling Shen
42b2588152
Merge Official Source
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2023-06-10 17:10:59 +08:00
Daniel Golle
d05d886d22 image: improve uImage.FIT device tree overlay support
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>
(cherry picked from commit 6b01d40bfedb42323a1324e1b5624f192a4c91de)
2023-06-09 19:23:03 +01:00
Tianling Shen
2ca84c2453 Merge Official Source
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2023-05-19 11:51:16 +08:00
Tim Harvey
7519b35881 scripts/gen_image_generic.sh: allow passing in partition offset
Allow passing in an optional offset (PARTOFFSET) for the first partition.
If not specified this will default to 256K (512 blocks) as it has before.

For example if you want to start partition data at a 16M offset instead
of 256K, specify 'PARTOFFSET=16M'.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
2023-05-18 16:17:52 +02:00
Paul Spooren
7611b330bb Revert "scripts: run ipkg-make-index through shellcheck"
This reverts commit e6aa1a70e6c870cfeac838b52ad57b6888e6629d.
2023-05-09 21:32:26 +02:00
Paul Spooren
e6aa1a70e6 scripts: run ipkg-make-index through shellcheck
Use quotes and replace `` by $() to pass the shellcheck tests.

Signed-off-by: Paul Spooren <mail@aparcar.org>
2023-05-09 19:06:23 +02:00
Tianling Shen
98bb1a6344
Revert "scripts/feeds: use partial clone for git submodule update"
Unfortunately this feature requires very recent git version.

This reverts commit b6cc644e1f6a6a9824d85ea4fdb7c058339e923c.

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2023-04-29 12:29:39 +08:00
Tianling Shen
b6cc644e1f
scripts/feeds: use partial clone for git submodule update
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2023-04-29 11:41:12 +08:00
Glen Huang
3151477727
scripts/feeds: use partial clone for src-git-full
Partial clone is much faster without clipping history

Signed-off-by: Glen Huang <me@glenhuang.com>
[also apply to include/download.mk]
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2023-04-29 11:22:05 +08:00
Tianling Shen
c958bed9d5
Merge Official Source
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2023-04-10 18:37:10 +08:00
Álvaro Fernández Rojas
0cdc257b8d scripts: sercomm-pid: add bmips support
Apparently, Sercomm sets 2 padding bytes instead of 1 (ramips).
The HW version is a bit different than the one used for ramips.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2023-04-09 10:01:03 +02:00
Álvaro Fernández Rojas
8382c5662e scripts: sercomm-payload: add PID file support
Allow passing Sercomm PID from file.
Until now, Sercomm PID could only be passed as an array of hex bytes.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2023-04-09 09:55:57 +02:00
Tianling Shen
3ddf2d6612
download.pl: update cdn domain
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2023-03-15 17:44:32 +08:00