[arch-projects] [initscripts] minor cleanups and fixes
Hi guys, I'm planning to push the following patches, and thought I'd ask for some acks before going ahead. Most are just minor fixes. The patches marked "workaround" are removing workarounds that have been in initscripts for a long time. I think we should either remove them or annotate them with the relevant upstream bugreport, so we can track what is happening and don't end up keeping these things forever. The last patch (which creates directories in /dev that otherwise would be created by udev) is, besides the justification given in the commit message, usefull if we ever want to support bootlogd (I think we do!), as it would have to be started before udev is running. Please shout if you have any objections! Cheers, Tom
This trivial patch moves the start of the LOCALE status message to before the first command. This should not make a difference, as all the commands should be instantaneos, but might be helpful in case of a bug. Signed-off-by: Tom Gundersen <teg@jklm.no> --- rc.sysinit | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/rc.sysinit b/rc.sysinit index 9d7c250..8fa5b30 100755 --- a/rc.sysinit +++ b/rc.sysinit @@ -341,12 +341,12 @@ fi status "Updating Module Dependencies" /sbin/depmod -A +[[ $LOCALE ]] || LOCALE="en_US" +stat_busy "Setting Locale: $LOCALE" # Flush old locale settings : >| /etc/profile.d/locale.sh /bin/chmod 755 /etc/profile.d/locale.sh # Set user defined locale -[[ $LOCALE ]] || LOCALE="en_US" -stat_busy "Setting Locale: $LOCALE" echo "export LANG=$LOCALE" >>/etc/profile.d/locale.sh stat_done -- 1.7.4.2
This trivial patch moves the start of the LOCALE status message to before the first command. This should not make a difference, as all the commands should be instantaneos, but might be helpful in case of a bug.
Signed-off-by: Tom Gundersen <teg@jklm.no> --- rc.sysinit | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/rc.sysinit b/rc.sysinit index 9d7c250..8fa5b30 100755 --- a/rc.sysinit +++ b/rc.sysinit @@ -341,12 +341,12 @@ fi
status "Updating Module Dependencies" /sbin/depmod -A
+[[ $LOCALE ]] || LOCALE="en_US" +stat_busy "Setting Locale: $LOCALE"
On Wed, Mar 30, 2011 at 8:01 PM, Tom Gundersen <teg@jklm.no> wrote: this can be done more elegantly in one line stat_busy "Setting Locale: ${LOCALE:=en_US}"
# Flush old locale settings : >| /etc/profile.d/locale.sh /bin/chmod 755 /etc/profile.d/locale.sh # Set user defined locale -[[ $LOCALE ]] || LOCALE="en_US" -stat_busy "Setting Locale: $LOCALE" echo "export LANG=$LOCALE" >>/etc/profile.d/locale.sh stat_done
-- 1.7.4.2
-- Sébastien Luttringer www.seblu.net
This revert commit 258935d3ee996b0790f39551e6b56596db71c9a8. This follows upstream commit baf2b4 where the systemd unit udev-retry.service is removed, and upstream commit 864fde where the --failed logic is deprecated alltogether. Signed-off-by: Tom Gundersen <teg@jklm.no> --- rc.sysinit | 2 -- 1 files changed, 0 insertions(+), 2 deletions(-) diff --git a/rc.sysinit b/rc.sysinit index 8fa5b30..cd24c46 100755 --- a/rc.sysinit +++ b/rc.sysinit @@ -300,8 +300,6 @@ if [[ $USELVM =~ yes|YES && -x /sbin/lvm && -d /sys/block ]]; then fi fi -status "Retrying failed UDev events" /sbin/udevadm trigger --action=add --type=failed - status "Activating Swap" /sbin/swapon -a if [[ $TIMEZONE && -e /usr/share/zoneinfo/$TIMEZONE ]]; then -- 1.7.4.2
On Wed, Mar 30, 2011 at 8:01 PM, Tom Gundersen <teg@jklm.no> wrote:
This revert commit 258935d3ee996b0790f39551e6b56596db71c9a8.
This follows upstream commit baf2b4 where the systemd unit udev-retry.service is removed, and upstream commit 864fde where the --failed logic is deprecated alltogether.
Signed-off-by: Tom Gundersen <teg@jklm.no> --- rc.sysinit | 2 -- 1 files changed, 0 insertions(+), 2 deletions(-)
diff --git a/rc.sysinit b/rc.sysinit index 8fa5b30..cd24c46 100755 --- a/rc.sysinit +++ b/rc.sysinit @@ -300,8 +300,6 @@ if [[ $USELVM =~ yes|YES && -x /sbin/lvm && -d /sys/block ]]; then fi fi
-status "Retrying failed UDev events" /sbin/udevadm trigger --action=add --type=failed - status "Activating Swap" /sbin/swapon -a
if [[ $TIMEZONE && -e /usr/share/zoneinfo/$TIMEZONE ]]; then
Good patch. It was in my queue :) -- Sébastien Luttringer www.seblu.net
/proc/sys/kerne/hotplug has been deprecated (moved to /sys/kernel/uevent_helper) since 2.6.16. This updates it. Note, this should not be necessary, as there is no reason this string should not already be empty. Signed-off-by: Tom Gundersen <teg@jklm.no> --- rc.sysinit | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diff --git a/rc.sysinit b/rc.sysinit index cd24c46..69fdab3 100755 --- a/rc.sysinit +++ b/rc.sysinit @@ -72,9 +72,8 @@ if [[ $HWCLOCK_PARAMS ]]; then fi fi -echo > /proc/sys/kernel/hotplug - stat_busy "Starting UDev Daemon" +echo "" > /sys/kernel/uevent_helper /sbin/udevd --daemon stat_done -- 1.7.4.2
On Wed, Mar 30, 2011 at 8:01 PM, Tom Gundersen <teg@jklm.no> wrote:
/proc/sys/kerne/hotplug has been deprecated (moved to /sys/kernel/uevent_helper) since 2.6.16.
This updates it. Note, this should not be necessary, as there is no reason this string should not already be empty.
No trace of uevent_helper in udev code. http://git.kernel.org/?p=linux%2Fhotplug%2Fudev.git&a=search&h=HEAD&st=grep&s=uevent_helper No trace of uevent_helper or hotplug in /lib/udev/rules.d/
From http://lwn.net/Articles/166954/ The hotplug helper /sbin/hotplug is now officially deprecated. The control file /proc/sys/kernel/hotplug has moved to /sys/kernel/uevent_helper, but it is expected to be disabled on most systems in favor of udev and the netlink interface.
So this is an old legagy. We should drop it.
Signed-off-by: Tom Gundersen <teg@jklm.no> --- rc.sysinit | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/rc.sysinit b/rc.sysinit index cd24c46..69fdab3 100755 --- a/rc.sysinit +++ b/rc.sysinit @@ -72,9 +72,8 @@ if [[ $HWCLOCK_PARAMS ]]; then fi fi
-echo > /proc/sys/kernel/hotplug - stat_busy "Starting UDev Daemon" +echo "" > /sys/kernel/uevent_helper /sbin/udevd --daemon stat_done
-- 1.7.4.2
-- Sébastien Luttringer www.seblu.net
In the future /etc/mtab should be a symlink to /proc/self/mounts, add support for this in rc.sysinit to be prepared. While strictly not needed, this makes it clear that the functionality can be removed once we move over to using symlinks. This functionality is expected with the next release of util-linux (2.20), but is already available in the current version if the experimental libmount support is enabled. Signed-off-by: Tom Gundersen <teg@jklm.no> --- rc.sysinit | 13 +++++++++---- 1 files changed, 9 insertions(+), 4 deletions(-) diff --git a/rc.sysinit b/rc.sysinit index 69fdab3..1601e7a 100755 --- a/rc.sysinit +++ b/rc.sysinit @@ -279,11 +279,16 @@ fi stat_busy "Mounting Local Filesystems" /bin/mount -n -o remount,rw / -if [ -x /bin/findmnt -a -e /proc/self/mountinfo ]; then - /bin/findmnt -rnu -o SOURCE,TARGET,FSTYPE,OPTIONS >| /etc/mtab -else - cat /proc/mounts >| /etc/mtab + +# don't touch /etc/mtab if it is a symlink to /proc/self/mounts +if [ ! -L /etc/mtab ]; then + if [ -x /bin/findmnt -a -e /proc/self/mountinfo ]; then + /bin/findmnt -rnu -o SOURCE,TARGET,FSTYPE,OPTIONS >| /etc/mtab + else + cat /proc/mounts >| /etc/mtab + fi fi + run_hook sysinit_premount # now mount all the local filesystems /bin/mount -a -t $NETFS -O no_netdev -- 1.7.4.2
On Wed, Mar 30, 2011 at 8:01 PM, Tom Gundersen <teg@jklm.no> wrote:
In the future /etc/mtab should be a symlink to /proc/self/mounts, add support for this in rc.sysinit to be prepared. While strictly not needed, this makes it clear that the functionality can be removed once we move over to using symlinks.
This functionality is expected with the next release of util-linux (2.20), but is already available in the current version if the experimental libmount support is enabled.
Signed-off-by: Tom Gundersen <teg@jklm.no> --- rc.sysinit | 13 +++++++++---- 1 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/rc.sysinit b/rc.sysinit index 69fdab3..1601e7a 100755 --- a/rc.sysinit +++ b/rc.sysinit @@ -279,11 +279,16 @@ fi
stat_busy "Mounting Local Filesystems" /bin/mount -n -o remount,rw / -if [ -x /bin/findmnt -a -e /proc/self/mountinfo ]; then - /bin/findmnt -rnu -o SOURCE,TARGET,FSTYPE,OPTIONS >| /etc/mtab -else - cat /proc/mounts >| /etc/mtab + +# don't touch /etc/mtab if it is a symlink to /proc/self/mounts +if [ ! -L /etc/mtab ]; then + if [ -x /bin/findmnt -a -e /proc/self/mountinfo ]; then + /bin/findmnt -rnu -o SOURCE,TARGET,FSTYPE,OPTIONS >| /etc/mtab + else + cat /proc/mounts >| /etc/mtab + fi fi + run_hook sysinit_premount # now mount all the local filesystems /bin/mount -a -t $NETFS -O no_netdev -- 1.7.4.2
Maybe you should use bash style with [[. Something like the follwing looks better if [[ -L /etc/mtab ]]; then : elif [[ -x /bin/findmnt && -e /proc/self/mountinfo ]]; then /bin/findmnt -rnu -o SOURCE,TARGET,FSTYPE,OPTIONS >| /etc/mtab else cat /proc/mounts >| /etc/mtab fi -- Sébastien Luttringer www.seblu.net
If this bug is still present (after more than 4 years) it should be reported and fixed in the kernel. Signed-off-by: Tom Gundersen <teg@jklm.no> --- rc.shutdown | 3 --- 1 files changed, 0 insertions(+), 3 deletions(-) diff --git a/rc.shutdown b/rc.shutdown index f588058..4c5a3f8 100755 --- a/rc.shutdown +++ b/rc.shutdown @@ -41,9 +41,6 @@ if [[ $TIMEZONE && -e /usr/share/zoneinfo/$TIMEZONE ]]; then /bin/cp "/usr/share/zoneinfo/$TIMEZONE" /etc/localtime fi -# removing psmouse module to fix some reboot issues on newer laptops -/sbin/modprobe -r psmouse >/dev/null 2>&1 - # Write to wtmp file before unmounting /sbin/halt -w -- 1.7.4.2
On Wed, Mar 30, 2011 at 08:01:26PM +0200, Tom Gundersen wrote:
If this bug is still present (after more than 4 years) it should be reported and fixed in the kernel.
Signed-off-by: Tom Gundersen <teg@jklm.no> --- rc.shutdown | 3 --- 1 files changed, 0 insertions(+), 3 deletions(-)
diff --git a/rc.shutdown b/rc.shutdown index f588058..4c5a3f8 100755 --- a/rc.shutdown +++ b/rc.shutdown @@ -41,9 +41,6 @@ if [[ $TIMEZONE && -e /usr/share/zoneinfo/$TIMEZONE ]]; then /bin/cp "/usr/share/zoneinfo/$TIMEZONE" /etc/localtime fi
-# removing psmouse module to fix some reboot issues on newer laptops -/sbin/modprobe -r psmouse >/dev/null 2>&1 - # Write to wtmp file before unmounting /sbin/halt -w
-- 1.7.4.2
In case you want to add it to the commit message as a reference: http://lkml.org/lkml/2007/2/26/324 dave
On Wed, Mar 30, 2011 at 8:48 PM, Dave Reisner <d@falconindy.com> wrote:
In case you want to add it to the commit message as a reference:
Brilliant, I did not find that. I added to the commit message: "Dave points out that this was fixed by kernel commit a1cec06177386 (which is in 2.6.21 and was backported to at least 2.6.19.6)." Cheers, Tom
If this bug is still present (after more than 4 years) it should be reported and fixed in syslog-ng. Signed-off-by: Tom Gundersen <teg@jklm.no> --- rc.shutdown | 2 -- 1 files changed, 0 insertions(+), 2 deletions(-) diff --git a/rc.shutdown b/rc.shutdown index 4c5a3f8..106c3df 100755 --- a/rc.shutdown +++ b/rc.shutdown @@ -15,8 +15,6 @@ echo " " printhl "Initiating Shutdown..." echo " " -# avoid NIS hanging syslog-ng on shutdown by unsetting the domainname -[[ -x /bin/domainname ]] && /bin/domainname "" [[ -x /etc/rc.local.shutdown ]] && /etc/rc.local.shutdown kill_everything shutdown -- 1.7.4.2
On Wed, Mar 30, 2011 at 8:01 PM, Tom Gundersen <teg@jklm.no> wrote:
If this bug is still present (after more than 4 years) it should be reported and fixed in syslog-ng. You win a BOFH point :)
Another point: Are there people that still use NIS?
Signed-off-by: Tom Gundersen <teg@jklm.no> --- rc.shutdown | 2 -- 1 files changed, 0 insertions(+), 2 deletions(-)
diff --git a/rc.shutdown b/rc.shutdown index 4c5a3f8..106c3df 100755 --- a/rc.shutdown +++ b/rc.shutdown @@ -15,8 +15,6 @@ echo " " printhl "Initiating Shutdown..." echo " "
-# avoid NIS hanging syslog-ng on shutdown by unsetting the domainname -[[ -x /bin/domainname ]] && /bin/domainname "" [[ -x /etc/rc.local.shutdown ]] && /etc/rc.local.shutdown
kill_everything shutdown -- 1.7.4.2
-- Sébastien Luttringer www.seblu.net
This was needed to properly deal with dm devices being created in initrd. However, the lvm2/devicemapper rule files no longer use this property and now contain a proper fix. By grepping through /lib/udev/rules.d I could not find any other rule file using this property. Finally, the startup script submitted to systemd by the udev maintainer does not set the property, and there has not been any bug complaints about this. Signed-off-by: Tom Gundersen <teg@jlkm.no> --- rc.sysinit | 2 -- 1 files changed, 0 insertions(+), 2 deletions(-) diff --git a/rc.sysinit b/rc.sysinit index 1601e7a..1331587 100755 --- a/rc.sysinit +++ b/rc.sysinit @@ -82,7 +82,6 @@ run_hook sysinit_udevlaunched # Trigger udev uevents if /bin/pidof -o %PPID /sbin/udevd >/dev/null; then stat_busy "Triggering UDev uevents" - /sbin/udevadm control --property=STARTUP=1 /sbin/udevadm trigger --action=add --type=devices /sbin/udevadm trigger --action=add --type=subsystems stat_done @@ -101,7 +100,6 @@ unset mods if /bin/pidof -o %PPID /sbin/udevd >/dev/null; then stat_busy "Waiting for UDev uevents to be processed" /sbin/udevadm settle --quiet --timeout=${UDEV_TIMEOUT:-30} - /sbin/udevadm control --property=STARTUP= stat_done fi -- 1.7.4.2
This should not be necessary as the packages installing modules should be responsible for updating the dependencies. Furthermore, as modules can be loaded very early in boot, but depmod can only be called after root is mounted rw, we can not rely on depmod fixing broken module dependencies. Signed-off-by: Tom Gundersen <teg@jklm.no> --- rc.sysinit | 2 -- 1 files changed, 0 insertions(+), 2 deletions(-) diff --git a/rc.sysinit b/rc.sysinit index 1331587..8ab9b58 100755 --- a/rc.sysinit +++ b/rc.sysinit @@ -339,8 +339,6 @@ if [[ $NISDOMAINNAME ]]; then status "Setting NIS Domain Name: $NISDOMAINNAME" /bin/nisdomainname "$NISDOMAINNAME" fi -status "Updating Module Dependencies" /sbin/depmod -A - [[ $LOCALE ]] || LOCALE="en_US" stat_busy "Setting Locale: $LOCALE" # Flush old locale settings -- 1.7.4.2
On Wed, Mar 30, 2011 at 8:01 PM, Tom Gundersen <teg@jklm.no> wrote:
This should not be necessary as the packages installing modules should be responsible for updating the dependencies.
Furthermore, as modules can be loaded very early in boot, but depmod can only be called after root is mounted rw, we can not rely on depmod fixing broken module dependencies.
Signed-off-by: Tom Gundersen <teg@jklm.no> --- rc.sysinit | 2 -- 1 files changed, 0 insertions(+), 2 deletions(-)
diff --git a/rc.sysinit b/rc.sysinit index 1331587..8ab9b58 100755 --- a/rc.sysinit +++ b/rc.sysinit @@ -339,8 +339,6 @@ if [[ $NISDOMAINNAME ]]; then status "Setting NIS Domain Name: $NISDOMAINNAME" /bin/nisdomainname "$NISDOMAINNAME" fi
-status "Updating Module Dependencies" /sbin/depmod -A - [[ $LOCALE ]] || LOCALE="en_US" stat_busy "Setting Locale: $LOCALE" # Flush old locale settings -- 1.7.4.2
looks good! -- Sébastien Luttringer www.seblu.net
On Fri, Apr 1, 2011 at 2:51 AM, Seblu <seblu@seblu.net> wrote:
On Wed, Mar 30, 2011 at 8:01 PM, Tom Gundersen <teg@jklm.no> wrote:
This should not be necessary as the packages installing modules should be responsible for updating the dependencies.
Furthermore, as modules can be loaded very early in boot, but depmod can only be called after root is mounted rw, we can not rely on depmod fixing broken module dependencies.
Signed-off-by: Tom Gundersen <teg@jklm.no> --- rc.sysinit | 2 -- 1 files changed, 0 insertions(+), 2 deletions(-)
diff --git a/rc.sysinit b/rc.sysinit index 1331587..8ab9b58 100755 --- a/rc.sysinit +++ b/rc.sysinit @@ -339,8 +339,6 @@ if [[ $NISDOMAINNAME ]]; then status "Setting NIS Domain Name: $NISDOMAINNAME" /bin/nisdomainname "$NISDOMAINNAME" fi
-status "Updating Module Dependencies" /sbin/depmod -A - [[ $LOCALE ]] || LOCALE="en_US" stat_busy "Setting Locale: $LOCALE" # Flush old locale settings -- 1.7.4.2
looks good! and fix : https://bugs.archlinux.org/task/20174
-- Sébastien Luttringer www.seblu.net
This is done at shutdown, so no need to repeat it here. Signed-off-by: Tom Gundersen <teg@jklm.no> --- rc.sysinit | 6 ------ 1 files changed, 0 insertions(+), 6 deletions(-) diff --git a/rc.sysinit b/rc.sysinit index 8ab9b58..e3cd57e 100755 --- a/rc.sysinit +++ b/rc.sysinit @@ -304,12 +304,6 @@ fi status "Activating Swap" /sbin/swapon -a -if [[ $TIMEZONE && -e /usr/share/zoneinfo/$TIMEZONE ]]; then - /bin/rm -f /etc/localtime - status "Configuring Time Zone" \ - /bin/cp "/usr/share/zoneinfo/$TIMEZONE" /etc/localtime -fi - RANDOM_SEED=/var/lib/misc/random-seed if [[ -f $RANDOM_SEED ]]; then stat_busy "Initializing Random Seed" -- 1.7.4.2
On Wed, Mar 30, 2011 at 8:01 PM, Tom Gundersen <teg@jklm.no> wrote:
This is done at shutdown, so no need to repeat it here. Why removing it at boot and not at shutdown. Imagine i fix my timezone by mouting my root from nfsroot or usb key. Why i should wait a shutdown to be completed to have my new timezone?
Signed-off-by: Tom Gundersen <teg@jklm.no> --- rc.sysinit | 6 ------ 1 files changed, 0 insertions(+), 6 deletions(-)
diff --git a/rc.sysinit b/rc.sysinit index 8ab9b58..e3cd57e 100755 --- a/rc.sysinit +++ b/rc.sysinit @@ -304,12 +304,6 @@ fi
status "Activating Swap" /sbin/swapon -a
-if [[ $TIMEZONE && -e /usr/share/zoneinfo/$TIMEZONE ]]; then - /bin/rm -f /etc/localtime - status "Configuring Time Zone" \ - /bin/cp "/usr/share/zoneinfo/$TIMEZONE" /etc/localtime -fi - RANDOM_SEED=/var/lib/misc/random-seed if [[ -f $RANDOM_SEED ]]; then stat_busy "Initializing Random Seed" -- 1.7.4.2
-- Sébastien Luttringer www.seblu.net
Creates the mountpoints for the standard api filesystems in /etc/fstab. At the moment this is already done by /lib/udev/devices in our udev package. However, with this change it is possible to boot a fully working system with the udev unaltered from upstream. For the future, this patch allows us to get rid of the /lib/udev/devices directory from the udev package alltogether. Signed-off-by: Tom Gundersen <teg@jklm.no> --- rc.sysinit | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/rc.sysinit b/rc.sysinit index e3cd57e..59995c5 100755 --- a/rc.sysinit +++ b/rc.sysinit @@ -275,6 +275,9 @@ if [[ -x /sbin/fsck ]]; then stat_done fi +/bin/mkdir -p /dev/pts +/bin/mkdir -p /dev/shm + stat_busy "Mounting Local Filesystems" /bin/mount -n -o remount,rw / -- 1.7.4.2
On Wed, Mar 30, 2011 at 08:01:31PM +0200, Tom Gundersen wrote:
Creates the mountpoints for the standard api filesystems in /etc/fstab.
At the moment this is already done by /lib/udev/devices in our udev package. However, with this change it is possible to boot a fully working system with the udev unaltered from upstream.
For the future, this patch allows us to get rid of the /lib/udev/devices directory from the udev package alltogether.
Signed-off-by: Tom Gundersen <teg@jklm.no> --- rc.sysinit | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/rc.sysinit b/rc.sysinit index e3cd57e..59995c5 100755 --- a/rc.sysinit +++ b/rc.sysinit @@ -275,6 +275,9 @@ if [[ -x /sbin/fsck ]]; then stat_done fi
+/bin/mkdir -p /dev/pts +/bin/mkdir -p /dev/shm + stat_busy "Mounting Local Filesystems" /bin/mount -n -o remount,rw /
-- 1.7.4.2
/bin/mkdir -p /dev/{pts,shm} +1 for being able to use vanilla upstream packages. /eyeballs /lib/udev/load-modules.sh dave
On Wed, Mar 30, 2011 at 8:54 PM, Dave Reisner <d@falconindy.com> wrote:
/bin/mkdir -p /dev/{pts,shm}
Good catch.
/eyeballs /lib/udev/load-modules.sh
Yes, that should go (as it slows down boot considerably and changes the semantics of udev in a non-trivial way), but I don't know enough about how it works to know what would be lost. -t
On Wed, Mar 30, 2011 at 09:06:17PM +0200, Tom Gundersen wrote:
On Wed, Mar 30, 2011 at 8:54 PM, Dave Reisner <d@falconindy.com> wrote:
/bin/mkdir -p /dev/{pts,shm}
Good catch.
/eyeballs /lib/udev/load-modules.sh
Yes, that should go (as it slows down boot considerably and changes the semantics of udev in a non-trivial way), but I don't know enough about how it works to know what would be lost.
-t
It'd be lovely if we could adopt the upstream /etc/modprobe.d hierarchy. I've always wondered why the KISS solution in this case was interpreted as: "create an wrapper around a magical bash array to intercept every modprobe call" when using 'install foomod /bin/false' works just as well. I tried to slim this script down, and while I was able to reproduce it in about half the SLOC (sans logging), it was susceptible to a few early boot issues and moreover, had zero effect on speed. This is where this ML is going to be fun: I do notice that load-modules.sh also in mkinitcpio (which doesn't, nor could it include /etc/rc.conf due to the bash dependency). mkinitcpio has blacklisting capabilities via the kernel cmdline and through the aforementioned /etc/modprobe.d hierarchy. I am happy to provide patchwork to remove this mess and replace it with something slightly more sane (while still retaining the MODULES array). Tom, I'm thinking of something very much along the lines of what we do for initscripts-systemd on shutdown. My only hangup is what to do with the quirks we have in our arch.rules files. I'm not familiar with the circumstances under which those were added, nor the repercussions of removing them. dave
I'm cc'ing Tobias (udev maintainer) in case he is not on the list. On Wed, Mar 30, 2011 at 10:58 PM, Dave Reisner <d@falconindy.com> wrote:
On Wed, Mar 30, 2011 at 09:06:17PM +0200, Tom Gundersen wrote:
On Wed, Mar 30, 2011 at 8:54 PM, Dave Reisner <d@falconindy.com> wrote:
/eyeballs /lib/udev/load-modules.sh
Yes, that should go (as it slows down boot considerably and changes the semantics of udev in a non-trivial way), but I don't know enough about how it works to know what would be lost.
It'd be lovely if we could adopt the upstream /etc/modprobe.d hierarchy. I've always wondered why the KISS solution in this case was interpreted as: "create an wrapper around a magical bash array to intercept every modprobe call" when using 'install foomod /bin/false' works just as well.
I don't know the historic reasons, my guess is that the script was added when udev couldn't do the blacklisting it can do today. The biggest challenge I see would be to figure out what the script can do that the upstream blacklisting cannot. Is there any documentation on this that I have missed?
I tried to slim this script down, and while I was able to reproduce it in about half the SLOC (sans logging), it was susceptible to a few early boot issues and moreover, had zero effect on speed.
I think the main slowdown comes from spawning bash all the time (the script itself is not that big), so that makes sense.
This is where this ML is going to be fun: I do notice that load-modules.sh also in mkinitcpio (which doesn't, nor could it include /etc/rc.conf due to the bash dependency). mkinitcpio has blacklisting capabilities via the kernel cmdline and through the aforementioned /etc/modprobe.d hierarchy.
I am happy to provide patchwork to remove this mess and replace it with something slightly more sane (while still retaining the MODULES array). Tom, I'm thinking of something very much along the lines of what we do for initscripts-systemd on shutdown.
The script Dave is referring to is meant to be run at shutdown, reads rc.conf and saves the MODULES array (among other things) in a format that udev knows how to read on boot. It would be neat if this script could be made to work the same in systemd and initscripts so we don't get any duplication (I guess it should already work in both settings).
My only hangup is what to do with the quirks we have in our arch.rules files. I'm not familiar with the circumstances under which those were added, nor the repercussions of removing them.
That's independent from removing load-modules.sh though? Cheers, Tom
participants (3)
-
Dave Reisner
-
Seblu
-
Tom Gundersen