From: Christoph Egger Subject: [PATCH][TOOLS] libfsimage: make pygrub work on ufs Date: Mon, 9 Jun 2008 15:59:45 +0200 Message-ID: <200806091559.45511.Christoph.Egger@amd.com> Mime-Version: 1.0 Content-Type: Multipart/Mixed; boundary="Boundary-00=_RdTTI7Dwi2YUhnQ" Return-path: 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 List-Id: xen-devel@lists.xenproject.org --Boundary-00=_RdTTI7Dwi2YUhnQ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Hi! Attached patch makes pygrub work on ufs. Signed-off-by: Christoph Egger =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 --Boundary-00=_RdTTI7Dwi2YUhnQ Content-Type: text/x-diff; charset="us-ascii"; name="fsimage_ufs.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="fsimage_ufs.diff" diff -r b320cfe1f10f tools/libfsimage/ufs/fsys_ufs.c --- a/tools/libfsimage/ufs/fsys_ufs.c Thu Jun 05 13:04:07 2008 +0100 +++ b/tools/libfsimage/ufs/fsys_ufs.c Fri Jun 06 15:56:08 2008 +0200 @@ -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+ indir blk */ -#define INDIRBLK0 ((grub_daddr32_t *)(FSYS_BUF+ 0x6000)) /* 1st indirect blk */ +#define INDIRBLK0 ((grub_daddr32_t *)(FSYS_BUF+ 0x4000 + MAXBSIZE)) /* 1st indirect blk */ #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 != UFS_MAGIC) + SUPERBLOCK->fs_magic != UFS_MAGIC || + MAXBSIZE < SUPERBLOCK->fs_bsize) return 0; return 1; --Boundary-00=_RdTTI7Dwi2YUhnQ Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --Boundary-00=_RdTTI7Dwi2YUhnQ--