Received: from mailman by lists.gnu.org with archive (Exim 4.33) id 1BtsIb-0001sb-R6 for mharc-grub-devel@gnu.org; Sun, 08 Aug 2004 14:21:37 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1BtsIa-0001sJ-9v for grub-devel@gnu.org; Sun, 08 Aug 2004 14:21:36 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1BtsIZ-0001rg-FX for grub-devel@gnu.org; Sun, 08 Aug 2004 14:21:36 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1BtsIZ-0001rd-DE for grub-devel@gnu.org; Sun, 08 Aug 2004 14:21:35 -0400 Received: from [195.113.31.125] (helo=artax.karlin.mff.cuni.cz) by monty-python.gnu.org with esmtp (Exim 4.34) id 1BtsET-00082u-Nc for grub-devel@gnu.org; Sun, 08 Aug 2004 14:17:22 -0400 Received: by artax.karlin.mff.cuni.cz (Postfix, from userid 17122) id C663842E0; Sun, 8 Aug 2004 20:17:20 +0200 (CEST) Date: Sun, 8 Aug 2004 20:17:20 +0200 To: The development of GRUB 2 Message-ID: <20040808181720.GA14939@artax.karlin.mff.cuni.cz> Mail-Followup-To: The development of GRUB 2 References: <20040808173040.GA11531@artax.karlin.mff.cuni.cz> <87smaxldbe.fsf@marco.marco-g.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87smaxldbe.fsf@marco.marco-g.com> User-Agent: Mutt/1.5.6i From: ebik@artax.karlin.mff.cuni.cz (Tomas Ebenlendr) Subject: Re: bugfix, hostfs 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, 08 Aug 2004 18:21:36 -0000 > ebik@artax.karlin.mff.cuni.cz (Tomas Ebenlendr) writes: > > > I'm thinkig about module loading in grub-emu (now I'm exploring dl.c, ld > > and so on) and as side efect I wrote access to host filesystem for grub. > > This also discovered a bug in dl.c which occur when 'normal.mod' exists, > > but cannot be loaded. > > Nice! Thanks for your patches. > > Why do you need hostfs for this? I think hostfs can be really useful > to me for debugging etc., but is it required for module loading? > Anyway, it would be really useful for me when I am writing filesystem > implementations. I don't *need* it, it is just comfortable way to access files from grub-emu. I also don't *need* to load modules in grub-emu, but if it will be easy and not user-confusing, it will make easier solving some problems. > Most comments are still about the GCS. Hmm, I wrote the patch for myself, and then I forgot to read it carefully. So I'm sory for inconvenient code. > > +#ifndef GRUB_UTIL > > +#error cannot live outside host fs > > +#endif > > I think there is no need to do this. > Maybe. I'm just used to write in files that shouldn't be ported to other "parts" of software that they can't be ported. > > + if ((signed) device->disk->id != -2) { > > What is -2? > Oh, sorry. Just a magic constant. Probably there should be better identification (e.g. magic device->disk->data (e.g. device->disk == device->disk->data)). This identification is used in hostfs_mount() > > > + grub_strncpy(pathbuf,path,/*FIXME*/2048 - 1); > > Why do you use pathbuf? Can't you just use path directly? If that is > not possible use MAX_PATH_LEN here when it is defined and dynamic > memory allocation otherwise (when there is no limit). > I concatenate path of directory and its entries to stat them. I will use the MAX_PATH_LEN. I only forgot that I forgot the name of this constant. (Uh). Thanks for comments. I will read the patch more carefuly and I will try to make the code 'nice'. -- Tomas 'ebi' Ebenlendr http://get.to/ebik PF 2004.60337551862