[jhalfs] 02/03: Call kernel filesystem scripts from Makefile

"Git Owner" ([email protected] via alfs-discuss Mailing List) <[email protected]>
Newsgroups gmane.linux.lfs.automated
Message-ID <[email protected]>
This is an automated email from the git hooks/post-receive script.

git pushed a commit to branch trunk
in repository jhalfs.

commit 3722d3164c0c3215eeec0afdffaa6a37886c5fc7
Author: Pierre Labastie <[email protected]>
AuthorDate: Thu Oct 6 10:26:29 2022 +0200

    Call kernel filesystem scripts from Makefile
    
    Instead of having them inside the Makefile, which implies editing
    them (automatically), which is not robust if anything changes:
    it got broken when a test for a mountpoint was added...
---
 LFS/master.sh | 23 +++--------------------
 1 file changed, 3 insertions(+), 20 deletions(-)

diff --git a/LFS/master.sh b/LFS/master.sh
index a5d9913..0013c0f 100644
--- a/LFS/master.sh
+++ b/LFS/master.sh
@@ -286,30 +286,13 @@ build_Makefile() {           #
     i=`expr $i + 1`
   done
 
-  # Store virtual kernel file systems commands:
-  devices=`cat ../kernfs-scripts/devices.sh | \
-            sed -e 's|^|	|'   \
-                -e 's|mount|sudo &|' \
-                -e 's|mkdir|sudo &|' \
-                -e 's|\\$|&&|g' \
-                -e 's|\$|; \\\\|' \
-                -e 's|then|& :|' \
-                -e 's|\$\$LFS|$(MOUNT_PT)|g'`
-  teardown=`cat ../kernfs-scripts/teardown.sh | \
-            sed -e 's|^|	|'   \
-                -e 's|umount|-sudo &|' \
-                -e 's|\$LFS|$(MOUNT_PT)|'`
-  teardownat=`cat ../kernfs-scripts/teardown.sh | \
-              sed -e 's|^|	|'   \
-                  -e 's|umount|@-sudo &|' \
-                  -e 's|\$LFS|$(MOUNT_PT)|'`
   # Drop in the main target 'all:' and the chapter targets with each sub-target
   # as a dependency.
 (
     cat << EOF
 
 all:	ck_UID ck_terminal mk_SETUP mk_LUSER mk_SUDO mk_CHROOT mk_BOOT create-sbu_du-report mk_BLFS_TOOL mk_CUSTOM_TOOLS
-$teardownat
+	@sudo env LFS=\$(MOUNT_PT) kernfs-scripts/teardown.sh
 	@sudo make do_housekeeping
 	@echo $VERSION > lfs-release && \\
 	sudo mv lfs-release \$(MOUNT_PT)/etc && \\
@@ -394,7 +377,7 @@ mk_CUSTOM_TOOLS: mk_BLFS_TOOL
 	@touch \$@
 
 devices: ck_UID
-$devices
+	sudo env LFS=\$(MOUNT_PT) kernfs-scripts/devices.sh
 EOF
 ) >> $MKFILE
 if [ "$INITSYS" = systemd ]; then
@@ -409,7 +392,7 @@ fi
     cat << EOF
 
 teardown:
-$teardown
+	sudo env LFS=\$(MOUNT_PT) kernfs-scripts/teardown.sh
 
 chroot1: devices
 	sudo \$(CHROOT1)

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.

-- 
http://lists.linuxfromscratch.org/sympa/info/alfs-discuss
Unsubscribe: See the above information page
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.