From 46c6113b28e3bbc4f1d85f50b5e1bc2f99a1f3e8 Mon Sep 17 00:00:00 2001 From: Pierre Labastie Date: Thu, 9 Jul 2020 17:02:10 +0000 Subject: [PATCH] Prevent overwriting /var/run and lock symlinks with PM /var/run and /var/lock are created as symlinks in creatingdirs. But if a package install something into those dirs (with DESTDIR install), they get overwritten with true directories if using a package manager. Note that without PM, anything installed into those dirs is lost at next reboot. So remove those dirs before packaging. --- LFS/lfs.xsl | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/LFS/lfs.xsl b/LFS/lfs.xsl index f223fd7..1131de6 100644 --- a/LFS/lfs.xsl +++ b/LFS/lfs.xsl @@ -311,6 +311,12 @@ rm -fv $PKG_DEST/sbin/nologin done [ -d $PKG_DEST/lib64 ] && [ -z "$(ls $PKG_DEST/lib64)" ] && rmdir -v $PKG_DEST/lib64 + +rm -rf $PKG_DEST/var/{run,lock} + +[ -d $PKG_DEST/var ] && [ -z "$(ls $PKG_DEST/var)" ] && rmdir -v $PKG_DEST/var PREV_SEC=${SECONDS} packInstall SECONDS=${PREV_SEC}