Current FHS compliance
authorSteve Youngs <steve@steveyoungs.com>
Sat, 6 Feb 2021 06:44:56 +0000 (16:44 +1000)
committerSteve Youngs <steve@steveyoungs.com>
Sat, 6 Feb 2021 06:44:56 +0000 (16:44 +1000)
This changeset updates everything to allow for an "unsplit /usr"
filesystem hierarchy.  The current FHS policy states that
 /bin /sbin /lib /lib64 should all be symlinks into the corresponding
directories under /usr

Signed-off-by: Steve Youngs <steve@steveyoungs.com>
.gitignore
README
etc/pkgusr/bash_profile
etc/pkgusr/handy_funcs
etc/sudoers.d/99-pkgusr
usr/bin/library-symbol-search
usr/bin/list_suspicious_files
usr/lib/pkgusr/install
usr/lib/pkgusr/ldconfig

index e74813a..31e0c49 100644 (file)
@@ -1,2 +1,4 @@
 ++log
 *.elc
+,,*
+*~
diff --git a/README b/README
index 80a344a..fbab62c 100644 (file)
--- a/README
+++ b/README
@@ -63,6 +63,16 @@ ldconfig wrapper needs sudo; if you want to set yourself up as a "master
 installer", OpenSSL and OpenSSH are needed; and pkgusr.el needs SXEmacs
 (or XEmacs/Emacs) obviously.
 
+FHS Note:
+========
+
+As of 2021-02-06 I have switched over to following the current FHS
+policy that states /bin /sbin /lib /lib64 should all be symlinks into
+/usr.  This conflicts with a lot of the {B,}LFS build/install
+instructions that have you move libraries and other binaries into /lib
+/bin /sbin etc.  You pretty much just gotta ignore that shit and embrace
+2021... we have cookies!
+
 Pre-Installation:
 ================
 
@@ -170,18 +180,18 @@ Copy'n'Paste Fun!
 PKGUSR=/path/to/your/pkgusr/repo/working/dir &&  ## Yeah, edit this bit!
 cp -va ${PKGUSR}/etc/pkgusr ${LFS}/etc &&
 chown -vR 0:0 ${LFS}/etc/pkgusr &&
-install -v -m711 -o0 -g0 -d ${LFS}/etc/sudoers.d &&
-install -v -m440 -o0 -g0 ${PKGUSR}/etc/sudoers.d/99-pkgusr \
+install -vm711 -o0 -g0 -d ${LFS}/etc/sudoers.d &&
+install -vm440 -o0 -g0 ${PKGUSR}/etc/sudoers.d/99-pkgusr \
     ${LFS}/etc/sudoers.d &&
-install -v -m644 ${PKGUSR}/installdir.lst ${LFS}/root &&
-install -v -m755 ${PKGUSR}/bin/{which,mail} ${LFS}/bin &&
-install -v -m755 ${PKGUSR}/usr/bin/* ${LFS}/bin &&
-install -v -m750 -o0 -g9999 -d ${LFS}/usr/lib/pkgusr &&
-install -v -m550 -o0 -g9999 ${PKGUSR}/usr/lib/pkgusr/* \
+install -vm644 ${PKGUSR}/installdir.lst ${LFS}/root &&
+install -vm755 ${PKGUSR}/bin/{which,mail} ${LFS}/usr/bin &&
+install -vm755 ${PKGUSR}/usr/bin/* ${LFS}/usr/bin &&
+install -vm750 -o0 -g9999 -d ${LFS}/usr/lib/pkgusr &&
+install -vm550 -o0 -g9999 ${PKGUSR}/usr/lib/pkgusr/* \
     ${LFS}/usr/lib/pkgusr &&
-install -v -m755 ${PKGUSR}/usr/sbin/{add_package_user,install_package} \
+install -vm755 ${PKGUSR}/usr/sbin/{add_package_user,install_package} \
     ${LFS}/usr/sbin &&
-install -v -m755 ${PKGUSR}/usr/sbin/{group,user}add ${LFS}/tools/bin &&
+install -vm755 ${PKGUSR}/usr/sbin/{group,user}add ${LFS}/tools/bin &&
 unset PKGUSR
 
 From this point on you need to re-enter the chroot environment.  So
index eaf7f6d..ad4323b 100644 (file)
@@ -9,8 +9,8 @@ LC_ALL=POSIX
 #
 # Once you are no longer needing or using the tools dir you can remove it
 # from the PATH if you want, but leaving it there won't hurt.
-#PATH=/usr/lib/pkgusr:/usr/bin:/bin:/usr/X11R6/bin:/opt/qt/bin:/tools/bin
-PATH=/usr/lib/pkgusr:/usr/bin:/bin:/usr/X11R6/bin:/opt/qt/bin
+#PATH=/usr/lib/pkgusr:/usr/bin:/usr/X11R6/bin:/opt/qt/bin:/tools/bin
+PATH=/usr/lib/pkgusr:/usr/bin:/usr/X11R6/bin:/opt/qt/bin
 
 ## A couple things to make less(1) nicer.
 LESS='-MRgiswFX'
index d22e388..542563d 100644 (file)
@@ -134,7 +134,7 @@ checkupdates()
     local sysbv=$(${sysb} -V|awk '/build:/ {print $2;}')
     local pkgbv=$(${pkgb} -V|awk '/build:/ {print $2;}')
     
-    if [ ${sysb} -nt ${pkgb} ]; then
+    if [[ ${sysbv} -gt ${pkgbv} ]]; then
        echo '*****************************************'
        echo '*                                       *'
        echo '*  B u i l d  S c r i p t  U p d a t e  *'
index 2789e32..7e88f25 100644 (file)
@@ -4,7 +4,7 @@
 #
 ####
 
-Cmnd_Alias        LDCONFIG = /sbin/ldconfig *
+Cmnd_Alias        LDCONFIG = /usr/sbin/ldconfig *
 User_Alias        PKGUSRS = %install
 Defaults:PKGUSRS  !lecture, !authenticate
 
index 012074d..8139f49 100755 (executable)
@@ -5,7 +5,7 @@
 # Author:     Steve Youngs <steve@sxemacs.org>
 # Maintainer: Steve Youngs <steve@sxemacs.org>
 # Created:    <2008-03-10>
-# Time-stamp: <Wednesday Jan 20, 2021 14:07:28 steve>
+# Time-stamp: <Friday Feb  5, 2021 19:53:29 steve>
 # Homepage:   N/A
 # Keywords:   utils package-management
 
@@ -70,13 +70,12 @@ fi
 # Library directories.
 # These are the directories we search.  If you have other lib directories
 # such as /usr/local/lib, /opt/lib, add them here.
-lib_dirs=(/usr/lib /usr/X11R6/lib /lib)
+lib_dirs=(/usr/lib /usr/X11R6/lib)
 
 # bastard library directories...
 # lib_dirs=(\
 #      /usr/lib \
 #      /usr/X11R6/lib \
-#      /lib \
 #      /opt/qt/lib \
 #      /opt/kde/lib)
 
index 34fc93c..a433c4d 100755 (executable)
@@ -19,7 +19,7 @@
 fs_to_scan=(/)
 
 ## Bastard settings
-#fs_to_scan=(/ /opt /usr /usr/src /var)
+#fs_to_scan=(/ /opt /usr/src /var)
 
 # Files with a path prefix found in the following list are ignored.
 # DO !!!!NOT!!! PUT /usr/src OR WHATEVER THE HOME DIRECTORY prefix is for your
index ab2986d..f46d10e 100755 (executable)
@@ -65,7 +65,7 @@
 #
 #    1. You're multi-lingual and like switching between languages.
 #    2. English is not your 1st or preferred language. (or you can't
-#       tollerate en_US)
+#       tolerate en_US)
 #    3. To satisfy glibc's test suite.
 #
 #  For me, #3 is the only one that is relevant.  But don't worry,
@@ -271,7 +271,9 @@ while getopts $args opts; do
        (m) perm=${OPTARG}; _perms ;;
        (o) owner=${OPTARG}; _owner ;;
        # Illegal options.
-       (*) exit 1 ;;
+       (*) echo 1>&2 '***' Illegal option -- ${OPTARG}
+           exit 1
+           ;;
     esac
 done
 shift $(( $OPTIND - 1 ))
index 15dc1cb..723e9e4 100755 (executable)
@@ -8,9 +8,9 @@
 ####
 
 if [ -x $(type -p sudo) ]; then
-    sudo /sbin/ldconfig "$@"
+    sudo /usr/sbin/ldconfig "$@"
 else
-    /sbin/ldconfig "$@" || exit $?
+    /usr/sbin/ldconfig "$@" || exit $?
     echo 1>&2 '***' No sudo available, you need to run ldconfig as root
 fi