summaryrefslogtreecommitdiffstats
path: root/meta/recipes-bsp/grub
diff options
context:
space:
mode:
authorJack Mitchell <jmitchell@cbnl.com>2013-10-14 10:55:59 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-10-18 15:49:56 +0100
commit8bfa6d96e77b1c9b39755df72ce834fb57534963 (patch)
tree9f65cb45d7ef50569e837929058a5a45e7661bf1 /meta/recipes-bsp/grub
parent88a8e96f8f3a39535fe75861e0756571ac307cc2 (diff)
downloadpoky-8bfa6d96e77b1c9b39755df72ce834fb57534963.tar.gz
grub: add patch to support 256 byte inodes
This patch is originally from oe-classic, it seemed to have been dropped in the transition for some reason. However I needed this patch to boot a system with 256 byte inodes. (From OE-Core rev: f36fd55e8721559dee2e9b57930cd3962958ba9e) Signed-off-by: Jack Mitchell <jmitchell@cbnl.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-bsp/grub')
-rw-r--r--meta/recipes-bsp/grub/grub-0.97/grub-support-256byte-inode.patch101
-rw-r--r--meta/recipes-bsp/grub/grub_0.97.bb11
2 files changed, 107 insertions, 5 deletions
diff --git a/meta/recipes-bsp/grub/grub-0.97/grub-support-256byte-inode.patch b/meta/recipes-bsp/grub/grub-0.97/grub-support-256byte-inode.patch
new file mode 100644
index 0000000000..d225d13dce
--- /dev/null
+++ b/meta/recipes-bsp/grub/grub-0.97/grub-support-256byte-inode.patch
@@ -0,0 +1,101 @@
1Upstream-Status: Inappropriate [No Longer Maintained]
2
3diff -Naur grub-0.97-800/stage2/fsys_ext2fs.c grub-0.97-810/stage2/fsys_ext2fs.c
4--- grub-0.97-800/stage2/fsys_ext2fs.c 2008-07-21 00:40:21.668879475 -0600
5+++ grub-0.97-810/stage2/fsys_ext2fs.c 2008-07-21 01:01:11.063953773 -0600
6@@ -79,7 +79,52 @@
7 __u32 s_rev_level; /* Revision level */
8 __u16 s_def_resuid; /* Default uid for reserved blocks */
9 __u16 s_def_resgid; /* Default gid for reserved blocks */
10- __u32 s_reserved[235]; /* Padding to the end of the block */
11+ /*
12+ * These fields are for EXT2_DYNAMIC_REV superblocks only.
13+ *
14+ * Note: the difference between the compatible feature set and
15+ * the incompatible feature set is that if there is a bit set
16+ * in the incompatible feature set that the kernel doesn't
17+ * know about, it should refuse to mount the filesystem.
18+ *
19+ * e2fsck's requirements are more strict; if it doesn't know
20+ * about a feature in either the compatible or incompatible
21+ * feature set, it must abort and not try to meddle with
22+ * things it doesn't understand...
23+ */
24+ __u32 s_first_ino; /* First non-reserved inode */
25+ __u16 s_inode_size; /* size of inode structure */
26+ __u16 s_block_group_nr; /* block group # of this superblock */
27+ __u32 s_feature_compat; /* compatible feature set */
28+ __u32 s_feature_incompat; /* incompatible feature set */
29+ __u32 s_feature_ro_compat; /* readonly-compatible feature set */
30+ __u8 s_uuid[16]; /* 128-bit uuid for volume */
31+ char s_volume_name[16]; /* volume name */
32+ char s_last_mounted[64]; /* directory where last mounted */
33+ __u32 s_algorithm_usage_bitmap; /* For compression */
34+ /*
35+ * Performance hints. Directory preallocation should only
36+ * happen if the EXT2_FEATURE_COMPAT_DIR_PREALLOC flag is on.
37+ */
38+ __u8 s_prealloc_blocks; /* Nr of blocks to try to preallocate*/
39+ __u8 s_prealloc_dir_blocks; /* Nr to preallocate for dirs */
40+ __u16 s_reserved_gdt_blocks;/* Per group table for online growth */
41+ /*
42+ * Journaling support valid if EXT2_FEATURE_COMPAT_HAS_JOURNAL set.
43+ */
44+ __u8 s_journal_uuid[16]; /* uuid of journal superblock */
45+ __u32 s_journal_inum; /* inode number of journal file */
46+ __u32 s_journal_dev; /* device number of journal file */
47+ __u32 s_last_orphan; /* start of list of inodes to delete */
48+ __u32 s_hash_seed[4]; /* HTREE hash seed */
49+ __u8 s_def_hash_version; /* Default hash version to use */
50+ __u8 s_jnl_backup_type; /* Default type of journal backup */
51+ __u16 s_reserved_word_pad;
52+ __u32 s_default_mount_opts;
53+ __u32 s_first_meta_bg; /* First metablock group */
54+ __u32 s_mkfs_time; /* When the filesystem was created */
55+ __u32 s_jnl_blocks[17]; /* Backup of the journal inode */
56+ __u32 s_reserved[172]; /* Padding to the end of the block */
57 };
58
59 struct ext2_group_desc
60@@ -218,6 +263,14 @@
61 #define EXT2_ADDR_PER_BLOCK(s) (EXT2_BLOCK_SIZE(s) / sizeof (__u32))
62 #define EXT2_ADDR_PER_BLOCK_BITS(s) (log2(EXT2_ADDR_PER_BLOCK(s)))
63
64+#define EXT2_GOOD_OLD_REV 0 /* The good old (original) format */
65+#define EXT2_DYNAMIC_REV 1 /* V2 format w/ dynamic inode sizes */
66+#define EXT2_GOOD_OLD_INODE_SIZE 128
67+#define EXT2_INODE_SIZE(s) (((s)->s_rev_level == EXT2_GOOD_OLD_REV) ? \
68+ EXT2_GOOD_OLD_INODE_SIZE : \
69+ (s)->s_inode_size)
70+#define EXT2_INODES_PER_BLOCK(s) (EXT2_BLOCK_SIZE(s)/EXT2_INODE_SIZE(s))
71+
72 /* linux/ext2_fs.h */
73 #define EXT2_BLOCK_SIZE_BITS(s) ((s)->s_log_block_size + 10)
74 /* kind of from ext2/super.c */
75@@ -553,7 +606,7 @@
76 gdp = GROUP_DESC;
77 ino_blk = gdp[desc].bg_inode_table +
78 (((current_ino - 1) % (SUPERBLOCK->s_inodes_per_group))
79- >> log2 (EXT2_BLOCK_SIZE (SUPERBLOCK) / sizeof (struct ext2_inode)));
80+ >> log2 (EXT2_INODES_PER_BLOCK (SUPERBLOCK)));
81 #ifdef E2DEBUG
82 printf ("inode table fsblock=%d\n", ino_blk);
83 #endif /* E2DEBUG */
84@@ -565,13 +618,12 @@
85 /* reset indirect blocks! */
86 mapblock2 = mapblock1 = -1;
87
88- raw_inode = INODE +
89- ((current_ino - 1)
90- & (EXT2_BLOCK_SIZE (SUPERBLOCK) / sizeof (struct ext2_inode) - 1));
91+ raw_inode = (struct ext2_inode *)((char *)INODE +
92+ ((current_ino - 1) & (EXT2_INODES_PER_BLOCK (SUPERBLOCK) - 1)) *
93+ EXT2_INODE_SIZE (SUPERBLOCK));
94 #ifdef E2DEBUG
95 printf ("ipb=%d, sizeof(inode)=%d\n",
96- (EXT2_BLOCK_SIZE (SUPERBLOCK) / sizeof (struct ext2_inode)),
97- sizeof (struct ext2_inode));
98+ EXT2_INODES_PER_BLOCK (SUPERBLOCK), EXT2_INODE_SIZE (SUPERBLOCK));
99 printf ("inode=%x, raw_inode=%x\n", INODE, raw_inode);
100 printf ("offset into inode table block=%d\n", (int) raw_inode - (int) INODE);
101 for (i = (unsigned char *) INODE; i <= (unsigned char *) raw_inode;
diff --git a/meta/recipes-bsp/grub/grub_0.97.bb b/meta/recipes-bsp/grub/grub_0.97.bb
index 38f39121d6..376244e331 100644
--- a/meta/recipes-bsp/grub/grub_0.97.bb
+++ b/meta/recipes-bsp/grub/grub_0.97.bb
@@ -13,11 +13,12 @@ RDEPENDS_${PN} = "diffutils"
13PR = "r6" 13PR = "r6"
14 14
15SRC_URI = "ftp://alpha.gnu.org/gnu/grub/grub-${PV}.tar.gz; \ 15SRC_URI = "ftp://alpha.gnu.org/gnu/grub/grub-${PV}.tar.gz; \
16 file://no-reorder-functions.patch \ 16 file://no-reorder-functions.patch \
17 file://autohell.patch \ 17 file://autohell.patch \
18 file://grub_fix_for_automake-1.12.patch \ 18 file://grub_fix_for_automake-1.12.patch \
19 file://objcopy-absolute.patch \ 19 file://objcopy-absolute.patch \
20 " 20 file://grub-support-256byte-inode.patch \
21"
21 22
22SRC_URI[md5sum] = "cd3f3eb54446be6003156158d51f4884" 23SRC_URI[md5sum] = "cd3f3eb54446be6003156158d51f4884"
23SRC_URI[sha256sum] = "4e1d15d12dbd3e9208111d6b806ad5a9857ca8850c47877d36575b904559260b" 24SRC_URI[sha256sum] = "4e1d15d12dbd3e9208111d6b806ad5a9857ca8850c47877d36575b904559260b"