aboutsummaryrefslogtreecommitdiffstats
path: root/include/image.mk
Commit message (Collapse)AuthorAgeFilesLines
* build: image: move IMAGE_SIZE to image.mkSungbo Eo2020-03-111-3/+3
| | | | | | | | | | IMAGE_SIZE is widely used in many targets. Declare it in the default template to clean up redundant code. This also prevents deriving IMAGE_SIZE unintentionally from the previously defined device. While at it, remove duplicate KERNEL_SIZE declaration. Signed-off-by: Sungbo Eo <mans0n@gorani.run>
* build: fix empty SUBTARGET in json filesPaul Spooren2020-02-131-1/+1
| | | | | | | | | | | | | | | Some targets like kirkwood or omap don't use a subtarget which results in a malformed JSON info file. Instead of having a valid value like `"target": "ath79/tiny"` for these targets the value is `"target": "kirkwood/"`. This patch uses the same if condition to use `generic` if the subtarget is empty. Tested for the kirkwood target. Signed-off-by: Paul Spooren <mail@aparcar.org>
* kernel: remove further obsolete kernel version switchesSungbo Eo2020-01-181-12/+7
| | | | | | | | Most of the kernel version switches below 4.14 were removed in commit 97940f876616 ("kernel: remove obsolete kernel version switches"), but some of them still remained. Remove them now. Signed-off-by: Sungbo Eo <mans0n@gorani.run>
* build: image: add SOC device variableAdrian Schmutzler2019-12-201-1/+2
| | | | | | | | | This creates the device variable SOC and adds it to DEFAULT_DEVICE_VARS. It is supposed to replace target-specific SOC variables like ATH_SOC or MTK_SOC and thus unify variable names across targets. Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
* build: image: posix compatibility cut v headKevin Darbyshire-Bryant2019-11-121-2/+2
| | | | | | | | | | | | | | | | | | | | | | Replace 2 instances of non posix use of 'head' with posix compliant 'cut'. 'head -c n' cuts 'n' bytes from the passed string and happens to work on Linux & Mac OS X even though '-c' is not posix. 'head --bytes n' does the same thing and happens to work on linux but not on Mac OS X and is also not posix. 'cut -b1-8' cuts the first 8 bytes from the passed string and is posix compliant, hence works on Linux & Mac OS X. Our usage of 'head --bytes' was particularly unfortunate since it was used to calculated the RootFS UUID passed to grub - the net result being a non-functioning system waiting for the root file system to appear. Thanks to karlp, ynezz & others for pointers on solving this. Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
* build: image: add common and reproducible IMG_PART_SIGNATURE variablePaul Spooren2019-11-111-0/+1
| | | | | | | | | | | | | | x86, mvebu and tegra targets are currently using more or less same SIGNATURE variable which provides unique partition ID/signature, so it makes sense to refactor it out into common variable which could be reused by all targets. While at it, make the content of the variable reproducible. Ref: http://lists.infradead.org/pipermail/openwrt-devel/2019-March/016148.html Signed-off-by: Paul Spooren <mail@aparcar.org> Suggested-by: Jo-Philipp Wich <jo@mein.io> [renamed to IMG_PARTSIGNATURE, reworked with epoch+vermagic hash] Signed-off-by: Petr Štetiar <ynezz@true.cz>
* build: image: fix build breakage of some imagesPetr Štetiar2019-11-081-0/+1
| | | | | | | | | | | | | Commit 881ed09ee6e2 ("build: create JSON files containing image info") has removed the crucial empty new line from the image copy step resulting in the following errors during make function expansion: GZ_SUFFIX := bash: GZ_SUFFIX: command not found Makefile:86: recipe for target 'openwrt-ath79-generic-tplink_archer-c7-v5-squashfs-sysupgrade.bin' failed Fixes: 881ed09ee6e2 ("build: create JSON files containing image info") Signed-off-by: Petr Štetiar <ynezz@true.cz>
* build: label kernel and rootfs ext4 volumesYousong Zhou2019-11-031-1/+1
| | | | | | | | | | | UUID of ext4 volumes generated by make_ext4fs are determined by volume label and it will all be 57f8f4bc-abf4-655f-bf67-946fc0f9f25b when label is empty Labeling them does not make them unique but tools like block command from fstools have a better chance differentiating them Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
* build: create JSON files containing image infoPaul Spooren2019-09-291-1/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The JSON info files contain details about the created firmware images per device and are stored next to the created images. The JSON files are stored as "$(IMAGE_PREFIX).json" and contain some device/image meta data as well as a list of created firmware images. An example of openwrt-ramips-rt305x-aztech_hw550-3g.json { "id": "aztech_hw550-3g", "image_prefix": "openwrt-ramips-rt305x-aztech_hw550-3g", "images": [ { "name": "openwrt-ramips-rt305x-aztech_hw550-3g-squashfs-sysupgrade.bin", "sha256": "db2b34b0ec4a83d9bf612cf66fab0dc3722b191cb9bedf111e5627a4298baf20", "type": "sysupgrade" } ], "metadata_version": 1, "supported_devices": [ "aztech,hw550-3g", "hw550-3g" ], "target": "ramips/rt305x", "titles": [ { "model": "HW550-3G", "vendor": "Aztech" }, { "model": "ALL0239-3G", "vendor": "Allnet" } ], "version_commit": "r10920+123-0cc87b3bac", "version_number": "SNAPSHOT" } Signed-off-by: Paul Spooren <mail@aparcar.org>
* Revert "build: remove harmful -nopad option from mksquashfs"Jonas Gorski2019-09-071-1/+1
| | | | | | | | | | | | | | This reverts commit 1c0290c5cc6258c48b8ba46b4f9c85a21de4f875. Dropping the nopad can make the padding overflow into the next erase block on devices using a non-aligned rootfs start. This breaks the jffs2 overlay partition with the following messages: [ 30.343877] jffs2_scan_eraseblock(): End of filesystem marker found at 0x10000 [ 30.376512] jffs2: Cowardly refusing to erase blocks on filesystem with no valid JFFS2 nodes [ 30.385253] jffs2: empty_blocks 196, bad_blocks 0, c->nr_blocks 197 Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
* build: remove harmful -nopad option from mksquashfsChristian Lamparter2019-08-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | While the -nopad option prevents mksquashfs from padding the image to an arbitrary 4k. It does not take into consideration that squashfs is programmed to have this 4k padding when it's being used on on a block device... which is its main "use-case". Now, after a week long discussion on the ML that included a back-and-forth between some of the possible options. But this is likely the best KISS patch to deal with the issue right away given the limited resources. From squashfs code point of view, be warned. The 4k padding is not enough when dealing with devices that have a PAGE_SIZE bigger than 4k. if it turns out to be affecting you, then please look-up either: "FS#2460 - kernel panic reading squashfs from ubi volume" bug Or the discussion on the OpenWrt-Devel ML in "amp821xx: use newly added pad-squashfs for Meraki MR24" and "Squashfs breakage lottery with UBI..." before making an educated guess. Note: This will not affect the "tiny"/small flash devices as much as it seems at first. This is because the the rootfs_data partition that follows uses jffs2. And it requires to be aligned to the flash block-size in order to work at all. So either the involved FSes will meet in the middle as before, or not at all. But in that latter case the image was already hoping for the "undefined behaviour" gamble to turn out in its favour and this is probably why this was unnoticed for so long. Fixes: FS#2460 Reported-by: Russell Senior <russell@personaltelco.net> Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
* image.mk: keep underscores when sanitize PROFILEPaul Spooren2019-08-221-1/+1
| | | | | | | | | | | | | | | | | | | Underscores don't harm in filenames, however the sanitize function from version.mk replaces them, causing inconsistent filenames. A fix tried to solve this previously via dfe99645dbdd4460f394beaa3a05091cd40b5942 however I did not look close enough: openwrt-ath79-generic-8dev-carambola2.manifest # current openwrt-ath79-generic_8dev-carambola2.manifest # patched ---------------------^ Eventually the sanitization of PROFILES *could* be removed as more and more profiles follow the device tree approach of vendor_model, neither containing upper case letters nor spaces. Signed-off-by: Paul Spooren <mail@aparcar.org>
* build: introduce ALT vendor/model/variantPaul Spooren2019-08-221-2/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some devices are produced and sold under different names. To debloat the buildroot but keeping it complete, new variables are introduced to handle different namings. Below an example taken from a recent PR[0] DEVICE_VENDOR := Arcadyan DEVICE_MODEL := ARV4520PW DEVICE_ALT0_VENDOR := Vodafone DEVICE_ALT0_MODEL := Easybox 800 DEVICE_ALT1_VENDOR := Airties DEVICE_ALT1_MODEL := WAV-281 With this commit the buildroot is extended to take care of up to three alternative namings. The primary title plus alternatives names (if defined) are shown in the `make menuconfig` dialog. Selecting on of devices automatically selects all alternative names as they share the same profile. A list of the newly introduced variables: DEVICE_ALT0_VENDOR := DEVICE_ALT0_MODEL := DEVICE_ALT0_VARIANT := DEVICE_ALT1_VENDOR := DEVICE_ALT1_MODEL := DEVICE_ALT1_VARIANT := DEVICE_ALT2_VENDOR := DEVICE_ALT2_MODEL := DEVICE_ALT2_VARIANT := [0]: https://github.com/openwrt/openwrt/pull/2229/files#diff-b436f01932a18876c27800ba183d95f6R140 Signed-off-by: Paul Spooren <mail@aparcar.org>
* build: allow overriding default selection state for devicesJonas Gorski2019-08-131-0/+3
| | | | | | | | | | | | | | | | | | | Allow overriding the default selection state for Devices, similar to setting a default for packages. E.g. by setting DEFAULT to n, they won't be selected by default anymore when enabling all device in the multi device profile. This allows preventing images being built by the default config for known broken devices, devices without enough RAM/flash, or devices not working with a certain kernel versions. This does not prevent the devices from being manually selected or images being built by the ImageBuilder. These devices often still have worth with a reduced package-set, or as a device for regression testing, when no better device is available. Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
* image.mk: remove device_ from manifest filenamePaul Spooren2019-08-131-1/+1
| | | | | | | | | | | | | | | | | | | The manifest file is based on IMG_PREFIX and PROFILE_SANITIZED, whereas the latter takes a string like DEVICE_8dev_carambola2 and sanitizes it. This behaviour results in a useless "device_" profile-prefix in the device manifest filename. Now uses *subst* to remove that. Therefore this patch results more consistent device file names: openwrt-ath79-generic-8dev_carambola2-initramfs-kernel.bin openwrt-ath79-generic-8dev-carambola2.manifest openwrt-ath79-generic-8dev_carambola2-squashfs-sysupgrade.bin instead of a single file being called openwrt-ath79-generic-device_8dev-carambola2.manifest Signed-off-by: Paul Spooren <mail@aparcar.org>
* ath79: split DEVICE_TITLE in multiple variablesPaul Spooren2019-07-041-2/+6
| | | | | | | | | | | | | | This allows the definition of DEVICE_VENDOR, DEVICE_MODEL and DEVICE_VARIANT. All three are merged together to look the same as the current DEVICE_TITLE. Also, if DEVICE_TITLE is set it's directly used as a *fallback* for devices which weren't upgraded yet. This is based on the work of @sudhanshu16. The motivation is to create JSON files based on provided metadata, needing clear differentiation between vendor, model and revision. Signed-off-by: Paul Spooren <mail@aparcar.org>
* build: image: make image padding OS agnosticPetr Štetiar2019-06-271-4/+4
| | | | | | | | | | Image padding with dd needs to be done in an OS independent way as not all dd understand capital letter unit specifiers, and not all understand lowercase either. Fixes: 97833a57eff1 ("build: image: add pad-to and pad-rootfs-squashfs helpers") Reported-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk> Signed-off-by: Petr Štetiar <ynezz@true.cz>
* build: image: add IMG_ROOTFS and IMG_COMBINED variablesPetr Štetiar2019-06-251-1/+3
| | | | | | Adding those two variables in order to share them across the tree. Signed-off-by: Petr Štetiar <ynezz@true.cz>
* build: image: add variable for gzip-ext4-padded-squashfsPetr Štetiar2019-06-251-0/+17
| | | | | | | This common code could be shared by at least 3 targets (malta, armvirt and x86) so let's factor it out to separate variable. Signed-off-by: Petr Štetiar <ynezz@true.cz>
* build: image: add pad-to and pad-rootfs-squashfs helpersPetr Štetiar2019-06-251-0/+9
| | | | | | For better reusability. Signed-off-by: Petr Štetiar <ynezz@true.cz>
* build: add UBOOT_PATH to DEFAULT_DEVICE_VARS and set a defaultChristian Lamparter2019-05-181-1/+3
| | | | | | | The helper shared Build/append-uboot in include/image-commands.mk uses it, so include this variable in DEFAULT_DEVICE_VARS. Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
* build: remove sgid permission from tarEneas U de Queiroz2019-04-061-1/+1
| | | | | | | | | | Otherwise tar will keep the sgid bit when running from a sgid-set directory, resulting in a different file being generated. Signed-off-by: Eneas U de Queiroz <cote2004-github@yahoo.com> Signed-off-by: Christian Lamparter <chunkeey@gmail.com> [reworked commit message, removed DMARC]
* build: image: Fix off-by-one in DTC kernel version checksPetr Štetiar2019-04-011-4/+4
| | | | | | | | | | | | It was reported to me on IRC today, that my change causes issues with kernel versions between 4.14 and 4.19. It's because I've wrongly used `git describe` in order to get kernel version where we should disable noisy DTC checks, but I should've used `git tag --contains` instead. Fixes: cbbef976e2b ("build: dtc: Disable noisy warnings by default") Signed-off-by: Petr Štetiar <ynezz@true.cz>
* IB: include SUPPORTED_DEVICES in 'make info' outputDaniel Golle2019-03-111-0/+1
| | | | Signed-off-by: Daniel Golle <daniel@makrotopia.org>
* ib: display whether profile comes with image metadataDaniel Golle2019-03-061-0/+1
| | | | | | | | Having image metadata (and signature) appended is a condition for semi-automated sysupgrade, hence IB needs to be able to tell which images will end up with metadata. Signed-off-by: Daniel Golle <daniel@makrotopia.org>
* tools: migrate from squashfs4 to squashfskit4Alexander Couzens2019-02-281-2/+1
| | | | | | | | | squashfskit is a fork of the squashfs-tools. squashfskit creates reproducible filesystems and includes many of the distro patches. Signed-off-by: Alexander Couzens <lynxis@fe80.eu> Tested-by: Paul Spooren <mail@aparcar.org>
* build: Accept BIN_DIR parameter for legacy-imagesSven Eckelmann2019-02-171-2/+2
| | | | | | | | | | | | | | | | | | BIN_DIR can be set to overwrite the output path for new images. This is an advertised feature for the imagebuilder and is used by systems like LibreMesh's chef. The legacy images are build using a new sub-make which doesn't receive the variable overwrites of the parent make process. As result, the BIN_DIR is automatically defined to the default value from rules.mk. The images will therefore not be placed in the output path which was selected by the user. Providing BIN_DIR as an explicit variable override to the sub-make works around this problem. Fixes: 26c771452cd8 ("image.mk: add LegacyDevice wrapper to allow legacy image building code to be used for device profiles") Reported-by: Paul Spooren <mail@aparcar.org> Signed-off-by: Sven Eckelmann <sven@narfation.org>
* build: add KERNEL_ENTRY and sort DEFAULT_DEVICE_VARSChristian Lamparter2019-02-111-6/+5
| | | | | | | | | | | | | | | | | The KERNEL_ENTRY was missing from the DEFAULT_DEVICE_VARS. This bug was discovered while preparing alternative images for the mpc85xx's TP-Link WDR4900-V1, which all failed to boot due to this: |## Booting kernel from Legacy Image at 02000000 ... | Image Name: POWERPC OpenWrt Linux-4.14.96 | Image Type: PowerPC Linux Kernel Image (uncompressed) | Data Size: 2056568 Bytes = 2 MiB | Load Address: 01000000 | Entry Point: 00000000 | Verifying Checksum ... OK Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
* build: Fix missing device variables for artifactsPetr Štetiar2019-02-051-0/+1
| | | | | | | | | | | | | | It was reported to me today on IRC, that building of artifacts doesn't work properly if the concat_cmd references DEVICE_NAME variable. I've found out, that it's due to missing call of Device/Export in artifacts building code path, so this patch adds the missing Device/Export call which in turn exports DEFAULT_DEVICE_VARS into the artifacts environment. Fixes: 493c9a35516c ("build: Introduce building of artifacts") Tested-by: Oskari Lemmela <oskari@lemmela.net> Reported-by: Oskari Lemmela <oskari@lemmela.net> Signed-off-by: Petr Štetiar <ynezz@true.cz>
* build: dtc: Disable noisy warnings by defaultPetr Štetiar2019-01-271-1/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | While helping with review and build testing of a few 4.19 pull requests, I've noticed, that dtc compiler in OpenWrt uses different options then upstream kernel, which is leading to a very noisy output[1]. It wouldn't be that bad per se, but a lot of such warnings aren't easily fixable so I think, that we should follow what upstream does and simply ignore^W silence those noisy warnings. So this patch tries to syncs dtc compiler flags with upstream kernel till version 4.19.13, disabling those warnings as they were added in upstream kernel: v4.6-rc1-2-gbc55398 dtc: turn off dtc unit address warnings by default The newly added dtc warning to check DT unit-address without reg property and vice-versa generates lots of warnings. Turn off the check unless building with W=1 or W=2. v4.11-rc2-11-g8654cb8 dtc: update warning settings for new bus and node/property dtc gained new warnings checking PCI and simple buses, unit address formatting, and stricter node and property name checking. Disable the new dtc warnings by default as there are 1000s. As before, warnings are enabled with W=1 or W=2. The strict node and property name checks are a bit subjective, so they are only enabled for W=2. v4.16-rc3-9-g4fd98e3 scripts: turn off some new dtc warnings by default The latest dtc update adds some new noisy warnings, so turn them off by default. Disable 'avoid_unnecessary_addr_size' and 'alias_paths'. They can be re-enabled by building with 'W=1'. v4.17-rc1-27-g74656b6 kbuild: disable new dtc graph and unit-address warnings dtc gained some new warnings for OF graphs and unique unit addresses, but they are currently much too noisy. So turn off 'graph_child_address', 'graph_port', and 'unique_unit_address' warnings by default. They can be enabled by building dtbs with W=1. Build tested on imx6 and ath79 with 4.14 and 4.19. 1. https://github.com/openwrt/openwrt/pull/1694#issuecomment-450864335 Signed-off-by: Petr Štetiar <ynezz@true.cz>
* build: add ABI_VERSION to binary package namesJo-Philipp Wich2019-01-191-2/+2
| | | | | | | | | | | | | | | | | | | | | | Add the ABI_VERSION source makefile variable to the binary package basename and resolve source dependencies on packages with ABI_VERSION set to such expanded names. If for example a package specifies DEPENDS:=libopenssl while the OpenSSL Makefile specifies ABI_VERSION:=1.0.0, the resulting ipk control data dependency will be "Depends: libopenssl1.0.0" and the libopenssl ipk file will be called "libopenssl1.0.0_<version>_<arch>.ipk". The next time a library such as OpenSSL is updated to an incompatible version, the ABI_VERSION shall be changed accordingly to prevent opkg from simply upgrading to an incompatible library without considering the dependencies of already installed packages. Also introduce another "SourceName" control field which is required by the newly introduced "scritps/ipkg-remove" to determine the proper related .ipk files to delete upon buildroot package clean operations. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
* build: Introduce building of artifactsPetr Štetiar2018-11-261-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We currently could (ab)use IMAGES for this task, but the downside is, that the filenames has filesystem tied to the filename, which might be confusing as the artifact itself don't has to be used with that specific filesystem. Another downside is, that the artifacts built with IMAGES target are build for every FILESYSTEMS filesystem. Consider following use case: define Device/apalis ... FILESYSTEMS := ext4 squashfs IMAGES := spl-uboot.bin recovery.scr IMAGE/spl-uboot.bin := append-uboot-spl | pad-to 68k | append-uboot IMAGE/recovery.scr := recovery-scr endef Where we would get target binaries with following filenames: openwrt-imx6-apalis-squashfs.recovery.scr openwrt-imx6-apalis-squashfs.spl-uboot.bin openwrt-imx6-apalis-ext4.recovery.scr openwrt-imx6-apalis-ext4.spl-uboot.bin With proposed patch, we could now just do: define Device/apalis ... ARTIFACTS := spl-uboot.bin recovery.scr ARTIFACT/spl-uboot.bin := append-uboot-spl | pad-to 68k | append-uboot ARTIFACT/recovery.scr := recovery-scr endef Which would produce target binaries with following filenames: openwrt-imx6-apalis-recovery.scr openwrt-imx6-apalis-spl-uboot.bin Signed-off-by: Petr Štetiar <ynezz@true.cz> Acked-by: Hauke Mehrtens <hauke@hauke-m.de>
* build: ensure that iwinfo is selected when building for multiple devicesFelix Fietkau2018-07-021-0/+1
| | | | | | | extra_packages needs to be added there, like on profiles and target packages lists Signed-off-by: Felix Fietkau <nbd@nbd.name>
* build: Allow to change the FIT config section nameSven Eckelmann2018-03-171-2/+4
| | | | | | | | 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: revert "make image target wait for initramfs"Christian Lamparter2018-03-151-1/+1
| | | | | | | | | | | This reverts commit 43be5087a915727e7dcb3459e2221f094c70811b. The change is incompatible with the image builder code. Luckily the RT-AC58U is no longer depending on the initramfs being available for the target's image generation rules. Reported-by: Venitex Aveon <aveon@aenote.com> Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
* build: make image target wait for initramfsChristian Lamparter2018-03-141-1/+1
| | | | | | | | | | | | The image production rules does not have the initramfs-image as a dependency. So, from make’s perspective initramfs creation can run independently/in parallel with the image generation code in the target's Makefile. This is a problem for devices that have to use the initramfs for the image creation and can lead to broken images. Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
* inclue/image.mk: fix package installation for per-device rootfsMatthias Schiffer2018-03-091-0/+1
| | | | | | | Fixes FS#1421. Fixes: 2fbf669730bf ("imagebuilder: reuse rootfs preparation from rootfs.mk") Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
* include/image.mk: base package-list manifest on unprepared rootfsMatthias Schiffer2018-03-071-8/+2
| | | | | | | With CONFIG_CLEAN_IPKG, the prepared rootfs does not have a full opkg status file. Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
* include/rootfs.mk: pass additional files dir to prepare_rootfs as an argumentMatthias Schiffer2018-03-071-1/+1
| | | | Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
* build: replace uses of OpenWrt with $(VERSION_DIST)Felix Fietkau2018-02-051-1/+1
| | | | | | This makes the distribution name more configurable. Signed-off-by: Felix Fietkau <nbd@nbd.name>
* build: fix restoring /etc/opkg with PER_DEVICE_ROOTFSJo-Philipp Wich2018-01-111-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | When generating per-device rootfs directories, the ./etc/opkg/ directory is moved away prior to calling opkg install, opkg remove and rootfs_prepare. After the opkg invocations and the rootfs_prepare macro call, the saved opkg config directory is supposed to be moved back to its previous ./etc/opkg location. The mv command however can fail to properly restore the directory under certain circumstances, e.g. when the prior opkg or files/ overlay copy operations caused a new ./etc/opkg/ directory to be created. In this case, the backed up directory (named target-dir-$hash.opkg) will be moved into the preexisting ./etc/opkg/ directory instead, causing the opkg configuration to be located in a wrong path on the final rootfs, e.g. in /etc/opkg/target-dir-$hash.opkg/distfeeds.conf instead of /etc/opkg/distfeeds.conf. Solve this problem by replacing the naive "mv" command with a recursive "cp -T" invocation which causes the backed up directory tree to get merged with the destination directory in case it already exists. Also perform the rootfs_prepare macro call after restoring the opkg configuration, to allow users to override it again by using the files/ overlay mechanism. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
* merge: targets: update image generation and targetsZoltan HERPAI2017-12-081-1/+1
| | | | Signed-off-by: Zoltan HERPAI <wigyori@uid0.hu>
* build: fix generating dtb with / in DEVICE_DTSFelix Fietkau2017-11-091-3/+4
| | | | | | Fixes layerscape build error Signed-off-by: Felix Fietkau <nbd@nbd.name>
* build: fix another regression in append-dtb fixFelix Fietkau2017-11-031-0/+4
| | | | | | Filter out duplicate generated code for the same dts files Signed-off-by: Felix Fietkau <nbd@nbd.name>
* build: fix regression in append-dtb fixFelix Fietkau2017-11-031-4/+3
| | | | | | | Strip whitespace from DTS directory Put the dependency earlier in the chain to avoid make errors Signed-off-by: Felix Fietkau <nbd@nbd.name>
* build: allow calling append-dtb from image build commandsFelix Fietkau2017-11-021-0/+16
| | | | | | | | | | | | mpc85xx uses this for firmware image files, since the dtb data is not directly part of the kernel image. This causes build failures in the image builder. Fix this by adding a separate build step that runs this call earlier, reusing the generated file for any calls from kernel or image build commands. Signed-off-by: Felix Fietkau <nbd@nbd.name>
* include: Include new location for DT bindingsFlorian Fainelli2017-10-231-0/+1
| | | | | | | | | Starting with commit d5d332d3f7e8 ("devicetree: Move include prefixes from arch to separate directory") included in 4.12 and newer relocated the dt-bindings directory, so account for that while passing CPPFLAGS before DTC runs. Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
* image.mk: Generate cpiogz with root-owned filesMichal Sojka2017-05-141-1/+1
| | | | | | | | | Some files (e.g. /etc/dropbear) need to be owned by root. Add cpio option to ensure that. Other image types (at least targz and squashfs) already have this. Signed-off-by: Michal Sojka <sojkam1@fel.cvut.cz>
* include/image.mk: allow passing a compat string to the NAND image templateJohn Crispin2017-04-241-5/+6
| | | | Signed-off-by: John Crispin <john@phrozen.org>
* include: add KERNEL_LOAD_ADDR to TARGET_VARSJohn Crispin2017-03-221-1/+1
| | | | | | This will allow us to override the variable from within a Device template. Signed-off-by: John Crispin <john@phrozen.org>