kumquat-buildroot/fs
Yann E. MORIN 409d4c3fe9 fs: don't use an intermediate tarball
Since 118534fe54 (fs: use a common tarball as base for the other
filesystems), the filesystem creation is split in two steps, using an
intermediate tarball to carry the generic, common finalisations to the
per-filesystem finalisation and image creation.

However, this intermediate tarball causes an issue with capabilities:
they are entirely missing in the generated filesystems.

Capabilities are stored in the extended attribute security.capability,
which tar by default will not store/restore, unless explicitly told to,
e.g. with --xattrs-include='*', which we don't pass.

Now, passing this option when creating and extracting the intermediate
tarball, both done under fakeroot, will cause fakeroot to report an
invalid filetype for files with capabilities. mksquashfs would report
such unknown files as a warning, while mkfs.ext2 would fail (with a
similar error message), e.g.:

    File [...]/usr/sbin/getcap has unrecognised filetype 0, ignoring

This is due to a poor interaction between tar and fakeroot; running as
root the exact same commands we run under fakeroot, works as expected.
Unfortunately, short of fixing fakeroot (which would first require
understanding the problem in there), we don't have much options.

The intermediate tarball was made to avoid redoing the same actions over
and over again for each filesystem to build. However, most of the time,
only one or two such filesystems would be enabled [0], and those actions
are usually pretty lightweight. So, using an intermediate tarball does
not provide a big optimisation.

The main reason to introduce the intermediate tarball, however, is that
it allows to postpone per-filesystem finalisations to be applied only
for the corresponding filesystem, not for all of them.

So, we get rid of the intermediate tarball, and simply move all of the
code to run under fakeroot to the per-filesystem fakeroot script.
Instead of extracting the intermediate tarball, we just rsync the
original target/ directory, and apply the filesystem finalisations on
that copy. The only thing still done in the rootfs-common step is to
generate the intermediate files (users file, devices file) that are used
in the fakeroot script.

Fixes: https://bugs.busybox.net/show_bug.cgi?id=11216

Note: an alternate solution would have been to keep the intermediate
tarball to keep most of the common finalisations, and move only the
permissions to each filesystem, but that was getting a bit more complex
and changed the ordering of permissions and post-fakeroot scripts. Once
we bite the bullet of having some common finalisation done in each
filesystem, it's easier to just move all of them.

[0] Most probsably, users would enable the real filesystem to put on
their device, plus the 'tar' filesystem, to be able to easily inspect
the content on their development machine.

Reported-by: Ricardo Martincoski <ricardo.martincoski@gmail.com>
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Ricardo Martincoski <ricardo.martincoski@gmail.com>
Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Cc: Arnout Vandecappelle <arnout@mind.be>
Cc: Peter Korsgaard <peter@korsgaard.com>
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
2018-11-13 00:47:36 +01:00
..
axfs fs: make it behave a bit more like the package infra 2018-01-03 21:58:07 +01:00
btrfs fs/btrfs: remove destination file before generation 2018-08-25 23:59:23 +02:00
cloop fs: make it behave a bit more like the package infra 2018-01-03 21:58:07 +01:00
cpio fs/*/Config.in: re-wrap help text 2018-04-01 08:52:45 +02:00
cramfs fs/cramfs: add xip option 2018-04-09 11:29:46 +02:00
ext2 fs/*/Config.in: re-wrap help text 2018-04-01 08:52:45 +02:00
f2fs fs/f2fs: simplify overprovision option handling 2018-11-08 21:17:49 +01:00
initramfs fs/*/Config.in: re-wrap help text 2018-04-01 08:52:45 +02:00
iso9660 fs/*/*.mk: fix code style 2018-04-01 08:40:41 +02:00
jffs2 fs/*/Config.in: re-wrap help text 2018-04-01 08:52:45 +02:00
romfs fs: make it behave a bit more like the package infra 2018-01-03 21:58:07 +01:00
squashfs fs/squashfs: add zstd support 2018-04-25 23:39:04 +02:00
tar fs/*/Config.in: fix attributes order 2018-04-01 08:52:45 +02:00
ubi fs/*/Config.in: re-wrap help text 2018-04-01 08:52:45 +02:00
ubifs fs: make it behave a bit more like the package infra 2018-01-03 21:58:07 +01:00
yaffs2 fs/yaffs2: fix code style 2018-04-01 07:55:22 +02:00
common.mk fs: don't use an intermediate tarball 2018-11-13 00:47:36 +01:00
Config.in fs/f2fs: add support for creating a f2fs image 2018-11-03 15:14:47 +01:00