Fix changing the ownership of $BUILDDIR/var/lib to LUSER when it has been

created by func_install_blfs. Fixes ticket #1729
This commit is contained in:
Pierre Labastie 2020-09-17 15:30:29 +00:00
parent 426e40be67
commit 088130f04a
2 changed files with 9 additions and 3 deletions

View file

@ -70,7 +70,7 @@ chapter_targets() { #
cp ${CONFIG} $BUILDDIR/sources/kernel-config ;; cp ${CONFIG} $BUILDDIR/sources/kernel-config ;;
esac esac
# Grab the name of the target # 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\}-@@' \ name=`echo ${this_script} | sed -e 's@[0-9]\{3,4\}-@@' \
-e 's@-pass[0-9]\{1\}@@' \ -e 's@-pass[0-9]\{1\}@@' \
-e 's@-libstdc++@@' \ -e 's@-libstdc++@@' \
@ -142,6 +142,8 @@ chapter_targets() { #
case "${this_script}" in case "${this_script}" in
*addinguser) *addinguser)
( (
# /var/lib may already exist and be owned by root if blfs tools
# have been installed.
cat << EOF cat << EOF
@if [ -f luser-id ]; then \\ @if [ -f luser-id ]; then \\
function useradd() { true; }; \\ function useradd() { true; }; \\
@ -152,6 +154,8 @@ cat << EOF
\$(CMDSDIR)/`dirname $file`/\$@ >> \$(LOGDIR)/\$@ 2>&1; \\ \$(CMDSDIR)/`dirname $file`/\$@ >> \$(LOGDIR)/\$@ 2>&1; \\
\$(PRT_DU) >>logs/\$@ \$(PRT_DU) >>logs/\$@
@chown \$(LUSER):\$(LGROUP) envars @chown \$(LUSER):\$(LGROUP) envars
@[ -d "\$(MOUNT_PT)/var/lib" ] && \\
chown \$(LUSER):\$(LGROUP) \$(MOUNT_PT)/var/lib
@chmod -R a+wt $JHALFSDIR @chmod -R a+wt $JHALFSDIR
@chmod a+wt \$(SRCSDIR) @chmod a+wt \$(SRCSDIR)
EOF EOF

View file

@ -62,8 +62,10 @@ sudo make -j1 -C $BUILDDIR$BLFS_ROOT \
$BUILDDIR$BLFS_ROOT/packages.xml $BUILDDIR$BLFS_ROOT/packages.xml
# But then $BUILDDIR/var/lib/ is owned by root if just created, which # But then $BUILDDIR/var/lib/ is owned by root if just created, which
# prevents $LUSER to create "nss_db". Change ownership here # prevents $LUSER to create "nss_db". The problem is that $LUSER
sudo chown $LUSER:$LGROUP $BUILDDIR/var/lib # 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) # Because the BLFS Makefile is supposed to be used in chroot (or booted)
# mode, the tracking file has wrong path for DTD. Change it: # mode, the tracking file has wrong path for DTD. Change it: