1 |
commit: ba62574fdc12c39736032fa7be3715c202f9326c |
2 |
Author: William Hubbs <williamh <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sat Oct 29 20:16:08 2011 +0000 |
4 |
Commit: William Hubbs <williamh <AT> gentoo <DOT> org> |
5 |
CommitDate: Sat Oct 29 20:16:08 2011 +0000 |
6 |
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/udev-gentoo-scripts.git;a=commit;h=ba62574f |
7 |
|
8 |
Add kv_min variable to the udev init script |
9 |
|
10 |
The makefile was hard coding a value for the minimal kernel version into |
11 |
the init script. I feel that a better approach is to have a variable |
12 |
with a default value in the init script. For testing, it is possible to |
13 |
adjust the value in /etc/conf.d/udev. I deliberately did not document |
14 |
this in the conf.d file, because this is a value we would not want users |
15 |
to modify. |
16 |
|
17 |
--- |
18 |
Makefile | 4 ---- |
19 |
init.d/udev | 5 +++-- |
20 |
2 files changed, 3 insertions(+), 6 deletions(-) |
21 |
|
22 |
diff --git a/Makefile b/Makefile |
23 |
index 055d71a..028dcec 100644 |
24 |
--- a/Makefile |
25 |
+++ b/Makefile |
26 |
@@ -7,8 +7,6 @@ MODPROBE_DIR ?= $(SYSCONFDIR)/modprobe.d |
27 |
|
28 |
VERSION = $(shell git describe --tags) |
29 |
|
30 |
-KV_min ?= 2.6.24 |
31 |
- |
32 |
DESTNAME = udev-gentoo-scripts-$(VERSION) |
33 |
|
34 |
HELPERS = \ |
35 |
@@ -33,8 +31,6 @@ install: |
36 |
@install -m 0755 init.d/* $(DESTDIR)$(INITD) |
37 |
@install -d $(DESTDIR)$(MODPROBE_DIR) |
38 |
@install -m 0644 modprobe.d/* $(DESTDIR)$(MODPROBE_DIR) |
39 |
- @sed -e "s/%KV_MIN%/$(KV_min)/" \ |
40 |
- -i "$(DESTDIR)$(INITD)"/udev |
41 |
|
42 |
check-git-repository: |
43 |
git diff --quiet || { echo 'STOP, you have uncommitted changes in the working directory' ; false ; } |
44 |
|
45 |
diff --git a/init.d/udev b/init.d/udev |
46 |
index 51e7081..ea10111 100644 |
47 |
--- a/init.d/udev |
48 |
+++ b/init.d/udev |
49 |
@@ -15,6 +15,7 @@ udev_debug="${udev_debug:-no}" |
50 |
udev_monitor="${udev_monitor:-no}" |
51 |
udev_monitor_keep_running="${udev_monitor_keep_running:-no}" |
52 |
udev_settle_timeout="${udev_settle_timeout:-60}" |
53 |
+kv_min="${kb_min:-2.6.34}" |
54 |
|
55 |
depend() |
56 |
{ |
57 |
@@ -34,9 +35,9 @@ depend() |
58 |
# Maybe something like udevd --test || exit $? |
59 |
check_kernel() |
60 |
{ |
61 |
- if [ $(get_KV) -lt $(KV_to_int '%KV_MIN%') ]; then |
62 |
+ if [ $(get_KV) -lt $(KV_to_int ${kv_min}) ]; then |
63 |
eerror "Your kernel is too old to work with this version of udev." |
64 |
- eerror "Current udev only supports Linux kernel %KV_MIN% and newer." |
65 |
+ eerror "Current udev only supports Linux kernel ${kv_min} and newer." |
66 |
return 1 |
67 |
fi |
68 |
return 0 |