From 2c1a7639907e771c3fadee3d17a313e4d5480249 Mon Sep 17 00:00:00 2001 From: Pierre Labastie Date: Wed, 30 Mar 2022 22:35:12 +0200 Subject: [PATCH] try to fix func_install_blfs to work in all cases WIP... --- common/libs/func_install_blfs | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/common/libs/func_install_blfs b/common/libs/func_install_blfs index 129d33c..c3d6763 100644 --- a/common/libs/func_install_blfs +++ b/common/libs/func_install_blfs @@ -32,19 +32,31 @@ echo "copying the local BLFS working copy (may take some time)" # of blfs-xml, if blfs-xml already exists; --preserve=timestamps: if the local # book has already been validated, tmp is posterior to the others, and # validation will not be done again. - cp -ruT --preserve=timestamps $BLFS_WC_LOCATION \ +# sudo is needed because make (below) may already have been run and +# may have put some files owned by root + sudo cp -ruT --preserve=timestamps $BLFS_WC_LOCATION \ ${BUILDDIR}${BLFS_ROOT}/$BLFS_XML fi # Copy the LFS book. Note that now, the book is downloaded before running # the BLFS tools. -cp -ruT --preserve=timestamps $BOOK \ +sudo cp -ruT --preserve=timestamps $BOOK \ ${BUILDDIR}${BLFS_ROOT}/$LFS_XML # Downloads the book if necessary, initialize the tracking file and the # package database. +# updating first is needed if the xml sources have already been cloned +# and we want to set the branches. +# Note that if LFS-BRANCH or BLFS-BRANCH is empty, which may happen +# if using a working copy, then the corresponding update is not +# performed by make (see BLFS/Makefile). # sudo is needed if $BUILDDIR/var/lib is owned by root and /var/lib/jhalfs # has to be created +sudo make -j1 -C $BUILDDIR$BLFS_ROOT \ + REV=$INITSYS \ + LFS-BRANCH=${COMMIT} \ + BLFS-BRANCH=${BLFS_TREE} \ + update sudo make -j1 -C $BUILDDIR$BLFS_ROOT \ REV=$INITSYS \ TRACKING_DIR=$BUILDDIR$TRACKING_DIR \ @@ -52,6 +64,7 @@ sudo make -j1 -C $BUILDDIR$BLFS_ROOT \ LFS-BRANCH="${COMMIT}" \ BLFS_XML=$BUILDDIR$BLFS_ROOT/$BLFS_XML \ BLFS-BRANCH=${BLFS_TREE} \ + update \ $BUILDDIR$BLFS_ROOT/packages.xml # But then $BUILDDIR/var/lib/ is owned by root if just created, which