diff options
author | William Hubbs <williamh@gentoo.org> | 2011-10-29 15:16:08 -0500 |
---|---|---|
committer | William Hubbs <williamh@gentoo.org> | 2011-10-29 15:16:08 -0500 |
commit | ba62574fdc12c39736032fa7be3715c202f9326c (patch) | |
tree | 6e6286c539e2bf7109005ef325bb8afb0b88aa98 | |
parent | remove warning about unreliable kernel/udev combination (diff) | |
download | udev-gentoo-scripts-ba62574fdc12c39736032fa7be3715c202f9326c.tar.gz udev-gentoo-scripts-ba62574fdc12c39736032fa7be3715c202f9326c.tar.bz2 udev-gentoo-scripts-ba62574fdc12c39736032fa7be3715c202f9326c.zip |
Add kv_min variable to the udev init script
The makefile was hard coding a value for the minimal kernel version into
the init script. I feel that a better approach is to have a variable
with a default value in the init script. For testing, it is possible to
adjust the value in /etc/conf.d/udev. I deliberately did not document
this in the conf.d file, because this is a value we would not want users
to modify.
-rw-r--r-- | Makefile | 4 | ||||
-rw-r--r-- | init.d/udev | 5 |
2 files changed, 3 insertions, 6 deletions
@@ -7,8 +7,6 @@ MODPROBE_DIR ?= $(SYSCONFDIR)/modprobe.d VERSION = $(shell git describe --tags) -KV_min ?= 2.6.24 - DESTNAME = udev-gentoo-scripts-$(VERSION) HELPERS = \ @@ -33,8 +31,6 @@ install: @install -m 0755 init.d/* $(DESTDIR)$(INITD) @install -d $(DESTDIR)$(MODPROBE_DIR) @install -m 0644 modprobe.d/* $(DESTDIR)$(MODPROBE_DIR) - @sed -e "s/%KV_MIN%/$(KV_min)/" \ - -i "$(DESTDIR)$(INITD)"/udev check-git-repository: git diff --quiet || { echo 'STOP, you have uncommitted changes in the working directory' ; false ; } diff --git a/init.d/udev b/init.d/udev index 51e7081..ea10111 100644 --- a/init.d/udev +++ b/init.d/udev @@ -15,6 +15,7 @@ udev_debug="${udev_debug:-no}" udev_monitor="${udev_monitor:-no}" udev_monitor_keep_running="${udev_monitor_keep_running:-no}" udev_settle_timeout="${udev_settle_timeout:-60}" +kv_min="${kb_min:-2.6.34}" depend() { @@ -34,9 +35,9 @@ depend() # Maybe something like udevd --test || exit $? check_kernel() { - if [ $(get_KV) -lt $(KV_to_int '%KV_MIN%') ]; then + if [ $(get_KV) -lt $(KV_to_int ${kv_min}) ]; then eerror "Your kernel is too old to work with this version of udev." - eerror "Current udev only supports Linux kernel %KV_MIN% and newer." + eerror "Current udev only supports Linux kernel ${kv_min} and newer." return 1 fi return 0 |