kumquat-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
btrfs
cloop
cpio
cramfs
erofs
ext2
f2fs
initramfs
iso9660
jffs2
oci
romfs
squashfs
tar
ubi
ubifs
yaffs2
common.mk
Config.in