# hotplug 2004_09_23
# ==================
# Slackware 9.0's 'hotplug' package includes version 2002_08_26 and there's
# also a patched version in 'patches'. 9.1's includes 2003_08_05 and
# version 2004_01_05 is in 'patches'. 10.0's includes 2004_01_05, 10.1 and
# 10.2's include 2004_09_23.
# Prerequisites:
# modutils (for 2.2.x/2.4.x kernels) or module-init-tools
# (for 2.5.x/2.6.x kernels)
# a Linux kernel with CONFIG_HOTPLUG enabled
cd
test -f installed/hotplug-2004_09_23.tar.bz2 &&
mv installed/hotplug-2004_09_23.tar.bz2 .
test ! -f hotplug-2004_09_23.tar.bz2 &&
wget http://ftp.kernel.org/pub/linux/utils/kernel/hotplug/\
hotplug-2004_09_23.tar.bz2
# Verify tarball w/ md5sum:
# (this came from my gpg-verified tarball)
echo "58e6995f9df71ce59b0ec2787019e5fe hotplug-2004_09_23.tar.bz2" | \
md5sum -c
# Verify tarball w/ sha1sum:
# (this also came from my gpg-verified tarball)
echo "2dd1be1337765600c66e48e5726a30a197a4f483 hotplug-2004_09_23.tar.\
bz2" | sha1sum -c
mkdir -p -m 0700 src
cd src
find -maxdepth 1 -type d -name "hotplug-*" -exec rm -r {} \;
tar xjvf ~/hotplug-2004_09_23.tar.bz2
cd hotplug-2004_09_23
test $UID = 0 && chown -R root:root .
# Patch it to:
# 1) Fix /etc/hotplug/net.agent to use Slackware's /etc/rc.d/rc.inet1
# 2) Quiet an error in /etc/hotplug/input.rc that will give an error if
# /proc/bus/input/devices doesn't exist, which it won't if you're running
# a kernel other than 2.6.x
# 3) Log to syslog when hotplug starts and stops, but unlike the Slack
# patch, don't make sure that logger and /var/run/syslogd.pid exist
# because I use syslog-ng. Rather than check for the pid of syslog,
# syslog-ng, and other variants, we'll just assume that everyone is
# running some sort of syslog and just check to make sure that
# /usr/bin/logger is executable.
# 4) Quiet some of the logging and messages to the console
# 5) Change a few files to use/refer-to /etc/rc.d/rc.hotplug instead of the
# default /etc/init.d/hotplug
wget -nc http://englanders.cc/pub/linux/patches/hotplug-2004_09_23.patch &&
patch -p1 < hotplug-2004_09_23.patch
# Become root to install it
su
# Back up existing hotplug files (not including firmware, man pages, docs),
# if there are any:
test -d /etc/hotplug &&
( mkdir -p -m 0700 ~/backup
cd /
tar cjvf ~/backup/hotplug-`date +%Y%m%d`.tar.bz2 /etc/rc.d/rc.hotplug \
/etc/hotplug /etc/hotplug.d )
test -x /sbin/removepkg && /sbin/removepkg hotplug
make install
test -f /etc/hotplug/pnp.distmap || touch /etc/hotplug/pnp.distmap
# If you want to collect ascii event logs for events that aren't handled
# by some /etc/hotplug/*.agent:
touch /var/log/hotplug/events
# To prevent hotplug from loading a module, add it to /etc/hotplug/blacklist
# Slackware's hotplug package (and older versions of hotplug) use
# /usr/lib/hotplug/firmware, move what's in there to /lib/firmware:
test ! -d /lib/firmware && mkdir -p /lib/firmware
test -d /usr/lib/hotplug/firmware &&
( mv -f /usr/lib/hotplug/firmware/* /lib/firmware/
rm -r /usr/lib/hotplug )