From patchwork Fri Nov 14 14:55:53 2008 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roman Rakus X-Patchwork-Id: 22979 Return-Path: X-Original-To: yaboot-devel@ozlabs.org Delivered-To: yaboot-devel@ozlabs.org Received: from mx2.redhat.com (mx2.redhat.com [66.187.237.31]) by ozlabs.org (Postfix) with ESMTP id A6E24DDD04 for ; Sat, 15 Nov 2008 01:56:29 +1100 (EST) Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id mAEEuQGV004364 for ; Fri, 14 Nov 2008 09:56:27 -0500 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx2.corp.redhat.com (8.13.1/8.13.1) with ESMTP id mAEEuQQf032640 for ; Fri, 14 Nov 2008 09:56:26 -0500 Received: from dhcp-lab-179.englab.brq.redhat.com (dhcp-lab-179.englab.brq.redhat.com [10.34.33.179]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id mAEEuOqe012672 for ; Fri, 14 Nov 2008 09:56:25 -0500 Message-ID: <491D9179.4020506@redhat.com> Date: Fri, 14 Nov 2008 15:55:53 +0100 From: Roman Rakus User-Agent: Thunderbird 2.0.0.16 (X11/20080723) MIME-Version: 1.0 To: yaboot-devel@ozlabs.org Subject: ybin --bootonce doesn't work X-Scanned-By: MIMEDefang 2.58 on 172.16.27.26 X-BeenThere: yaboot-devel@ozlabs.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: Technical and development discussion regarding yaboot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Nov 2008 14:56:30 -0000 From bugzilla https://bugzilla.redhat.com/show_bug.cgi?id=471425 /Description From Will Woods (wwoods@redhat.com ) 2008-11-13 12:25:19 EDT/ ybin --bootonce doesn't work, for a couple of reasons: 1) It inverts the logic of a test to see if nvram is available, and 2) It assumes the output of 'nvsetenv VARNAME' will be 'VARNAME=VALUE', rather than just 'VALUE' (as it is when using the "nvram" utility). The attached patch fixes these problems and makes --bootonce work as expected. RR diff --git a/ybin/ybin b/ybin/ybin index 379b94b..bd4e8cc 100755 --- a/ybin/ybin +++ b/ybin/ybin @@ -1658,14 +1658,15 @@ checkconf || exit 1 if [ "x$bootonce" != "x" ]; then foundlabel=`sed s/\#.*// $bootconf | grep "label=$bootonce$" | wc -l` - if [ "$nonvram" = 0 ]; then + if [ "$nonvram" = 1 ]; then echo 1>&2 "$PRG: --bootonce specified, but nvsetenv not available." exit 1 fi if [ "$foundlabel" = 1 ]; then nvsetenv boot-once "$bootonce" foundlabel=`nvsetenv boot-once` - if [ "$foundlabel" != "boot-once=$bootonce" ]; then + if [ "$foundlabel" != "boot-once=$bootonce" -a \ + "$foundlabel" != "$bootonce" ]; then echo 1>&2 "$PRG: Could not nvsetenv boot-once $bootonce" exit 1 fi