For some reason the new belkin-header.py script works without issues
in a local Fedora build environment. In the OpenWrt build pipeline it
produces the following errors:
Traceback (most recent call last):
File "/builder/shared-workdir/build/scripts/belkin-header.py", line 92, in <module>
head = create_header(buf, args.belkin_header, args.belkin_model)
File "/builder/shared-workdir/build/scripts/belkin-header.py", line 68, in create_header
head[28:29] = VERSION1.to_bytes(1)
TypeError: to_bytes() missing required argument 'byteorder' (pos 2)
This may be related due to different python version. Fix this by
handing over the needed parameters
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/16667
Signed-off-by: Robert Marko <robimarko@gmail.com>
When a target is installed from a feed, the linux kernel package is scanned
before the installation of this target.
If some kernel module packages are defined in this feeds at the target
level, there were not parsed during the scan of linux kernel package, as
the target didn't exist yet. So these kernel module packages don't exist.
Once the target is installed, clean the linux kernel packageinfo to force
the scan of the linux kernel package next time this script (or the make
command) is called.
Signed-off-by: Thomas Richard <thomas.richard@bootlin.com>
Link: https://patchwork.ozlabs.org/project/openwrt/patch/mailman.117548.1727195440.1280.openwrt-devel@lists.openwrt.org/
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Hardware specification
----------------------
* RTL8380M SoC, 1 MIPS 4KEc core @ 500MHz
* 256MB DRAM
* 32MB NOR Flash
* 8 x 10/100/1000BASE-T ports
* 2 x SFP ports
* Power LED, Fault LED
* Reset button on front panel
* UART (115200 8N1) via populated standard pin header marked JP1
TODO: The SFP ports use a shared SCL GPIO that the driver cannot handle.
The left SFP port (lan9) is defined and fully functional while the laser
on the right SFP port (lan10) is off by default.
UART pinout
-----------
[o]ooo|JP1
| ||`------ GND
| |`------- RX
| `-------- TX
`---------- Vcc (3V3)
Installation using OEM webinterface
-----------------------------------
1. Make sure you are running OEM firmware in secondary slot
2. Install squashfs-factory.imag to primary slot by upload via http
Installation using serial interface
-----------------------------------
1. Press "a" "c" "p" during message "Enter correct key to stop autoboot"
2. Load image with "upgrade runtime <TFTP IP>:squashfs-sysupgrade.bin" command
3. Switch to primary slot with "setsys bootpartition 0"
4. Store config with "savesys"
5. Boot the image with `boota` command
Dual-boot with stock firmware using writable u-boot-env
-------------------------------------------------------
From stock to OpenWrt / primary image 1 (CLI as admin):
- > boot system image1
- > reboot
From OpenWrt to stock / boot image 2: (shell as root)
- # fw_setsys bootpartition 1
- # reboot
Debrick using serial interface
------------------------------
1. Press "a" "c" "p" during message "Enter correct key to stop autoboot"
2. Load vendor image with "upgrade runtime <TFTP IP>:LGS310xxxxx.imag"
3. switch to primary partition "setsys bootpartition 0"
4. safe config "savesys"
Further documentation
---------------------
See https://openwrt.org/toh/linksys/lgs352c
It has been developed and tested on device with v1 revision.
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/16068
[Add missing 'w' in name of firmware partition]
Signed-off-by: Sander Vanheule <sander@svanheule.net>
This script hasn't seen an update in multiple years, update it to the
latest version provided upstream.
Both `config.guess` and `config.sub` are copied from upstream[1] and not
modified.
The full changelog is available within the upstream repository[1].
[1]: https://git.savannah.gnu.org/git/config.git
Link: https://github.com/openwrt/openwrt/pull/16536
Signed-off-by: Robert Marko <robimarko@gmail.com>
Add feed update option '-s' that performs 'git pull --rebase --autostash':
* possible local uncommited changes are autostashed before pull,
* local commits are then rebased on top of the new commits pulled
from origin and
* finally git does 'stash pop'.
This enables feed update while there are local development commits
and possibly also local uncommited changes.
Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
Link: https://github.com/openwrt/openwrt/pull/15377
Signed-off-by: Robert Marko <robimarko@gmail.com>
Add feed update option '-r' to perform "git pull --rebase" so that
possible local commits are rebased on top of the new commits pulled
from origin. That enables git pull while there are local
development commits.
Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
Link: https://github.com/openwrt/openwrt/pull/15377
Signed-off-by: Robert Marko <robimarko@gmail.com>
Fix broken link generation for KERNEL projects.
Using $1 in projectsmirrors sub was still referencing the caller $1
instead of the remaining args of projectsmirrors sub.
Use shift and put the second arg of projectsmirrors sub in $append to
correctly handle the sub args.
Fixes: 465cf35888 ("scripts/download.pl: detach mirror URLs from script file")
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Detach URL from download script to make it easier to change and update
the URLs.
The mirror list is moved to a JSON file in the scripts directory called
projectsmirrors.json.
Link: https://github.com/openwrt/openwrt/pull/15745
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
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>
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>
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>
Prior e8725a932e, version used to be
VERSION:=$(PKG_VERSION)-$(PKG_RELEASE)
After e8725a932e, the version is:
VERSION:=$(PKG_VERSION)-r$(PKG_RELEASE)
Hence the gen_*_cyclonedxsbom functions need to be updated to remove
the trailing -r prefix in the version in order to generate correct
version info in the SBOM.
Signed-off-by: Akshay Bhat <nodeax@gmail.com>
Fix revision calculation when local branch is rebased on new "main" branch
instead of "master".
Signed-off-by: Marius Dinu <m95d+git@psihoexpert.ro>
Link: https://github.com/openwrt/openwrt/pull/15538
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
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>
Text of a commit message body should wrap at 75 characters. Manual commits
are expected to do so, but automated commits *must* do so to avoid adding
repeated ugly commits.
Signed-off-by: Tony Ambardar <itugrok@yahoo.com>
Apart from being misspelled ('dymamic' vs. 'dynamic') and a mismatch of
the number of parameters, there is also simply no need to add the 'dynamic'
volume type keyword as 6th parameter as that's the default anyway.
Fix and simplify the ubinize-image.sh script to work as intended.
Fixes: 6c17d71973 ("scripts: ubinize-image.sh: support static volumes, make size optional")
Reported-by: Hannu Nyman <hannu.nyman@iki.fi>
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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 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>
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>
`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>
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>
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>