From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1EVBfT-0003Ob-VD for mharc-grub-devel@gnu.org; Thu, 27 Oct 2005 13:36:00 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1EVBfT-0003OI-1k for grub-devel@gnu.org; Thu, 27 Oct 2005 13:35:59 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1EVBfQ-0003NA-TS for grub-devel@gnu.org; Thu, 27 Oct 2005 13:35:58 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EVBfQ-0003Mz-Dk for grub-devel@gnu.org; Thu, 27 Oct 2005 13:35:56 -0400 Received: from [66.249.82.202] (helo=xproxy.gmail.com) by monty-python.gnu.org with esmtp (Exim 4.34) id 1EVBfQ-0006pt-Dh for grub-devel@gnu.org; Thu, 27 Oct 2005 13:35:56 -0400 Received: by xproxy.gmail.com with SMTP id s8so18068wxc for ; Thu, 27 Oct 2005 10:35:55 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:disposition-notification-to:date:from:user-agent:x-accept-language:mime-version:to:subject:references:in-reply-to:content-type:content-transfer-encoding; b=b7SEysrtbb11+LCAysyrKQFMZ3SVigeYqg5pGTSTrYVSDTVu4AS/hdExvP82NJgHIZ/ZeT5t8zjuKpH/qQaseaenP0sEx+TgjPDrTG/+H9NGR/v9akbMqz8dOAbUAlKaIPo3OMO3K10EHyXHj2jZYRMzxCbtBbROmUKWK4gSFPc= Received: by 10.65.110.4 with SMTP id n4mr1821454qbm; Thu, 27 Oct 2005 10:35:55 -0700 (PDT) Received: from ?192.168.1.100? ( [83.77.226.117]) by mx.gmail.com with ESMTP id q19sm602858qbq.2005.10.27.10.35.54; Thu, 27 Oct 2005 10:35:55 -0700 (PDT) Message-ID: <43610FFA.3010407@gmail.com> Date: Thu, 27 Oct 2005 19:35:54 +0200 From: Vladimir Serbinenko User-Agent: Mozilla Thunderbird 1.0.6 (X11/20050804) X-Accept-Language: en-us, en MIME-Version: 1.0 To: The development of GRUB 2 References: <20051027120427.19262.qmail@web53006.mail.yahoo.com> <87k6fyopyr.fsf@student.han.nl> In-Reply-To: <87k6fyopyr.fsf@student.han.nl> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: Automatic backup with grub X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Oct 2005 17:35:59 -0000 > >So what needs to be done is place an image back once in a while. It >should be possible to create a GRUB command for that, I guess. :-) > > Why a command? A better way, IMO, is using some variables stored in file. It could be presented as array SAVED_INTEGER of integers and SAVED_FLAGS of flags. Then with command initsaved where must be created from OS (what about a tool or shell script?) then initsaved /grub2/savedvars if [[ SAVED_INTEGER[0] -ge 10]]; then defwin = ""; defrest="--default"; else defwin = "--default"; defrest=""; fi menu $defwin windows { ... # Load windows ((SAVED_INTEGER[0]++)); } menu $defrest restore windows { ... # Restore windows SAVED_INTEGER[0]=0; } menu reset counter { SAVED_INTEGER[0]=0; } timeout=10; In this way first 10 times $defwin expands to --default and "Load windows" becomes default. Afterwards $defrest expands to --default and "restore windows" becomes default Vladimir 'phcoder' Serbinenko