Allow to specify a branch without a commit ID to always use the branch
head which is handy for development purpose.
Implements: PCF-1869
Tracked-by: FEAT-29
Signed-off-by: Mohamed-nour Toumi <mohamed.toumi_ext@softathome.com>
Development on next prplOS release 5.0.0 started, so lets mark the
version accordingly.
References: PCF-2479
Link: https://prplfoundationcloud.atlassian.net/wiki/x/AQCcYQ
Signed-off-by: Petr Štetiar <petr.stetiar@prplfoundation.org>
Python before 3.9 release does not support the built-in generic type syntax "set[str]".
To ensure compatibility, imported "Set" from the "typing" module and updated type annotations.
Fixes: PPW-1115
Signed-off-by: Volodymyr Martysh <v.martysh@inango-systems.com>
The add1b5884b commit introduced
a mechanism to skip second inclusion of the manifests. This code
contained a typo that lead to script crash when single profile
actually included twice.
Current commit fixes the typo.
Fixes: PPW-1115
Signed-off-by: Volodymyr Martysh <v.martysh@inango-systems.com>
Problem:
Included profiles were processed only after all command-line profiles,
which broke the expected recursive include order.
Fix:
Implement recursive profile loading so each profile processes its own
'includes' before moving to the next CLI profile. Added 'seen' set to
avoid duplicates and circular includes.
Fixes: PPW-1115
Signed-off-by: Volodymyr Martysh <vmartysh@maxlinear.com>
Development on next prplOS release 4.2.0 started, so lets mark the
version accordingly.
References: PCF-2123
Signed-off-by: Petr Štetiar <petr.stetiar@prplfoundation.org>
Add processing two new sections in gen_config.py:
* include: add the possibility to include one profile into another;
* packages_remove: add separate section to remove some packages.
References: PCF-1849, FEAT-84
Signed-off-by: Roman Shcherbakov <r.shcherbakov@inango-systems.com>
It was decided, that prplOS releases should be actually prplWare
releases, so we've renamed prplos-vX.Y.Z Git tags to prplware-vX.Y.Z
since prplWare 4.0.1 release.
So lets adapt the versioning script to support that new Git tag scheme.
Signed-off-by: Petr Štetiar <petr.stetiar@prplfoundation.org>
(cherry picked from commit 4b55e8c58fd0a0c94b7c689685c871d2355ed7e5)
OpenWRT's "./scripts/feeds install -f -p feed packagename" command forecufully
install package from selected feed if there is no installed package with same
packagename, or if there package with same packagename in core packages. If
there is package with same packagename in other feed then installation would
not happen.
In order to forecully install packages mentioned in "additional_packages"
configuration we should uninstall packages with same name firstly.
With this modification the following scenario would work:
Two feeds contains name "packagename" package
feeds/feed1/packagename/Makefile
feeds/feed2/packagename/Makefile
Profiles installs both this feeds and selects exact feed that should
provide the package:
feeds:
- name: feed1
- name: feed2
additional_packages:
- feed: feed2
packages:
- packagename
References: PCF-1866
Signed-off-by: Nikolai Merinov <n.merinov@inango-systems.com>
Currently the script will exit with usage information and an error if a required
parameter is missing, but it actually doesn't provide any information about which
parameter is missing, so its quite tedious to find out which parameter is missing.
So lets fix it by adding a function to check for missing parameters and printing
a proper error message with the missing parameter(s):
Error: Missing required parameters:
CONFIG (-c): config name
Usage: mkits.sh -A arch -C comp -a addr -e entry -v version -k kernel [-D name -n address -d dtb] -o its_file -c config_name
...
While at it, harmonize the shebang with other shell scripts and thus as
well allow usage of more advanced bash features.
Additionally fix the missing usage description of `-c` argument.
Upstream-Status: Submitted [https://github.com/openwrt/openwrt/pull/18524]
Signed-off-by: Petr Štetiar <ynezz@true.cz>
Signed-off-by: Petr Štetiar <petr.stetiar@prplfoundation.org>
Development on next prplOS release 4.1.0 started, so lets mark the
version accordingly.
References: PCF-1574
Signed-off-by: Petr Štetiar <petr.stetiar@prplfoundation.org>
(cherry picked from commit 0b894a34a48d6f4d6182a7330bacffa30279db6f)
Previous change, that introduced the "GENCONFIG_PROFILE_DIRS" environment variable,
broke the "gen_config.py list" command.
Align "list" command implementation with a way how "gen_config.py" search profiles
currently. If several directories contains profiles with same name then profile
that printed earlier in "gen_config.py list" output would take precedence.
Reference: PCF-1852
Signed-off-by: Nikolai Merinov <n.merinov@inango-systems.com>
When developing locally, we often need to load profiles that are not
upstreamed (e.g. not in ./profiles directory).
gen-config now supports a list of directories where profiles can be
located. Upstream profiles can be loaded along with local profiles by
setting GENCONFIG_PROFILE_DIRS="./profiles:/opt/mylocalprofiles".
Upstream profiles can even be overriden by local profiles since the
last directory takes precedence over previous directories in the list.
Implements: PCF-1690
Signed-off-by: Cedric CHEDALEUX <cedric.chedaleux@orange.com>
To point to a local feed, the 'method' key of the feed section can be set
to 'src-link' in a profile YAML file. However, the script first checks that
a revision is specified and aborts if not. This check is useless for a local feed.
Let's only check the 'revision' field for 'git-src' and 'git-src-full'
methods which are the only ones that supports a specific revision.
Signed-off-by: Cedric CHEDALEUX <cedric.chedaleux@orange.com>
OpenWrt build system creates symlink package/feeds/<feed>/<package> for
each package being installed from the feeds. Currently the invocation of
gen_config.py script isn't idempotent, because it fails to remove those
symlinks, which in the end might lead to strange build issues due to
stale package symlinks.
So lets fix it by actually removing the directory with package symlinks.
Fixes: PCF-1812
Reported-by: Nikolay Merinov <n.merinov@inango-systems.com>
Signed-off-by: Petr Štetiar <petr.stetiar@prplfoundation.org>
Development on next prplOS release 4.0.0 started, so lets mark the
version accordingly.
References: PCF-1574
Signed-off-by: Petr Štetiar <petr.stetiar@prplfoundation.org>
The 'diffconfig' section was parsed before the packages sections.
Therefore it was not possible to remove a package that was once added in
a profile, in another, subsequent profile.
Like so for example:
./scripts/gen_config.py prpl override
Where the content of override.yml is:
diffconfig: |
# CONFIG_PACKAGE_cthulhu-lxc is not set
Fix this by parsing diffconfig section after packages sections.
Fixes: PCF-1587
Signed-off-by: Piotr Nakraszewicz <piotr.nakraszewicz@consult.red>
Development on next prplOS release 3.2.0 already started, so lets mark
the version accordingly.
Signed-off-by: Petr Štetiar <petr.stetiar@prplfoundation.org>
In the current setup, YAML profiles for feed revision references can
only use weak Git tag-based references, like so in profiles/prpl.yml:
```yaml
- name: feed_amx
uri: https://gitlab.com/prpl-foundation/prplos/feeds/feed_amx.git
revision: v11.9.0
- name: feed_gmap
uri: https://gitlab.com/prpl-foundation/prplos/feeds/feed_gmap.git
revision: v1.7.2
```
Git tags can be mutable, meaning they can be changed or moved. This
introduces a risk where the reproducibility of builds cannot be
guaranteed. Therefore, relying solely on Git tags for referencing
revisions is not ideal.
To enhance the reproducibility and reliability of the builds, the feed
Git revision should support either of the following:
1. Full Git SHA-1 hash of the Git object (a 40-character string).
2. Human-readable reference like a Git tag, followed by an @ separator
and then full (40-character) Git SHA
Examples of the currently only valid feed revisions:
```yaml
- name: feed_gmap
uri: <https://gitlab.com/prpl-foundation/prplos/feeds/feed_gmap.git>
revision: 178c8c0dea56bfe6e5f3d0af84be4b0156041291
- name: feed_gmap
uri: <https://gitlab.com/prpl-foundation/prplos/feeds/feed_gmap.git>
revision: v1.7.2@178c8c0dea56bfe6e5f3d0af84be4b0156041291
```
Closes: PCF-1388
Signed-off-by: Petr Štetiar <petr.stetiar@prplfoundation.org>
Checksec is a bash script to check the properties of executables (like
PIE, RELRO, Canaries, ASLR, Fortify Source).
Add an optional build feature, which when enabled is going to create a
JSON report about the state of mitigations in the produced binaries.
Upstream-Status: Submitted [https://github.com/openwrt/openwrt/pull/14569]
Signed-off-by: Cedric DOURLENT <cedric.dourlent@softathome.com>
OpenWrt 23.05 release is the new base for the upcoming prplOS 3.1.0
release, so lets mark the build versions accordingly.
Signed-off-by: Petr Štetiar <petr.stetiar@prplfoundation.org>
This can be used inside build setups for easy feeds.conf generation.
Signed-off-by: John Crispin <john@phrozen.org>
(cherry picked from commit f039f68dcbf26b424028f39f9dd80cd4c89ea9be)
Henceforth, we will utilize the prplOS version throughout the
development cycle, determined by the output of the `git describe`
command. The version will be composed of:
- The fixed version number of the upcoming release currently in
development.
- The abbreviated (8 characters) object hash of the most recent commit.
For instance, with the ongoing development of prplOS version 3.0.0 and
having the Git hash `5a2a69d`, the resulting version would be
`3.0.0-5a2a69d`.
References: PCF-691
Signed-off-by: Petr Štetiar <ynezz@true.cz>
The script always gets passed the package name, not the source name.
Optimize for the default case where the package name matches the
filename prefix.
Signed-off-by: Felix Fietkau <nbd@nbd.name>
(cherry picked from commit 471fd0a50281ce2a37fece402c4c5bd609b6d580)
Rework the generation of the index.json version of the package
indexes to match the original intent (i.e., for use by the ASU
server and other downstream projects). The current file contains
package names that have ABI versioning, making them unusable by ASU,
so we now remove the ABI suffixes.
Also adds a 'version' field to the json, so downstream utilities
can detect the new semantics of the package name fields.
Links: 218ce40cd7
Signed-off-by: Eric Fahlgren <ericfahlgren@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/19051
(cherry picked from commit 2b0b16f1d1571b23425b2d7ab5dc3816e2ceec12)
Link: https://github.com/openwrt/openwrt/pull/19097
Signed-off-by: Robert Marko <robimarko@gmail.com>
Device profiles that specify 'DEFAULT := n' are being included
in the imagebuilder metadata, specifically in .profiles.mk, even
though there is no kernel built for the device. This results in
'make info' showing the device as valid, but then 'make image
PROFILE=xxx' failing with 'No rule to make target xxx-kernel.bin ...'
We exclude these profiles from the imagebuilder, avoiding these
errors.
Fixes: https://github.com/openwrt/openwrt/issues/18410
Signed-off-by: Eric Fahlgren <ericfahlgren@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/18748
(cherry picked from commit b88f3ebb3341281fa7e61dc4f039062e72c86b9e)
Link: https://github.com/openwrt/openwrt/pull/18765
Signed-off-by: Robert Marko <robimarko@gmail.com>
When a feed has submodules, all its submodules are fully cloned whereas
the feed itself is shallowed. Let's be consistent and perform shallow clones
as well for the submodules.
Signed-off-by: Cedric CHEDALEUX <cedric.chedaleux@orange.com>
Link: https://github.com/openwrt/openwrt/pull/18003
Signed-off-by: Robert Marko <robimarko@gmail.com>
(cherry picked from commit 9ec32cfb2733856a2ab4caee07d9b3297568381d)
When a feed is referenced with a specific commit (i.e. <git_url>^<sha1>),
a full clone was performed and a branch was created from the sha1
and named with the sha1. Other git clones operations are shallowed.
As Git does not support clone at a specific commit, let's first perform
a shallow clone to latest commit, then fetch the relevant commit and
finally checkout it (no more 'pseudo' branch).
It saves bandwith and significantly speeds up the feed update process.
Signed-off-by: Cedric CHEDALEUX <cedric.chedaleux@orange.com>
Link: https://github.com/openwrt/openwrt/pull/18003
Signed-off-by: Robert Marko <robimarko@gmail.com>
(cherry picked from commit 32d0a57dc10811a24816e51f10e55963f40fe462)
Fixes following shellcheck's recommendations:
In scripts/download-check-artifact.sh line 24:
exit $1
^-- SC2086 (info): Double quote to prevent globbing and word splitting.
In scripts/download-check-artifact.sh line 53:
local sum="$(shasum -a 256 "$image_file")";
^-^ SC2155 (warning): Declare and assign separately to avoid masking return values.
In scripts/download-check-artifact.sh line 72:
cd "/tmp/verify.$$"
^-----------------^ SC2164 (warning): Use 'cd ... || exit' or 'cd ... || return' in case cd fails.
In scripts/download-check-artifact.sh line 114:
printf "Keyserver to use? [$keyserver_url] > "
^-- SC2059 (info): Don't use variables in the printf format string. Use printf '..%s..' "$foo".
In scripts/download-check-artifact.sh line 115:
read url; case "${url:-$keyserver_url}" in
^--^ SC2162 (info): read without -r will mangle backslashes.
While at it make it clear, that it is possible to download/check any
build artifacts like even SDK or ImageBuilder.
Link: https://github.com/openwrt/openwrt/pull/16871
(cherry picked from commit 27c2c140b16cb490f20c1c2259b3decf50ae5762)
Link: https://github.com/openwrt/openwrt/pull/17097
Signed-off-by: Petr Štetiar <ynezz@true.cz>
While checking wiki documentation about GPG signatures checking I found
this nice script and I've thought, that it would be nice to provide it
officially instead of some random internet site.
Usage example:
$ ./scripts/download-check-artifact.sh https://downloads.openwrt.org/snapshots/targets/mediatek/filogic/openwrt-mediatek-filogic-openwrt_one-squashfs-sysupgrade.itb
1) Downloading image file
=========================
########################################### 100.0%
2) Downloading checksum file
============================
########################################### 100.0%
3) Downloading the GPG signature
================================
########################################### 100.0%
4) Verifying GPG signature
==========================
gpg: Signature made Tue 05 Nov 2024 05:21:50 PM UTC
gpg: using EDDSA key 92C561DE55AE6552F3C736B82B0151090606D1D9
gpg: Good signature from "OpenWrt Build System (Nitrokey3) <contact@openwrt.org>" [ultimate]
Primary key fingerprint: 8A8B C12F 46B8 36C0 F9CD B36F 1D53 D187 7742 E911
Subkey fingerprint: 92C5 61DE 55AE 6552 F3C7 36B8 2B01 5109 0606 D1D9
5) Verifying SHA256 checksum
============================
openwrt-mediatek-filogic-openwrt_one-squashfs-sysupgrade.itb: OK
Verification done!
==================
Downloaded artifact placed in '/var/home/ynezz/dev/openwrt/openwrt.git/openwrt-mediatek-filogic-openwrt_one-squashfs-sysupgrade.itb'
Cleaning up.
Adding file in a state as downloaded from https://www.abitare.org/bin/download.sh
References: https://openwrt.org/docs/guide-quick-start/verify_firmware_checksum?s[]=gpg#linux
Signed-off-by: David S. H. Rosenthal <dshr@abitare.org>
Link: https://github.com/openwrt/openwrt/pull/16871
(cherry picked from commit 4c9031fda271ed7d4503642f63ff824faa6cc3a0)
Link: https://github.com/openwrt/openwrt/pull/17097
Signed-off-by: Petr Štetiar <ynezz@true.cz>
Currently downstream tools like ASU lack information about kernel
version to find out the relevant kmod build folder on downloads server.
So lets fix it by providing a new `linux_kernel` JSON array which would
for the start provide Linux kernel version, revision and vermagic
information.
"linux_kernel": {
"release": "1",
"vermagic": "b57450c07d3a786158c3601fc5cee57d",
"version": "6.6.61"
},
Fixes: openwrt/openwrt#17036Fixes: efahl/owut#9
Co-developed-by: Petr Štetiar <ynezz@true.cz>
Signed-off-by: Eric Fahlgren <ericfahlgren@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/17042
Signed-off-by: Petr Štetiar <ynezz@true.cz>
(cherry picked from commit c857145e034f623e31ab2028049a547ecd94ce85)
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>
This script will reorder the content of all config-* files in the target
folder. It will also remove duplicates. It will not remove options
already defined in the generic configuration.
Link: https://github.com/openwrt/openwrt/pull/16743
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
The larger switches of the Linksys LGS series (e.g. LGS352C) make
use of NAND. So the vendor firmware uses other commands to upload
an image through the WebUI.
Add the required scripts. With this we can upload an image to all
devices of that series. Independant of NOR or NAND.
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/16711
Signed-off-by: Robert Marko <robimarko@gmail.com>
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>