Commit graph

255 commits

Author SHA1 Message Date
Felix Fietkau
77265e00c7 build: add support code for appending metadata to images
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2016-11-19 11:24:10 +01:00
Jo-Philipp Wich
d1ae4c4958 config: ext4: drop option to set maximum number of inodes
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>
2016-10-27 19:24:38 +02:00
Jo-Philipp Wich
244955de16 include: image.mk: make ext4 reserved blocks percentage optional
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>
2016-10-27 19:24:38 +02:00
Matthias Schiffer
021b96d7c5
rootfs: remove unnecessary and potentially harmful force flags from opkg call
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>
2016-09-26 17:57:58 +02:00
Matthias Schiffer
593dfac909
image: per-device rootfs: first remove, then install packages
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>
2016-09-26 17:57:58 +02:00
Matthias Schiffer
a16a8814ea
image: don't modify file permissions before rootfs generation
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>
2016-09-26 17:57:56 +02:00
Matthias Schiffer
663145e419
image: fix CONFIG_CLEAN_IPKG with CONFIG_TARGET_PER_DEVICE_ROOTFS
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>
2016-09-25 09:30:55 +02:00
Matthias Schiffer
3675e657ed
image: per-device rootfs: don't fail without opkg
Ignore errors caused by /etc/opkg not existing (i.e. when opkg is not
selected).

Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
2016-09-24 18:41:37 +02:00
Matthias Schiffer
e916579340
image: allow specifying additional packages for device-specific rootfs
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>
2016-09-24 18:25:25 +02:00
Matthias Schiffer
c15d70c6d6
image: don't override opkg list directory in per-device rootfs mode
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>
2016-09-24 03:37:08 +02:00
Mathias Kresin
14b40d61e1 image: use check-size from new image build code
Use the new image build code and deduplicate the code.

Signed-off-by: Mathias Kresin <dev@kresin.me>
2016-09-13 19:36:41 +02:00
Mathias Kresin
1cd0a4c688 image: add KERNEL_SIZE to the default device vars
This reverts commit ec37a56587 and fixes
the underlying issue.
2016-09-13 19:36:41 +02:00
Felix Fietkau
d27bce8d28 build: drop UBI EOF marker from images by default
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>
2016-09-12 18:21:52 +02:00
Pushpal Sidhu
4fd043b95b image.mk: Create a manifest file of installed packages as a build artifact
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>
2016-09-08 13:40:02 +02:00
Felix Fietkau
a84a74f618 scripts/ubinize-image.sh: add support for adding custom partitions
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2016-08-31 13:05:19 +02:00
Felix Fietkau
2180b715c1 image: fix per-device rootfs build error when not all opkg package files are found
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2016-08-04 11:19:41 +02:00
John Crispin
4df2011794 include/image.mk: allow image code to override uImage name
Signed-off-by: John Crispin <john@phrozen.org>
2016-08-03 15:30:13 +02:00
Jo-Philipp Wich
83175687c8 build: remove image specific checksum code
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>
2016-08-01 18:11:26 +02:00
Felix Fietkau
905e50d2fb image: use the merged package directory to resolve dependencies for per-device rootfs
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2016-08-01 11:13:38 +02:00
Felix Fietkau
baeda5d31d image.mk: add CMDLINE to DEVICE_VARS
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2016-07-30 14:10:33 +02:00
Felix Fietkau
84718d8736 image: add support for overriding kernel/rootfs images in sysupgrade-tar template
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2016-07-30 14:10:33 +02:00
Felix Fietkau
c5a9a08f1e image.mk: remove leftover variable from a previous rework
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2016-07-29 17:13:48 +02:00
Felix Fietkau
76341cfc5f build: add support for per-device rootfs based on device profile packges
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2016-07-29 10:18:26 +02:00
Felix Fietkau
c0dceae4bb build: minor cleanup of redundant code
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2016-07-29 10:18:26 +02:00
Felix Fietkau
c792c7512c build: add target_params variable for getting root filesystem image parameters
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2016-07-29 10:18:26 +02:00
Felix Fietkau
c5ca181d12 image: add wrapper variable to get the target dir for mkfs commands
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2016-07-29 10:18:26 +02:00
Felix Fietkau
4fed7a60f9 image: make mkfs template output to $@
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2016-07-29 10:18:26 +02:00
Felix Fietkau
b47f438d98 build: remove image prefix from kernel files in KDIR
This allows the image builder to change EXTRA_IMAGE_NAME at a later
point in time without breaking the build

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2016-07-25 12:44:30 +02:00
Felix Fietkau
9945a1dca5 build: remove cpio.gz and tar.gz from regular filesystem types
They are not used to produce regular firmware images anyway. Instead,
call their build templates directly if enabled in the config

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2016-07-25 12:43:39 +02:00
Felix Fietkau
11fc0cd1b1 image.mk: create default ubifs before calling legacy image build code
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2016-07-22 13:58:58 +02:00
Felix Fietkau
8265fdcc4d imagebuilder: strip DEVICE_ prefix from profiles (FS#55)
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2016-07-21 13:41:20 +02:00
Felix Fietkau
b5b2425cba image.mk: initialize BOARD_NAME and IMAGES, add it to DEVICE_VARS
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2016-07-20 10:13:50 +02:00
Felix Fietkau
9a50a213d2 image.mk: add support for specifying the VID header offset for UBI
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2016-07-20 10:13:50 +02:00
Felix Fietkau
9497a23ecb build: add support for parameter passing to mkfs from devices
Will be used to support different ubifs parameters per device

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2016-07-20 10:13:50 +02:00
Felix Fietkau
4added6692 build: split legacy image mkfs.ubifs command from the one used for the new image building code
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2016-07-20 10:13:50 +02:00
Felix Fietkau
ebd0b2d0b1 build: split legacy image building code out of image.mk
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2016-07-20 10:13:50 +02:00
Felix Fietkau
1c1244193a image.mk: replace some template abstraction with make pattern rules
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2016-07-20 10:13:50 +02:00
Felix Fietkau
efdf7f6499 image.mk: remove obsolete Build/mkfs overrides
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2016-07-20 10:13:50 +02:00
Felix Fietkau
8e2764ce9b image.mk: clean up redundant code related to DEVICE_DTS
It is used by a core build template, so the variable should be
initialized and added to DEVICE_VARS in the core.
Same for DEVICE_DTS_DIR

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2016-07-15 14:14:11 +02:00
Felix Fietkau
b8fddb8912 image: allow devices to override the -E 5 ubinize option
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2016-07-14 10:27:30 +02:00
Felix Fietkau
e0ed6ec667 image: clean up UBI related device variable definitions
Move UBI related variable export to core, since the variables are used
by a core Build/ template

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2016-07-14 10:27:30 +02:00
Sergey Sergeev
e6b9330343 build: Adds the ability to disable personal initramfs build for target device
If KERNEL_INITRAMFS := in the target/linux/*/image/Makefile->Device/%NAME% section is set to ''
then personal initramfs file for this target device will not be created.
This var is similar to the Device/Build/kernel KERNEL_INSTALL :=

Signed-off-by: Sergey Sergeev <adron@yapic.net>
2016-06-26 13:06:36 +02:00
Felix Fietkau
8a156ad129 image.mk: add a separate step for building kernel images for LegacyDevice support
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2016-06-17 20:23:11 +02:00
Felix Fietkau
425e2c1d96 image.mk: run LegacyDevice prepare once instead of once per filesystem
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2016-06-17 20:11:27 +02:00
Felix Fietkau
3004275c17 image.mk: fix make variable/command context leakage between LegacyDevice templates
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2016-06-17 20:11:27 +02:00
Felix Fietkau
21ad25f547 image.mk: fix dependencies for legacy make prepare step
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2016-06-07 16:22:28 +02:00
Felix Fietkau
160913f9de image.mk: fix filesystem dependency issue
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2016-06-07 10:26:23 +02:00
Felix Fietkau
26c771452c image.mk: add LegacyDevice wrapper to allow legacy image building code to be used for device profiles
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2016-06-07 08:58:41 +02:00
Felix Fietkau
dafda4b7f8 image.mk: change the default of the kernel suffix
Make it more suitable for installing into bin/

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2016-06-07 08:58:41 +02:00
Felix Fietkau
b50dfd5622 image.mk: add support for specifying a different suffix for the initramfs kernel
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2016-06-07 08:58:40 +02:00