[jhalfs] branch plabs/check-mount updated: Check that $(MOUNT_PT) is a mount point

"Git Owner" ([email protected] via alfs-discuss Mailing List) <[email protected]> Mon, 06 Jan 2025 17:46:34 +0000
Newsgroups gmane.linux.lfs.automated
Message-ID <173618559496.5618.2284695439806715851@rivendell.linuxfromscratch.org>
This is an automated email from the git hooks/post-receive script.

git pushed a commit to branch plabs/check-mount
in repository jhalfs.

The following commit(s) were added to refs/heads/plabs/check-mount by this push:
     new 5eadf60  Check that $(MOUNT_PT) is a mount point
5eadf60 is described below

commit 5eadf609f8c30ffab6a3a2a4f5c19df030b4276e
Author: Pierre Labastie <[email protected]>
AuthorDate: Mon Jan 6 18:38:04 2025 +0100

    Check that $(MOUNT_PT) is a mount point
    
    See ticket #1742 for details. It has been decided to add a check
    at the beginning of the run of make in the jhalfs directory.
    If $(MOUNT_PT) is not a mount point, which may be a valid use case,
    we don't stop, but we warn the user and give her/him 5 seconds for
    stopping the process. If the <return> key is not hit within 5
    seconds, the build starts.
    This target is a dependency of the "all" Makefile target, so that
    it is run each time make is started without parameter...
    
    Fixes #1742.
---
 LFS/master.sh | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/LFS/master.sh b/LFS/master.sh
index 8a79b7c..f9b2ce5 100644
--- a/LFS/master.sh
+++ b/LFS/master.sh
@@ -302,7 +302,7 @@ EOF
 
 .NOTPARALLEL:
 
-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
+all:	ck_UID ck_terminal ck_mountpoint mk_SETUP mk_LUSER mk_SUDO mk_CHROOT mk_BOOT create-sbu_du-report mk_BLFS_TOOL mk_CUSTOM_TOOLS
 	@sudo env LFS=\$(MOUNT_PT) kernfs-scripts/teardown.sh
 EOF
 ) >> $MKFILE
@@ -487,7 +487,7 @@ create-sbu_du-report:  mk_BOOT
 
 check-luser:
 	@if grep -q '^\$(LUSER):' /etc/passwd; then \\
-	    echo \$(RED)User \$(LUSER) exists:; \\
+	    echo \$(RED)User \$(LUSER) exists:\$(OFF); \\
 	    echo This is an error since the LFS book shall create it; \\
 	    exit 1; \\
 	fi
@@ -496,9 +496,19 @@ remove-luser:
 	-@userdel \$(LUSER); groupdel \$(LGROUP)
 	@rm -rf \$(LUSER_HOME)
 
+ck_mountpoint:
+	@if ! mountpoint -q \$(MOUNT_PT); then \\
+	   echo \$(RED)"**" \$(MOUNT_PT) is not a mountpoint. "**"\$(OFF); \\
+	   echo If this is what you want, just wait. Otherwise, hit; \\
+	   echo the \\<return\\> key within 5 seconds and fix your; \\
+	   echo configuration.; \\
+	   if read -t 5; then exit 1; fi; \\
+	fi
+
 do_housekeeping:
 	@-rm -f /tools
 
+.PHONY: ck_mountpoint
 EOF
 ) >> $MKFILE
 

-- 
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