diff --git a/LFS/master.sh b/LFS/master.sh index c36ec4b..6aae4e6 100644 --- a/LFS/master.sh +++ b/LFS/master.sh @@ -70,7 +70,7 @@ chapter_targets() { # cp ${CONFIG} $BUILDDIR/sources/kernel-config ;; esac # Grab the name of the target - # This is only use to check the name in "opt_override" or "BLACKIST" + # This is only used to check the name in "opt_override" or "BLACKIST" name=`echo ${this_script} | sed -e 's@[0-9]\{3,4\}-@@' \ -e 's@-pass[0-9]\{1\}@@' \ -e 's@-libstdc++@@' \ @@ -142,6 +142,8 @@ chapter_targets() { # case "${this_script}" in *addinguser) ( +# /var/lib may already exist and be owned by root if blfs tools +# have been installed. cat << EOF @if [ -f luser-id ]; then \\ function useradd() { true; }; \\ @@ -152,6 +154,8 @@ cat << EOF \$(CMDSDIR)/`dirname $file`/\$@ >> \$(LOGDIR)/\$@ 2>&1; \\ \$(PRT_DU) >>logs/\$@ @chown \$(LUSER):\$(LGROUP) envars + @[ -d "\$(MOUNT_PT)/var/lib" ] && \\ + chown \$(LUSER):\$(LGROUP) \$(MOUNT_PT)/var/lib @chmod -R a+wt $JHALFSDIR @chmod a+wt \$(SRCSDIR) EOF diff --git a/common/libs/func_install_blfs b/common/libs/func_install_blfs index 2303154..f69bfcc 100644 --- a/common/libs/func_install_blfs +++ b/common/libs/func_install_blfs @@ -62,8 +62,10 @@ sudo make -j1 -C $BUILDDIR$BLFS_ROOT \ $BUILDDIR$BLFS_ROOT/packages.xml # But then $BUILDDIR/var/lib/ is owned by root if just created, which -# prevents $LUSER to create "nss_db". Change ownership here -sudo chown $LUSER:$LGROUP $BUILDDIR/var/lib +# prevents $LUSER to create "nss_db". The problem is that $LUSER +# May not have been created yet. So do not change ownership here +# and do it in master.sh for chapter 4. +#sudo chown $LUSER:$LGROUP $BUILDDIR/var/lib # Because the BLFS Makefile is supposed to be used in chroot (or booted) # mode, the tracking file has wrong path for DTD. Change it: