[oe] [PATCH] grub 0.97: fixing broken 256byte-inodes patch

Michal Minar i at minami.cz
Wed Sep 1 15:57:39 UTC 2010


 * original patch causes termination of grub with floating point exception,
   when operating upon ext2 partitions
 * the bug description came from:
   http://bugs.gentoo.org/show_bug.cgi?id=220687
 * fixed patch was done by RB <aoz.syn at gmail.com>

Signed-off-by: Michal Minar <i at minami.cz>
---
 .../grub/grub-0.97/grub-support-256byte-inode.diff |   21 ++++++++++++-------
 1 files changed, 13 insertions(+), 8 deletions(-)

diff --git a/recipes/grub/grub-0.97/grub-support-256byte-inode.diff b/recipes/grub/grub-0.97/grub-support-256byte-inode.diff
index bef3bc1..caaf9d6 100644
--- a/recipes/grub/grub-0.97/grub-support-256byte-inode.diff
+++ b/recipes/grub/grub-0.97/grub-support-256byte-inode.diff
@@ -1,7 +1,7 @@
-diff -Nrup a/stage2/fsys_ext2fs.c b/stage2/fsys_ext2fs.c
---- a/stage2/fsys_ext2fs.c	2004-08-08 20:19:18.000000000 +0200
-+++ b/stage2/fsys_ext2fs.c	2008-01-30 14:27:20.000000000 +0100
-@@ -79,7 +79,52 @@ struct ext2_super_block
+diff -Naur grub-0.97-800/stage2/fsys_ext2fs.c grub-0.97-810/stage2/fsys_ext2fs.c
+--- grub-0.97-800/stage2/fsys_ext2fs.c	2008-07-21 00:40:21.668879475 -0600
++++ grub-0.97-810/stage2/fsys_ext2fs.c	2008-07-21 01:01:11.063953773 -0600
+@@ -79,7 +79,52 @@
      __u32 s_rev_level;		/* Revision level */
      __u16 s_def_resuid;		/* Default uid for reserved blocks */
      __u16 s_def_resgid;		/* Default gid for reserved blocks */
@@ -55,17 +55,22 @@ diff -Nrup a/stage2/fsys_ext2fs.c b/stage2/fsys_ext2fs.c
    };
  
  struct ext2_group_desc
-@@ -218,6 +263,9 @@ struct ext2_dir_entry
+@@ -218,6 +263,14 @@
  #define EXT2_ADDR_PER_BLOCK(s)          (EXT2_BLOCK_SIZE(s) / sizeof (__u32))
  #define EXT2_ADDR_PER_BLOCK_BITS(s)		(log2(EXT2_ADDR_PER_BLOCK(s)))
  
-+#define EXT2_INODE_SIZE(s)		(SUPERBLOCK->s_inode_size)
++#define EXT2_GOOD_OLD_REV   0   /* The good old (original) format */
++#define EXT2_DYNAMIC_REV    1   /* V2 format w/ dynamic inode sizes */
++#define EXT2_GOOD_OLD_INODE_SIZE 128
++#define EXT2_INODE_SIZE(s)  (((s)->s_rev_level == EXT2_GOOD_OLD_REV) ? \
++                 EXT2_GOOD_OLD_INODE_SIZE : \
++                 (s)->s_inode_size)
 +#define EXT2_INODES_PER_BLOCK(s)	(EXT2_BLOCK_SIZE(s)/EXT2_INODE_SIZE(s))
 +
  /* linux/ext2_fs.h */
  #define EXT2_BLOCK_SIZE_BITS(s)        ((s)->s_log_block_size + 10)
  /* kind of from ext2/super.c */
-@@ -553,7 +601,7 @@ ext2fs_dir (char *dirname)
+@@ -553,7 +606,7 @@
        gdp = GROUP_DESC;
        ino_blk = gdp[desc].bg_inode_table +
  	(((current_ino - 1) % (SUPERBLOCK->s_inodes_per_group))
@@ -74,7 +79,7 @@ diff -Nrup a/stage2/fsys_ext2fs.c b/stage2/fsys_ext2fs.c
  #ifdef E2DEBUG
        printf ("inode table fsblock=%d\n", ino_blk);
  #endif /* E2DEBUG */
-@@ -565,13 +613,12 @@ ext2fs_dir (char *dirname)
+@@ -565,13 +618,12 @@
        /* reset indirect blocks! */
        mapblock2 = mapblock1 = -1;
  
-- 
1.7.2.2





More information about the Openembedded-devel mailing list