linux-postmarketos-rockchip: drop armv7 and upgrade to 6.0 (MR 3526)
[ci:skip-build] Already built successfuly on CI in MR
This commit is contained in:
parent
bd2cdfbaf4
commit
5ec845da6e
4 changed files with 237 additions and 8313 deletions
|
@ -1,143 +0,0 @@
|
|||
From 8d9406b97635ee7edad133c48f3de120de331d0e Mon Sep 17 00:00:00 2001
|
||||
From: SolidHal <hal@halemmerich.com>
|
||||
Date: Fri, 24 Aug 2018 11:04:43 -0500
|
||||
Subject: [PATCH] block: partitions: efi: Add support for IGNOREME GPT
|
||||
signature
|
||||
|
||||
This patch adds support for a special GPT header signature marker (using
|
||||
the string 'IGNOREME' instead of the spec's 'EFI PART'). This tells the
|
||||
kernel to ignore this GPT completely and look at the other one instead.
|
||||
Since the kernel always prefers the primary GPT anyway, all we really
|
||||
need to do effectively is to check whether the primary GPT is marked
|
||||
'IGNOREME' and force evaluation of the secondary one in that case.
|
||||
|
||||
Borrowed from the chrome os 3.14 kernel, the commit can be found here:
|
||||
https://chromium.googlesource.com/chromiumos/third_party/kernel/+/abba28d0a1b7361da6e2023352e92687166ca30d
|
||||
|
||||
Also bundled in this commit
|
||||
https://chromium.googlesource.com/chromiumos/third_party/kernel/+/bd0c62c7de0c8a63314b7955e5718d8f6192f9d2%5E%21/#F0
|
||||
Which is a small compiler warning fix for the above patch
|
||||
|
||||
This patch fixes how the kernel detects and handles certain mmc
|
||||
manufatures devices, and allows the partitions on the mmc to be bootable
|
||||
and mountable.
|
||||
|
||||
Signed-off-by: SolidHal <hal@halemmerich.com>
|
||||
---
|
||||
block/partitions/efi.c | 33 +++++++++++++++++++++++----------
|
||||
block/partitions/efi.h | 3 ++-
|
||||
2 files changed, 25 insertions(+), 11 deletions(-)
|
||||
|
||||
diff --git a/block/partitions/efi.c b/block/partitions/efi.c
|
||||
index 5e9be13a56a8..8cdfcc48558c 100644
|
||||
--- a/block/partitions/efi.c
|
||||
+++ b/block/partitions/efi.c
|
||||
@@ -328,23 +328,34 @@ static gpt_header *alloc_read_gpt_header(struct parsed_partitions *state,
|
||||
* @lba: logical block address of the GPT header to test
|
||||
* @gpt: GPT header ptr, filled on return.
|
||||
* @ptes: PTEs ptr, filled on return.
|
||||
+ * @ignored is filled on return with 1 if this is an IGNOREME GPT,
|
||||
+ * 0 otherwise. May be NULL.
|
||||
*
|
||||
* Description: returns 1 if valid, 0 on error.
|
||||
* If valid, returns pointers to newly allocated GPT header and PTEs.
|
||||
*/
|
||||
static int is_gpt_valid(struct parsed_partitions *state, u64 lba,
|
||||
- gpt_header **gpt, gpt_entry **ptes)
|
||||
+ gpt_header **gpt, gpt_entry **ptes, int *ignored)
|
||||
{
|
||||
u32 crc, origcrc;
|
||||
u64 lastlba, pt_size;
|
||||
|
||||
+ if (ignored)
|
||||
+ *ignored = 0;
|
||||
if (!ptes)
|
||||
return 0;
|
||||
if (!(*gpt = alloc_read_gpt_header(state, lba)))
|
||||
return 0;
|
||||
|
||||
/* Check the GUID Partition Table signature */
|
||||
- if (le64_to_cpu((*gpt)->signature) != GPT_HEADER_SIGNATURE) {
|
||||
+
|
||||
+ if (le64_to_cpu((*gpt)->signature) == GPT_HEADER_SIGNATURE_IGNORED) {
|
||||
+ pr_debug("GUID Partition Table at LBA %llu marked IGNOREME\n",
|
||||
+ (unsigned long long)lba);
|
||||
+ if (ignored)
|
||||
+ *ignored = 1;
|
||||
+ goto fail;
|
||||
+ } else if (le64_to_cpu((*gpt)->signature) != GPT_HEADER_SIGNATURE) {
|
||||
pr_debug("GUID Partition Table Header signature is wrong:"
|
||||
"%lld != %lld\n",
|
||||
(unsigned long long)le64_to_cpu((*gpt)->signature),
|
||||
@@ -581,7 +592,7 @@ compare_gpts(gpt_header *pgpt, gpt_header *agpt, u64 lastlba)
|
||||
static int find_valid_gpt(struct parsed_partitions *state, gpt_header **gpt,
|
||||
gpt_entry **ptes)
|
||||
{
|
||||
- int good_pgpt = 0, good_agpt = 0, good_pmbr = 0;
|
||||
+ int good_pgpt = 0, good_agpt = 0, good_pmbr = 0, pgpt_ignored = 0;
|
||||
gpt_header *pgpt = NULL, *agpt = NULL;
|
||||
gpt_entry *pptes = NULL, *aptes = NULL;
|
||||
legacy_mbr *legacymbr;
|
||||
@@ -613,13 +624,13 @@ static int find_valid_gpt(struct parsed_partitions *state, gpt_header **gpt,
|
||||
}
|
||||
|
||||
good_pgpt = is_gpt_valid(state, GPT_PRIMARY_PARTITION_TABLE_LBA,
|
||||
- &pgpt, &pptes);
|
||||
+ &pgpt, &pptes, &pgpt_ignored);
|
||||
if (good_pgpt)
|
||||
good_agpt = is_gpt_valid(state,
|
||||
le64_to_cpu(pgpt->alternate_lba),
|
||||
- &agpt, &aptes);
|
||||
- if (!good_agpt && force_gpt)
|
||||
- good_agpt = is_gpt_valid(state, lastlba, &agpt, &aptes);
|
||||
+ &agpt, &aptes, NULL);
|
||||
+ if (!good_agpt && (force_gpt || pgpt_ignored))
|
||||
+ good_agpt = is_gpt_valid(state, lastlba, &agpt, &aptes, NULL);
|
||||
|
||||
if (!good_agpt && force_gpt && fops->alternative_gpt_sector) {
|
||||
sector_t agpt_sector;
|
||||
@@ -628,14 +639,15 @@ static int find_valid_gpt(struct parsed_partitions *state, gpt_header **gpt,
|
||||
err = fops->alternative_gpt_sector(disk, &agpt_sector);
|
||||
if (!err)
|
||||
good_agpt = is_gpt_valid(state, agpt_sector,
|
||||
- &agpt, &aptes);
|
||||
+ &agpt, &aptes, NULL);
|
||||
}
|
||||
|
||||
/* The obviously unsuccessful case */
|
||||
if (!good_pgpt && !good_agpt)
|
||||
goto fail;
|
||||
|
||||
- compare_gpts(pgpt, agpt, lastlba);
|
||||
+ if (!pgpt_ignored)
|
||||
+ compare_gpts(pgpt, agpt, lastlba);
|
||||
|
||||
/* The good cases */
|
||||
if (good_pgpt) {
|
||||
@@ -652,7 +664,8 @@ static int find_valid_gpt(struct parsed_partitions *state, gpt_header **gpt,
|
||||
*ptes = aptes;
|
||||
kfree(pgpt);
|
||||
kfree(pptes);
|
||||
- pr_warn("Primary GPT is invalid, using alternate GPT.\n");
|
||||
+ pr_warn("Primary GPT is %s, using alternate GPT.\n",
|
||||
+ pgpt_ignored ? "being ignored" : "invalid");
|
||||
return 1;
|
||||
}
|
||||
|
||||
diff --git a/block/partitions/efi.h b/block/partitions/efi.h
|
||||
index 8cc2b88d0aa8..fcf65ebbaa85 100644
|
||||
--- a/block/partitions/efi.h
|
||||
+++ b/block/partitions/efi.h
|
||||
@@ -27,7 +27,8 @@
|
||||
#define GPT_MBR_PROTECTIVE 1
|
||||
#define GPT_MBR_HYBRID 2
|
||||
|
||||
-#define GPT_HEADER_SIGNATURE 0x5452415020494645ULL
|
||||
+#define GPT_HEADER_SIGNATURE 0x5452415020494645ULL /* 'EFI PART' */
|
||||
+#define GPT_HEADER_SIGNATURE_IGNORED 0x454d45524f4e4749ULL /* 'IGNOREME' */
|
||||
#define GPT_HEADER_REVISION_V1 0x00010000
|
||||
#define GPT_PRIMARY_PARTITION_TABLE_LBA 1
|
||||
|
||||
--
|
||||
2.34.1
|
||||
|
|
@ -10,10 +10,11 @@
|
|||
# boot failure
|
||||
|
||||
pkgname=linux-postmarketos-rockchip
|
||||
pkgver=5.18
|
||||
pkgrel=4
|
||||
pkgver=6.0
|
||||
pkgrel=0
|
||||
pkgdesc="Mainline kernel for rockchip devices"
|
||||
arch="aarch64 armv7"
|
||||
arch="aarch64"
|
||||
_carch="arm64"
|
||||
_flavor="${pkgname#linux-}"
|
||||
url="https://kernel.org"
|
||||
license="GPL-2.0-only"
|
||||
|
@ -22,6 +23,7 @@ options="!strip !check !tracedeps
|
|||
pmb:kconfigcheck-community
|
||||
"
|
||||
makedepends="
|
||||
bash
|
||||
bison
|
||||
devicepkg-dev
|
||||
findutils
|
||||
|
@ -37,13 +39,8 @@ makedepends="
|
|||
mpfr-dev
|
||||
"
|
||||
|
||||
case "$CARCH" in
|
||||
aarch64*) _carch="arm64" ;;
|
||||
arm*) _carch="arm" ;;
|
||||
esac
|
||||
|
||||
# Source
|
||||
_config="config-$_flavor.$CARCH"
|
||||
_config="config-$_flavor.$arch"
|
||||
case $pkgver in
|
||||
*.*.*) _kernver=${pkgver%.0};;
|
||||
*.*) _kernver=$pkgver;;
|
||||
|
@ -51,10 +48,7 @@ esac
|
|||
|
||||
source="
|
||||
https://cdn.kernel.org/pub/linux/kernel/v${_kernver%%.*}.x/linux-$_kernver.tar.xz
|
||||
0007-block-partitions-efi-Add-support-for-IGNOREME-GPT-si.patch
|
||||
|
||||
config-$_flavor.aarch64
|
||||
config-$_flavor.armv7
|
||||
$_config
|
||||
"
|
||||
builddir="$srcdir/linux-$_kernver"
|
||||
|
||||
|
@ -68,7 +62,6 @@ build() {
|
|||
unset LDFLAGS
|
||||
make ARCH="$_carch" \
|
||||
KBUILD_BUILD_VERSION="$((pkgrel + 1 ))-$_flavor"
|
||||
|
||||
}
|
||||
|
||||
package() {
|
||||
|
@ -80,19 +73,11 @@ package() {
|
|||
INSTALL_MOD_PATH="$pkgdir" \
|
||||
INSTALL_DTBS_PATH="$pkgdir/boot/dtbs-$_flavor"
|
||||
|
||||
# not all armv7 devices (google-veyon-jerry) support booting gzipped kernels yet
|
||||
if [ $_carch = arm64 ]; then
|
||||
gzip -v "$pkgdir"/boot/vmlinuz
|
||||
mv "$pkgdir"/boot/vmlinuz.gz "$pkgdir"/boot/vmlinuz
|
||||
else
|
||||
mv "$pkgdir"/boot/vmlinuz "$pkgdir"/boot/vmlinuz
|
||||
fi
|
||||
gzip -v "$pkgdir"/boot/vmlinuz
|
||||
mv "$pkgdir"/boot/vmlinuz.gz "$pkgdir"/boot/vmlinuz
|
||||
}
|
||||
|
||||
|
||||
sha512sums="
|
||||
dbbc9d1395898a498fa4947fceda1781344fa5d360240f753810daa4fa88e519833e2186c4e582a8f1836e6413e9e85f6563c7770523b704e8702d67622f98b5 linux-5.18.tar.xz
|
||||
265b05bc542edb290ec15cd5f50132698a32e80d30ce28ce3ad7e990b7c07df92c4556122505b07a6aa582a919459872d1d874f4ed422d2aff2cdfb51889e720 0007-block-partitions-efi-Add-support-for-IGNOREME-GPT-si.patch
|
||||
b06b76cf3197242af9277626df2d0041bc13036c07b88c7555bc5ee4a16185a659d3834aff04caf93df0e5ad19ab0b57f7e72beb813275f7c4ae859cb893ebea config-postmarketos-rockchip.aarch64
|
||||
d44a72f0ba64f5c3227eb9f11211e4cf1e7cbe69bc112525649a09065f39b506644a2515ed9fa33844a8bef933ed5e7543678618cddc484b65d11613059eda58 config-postmarketos-rockchip.armv7
|
||||
bac41a7aeb6e809616cee2f13dcd1c45e829dfd1ccf60aee1dc4c46b1e28532f4485c7d819a32940de84fdfbf89db80a4e919bce8a74b2948c5a01551771b714 linux-6.0.tar.xz
|
||||
db32d09836cf9bc933a865355cb6f7cbcac884085f22e50fe06ee40945ada3eb0753475af014a8f27bd9f499e85e1b5f26506b06d6d6f9f30d5222228ce4e041 config-postmarketos-rockchip.aarch64
|
||||
"
|
||||
|
|
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue