cdsteinkuehler / br2rauc

Buildroot + RAUC
Other
52 stars 18 forks source link

/var/lock is not being made #6

Closed synaption closed 2 years ago

synaption commented 2 years ago

I see /var/lock in the rootfs-overlay, but for some reason it does not end up in my image. It IS in the target folder.

BubuOT commented 2 years ago

/var is mounted as a tmpfs by default by buildroot, so anything in /var that's in the image will be overmounted by the tmpfs. I think a writable /var is required by systemd for booting the system. (The /var/lock is created by systemd-tmpfiles at runtime then.)

For our project I removed this tmpfs mount and instead went with a persistent /var bind-mounted from /data.

cdsteinkuehler commented 2 years ago

IIRC, /var/lock is present, but gets "hidden" when the tmpfs for /var is mounted. Redirecting /var to /data is one solution, but I'd prefer to stick with a tmpfs for /var. I am open to suggestions.

cdsteinkuehler commented 2 years ago

Looks like the proper way to handle the creation of the /var/lock directory using systemd is systemd-tmpfiles and tmpfiles.d. In my production builds (Buildroot + br2rauc + additional customizations) the /var/lock directory is getting properly created as a symlink to /run/lock. I am now testing to see if this also works with just br2rauc w/o any additions. I do recall at one point I was getting errors due to a missing /var/lock directory, but that was long enough ago (even before my initial commit) I don't remember the details.

cdsteinkuehler commented 2 years ago

Buildroot with systemd is generating /var/lock as a symlink to ../run/lock meaning the /var/lock directory in rootfs-overlay is unnecessary and has been removed in 4706e9e79cb267768f08dc7a555a34b2ea2c37eb.