From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1VtL0r-00020e-5N for mharc-grub-devel@gnu.org; Wed, 18 Dec 2013 12:34:25 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37277) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VtL0k-0001sF-QH for grub-devel@gnu.org; Wed, 18 Dec 2013 12:34:23 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VtL0f-0003fH-2R for grub-devel@gnu.org; Wed, 18 Dec 2013 12:34:18 -0500 Received: from mail-ea0-x232.google.com ([2a00:1450:4013:c01::232]:57562) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VtL0e-0003fB-OF for grub-devel@gnu.org; Wed, 18 Dec 2013 12:34:13 -0500 Received: by mail-ea0-f178.google.com with SMTP id d10so3674105eaj.23 for ; Wed, 18 Dec 2013 09:34:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type; bh=l7pEUe1uqf3Pkl1u9Ar3SjJ/XdPZaQKRoK+Awg39a5c=; b=WedtpVgIINSgOhjLlhvkozMbIC8aQNqlpXuSB1oUGEH4ed2vqKwFIw+O632UgDhRnW fZ0bRfvR9o00NXqq9dtNs9vsLIMqstqHsQhZcYcLpkTdouQlghppEQQiIRQRQc/pLEnc 4C/KUT48c9RBnzuJmEocjrok/nL4hoF3h3E9Xy5uzCQ/BvwIUw5I5Y5oUR9EffCbbXy1 TNCaOvighXHUdbjIsRh4Zu0D5rsr0KL1QED22y39c2D0GbRIFhuXx+VUGoXpyzbDiKbf Pcu6iaxFHJNL8UTOL2VJBQHRgvIxJDzpZeVKRfSmt6yl10YE9uNIB5VMwdkDctYHxkk3 NlIw== X-Received: by 10.14.211.69 with SMTP id v45mr29774680eeo.75.1387388051887; Wed, 18 Dec 2013 09:34:11 -0800 (PST) Received: from [192.168.1.16] (85-188.196-178.cust.bluewin.ch. [178.196.188.85]) by mx.google.com with ESMTPSA id j46sm1863306eew.18.2013.12.18.09.34.10 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 18 Dec 2013 09:34:10 -0800 (PST) Message-ID: <52B1DC91.6060306@gmail.com> Date: Wed, 18 Dec 2013 18:34:09 +0100 From: =?UTF-8?B?VmxhZGltaXIgJ8+GLWNvZGVyL3BoY29kZXInIFNlcmJpbmVua28=?= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20131103 Icedove/17.0.10 MIME-Version: 1.0 To: The development of GNU GRUB Subject: Re: [PATCH] fix timeout handling with GRUB_HIDDEN_TIMEOUT=0 References: <1386437059-25559-1-git-send-email-arvidjaar@gmail.com> <20131218212209.24ceaba9@opensuse.site> In-Reply-To: <20131218212209.24ceaba9@opensuse.site> X-Enigmail-Version: 1.6 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="Rjvrd6AH5jM9A0scHFrnuABX4tvlbFrk3" X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:4013:c01::232 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Dec 2013 17:34:24 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --Rjvrd6AH5jM9A0scHFrnuABX4tvlbFrk3 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable @Colin: can you review this? On 18.12.2013 18:22, Andrey Borzenkov wrote: > Ping? This fixes actual problem - default /etc/default/grub shipped on > openSUSE included GRUB_HIDDEN_TIMEOUT=3D0 which means timeout gets > disabled after update. >=20 > Colin, I Cc you as author of original patch - what do you think? >=20 >=20 > =D0=92 Sat, 7 Dec 2013 21:24:19 +0400 > Andrey Borzenkov =D0=BF=D0=B8=D1=88=D0=B5=D1=82: >=20 >> Before 44d488477902f0786d6bce44b74713f1713a34a9 combination of >> GRUB_HIDDEN_TIMEOUT=3D0 and GRUB_TIMEOUT!=3D0 resulted in normal menu = with >> timeout. Now due to GRUB_HIDDEN_TIMEOUT taking precedence, it will alw= ays >> set timeout to 0 and immediately load default entry. >> >> To ensure that update does not break existing configuration, refactor >> make_timeout code. We have >> >> a) GRUB_TIMEOUT_STYLE set - assume new code >> b) GRUB_HIDDEN_TIMEOUT > 0 - use existing logic to set GRUB_TIMEOUT_ST= YLE to >> hidden|countdown >> c) GRUB_HIDDEN_TIMEOUT =3D 0 - set GRUB_TIMOUT_STYLE to menu >> >> There is no need to have special case for GRUB_TIMEOUT_STYLE not set -= it is the >> same as having it set to menu, so consolidate it with previous code. >> >> --- >> util/grub.d/00_header.in | 58 +++++++++++++++++++++++++--------------= --------- >> 1 file changed, 30 insertions(+), 28 deletions(-) >> >> diff --git a/util/grub.d/00_header.in b/util/grub.d/00_header.in >> index d2e7252..0c82f23 100644 >> --- a/util/grub.d/00_header.in >> +++ b/util/grub.d/00_header.in >> @@ -282,48 +282,50 @@ fi >> =20 >> make_timeout () >> { >> - if [ "x${1}${3}" !=3D "x" ] ; then >> - if [ "x${3}" !=3D "x" ] ; then >> - timeout=3D"${2}" >> - style=3D"${3}" >> - else >> - # Handle the deprecated GRUB_HIDDEN_TIMEOUT scheme. >> - timeout=3D"${1}" >> - if [ "x${2}" !=3D "x0" ] ; then >> - grub_warn "$(gettext "Setting GRUB_TIMEOUT to a non-zero value when= GRUB_HIDDEN_TIMEOUT is set is no longer supported.")" >> - fi >> - if [ "x${GRUB_HIDDEN_TIMEOUT_QUIET}" =3D "xtrue" ] ; then >> - style=3D"hidden" >> - else >> - style=3D"countdown" >> - fi >> + if [ "x${3}" !=3D "x" ] ; then >> + timeout=3D"${2}" >> + style=3D"${3}" >> + elif [ "x${1}" !=3D "x" -a "x${1}" !=3D "x0" ] ; then >> + # Handle the deprecated GRUB_HIDDEN_TIMEOUT scheme. >> + timeout=3D"${1}" >> + if [ "x${2}" !=3D "x0" ] ; then >> + grub_warn "$(gettext "Setting GRUB_TIMEOUT to a non-zero value w= hen GRUB_HIDDEN_TIMEOUT is set is no longer supported.")" >> fi >> - if [ "x${style}" =3D "xcountdown" ] ; then >> - verbose=3D" --verbose" >> - else >> + if [ "x${GRUB_HIDDEN_TIMEOUT_QUIET}" =3D "xtrue" ] ; then >> + style=3D"hidden" >> verbose=3D >> + else >> + style=3D"countdown" >> + verbose=3D" --verbose" >> fi >> - cat << EOF >> + else >> + # No hidden timeout, so treat as GRUB_TIMEOUT_STYLE=3Dmenu >> + timeout=3D"${2}" >> + style=3D"menu" >> + fi >> + cat << EOF >> if [ x\$feature_timeout_style =3D xy ] ; then >> set timeout_style=3D${style} >> set timeout=3D${timeout} >> EOF >> - if [ "x${style}" !=3D "xmenu" ] ; then >> - cat << EOF >> + if [ "x${style}" =3D "xmenu" ] ; then >> + cat << EOF >> +# Fallback normal timeout code in case the timeout_style feature is >> +# unavailable. >> +else >> + set timeout=3D${timeout} >> +EOF >> + else >> + cat << EOF >> # Fallback hidden-timeout code in case the timeout_style feature is >> # unavailable. >> elif sleep${verbose} --interruptible ${timeout} ; then >> set timeout=3D0 >> EOF >> - fi >> - cat << EOF >> + fi >> + cat << EOF >> fi >> EOF >> - else >> - cat << EOF >> -set timeout=3D${2} >> -EOF >> - fi >> } >> =20 >> if [ "x$GRUB_BUTTON_CMOS_ADDRESS" !=3D "x" ]; then >=20 >=20 > _______________________________________________ > Grub-devel mailing list > Grub-devel@gnu.org > https://lists.gnu.org/mailman/listinfo/grub-devel >=20 --Rjvrd6AH5jM9A0scHFrnuABX4tvlbFrk3 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.15 (GNU/Linux) Comment: Using GnuPG with Icedove - http://www.enigmail.net/ iF4EAREKAAYFAlKx3JEACgkQmBXlbbo5nOsAxAD/d3lm3+cwGHO5O8813nn06pkB NXTj5TscF69vS0qEwyIA/iF1zTR1EfgZNHjX+u/n9tjDMDWghW4S8JUAxOx8+Cau =loeS -----END PGP SIGNATURE----- --Rjvrd6AH5jM9A0scHFrnuABX4tvlbFrk3--