From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1NKcIT-0000sf-E0 for mharc-grub-devel@gnu.org; Tue, 15 Dec 2009 13:38:57 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NKcIS-0000qu-94 for grub-devel@gnu.org; Tue, 15 Dec 2009 13:38:56 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NKcIN-0000m8-Ru for grub-devel@gnu.org; Tue, 15 Dec 2009 13:38:55 -0500 Received: from [199.232.76.173] (port=42280 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NKcIN-0000m0-K7 for grub-devel@gnu.org; Tue, 15 Dec 2009 13:38:51 -0500 Received: from mail-fx0-f225.google.com ([209.85.220.225]:41032) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NKcIM-00032X-V2 for grub-devel@gnu.org; Tue, 15 Dec 2009 13:38:51 -0500 Received: by fxm25 with SMTP id 25so178260fxm.26 for ; Tue, 15 Dec 2009 10:38:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:references:in-reply-to :content-type; bh=exkqb5rB5mZpe+9WZamW3MqOq2Wj+3TwDcjbFSiOtXU=; b=ZIDxnh0BGlywznBaMauApq5LCKvZWlvjwQo3dYTXRm1km1SteLTrP31MyC0CqvXgs0 lMa1nujb2h+m4jJjh3pyDaBnw0DWSj4r8eb4UI6nHGAtSrRpjUat08M0dfmLyAnQmPsp O+yR4xBJvG52Mn+WGPJNP9IJfYtlWEfgh4sUo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type; b=JAFUc4TpIxNI5Ka9VoHGGmFQet7b0rZYYQtSRt+4nZOn+am5Bg4gBkpSJ27uojrwlJ uyUHO/IEd3LiBHArW8YIK/Rtf5rmipfCk8c2ex1jkDhvAxXJW2CU4W0sO+KPQblw63L7 FfWhKhahRlMDMg4Y5hzn/QajVX691AjSdwXEg= Received: by 10.223.59.3 with SMTP id j3mr657953fah.46.1260902328535; Tue, 15 Dec 2009 10:38:48 -0800 (PST) Received: from ?192.168.178.55? (p5B0CE880.dip.t-dialin.net [91.12.232.128]) by mx.google.com with ESMTPS id 13sm48001fxm.1.2009.12.15.10.38.46 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 15 Dec 2009 10:38:47 -0800 (PST) Message-ID: <4B27D7AF.1050108@googlemail.com> Date: Tue, 15 Dec 2009 19:38:39 +0100 From: Andreas Born User-Agent: Thunderbird 2.0.0.23 (X11/20090827) MIME-Version: 1.0 To: GRUB2 Devel References: <20091015-153848.sv74720.97143@savannah.gnu.org> <4B1C36F1.4000602@googlemail.com> In-Reply-To: <4B1C36F1.4000602@googlemail.com> Content-Type: multipart/mixed; boundary="------------010501030508050503030603" X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) Subject: Re: [bug #27710] variable type not exported into new context X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 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: Tue, 15 Dec 2009 18:38:56 -0000 This is a multi-part message in MIME format. --------------010501030508050503030603 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Seems like I completely forgot the diff here. Sorry, this time it is attached. Changelog: 2009-12-15 Andreas Born * kern/env.c (grub_env_context_open): Reapply global flag for variables exported to the new context. This behaviour can be really annoying. If one boots to the grub menu, chooses the shell with 'c', loads the menu again and drops to shell again (i.e. created 2 new contexts), prefix and root are gone. Although they are still exported into the first new context, they aren't marked again global in that context. Therefore creating another new context (from within the first context) doesn't export prefix and root from the 1st context to the second context. Of course, that has to happen as the global flag is not set in the first context. I created the new contexts by loading a grub.cfg which doesn't touch prefix and root with the configfile command. The patch changes the behaviour to not only export variables to the new context instead they are exported to the new context and then marked as global again with grub_env_export. Hope the issue is understandable like that. Otherwise please ask. Regards Andreas Andreas Born schrieb: > As of r1917 grub_env_context_open still doesn't mark exported > variables as global in the new context. > Attached patch exports them with grub_env_export in the new context. > > Andreas Born schrieb: >> URL: >> >> >> Summary: variable type not exported into new context >> Project: GNU GRUB >> Submitted by: shador >> Submitted on: Do 15 Okt 2009 15:38:48 GMT >> Category: Terminal >> Severity: Major >> Priority: 5 - Normal >> Item Group: Software Error >> Status: None >> Privacy: Public >> Assigned to: None >> Originator Name: Originator Email: >> Open/Closed: Open >> Discussion Lock: Any >> Release: Release: SVN >> Reproducibility: Every Time >> Planned Release: None >> >> _______________________________________________________ >> >> Details: >> >> A variable created and exported afterwards, isn't marked 'export' >> after a new >> context was created by issuing configfile. Thus if you issue another >> time >> configfile the variable is unset. >> This means recursive menus deeper than 2 menus are not possible by >> loading >> another configfile. >> >> Example: >> set blub=blob >> export blub >> configfile >> configfile >> echo $blub >> => nothing, blub was unset after the second configfile (prefix also so >> everything fails). >> >> Workaround: >> In every new context (-> every .cfg file) (re)export the variable (and >> prefix, root). >> >> Attached is a patch which marks variables copied into the new context >> again >> 'export' preventing breakage of prefix and root. >> >> >> >> _______________________________________________________ >> >> File Attachments: >> >> >> ------------------------------------------------------- >> Date: Do 15 Okt 2009 15:38:48 GMT Name: export-context.diff Size: >> 359B By: shador >> >> >> >> _______________________________________________________ >> >> Reply to this item at: >> >> >> >> _______________________________________________ >> Nachricht geschickt von/durch Savannah >> http://savannah.gnu.org/ >> >> > --------------010501030508050503030603 Content-Type: text/x-patch; name="export-context.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="export-context.diff" === modified file 'kern/env.c' --- kern/env.c 2009-07-16 22:14:09 +0000 +++ kern/env.c 2009-11-29 00:15:05 +0000 @@ -101,6 +101,7 @@ grub_env_context_close (); return grub_errno; } + grub_env_export (var->name); grub_register_variable_hook (var->name, var->read_hook, var->write_hook); } } --------------010501030508050503030603--