commit: 1453e23dfd7685e61729dd34811123631bbf5b7b
parent 19f06ac37ebaeee709d84dd289f2b7fb7fba0a6d
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date: Wed, 29 May 2024 17:09:46 +0200
init.sh: Remove /utils-std-*/cmd from global PATH
Diffstat:
M | init.sh | 38 | ++++++++++++++++++++++++-------------- |
1 file changed, 24 insertions(+), 14 deletions(-)
diff --git a/init.sh b/init.sh
@@ -30,9 +30,12 @@ build_stubs() {
do
$CC $CFLAGS -o "/bin/$i" "/${i}-stub.c" || die "Failed compiling $i stub"
done
+}
+
+build_stubs_symlinks() {
ln -s grep /bin/egrep || die
ln -s grep /bin/fgrep || die
- ln /utils-std-*/cmd/cat /usr/bin/sort || die
+ ln -s cat /bin/sort || die
}
build_pdpmake() {
@@ -136,10 +139,7 @@ export CFLAGS="-Os -Wall -Wextra"
build_oyacc
-cd /utils-std-*/
-M4="true" loksh ./makeless.sh
-
-profile_export PATH="$PATH:$PWD/cmd/"
+profile_export PATH="/bin:/usr/bin:/usr/local/bin"
profile_export YACC="yacc"
profile_export STRIP="true"
profile_export INSTALL="install"
@@ -149,16 +149,29 @@ profile_export CC="$CC"
profile_export CFLAGS="$CFLAGS"
export SHELL="/bin/loksh"
-ln -s loksh /bin/sh || die "Failed creating /bin/sh symlink"
build_sbase_sed || die
-build_awk || die
-
# stubs for utilities currently missing from utils-std
-
build_stubs || die
+build_pdpmake || die
+
+cd /utils-std-*/ || die
+M4=true loksh ./makeless.sh || die
+
+oldpath="$PATH"
+PATH="$(echo /utils-std-*/cmd/):$oldpath"
+
+ln -s loksh /bin/sh || die "Failed creating /bin/sh symlink"
+
+# needs: make cat $CC $YACC rm mv $AR true test install mkdir
+build_hierloom_devtools || die
+
+build_utils_std || die
+
+PATH="$oldpath"
+
cat >/bin/hostname <<'EOF'
#!/bin/sh
exec uname -n
@@ -166,12 +179,9 @@ EOF
chmod +x /bin/hostname
-build_pdpmake || die
-
-build_hierloom_devtools || die
+build_stubs_symlinks || die
-# Needs make + m4
-build_utils_std || die
+build_awk || die
build_hierloom || die