summaryrefslogtreecommitdiffstats
path: root/scripts
Commit message (Collapse)AuthorAgeFilesLines
* build: add explicit --no-show-signature for gitOto Šťáva2024-02-201-2/+2
| | | | | | | | | | | | | 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>
* scripts: ubinize-image.sh: fix on POSIX shell, allow custom imagesDaniel Golle2024-02-161-16/+17
| | | | | | | | | | 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>
* scripts: ubinize-image.sh: support static volumes, make size optionalDaniel Golle2024-02-151-9/+21
| | | | | | | | | | | | | | | | 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>
* scripts/rstrip.sh: ignore /lib/firmwareFelix Fietkau2024-01-221-1/+1
| | | | | | | 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>
* scripts: fix installed-size calculationPaul Spooren2024-01-081-1/+1
| | | | | | | | | | 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>
* packages: store URL in ManifestPaul Spooren2024-01-081-0/+2
| | | | | | | | 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>
* build: ensure silent Make behavior for json scriptsMichael Pratt2024-01-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | 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>
* image: fix Linksys image alignment and simplify footer creationTony Ambardar2023-11-261-64/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* scripts: sercomm-pid.py: use uppercase hwid in pidMikhail Zhilkin2023-11-251-1/+1
| | | | | | | | | | | | | | | | | 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>
* scripts/dump-target-info.pl: add new function to DUMP devicesChristian Marangi2023-11-151-1/+79
| | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* scripts/getver.sh: prevent asking for negative rev-parseChristian Marangi2023-11-121-1/+1
| | | | | | | | | | | | | | 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>
* build: replace `true` with a custom noop scriptIlya Katsnelson2023-11-031-0/+2
| | | | | | | `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>
* build: use long hashes when generating feed.buildinfoSandro Jäckel2023-11-021-3/+3
| | | | | | | | | | | 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>
* build: add CycloneDX SBOM JSON supportPetr Štetiar2023-11-012-8/+219
| | | | | | | | | | | | | 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>
* package-dumpinfo,metadata: add ABI version information to package indexPetr Štetiar2023-11-011-0/+1
| | | | | | | | | 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>
* package-metadata: add CPE information to JSON package manifestsPetr Štetiar2023-11-012-0/+2
| | | | | | | | | | 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>
* scripts/ext-toolchain: implement external GCC version detectionChristian Marangi2023-10-201-0/+22
| | | | | | | | | | | | | | | | | Some package may needs to enable compatibility option based on the GCC version. Currently the GCC version is set based on the default value and doesn't actually reflect the real value provided by the external toolchain if used. Fix this by correctly detecting the GCC version in the external toolchain and set the correct value in CONFIG_GCC_VERSION. A new option is added in menuconfig to manually set the GCC version if needed. Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
* Delete arm-magic scriptLinus Walleij2023-10-041-42/+0
| | | | | | | | | This script was used to modify the wrong machine type passed from the boot loader to the kernel. The device tree kernels does not use the machine type so this script is no longer needed. Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
* scripts/download.pl: Remove stale download sites and convert to httpsHannu Nyman2023-09-161-22/+15
| | | | | | | | | | | Remove the stale site definitions from @APACHE, KERNEL etc. * Remove site that had dropped APACHE * Remove KERNEL site leading to wrong directory * Remove dead sites * Convert ftp/http URLs to https, if possible. Remove duplicate Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
* scripts/download.pl: remove stale GNOME download sitesHannu Nyman2023-09-011-6/+2
| | | | | | | | | Remove stale sites from @GNOME alias: * remove 2 sites that have stale 3 years old content * remove 2 sites that have dropped GNOME * convert 2 sites from FTP to HTTP Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
* scripts/package-metadata.pl: strip already selected conditions from dependenciesFelix Fietkau2023-09-011-0/+2
| | | | | | | | When a dependency is pulled in via conditional depends, and the condition is already selected earlier in the chain, drop the condition. This avoids some corner cases that trigger recursive dependencies. Signed-off-by: Felix Fietkau <nbd@nbd.name>
* Revert "scripts/package-metadata.pl: fix handling transitive conditional ↵Felix Fietkau2023-09-011-3/+3
| | | | | | | | | | dependencies" This reverts commit 6c3eff9dd8bb8d0f268e8a0dbedbc6a33bdac796. This appears to cause some regressions in generated config. Will be replaced with a fixed version later Signed-off-by: Felix Fietkau <nbd@nbd.name>
* scripts/package-metadata.pl: sort dependency keysFelix Fietkau2023-09-011-1/+1
| | | | | | | This makes it easier to keep track of changes in the generated output, when the script is modified Signed-off-by: Felix Fietkau <nbd@nbd.name>
* scripts/package-metadata.pl: fix handling transitive conditional dependenciesFelix Fietkau2023-09-011-3/+3
| | | | | | | | | | When a package foo depends on PACKAGE_foo:bar (in order to make build dependencies conditional), tracking transitive dependencies can fail because the internal seen flag is checked/set before eliminating the fake conditional dependency. This can show up as a depends on not properly turned into a select further down in the dependency chain Signed-off-by: Felix Fietkau <nbd@nbd.name>
* scripts: qemustart: Fix x86/legacy bootupHauke Mehrtens2023-08-141-2/+2
| | | | | | | 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>
* build: make git sub-modules to fetch configurableKarsten Sperling2023-07-281-1/+5
| | | | | | | | | | | | | Currently the git protocol downloads all submodules of the target repository. This can be unwieldy for repositories with a lot of submodules where only a subset are required in the context of the OpenWrt build. This change adds a PKG_SOURCE_SUBMODULES variable to configure this behavior. It takes a space-separated list of submodule paths, or the word "skip" to disable submodule downloads entirely. The default is to download all submodules, i.e. preserving current behavior. Signed-off-by: Karsten Sperling <ksperling@apple.com>
* mediatek: add support for ZyXEL NWA50AX ProDavid Bauer2023-07-211-0/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* build: fix generation of large .vdi imagesAdones Pitogo2023-07-151-2/+8
| | | | | | | | | | | 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>
* scripts/mkits.sh: DT overlays don't need a loadaddrDaniel Golle2023-07-121-7/+0
| | | | | | | 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>
* build: add ALT5 vendor/model/variantWenli Looi2023-07-081-1/+1
| | | | | | This allows adding another device variant. Signed-off-by: Wenli Looi <wlooi@ucalgary.ca>
* scripts: use sep-char for hash nodesDavid Bauer2023-07-081-10/+10
| | | | | | | | | 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>
* image: add additional fields to Netgear encrypted imageWenli Looi2023-07-011-2/+13
| | | | | | | | | | | | | | | | 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>
* ath79: Add support for MOXA AWK-1137CMaximilian Martin2023-06-251-0/+109
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Device specifications: ====================== * Qualcomm/Atheros AR9344 * 128 MB of RAM * 16 MB of SPI NOR flash * 2x 10/100 Mbps Ethernet * 2T2R 2.4/5 GHz Wi-Fi * 4x GPIO-LEDs (1x wifi, 2x ethernet, 1x power) * 1x GPIO-button (reset) * 2x fast ethernet - lan1 + builtin switch port 1 + used as WAN interface - lan2 + builtin switch port 2 + used as LAN interface * 9-30V DC * external antennas Flashing instructions: ====================== Log in to https://192.168.127.253/ Username: admin Password: moxa Open Maintenance > Firmware Upgrade and install the factory image. Serial console access: ====================== Connect a RS232-USB converter to the maintenance port. Pinout: (reset button left) [GND] [NC] [RX] [TX] Firmware Recovery: ================== When the WLAN and SYS LEDs are flashing, the device is in recovery mode. Serial console access is required to proceed with recovery. Download the original image from MOXA and rename it to 'awk-1137c.rom'. Set up a TFTP server at 192.168.127.1 and connect to a lan port. Follow the instructions on the serial console to start the recovery. Signed-off-by: Maximilian Martin <mm@simonwunderlich.de>
* scripts: sercomm-kernel-header.py: improve compatibilityMikhail Zhilkin2023-06-111-3/+3
| | | | | | | | | | | | | 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>
* scripts: qemustart: change armvirt references to armsrMathew McBride2023-06-101-9/+9
| | | | | | | | 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>
* image: improve uImage.FIT device tree overlay supportDaniel Golle2023-06-051-6/+3
| | | | | | | | | | 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>
* scripts: gen_image_generic: allow the partition types to be setMathew McBride2023-06-021-1/+3
| | | | | | | | | 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>
* scripts/gen_image_generic.sh: allow passing in partition offsetTim Harvey2023-05-181-1/+1
| | | | | | | | | | 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>
* Revert "scripts: run ipkg-make-index through shellcheck"Paul Spooren2023-05-091-6/+6
| | | | This reverts commit e6aa1a70e6c870cfeac838b52ad57b6888e6629d.
* scripts: run ipkg-make-index through shellcheckPaul Spooren2023-05-091-6/+6
| | | | | | Use quotes and replace `` by $() to pass the shellcheck tests. Signed-off-by: Paul Spooren <mail@aparcar.org>
* scripts: sercomm-pid: add bmips supportÁlvaro Fernández Rojas2023-04-091-5/+11
| | | | | | | 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>
* scripts: sercomm-payload: add PID file supportÁlvaro Fernández Rojas2023-04-091-2/+18
| | | | | | | 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>
* scripts: size_compare: print a grand totalAndre Heider2023-02-031-1/+4
| | | | | | | | | | | Usefull to check the impact of treewide changes: Change Local Remote Package +281 6191 5910 ubus -547 56166 56713 procd -13294 91544 104838 ubi-utils ~~~~~~~ total change -13560 Signed-off-by: Andre Heider <a.heider@gmail.com>
* scripts: size_compare: fix support for CONFIG_BINARY_FOLDERAndre Heider2023-02-031-8/+11
| | | | | | | | There is no CONFIG_BINARY_DIR, it's CONFIG_BINARY_FOLDER. While at it, don't parse the shell compatible .config, eval it. Signed-off-by: Andre Heider <a.heider@gmail.com>
* scripts: qemustart: support CONFIG_BINARY_FOLDERAndre Heider2023-02-031-1/+2
| | | | | | | | | | If CONFIG_BINARY_FOLDER is set in .config, use that instead of "bin" as the bindir. That allows to set that config and easily run e.g. `./scripts/qemustart armvirt 32`. Signed-off-by: Andre Heider <a.heider@gmail.com>
* build: add ALT3 and ALT4 vendor/model/variantWenli Looi2023-01-251-1/+1
| | | | | | This is needed for the Netgear EX7300 series v2. Signed-off-by: Wenli Looi <wlooi@ucalgary.ca>
* scripts: ext-tools: add option to only refresh timestampsChristian Marangi2023-01-231-4/+20
| | | | | | | It's possible to have prebuilt tools already extracted. Add option to just refresh the timestamps. Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
* scripts: ext-tools: follow links for host tools pathChristian Marangi2023-01-231-1/+1
| | | | | | | Host tools path may be a symbolic link. Use -H with find to follow path links passed from command line to find command. Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
* scripts/dl_github_archieve.py: fix generating unreproducible tarChristian Marangi2023-01-121-1/+1
| | | | | | | | | | | | | | | Allign dl_github_archieve.py to 8252511dc0b5a71e9e64b96f233a27ad73e28b7f change. On supported system the sigid bit is applied to files and tar archieve that on tar creation. This cause unreproducible tar for these system and these bit should be dropped to produce reproducible tar. Add the missing option following the command options used in other scripts. Fixes: 75ab064d2b38 ("build: download code from github using archive API") Suggested-by: Eneas U de Queiroz <cotequeiroz@gmail.com> Tested-by: Robert Marko <robimarko@gmail.com> Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
* scripts: add Apache fastly mirrorDavid Bauer2023-01-071-0/+1
| | | | | | | Add the Apache fastly mirror as preferred download source. This service is using a dual-stacked CDN. Signed-off-by: David Bauer <mail@david-bauer.net>