aboutsummaryrefslogtreecommitdiffstats
path: root/include/image.mk
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* image.mk: force kernel rebuild on every runFelix Fietkau2017-03-131-2/+2
| | | | | | | DTS dependencies are not processed correctly so makes it safer against poentially stale builds Signed-off-by: Felix Fietkau <nbd@nbd.name>
* build: get rid of host.mkFelix Fietkau2017-02-261-1/+0
| | | | | | Defined required host related variables in toplevel.mk instead Signed-off-by: Felix Fietkau <nbd@nbd.name>
* image.mk: add generic function for gzipping images if enabledFelix Fietkau2017-01-131-0/+7
| | | | Signed-off-by: Felix Fietkau <nbd@nbd.name>
* image: when using the new image build code, gzip ext4 images by defaultFelix Fietkau2017-01-131-1/+6
| | | | | | | | | This reduces the amount of hacks in the makefile code. Remove the apm821xx code to do the same - it was broken and left both compressed and uncompressed images in $(BIN_DIR) Signed-off-by: Felix Fietkau <nbd@nbd.name>
* image.mk: use LINUX_KARCH rather than ARCH for mkitsIan Pozella2017-01-131-1/+1
| | | | | | | | | | | The generated 'its' is passed to mkimage which expects linux arch strings rather than the full arch (e.g. mips not mipsel). It currently works in some cases where LINUX_KARCH == ARCH but otherwise you get an unknown arch build error. Signed-off-by: Ian Pozella <Ian.Pozella@imgtec.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* build: remove obsolete parallel build related optionsFelix Fietkau2017-01-101-1/+1
| | | | | | Always use the main make jobserver, which has been the default for ages Signed-off-by: Felix Fietkau <nbd@nbd.name>
* build: fix build of ubifs imagesFelix Fietkau2017-01-091-3/+3
| | | | | | --force-compr was added by the xz compression patch, which is gone now. Signed-off-by: Felix Fietkau <nbd@nbd.name>
* build: use mkhash to replace various quirky md5sum/openssl callsFelix Fietkau2017-01-051-1/+1
| | | | Signed-off-by: Felix Fietkau <nbd@nbd.name>
* build: support adding version code to file names (FS#323)Jo-Philipp Wich2016-12-091-2/+4
| | | | | | | | | | | | | | Now that the VERSION_NUMBER variable holds the human friendly name and not the commit ID anymore, we need to support adding the revision ID as well. Introduce a new config variable CONFIG_VERSION_CODE_FILENAMES which, if set, causes the resulting file names to contain a commit ID designation as printed by scripts/getver.sh. Also sanitize the input variables to ensure that the resulting strings are lowercased and no not contain spaces. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
* build: add support code for appending metadata to imagesFelix Fietkau2016-11-191-1/+4
| | | | Signed-off-by: Felix Fietkau <nbd@nbd.name>
* config: ext4: drop option to set maximum number of inodesJo-Philipp Wich2016-10-271-1/+0
| | | | | | | | | | | There is very little practical use to limit the number of available inodes on an ext4 filesystem and the make_ext4fs utility is able to calculate useful defaults by itself. Drop the option to make resulting ext4 filesystems more flexible by default. Signed-off-by: Jo-Philipp Wich <jo@mein.io> Acked-by: Michael Heimpold <mhei@heimpold.de>
* include: image.mk: make ext4 reserved blocks percentage optionalJo-Philipp Wich2016-10-271-1/+1
| | | | | | | | Allow CONFIG_TARGET_EXT4_RESERVED_PCT to be empty as make_ext4fs is usually able to figure out a suitable default. Signed-off-by: Jo-Philipp Wich <jo@mein.io> Reviewed-by: Michael Heimpold <mhei@heimpold.de>
* rootfs: remove unnecessary and potentially harmful force flags from opkg callMatthias Schiffer2016-09-261-1/+1
| | | | | | | | | | | | Especially --force-overwrite and --force-depends will often lead to broken images; it's better to fail the build in such cases than to silently ignore the errors. Instead, ignore errors in the per-device rootfs opkg remove command, so the build doesn't break when packages can't be removed because of dependencies. Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
* image: per-device rootfs: first remove, then install packagesMatthias Schiffer2016-09-261-3/+3
| | | | | | | | Some DEVICE_PACKAGES definitions replace one package variant with another (e.g. wpad-mini is replaced with wpad). To avoid file conflicts, first remove, then install packages. Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
* image: don't modify file permissions before rootfs generationMatthias Schiffer2016-09-261-19/+2
| | | | | | | | | | | | | | | | Modifying the file permissions can be harmful, as it would make files world-readable even if they weren't in the ipk packages. The Image/mkfs/prepare step is removed completely, as it is redundant now (/tmp and /overlay are already provided by base-files with the correct permissions). It has been verified that this change does not affect any permissions of files in the default package set except /etc/ppp/chap-secrets, which was world-readable before. All packages not in the default set are more likely to be installed via opkg than being part of a base image and thus were usually not affected by the permission modification anyways. Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
* image: fix CONFIG_CLEAN_IPKG with CONFIG_TARGET_PER_DEVICE_ROOTFSMatthias Schiffer2016-09-251-1/+1
| | | | | | | | | | | Running prepare_rootfs on TARGET_DIR deletes the opkg state when CONFIG_CLEAN_IPKG is enabled, making the per-device rootfs package install fail. To avoid this, create a copy of the TARGET_DIR before prepare_rootfs is run and use this as basis for per-device rootfs generation. Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
* image: per-device rootfs: don't fail without opkgMatthias Schiffer2016-09-241-2/+2
| | | | | | | Ignore errors caused by /etc/opkg not existing (i.e. when opkg is not selected). Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
* image: allow specifying additional packages for device-specific rootfsMatthias Schiffer2016-09-241-2/+12
| | | | | | | | Add a new option to each device in multi-profile mode, allowing to provide a list of packages to add or remove. In case of added packages, the user must take care that these are selected to be built. Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
* image: don't override opkg list directory in per-device rootfs modeMatthias Schiffer2016-09-241-5/+2
| | | | | | | | | | | | opkg's -l option is always interpreted relative to the installation root. This leads to very weird paths inside the rootfs (containing the whole path to the LEDE tree on the build machine) and causes the subsequent deletion of the list directory to fail (cluttering the resulting images). Instead, use the default list directory and remove its contents in prepare_rootfs. Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
* image: use check-size from new image build codeMathias Kresin2016-09-131-8/+1
| | | | | | Use the new image build code and deduplicate the code. Signed-off-by: Mathias Kresin <dev@kresin.me>
* image: add KERNEL_SIZE to the default device varsMathias Kresin2016-09-131-1/+1
| | | | | This reverts commit ec37a565878fd79d4127cbb843c17ce3b8dc97c0 and fixes the underlying issue.
* build: drop UBI EOF marker from images by defaultFelix Fietkau2016-09-121-1/+1
| | | | | | | | Only add them where they are actually required. Should help with compatibility issues with stock U-Boot images that access UBI Signed-off-by: Felix Fietkau <nbd@nbd.name>
* image.mk: Create a manifest file of installed packages as a build artifactPushpal Sidhu2016-09-081-0/+8
| | | | | | | | | | A few linux BSP's create a manifest file of installed packages for a given target in order to help them understand exactly what's on their images. Create one here as well as a build artifact since many users have an affinity to prune down on packages to save valuable flash space. Signed-off-by: Pushpal Sidhu <psidhu@gateworks.com> Signed-off-by: Tim Harvey <tharvey@gateworks.com>
* scripts/ubinize-image.sh: add support for adding custom partitionsFelix Fietkau2016-08-311-1/+2
| | | | Signed-off-by: Felix Fietkau <nbd@nbd.name>
* image: fix per-device rootfs build error when not all opkg package files are ↵Felix Fietkau2016-08-041-1/+1
| | | | | | found Signed-off-by: Felix Fietkau <nbd@nbd.name>
* include/image.mk: allow image code to override uImage nameJohn Crispin2016-08-031-1/+2
| | | | Signed-off-by: John Crispin <john@phrozen.org>
* build: remove image specific checksum codeJo-Philipp Wich2016-08-011-8/+0
| | | | | | | Now that we globally calculate sha256sums over the bin/ directory we can remove the target image specific checksum handling. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
* image: use the merged package directory to resolve dependencies for ↵Felix Fietkau2016-08-011-2/+14
| | | | | | per-device rootfs Signed-off-by: Felix Fietkau <nbd@nbd.name>
* image.mk: add CMDLINE to DEVICE_VARSFelix Fietkau2016-07-301-1/+1
| | | | Signed-off-by: Felix Fietkau <nbd@nbd.name>