On Thu, 2024-05-30 at 17:02 +0800, Changqing Li via lists.openembedded.org 
wrote:
> From: Changqing Li <[email protected]>
> 
> Currently, set VOLATILE_TMP_DIR to "no", only make /tmp as persistent.
> This patch extends VOLATILE_TMP_DIR to also specify the persistence of
> /var/tmp by following changes:
> 
> * change FILESYSTEM_PERMS_TABLES to remove symlink /var/tmp -> 
> /var/volatile/tmp
>   for the packaging process
> * update base-files to create /var/tmp as a dir not symlink to 
> /var/volatile/tmp
> 
> Here is an use case:
> Steps:
> 1. docker import core-image-minimal-qemux86-64.tar.bz2 poky:latest
> 2. docker run -it --rm poky:latest /bin/sh
> 3. /var/log /var/tmp are deadlinks, and cause "No such file or directory" 
> errors
> 
> Root cause:
> By default, /var/tmp links to /var/volatile/tmp, and /var/volatile/tmp
> usually created by initscript(sysV) or systemd-tmpfile.d(systemd) during
> boot up, but for container, initscript/systemd-tmpfile.d will not be
> executed, so /var/volatile/tmp is not created.
> 
> This patch provides an option for user want to use container, set
> VOLATILE_TMP_DIR to "no" can resolve above case.
> 
> Signed-off-by: Changqing Li <[email protected]>

Sorry it has taken me so long to get to this. I agree we should try and
fix the issues you raise here but I don't think the patch is quite the
best way to do it. What I'd propose is that we keen the new fs-perms
files you're creating but change the tables variable to simply be:

FILESYSTEM_PERMS_TABLES ?=  " files/fs-perms.txt \
                              files/fs-perms-volatile-log.txt \
                              files/fs-perms-volatile-tmp.txt \
                            "

The other references can then simply work along the lines of:

${@bb.utils.contains("FILESYSTEM_PERMS_TABLES", 
"files/fs-perms-volatile-log.txt", "log", "", d)}

and we drop the VOLATILE_*_DIR variables.

I'd suggest two patches, one separating out fs-perms-volatile-log.txt
and the other adding fs-perms-volatile-tmp.txt.

Cheers,

Richard

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#203697): 
https://lists.openembedded.org/g/openembedded-core/message/203697
Mute This Topic: https://lists.openembedded.org/mt/106385197/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to