[yocto] Recipe that creates empty /var/log directory is auto-mounted to /var/volatile/log

Fred Ollinger Fred.Ollinger at seescan.com
Mon May 9 08:32:43 PDT 2016


Some people choose a read-only file system. Thus /var/log is not writable.


However, some software expects to use the hard coded path of /var/log.


Thus, there's a symlink to the ramdisk to solve both problems.

________________________________
From: yocto-bounces at yoctoproject.org <yocto-bounces at yoctoproject.org> on behalf of Paul Knopf <pknopf at medxchange.com>
Sent: Monday, May 9, 2016 7:02 AM
To: yocto at yoctoproject.org
Subject: [yocto] Recipe that creates empty /var/log directory is auto-mounted to /var/volatile/log

I have a simple recipe that places files on the system.

-------------
do_install() {
  # create this directory, because our "normal" fstab file will mount a log partition to it.
  install -d ${D}/var/log
  install -d ${D}${sysconfdir}
  install -m 0644 ${WORKDIR}/fstab-normal ${D}${sysconfdir}/fstab
}
-------------

The fstab-normal file has an entry that mounts a partition to this created /var/log directory.

-------------
/dev/mmcblk0p3       /var/log             auto       defaults  0  0
-------------

However, when the package get's created, /var/log gets pointed to /var/volatile/log. Where is this happening, and why?

-------------
pknopf at ubuntu:~/Git/recipes/build/tmp/work/cortexa9hf-vfp-neon-poky-linux-gnueabi/base-files-fstab-normal/1.0-r0/package$ tree
.
??? etc
?   ??? fstab
??? var
    ??? log -> volatile/log
    ??? volatile
        ??? log

-------------

Thanks,
Paul Knopf
Software Engineer
Med X Change, Inc
pknopf at medxchange.com<mailto:pknopf at medxchange.com>



More information about the yocto mailing list