From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1RKFRs-0000j4-Py for garchives@archives.gentoo.org; Sat, 29 Oct 2011 20:24:13 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id F100D21C06E; Sat, 29 Oct 2011 20:24:04 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id BAC3B21C06E for ; Sat, 29 Oct 2011 20:24:04 +0000 (UTC) Received: from pelican.gentoo.org (unknown [66.219.59.40]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 36AAC1B4011 for ; Sat, 29 Oct 2011 20:24:04 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id 6A32980042 for ; Sat, 29 Oct 2011 20:24:03 +0000 (UTC) From: "William Hubbs" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "William Hubbs" Message-ID: Subject: [gentoo-commits] proj/udev-gentoo-scripts:master commit in: init.d/, / X-VCS-Repository: proj/udev-gentoo-scripts X-VCS-Files: Makefile init.d/udev X-VCS-Directories: init.d/ / X-VCS-Committer: WilliamH X-VCS-Committer-Name: William Hubbs X-VCS-Revision: ba62574fdc12c39736032fa7be3715c202f9326c Date: Sat, 29 Oct 2011 20:24:03 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: X-Archives-Hash: 0d5e2fe6f531dba425dbf254cc013be8 commit: ba62574fdc12c39736032fa7be3715c202f9326c Author: William Hubbs gentoo org> AuthorDate: Sat Oct 29 20:16:08 2011 +0000 Commit: William Hubbs gentoo org> CommitDate: Sat Oct 29 20:16:08 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/udev-gentoo-s= cripts.git;a=3Dcommit;h=3Dba62574f 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. --- Makefile | 4 ---- init.d/udev | 5 +++-- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 055d71a..028dcec 100644 --- a/Makefile +++ b/Makefile @@ -7,8 +7,6 @@ MODPROBE_DIR ?=3D $(SYSCONFDIR)/modprobe.d =20 VERSION =3D $(shell git describe --tags) =20 -KV_min ?=3D 2.6.24 - DESTNAME =3D udev-gentoo-scripts-$(VERSION) =20 HELPERS =3D \ @@ -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 =20 check-git-repository: git diff --quiet || { echo 'STOP, you have uncommitted changes in the w= orking 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=3D"${udev_debug:-no}" udev_monitor=3D"${udev_monitor:-no}" udev_monitor_keep_running=3D"${udev_monitor_keep_running:-no}" udev_settle_timeout=3D"${udev_settle_timeout:-60}" +kv_min=3D"${kb_min:-2.6.34}" =20 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