aboutsummaryrefslogtreecommitdiffstats
path: root/LFS
diff options
context:
space:
mode:
authorPierre Labastie <pierre.labastie@neuf.fr>2022-10-06 10:26:29 +0200
committerPierre Labastie <pierre.labastie@neuf.fr>2022-10-06 10:26:29 +0200
commit3722d3164c0c3215eeec0afdffaa6a37886c5fc7 (patch)
tree9db1a1a11006c805268c4795a27e7aa80e72584f /LFS
parent87eb9e9a946f507b46803e4d1f5508b7ce54c3b2 (diff)
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...
Diffstat (limited to 'LFS')
-rw-r--r--LFS/master.sh23
1 files changed, 3 insertions, 20 deletions
diff --git a/LFS/master.sh b/LFS/master.sh
index a5d99138bb..0013c0fcfb 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)