aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
Commit message (Collapse)AuthorAgeFilesLines
* 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> (cherry picked from commit 9e49e0a6c4535d345084cc62c594be5cad23b911)
* build: add CycloneDX SBOM JSON supportPetr Štetiar2023-11-022-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> (cherry picked from commit d604a07225c5c82b942cd3374cc113ad676a2519)
* package-dumpinfo,metadata: add ABI version information to package indexPetr Štetiar2023-11-021-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> (cherry picked from commit 649655f427932fe79b96a41f883c8054b1806191)
* package-metadata: add CPE information to JSON package manifestsPetr Štetiar2023-11-022-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> (cherry picked from commit 8562c65ff8aae3899cdb190319709500b7651492)
* scripts: qemustart: Fix x86/legacy bootupHauke Mehrtens2023-08-151-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> (cherry picked from commit 497012ab4eb1f37cbbbff9a766d2fecdb43dd0db)
* scripts: use sep-char for hash nodesDavid Bauer2023-07-261-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> (cherry picked from commit 2b133ab19cd5d741f3191f917c607667943f5f58)
* mediatek: add support for ZyXEL NWA50AX ProDavid Bauer2023-07-231-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> (cherry picked from commit f0445746f6fd96fc7c5394b238153bd2ff22bc5b)
* 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> (cherry picked from commit bdb4b78210cfb6bc8a6cda62fc990dd45ec3054c)
* scripts/mkits.sh: DT overlays don't need a loadaddrDaniel Golle2023-07-131-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> (cherry picked from commit cff3786bd54cec8276f1fd08d5c6697846f393a5)
* image: add additional fields to Netgear encrypted imageWenli Looi2023-07-131-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> (cherry picked from commit 0a1ebccc8702cadc50bc096f1e185472f3927786)
* scripts: sercomm-kernel-header.py: improve compatibilityMikhail Zhilkin2023-06-171-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> (cherry picked from commit 35a4418d3966ccf6229916b0021bd18871ef22dd)
* scripts: qemustart: change armvirt references to armsrMathew McBride2023-06-131-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> (cherry picked from commit 36bf9d861082d30fdb1cf1d00f819e60b8bb84a7)
* scripts: gen_image_generic: allow the partition types to be setMathew McBride2023-06-131-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> (cherry picked from commit 701d774f54aef2f9fe3c584700773dcb260dd03c)
* image: improve uImage.FIT device tree overlay supportDaniel Golle2023-06-091-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> (cherry picked from commit 6b01d40bfedb42323a1324e1b5624f192a4c91de)
* 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>
* scripts: remove redundant character '0x0a' from Linksys image signatureShiji Yang2022-11-271-3/+0
| | | | | | | | | The redundant character '0x0a' after the 192 bytes '0x00' padding broke the factory image. We need to remove it to make things work again. Fixes: e6769d11f3 scripts: fix missing character '0' issue in linksys image Tested-by: Tony Butler <spudz76@gmail.com> Signed-off-by: Shiji Yang <yangshiji66@qq.com>
* scripts: fix dl_cleanup.py argument handlingAndre Heider2022-11-151-3/+6
| | | | | | | | | | The -w|--whitelist and -D|--download-dir arguments pass an additional value, properly evaluate that. Also allow to pass the download directory without -D|--download-dir, just as the usage describes. Finally fix spitting out the wrong error messages about those args. Signed-off-by: Andre Heider <a.heider@gmail.com>
* scripts/mkits.sh: fix portability issueFelix Fietkau2022-11-091-2/+2
| | | | | | | BSD wc can output more whitespaces, which breaks the cut usage. Replace the cut invocation with awk, which is more portable. Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mkits: support definition of DTB loadaddrDavid Bauer2022-11-081-1/+7
| | | | | | | Support defining a per-device loadaddress for the DTB. This is required for devices which to not align the DTB from the bootloader correctly. Signed-off-by: David Bauer <mail@david-bauer.net>
* scripts: fix missing character '0' issue in linksys imageShiji Yang2022-10-301-2/+2
| | | | | | | | In the stock firmware of Linksys, there is a '0' after the crc checksum. Validated on EA6350V3, EA7300 and EA7300V2's stock images. Fixes: 892d741259 build: add a script for generating Linksys factory images Signed-off-by: Shiji Yang <yangshiji66@qq.com>
* scripts/download.pl: pass aria2 config in ENV onlyZhang Hua2022-10-201-0/+1
| | | | | | | | | | | | | The aria2c command tries to load config from ${XDG_CONFIG_HOME:-${HOME}/.config}/aria2/aria2.conf by default, which may result unexpected behavior. As a replacement, people can use environment variable ARIA2C_OPTIONS to custom arguments passed to aria2c like curl and wget below. Including --conf-path=/path/to/config.conf in ARIA2C_OPTIONS can also set a custom config file path easily if needed. Signed-off-by: Zhang Hua <zhanghuadedn@gmail.com>
* scripts/download.pl: make the download tool configurableChristian Marangi2022-10-201-13/+35
| | | | | | | | | | | | | | | | | | | | | | Introduce a new option in the "Advanced configuration options" to configure a custom download tool. By declaring a string in "Use custom download tool" an user can force what command to use to download package. With the string empty the default tool used is curl, with wget as a fallback if not available. download.pl supports 3 tools officially aria2c, curl and wget. If one of the tool is used in this config, download.pl will use the default args to make use of them. If the provided string is different than aria2c, curl or wget, the command is used as is and the download url will be appended at the end of such command. While at it also tweak the tool selection logic and chose the tool only once when the script is called and move aria2c specific variables in the relevant section. Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
* scripts/ext-tools: introduce new script to install prebuilt toolsChristian Marangi2022-09-301-0/+98
| | | | | | | | | | | | | | | Add a simple script to make it easier to install a prebuilt tools tar. Currently it will be used by our tools container and kernel workflow on github. Simple script that take a tar that contains prebuilt host tools, extract them and refresh the timestamps to skip recompilation of such host tools. By default it refresh timestamps of build_dir/host and staging_dir/host/stamp. Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
* scripts/download.pl: add tsinghua and ustc mirrorsBradford Zhang2022-09-301-0/+9
| | | | | | Add https://mirrors.tuna.tsinghua.edu.cn/ and https://mirrors.ustc.edu.cn/ mirrors into download.pl to speed up download in China. Signed-off-by: Bradford Zhang <zyc@zyc.name>
* scripts/download.pl: generilize and simplify download tool checkChristian Marangi2022-09-281-16/+17
| | | | | | | | | Generilize download tool check and skip other check if a download tool has been found. While at it also reintroduce c836ca84e8f641e10a8349a8f9b7432b33d6cec1 that was previously dropped with aria2c support. Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
* scripts/download.pl: fix support for aria2c download tool on macosChristian Marangi2022-09-261-6/+8
| | | | | | | | | Currently we use /dev/shm to place aria2c tmp file. This is not present on macos. Use the openwrt tmp directory instead of the linux-only /dev/shm to save compatibility with more os. Fixes: d39123626931 ("download.pl: add aria2c support") Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
* scripts/download.pl: fix mirrors regression for curl and wgetChristian Marangi2022-09-261-1/+1
| | | | | | | | | With the introduction of aria2c support, curl and wget no longer try to download the file from mirrors. Fix this regression by emptying the remaining mirrors list only when aria2c is used. Fixes: d39123626931 ("download.pl: add aria2c support") Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
* scripts/download.pl: fix whitespace in mirror urls and drop forChristian Marangi2022-09-251-7/+2
| | | | | | | Fix whitespace in mirror urls and replace for loop with join+map logic. Fixes: d39123626931 ("download.pl: add aria2c support") Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
* download.pl: add aria2c supportBradford Zhang2022-09-251-13/+40
| | | | | | | | | | | | Use aria2c download tool by default on package download if available in the system. aria2c permits to use multiple mirrors and may improve download speed on special context where servers are hard to reach. Co-authored-by: Christian Marangi <ansuelsmth@gmail.com> Signed-off-by: Bradford Zhang <zyc@zyc.name> [ fix wrong var in the script and improve commit description ] Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
* scripts/dl_cleanup: add support for subdirectoriesMichael Pratt2022-09-221-9/+18
| | | | | | | | | | | Allow comparing subdirectories exactly like files. Handle a corner case where the new subdirectory has the same tarball inside of it as the one that was downloaded before a subdirectory for that package was established. Signed-off-by: Michael Pratt <mcpratt@pm.me>
* scripts: add clean of build dir to dl_cleanup scriptAnsuel Smith2022-09-141-3/+35
| | | | | | | | | | Improve dl_cleanup by adding an option to also clean the build directory related to the downloaded package. The script will check every directory in build_dir/ and check if any old package is present there. If outdated package are found, the old one are cleared leaving only the last one. Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
* scripts: assume dl/ the default dir for dl_cleanup scriptAnsuel Smith2022-09-141-8/+12
| | | | | | | Assume dl/ the default dl dir and make it configurable if someone have that in a different place. Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
* scripts: add additional regex for dl_cleanupAnsuel Smith2022-09-141-0/+2
| | | | | | | Add additional regex for dl_cleanup script to handle case with xxx-v1.2a and xxx-v1.2.3a Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
* scripts/download.pl: fix downloads with wgetPetr Štetiar2022-09-131-2/+8
| | | | | | | | | | | | | | | | | | | | Several users of wget for downloads (curl is not available in the system) have reported broken download functionality: wget --tries=5 --timeout=20 --output-document=- https://cdn.kernel.org/pub/linux/kernel/v5.x/linux-5.10.142.tar.xz http://: Invalid host name. Thats all happening due to '' was passed as an argument, which got later expanded to http://. In the context of a list constructor '' is not nothing, it is an empty string element. So fix it by using () as it will yield "nothing" and thus not introduce an empty string element. Fixes: #10692 Fixes: 90c6e3aedf16 ("scripts: always check certificates") Signed-off-by: Jo-Philipp Wich <jo@mein.io> [shellwords() -> ()] Signed-off-by: Petr Štetiar <ynezz@true.cz>
* scripts/download.pl: silence can't exec curl warningPetr Štetiar2022-09-131-1/+1
| | | | | | | | | | | When running build in verbose mode `make V=s` we can see a lot of following warnings when curl is not available in the system: Can't exec "curl": No such file or directory at scripts/download.pl line 77. So lets fix it by redirecting of the stderr to null hole. Signed-off-by: Petr Štetiar <ynezz@true.cz>
* scripts: always check certificatesJosh Roys2022-09-101-2/+4
| | | | | | | | | | | | | | | Remove flags from wget and curl instructing them to ignore bad server certificates. Although other mechanisms can protect against malicious modifications of downloads, other vectors of attack may be available to an adversary. TLS certificate verification can be disabled by turning oof the "Enable TLS certificate verification during package download" option enabled by default in the "Global build settings" in "make menuconfig" Signed-off-by: Josh Roys <roysjosh@gmail.com> [ add additional info on how to disable this option ] Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
* scripts: xxdi.pl: add xxd -i compat modePetr Štetiar2022-09-061-18/+19
| | | | | | | | | | | So it can serve as a standalone drop in replacement for xxd utility used currently mostly in U-Boot packages with `xxd -i` mode which outputs C include file style, with aim for byte to byte identical output, so the eventual difference in the generated output is easily spottable. Fixes: #10555 Signed-off-by: Petr Štetiar <ynezz@true.cz> Signed-off-by: Jo-Philipp Wich <jo@mein.io> [perl-fu]
* scripts: xxdi.pl: remove File::Slurp dependencyJo-Philipp Wich2022-09-061-2/+17
| | | | | | | In order to make it more portable. Signed-off-by: Jo-Philipp Wich <jo@mein.io> Signed-off-by: Petr Štetiar <ynezz@true.cz>