grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: bugfix, hostfs


From: Tomas Ebenlendr
Subject: Re: bugfix, hostfs
Date: Sun, 8 Aug 2004 20:17:20 +0200
User-agent: Mutt/1.5.6i

> address@hidden (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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]