aboutsummaryrefslogtreecommitdiffstats
path: root/include/image-commands.mk
Commit message (Collapse)AuthorAgeFilesLines
* scripts: mkits.sh make it possible to specify fdt@#Christian Lamparter2020-09-251-0/+1
| | | | | | | | | | | | | | Some bootloaders are really keen on just one special fdt in a multi-image fit image. This is a problem, because currently this is fixed to "fdt@1". This patch introduces a new device variable: DEVICE_FDT_NUM that allows to specify the right fdt number. If the value is absent "1" will be chosen. Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
* build: improve message for incompatible image on "legacy" devicesAdrian Schmutzler2020-08-081-3/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | It has been reported that the current message displayed during upgrade with compat_version change is misleading for "legacy" devices, i.e. those without the "new" fwtool. This is partially caused by the fact that we need to exploit the supported_devices string to get some message text displayed for these devices. This patch modifies the message to make it more helpful and include additional information, e.g. Device linksys,wrt3200acm not supported by this image Supported devices: linksys,wrt3200acm linksys-whateverelse - Image version mismatch: image 1.1, device 1.0. Please wipe config during upgrade (force required) or reinstall. Reason: Config cannot be migrated from swconfig to DSA Note that the line breaks (except the one before Supported devices) are added manually here, I hesitate to hack \n into the supported_devices as well. The "Reason:" will only be displayed if DEVICE_COMPAT_MESSAGE is set for the device, otherwise "Please check documentation ..." will be shown instead. While at it, also rearrange the code in image-commands.mk to make lines shorter and remove the double filter-out command. Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
* build: image: return sizes if check-size failsAdrian Schmutzler2020-08-031-2/+4
| | | | | | | | | | | | | Instead of just printing a warning that an image is too big, also print both actual size and limit in the string: WARNING: Image file somename.bin is too big: 2096101 > 1048576 Since the kernel size is checked via the same function (if KERNEL_SIZE is specified), this will also apply to the kernel image size check. Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
* build: image: drop unused check-kernel-size recipeAdrian Schmutzler2020-08-021-7/+0
| | | | | | | | | | The recipe check-kernel-size is not used in the entire tree. Instead, we already check the size of the kernel image in Device/Build/kernel in image.mk via check-size function if KERNEL_SIZE is defined. Therefore, drop the function. Using it would be redundant anyway. Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
* base-files: fwtool: make compat_version backward compatibleAdrian Schmutzler2020-07-311-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | So far, the compatibility mechanism only works if both device and image are already updated to the new routines. This patch extends the sysupgrade metadata and fwtool_check_image() to account for "older" images as well: The basic mechanism for older devices to check for image compatibility is the supported_devices entry. This can be exploited by putting a custom message into this variable of the metadata, so older FW will produce a mismatch and print the message as it thinks it's the list of supported devices. So, we have two cases: device 1.0, image 1.0: The metadata will just contain supported_devices as before. device 1.0, image 1.1: The metadata will contain: "new_supported_devices":["device_string1", "device_string2", ...], "supported_devices":["Image version 1.1 incompatible to device: ..."] If the device is "legacy", i.e. does not have the updated fwtool.sh, it will just fail with image check and print the content of supported_devices. If DEVICE_COMPAT_MESSAGE is set, this will be printed on old devices as well through the same mechanism. Otherwise a generic "Please check documentation ..." is appended. Upgrade can still be performed with -F like when SUPPORTED_DEVICES has been removed to prevent bricking. If the device has updated fwtool.sh (but is 1.0), it will just use the new_supported_devices instead, and work as intended (flashing with -n will work, flashing without will print the appropriate warning). This mechanism should provide a fair tradeoff between simplicity and functionality. Since we touched a lot of fields in metadata, this also bumps metadata_version to 1.1. Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
* build: add DEVICE_COMPAT_VERSION and DEVICE_COMPAT_MESSAGEAdrian Schmutzler2020-07-311-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We regularly encounter the situation that devices are subject to changes that will make them incompatible to previous versions. Removing SUPPORTED_DEVICES will not really be helpful in most of these cases, as this only helps after a rename. To solve this situation, this patchset introduces a compatibility version for devices. It will be implemented via a per-device Make variable DEVICE_COMPAT_VERSION, which will be set to 1.0 globally by default and then can be overwritten as needed. Furthermore, a variable DEVICE_COMPAT_MESSAGE is added, where a message to be displayed during sysupgrade may be specified optionally. This patch only implements the build variables and adds them to the sysupgrade metadata, the evaluation will be addressed in a subsequent patch. To set it, one would just need to add the following to a device node: define Device/somedevice ... DEVICE_COMPAT_VERSION := 1.1 DEVICE_COMPAT_MESSAGE := Config cannot be migrated from swconfig to DSA endef Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
* build: image: set default parameter for check-sizeSungbo Eo2020-03-211-1/+1
| | | | | | | In most cases check-size is used with IMAGE_SIZE and vice versa. Let check-size use IMAGE_SIZE by default. Signed-off-by: Sungbo Eo <mans0n@gorani.run>
* x86: use qemu-image command from image-commands.mkPaul Spooren2020-03-211-0/+7
| | | | | | | | | | | The `qemu-image` command converts images to the specified type and reduces redundant code. Adaption from Alexander Couzens <lynxis@fe80.eu> work[0]. [0]: https://git.openwrt.org/?p=openwrt/staging/lynxis.git;a=blob;f=target/linux/x86/image/Makefile;h=83b8140b7aefbe708fd09c9c61827e7e39bda8b4;hb=416cccf398e9589e3de386e05b61b1c46cace20d#l51 Signed-off-by: Paul Spooren <mail@aparcar.org>
* build: define check-kernel-size to remove unflashable imagesJeff Kletsky2020-01-151-0/+7
| | | | | | | | | | | | | | | | | | | | | Certain boards have limitations on U-Boot that prevent flashing of images where the kernel size exceeds a threshold, yet sysupgrade can sucessfully manage larger kernels. The current check-size will remove the target artifact if its total size exceeds the threshold. If applied after append-kernel, it will remove the kernel, but the remaining image-assembly steps will continue, resulting in an image without a kernel that is likely unbootable. By defining check-kernel-size, it is now possible to prevent release of such unbootable images through a construct similar to: IMAGE/factory.img := append-kernel | pad-to $$$$(GL_UBOOT_UBI_OFFSET) | \ append-ubi | check-kernel-size $$$$(GL_UBOOT_UBI_OFFSET) Cc: Chuanhong Guo <gch981213@gmail.com> Signed-off-by: Jeff Kletsky <git-commits@allycomm.com>
* treewide: move mktplinkfw to tplink-v1-image in image-commands.mkAdrian Schmutzler2020-01-081-0/+22
| | | | | | | | | | | | | | | | | | | | | This move the slightly different target-specific implementations of mktplinkfw from the targets to include/image-commands.mk and renames it to tplink-v1-image. Having a common version will increase consistency between implementation and will complete the tplink build command already present in the new location. Due to the slight differences of the original implementations, this also does some adjustments to the device build commands/variables. This also moves rootfs_align as this is required as dependency. Tested on: - TL-WDR4300 v1 (ath79, factory) - TL-WDR4900 v1 (mpc85xx, sysupgrade) - RE210 v1 (ramips, see Tested-by) Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de> Tested-by: Christoph Krapp <achterin@googlemail.com>
* Revert "build: separate signing logic"John Crispin2019-10-211-8/+5
| | | | | | | | This reverts commit 4a45e69d190f72ed94878487b271ed7651dd9efa. This broke the buildbots Signed-off-by: John Crispin <john@phrozen.org>
* build: separate signing logicPaul Spooren2019-10-211-5/+8
| | | | | | | | | | | | | | | | This separates the options for signature creation and verification * SIGNED_PACKAGES create Packages.sig * SIGNED_IMAGES add ucert signature to created images * CHECK_SIGNATURE add verification capabilities to images * INSTALL_LOCAL_KEY add local key-build to /etc/opkg/keys Right now the buildbot.git contains some hacks to create images that have signature verification capabilities while not storing private keys on buildbot slaves. This commit allows to disable these steps for the buildbots and only perform signing on the master. Signed-off-by: Paul Spooren <mail@aparcar.org>
* image: add magic number option for append-uImage-fakehdrMichal Cieslakiewicz2019-10-211-2/+5
| | | | | | | | | 'append-uImage-fakehdr' can now accept magic number as a second, optional parameter (passed directly to 'mkimage' command with '-M' option). This enables construction of proper Netgear-specific fake rootfs images (required for flashing WNDR4300 for example). Signed-off-by: Michal Cieslakiewicz <michal.cieslakiewicz@wp.pl>
* build: install-dtb: fix race condition when copying dtbYousong Zhou2019-09-151-4/+7
| | | | | | | | | | | | | | | | Currently for at91 target, Build/install-dtb can be triggered concurrently for multiple different TARGET_FILESYSTEMS, cp command can fail when the target file is already open exclusively by other cp process [ -f /builder/shared-workdir/build/build_dir/target-arm_arm926ej-s_musl_eabi/linux-at91_sam9x/at91sam9263ek-uImage -a -f /builder/shared-workdir/build/build_dir/target-arm_arm926ej-s_musl_eabi/linux-at91_sam9x/root.ubifs+fs=-m_2048_-e_126KiB_-c_2048+pkg=68b329da ] [ -f /builder/shared-workdir/build/build_dir/target-arm_arm926ej-s_musl_eabi/linux-at91_sam9x/at91sam9263ek-uImage -a -f /builder/shared-workdir/build/build_dir/target-arm_arm926ej-s_musl_eabi/linux-at91_sam9x/root.ext4+pkg=68b329da ] cp -fpR /builder/shared-workdir/build/build_dir/target-arm_arm926ej-s_musl_eabi/linux-at91_sam9x/linux-4.14.141/arch/arm/boot/dts/at91sam9263ek.dtb /builder/shared-workdir/build/bin/targets/at91/sam9x/openwrt-at91-sam9x-at91sam9263ek.dtb; cp -fpR /builder/shared-workdir/build/build_dir/target-arm_arm926ej-s_musl_eabi/linux-at91_sam9x/linux-4.14.141/arch/arm/boot/dts/at91sam9263ek.dtb /builder/shared-workdir/build/bin/targets/at91/sam9x/openwrt-at91-sam9x-at91sam9263ek.dtb; cp: cannot create regular file '/builder/shared-workdir/build/bin/targets/at91/sam9x/openwrt-at91-sam9x-at91sam9263ek.dtb': File exists Makefile:87: recipe for target '/builder/shared-workdir/build/build_dir/target-arm_arm926ej-s_musl_eabi/linux-at91_sam9x/tmp/openwrt-at91-sam9x-at91sam9263ek-ubifs-dtb' failed make[4]: *** [/builder/shared-workdir/build/build_dir/target-arm_arm926ej-s_musl_eabi/linux-at91_sam9x/tmp/openwrt-at91-sam9x-at91sam9263ek-ubifs-dtb] Error 1 Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
* build: fix indent in image-commands.mkAdrian Schmutzler2019-08-171-1/+1
| | | | | | Convert leading spaces to tab to match rest of the file. Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
* build: image: add pad-to and pad-rootfs-squashfs helpersPetr Štetiar2019-06-251-2/+1
| | | | | | For better reusability. Signed-off-by: Petr Štetiar <ynezz@true.cz>
* metadata: add "metadata_version" fieldPaul Spooren2019-03-061-0/+1
| | | | | | | allow downstream projects to see the current version of the metadata, usefull if eventually more variables change Signed-off-by: Paul Spooren <mail@aparcar.org>
* metadata: add "target" entryPaul Spooren2019-03-061-0/+1
| | | | | | | add "target" entry based on $(TARGETID) resulting in `<target>/<subtarget>`. Signed-off-by: Paul Spooren <mail@aparcar.org>
* metadata: fixup "board"Paul Spooren2019-03-061-1/+1
| | | | | | | | currently the "board" parameter contains $(BOARD) which actually results to `<target>` (like ramips, ar71xx) without subtarget. However, one actually excepts (not?) to contain BOARD_NAME or DEVICE_NAME. Signed-off-by: Paul Spooren <mail@aparcar.org>
* build: qsdk-ipq-*: include dtc in PATH before calling mkimagePiotr Dymacz2019-02-261-2/+2
| | | | | | | Use 'dtc' from kernel sources instead of relying on host tool. Fixes: bf4630e5adb4 ("build: add helpers for generating QSDK sysupgrade compatible images") Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
* build: add helpers for generating QSDK sysupgrade compatible imagesPiotr Dymacz2019-02-251-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Qualcomm SDK (QSDK) sysupgrade compatible images for IPQ40xx, IPQ806x and IPQ807x use FIT format together with 'dumpimage' tool from U-Boot for verifying and extracting them. Based on 'images' sections names, corresponding mtd partitions are flashed. For example, in case of NOR-only boards, below mapping is used (section name -> mtd name): hlos* -> 0:HLOS rootfs* -> rootfs And for boards with NAND (kernel inside UBI): ubi* -> rootfs Above mappings come from unmodified QSDK sources and might be wrong for boards running custom or modified QSDK-based firmware. Some of vendors adjust them to meet their modified mtd layout or features like recovery or dual-image support. This adds simple script 'mkits-qsdk-ipq-image.sh' (based on 'mkits.sh') for generating FIT images tree source files, compatible with the QSDK sysupgrade format. Resulting images can be used for initial (factory -> OpenWrt) installation and would work both in CLI and GUI. The script is universal in a way it allows to include as many sections as needed. To make use of it, two generic/basic build recipes for NOR and NAND based boards are also included in 'image-commands.mk': Build/qsdk-ipq-factory-nand Build/qsdk-ipq-factory-nor Example usage for board with UBI in NAND: IMAGE/nand-factory.bin := append-ubi | qsdk-ipq-factory-nand Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
* build: add a script for generating Linksys factory imagesOever González2019-01-261-0/+7
| | | | | | | | | | | | | This commit adds the 'Build/linksys-image' rule and the 'linksys-image.sh' script to the build system. This change is needed for generating factory images for the Linksys EA6350v3 device. Without this patch, only valid sysupgrade images can be generated. With this patch, users can flash the device without the need of physical access or disassembly. Signed-off-by: Ryan Pannell <ryan@osukl.com> Signed-off-by: Oever González <notengobattery@gmail.com>
* firmware-utils: mksercommfw: overhaul image creationMathias Kresin2019-01-151-0/+10
| | | | | | | | | | | | | | | | | | | | Move the zip compression into a build recipe. Pad the image using the existing build recipes as well to remove duplicate functionality Change the code to append header and footer in two steps. Allow to use a fixed filename as the netgear update image does. Use a fixed timestamp within the zip archive to make the images reproducible. Due to the changes we are now compatible to the gnu89 c standard used by default on the buildbots and we don't need to force a more recent standard anymore. Beside all changes, the footer still looks wrong in compare to the netgear update image. Signed-off-by: Mathias Kresin <dev@kresin.me>
* build: remove duplicate mksercomfw image recipeMathias Kresin2019-01-131-10/+0
| | | | | | | Keep the ramips/mt76x8 copy, since it's only required for this target at the moment. Signed-off-by: Mathias Kresin <dev@kresin.me>
* build: move seama commands to image-commands.mkMathias Kresin2018-12-301-0/+12
| | | | | | Move it to image-commands.mk to get rid of duplicate recipes. Signed-off-by: Mathias Kresin <dev@kresin.me>
* build: move xor-image into image-commandsINAGAKI Hiroshi2018-12-241-0/+5
| | | | | | | | I moved xor-image into image-commands.mk to use it in ath79 target. It required for NEC WG800HP. Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
* build: drop cameo-factory recipeMathias Kresin2018-12-171-12/+0
| | | | | | | The cameo factory images are created using existing image build commands, which makes the code obsolete. Signed-off-by: Mathias Kresin <dev@kresin.me>
* build: move append-string to image-commands.mkMathias Kresin2018-12-171-0/+4
| | | | | | Move it to image-commands.mk so that it can used by other targets. Signed-off-by: Mathias Kresin <dev@kresin.me>
* image: remove duplicate cameo-factorySebastian Kemper2018-12-171-12/+0
| | | | | | The function was accidentally added twice. Remove the duplicate. Signed-off-by: Sebastian Kemper <sebastian_ml@gmx.net>
* ath79: add d-link dir-825-c1 and dir-835-a1Sebastian Kemper2018-12-171-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit ports both dir-825-c1 and dir-835-a1 from ar71xx to ath79. They're pretty much identical, except dir-835-a1 has less LEDs. The routers come with 128 MByte of RAM and 16 MBytes of flash and sport 2.4GHz and 5.0GHz wireless. Both routers have entries already in OpenWrt's TOH. Please check there for more information on these antiquities. https://openwrt.org/toh/hwdata/d-link/d-link_dir-825_c1 https://openwrt.org/toh/hwdata/d-link/d-link_dir-835_a1 Installation: 1. Connect to the web interface of the vendor firmware (usually listening on 192.168.0.1). 2. Go to "Tools", then "Firmware". 3. In the "Firmware Upgrade" box click "Browse". 4. Select the OpenWrt factory image for your router. 5. Click "Upload", confirm the popups if you agree to flash the file you selected. 6. Wait for firmware upgrade to complete. It takes about 5 minutes. Run-tested on dir-825-c1. dir-835-a1 should work as well, but I don't have this router so I can't confirm. Signed-off-by: Sebastian Kemper <sebastian_ml@gmx.net> Signed-off-by: Christian Lamparter <chunkeey@gmail.com> [trivial changes]
* image: add cameo-factory commandSebastian Kemper2018-12-171-0/+12
| | | | | | | | | | | This command enables factory image generation for Cameo boards. On upgrade the vendor firmware will check the size of the provided image and if a specific string is located at the end of the binary. cameo-factory will generate an image that the vendor firmware accepts. Tested on a D-Link DIR-825 C1 with vendor firmwares 3.01 and 3.04. Signed-off-by: Sebastian Kemper <sebastian_ml@gmx.net>
* ath79: modify mtd partitions for Buffalo BHR-4GRV2INAGAKI Hiroshi2018-11-261-8/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit modifies mtd partitions define for Buffalo BHR-4GRV2 and move it to generic subtarget. In Buffalo BHR-4GRV2, "kernel" partition is located behined "rootfs" partition in the stock firmware. This causes the size of the kernel to be limited by the fixed value. 0x50000 0xe80000 0xff0000 +-------------------------------+--------------+ | rootfs | kernel | | (14528k) | (1472k) | +-------------------------------+--------------+ After ar71xx was updated to Kernel 4.14, the kernel size of BHR-4GRV2 exceeded the limit, and it breaks builds on official buildbot. Since this issue was also confirmed in ath79, I modified the mtd partitions to get rid of that limitation. 0x50000 0xff0000 +----------------------------------------------+ | firmware | | (16000k) | +----------------------------------------------+ However, this commit breaks compatibility with ar71xx firmware, so I dropped "SUPPORTED_DEVICES += bhr-4grv2". This commit requires new flash instruction instead of the old one. Flash instruction using initramfs image: 1. Connect the computer to the LAN port of BHR-4GRV2 2. Set the IP address of the computer to 192.168.12.10 3. Rename the OpenWrt initramfs image to "bhr4grv2-uImage-initramfs-gzip.bin" and place it into the TFTP directory 4. Start the tftp server on the computer 5. While holding down the "ECO" button, connect power cable to BHR-4GRV2 and turn on it 6. Flashing (orange) diag LED and release the finger from the button, BHR-4GRV2 downloads the intiramfs image from TFTP server and boot with it 7. On the initramfs image, create "/etc/fw_env.config" file with following contents /dev/mtd1 0x0 0x10000 0x10000 8. Execute following commands to add environment variables for u-boot fw_setenv ipaddr 192.168.12.1 fw_setenv serverip 192.168.12.10 fw_setenv ethaddr 00:aa:bb:cc:dd:ee fw_setenv bootcmd "bootm 0x9f050000 || bootm 0x9fe80000" 9. Perform sysupgrade with squashfs-sysupgrade image 10. Wait ~150 seconds to complete flashing And this commit includes small fix; BHR-4GRV2 has QCA9557 as a SoC, not QCA9558. Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
* image: ignore usign build errorsHauke Mehrtens2018-10-071-1/+1
| | | | | | | | | | | | | | The tl-wa850re-v2 images from the ar71xx/tiny target are getting too big with the default packages. The size check is done before the meta data is added so there is no file to add meta data to or to sign. Originally errors in Build/append-metadata were getting ignored, but if the signing fails the error is not ignored. This adds a check if the file to be signed is there and only does the signing if it is there. This way it does not fail if the package creation was already aborted earlier. Fixes: 848b455d2e94 ("image: use ucert to append signature") Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
* build: add mkrasimageDavid Bauer2018-08-281-9/+9
| | | | | | | | | | | | | | | The current make-ras.sh image generation script for the ZyXEL NBG6617 has portability issues with bash. Because of this, factory images are currently not built correctly by the OpenWRT buildbots. This commit replaces the make-ras.sh by C-written mkrasimage. The new mkrasimage is also compatible with other ZyXEL devices using the ras image-format. This is not tested with the NBG6616 but it correctly builds the header for ZyXEL factory image. Signed-off-by: David Bauer <mail@david-bauer.net>
* firmware-utils: add sercomm/netgear toolLudwig Thomeczek2018-08-131-0/+10
| | | | | | | | | | | This adds a tool to generate a firmware file accepted by Netgear or sercomm devices. They use a zip-packed rootfs with header and a custom checksum. The generated Image can be flashed via the nmrpflash tool or the webinterface of the router. Signed-off-by: Ludwig Thomeczek <ledesrc@wxorx.net>
* ath79: add support for I-O DATA WN-AC1600DGR2INAGAKI Hiroshi2018-08-111-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I-O DATA WN-AC1600DGR2 is a 2.4/5 GHz band 11ac router, based on Qualcomm Atheros QCA9557. Specification: - Qualcomm Atheros QCA9557 - 128 MB of RAM - 16 MB of Flash - 2.4/5 GHz wifi - 2.4 GHz: 2T2R (SoC internal) - 5 GHz: 3T3R (QCA9880) - 5x 10/100/1000 Mbps Ethernet - 6x LEDs, 6x keys (4x buttons, 1x slide switch) - UART header on PCB - Vcc, GND, TX, RX from ethernet port side - 115200n8 Flash instruction using factory image: 1. Connect the computer to the LAN port of WN-AC1600DGR2 2. Connect power cable to WN-AC1600DGR2 and turn on it 3. Access to "http://192.168.0.1/" and open firmware update page ("ファームウェア") 4. Select the OpenWrt factory image and click update ("更新") button 5. Wait ~150 seconds to complete flashing Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
* ath79: add support for Buffalo BHR-4GRV2INAGAKI Hiroshi2018-08-091-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Buffalo BHR-4GRV2 is a wired router, based on Qualcomm Atheros QCA9558. Ported from ar71xx target. Specification: - Qualcomm Atheros QCA9558 - 64 MB of RAM - 16 MB of Flash - 5x 10/100/1000 Ethernet - QCA8337N - 4x LEDs, 2x keys - UART header on PCB - Vcc, TX, RX, GND from LED side - 115200n8 Flash instruction using factory image: 1. Connect the computer to the LAN port of BHR-4GRV2 2. Connect power cable to BHR-4GRV2 and turn on it 3. Access to "http://192.168.12.1/" and open firmware update page ("ファームウェア更新") 4. Select the OpenWrt factory image and click update ("更新実行") button 5. Wait ~120 seconds to complete flashing Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
* image: fix build without ucertDaniel Golle2018-08-081-1/+1
| | | | | | | | Make sure the Shell-expression returns true also in case of key-build.ucert being absent. Fixes commit 848b455d2e ("image: use ucert to append signature") Signed-off-by: Daniel Golle <daniel@makrotopia.org>
* image: use ucert to append signatureDaniel Golle2018-08-071-0/+6
| | | | Signed-off-by: Daniel Golle <daniel@makrotopia.org>
* ipq40xx: add support for the ZyXEL NBG6617Christian Lamparter2018-06-261-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds support for ZyXEL NBG6617 Hardware highlights: SOC: IPQ4018 / QCA Dakota CPU: Quad-Core ARMv7 Processor rev 5 (v7l) Cortex-A7 DRAM: 256 MiB DDR3L-1600/1866 Nanya NT5CC128M16IP-DI @ 537 MHz NOR: 32 MiB Macronix MX25L25635F ETH: Qualcomm Atheros QCA8075 Gigabit Switch (4 x LAN, 1 x WAN) USB: 1 x 3.0 (via Synopsys DesignWare DWC3 controller in the SoC) WLAN1: Qualcomm Atheros QCA4018 2.4GHz 802.11bgn 2:2x2 WLAN2: Qualcomm Atheros QCA4018 5GHz 802.11a/n/ac 2:2x2 INPUT: RESET Button, WIFI/Rfkill Togglebutton, WPS Button LEDS: Power, WAN, LAN 1-4, WLAN 2.4GHz, WLAN 5GHz, USB, WPS Serial: WARNING: The serial port needs a TTL/RS-232 3.3v level converter! The Serial setting is 115200-8-N-1. The 1x4 .1" header comes pre-soldered. Pinout: 1. 3v3 (Label printed on the PCB), 2. RX, 3. GND, 4. TX first install / debricking / restore stock: 0. Have a PC running a tftp-server @ 192.168.1.99/24 1. connect the PC to any LAN-Ports 2. put the openwrt...-factory.bin (or V1.00(ABCT.X).bin for stock) file into the tftp-server root directory and rename it to just "ras.bin". 3. power-cycle the router and hold down the the WPS button (for 30sek) 4. Wait (for a long time - the serial console provides some progress reports. The u-boot says it best: "Please be patient". 5. Once the power LED starts to flashes slowly and the USB + WPS LEDs flashes fast at the same time. You have to reboot the device and it should then come right up. Installation via Web-UI: 0. Connect a PC to the powered-on router. It will assign your PC a IP-address via DHCP 1. Access the Web-UI at 192.168.1.1 (Default Passwort: 1234) 2. Go to the "Expert Mode" 3. Under "Maintenance", select "Firmware-Upgrade" 4. Upload the OpenWRT factory image 5. Wait for the Device to finish. It will reboot into OpenWRT without any additional actions needed. To open the ZyXEL NBG6617: 0. remove the four rubber feet glued on the backside 1. remove the four philips screws and pry open the top cover (by applying force between the plastic top housing from the backside/lan-port side) Access the real u-boot shell: ZyXEL uses a proprietary loader/shell on top of u-boot: "ZyXEL zloader v2.02" When the device is starting up, the user can enter the the loader shell by simply pressing a key within the 3 seconds once the following string appears on the serial console: | Hit any key to stop autoboot: 3 The user is then dropped to a locked shell. |NBG6617> HELP |ATEN x[,y] set BootExtension Debug Flag (y=password) |ATSE x show the seed of password generator |ATSH dump manufacturer related data in ROM |ATRT [x,y,z,u] RAM read/write test (x=level, y=start addr, z=end addr, u=iterations) |ATGO boot up whole system |ATUR x upgrade RAS image (filename) |NBG6617> In order to escape/unlock a password challenge has to be passed. Note: the value is dynamic! you have to calculate your own! First use ATSE $MODELNAME (MODELNAME is the hostname in u-boot env) to get the challange value/seed. |NBG6617> ATSE NBG6617 |012345678901 This seed/value can be converted to the password with the help of this bash script (Thanks to http://www.adslayuda.com/Zyxel650-9.html authors): - tool.sh - ror32() { echo $(( ($1 >> $2) | (($1 << (32 - $2) & (2**32-1)) ) )) } v="0x$1" a="0x${v:2:6}" b=$(( $a + 0x10F0A563)) c=$(( 0x${v:12:14} & 7 )) p=$(( $(ror32 $b $c) ^ $a )) printf "ATEN 1,%X\n" $p - end of tool.sh - |# bash ./tool.sh 012345678901 | |ATEN 1,879C711 copy and paste the result into the shell to unlock zloader. |NBG6617> ATEN 1,0046B0017430 If the entered code was correct the shell will change to use the ATGU command to enter the real u-boot shell. |NBG6617> ATGU |NBG6617# Co-authored-by: David Bauer <mail@david-bauer.net> Signed-off-by: Christian Lamparter <chunkeey@googlemail.com> Signed-off-by: David Bauer <mail@david-bauer.net>
* include/image-commands.mk: shorter version in Netgear factory headerHannu Nyman2018-06-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | Shorten the version string in Netgear factory image header in order to enable u-boot TFTP recovery flash mode to work again. Strip 'r7210-14cb05909a' into 'r7210' in the Netgear image header by removing the hash (anything after "-"). background: Some Netgear routers have recently been unable to flash Openwrt factory image with the TFTP recovery flash mode provided by Netgear u-boot. That is due to over-long Openwrt version string overflowing into the router type string in u-boot code. Modern git versions produce 10-digit short hashes for the Openwrt main repo, and that causes the version string to be too long in the image header, breaking the image ID verification by the TFTP flash routine. (Other option could be to force a shorter hash in scripts/getver.sh, but as the problem only concerns Netgear routers, let's patch just them.) More detailed explanations in FS#1583 Tested with WNDR3800 Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
* build: add apend-uboot commandDavid Bauer2018-05-221-0/+4
| | | | | | | This commit adds an append-uboot command to append U-Boot from the bin-directory. Signed-off-by: David Bauer <mail@david-bauer.net>
* build: use busybox gzip compatible force optionMathew McBride2018-05-211-1/+1
| | | | | | | | | | commit 138c763 ("build: add --force option to gzip in Build/gzip") added the --force flag to the gzip invocation. Under environments with busybox gzip (e.g Alpine Linux), this fails as busybox only recognizes "-f". Signed-off-by: Mathew McBride <matt@traverse.com.au>
* build: consolidate fake uImage header build commandsMathias Kresin2018-04-201-9/+9
| | | | | | | | | | | Merge the two existing functions and use a parameter for the type header field. It updates the syntax of the former mpc85xx fake ramdisk header command to be compatible with mkimage from u-boot 2018.03 and fixes the build error spotted by the build bot. Signed-off-by: Mathias Kresin <dev@kresin.me>
* build: fix uImage fake header commandMathias Kresin2018-04-191-1/+2
| | | | | | | | | | Use a syntax compatible with mkimage from u-boot 2018.03 to fix the build errors spotted by the build bot. The images are binary identical to the ones generated with mkimage from u-boot 2014.10. Signed-off-by: Mathias Kresin <dev@kresin.me>
* build: Allow to change the FIT config section nameSven Eckelmann2018-03-171-0/+1
| | | | | | | | Some devices only boot when a special config is found in the image and completely ignore the default entry during the selection. These devices can now use the variable DEVICE_DTS_CONFIG in their device image definition. Signed-off-by: Sven Eckelmann <sven@narfation.org>
* build: add --force option to gzip in Build/gzipStijn Tintel2018-02-191-1/+1
| | | | | | | | | | When using pigz, a parallel gzip implementation, the gzip step in the image build for some targets fails, because the image filename already has the .gz extension. This results in an emtpy image file. Fix this by adding the --force option to gzip in the Build/gzip macro. Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be> Tested-by: Martin Schleier <drahemmaps@gmx.net>
* at91: fix image building with CONFIG_TARGET_MULTI_PROFILEJo-Philipp Wich2018-02-141-5/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | The current image build code has a number of race conditions and interface contract violations in the custom image build steps: - Build/install-zImage, solely used by at91, relies on $(PROFILE_SANITIZED) which is not available when building with CONFIG_TARGET_MULTI_PROFILE - Build/at91-sdcard, which may run concurrently, creates scratch files at fixed locations and manipulates target files directly which can lead to file corruption and other unexpected failures Rename the install-zImage macro to at91-install-zImage and move it to the at91 image Makefile since this target is the sole user. Also utilize "$@" as output file name and switch the usage of $(PROFILE_SANITIZED) to $(DEVICE_NAME) in order to fix naming under multi profile builds. Fix the at91-sdcard macro to construct scratch file paths relative to "$@", which is guaranteed to be unique and store the final artifact output in "$@" as well, instead of inside $(BIN_DIR). The generic image build code takes care of moving a build steps "$@" output to the final destination in a concurrency-safe manner. Finally remove the broken install-zImage from the generic image-commands Makefile. Fixes: d7a679a036 ("at91: Install zImage.") Signed-off-by: Jo-Philipp Wich <jo@mein.io>
* build: replace uses of OpenWrt with $(VERSION_DIST)Felix Fietkau2018-02-051-3/+3
| | | | | | This makes the distribution name more configurable. Signed-off-by: Felix Fietkau <nbd@nbd.name>
* build: add image command for CE imagesSven Eckelmann2018-01-131-0/+13
| | | | | | | | | Combined Extended Images V1 can be created easily via the new image commands using IMAGE/sysupgrade.bin/squashfs := append-rootfs | pad-rootfs | combined-ext-image Signed-off-by: Sven Eckelmann <sven.eckelmann@open-mesh.com>