buildroot/fs
Norbert Lange 5e78e7e97d fs: clean the volatile /run and /tmp directories
At run time, /run and /tmp get overmounted with a tmpfs, so anything
that is there becomes inaccessible.

Scripts in the fakeroot environment could call tools preparing the early
environment, leaving traces in /run or /tmp. For example, mkusers might
create home directories in /run: openssh sets the sshd home directory to
/run/sshd, so mkusers creates it. But since a tmpfs is mounted over it,
it doesn't exist at runtime, so the openssh service creates it at
startup (and deletes it when the service is stopped).

In addition, packages or rootfs overlay may leave things there as well.
Those may actually pose a runtime problem because the created file or
directory is missing - or it may not be a problem because the package
creates the missing files/directories on startup. In this situation,
it's better not to have them in the rootfs image (because they're not
functional anyway), but it's good to leave them in TARGET_DIR to make it
easier to debug the situation.

Therefore, remove the contents of /run and /tmp in the fakeroot
environment after ROOTFS_PRE_GEN_HOOKS, so they are still left in
TARGET_DIR.

Signed-off-by: Norbert Lange <nolange79@gmail.com>
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
2022-01-09 10:04:34 +01:00
..
axfs fs: make it behave a bit more like the package infra 2018-01-03 21:58:07 +01:00
btrfs fs: don't use := when not needed 2019-10-27 10:35:06 +01:00
cloop fs: make it behave a bit more like the package infra 2018-01-03 21:58:07 +01:00
cpio fs/cpio: add zstd as compression option 2021-01-16 22:45:34 +01:00
cramfs fs/cramfs: add xip option 2018-04-09 11:29:46 +02:00
erofs fs/erofs: add big pcluster support 2021-07-19 22:34:21 +02:00
ext2 fs/ext2: fir (again) namespace for variables 2021-10-13 18:01:34 +02:00
f2fs fs: don't use := when not needed 2019-10-27 10:35:06 +01:00
initramfs fs/initramfs: fix show-info 2020-03-18 22:44:19 +01:00
iso9660 fs/iso9660: add support for hybrid image using Grub2 on BIOS and EFI 2021-09-29 22:58:57 +02:00
jffs2 fs/jffs2: copy xattrs 2020-10-08 21:48:03 +02:00
oci fs: new OCI filesystem type 2021-09-11 14:52:41 +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 config option to pass nopad parameter to mksquashfs 2020-06-17 23:01:23 +02:00
tar fs: don't use := when not needed 2019-10-27 10:35:06 +01:00
ubi fs/ubi: expose BINARIES_DIR to ubinize.cfg 2020-06-06 13:43:43 +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: clean the volatile /run and /tmp directories 2022-01-09 10:04:34 +01:00
Config.in fs: new OCI filesystem type 2021-09-11 14:52:41 +02:00