diff options
author | Juuso Alasuutari | 2007-01-30 20:25:05 +0200 |
---|---|---|
committer | Jaka Kranjc | 2007-02-14 21:11:30 +0100 |
commit | 6a7a4877a61f8cc2e673080a17cbc8a611627d28 (patch) | |
tree | b856046654e9f35c9003562f98076363b0ae8a08 | |
parent | 8596f8aba1610faa4d45ea6a73ea319d5dfd86e8 (diff) |
init.d: Only depend on udev-old when absolutely necessary, i.e. when
udev isn't already installed. If the kernel is old and udev is installed
we can assume it's an old enough version. This will help reduce
unnecessary steps from hotplug -> udev migration (no casting of udev-old
and udev back and forth during upgrade)
(cherry picked from commit e0e5f2d784dadc5a5a5fee06dabacb2cb2562810)
(cherry picked from commit 2b0bf5625b8eba5827001603518d23a3403f7282)
-rwxr-xr-x | smgl/init.d/DEPENDS | 36 | ||||
-rw-r--r-- | smgl/init.d/HISTORY | 4 |
2 files changed, 25 insertions, 15 deletions
diff --git a/smgl/init.d/DEPENDS b/smgl/init.d/DEPENDS index c51feb48ec..636f6d9726 100755 --- a/smgl/init.d/DEPENDS +++ b/smgl/init.d/DEPENDS @@ -1,20 +1,26 @@ depends simpleinit-msb && -if [ "$DEVICES" == "devfs" ]; then - optional_depends devfsd "" "" \ - "to make devfs more functional and compatible with the old static /dev" -elif [ "$DEVICES" == "udev" ]; then - KERNEL_VERSION=$(get_kernel_version) && - PATCHLEVEL=`echo $KERNEL_VERSION | cut -d. -f2` && - SUBLEVEL=`echo $KERNEL_VERSION | cut -d. -f3` && - tmp=`echo $KERNEL_VERSION | cut -d. -f3 | sed 's/^[0-9]*//g'` && - SUBLEVEL=${SUBLEVEL/$tmp/} && - # kernel < 2.6.15-rc1 can't use udev > 0.93 tarballs because udevsend has been removed - if [ $SUBLEVEL -ge 15 -a $PATCHLEVEL -ge 6 ]; then - depends udev +if [[ $DEVICES == devfs ]] +then + optional_depends devfsd \ + "" \ + "" \ + "to make devfs more functional and compatible with \ +the old static /dev" +elif [[ $DEVICES == udev ]] +then + local VER2=$(echo $VERSION | cut -d. -f2) && + local VER3=$(echo $VERSION | cut -d. -f3) && + VER3=${VER3%%[^0-9]*} && + + if (( VER2 > 6 )) || + (( VER2 == 6 && VER3 > 14 )) || + spell_ok udev + then + depends udev else - message "You have a kernel < 2.6.15, it is too old for latest udev." && - message "We will use udev-old spell instead..." && - depends udev-old + message "You have a kernel < 2.6.15, it is too old for" \ + "latest udev.\nUsing udev-old spell instead." && + depends udev-old fi fi diff --git a/smgl/init.d/HISTORY b/smgl/init.d/HISTORY index 01bba5732f..e97420c129 100644 --- a/smgl/init.d/HISTORY +++ b/smgl/init.d/HISTORY @@ -1,3 +1,7 @@ +2007-01-30 Juuso Alasuutari <iuso@sourcemage.org> + * DEPENDS: Depend on udev-old instead of udev only when absolutely + necessary. Cleaned the code up. + 2007-01-18 Jeremy Blosser <jblosser-smgl@firinn.org> * init.d/devices: Centralize /proc mounting. * init.d{mountroot.sh,mountall.sh}: Try to not break systems that use |