diff options
author | Keir Fraser <keir.fraser@citrix.com> | 2008-06-09 15:06:26 +0100 |
---|---|---|
committer | Keir Fraser <keir.fraser@citrix.com> | 2008-06-09 15:06:26 +0100 |
commit | e6d935117073dcf8d5123f2c5be49897e98a549f (patch) | |
tree | 8922b5274ee91a8a78c0e59f28191fff2d0e8bbf /tools | |
parent | 250c8bc01c71064d8966f467c471584c14065fa3 (diff) | |
download | xen-e6d935117073dcf8d5123f2c5be49897e98a549f.tar.gz xen-e6d935117073dcf8d5123f2c5be49897e98a549f.tar.bz2 xen-e6d935117073dcf8d5123f2c5be49897e98a549f.zip |
libfsimage: make pygrub work on ufs
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/libfsimage/ufs/fsys_ufs.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/tools/libfsimage/ufs/fsys_ufs.c b/tools/libfsimage/ufs/fsys_ufs.c index a92a6e5307..4d6db3689e 100644 --- a/tools/libfsimage/ufs/fsys_ufs.c +++ b/tools/libfsimage/ufs/fsys_ufs.c @@ -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 *options) { 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; |