From: Christoph Egger Subject: Re: [PATCH][TOOLS] libfsimage: make pygrub work on ufs Date: Tue, 10 Jun 2008 10:24:56 +0200 Message-ID: <200806101024.57045.Christoph.Egger@amd.com> References: <200806091559.45511.Christoph.Egger@amd.com> <20080609155033.GA28374@totally.trollied.org.uk> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: <20080609155033.GA28374@totally.trollied.org.uk> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com Cc: John Levon List-Id: xen-devel@lists.xenproject.org On Monday 09 June 2008 17:50:33 John Levon wrote: > On Mon, Jun 09, 2008 at 03:59:45PM +0200, Christoph Egger wrote: > > Attached patch makes pygrub work on ufs. > > > > @@ -32,8 +32,9 @@ > > #define SUPERBLOCK ((struct fs *)(FSYS_BUF + 0x2000)) > > #define INODE ((struct icommon *)(FSYS_BUF + 0x1000)) > > #define DIRENT (FSYS_BUF + 0x4000) > > +#define MAXBSIZE ((FSYS_BUFLEN - 0x4000) / 2) > > #define INDIRBLK1 ((grub_daddr32_t *)(FSYS_BUF + 0x4000)) /* 2+ indirb= lk=20 */=20 > > -#define INDIRBLK0 ((grub_daddr32_t *)(FSYS_BUF+ 0x6000)) /* 1st=20 indirect blk */ > > +#define INDIRBLK0 ((grub_daddr32_t *)(FSYS_BUF+ 0x4000 + MAXBSIZE)) /= *=20 1st indirect blk */ > > This is a no-op, right? No, FSYS_BUFLEN is used now which wasn't before. > I'm not sure why you made this change? It deals with differences between UFS implementations such as =46FSv1 and FFSv2. > > #define indirblk0 (*fsig_int1(ffi)) > > #define indirblk1 (*fsig_int2(ffi)) > > @@ -48,7 +49,8 @@ ufs_mount(fsi_file_t *ffi, const char *o > > { > > if (/*! IS_PC_SLICE_TYPE_SOLARIS(current_slice) || */ > > !devread(ffi, UFS_SBLOCK, 0, UFS_SBSIZE, (char *)SUPERBLOCK) || > > - SUPERBLOCK->fs_magic !=3D UFS_MAGIC) > > + SUPERBLOCK->fs_magic !=3D UFS_MAGIC || > > + MAXBSIZE < SUPERBLOCK->fs_bsize) > > return 0; > > And all this does is make the mount checks stricter? Right. Christoph =2D-=20 AMD Saxony, Dresden, Germany Operating System Research Center Legal Information: AMD Saxony Limited Liability Company & Co. KG Sitz (Gesch=E4ftsanschrift): Wilschdorfer Landstr. 101, 01109 Dresden, Deutschland Registergericht Dresden: HRA 4896 vertretungsberechtigter Komplement=E4r: AMD Saxony LLC (Sitz Wilmington, Delaware, USA) Gesch=E4ftsf=FChrer der AMD Saxony LLC: Dr. Hans-R. Deppe, Thomas McCoy