From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1J6mut-0006de-HD for mharc-grub-devel@gnu.org; Mon, 24 Dec 2007 08:00:23 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1J6mur-0006bW-UW for grub-devel@gnu.org; Mon, 24 Dec 2007 08:00:22 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1J6mun-0006Vx-Ig for grub-devel@gnu.org; Mon, 24 Dec 2007 08:00:20 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1J6mum-0006V5-Jg for grub-devel@gnu.org; Mon, 24 Dec 2007 08:00:17 -0500 Received: from aybabtu.com ([69.60.117.155]) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1J6mul-0006nN-70 for grub-devel@gnu.org; Mon, 24 Dec 2007 08:00:16 -0500 Received: from [192.168.10.6] (helo=thorin) by aybabtu.com with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.63) (envelope-from ) id 1J6muj-0003zO-2c for grub-devel@gnu.org; Mon, 24 Dec 2007 14:00:13 +0100 Received: from rmh by thorin with local (Exim 4.63) (envelope-from ) id 1J6muP-00066C-1G for grub-devel@gnu.org; Mon, 24 Dec 2007 13:59:53 +0100 Date: Mon, 24 Dec 2007 13:59:53 +0100 From: Robert Millan To: The development of GRUB 2 Message-ID: <20071224125952.GA23228@thorin> References: <20071223214851.GB28105@thorin> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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] cpio and tar filesystem 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: Mon, 24 Dec 2007 13:00:22 -0000 On Mon, Dec 24, 2007 at 12:40:06PM +0800, Bean wrote: > On Dec 24, 2007 5:48 AM, Robert Millan 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 > > * 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 I know my rights; I want my phone call! What use is a phone call, if you are unable to speak? (as seen on /.)