From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1VtKpJ-0008JW-JM for mharc-grub-devel@gnu.org; Wed, 18 Dec 2013 12:22:30 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33808) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VtKpB-00082B-0z for grub-devel@gnu.org; Wed, 18 Dec 2013 12:22:27 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VtKp1-0007w1-Sj for grub-devel@gnu.org; Wed, 18 Dec 2013 12:22:20 -0500 Received: from mail-la0-x235.google.com ([2a00:1450:4010:c03::235]:55915) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VtKp1-0007vx-Ku for grub-devel@gnu.org; Wed, 18 Dec 2013 12:22:11 -0500 Received: by mail-la0-f53.google.com with SMTP id mc6so4061035lab.12 for ; Wed, 18 Dec 2013 09:22:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; bh=CHZNANP1GogtThMqf6Z8baSKR2feJUlInDZkKLqrVIQ=; b=b4MxDN4w8mqlQ7BhCbHLCx64bJJBEzpRLfj0CryZeNP68qf3oR+lVd21F/Nj0rAN7b oWuMhECaNw3OTomsxWiVNWabgNZC6xxKC12nUXjV9OzLg5FppbGvAfq2usEWwfMTS9Im IRfOz4wsA4+/Zmm3WaNCY7jgOq6qVEO7H2rs+24C8S1JYPTOIrqEXzWoWTYV7lL6BbV/ jXtf5+gxt0InOOaEZe8Wxyyx8JkI3UA/7Bm0dUjPDPq1ylg2MIm2QJGztqDDdlRAFl6m Ejmrxr13qZDB0Clkw2DicORQIkiaa2n2jqXJCqNGD/w+2t6522upN7FCLH/s/QPBV7rp TwEQ== X-Received: by 10.152.203.129 with SMTP id kq1mr6018lac.77.1387387330437; Wed, 18 Dec 2013 09:22:10 -0800 (PST) Received: from opensuse.site (ppp91-76-134-134.pppoe.mtu-net.ru. [91.76.134.134]) by mx.google.com with ESMTPSA id i8sm447610lbh.2.2013.12.18.09.22.09 for (version=SSLv3 cipher=RC4-SHA bits=128/128); Wed, 18 Dec 2013 09:22:09 -0800 (PST) Date: Wed, 18 Dec 2013 21:22:09 +0400 From: Andrey Borzenkov To: grub-devel@gnu.org Subject: Re: [PATCH] fix timeout handling with GRUB_HIDDEN_TIMEOUT=0 Message-ID: <20131218212209.24ceaba9@opensuse.site> In-Reply-To: <1386437059-25559-1-git-send-email-arvidjaar@gmail.com> References: <1386437059-25559-1-git-send-email-arvidjaar@gmail.com> X-Mailer: Claws Mail 3.9.2 (GTK+ 2.24.22; x86_64-suse-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: 8bit X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:4010:c03::235 Cc: cjwatson@ubuntu.com 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:22:27 -0000 Ping? This fixes actual problem - default /etc/default/grub shipped on openSUSE included GRUB_HIDDEN_TIMEOUT=0 which means timeout gets disabled after update. Colin, I Cc you as author of original patch - what do you think? В Sat, 7 Dec 2013 21:24:19 +0400 Andrey Borzenkov пишет: > Before 44d488477902f0786d6bce44b74713f1713a34a9 combination of > GRUB_HIDDEN_TIMEOUT=0 and GRUB_TIMEOUT!=0 resulted in normal menu with > timeout. Now due to GRUB_HIDDEN_TIMEOUT taking precedence, it will always > 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_STYLE to > hidden|countdown > c) GRUB_HIDDEN_TIMEOUT = 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 > > make_timeout () > { > - if [ "x${1}${3}" != "x" ] ; then > - if [ "x${3}" != "x" ] ; then > - timeout="${2}" > - style="${3}" > - else > - # Handle the deprecated GRUB_HIDDEN_TIMEOUT scheme. > - timeout="${1}" > - if [ "x${2}" != "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}" = "xtrue" ] ; then > - style="hidden" > - else > - style="countdown" > - fi > + if [ "x${3}" != "x" ] ; then > + timeout="${2}" > + style="${3}" > + elif [ "x${1}" != "x" -a "x${1}" != "x0" ] ; then > + # Handle the deprecated GRUB_HIDDEN_TIMEOUT scheme. > + timeout="${1}" > + if [ "x${2}" != "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${style}" = "xcountdown" ] ; then > - verbose=" --verbose" > - else > + if [ "x${GRUB_HIDDEN_TIMEOUT_QUIET}" = "xtrue" ] ; then > + style="hidden" > verbose= > + else > + style="countdown" > + verbose=" --verbose" > fi > - cat << EOF > + else > + # No hidden timeout, so treat as GRUB_TIMEOUT_STYLE=menu > + timeout="${2}" > + style="menu" > + fi > + cat << EOF > if [ x\$feature_timeout_style = xy ] ; then > set timeout_style=${style} > set timeout=${timeout} > EOF > - if [ "x${style}" != "xmenu" ] ; then > - cat << EOF > + if [ "x${style}" = "xmenu" ] ; then > + cat << EOF > +# Fallback normal timeout code in case the timeout_style feature is > +# unavailable. > +else > + set timeout=${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=0 > EOF > - fi > - cat << EOF > + fi > + cat << EOF > fi > EOF > - else > - cat << EOF > -set timeout=${2} > -EOF > - fi > } > > if [ "x$GRUB_BUTTON_CMOS_ADDRESS" != "x" ]; then