grub-devel
[Top][All Lists]
Advanced

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

Re: [PATCH] cpio and tar filesystem


From: Robert Millan
Subject: Re: [PATCH] cpio and tar filesystem
Date: Mon, 24 Dec 2007 13:59:53 +0100
User-agent: Mutt/1.5.13 (2006-08-11)

On Mon, Dec 24, 2007 at 12:40:06PM +0800, Bean wrote:
> On Dec 24, 2007 5:48 AM, Robert Millan <address@hidden> wrote:
> >Perhaps it'd be a good idea to move the arch-independant part of
> >grub_emu_SOURCES to common.rmk (as grub_emu_SOURCES += foo), to avoid
> >having to update all the files so often ...
> 
> yes, but i think it should be in a separate patch.

Agreed.

> > Btw, this line seems to be the same on both cases.  It can be moved out of
> > `if (data->mode == MODE_BCPIO)' to save some space?
> >
> 
> In fact, it's not the same, in the first case, hd is of type
> HEAD_BCPIO, while in the second case, hd is of type HEAD_USTAR.The two
> structure has different size.

Ah, right.

> > > +      if (hd.namesize & 1)
> > > +        hd.namesize++;
> > > [...]
> > > +      if (data->size & 1)
> > > +        (*ofs)++;
> >
> > I find this confusing.  AFAICT `hd.namesize == 1' would archieve the same 
> > and
> > seems to be more consistent with your use of this variable as a counter.
> >
> When the name size is odd number, cpio pad another byte to make it
> word align, and the same apply to file size. However, I want to keep
> the original file size, so it use (*ofs)++ instead of data->size++.

Ok.

> > Are you sure these are still needed?  We have a few modules that use them 
> > but
> > AFAIK are not necessary at this time.
> 
> This is needed, the my_mod variable is used to stored the module
> pointer, and we need it to increase the module reference when a file
> is opened, so that the modules can't be unloaded.
> 
> Here is the new patch.
> 
> 2007-12-24  Bean  <address@hidden>
> 
>       * conf/common.rmk (pkgdata_MODULES): Add cpio.mod.
>       (cpio_mod_SOURCES): New variable.
>       (cpio_mod_CFLAGS): Likewise.
>       (cpio_mod_LDFLAGS): Likewise.
> 
>       * fs/cpio.c: New file.
> 
>       * conf/i386-pc.rmk (grub_emu_SOURCES): Add cpio.c.
> 
>       * conf/i386-efi.rmk (grub_emu_SOURCES): Likewise.
> 
>       * conf/i386-linuxbios.rmk (grub_emu_SOURCES): Likewise.
> 
>       * conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Likewise.

Looks good to me.  If nobody has any objection, I'll check this in.

-- 
Robert Millan

<GPLv2> I know my rights; I want my phone call!
<DRM> What use is a phone call, if you are unable to speak?
(as seen on /.)




reply via email to

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