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 1RvQjz-0004O9-R3 for garchives@archives.gentoo.org; Thu, 09 Feb 2012 09:56:36 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id EBD43E049A; Thu, 9 Feb 2012 09:56:28 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id BFADDE049A for ; Thu, 9 Feb 2012 09:56:28 +0000 (UTC) Received: from hornbill.gentoo.org (hornbill.gentoo.org [94.100.119.163]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 34A7D1B4018 for ; Thu, 9 Feb 2012 09:56:28 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id 27985E53FF for ; Thu, 9 Feb 2012 09:56:26 +0000 (UTC) From: "Robin H. Johnson" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Robin H. Johnson" Message-ID: Subject: [gentoo-commits] proj/openrc:master commit in: sh/ X-VCS-Repository: proj/openrc X-VCS-Files: sh/init-early.sh.Linux.in X-VCS-Directories: sh/ X-VCS-Committer: robbat2 X-VCS-Committer-Name: Robin H. Johnson X-VCS-Revision: f5e7e768522895d2efe31d1afbdf7f2214421c7f Date: Thu, 9 Feb 2012 09:56:26 +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: 55cff28e-5853-4436-bbba-9fb94a53653d X-Archives-Hash: 2552c10171af66e8553763be1e3aa676 commit: f5e7e768522895d2efe31d1afbdf7f2214421c7f Author: Robin H. Johnson gentoo org> AuthorDate: Thu Feb 9 09:49:04 2012 +0000 Commit: Robin H. Johnson gentoo org> CommitDate: Thu Feb 9 09:53:46 2012 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/openrc.git;a=3D= commit;h=3Df5e7e768 Fix early consolefont/termencoding usage vs rc_sys During early boot, the keywords were not being checked for consolefont/termencoding and they were running anyway when they should not be. X-Gentoo-Bug: 400549 X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=3D400549 Signed-off-by: Robin H. Johnson gentoo.org> --- sh/init-early.sh.Linux.in | 21 +++++++++++++++++---- 1 files changed, 17 insertions(+), 4 deletions(-) diff --git a/sh/init-early.sh.Linux.in b/sh/init-early.sh.Linux.in index f546951..fb3860a 100644 --- a/sh/init-early.sh.Linux.in +++ b/sh/init-early.sh.Linux.in @@ -5,6 +5,19 @@ : ${CONSOLE:=3D/dev/console} : ${RC_LIBEXECDIR:=3D@LIBEXECDIR@} =20 +service_present() +{ + local p=3D"/etc/runlevels/$1/$2" + # fail if the file doesn't exist + [ ! -e "$p" ] && return 1 + # succeed if $RC_SYS empty, can't check further, assume script will run + [ -z "$RC_SYS" ] && return 0 + # fail if file contains "-$RC_SYS", because then it won't run + egrep -qi "^[[:space:]]*keyword[[:space:]].*-$RC_SYS\>" "$p" && return = 1 + # succeed otherwise + return 0 +} + if [ -e "$RC_LIBEXECDIR"/console/unicode ]; then termencoding=3D"%G" kmode=3D"-u" @@ -14,8 +27,8 @@ else fi =20 # Try and set a font and as early as we can -if [ -e /etc/runlevels/"$RC_DEFAULTLEVEL"/consolefont \ - -o -e /etc/runlevels/"$RC_BOOTLEVEL"/consolefont ]; then +if service_present "$RC_DEFAULTLEVEL" consolefont || + service_present "$RC_BOOTLEVEL" consolefont; then printf "\033%s" "$termencoding" >"$CONSOLE" 2>/dev/null if [ -r "$RC_LIBEXECDIR"/console/font -a -x /usr/bin/setfont ]; then font=3D"$(cat "$RC_LIBEXECDIR"/console/font)" @@ -25,8 +38,8 @@ if [ -e /etc/runlevels/"$RC_DEFAULTLEVEL"/consolefont \ fi =20 # Try and set a keyboard map as early as possible -if [ -e /etc/runlevels/"$RC_DEFAULTLEVEL"/keymaps \ - -o -e /etc/runlevels/"$RC_BOOTLEVEL"/keymaps ]; then +if service_present "$RC_DEFAULTLEVEL" keymaps || + service_present "$RC_BOOTLEVEL" keymaps; then kbd_mode $kmode -C "$CONSOLE" 2>/dev/null if [ -r "$RC_LIBEXECDIR"/console/keymap ]; then loadkeys -q "$RC_LIBEXECDIR"/console/keymap 2>/dev/null