From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 36516138330 for ; Thu, 8 Sep 2016 18:38:02 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 3943EE0854; Thu, 8 Sep 2016 18:37:58 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id C8465E0854 for ; Thu, 8 Sep 2016 18:37:57 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 3F5A6340940 for ; Thu, 8 Sep 2016 18:37:56 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 711A42478 for ; Thu, 8 Sep 2016 18:37:54 +0000 (UTC) From: "William Hubbs" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "William Hubbs" Message-ID: <1473359773.841b883825ddf9982a673b3964757f6df25acd46.williamh@OpenRC> Subject: [gentoo-commits] proj/openrc:master commit in: init.d/ X-VCS-Repository: proj/openrc X-VCS-Files: init.d/hwclock.in X-VCS-Directories: init.d/ X-VCS-Committer: williamh X-VCS-Committer-Name: William Hubbs X-VCS-Revision: 841b883825ddf9982a673b3964757f6df25acd46 X-VCS-Branch: master Date: Thu, 8 Sep 2016 18:37:54 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 296878f2-afcd-4c1f-ac32-3b803addc233 X-Archives-Hash: 2b5de703acf89d8c77a7bc9462b3b1cb commit: 841b883825ddf9982a673b3964757f6df25acd46 Author: William Hubbs gmail com> AuthorDate: Thu Sep 8 17:39:52 2016 +0000 Commit: William Hubbs gentoo org> CommitDate: Thu Sep 8 18:36:13 2016 +0000 URL: https://gitweb.gentoo.org/proj/openrc.git/commit/?id=841b8838 hwclock: fix module load warning init.d/hwclock.in | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/init.d/hwclock.in b/init.d/hwclock.in index d28ac85..e69c561 100644 --- a/init.d/hwclock.in +++ b/init.d/hwclock.in @@ -80,6 +80,15 @@ get_noadjfile() fi } +rtc_exists() +{ + local rtc= + for rtc in /dev/rtc /dev/rtc[0-9]*; do + [ -e "$rtc" ] && break + done + [ -e "$rtc" ] +} + start() { local retval=0 errstr="" modname @@ -92,17 +101,13 @@ start() ebegin "Setting system clock using the hardware clock [$utc]" if [ -e /proc/modules ]; then - local rtc= - for rtc in /dev/rtc /dev/rtc[0-9]*; do - [ -e "$rtc" ] && break - done - if [ ! -e "${rtc}" ]; then - for x in rtc-cmos rtc genrtc; do - modprobe -q $x && modname=$x && break - done - [ -n "$modname" ] && - ewarn "The $modname module needs to be configured in \ - @SYSCONFDIR@/conf.d/modules or built in." + if ! rtc_exists; then + for x in rtc-cmos rtc genrtc; do + modprobe -q $x && rtc_exists && modname="$x" && break + done + [ -n "$modname" ] && + ewarn "The $modname module needs to be configured in \ + @SYSCONFDIR@/conf.d/modules or built in." fi fi