In my testing of 11.0 I have run into issues with hotplug that I never experienced before with Slackware. I think I have discovered the cause of my problems and I think the problem is a bug in the
rc.S script. I would appreciate some of you more knowledgeable Slackers responding.
Background: I always have run the 2.4 kernel and never have tried or tested the 2.6 kernel. I use old hardware and although I have two 1.1 USB ports on my boxes, I do not use any USB devices. Even my mice and keyboard are PS2 or AT. Thus, I never had any need for hotplug and I always have disabled the
rc.hotplug script (not executable). I experienced no issues or problems with this configuration until updating to 11.0. Since then
dhcpcd has
driven me nuts. I discovered that the only way to stop the nonsense was to pass the
nohotplug parameter to the kernel at boot-up. This work-around sufficed but bothered me. What changed from 10.2 to 11.0?
I believe the problem is the
rc.S script. Many of you are running 2.6 kernels and as written the script's hotplug test will not affect you. Similarly, of the remaining Slackers running 2.4, I suspect many have
rc.hotplug enabled (executable). And again, the new 11.0
rc.S script will not affect you. I imagine only a few Slackers are like me who simply do not run hotplug and never have. Therefore I think this new bug passed unnoticed by just about everybody. But us folks running 2.4 who previously always ignored hotplug experience the 11.0
rc.S differently.
Unlike the 10.2 script, the 11.0
rc.S script uses a kernel version test in deciding whether to run hotplug. In 10.2, if
rc.hotplug was not executable then that was the final test and the
rc.S script disabled hotplug. But in the 11.0
rc.S, the script now additionally checks the kernel version before deciding what to do with a non-executable
rc.hotplug. Based upon the comments embedded within the hotplug section of the 11.0
rc.S script, I believe the intent is that with 2.4 kernels, hotplug should be disabled if
rc.hotplug is not executable but the executable status of
rc.hotplug should be ignored with 2.6 kernels. Yet the script test does not honor the executable status of
rc.hotplug with 2.4 kernels because of a single
! negation parameter.
The stock 11.0
rc.S hotplug test looks this:
Code:
if [ -w /proc/sys/kernel/hotplug ]; then
# Kernel command line option 'nohotplug' given, so we will shut off
# hotplugging even if it is not a good idea. Sometimes it *is* a
# good idea, especially when you're trying to figure out which
# kernel module is crashing the machine and needs to be added to
# your /etc/modprobe.d/blacklist (2.6+ kernels) and/or your
# /etc/hotplug/blacklist (2.4.x kernels).
if grep -wq nohotplug /proc/cmdline ; then
echo "/dev/null" > /proc/sys/kernel/hotplug
elif [ ! -x /etc/rc.d/rc.hotplug ]; then
# Ignore /etc/rc.d/rc.hotplug on kernels newer than 2.4.x:
if [ ! "$(uname -r | cut -f 1,2 -d .)" = "2.4" ]; then
# We must be running a 2.4.x kernel, so turn off hotplug:
echo "/dev/null" > /proc/sys/kernel/hotplug
fi
fi
fi
That
uname -r test with the
! negation is the problem. The
! negation should not be there. By removing that negation parameter the script now runs correctly on my box and honors the executable condition of my
rc.hotplug.
With this modification I also no longer have to pass the
nohotplug parameter to the kernel at boot-up and
dhcpcd now behaves itself.
Comments please and should PV be notified?
P.S. I'm not interested in discussions about the philosophy of hotplug, etc. I just want to fix this awful problem with hotplug and dhcpcd, which I believe is caused by the
rc.S script. Thanks.