Commit Graph

1131 Commits

Author SHA1 Message Date
Petr Štetiar
f5f79d2828
scripts: prplos_version.sh: mark development version as 5.1.0
Development on next prplOS release 5.1.0 started, so lets mark the
version accordingly.

Signed-off-by: Petr Štetiar <petr.stetiar@prplfoundation.org>
2026-06-05 19:27:38 +02:00
Petr Štetiar
635e246c9c
scripts: prplos_version.sh: mark development version as 5.0.0
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>
2026-03-25 12:06:34 +01:00
Volodymyr Martysh
e45e20d224 scripts: gen_config: replace built-in set[str] with Set[str] for Python 3.8 compatibility
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>
2025-12-09 16:43:04 +00:00
Volodymyr Martysh
016a5b7eef scripts: gen_config: Double-inclusion processing code could fail
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>
2025-12-09 16:43:04 +00:00
Volodymyr Martysh
add1b5884b scripts: gen_config: Wrong order of profiles being included by gen_config.py
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>
2025-12-03 16:44:13 +00:00
Petr Štetiar
aef5f01ae9
scripts: prplos_version.sh: mark development version as 4.2.0
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>
2025-10-11 07:54:42 +00:00
Roman Shcherbakov
098a0f1159 scripts: gen_config: new features to remove package and include profiles
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>
2025-10-06 11:56:09 +03:00
Petr Štetiar
90f98b91e6
scripts: prplos_version: adapt for prplware Git version tags
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)
2025-09-11 06:10:24 +00:00
Nikolai Merinov
a94d35fdee scripts: gen_config: force install "additional_packages" even if they provided from other feeds
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>
2025-08-22 07:57:21 +00:00
Petr Štetiar
68210dd0d7
scripts/mkits.sh: improve error handling for required parameters
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>
2025-08-01 05:49:44 +00:00
Petr Štetiar
0894b55ce2
scripts: prplos_version.sh: mark development version as 4.1.0
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)
2025-07-31 15:29:46 +00:00
Nikolai Merinov
3d908b5466
scripts: gen_config: align "list" command implementation with profile search logic
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>
2025-07-31 15:29:39 +00:00
Cedric CHEDALEUX
437a015e3a
scripts: gen_config: add support for external profiles
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>
2025-07-31 15:28:50 +00:00
Cedric CHEDALEUX
1a25026b78
scripts: gen_config: add support for local feeds
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>
2025-07-31 15:28:49 +00:00
Petr Štetiar
62827e3d83
scripts: gen_config.py: fix typo causing broken symlinks for feed packages
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>
2025-07-31 15:28:06 +00:00
John Crispin
d17630782d
scripts/gen_config.py: use -f when installing target feeds
This allows overriding target folders from feeds.

Signed-off-by: John Crispin <john@phrozen.org>
2025-07-31 15:27:35 +00:00
Petr Štetiar
ca25d241e2
scripts: prplos_version.sh: mark development version as 4.0.0
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>
2025-07-31 15:25:48 +00:00
Matthias FRANCK
191ad535f9
scripts: gen_config.py: keep feed order
This way custom feeds can override default feeds.

Signed-off-by: Toon Caeyers <toon.caeyers_ext@softathome.com>
2025-07-31 15:22:24 +00:00
Piotr Nakraszewicz
c24217adce
scripts: gen_config: allow to remove a package
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>
2025-07-31 15:22:10 +00:00
Petr Štetiar
ba3ed65753
scripts: prplos_version.sh: mark development version as 3.2.0
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>
2025-07-31 15:21:18 +00:00
Petr Štetiar
ffd72408ac
scripts: gen_config.py: allow only use of Git hashes for feed revisions in profiles
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>
2025-07-31 15:21:05 +00:00
Cedric DOURLENT
8eaacac69a
build: add support for checksec.sh based mitigation reports
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>
2025-07-31 15:20:37 +00:00
Petr Štetiar
8fbd2c3772
scripts: prplos_version.sh: mark development version as 3.1.0
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>
2025-07-31 15:18:14 +00:00
John Crispin
2eacc18b31
backport: scripts/feeds: add a new command that allows generating a new feeds.conf
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)
2025-07-31 10:36:15 +00:00
Petr Štetiar
14f4f27342
version.mk: introduce prplOS Git based versioning
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>
2025-07-31 10:34:07 +00:00
Petr Štetiar
773825c18e
scripts: gen_config.py: install additional_packages in one go
To avoid quite costly parsing step on each additional package install.

Signed-off-by: Petr Štetiar <ynezz@true.cz>
2025-07-31 10:33:00 +00:00
Petr Štetiar
3e477e899f
scripts: gen_config.py: add verbose command logging
Output all commands when environment variable GENCONFIG_VERBOSE is set.

Signed-off-by: Petr Štetiar <ynezz@true.cz>
2025-07-31 10:32:59 +00:00
Petr Štetiar
17a03e5b82
scripts: gen_config.py: disable stdout output buffering
Python3 line buffers stdout which makes script output confusing so lets
disable it.

Signed-off-by: Petr Štetiar <ynezz@true.cz>
2025-07-31 10:32:58 +00:00
Petr Štetiar
cc2a4fc6fd
scripts: copy gen_config.py from prplOS v1.5 release
So we can use it for config generation from profiles.

Signed-off-by: Petr Štetiar <ynezz@true.cz>
2025-07-31 10:31:19 +00:00
Felix Fietkau
787072906d build: ipkg-remove: fix source name / package confusion, optimize
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)
2025-07-17 10:46:39 +02:00
Eric Fahlgren
c99d356747 package: rework contents of package index.json
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>
2025-06-11 19:12:09 +02:00
Eric Fahlgren
52d4559fe1 imagebuilder: exclude metadata for profiles that have no kernel
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>
2025-05-10 12:12:26 +02:00
Cedric CHEDALEUX
9836836302 scripts/feeds: shallow clone submodules
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)
2025-03-04 12:01:44 +01:00
Cedric CHEDALEUX
efffa8a608 scripts/feeds: shallow clone for specific commit update
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)
2025-03-04 12:01:38 +01:00
Petr Štetiar
8f0d52d8c4
scripts: download-check-artifact.sh: fix shellcheck and improve
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>
2024-11-28 18:47:07 +00:00
David S. H. Rosenthal
2942ee0a8d
scripts: add download-check-artifact.sh script
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>
2024-11-28 18:47:05 +00:00
Eric Fahlgren
7ef734deac
build: profiles.json: add kernel version information
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#17036
Fixes: 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)
2024-11-26 22:48:38 +00:00
Christian Marangi
377b66990b
build: introduce support to declare skip package
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>
2024-10-29 00:07:54 +01:00
Christian Marangi
07159cc25a
Revert "scripts/download.pl: read file natively"
This reverts commit 65560de58d.

Seems to broke CI and require more testing.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2024-10-27 15:58:16 +01:00
Matteo Croce
65560de58d
scripts/download.pl: read file natively
Read files natively instead of execing /bin/cat.

Signed-off-by: Matteo Croce <teknoraver@meta.com>
Link: https://github.com/openwrt/openwrt/pull/16784
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2024-10-27 14:24:32 +01:00
Hauke Mehrtens
b8816343fb scripts: Add script to reorder kernel config-* files
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>
2024-10-22 21:13:26 +02:00
Markus Stockhausen
3098b4bf07 scripts: linksys-image: add NAND devices
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>
2024-10-22 10:10:17 +02:00
Matteo Croce
6e40f98208 scripts/download.pl: use perl builtins instead of system()
Perl natively supports renaming files and create directories.
Do it without calling system().

Signed-off-by: Matteo Croce <teknoraver@meta.com>
Link: https://github.com/openwrt/openwrt/pull/16542
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-10-12 21:59:15 +02:00
Markus Stockhausen
3d7040b7d6 realtek: scripts: fix error in belkin-header
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>
2024-10-11 23:37:09 +02:00
Thomas Richard
51e083426b scripts/feeds: force kernel package scan after a target installation
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>
2024-10-10 21:51:43 +02:00
Markus Stockhausen
d03f3dcf3b realtek: add support for Linksys LGS310C
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>
2024-10-02 20:15:21 +02:00
Robert Marko
45bd222ea1 scripts: config.guess: update to 2024-07-27
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>
2024-09-28 22:48:47 +02:00
Hannu Nyman
f68dcce3bb scripts/feeds: Support feed update with git pull --rebase --autostash
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>
2024-09-08 18:54:42 +02:00
Hannu Nyman
ef720b1e09 scripts/feeds: Support feed update with git pull --rebase
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>
2024-09-08 18:54:41 +02:00
Christian Marangi
3b83d393dd
scripts/download.pl: fix broken link for KERNEL projects
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>
2024-06-19 14:30:06 +02:00