Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1KUZVw-00005P-Ru for mharc-grub-devel@gnu.org; Sun, 17 Aug 2008 00:05:12 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KUZVv-00005K-Pl for grub-devel@gnu.org; Sun, 17 Aug 2008 00:05:11 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KUZVu-00004t-Ag for grub-devel@gnu.org; Sun, 17 Aug 2008 00:05:11 -0400 Received: from [199.232.76.173] (port=57297 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KUZVu-00004q-6w for grub-devel@gnu.org; Sun, 17 Aug 2008 00:05:10 -0400 Received: from ti-out-0910.google.com ([209.85.142.185]:20231) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KUZVt-0006et-Ed for grub-devel@gnu.org; Sun, 17 Aug 2008 00:05:09 -0400 Received: by ti-out-0910.google.com with SMTP id u5so640840tia.10 for ; Sat, 16 Aug 2008 21:05:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=sg9cOqkAkye5bqwn1kHSgs5OvSMLqQrY04NCqoLdhY0=; b=hgDHmvzlrZn4plHL6u5KCLbItXZK9H5H+djaaw0/B0TWnU5Q2BXeiCjS2oYBSJ7PmF uaQOT2/35oKpSS7t6HA8UOSnJ0/YSbnzL5CyE5gGloqENs/gkNnVZMmbrzQMVMHpPLJm jv2UmluAhuVWQi+0IlizEmnuL9nTqpue2ZO5c= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=p42SPFxuJ8i5NQPjyDNi2RT26yGaHWph0yugYp26DN5DSZEFnc3SCtZmSXot9vCZRe N94Kb6fOAgCUhqZiP0y5b9EokW1/Eo21/muwzMxns8EwEE4kvyZt8MHV99Jv8qDU2pIR mErH8XR7N9VLPScDflhryjOUeApmB0vfdEdLM= Received: by 10.110.90.9 with SMTP id n9mr4094034tib.22.1218945906857; Sat, 16 Aug 2008 21:05:06 -0700 (PDT) Received: by 10.110.16.5 with HTTP; Sat, 16 Aug 2008 21:05:06 -0700 (PDT) Message-ID: Date: Sun, 17 Aug 2008 12:05:06 +0800 From: Bean To: "The development of GRUB 2" In-Reply-To: <5BACA85F3C9C449AA54CC447C1E5D61D@hp2003> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <48A6FA9A.45473C.07156@m12-70.163.com> <5BACA85F3C9C449AA54CC447C1E5D61D@hp2003> X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 2) Subject: Re: [PATCH] romfs support for Grub2 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, 17 Aug 2008 04:05:11 -0000 Hi, On Sun, Aug 17, 2008 at 10:43 AM, y.volta wrote: > Hi, > > I made a small patch for grub2 using a romfs file ( zip compressing support ). there are 3 files added: > > -/commands/i386/pc/romfst.c command to mount a romfs image file. > -/fs/i386/pc/romfs.c fs and disk layer for romfs. > -/include/grub/i386/pc/romfs.h header file. > > usage: > grub>romfst /romfs.gz > grub>cat (rd)/readme.txt > > info > ------------------------------------------------------------ > i make this patch have two resources: the grub legancy romfs patch and the bean's pxe patch. > i get to know the pxe mod merged the disk&fs into a fs source file. this will make mod more simple to implement. > the romfst command will load the specify file to a new memory block. when user access (rd), the new files are ready for him. I think romfs support is not in grub legacy, do you mean some local patch of distro ? Also, code from grub legacy is not always compatible with grub2. To avoid legal issue, just don't import code from other source, write them from scratch. There is no need to add a command to mount the image, you can use loopback. Also, don't merge disk&fs, romfs should be a fs module, just like cpio. BTW, I notice that you define le32, but there is already a function to do the job: grub_le_to_cpu32. Also, you use global buffer blk_buf, this is very grub-legacy. In grub2, you should avoid it as much as possible, because it would have problem when accessing multiple file, try to place the buffer in local structure like grub_romfs_data. > limitations > ------------------------------------------------------------ > * this patch is for file only: if you want to use it on a disk/partition, we should improve it. > * grub_romfs_data *data, has not set to file->data - i used several global varibles to store releated stuffs. > > > well, this is just a work-able patch, not too professional. ;-) > > btw, i think the grub_dprintf should output to non-display device, this will make debuging more easier and comfort . i think the low-cost device is a com-port. for, now time virtual machine software has this legancy device full supported. > the freeldr coming with ReactOS have this kind of function (only display a string, but can do kernal debug also ) Please don't define new debug mechanism. grub_dprintf may not be the best, but it's already used through grub2, just keep it that way. Also, I notice that indentation is not right, grub2 use gnu style. If you're too lazy to reformat the code, you can run it through indent. -- Bean