summaryrefslogtreecommitdiff
path: root/source/a
diff options
context:
space:
mode:
Diffstat (limited to 'source/a')
-rw-r--r--source/a/pkgtools/doinst.sh69
-rw-r--r--source/a/pkgtools/manpages/explodepkg.82
-rw-r--r--source/a/pkgtools/manpages/installpkg.82
-rw-r--r--source/a/pkgtools/manpages/makepkg.88
-rw-r--r--source/a/pkgtools/manpages/removepkg.810
-rwxr-xr-xsource/a/pkgtools/pkgtools.SlackBuild19
-rw-r--r--source/a/pkgtools/scripts/explodepkg4
-rw-r--r--source/a/pkgtools/scripts/installpkg32
-rw-r--r--source/a/pkgtools/scripts/makebootdisk2
-rw-r--r--source/a/pkgtools/scripts/pkgtool15
-rw-r--r--source/a/pkgtools/scripts/removepkg31
-rw-r--r--source/a/pkgtools/scripts/setup.80.make-bootdisk2
-rw-r--r--source/a/pkgtools/scripts/setup.services2
-rw-r--r--source/a/pkgtools/scripts/upgradepkg28
-rw-r--r--source/a/sysvinit/CHANGES1
-rw-r--r--source/a/sysvinit/slack-desc2
-rwxr-xr-xsource/a/sysvinit/sysvinit.SlackBuild32
-rw-r--r--source/a/sysvinit/sysvinit.use_dev_initctl_not_run_initctl.diff267
18 files changed, 462 insertions, 66 deletions
diff --git a/source/a/pkgtools/doinst.sh b/source/a/pkgtools/doinst.sh
new file mode 100644
index 00000000..d14a6787
--- /dev/null
+++ b/source/a/pkgtools/doinst.sh
@@ -0,0 +1,69 @@
+#!/bin/bash
+# Migrate the package database and related directories from the long-time
+# (stupid) directory /var/log to /var/lib/pkgtools.
+#
+# The removed_* directories will remain under /var/log (but moved to
+# /var/log/pkgtools) as they contain log files of previous operations,
+# not anything that's actively used for package management. Also, the
+# removed_* directories can become quite large compared with the database.
+#
+# First, if it's just a case of missing symlinks, make them. Don't make them
+# if the directories exist in /var/log - we'll do a proper migration in that
+# case.
+for directory in packages scripts setup ; do
+ if [ ! -L var/log/$directory -a ! -d var/log/$directory ]; then
+ if [ -d var/lib/pkgtools/$directory ]; then
+ # Make the symlink:
+ ( cd var/log ; ln -sf ../lib/pkgtools/$directory . )
+ fi
+ fi
+done
+for directory in removed_packages removed_scripts ; do
+ if [ ! -L var/log/$directory -a ! -d var/log/$directory ]; then
+ mkdir -p var/log/pkgtools/$directory
+ ( cd var/log ; ln -sf pkgtools/$directory . )
+ fi
+ if [ ! -L var/lib/pkgtools/$directory -a ! -d var/lib/pkgtools/$directory ]; then
+ mkdir -p var/lib/pkgtools
+ ( cd var/lib/pkgtools ; ln -sf ../../log/pkgtools/$directory . )
+ fi
+done
+# If at this point /var/log/packages is not a symlink, we need to do the
+# migration. We should already have a lock on being the only install script
+# that's currently running, but also get a lock on ldconfig to freeze any
+# other package operations that are happening now until after the migration
+# is complete.
+if [ ! -L var/log/packages ]; then
+ if [ ! -d run/lock/pkgtools ]; then
+ mkdir -p run/lock/pkgtools
+ fi
+ ( flock 9 || exit 11
+ # Don't migrate if tar is running, as there may still be package operations
+ # going on in another process:
+ while pidof tar 1> /dev/null 2> /dev/null ; do
+ sleep 15
+ done
+ # Just to be a bit safer from race conditions:
+ sleep 5
+ # First, move the removed_* directories into a pkgtools subdirectory:
+ mkdir -p var/log/pkgtools
+ for directory in removed_packages removed_scripts ; do
+ if [ ! -d var/log/pkgtools/$directory ]; then
+ mkdir -p var/log/pkgtools/$directory
+ # Move anything found in the old location, then remove it:
+ mv var/log/$directory/* var/log/pkgtools/$directory 2> /dev/null
+ rm -rf var/log/$directory
+ # Make a symlink:
+ ( cd var/log ; ln -sf pkgtools/$directory . )
+ fi
+ done
+ for directory in packages scripts setup ; do
+ mkdir -p var/lib/pkgtools/$directory
+ mv var/log/$directory/* var/lib/pkgtools/$directory 2> /dev/null
+ rm -rf var/log/$directory
+ ( cd var/log
+ ln -sf ../lib/pkgtools/$directory .
+ )
+ done
+ ) 9> run/lock/pkgtools/ldconfig.lock
+fi
diff --git a/source/a/pkgtools/manpages/explodepkg.8 b/source/a/pkgtools/manpages/explodepkg.8
index 3e11fddc..ddc3d47c 100644
--- a/source/a/pkgtools/manpages/explodepkg.8
+++ b/source/a/pkgtools/manpages/explodepkg.8
@@ -25,7 +25,7 @@ uncompresses and untars Slackware *.tgz (or .tbz, .tlz, .txz) packages (or any a
that was created by
compressing a tarfile with one of the supported compression utilities) in the current directory. It is not usually
used to install packages, since it doesn't execute the installation scripts
-in ./install or ./var/log/setup. The primary use for
+in ./install or ./var/lib/pkgtools/setup. The primary use for
.B explodepkg
is in package maintenance - exploding a package in a subdirectory, making fixes
to it or upgrading the software, and then building the updated package with
diff --git a/source/a/pkgtools/manpages/installpkg.8 b/source/a/pkgtools/manpages/installpkg.8
index f06e611d..204cc841 100644
--- a/source/a/pkgtools/manpages/installpkg.8
+++ b/source/a/pkgtools/manpages/installpkg.8
@@ -61,7 +61,7 @@ not actually install the package. The list is formatted in a suitable fashion t
use as a list of files to backup.
.TP
.B \--md5sum packagename
-Record the package md5sum in the metadata written in /var/log/packages.
+Record the package md5sum in the metadata written in /var/lib/pkgtools/packages.
.TP
.B \--root /otherroot
Install using a location other than / (the default) as the root of the
diff --git a/source/a/pkgtools/manpages/makepkg.8 b/source/a/pkgtools/manpages/makepkg.8
index 0f239a9b..16a98f3f 100644
--- a/source/a/pkgtools/manpages/makepkg.8
+++ b/source/a/pkgtools/manpages/makepkg.8
@@ -110,11 +110,11 @@ or
The second type of script is the
.B configuration
script. This is found in the subdirectory
-.B ./var/log/setup
+.B ./var/lib/pkgtools/setup
and must have a name that starts with
.B setup.
in order to be recongnized. An example is the timezone script:
-.B /var/log/setup/setup.timeconfig.
+.B /var/lib/pkgtools/setup/setup.timeconfig.
These scripts are executed during the
.B CONFIGURE
phase of
@@ -136,13 +136,13 @@ script. Like the name suggests, these are executed only once after the package
is installed, in contrast to the standard
.B configuration
script. These scripts are also found in the
-.B ./var/log/setup
+.B ./var/lib/pkgtools/setup
directory and must have a name that starts with
.B setup.,
but in addition the name must contain the string
.B onlyonce.
An example might be a script with the name
-.B /var/log/setup/setup.onlyonce.testscript
+.B /var/lib/pkgtools/setup/setup.onlyonce.testscript
.SH PACKAGE FORMAT
.B makepkg
uses GNU tar plus GNU gzip to create its packages. A simple way to
diff --git a/source/a/pkgtools/manpages/removepkg.8 b/source/a/pkgtools/manpages/removepkg.8
index d6be202c..f92ed8c2 100644
--- a/source/a/pkgtools/manpages/removepkg.8
+++ b/source/a/pkgtools/manpages/removepkg.8
@@ -38,7 +38,7 @@ removepkg \- remove Slackware packages.
.B removepkg
removes a previously installed Slackware package, while writing a progress
report to the standard output. A package may be specified either by the
-full package name (as you'd see listed in /var/log/packages/), or by the
+full package name (as you'd see listed in /var/lib/pkgtools/packages/), or by the
base package name. For example, the package foo-1.0-i586-1.txz may be removed
with any of the following commands:
@@ -71,12 +71,12 @@ you do this (and maybe pipe the output to
be important.
.LP
When removing a package, it's original file index will be moved from
-/var/log/packages to /var/log/removed_packages. Likewise, it's installation
-script will be moved from /var/log/scripts to /var/log/removed_scripts.
+/var/lib/pkgtools/packages to /var/log/pkgtools/removed_packages. Likewise, its installation
+script will be moved from /var/lib/pkgtools/scripts to /var/log/pkgtools/removed_scripts.
.SH OPTIONS
.TP
.B \--copy packagename
-Construct a copy of the package under /var/log/setup/tmp/preserved_packages/packagename,
+Construct a copy of the package under /var/lib/pkgtools/setup/tmp/preserved_packages/packagename,
but don't remove it. (same effect as \-warn \-preserve)
.TP
.B \--keep
@@ -86,7 +86,7 @@ required_list). Mostly useful for debugging purposes.
.TP
.B \--preserve packagename
If specified, the complete package subtree is reconstructed in
-/var/log/setup/tmp/preserved_packages/packagename.
+/var/lib/pkgtools/setup/tmp/preserved_packages/packagename.
.TP
.B \--terse
Remove the package displaying only a single description line to stdout.
diff --git a/source/a/pkgtools/pkgtools.SlackBuild b/source/a/pkgtools/pkgtools.SlackBuild
index 0937267d..bdcb11ac 100755
--- a/source/a/pkgtools/pkgtools.SlackBuild
+++ b/source/a/pkgtools/pkgtools.SlackBuild
@@ -30,7 +30,7 @@ PKGNAM=pkgtools
# *** UPDATE THESE WITH EACH BUILD:
VERSION=15.0
ARCH=${ARCH:-noarch}
-BUILD=${BUILD:-19}
+BUILD=${BUILD:-20}
# If the variable PRINT_PACKAGE_NAME is set, then this script will report what
# the name of the created package would be, and then exit. This information
@@ -80,19 +80,24 @@ mkdir -p $PKG
chown root:root $PKG/sbin/*
chmod 755 $PKG/sbin/*
# These scripts are used during the installation:
- mkdir -p $PKG/var/log/setup/tmp
- chmod 700 $PKG/var/log/setup/tmp
+ mkdir -p $PKG/var/lib/pkgtools/setup/tmp
+ chmod 700 $PKG/var/lib/pkgtools/setup/tmp
for file in setup.* ; do
- cp -a $file $PKG/var/log/setup
+ cp -a $file $PKG/var/lib/pkgtools/setup
done
- chown root:root $PKG/var/log/setup/setup.*
- chmod 755 $PKG/var/log/setup/setup.*
+ chown root:root $PKG/var/lib/pkgtools/setup/setup.*
+ chmod 755 $PKG/var/lib/pkgtools/setup/setup.*
# Add a link for makebootstick:
- ( cd $PKG/sbin ; ln -sf ../var/log/setup/setup.80.make-bootdisk makebootstick )
+ ( cd $PKG/sbin ; ln -sf ../var/lib/pkgtools/setup/setup.80.make-bootdisk makebootstick )
)
+# Create the base directories (not really necessary, but doesn't hurt):
+mkdir -p $PKG/var/lib/pkgtools/{packages,scripts}
+mkdir -p $PKG/var/log/pkgtools/{removed_packages,removed_scripts}
+
mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc
+zcat $CWD/doinst.sh.gz > $PKG/install/doinst.sh
# Build the package:
cd $PKG
diff --git a/source/a/pkgtools/scripts/explodepkg b/source/a/pkgtools/scripts/explodepkg
index e1f9b128..72c013d4 100644
--- a/source/a/pkgtools/scripts/explodepkg
+++ b/source/a/pkgtools/scripts/explodepkg
@@ -32,8 +32,8 @@ Equivalent to (for each package listed):
( umask 000 ; cat package_name | COMPRESSOR -dc | tar xpvf package_name )
Note: This should only be used for debugging or examining packages, not for
-installing them. It doesn't execute installation scripts or update the package
-indexes in /var/log/packages and /var/log/scripts.
+installing them. It doesn't execute installation scripts or update the package
+indexes in /var/lib/pkgtools/packages and /var/lib/pkgtools/scripts.
EOF
fi
diff --git a/source/a/pkgtools/scripts/installpkg b/source/a/pkgtools/scripts/installpkg
index b777442a..0d82f89c 100644
--- a/source/a/pkgtools/scripts/installpkg
+++ b/source/a/pkgtools/scripts/installpkg
@@ -21,6 +21,15 @@
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
+# Mon Jun 4 21:17:58 UTC 2018
+# Migrate the package database and directories from /var/log to
+# /var/lib/pkgtools. /var/log was never a good place for this data, as it is
+# considered by many to be a directory that could be wiped to free up some
+# space. Originally the package database was in /var/adm, but the FSSTND
+# (later FHS) group decided that directory should be a symlink to /var/log,
+# and I went along with that since it was years ago and I was a n00b and didn't
+# know any better. /var/lib/pkgtools will be a better and safer location.
+#
# Thu May 24 20:23:55 UTC 2018
# Added --terselength option to set the line length in --terse mode.
# Allow adding NOLOCK in an install script to allow it to run without locking.
@@ -254,14 +263,33 @@ while [ 0 ]; do
done
# Set the prefix for the package database directories (packages, scripts).
-ADM_DIR="$ROOT/var/log"
+ADM_DIR="$ROOT/var/lib/pkgtools"
+
+# Set the prefix for the removed packages/scripts log files:
+LOG_DIR="$ROOT/var/log/pkgtools"
+
# If the directories don't exist, "initialize" the package database:
-for PKGDBDIR in packages removed_packages removed_scripts scripts setup ; do
+for PKGDBDIR in packages scripts setup ; do
if [ ! -d $ADM_DIR/$PKGDBDIR ]; then
mkdir -p $ADM_DIR/$PKGDBDIR
chmod 755 $ADM_DIR/$PKGDBDIR
fi
done
+for PKGLOGDIR in removed_packages removed_scripts ; do
+ if [ ! -d $LOG_DIR/$PKGLOGDIR ]; then
+ rm -rf $LOG_DIR/$PKGLOGDIR # make sure it's not a symlink or something stupid
+ mkdir -p $LOG_DIR/$PKGLOGDIR
+ chmod 755 $LOG_DIR/$PKGLOGDIR
+ fi
+done
+# Likewise, make sure that the symlinks in /var/log exist. We no longer
+# trust anything to remain in /var/log. Let the admin wipe it if that's
+# what they like.
+for symlink in packages scripts setup ; do
+ if [ ! -L $LOG_DIR/../$symlink -a ! -d $LOG_DIR/../$symlink ]; then
+ ( cd $LOG_DIR/.. ; ln -sf ../lib/pkgtools/$symlink . )
+ fi
+done
# Make sure there's a proper temp directory:
TMP=$ADM_DIR/setup/tmp
diff --git a/source/a/pkgtools/scripts/makebootdisk b/source/a/pkgtools/scripts/makebootdisk
index e1c3cfb6..79379618 100644
--- a/source/a/pkgtools/scripts/makebootdisk
+++ b/source/a/pkgtools/scripts/makebootdisk
@@ -34,7 +34,7 @@ else
fi
# Make sure there's a proper temp directory:
-TMP=/var/log/setup/tmp
+TMP=/var/lib/pkgtools/setup/tmp
# If the $TMP directory doesn't exist, create it:
if [ ! -d $TMP ]; then
mkdir -p $TMP
diff --git a/source/a/pkgtools/scripts/pkgtool b/source/a/pkgtools/scripts/pkgtool
index 000bb002..076402b8 100644
--- a/source/a/pkgtools/scripts/pkgtool
+++ b/source/a/pkgtools/scripts/pkgtool
@@ -3,7 +3,7 @@
# Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999 Patrick Volkerding, Moorhead, MN USA
# Copyright 2001, 2004 Slackware Linux, Inc., Concord, CA USA
# All rights reserved.
-# Copyright 2007, 2009, 2010, 2011, 2013, 2015, 2016 Patrick Volkerding, Sebeka, MN, USA
+# Copyright 2007, 2009, 2010, 2011, 2013, 2015, 2016, 2018 Patrick Volkerding, Sebeka, MN, USA
#
# Redistribution and use of this script, with or without modification, is
# permitted provided that the following conditions are met:
@@ -23,6 +23,9 @@
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
+# Mon Jun 4 21:17:58 UTC 2018
+# Use /var/lib/pkgtools, not /var/log.
+#
# Sat Apr 25 21:18:53 UTC 2009
# Converted to use new pkgbase() function to remove pathname and
# valid package extensions.
@@ -67,12 +70,12 @@ pkgbase() {
echo $PKGRETURN
}
-SOURCE_DIR=/var/log/mount
+SOURCE_DIR=/var/lib/pkgtools/mount
ASK="tagfiles"
if [ -L /bin/chmod -a -L /bin/chown ]; then # probably on the bootdisk using busybox
TARGET_DIR=/mnt
rootdevice="$(mount | grep ' on /mnt ' | tail -n 1 | cut -f 1 -d ' ' 2> /dev/null)"
- TMP=/mnt/var/log/setup/tmp
+ TMP=/mnt/var/lib/pkgtools/setup/tmp
if ! mount | grep ' on /mnt ' 1> /dev/null 2> /dev/null ; then
echo
echo
@@ -94,13 +97,13 @@ if [ -L /bin/chmod -a -L /bin/chown ]; then # probably on the bootdisk using bus
else
TARGET_DIR=/
rootdevice="$(mount | grep ' on / ' | tail -n 1 | cut -f 1 -d ' ')"
- TMP=/var/log/setup/tmp
+ TMP=/var/lib/pkgtools/setup/tmp
fi
if [ ! -d $TMP ]; then
mkdir -p $TMP
chmod 700 $TMP
fi
-ADM_DIR=$TARGET_DIR/var/log
+ADM_DIR=$TARGET_DIR/var/lib/pkgtools
LOG=$TMP/PKGTOOL.REMOVED
# remove whitespace
@@ -200,7 +203,7 @@ if [ $# -gt 0 ]; then # there are arguments to the command
SOURCE_DIR=$2 ; shift 2 ;;
-target_dir | --target_dir)
TARGET_DIR=$2
- ADM_DIR=$TARGET_DIR/var/log
+ ADM_DIR=$TARGET_DIR/var/lib/pkgtools
shift 2 ;;
-source_device | --source_device)
SOURCE_DEVICE=$2 ; shift 2 ;;
diff --git a/source/a/pkgtools/scripts/removepkg b/source/a/pkgtools/scripts/removepkg
index 6312353a..b033eebf 100644
--- a/source/a/pkgtools/scripts/removepkg
+++ b/source/a/pkgtools/scripts/removepkg
@@ -3,7 +3,7 @@
#
# Copyright 1994, 1995, 1998 Patrick Volkerding, Moorhead, Minnesota USA
# Copyright 2001, Slackware Linux, Inc., Concord, CA USA
-# Copyright 2009, 2015, 2016 Patrick J. Volkerding, Sebeka, MN, USA
+# Copyright 2009, 2015, 2016, 2018 Patrick J. Volkerding, Sebeka, MN, USA
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
@@ -24,6 +24,11 @@
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
+# Tue Jun 5 20:04:45 UTC 2018
+# Use /var/lib/pkgtools for the package database, not /var/log.
+# Logs of the removed packages and scripts will remain in /var/log, but moved
+# into /var/log/pkgtools.
+#
# Sun May 27 18:02:23 UTC 2018
# Added --terse mode to print one line per removed package.
#
@@ -133,14 +138,19 @@ pkgbase() {
# This makes "sort" run much faster:
export LC_ALL=C
+# Set the prefix for the package database directories (packages, scripts).
+ADM_DIR="$ROOT/var/lib/pkgtools"
+
+# Set the prefix for the removed packages/scripts log files:
+LOG_DIR="$ROOT/var/log/pkgtools"
+
# Make sure there's a proper temp directory:
-TMP=$ROOT/var/log/setup/tmp
+TMP=$ADM_DIR/setup/tmp
# If the $TMP directory doesn't exist, create it:
if [ ! -d $TMP ]; then
mkdir -p $TMP
chmod 700 $TMP # no need to leave it open
fi
-ADM_DIR=$ROOT/var/log
PRES_DIR=$TMP/preserved_packages
# Lock directory for ldconfig... share it with installpkg so that upgradepkg
@@ -366,10 +376,19 @@ remove_packages() {
fi
fi
if [ ! "$WARN" = "true" ]; then
- mkdir -p $ADM_DIR/removed_packages $ADM_DIR/removed_scripts
- mv $ADM_DIR/packages/$PKGNAME $ADM_DIR/removed_packages
+ # We won't assume that anything in /var/log can be trusted to remain there,
+ # so we'll remake the directories and symlinks first:
+ mkdir -p $LOG_DIR/removed_packages $LOG_DIR/removed_scripts
+ for symlink in removed_packages removed_scripts ; do
+ if [ ! -L $LOG_DIR/../$symlink ]; then
+ rm -rf $LOG_DIR/../$symlink
+ ( cd $LOG_DIR/.. ; ln -sf pkgtools/$symlink . )
+ fi
+ done
+ # Now that we know we have log directories, move the files:
+ mv $ADM_DIR/packages/$PKGNAME $LOG_DIR/removed_packages
if [ -r $ADM_DIR/scripts/$PKGNAME ]; then
- mv $ADM_DIR/scripts/$PKGNAME $ADM_DIR/removed_scripts
+ mv $ADM_DIR/scripts/$PKGNAME $LOG_DIR/removed_scripts
fi
fi
else
diff --git a/source/a/pkgtools/scripts/setup.80.make-bootdisk b/source/a/pkgtools/scripts/setup.80.make-bootdisk
index c1753bc5..0ed8b9a1 100644
--- a/source/a/pkgtools/scripts/setup.80.make-bootdisk
+++ b/source/a/pkgtools/scripts/setup.80.make-bootdisk
@@ -5,7 +5,7 @@ if [ -r /usr/lib/setup/setup ]; then
else
RDIR=/dev/null
fi
-TMP=/var/log/setup/tmp
+TMP=/var/lib/pkgtools/setup/tmp
if [ ! -d $TMP ]; then
mkdir -p $TMP
diff --git a/source/a/pkgtools/scripts/setup.services b/source/a/pkgtools/scripts/setup.services
index 47b4cef7..2e83cb93 100644
--- a/source/a/pkgtools/scripts/setup.services
+++ b/source/a/pkgtools/scripts/setup.services
@@ -1,6 +1,6 @@
#!/bin/sh
#BLURB="Select/deselect system daemons (services)"
-TMP=/var/log/setup/tmp
+TMP=/var/lib/pkgtools/setup/tmp
if [ ! -d $TMP ]; then
mkdir -p $TMP
fi
diff --git a/source/a/pkgtools/scripts/upgradepkg b/source/a/pkgtools/scripts/upgradepkg
index 3ee3c658..f53d21d9 100644
--- a/source/a/pkgtools/scripts/upgradepkg
+++ b/source/a/pkgtools/scripts/upgradepkg
@@ -22,6 +22,9 @@
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
+# Mon Jun 4 21:17:58 UTC 2018
+# Use /var/lib/pkgtools, not /var/log.
+#
# Thu May 24 20:23:55 UTC 2018
# Added --terselength option to set the line length in --terse mode.
# Use a lockfile to prevent output collisions in --terse mode.
@@ -83,8 +86,11 @@ For more details see upgradepkg(8).
EOF
}
+# Set the prefix for the package database directories (packages, scripts).
+ADM_DIR="$ROOT/var/lib/pkgtools"
+
# Make sure there's a proper temp directory:
-TMP=$ROOT/var/log/setup/tmp
+TMP=$ADM_DIR/setup/tmp
# If the $TMP directory doesn't exist, create it:
if [ ! -d $TMP ]; then
mkdir -p $TMP
@@ -204,7 +210,7 @@ for ARG; do
# Simple package integrity check:
if ! [ -f "$NEW" ]; then
ERRCODE=4
- echo "Cannot install $NEW: file not found"
+ echo "Cannot install $NEW: file not found"
continue;
fi
@@ -226,9 +232,9 @@ for ARG; do
# Check and fix the old package name:
SHORT="$(package_name $OLD)"
- if [ ! -r $ROOT/var/log/packages/$OLD ]; then
- if ls $ROOT/var/log/packages/$SHORT* 1> /dev/null 2> /dev/null ; then
- for installed_package in $ROOT/var/log/packages/$SHORT* ; do
+ if [ ! -r $ADM_DIR/packages/$OLD ]; then
+ if ls $ADM_DIR/packages/$SHORT* 1> /dev/null 2> /dev/null ; then
+ for installed_package in $ADM_DIR/packages/$SHORT* ; do
if [ "$(package_name $installed_package)" = "$SHORT" ]; then # found one
OLD="${installed_package##*/}"
break
@@ -240,14 +246,14 @@ for ARG; do
# Test to see if both the old and new packages are where we expect them
# to be - skip to the next package (or package pair) if anything's wrong:
- if [ ! -r $ROOT/var/log/packages/$OLD ]; then
+ if [ ! -r $ADM_DIR/packages/$OLD ]; then
if [ ! "$INSTALL_NEW" = "yes" ]; then
if [ "$DRY_RUN" = "true" ]; then
echo "$OLD would not be upgraded (no installed package named $SHORT)."
else
! [ $TERSE ] && echo
echo "Error: there is no installed package named $OLD."
- ! [ $TERSE ] && echo " (looking for $ROOT/var/log/packages/$OLD)"
+ ! [ $TERSE ] && echo " (looking for $ADM_DIR/packages/$OLD)"
! [ $TERSE ] && echo
fi
ERRCODE=1
@@ -317,7 +323,7 @@ EOF
SHORT="$(package_name $OLD)"
if [ "$DRY_RUN" = "true" ]; then
echo -n "$NEW would upgrade: "
- for installed_package in $ROOT/var/log/packages/$SHORT* ; do
+ for installed_package in $ADM_DIR/packages/$SHORT* ; do
if [ "$(package_name $installed_package)" = "$SHORT" ]; then
echo -n "$(pkgbase $installed_package)"
fi
@@ -325,12 +331,12 @@ EOF
echo
continue
fi
- for installed_package in $ROOT/var/log/packages/$SHORT* ; do
+ for installed_package in $ADM_DIR/packages/$SHORT* ; do
if [ "$(package_name $installed_package)" = "$SHORT" ]; then
mv $installed_package ${installed_package}-upgraded-$TIMESTAMP
fi
done
- for installed_script in $ROOT/var/log/scripts/$SHORT* ; do
+ for installed_script in $ADM_DIR/scripts/$SHORT* ; do
if [ "$(package_name $installed_script)" = "$SHORT" ]; then
if [ -r $installed_script ]; then
mv $installed_script ${installed_script}-upgraded-$TIMESTAMP
@@ -385,7 +391,7 @@ EOF
fi
# Now, the leftovers from the old package(s) can go. Pretty simple, huh? :)
( flock 9 || exit 11
- for rempkg in "$ROOT/var/log/packages/"*"-$TIMESTAMP"; do
+ for rempkg in "$ADM_DIR/packages/"*"-$TIMESTAMP"; do
if [ "$VERBOSE" = "verbose" ]; then
/sbin/removepkg "${rempkg##*/}"
elif ! [ $TERSE ]; then
diff --git a/source/a/sysvinit/CHANGES b/source/a/sysvinit/CHANGES
deleted file mode 100644
index a4c1f96b..00000000
--- a/source/a/sysvinit/CHANGES
+++ /dev/null
@@ -1 +0,0 @@
-Removed pidof symlink.
diff --git a/source/a/sysvinit/slack-desc b/source/a/sysvinit/slack-desc
index 79d6b54a..0d585bf7 100644
--- a/source/a/sysvinit/slack-desc
+++ b/source/a/sysvinit/slack-desc
@@ -15,5 +15,5 @@ sysvinit: For example, the normal system runlevel is 3, which starts agetty
sysvinit: on virtual consoles tty1 - tty6. Runlevel 4 starts xdm.
sysvinit: Runlevel 0 shuts the system down.
sysvinit:
-sysvinit:
+sysvinit: Homepage: http://www.nongnu.org/sysvinit/
sysvinit:
diff --git a/source/a/sysvinit/sysvinit.SlackBuild b/source/a/sysvinit/sysvinit.SlackBuild
index 8f31223f..b74de22a 100755
--- a/source/a/sysvinit/sysvinit.SlackBuild
+++ b/source/a/sysvinit/sysvinit.SlackBuild
@@ -23,8 +23,8 @@
cd $(dirname $0) ; CWD=$(pwd)
PKGNAM=sysvinit
-VERSION=${VERSION:-2.88dsf}
-BUILD=${BUILD:-5}
+VERSION=${VERSION:-2.90}
+BUILD=${BUILD:-1}
# Automatically determine the architecture we're building on:
if [ -z "$ARCH" ]; then
@@ -54,20 +54,28 @@ cd $TMP
rm -rf sysvinit-$VERSION
tar xvf $CWD/sysvinit-$VERSION.tar.xz || exit 1
cd sysvinit-$VERSION
+
chown -R root:root .
+find . \
+ \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
+ -exec chmod 755 {} \; -o \
+ \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
+ -exec chmod 644 {} \;
# Fix paths for /etc/forcefsck and /etc/fastboot:
zcat $CWD/sysvinit.paths.diff.gz | patch -p1 -E --verbose --backup --suffix=.orig || exit 1
-cd doc
+# Use /dev/initctl instead of /run/initctl ; this is a named pipe and probably
+# should be in /dev anyway, but more importantly, having the upgraded package
+# expect it in /run breaks shutdown/reboot without manual intervention
+zcat $CWD/sysvinit.use_dev_initctl_not_run_initctl.diff.gz | patch -p1 --verbose || exit 1
+
mkdir -p $PKG/usr/doc/sysvinit-$VERSION
-cp -a Install Propaganda sysvinit-2.86.lsm \
- ../COPYING* ../COPYRIGHT ../README* \
+cp -a COPYING* COPYRIGHT* README* \
+ doc/* \
$PKG/usr/doc/sysvinit-$VERSION
-chmod -R 644 $PKG/usr/doc/sysvinit-$VERSION/*
-chmod 755 $PKG/usr/doc/sysvinit-$VERSION
-cd ../src
+cd src
make clobber || exit 1
make || exit 1
@@ -90,14 +98,6 @@ mv $PKG/sbin/init $PKG/sbin/init.new
chmod 755 $PKG/sbin/init.new
chown root:root $PKG/sbin/init.new
-# This version is old. We use genpower now.
-#cat wall > $PKG/usr/bin/wall
-#strip --strip-unneeded powerd
-#cat powerd > $PKG/sbin/powerd
-#chmod 755 $PKG/usr/bin/wall $PKG/sbin/powerd
-#chown root:root $PKG/usr/bin/wall $PKG/sbin/powerd
-cp initscript.sample $PKG/sbin/initscript.sample
-
cd ../man
mkdir -p $PKG/usr/man/man{1,5,8}
for page in last.1 ; do
diff --git a/source/a/sysvinit/sysvinit.use_dev_initctl_not_run_initctl.diff b/source/a/sysvinit/sysvinit.use_dev_initctl_not_run_initctl.diff
new file mode 100644
index 00000000..0a0f23ed
--- /dev/null
+++ b/source/a/sysvinit/sysvinit.use_dev_initctl_not_run_initctl.diff
@@ -0,0 +1,267 @@
+diff -Nur sysvinit-2.90.orig/doc/Install sysvinit-2.90/doc/Install
+--- sysvinit-2.90.orig/doc/Install 2018-06-18 18:25:26.000000000 -0500
++++ sysvinit-2.90/doc/Install 2018-06-19 19:25:46.523082855 -0500
+@@ -66,7 +66,7 @@
+ manual page on shutdown to find out more about this.
+
+ Running from a read-only file system (CDROM?):
+-* All communication to init goes through the FIFO /run/initctl.
++* All communication to init goes through the FIFO /dev/initctl.
+ There should be no problem using a read-only root file system
+ If you use a Linux kernel > 1.3.66. Older kernels don't allow
+ writing to a FIFO on a read-only file system.
+diff -Nur sysvinit-2.90.orig/doc/initctl sysvinit-2.90/doc/initctl
+--- sysvinit-2.90.orig/doc/initctl 2018-06-18 18:25:26.000000000 -0500
++++ sysvinit-2.90/doc/initctl 2018-06-19 19:26:00.277206540 -0500
+@@ -1,5 +1,5 @@
+ This document describes the communiction pipe set up by SysV init
+-at /run/initctl. This named pipe allows programs with the proper
++at /dev/initctl. This named pipe allows programs with the proper
+ permissions (typically programs run by root have read+write access to
+ the pipe) to send signals to the init program (PID 1).
+
+@@ -58,13 +58,13 @@
+ might need to process our request. For example, when setting environment
+ variables.
+
+-When setting an environment variable through init's /run/initctl pipe,
++When setting an environment variable through init's /dev/initctl pipe,
+ the data variable should have the format VARIABLE=VALUE. The string
+ should be terminated with a NULL '\0' character.
+
+
+ The following C code example shows how to send a set environment variable
+-request to the init process using the /run/initctl pipe. This example
++request to the init process using the /dev/initctl pipe. This example
+ is simplified and skips the error checking. A more comlpete example can be
+ found in the shutdown.c program's init_setnv() function.
+
+@@ -86,7 +86,7 @@
+
+
+
+-Usually the /run/initctl pipe would only be used by low-level programs to
++Usually the /dev/initctl pipe would only be used by low-level programs to
+ request a power-related shutdown or change the runlevel, like telinit
+ would do. Most of the time there is no need to talk to init directly, but
+ this gives us an extenable approach so init can be taught how to learn
+diff -Nur sysvinit-2.90.orig/man/init.8 sysvinit-2.90/man/init.8
+--- sysvinit-2.90.orig/man/init.8 2018-06-18 18:25:26.000000000 -0500
++++ sysvinit-2.90/man/init.8 2018-06-19 19:26:15.470343168 -0500
+@@ -144,7 +144,7 @@
+ the letter \fBF\fP.
+ .PP
+ Usage of \fBSIGPWR\fP and \fB/etc/powerstatus\fP is discouraged. Someone
+-wanting to interact with \fBinit\fP should use the \fB/run/initctl\fP
++wanting to interact with \fBinit\fP should use the \fB/dev/initctl\fP
+ control channel - see the initctl manual page for more documentation
+ about this.
+ .PP
+@@ -248,7 +248,7 @@
+ the current runlevel.
+ .PP
+ .SH INTERFACE
+-Init listens on a \fIfifo\fP in /dev, \fI/run/initctl\fP, for messages.
++Init listens on a \fIfifo\fP in /dev, \fI/dev/initctl\fP, for messages.
+ \fBTelinit\fP uses this to communicate with init. The interface is not
+ very well documented or finished. Those interested should study the
+ \fIinitreq.h\fP file in the \fIsrc/\fP subdirectory of the \fBinit\fP
+@@ -262,11 +262,11 @@
+ .TP 0.5i
+ .B SIGUSR1
+ On receipt of this signals, init closes and re-opens its control fifo,
+-\fB/run/initctl\fP. Useful for bootscripts when /dev is remounted.
++\fB/dev/initctl\fP. Useful for bootscripts when /dev is remounted.
+ .TP 0.5i
+ .B SIGUSR2
+ When init receives SIGUSR2, init closes and leaves the control fifo,
+-\fB/run/initctl\f\P, closed. This may be used to make sure init is not
++\fB/dev/initctl\f\P, closed. This may be used to make sure init is not
+ holding open any files. However, it also prevents init from switching
+ runlevels. Which means commands like shutdown no longer work.
+ The fifo can be re-opened by sending init the SIGUSR1 signal.
+@@ -294,7 +294,7 @@
+ /dev/console
+ /var/run/utmp
+ /var/log/wtmp
+-/run/initctl
++/dev/initctl
+ .fi
+ .\"}}}
+ .\"{{{ Warnings
+diff -Nur sysvinit-2.90.orig/man/initctl.5 sysvinit-2.90/man/initctl.5
+--- sysvinit-2.90.orig/man/initctl.5 2018-06-18 18:25:26.000000000 -0500
++++ sysvinit-2.90/man/initctl.5 2018-06-19 19:26:43.481595070 -0500
+@@ -16,13 +16,13 @@
+ .\"
+ .TH INITCTL 5 "April 13, 2018" "" "Linux System Administrator's Manual"
+ .SH NAME
+-initctl \- /run/initctl is a named pipe which passes commands to SysV init.
++initctl \- /dev/initctl is a named pipe which passes commands to SysV init.
+ .SH SYNOPSIS
+-/run/initctl
++/dev/initctl
+ .SH DESCRIPTION
+
+ This document describes the communiction pipe set up by SysV init
+-at /run/initctl. This named pipe allows programs with the proper
++at /dev/initctl. This named pipe allows programs with the proper
+ permissions (typically programs run by root have read+write access to
+ the pipe) to send signals to the init program (PID 1).
+
+@@ -86,14 +86,14 @@
+ might need to process our request. For example, when setting environment
+ variables.
+
+-When setting an environment variable through init's /run/initctl pipe,
++When setting an environment variable through init's /dev/initctl pipe,
+ the data variable should have the format VARIABLE=VALUE. The string
+ should be terminated with a NULL character.
+
+ .SH EXAMPLES
+
+ The following C code example shows how to send a set environment variable
+-request to the init process using the /run/initctl pipe. This example
++request to the init process using the /dev/initctl pipe. This example
+ is simplified and skips the error checking. A more comlpete example can be
+ found in the shutdown.c program's init_setnv() function.
+
+@@ -118,18 +118,18 @@
+ .sp
+ .RE
+ .SH NOTES
+-Usually the /run/initctl pipe would only be used by low-level programs to
++Usually the /dev/initctl pipe would only be used by low-level programs to
+ request a power-related shutdown or change the runlevel, like telinit
+ would do. Most of the time there is no need to talk to init directly, but
+ this gives us an extenable approach so init can be taught how to learn
+ more commands.
+ .PP
+-The commands passed through the /run/initctl pipe must be sent in a specific
++The commands passed through the /dev/initctl pipe must be sent in a specific
+ binary format and be of a specific length. Larger data structures or ones
+ not using the proper format will be ignored. Typically, only root has the
+ ability to write to the initctl pipe for security reasons.
+ .PP
+-The /run/initctl pipe can be closed by sending init (PID 1) the SIGUSR2
++The /dev/initctl pipe can be closed by sending init (PID 1) the SIGUSR2
+ signal. This closes the pipe and leaves it closed. This may be useful
+ for making sure init is not keeping any files open. However, when the
+ pipe is closed, init no longer receives signals, such as those sent by
+@@ -137,12 +137,12 @@
+ change its runlevel directly. The pipe may be re-opened by sending init (PID 1)
+ the SIGUSR1 signal.
+ .PP
+-If the /run/initctl pipe is closed then it may still be possible to bring
++If the /dev/initctl pipe is closed then it may still be possible to bring
+ down the system using the shutdown command's -n flag, but this is not
+ always clean and not recommended.
+ .RE
+ .SH FILES
+-/run/initctl
++/dev/initctl
+ /sbin/init
+ .SH AUTHOR
+ Jesse Smith <jsmith@resonatingmedia.com>
+diff -Nur sysvinit-2.90.orig/src/Makefile sysvinit-2.90/src/Makefile
+--- sysvinit-2.90.orig/src/Makefile 2018-06-18 18:25:26.000000000 -0500
++++ sysvinit-2.90/src/Makefile 2018-06-19 19:27:26.501981961 -0500
+@@ -217,8 +217,8 @@
+ #
+ # This part is skipped on Debian systems, the
+ # debian.preinst script takes care of it.
+- @if [ ! -p /run/initctl ]; then \
+- echo "Creating /run/initctl"; \
+- rm -f /run/initctl; \
+- mknod -m 600 /run/initctl p; fi
++ @if [ ! -p /dev/initctl ]; then \
++ echo "Creating /dev/initctl"; \
++ rm -f /dev/initctl; \
++ mknod -m 600 /dev/initctl p; fi
+ endif
+diff -Nur sysvinit-2.90.orig/src/init.c sysvinit-2.90/src/init.c
+--- sysvinit-2.90.orig/src/init.c 2018-06-18 18:25:26.000000000 -0500
++++ sysvinit-2.90/src/init.c 2018-06-19 19:27:08.688821762 -0500
+@@ -131,7 +131,7 @@
+ int maxproclen; /* Maximal length of argv[0] with \0 */
+ struct utmp utproto; /* Only used for sizeof(utproto.ut_id) */
+ char *console_dev; /* Console device. */
+-int pipe_fd = -1; /* /run/initctl */
++int pipe_fd = -1; /* /dev/initctl */
+ int did_boot = 0; /* Did we already do BOOT* stuff? */
+ int main(int, char **);
+
+@@ -2354,13 +2354,13 @@
+ int quit = 0;
+
+ /*
+- * First, try to create /run/initctl if not present.
++ * First, try to create /dev/initctl if not present.
+ */
+ if (stat(INIT_FIFO, &st2) < 0 && errno == ENOENT)
+ (void)mkfifo(INIT_FIFO, 0600);
+
+ /*
+- * If /run/initctl is open, stat the file to see if it
++ * If /dev/initctl is open, stat the file to see if it
+ * is still the _same_ inode.
+ */
+ if (pipe_fd >= 0) {
+@@ -2374,7 +2374,7 @@
+ }
+
+ /*
+- * Now finally try to open /run/initctl if pipe_fd is -1
++ * Now finally try to open /dev/initctl if pipe_fd is -1
+ * if it is -2, then we leave it closed
+ */
+ if (pipe_fd == -1) {
+@@ -2681,7 +2681,7 @@
+ }
+ if (ISMEMBER(got_signals, SIGUSR1)) {
+ /*
+- * SIGUSR1 means close and reopen /run/initctl
++ * SIGUSR1 means close and reopen /dev/initctl
+ */
+ INITDBG(L_VB, "got SIGUSR1");
+ if (pipe_fd)
+@@ -2929,7 +2929,7 @@
+ strerror(errno));
+
+ /* Open the fifo and write a command. */
+- /* Make sure we don't hang on opening /run/initctl */
++ /* Make sure we don't hang on opening /dev/initctl */
+ SETSIG(sa, SIGALRM, signal_handler, 0);
+ alarm(3);
+ if ((fd = open(INIT_FIFO, O_WRONLY)) >= 0) {
+diff -Nur sysvinit-2.90.orig/src/initreq.h sysvinit-2.90/src/initreq.h
+--- sysvinit-2.90.orig/src/initreq.h 2018-06-18 18:25:26.000000000 -0500
++++ sysvinit-2.90/src/initreq.h 2018-06-19 19:26:51.388666180 -0500
+@@ -1,5 +1,5 @@
+ /*
+- * initreq.h Interface to talk to init through /run/initctl.
++ * initreq.h Interface to talk to init through /dev/initctl.
+ *
+ * Copyright (C) 1995-2004 Miquel van Smoorenburg
+ *
+@@ -26,7 +26,7 @@
+ #include <sys/param.h>
+
+ #ifndef INIT_FIFO
+-#define INIT_FIFO "/run/initctl"
++#define INIT_FIFO "/dev/initctl"
+ #endif
+
+ #define INIT_MAGIC 0x03091969
+diff -Nur sysvinit-2.90.orig/src/shutdown.c sysvinit-2.90/src/shutdown.c
+--- sysvinit-2.90.orig/src/shutdown.c 2018-06-18 18:25:26.000000000 -0500
++++ sysvinit-2.90/src/shutdown.c 2018-06-19 19:27:13.214862465 -0500
+@@ -176,7 +176,7 @@
+
+ /*
+ * Open the fifo and write the command.
+- * Make sure we don't hang on opening /run/initctl
++ * Make sure we don't hang on opening /dev/initctl
+ */
+ memset(&sa, 0, sizeof(sa));
+ sa.sa_handler = alrm_handler;