Skip to content

Commit 3b3f229

Browse files
committed
fixup armhf veyron emmc gpu ignore patch
1 parent 3cbb795 commit 3b3f229

File tree

1 file changed

+30
-16
lines changed

1 file changed

+30
-16
lines changed

kernel/patches/armhf/kernel/0001-block-partitions-efi-Add-support-for-IGNOREME-GPT-si.patch

Lines changed: 30 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -50,20 +50,20 @@ index 39f70d9..aa08380 100644
5050
u64 lastlba, pt_size;
5151
-
5252
+ if (ignored)
53-
+ *ignored = 0;
53+
+ *ignored = 0;
5454
if (!ptes)
5555
return 0;
5656
if (!(*gpt = alloc_read_gpt_header(state, lba)))
5757
return 0;
5858

5959
/* Check the GUID Partition Table signature */
6060
- if (le64_to_cpu((*gpt)->signature) != GPT_HEADER_SIGNATURE) {
61-
+ if (le64_to_cpu((*gpt)->signature) == GPT_HEADER_SIGNATURE_IGNORED) {
62-
+ pr_debug("GUID Partition Table at LBA %llu marked IGNOREME\n",
63-
+ (unsigned long long)lba);
64-
+ if (ignored)
65-
+ *ignored = 1;
66-
+ goto fail;
61+
+ if (le64_to_cpu((*gpt)->signature) == GPT_HEADER_SIGNATURE_IGNORED) {
62+
+ pr_warn("GUID Partition Table at LBA %llu marked IGNOREME\n",
63+
+ (unsigned long long)lba);
64+
+ if (ignored)
65+
+ *ignored = 1;
66+
+ goto fail;
6767
+ } else if (le64_to_cpu((*gpt)->signature) != GPT_HEADER_SIGNATURE) {
6868
pr_debug("GUID Partition Table Header signature is wrong:"
6969
"%lld != %lld\n",
@@ -77,7 +77,7 @@ index 39f70d9..aa08380 100644
7777
gpt_header *pgpt = NULL, *agpt = NULL;
7878
gpt_entry *pptes = NULL, *aptes = NULL;
7979
legacy_mbr *legacymbr;
80-
@@ -613,13 +626,13 @@ static int find_valid_gpt(struct parsed_partitions *state, gpt_header **gpt,
80+
@@ -613,13 +626,16 @@ static int find_valid_gpt(struct parsed_partitions *state, gpt_header **gpt,
8181
}
8282

8383
good_pgpt = is_gpt_valid(state, GPT_PRIMARY_PARTITION_TABLE_LBA,
@@ -90,12 +90,15 @@ index 39f70d9..aa08380 100644
9090
- if (!good_agpt && force_gpt)
9191
- good_agpt = is_gpt_valid(state, lastlba, &agpt, &aptes);
9292
+ &agpt, &aptes, NULL);
93-
+ if (!good_agpt && (force_gpt || pgpt_ignored))
94-
+ good_agpt = is_gpt_valid(state, lastlba, &agpt, &aptes, NULL);
93+
+ if (!good_agpt && (force_gpt || pgpt_ignored)){
94+
+ good_agpt = is_gpt_valid(state, lastlba, &agpt, &aptes, NULL);
95+
+ if (!good_agpt)
96+
+ pr_warn("Primary GPT invalid or ignored, but Alternate GPT is also invalid");
97+
+ }
9598

9699
if (!good_agpt && force_gpt && fops->alternative_gpt_sector) {
97100
sector_t agpt_sector;
98-
@@ -628,14 +641,15 @@ static int find_valid_gpt(struct parsed_partitions *state, gpt_header **gpt,
101+
@@ -628,14 +644,15 @@ static int find_valid_gpt(struct parsed_partitions *state, gpt_header **gpt,
99102
err = fops->alternative_gpt_sector(disk, &agpt_sector);
100103
if (!err)
101104
good_agpt = is_gpt_valid(state, agpt_sector,
@@ -108,21 +111,32 @@ index 39f70d9..aa08380 100644
108111
goto fail;
109112

110113
- compare_gpts(pgpt, agpt, lastlba);
111-
+ if (!pgpt_ignored)
114+
+ if (!pgpt_ignored)
112115
+ compare_gpts(pgpt, agpt, lastlba);
113116

114117
/* The good cases */
115118
if (good_pgpt) {
116-
@@ -644,7 +658,8 @@ static int find_valid_gpt(struct parsed_partitions *state, gpt_header **gpt,
119+
@@ -643,8 +660,8 @@ static int find_valid_gpt(struct parsed_partitions *state, gpt_header **gpt,
120+
*ptes = pptes;
117121
kfree(agpt);
118122
kfree(aptes);
119-
if (!good_agpt)
123+
- if (!good_agpt)
120124
- pr_warn("Alternate GPT is invalid, using primary GPT.\n");
121-
+ pr_warn("Primary GPT is %s, using alternate GPT.\n",
122-
+ pgpt_ignored ? "being ignored" : "invalid");
125+
+ if (!good_agpt)
126+
+ pr_warn("Alternate GPT is invalid, using primary GPT.\n");
123127
return 1;
124128
}
125129
else if (good_agpt) {
130+
@@ -652,7 +669,8 @@ static int find_valid_gpt(struct parsed_partitions *state, gpt_header **gpt,
131+
*ptes = aptes;
132+
kfree(pgpt);
133+
kfree(pptes);
134+
- pr_warn("Primary GPT is invalid, using alternate GPT.\n");
135+
+ pr_warn("Primary GPT is %s, using alternate GPT.\n",
136+
+ pgpt_ignored ? "being ignored" : "invalid");
137+
return 1;
138+
}
139+
126140
diff --git a/block/partitions/efi.h b/block/partitions/efi.h
127141
index abd0b19..36cddc8 100644
128142
--- a/block/partitions/efi.h

0 commit comments

Comments
 (0)