From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1Llqi9-0007Vf-Rw for mharc-grub-devel@gnu.org; Mon, 23 Mar 2009 16:25:29 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Llqi8-0007UF-4A for grub-devel@gnu.org; Mon, 23 Mar 2009 16:25:28 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Llqi7-0007TU-7U for grub-devel@gnu.org; Mon, 23 Mar 2009 16:25:27 -0400 Received: from [199.232.76.173] (port=59578 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Llqi7-0007TE-1E for grub-devel@gnu.org; Mon, 23 Mar 2009 16:25:27 -0400 Received: from fg-out-1718.google.com ([72.14.220.158]:28013) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Llqi6-00026Y-LW for grub-devel@gnu.org; Mon, 23 Mar 2009 16:25:26 -0400 Received: by fg-out-1718.google.com with SMTP id 19so621840fgg.7 for ; Mon, 23 Mar 2009 13:25:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:content-type :content-transfer-encoding; bh=/qY29i4MCS9r+V3F/cRWekBh0DRB/sKlPdCmfys3gdg=; b=IOIHsaoQ778zl61/eNpEsOnJniwFLdOoMpKQ6slxiAbAlJ4eelSL++c3pmxA68WRp3 F3dPWxY4909FbewUelj/SQS1Rlu0Z3zLyGKRpJ1Qfsx6Hd46plEkvnqoZAgNsCAliJvH Bw58Uqa9ALsDnMvBgEgx5kfW0SJt1Hh+SLKzo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject :content-type:content-transfer-encoding; b=jcUleO4SqMKaIFPlw6UjlA0aCHqoCk6Ws/oc/1574yP5EbhIpgCrcXyjivBvegUE74 Wrruf/VxgcEz3eryBEbr2Abj6aTtAazb78tjJL7zZ4QY+z3cdEHiS4IqnSIsbVEunre5 4NjaM5woCSVwfgCFSKTrHwO7WS/g68s8XcSSs= Received: by 10.86.86.2 with SMTP id j2mr3021966fgb.74.1237839925631; Mon, 23 Mar 2009 13:25:25 -0700 (PDT) Received: from ?192.168.1.2? (173-122.3-85.cust.bluewin.ch [85.3.122.173]) by mx.google.com with ESMTPS id l19sm3801505fgb.26.2009.03.23.13.25.24 (version=SSLv3 cipher=RC4-MD5); Mon, 23 Mar 2009 13:25:25 -0700 (PDT) Message-ID: <49C7F035.1090101@gmail.com> Date: Mon, 23 Mar 2009 21:25:25 +0100 From: phcoder User-Agent: Thunderbird 2.0.0.21 (X11/20090318) MIME-Version: 1.0 To: The development of GRUB 2 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) Subject: [Design] savedefault 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: Mon, 23 Mar 2009 20:25:28 -0000 Hello we had a discussion on IRC about implementing savedefault. We've found 3 possible solutions: 1) just add support for it in grub-mkimage in following way: load_env menuentry "menu entry 1" { default=0 save_env .... } menuentry "menu entry 2" { default=1 save_env .... } This method has disadvantage of the necessity of counting entries in grub-mkconfig. This is easily broken OS-specific script count entries wrong. Also it breaks if user adds entries manually in the middle of the file 2) Export a variable selected_menu. Then syntax would be sth like load_env menuentry "menu entry 1" { default=$selected_menu save_env .... } menuentry "menu entry 2" { default=$selected_menu save_env .... } 3) Add label support syntax would be sth like: default=ubuntu menuentry --label ubuntu "Ubuntu" { .... } And for savedefault it would be something like load_env menuentry --label linux_ "Linux" { default=linux_ save_env .... } -- Regards Vladimir 'phcoder' Serbinenko