aboutsummaryrefslogtreecommitdiff
path: root/fs
Commit message (Collapse)AuthorAgeFilesLines
* fs: ensure hard links in TARGET_DIR are correctly copied for filesystem inputGravatar Peter Korsgaard2018-05-271-1/+1
| | | | | | | | | | | | | | | | | | | Fixes #11046 Commit bb2a57a17a7 (fs: run packages' filesystem hooks in a copy of target/) changed the file system logic to run file system hooks from packages on a copy of TARGET_DIR, and finally use this copy as input for the file system generation. This copy was done with rsync, which by default does not preserve hard links, leading to an expansion of the file system images when hard links are present. Fix it by passing the -H option to rsync (preserve hard links). Signed-off-by: Peter Korsgaard <peter@korsgaard.com> Acked-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
* fs/squashfs: add zstd supportGravatar Peter Seiderer2018-04-252-0/+5
| | | | | | Signed-off-by: Peter Seiderer <ps.report@gmx.net> Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
* fs/cramfs: add xip optionGravatar Chris Brandt2018-04-092-0/+28
| | | | | | | | Cramfs now has the ability to XIP all ELF files. Cc: Nicolas Pitre <nico@linaro.org> Signed-off-by: Chris Brandt <chris.brandt@renesas.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
* package/cramfs: change to new site locationGravatar Chris Brandt2018-04-092-3/+3
| | | | | | | | | | | | | | | | | | | | | | As of Linux-4.15, cramfs now has a official maintainer again. Additionally, that person is hosting and maintaining a new version of cramfs-tools. Patches 0001-endian.patch and 0003-fix-missing-types.patch are no longer needed because they have been upstreamed. However, since patch 0002-cygwin_IO.patch is so old, it is being removed until someone that needs it can reapply and test it. At that point, they should submit the changes to the new cramfs-tools maintainer instead of adding the patches back here. Please note that cross-endian support for cramfsck is not supported at this time. Cc: Nicolas Pitre <nico@linaro.org> Signed-off-by: Chris Brandt <chris.brandt@renesas.com> Reviewed-by: Matt Weber <matthew.weber@rockwellcollins.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
* fs/*/Config.in: re-wrap help textGravatar Ricardo Martincoski2018-04-015-26/+32
| | | | | | | ... to follow the convention <tab><2 spaces><62 chars>. Signed-off-by: Ricardo Martincoski <ricardo.martincoski@gmail.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
* fs/*/Config.in: fix attributes orderGravatar Ricardo Martincoski2018-04-012-4/+4
| | | | | | | ... to follow the convention: type, default, depends on, select, help. Signed-off-by: Ricardo Martincoski <ricardo.martincoski@gmail.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
* */Config.in*: remove consecutive empty linesGravatar Ricardo Martincoski2018-04-011-1/+0
| | | | | Signed-off-by: Ricardo Martincoski <ricardo.martincoski@gmail.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
* fs/*/*.mk: fix code styleGravatar Ricardo Martincoski2018-04-012-3/+1
| | | | | | | | The header of the initramfs.mk file fits in one line, so rearrange it. Remove consecutive empty line. Signed-off-by: Ricardo Martincoski <ricardo.martincoski@gmail.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
* fs/ubi: use namespace for internal variableGravatar Ricardo Martincoski2018-04-011-3/+3
| | | | | | | | | UBINIZE_CONFIG_FILE_PATH is only used inside this file, so rename it to start with UBI_, following the namespace convention already used by common packages. Signed-off-by: Ricardo Martincoski <ricardo.martincoski@gmail.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
* fs/yaffs2: fix code styleGravatar Ricardo Martincoski2018-04-011-0/+0
| | | | | | | | Rename the .mk to follow the convention. The variables inside it already use the correct name. Signed-off-by: Ricardo Martincoski <ricardo.martincoski@gmail.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
* fs: remove intermediate artefactsGravatar Yann E. MORIN2018-03-311-0/+2
| | | | | | | | | | | | | | | | | | | | Each of the intermediate, per-rootfs target directories, as well as the intermediate tarball, can take quite some place, and is mostly a duplication of what's already in target/. The only delta, if any, would be the tweaks made by the filesystem image generations, but those tweaks are most probably only meaningful when seen as root. We normally do not remove intermediate files, but those can be quite large, and are not directly usable by, nor accessible to the user. So, get rid of them once the filesystem has been generated. This does not need to be done in fakeroot. Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com> Cc: Arnout Vandecappelle <arnout@mind.be> Tested-by: Matt Weber <matthew.weber@rockwellcollins.com> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
* fs: get rid of package-provided post-fs hooksGravatar Yann E. MORIN2018-03-311-2/+0
| | | | | | | | | | | | | | | | | Now that the pre-fs ones are run on a transient copy of target/, the post-fs hooks are no longer needed because we no longer need to restore the target/ directory as it is only a internal copy. Remove support for the post-fs hooks, and update the sole package using them. We do not add a legacy check because this was mostly a purely-internal detail that was never really exposed nor documented. Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com> Cc: Arnout Vandecappelle <arnout@mind.be> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
* fs: run packages' filesystem hooks in a copy of target/Gravatar Yann E. MORIN2018-03-311-2/+5
| | | | | | | | | | | | | | | | | | | | Currently, some packages may register hooks to be run just before and just after the generic tarball image is generated, because they need to prepare the filesystem for read-only or read-write operation. However, this means that, if any of the hooks or the image generation fails, the target directory is left in a dangling, inconsistent state. We fix that by doing a copy of target/, run the hooks on that copy, generate the generic tarball image out of that, and get rid of the copy. This way, we can guarantee consistency of the target directory, and we can even ditch support for post-fs hooks (those that restore target/). Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com> Cc: Arnout Vandecappelle <arnout@mind.be> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
* fs: use a common tarball as base for the other filesystemsGravatar Yann E. MORIN2018-03-311-28/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, some filesystems may want to tweak the content of the target directory, create special device nodes etc... This all means that: - the content of the target directory for a specific filesystems may depend on whether another filesystem is enabled or not; for example, cpio will create a /init script or symlink and a /dev/console node; - the filesystems can not be built in parallel, because they may change the content of the target directory while another is being assembled. Furthermore, the same fakeroot script is executed over-and-over-again for each filesystem, to create the device nodes, the users and their homes and files, and setting permissions... We introduce an intermediate tarball, for which we do the full fakeroot shebang. That tarball then serves as the base for the other filesystems, with a very simple fakeroot script that untars the common tarball, and calls the actual filesystem image generator on that. Note that we use a very simple tar command to generate the intermediate tarball, because we are not concerned with reproducibility of the archive itself (only of the archived files). Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com> Cc: Arnout Vandecappelle <arnout@mind.be> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
* fs: introduce a macro for reproducible commandGravatar Yann E. MORIN2018-03-311-3/+7
| | | | | | | Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com> Cc: Arnout Vandecappelle <arnout@mind.be> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
* fs: new intermediate rootfs-common to gather common dependenciesGravatar Yann E. MORIN2018-03-311-4/+19
| | | | | | | | | | | | | | | Before we can create an intermediate tarball for all filesystems, we nedd to move the common dependencies needed to generate that intermediate tarball, rather than leave those dependencies to each filesystem. So, we introduce rootfs-common, which gathers all those common dependencies. Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com> Cc: Arnout Vandecappelle <arnout@mind.be> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
* fs: introduce per-rootfs TARGET_DIR variableGravatar Yann E. MORIN2018-03-311-0/+1
| | | | | | | | | | ... which for now still points to the base target directory, but this is a step forward. Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com> Cc: Arnout Vandecappelle <arnout@mind.be> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
* fs: split per-rootfs dependency lineGravatar Yann E. MORIN2018-03-311-1/+2
| | | | | | | Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com> Cc: Arnout Vandecappelle <arnout@mind.be> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
* fs: use a per-rootfs fakeroot scriptGravatar Yann E. MORIN2018-03-311-3/+3
| | | | | | | | | | | | | | ... and locate that script in a per-rootfs directory. Just like for ROOTFS, this variable will leak down the dependency tree to target-finalize and packages - But it doesn't matter as it isn't used outside fs/. [Peter: extend commit message] Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com> Cc: Arnout Vandecappelle <arnout@mind.be> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
* fs: define per-rootfs directoryGravatar Yann E. MORIN2018-03-311-0/+2
| | | | | | | | | | This will serve in future commits to store pre-rootfs files, like fakeroot script... Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com> Cc: Arnout Vandecappelle <arnout@mind.be> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
* fs: set per-rootfs variable nameGravatar Yann E. MORIN2018-03-311-0/+1
| | | | | | | | | | | | | | | | | | | | Like we do for packages with the PKG variable, set ROOTFS to contain the upper-case name of the rootfs currently being generated. This will be useful in later patches, when we need more per-rootfs variables, like a per-rootfs TARGET_DIR for example. In Makefiles, per-rule variables trickle down the dependency chain, to all dependencies of that rule, so we have to stop ROOTFS as soon as we're not in a rootfs. This means we have to stop it at target-finalize (which is a dependency of all filesystems), and for each package individually, since some packages (host or target) can be direct dependencies of filesystems as well. Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com> Cc: Arnout Vandecappelle <arnout@mind.be> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
* fs/iso9660: rename internal variableGravatar Yann E. MORIN2018-03-311-15/+15
| | | | | | | | | | | | | We're soon to introduce a generic variable with that name, i.e. $(FS_NAME)_TARGET_DIR, so our internal, temporary variable would clash with it. Just rename it. Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com> Cc: Arnout Vandecappelle <arnout@mind.be> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
* fs/cpio: don't extend packages' permissions tableGravatar Yann E. MORIN2018-03-311-2/+4
| | | | | | | | | | | | | | | | | | | | | | | Currently, when we build a cpio filesystem without static devices, we shoehorn the /dev/console node as if it were specified by a package. This means that this device is added for all filesystems as well, not just the cpio. But if we disable cpio, that device is not created for other filesystems. This is not very clean, and may break expectations. Instead, use an explicit mknod as part of the _CMD, as we know it's going to run under fakeroot. This is still visible to all filesystems built after cpio, and not to those built before it, though. [Peter: ensure /dev exists, simplify comment] Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com> Cc: Arnout Vandecappelle <arnout@mind.be> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
* fs: run filesystem hooks under fakerootGravatar Yann E. MORIN2018-03-311-1/+2
| | | | | | | | | | | | | | | | | | Currently, the pre-gen hooks of the various filesystems are run before we enter the fakeroot. However, this precludes those hooks from doing actions that require root, like creating a pseudo-device or the likes. So, move those pre-gen hooks under fakeroot. This has currently no side-effect, as they are still called before everything else in the fakeroot script, even the system-wide chown call. Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com> Cc: Arnout Vandecappelle <arnout@mind.be> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
* package/pkg-generic: handle host-tar as an extract dependencyGravatar Thomas Petazzoni2018-03-251-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This moves the host-tar dependency handling from DEPENDENCY_HOST_PREREQ to an extract dependency. To achieve that, check-host-tar.mk fills in the BR2_TAR_HOST_DEPENDENCY variable with host-tar if building a host-tar is needed. The name BR2_TAR_HOST_DEPENDENCY has been chosen because it matches the name BR2_CMAKE_HOST_DEPENDENCY already used in check-host-cmake.mk. The BR2_TAR_HOST_DEPENDENCY is added to all packages, except host-tar itself (obviously) and host-skeleton, because we depend on host-skeleton to install host-tar properly in HOST_DIR. In addition, we modify tar.mk to explicitly build host-tar without ccache: since ccache source code is available as a tarball, ccache will obviously depend on host-tar if the system tar is insufficient. Finally, to make things really clean, we also add $(BR2_TAR_HOST_DEPENDENCY) to the dependencies of the tar filesystem format, since it requires tar, so we'd better make sure we have a suitable tar. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com> Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Tested-by: Matt Weber <matthew.weber@rockwellcollins.com> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
* fs/cpio/init: preserve argumentsGravatar Gaël PORTAY2018-02-261-1/+1
| | | | | | | | | | | Use "$@" instead of $* to preserve arguments containing spaces. The shell expands "$@" as "$1" "$2" "$3"... while it expands $@ as $1 $2 $3. With the second form, we loses spaces in positional parameters. Signed-off-by: Gaël PORTAY <gael.portay@savoirfairelinux.com> Reviewed-by: Adrian Perez de Castro <aperez@igalia.com> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
* fs: pass EXTRA_ENV to post-fakeroot scriptGravatar Yann E. MORIN2018-01-151-1/+1
| | | | | | | | | Like we do for post-build and post-image scripts, pass EXTRA_ENV to post-fakeroot script. Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
* fs/tar: add option for lz4 compressionGravatar Peter Korsgaard2018-01-081-0/+5
| | | | | Signed-off-by: Peter Korsgaard <peter@korsgaard.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
* fs/ext2: add option for lz4 compressionGravatar Peter Korsgaard2018-01-081-0/+5
| | | | | Signed-off-by: Peter Korsgaard <peter@korsgaard.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
* fs/cpio: add option for lz4 compressionGravatar Peter Korsgaard2018-01-081-0/+5
| | | | | Signed-off-by: Peter Korsgaard <peter@korsgaard.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
* fs/common.mk: support lz4 compressionGravatar Peter Korsgaard2018-01-081-0/+5
| | | | | | | | | | Similar to the other compressors. Notice that we use the -l (legacy format) for Linux kernel initrd compatibility. Lz4 decompression is supported by the Linux kernel since 3.11. Signed-off-by: Peter Korsgaard <peter@korsgaard.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
* fs: make it behave a bit more like the package infraGravatar Yann E. MORIN2018-01-0314-17/+16
| | | | | | | | | | | | | | Currently, to register a filesystem, one has to call: $(eval $(call ROOTFS_TARGET,blabla)) This is very unlike the package infrastructure, where the name of the package is automatically guessed by the infra. It turns out that we can now do that for the filesystem infra too. Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
* fs/ubifs: spin-off ubi to be its own filesystemGravatar Yann E. MORIN2018-01-035-52/+53
| | | | | | | | | | | | | Currently, the ubifs-in-ubi-image ("UBI image" thereafter) filesystem is half an option of the ubifs filesystem, half a filesystem on its own: the config options are options of the ubifs filesystem, but the .mk code is in a separate .mk and registers a real filesystem. Make it a full filesystem on its own, in its own directory tree. Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
* fs/iso9660: fix transparent (de)compressionGravatar Yann E. MORIN2018-01-021-4/+8
| | | | | | | | | | | | | | | | | | | | | | It needs mkzftree from zisofs-tools, so we add a dependency to it, and we call that one explicitly (to avoid using the one from the host in PATH). It also needs the the uncompressed kernel image, but because it is already in target/ so it gets compressed by mkzftree. We have two options: - compress everything but the kernel image, - compress everything, kernel included, and recopy it later. We choose the latter, because it is the simplest solution. So, we always define the kernel-copy hook, but only register it when needed. Finally, it needs a kernel with support for transparent (de)compression, so we update the existing test config. Reported-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
* fs/iso9660: add option for transparent (de)compressionGravatar Yann E. MORIN2017-12-312-0/+21
| | | | | | Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> [Thomas: rename option to BR2_TARGET_ROOTFS_ISO9660_TRANSPARENT_COMPRESSION.] Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
* fs/ubifs: split long line, use simple asignmentGravatar Yann E. MORIN2017-12-271-1/+4
| | | | | | | | | | | | This line has been sitting there unchanged for years now, but it does not follow current best pratices, that is: - do not use imediate assignment, - split lines longer than ~80 chars. Fix that. Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
* fs: prepare temp directory before running PRE_GEN hooksGravatar Yann E. MORIN2017-12-021-1/+1
| | | | | | | | | | | | | | | | | | | Some filesystems have PRE_GEN hooks that create a directory structure under the temporary directory. For example, iso9660 will create a sub-directory where it stores the kernel (in case of initramfs or initrd). So, we must run the PRE_GEN hooks after we cleanup/create the temporary directory. Fixes: https://gitlab.com/buildroot.org/buildroot/-/jobs/42835965 https://gitlab.com/buildroot.org/buildroot/-/jobs/42835967 Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
* fs: don't remove intermediate filesGravatar Yann E. MORIN2017-11-301-1/+0
| | | | | | | | | | | | Now that they are in their own directory and no longer pollute the build dir, there is no point in removing them. Furthermore, a follow-up patch will require that those files survive when more than one filesystem image is generated. Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
* fs/iso9660: don't pollute $(BUILD_DIR) with temp dirGravatar Yann E. MORIN2017-11-301-1/+1
| | | | | | | | Use the newly-introdued $(FS_DIR) location to store temporary files. Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
* fs: don't pollute $(BUILD_DIR) with temp filesGravatar Yann E. MORIN2017-11-301-5/+6
| | | | | | | | | | | Currently, we create a bunch of temporary files in $(BUILD_DIR), while assembling the filesystem images. Move those files to their own sub-directory. Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
* fs: remove TARGET_DIR_WARNING_FILE lateGravatar Yann E. MORIN2017-11-301-1/+1
| | | | | | | | | | Remove it just before generating the filesystem image. This way, removing-and-recreating the file encloses the actual image generation as tightly as possible. Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
* fs/common: get rid of post-target rulesGravatar Yann E. MORIN2017-11-301-5/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | The only users of post-target rules were ext2, cpio and initramfs. Of those, ext2 and cpio were changed to use post-gen hooks, while initramfs was not even using the generic rootfs infra and was fixed to no longer reference post-target rules. Besides, the comment in the infra was really misleading: it referenced initramfs implying it was the sole user of that feature, even though initramfs was not using the fs infra. Furthermore, using post-target rules was inherently broken for top-level parallel builds, because filesystems had to ensure the ordering by themselves. Of the two real users of post-target rules (cpio and ext2), one did enforce rules ordering (apparently correctly), while the other forgot to do so. We can get rid of post-target rules altogether, now. Add a legacy check, to catch out-of-tree (e.g. br2-external) users of post-target rules, and instruct them to switch to post-gen hooks instead. Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Cc: Arnout Vandecappelle <arnout@mind.be> Reviewed-by: Romain Naour <romain.naour@gmail.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
* fs/cpio: use a post-gen hook rather than a post-target ruleGravatar Yann E. MORIN2017-11-301-5/+6
| | | | | | | | | | | | | | | | | We already have a mechanism for running stuff after the filesystem is generated, and that's called post-gen hooks. Use those hooks. Note: for cpio (and unlike ext2 previously), the dependency chain was correct, in that the post-target rule correctly depended on the image rule. Nonetheless, we still want to fix it for consistency. Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Cc: Arnout Vandecappelle <arnout@mind.be> Reviewed-by: Romain Naour <romain.naour@gmail.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
* fs/ext2: use a post-gen hook rather than a post-target ruleGravatar Yann E. MORIN2017-11-301-6/+4
| | | | | | | | | | | | | | | | | | | post-target rules are probably not resilient to parallel builds, given that they do not depend on the image being generated first. Beside, we already have a mechanism for running stuff after the filesystem is generated, and that's called post-gen hooks. Use those hooks. Note: this basically reverts 75b6303 (rootfs-ext2: make the symlink as a _POST_TARGET) since we've now re-introduced post-gen hooks. Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Cc: Arnout Vandecappelle <arnout@mind.be> Reviewed-by: Romain Naour <romain.naour@gmail.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
* fs/initramfs: cleanups, enhance commentsGravatar Yann E. MORIN2017-11-301-7/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | rootfs-initramfs is not using the generic fs infrastructure, because there is virtually nothing to do to build the initramfs image: there is no actual image to be built to begin with. The only purpose of rootfs-initramfs is to ensure the rootfs.cpio image is built and then that the Linux kernel is rebuilt with that rootfs.cpio as initramfs source. Using variables of the fs infra like if it were used is misleading. It looked nice as long as there was the possibility that rootfs-initramfs would one day use the fs infra. But there's no way that will happen any time soon. Furthermore, the linux' rule linux-rebuild-with-initramfs now already depends on rootfs-cpio by itself, so we need not duplicate this dependency in rootfs-initramfs. Still, we want to advertise that the dependency is on rootfs-cpio, so we get nice dependency graphs (and not expose the internal linux-rebuild-with-initramfs rule to the users). So, remove the variables and directly define the rules. Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Cc: Romain Naour <romain.naour@openwide.fr> Reviewed-by: Romain Naour <romain.naour@gmail.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
* fs: add missing $$(sep) to pre- and post-command hooks codeGravatar Andrey Smirnov2017-11-051-2/+2
| | | | | | | | | | | | | | | When multiple hooks are registred, both pre-a and post-command hooks' foreach loops need to have a separator at the end in order for the code to work as intended. Without the separator all hooks end up as a one single line command thus making all but the first hook into no-ops. Fixes: 4628b6f3b4 ("fs: add pre- and post-command hooks") Cc: Yann E. MORIN <yann.morin.1998@free.fr> Cc: Romain Naour <romain.naour@gmail.com> Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Acked-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
* fs/iso9660: remove support for grubGravatar Yann E. MORIN2017-09-233-63/+5
| | | | | | | | | grub will be removed soon. Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Cc: Ricardo Martincoski <ricardo.martincoski@gmail.com> Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
* Merge branch 'next'Gravatar Thomas Petazzoni2017-09-021-2/+3
|\
| * fs/squashfs: honour the number of parallel jobsGravatar Yann E. MORIN2017-08-091-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | By default, mksquashfs uses all the CPUs available, like us with BR2_JLEVEL=0. However, by setting BR21_JLEVEL to non-zero, a user volutarily limits the number of jobbs allowed to run concurrently (for various reasons, like this is not a priority task on the machine; or like the autobuilders, to spread the load accross multiple runs without overloading the machine). So, propagate tthe parallelisn settings down to mksquashfs, to repect the user's will. Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Cc: Clayton Shotwell <clayton.shotwell@rockwellcollins.com> Tested-by: Clayton Shotwell <clayton.shotwell@rockwellcollins.com> Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
* | fs/iso9660: really create initrd temp dirGravatar Yann E. MORIN2017-08-151-0/+1
|/ | | | | | | | | | | | | | | | | | | | | | | | | In case we're using an initrd, we create an empty "root" directory that will contain only the bootloader stuff, not the actual root filesystem, because it is in an initrd (standalone or initramfs). We have to ensure that the directory is empty before assembling the filesystem (to avoid any file lingering from a previous run, like the sequence "make; make"). So we first remove it before we create it, so that on each build (especially not-from-scratch builds) we get the exact expected content without any leftover. However, the macro responsible for that, although defined since 7080eef9, was never called. Fix that by registering it as a pre-gen hook. Note: the directory need not be created, as there are quite a few "install -D" commands that ensure it is created. Yet, we prefer to create it explicitly to avoid any confusion. Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>