* [Buildroot] [PATCH 2/2] grub: fix ext2 segfaults
@ 2011-08-21 16:52 Darius Augulis
2011-09-04 12:21 ` Darius Augulis
0 siblings, 1 reply; 2+ messages in thread
From: Darius Augulis @ 2011-08-21 16:52 UTC (permalink / raw)
To: buildroot
Fix grub issue when loading stage2 from ext2.
The symptom is periodically rebooting system.
This fix is borrowed from *somewhere* but it
does the job.
Signed-off-by: Darius Augulis <augulis.darius@gmail.com>
---
boot/grub/grub.600-ext2-fix.patch | 32 ++++++++++++++++++++++++++++++++
1 files changed, 32 insertions(+), 0 deletions(-)
create mode 100644 boot/grub/grub.600-ext2-fix.patch
diff --git a/boot/grub/grub.600-ext2-fix.patch b/boot/grub/grub.600-ext2-fix.patch
new file mode 100644
index 0000000..8bbd199
--- /dev/null
+++ b/boot/grub/grub.600-ext2-fix.patch
@@ -0,0 +1,32 @@
+diff -uprN grub-0.97-orig//debian/patches/00list grub-0.97/debian/patches/00list
+--- grub-0.97-orig//debian/patches/00list 2011-08-21 17:08:01.651441450 +0300
++++ grub-0.97/debian/patches/00list 2011-08-21 17:13:11.712978964 +0300
+@@ -24,6 +24,7 @@ crossreference_manpages.diff
+ ext3_256byte_inode.diff
+ use_grub-probe_in_grub-install.diff
+ 128gib_disk_limit.diff
++ext2_fix.diff
+
+ # We aren't building amd64 binaries, see #244498
+ #fix_amd64_compile.diff
+diff -uprN grub-0.97-orig//debian/patches/ext2_fix.diff grub-0.97/debian/patches/ext2_fix.diff
+--- grub-0.97-orig//debian/patches/ext2_fix.diff 1970-01-01 03:00:00.000000000 +0300
++++ grub-0.97/debian/patches/ext2_fix.diff 2011-08-21 17:12:10.088673380 +0300
+@@ -0,0 +1,17 @@
++diff -uprN grub-0.97-orig//stage2/fsys_ext2fs.c grub-0.97/stage2/fsys_ext2fs.c
++--- grub-0.97-orig//stage2/fsys_ext2fs.c 2011-08-21 17:08:01.647441447 +0300
+++++ grub-0.97/stage2/fsys_ext2fs.c 2011-08-21 17:11:05.312352171 +0300
++@@ -263,7 +263,12 @@ struct ext2_dir_entry
++ #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 */
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [Buildroot] [PATCH 2/2] grub: fix ext2 segfaults
2011-08-21 16:52 [Buildroot] [PATCH 2/2] grub: fix ext2 segfaults Darius Augulis
@ 2011-09-04 12:21 ` Darius Augulis
0 siblings, 0 replies; 2+ messages in thread
From: Darius Augulis @ 2011-09-04 12:21 UTC (permalink / raw)
To: buildroot
On 08/21/2011 07:52 PM, Darius Augulis wrote:
> Fix grub issue when loading stage2 from ext2.
> The symptom is periodically rebooting system.
> This fix is borrowed from *somewhere* but it
> does the job.
Hi all,
please review this patch and merge if it's ok.
Thanks.
Darius A.
>
> Signed-off-by: Darius Augulis<augulis.darius@gmail.com>
> ---
> boot/grub/grub.600-ext2-fix.patch | 32 ++++++++++++++++++++++++++++++++
> 1 files changed, 32 insertions(+), 0 deletions(-)
> create mode 100644 boot/grub/grub.600-ext2-fix.patch
>
> diff --git a/boot/grub/grub.600-ext2-fix.patch b/boot/grub/grub.600-ext2-fix.patch
> new file mode 100644
> index 0000000..8bbd199
> --- /dev/null
> +++ b/boot/grub/grub.600-ext2-fix.patch
> @@ -0,0 +1,32 @@
> +diff -uprN grub-0.97-orig//debian/patches/00list grub-0.97/debian/patches/00list
> +--- grub-0.97-orig//debian/patches/00list 2011-08-21 17:08:01.651441450 +0300
> ++++ grub-0.97/debian/patches/00list 2011-08-21 17:13:11.712978964 +0300
> +@@ -24,6 +24,7 @@ crossreference_manpages.diff
> + ext3_256byte_inode.diff
> + use_grub-probe_in_grub-install.diff
> + 128gib_disk_limit.diff
> ++ext2_fix.diff
> +
> + # We aren't building amd64 binaries, see #244498
> + #fix_amd64_compile.diff
> +diff -uprN grub-0.97-orig//debian/patches/ext2_fix.diff grub-0.97/debian/patches/ext2_fix.diff
> +--- grub-0.97-orig//debian/patches/ext2_fix.diff 1970-01-01 03:00:00.000000000 +0300
> ++++ grub-0.97/debian/patches/ext2_fix.diff 2011-08-21 17:12:10.088673380 +0300
> +@@ -0,0 +1,17 @@
> ++diff -uprN grub-0.97-orig//stage2/fsys_ext2fs.c grub-0.97/stage2/fsys_ext2fs.c
> ++--- grub-0.97-orig//stage2/fsys_ext2fs.c 2011-08-21 17:08:01.647441447 +0300
> +++++ grub-0.97/stage2/fsys_ext2fs.c 2011-08-21 17:11:05.312352171 +0300
> ++@@ -263,7 +263,12 @@ struct ext2_dir_entry
> ++ #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 */
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-09-04 12:21 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-08-21 16:52 [Buildroot] [PATCH 2/2] grub: fix ext2 segfaults Darius Augulis
2011-09-04 12:21 ` Darius Augulis
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox