From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1K7sFT-00062i-Mh for mharc-grub-devel@gnu.org; Sun, 15 Jun 2008 09:26:23 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1K7sFQ-000609-UQ for grub-devel@gnu.org; Sun, 15 Jun 2008 09:26:20 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1K7sFP-0005yw-Lt for grub-devel@gnu.org; Sun, 15 Jun 2008 09:26:20 -0400 Received: from [199.232.76.173] (port=50563 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1K7sFP-0005yt-Ed for grub-devel@gnu.org; Sun, 15 Jun 2008 09:26:19 -0400 Received: from aybabtu.com ([69.60.117.155]:43204) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1K7sFP-0005pp-9Y for grub-devel@gnu.org; Sun, 15 Jun 2008 09:26:19 -0400 Received: from [192.168.10.10] (helo=thorin) by aybabtu.com with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.63) (envelope-from ) id 1K7sDJ-0006n3-Ec for grub-devel@gnu.org; Sun, 15 Jun 2008 15:24:10 +0200 Received: from rmh by thorin with local (Exim 4.63) (envelope-from ) id 1K7sEy-0004Va-Qi for grub-devel@gnu.org; Sun, 15 Jun 2008 15:25:52 +0200 Date: Sun, 15 Jun 2008 15:25:52 +0200 From: Robert Millan To: The development of GRUB 2 Message-ID: <20080615132552.GA17222@thorin> References: <20080614193028.GB840@thorin> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Organization: free as in freedom X-Message-Flag: Worried about Outlook viruses? Switch to Thunderbird! www.mozilla.com/thunderbird X-Debbugs-No-Ack: true User-Agent: Mutt/1.5.13 (2006-08-11) X-detected-kernel: by monty-python.gnu.org: Genre and OS details not recognized. Subject: Re: [PATCH] Save/Load environment variable support 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: Sun, 15 Jun 2008 13:26:21 -0000 On Sun, Jun 15, 2008 at 03:44:56AM +0800, Bean wrote: > >> +#define grub_strlen strlen > >> +#define grub_strcpy strcpy > >> +#define grub_strchr strchr > >> +#define grub_memcmp memcmp > >> +#define grub_memcpy memcpy > > > > Uhm can we avoid this? The rest of non-util code just calls the grub_* > > functions (linking with kern/misc.c in this case). > > I fount out that if I use grub_*, I end up adding quite a few of extra > modules that serve no purpose other than string manipulation. Perhaps > we should separate those routines from kern/misc.c ? Which modules? If these functions are part of kernel, they shouldn't be dragging modules in, AFAICT. > >> + for (len = GRUB_ENVBLK_MAXLEN - 6; len > 0; len -= 4, pd++) > >> + if (*pd == GRUB_ENVBLK_SIGNATURE) > > > > I wonder if this would be dangerous when run on files where env block > > presence is optional, like core.img (though we can always think about this > > later when that option is added). > > Yes, perhaps we should store a pointer to environment block so that we > don't need to scan for it. If the env block could have variable length (in core.img, not the filesystem one), then maybe a zero-length block could be embedded unconditionaly. -- Robert Millan I know my rights; I want my phone call! What good is a phone call… if you are unable to speak? (as seen on /.)