volla-mimameid: new device (Volla Phone 22) (MR 3340)

This commit is contained in:
Jami Kettunen 2022-06-27 00:19:06 +03:00 committed by Newbyte
parent 4c14014faa
commit 2670b2c580
No known key found for this signature in database
GPG key ID: 5873C171C9429CFA
6 changed files with 5564 additions and 0 deletions

View file

@ -0,0 +1,32 @@
# Reference: <https://postmarketos.org/devicepkg>
# Maintainer: Jami Kettunen <jami.kettunen@protonmail.com>
pkgname=device-volla-mimameid
pkgdesc="Volla Phone 22"
pkgver=0.1
pkgrel=0
url="https://postmarketos.org"
license="MIT"
arch="aarch64"
options="!check !archcheck"
depends="
linux-volla-mimameid
mesa-dri-gallium
mkbootimg
msm-fb-refresher
postmarketos-base
"
makedepends="devicepkg-dev"
source="deviceinfo"
build() {
devicepkg_build $startdir $pkgname
}
package() {
devicepkg_package $startdir $pkgname
}
sha512sums="
0a8ac9a10584d0473864581f0a18063ab29083c80b7f89383da507ddfe2d2deb680e16d8943b3dbf50e71c49bf4b98aa73584bfbb236a9655307af5f0438e5e4 deviceinfo
"

View file

@ -0,0 +1,41 @@
# Reference: <https://postmarketos.org/deviceinfo>
# Please use double quotes only. You can source this file in shell
# scripts.
deviceinfo_format_version="0"
deviceinfo_name="Volla Phone 22"
deviceinfo_manufacturer="Volla"
deviceinfo_codename="volla-mimameid"
deviceinfo_year="2022"
deviceinfo_dtb="mediatek/mt6768"
deviceinfo_arch="aarch64"
# Device related
deviceinfo_chassis="handset"
deviceinfo_keyboard="false"
deviceinfo_external_storage="true"
deviceinfo_screen_width="1080"
deviceinfo_screen_height="2340"
# Bootloader related
deviceinfo_flash_method="fastboot"
deviceinfo_kernel_cmdline="bootopt=64S3,32N2,64N2"
deviceinfo_generate_bootimg="true"
deviceinfo_bootimg_qcdt="false"
deviceinfo_bootimg_mtk_mkimage="false"
deviceinfo_bootimg_dtb_second="false"
deviceinfo_flash_pagesize="2048"
deviceinfo_flash_sparse="true"
deviceinfo_flash_fastboot_partition_system="super"
deviceinfo_header_version="2"
deviceinfo_append_dtb="false"
deviceinfo_flash_offset_dtb="0x0bc08000"
deviceinfo_flash_offset_base="0x40078000"
deviceinfo_flash_offset_kernel="0x00008000"
deviceinfo_flash_offset_ramdisk="0x07c08000"
deviceinfo_flash_offset_second="0x00e10000"
deviceinfo_flash_offset_tags="0x0bc08000"
# NOTE: Flashing kernel on upgrades unsupported due to "dd: error writing
# '/dev/disk/by-partlabel/boot_a': Operation not permitted"
# (the current slot's boot partition appears to be write-protected :/)

View file

@ -0,0 +1,69 @@
# Reference: <https://postmarketos.org/vendorkernel>
# Kernel config based on: arch/arm64/configs/gs5_defconfig
# Maintainer: Jami Kettunen <jami.kettunen@protonmail.com>
pkgname=linux-volla-mimameid
pkgver=4.14.186
pkgrel=0
pkgdesc="Volla Phone 22 kernel fork"
arch="aarch64"
_carch="arm64"
_flavor="volla-mimameid"
url="https://kernel.org"
license="GPL-2.0-only"
options="!strip !check !tracedeps
pmb:cross-native
pmb:kconfigcheck-zram
"
makedepends="
bash
bc
bison
devicepkg-dev
flex
openssl-dev
perl
linux-headers
xz
"
# Source
_repository="kernel-volla-mt6768"
_commit="263d122c614e3c60cef7bfa3d0d2da55cb409d5d"
_config="config-$_flavor.$arch"
source="
$pkgname-$_commit.tar.gz::https://gitlab.com/ubports/porting/community-ports/android11/volla-phone-22/$_repository/-/archive/$_commit.tar.gz
$_config
revert-ALPS04791965-dtc-remove-prebuilt-dtc_overlay.patch
stop-inlining-blk_crypto_flock-and-ksm_flock.patch
"
builddir="$srcdir/$_repository-$_commit"
_outdir="out"
prepare() {
default_prepare
REPLACE_GCCH=0 . downstreamkernel_prepare
}
build() {
unset LDFLAGS
make O="$_outdir" ARCH="$_carch" CC="${CC:-gcc}" \
KBUILD_BUILD_VERSION="$((pkgrel + 1 ))-postmarketOS"
}
package() {
KERNEL_IMAGE_NAME="Image.gz" downstreamkernel_package \
"$builddir" "$pkgdir" "$_carch" "$_flavor" "$_outdir"
make modules_install dtbs_install O="$_outdir" ARCH="$_carch" \
INSTALL_MOD_PATH="$pkgdir" INSTALL_MOD_STRIP=1 \
INSTALL_DTBS_PATH="$pkgdir/boot/dtbs"
rm -f "$pkgdir"/lib/modules/*/build "$pkgdir"/lib/modules/*/source
}
sha512sums="
b4af2b94a9f5ea6663ce0a866cb568cbb550ec88ce708ae5ede8cd3d2d8abbb64c7c6f5ebb6a0eec4a37e6d6c3d65a99c34bde07eb39dad906b31d3c4f281d41 linux-volla-mimameid-263d122c614e3c60cef7bfa3d0d2da55cb409d5d.tar.gz
6c1eac12ec0ab77a8be4de82fbca96341ca5e9c29668db04a52010cddab0807737eb9aea8bc0c3b6454ae904efb391a5cabf7330622d453bc369512027a425bf config-volla-mimameid.aarch64
d3a19d48fe1392cb7d48d5bf21073a32045a3937233435d016129f31b5e43ec220c5481c2c31c6a787efc14f934028de33d8be79bed212d288dd9a40bd6834de revert-ALPS04791965-dtc-remove-prebuilt-dtc_overlay.patch
e448a1093c09414be36333fbdb0d4a3bc5b59018d571b702c6607cb32927cf1563bf03aa1f2d502e6040490e0b26198dd8204306ebaad41be810ba2d47a2721c stop-inlining-blk_crypto_flock-and-ksm_flock.patch
"

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,35 @@
From 8408cd19e74734bede629af90a64f5555a1588d4 Mon Sep 17 00:00:00 2001
From: Jami Kettunen <jami.kettunen@protonmail.com>
Date: Sat, 25 Jun 2022 18:35:38 +0300
Subject: [PATCH] Revert "[ALPS04791965] dtc: remove prebuilt dtc_overlay"
dtc should be provided by the OS environment, not a dynamic x86_64 glibc
linked binary in the kernel tree.
FIXME: cannot build with CONFIG_BUILD_ARM64_DTB_OVERLAY_IMAGE=y
-> unpatched host dtc version doesn't seem to support dtbo creation properly
while the in-tree one is a dynamically linked x86_64 glibc binary!
This reverts commit 5d47795d913f849911d491f2fb132e9e6297df33.
---
scripts/Makefile.lib | 2 +-
scripts/dtc/dtc_overlay | Bin 333600 -> 0 bytes
2 files changed, 1 insertion(+), 1 deletion(-)
delete mode 100755 scripts/dtc/dtc_overlay
diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
index b442d12ff2fe..5fe57a7d5320 100644
--- a/scripts/Makefile.lib
+++ b/scripts/Makefile.lib
@@ -312,7 +312,7 @@ $(obj)/%.dtb.S: $(obj)/%.dtb
quiet_cmd_dtc = DTC $@
cmd_dtc = mkdir -p $(dir ${dtc-tmp}) ; \
$(CPP) $(dtc_cpp_flags) -x assembler-with-cpp -o $(dtc-tmp) $< ; \
- $(srctree)/scripts/dtc/dtc_overlay -@ -O dtb -o $@ -b 0 \
+ $(DTC) -@ -O dtb -o $@ -b 0 \
$(addprefix -i,$(dir $<) $(DTC_INCLUDE)) $(DTC_FLAGS) \
-d $(depfile).dtc.tmp $(dtc-tmp) ; \
cat $(depfile).pre.tmp $(depfile).dtc.tmp > $(depfile)
--
2.36.1

View file

@ -0,0 +1,72 @@
Fixes the following build errors under GCC 11:
In file included from ../block/blk-crypto.c:14:
../block/blk-crypto.c: In function 'blk_crypto_flock':
../include/linux/keyslot-manager.h:101:13: error: inlining failed in call to 'always_inline' 'ksm_flock': function body not available
101 | inline void ksm_flock(struct keyslot_manager *ksm, unsigned int flags);
| ^~~~~~~~~
../block/blk-crypto.c:310:9: note: called from here
310 | ksm_flock(ksm, flags);
| ^~~~~~~~~~~~~~~~~~~~~
In file included from ../drivers/md/dm.c:27:
../drivers/md/dm.c: In function 'dm_derive_raw_secret_callback':
../include/linux/blk-crypto.h:35:13: error: inlining failed in call to 'always_inline' 'blk_crypto_flock': function body not available
35 | inline void blk_crypto_flock(struct keyslot_manager *ksm, unsigned int flags);
| ^~~~~~~~~~~~~~~~
../drivers/md/dm.c:2120:17: note: called from here
2120 | blk_crypto_flock(dev->bdev->bd_queue->ksm, SINGLE_DEPTH_NESTING);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
---
diff --git a/block/blk-crypto.c b/block/blk-crypto.c
index f15ed0b70ecd..703700d9bf9d 100644
--- a/block/blk-crypto.c
+++ b/block/blk-crypto.c
@@ -305,7 +305,7 @@ int blk_crypto_evict_key(struct request_queue *q,
}
EXPORT_SYMBOL_GPL(blk_crypto_evict_key);
-inline void blk_crypto_flock(struct keyslot_manager *ksm, unsigned int flags)
+void blk_crypto_flock(struct keyslot_manager *ksm, unsigned int flags)
{
ksm_flock(ksm, flags);
}
diff --git a/block/keyslot-manager.c b/block/keyslot-manager.c
index 1ce66f66af20..95afcd9c4874 100644
--- a/block/keyslot-manager.c
+++ b/block/keyslot-manager.c
@@ -681,7 +681,7 @@ EXPORT_SYMBOL_GPL(keyslot_manager_derive_raw_secret);
* detection, set another lock sub-class could avoid it.
*
*/
-inline void ksm_flock(struct keyslot_manager *ksm, unsigned int flags)
+void ksm_flock(struct keyslot_manager *ksm, unsigned int flags)
{
ksm->lock_flags = flags;
}
diff --git a/include/linux/blk-crypto.h b/include/linux/blk-crypto.h
index 43d0dbbeb70f..30ba27226a22 100644
--- a/include/linux/blk-crypto.h
+++ b/include/linux/blk-crypto.h
@@ -32,7 +32,7 @@ int blk_crypto_start_using_mode(enum blk_crypto_mode_num crypto_mode,
int blk_crypto_evict_key(struct request_queue *q,
const struct blk_crypto_key *key);
-inline void blk_crypto_flock(struct keyslot_manager *ksm, unsigned int flags);
+void blk_crypto_flock(struct keyslot_manager *ksm, unsigned int flags);
#else /* CONFIG_BLK_INLINE_ENCRYPTION */
diff --git a/include/linux/keyslot-manager.h b/include/linux/keyslot-manager.h
index e247be8a5d43..dfb1d97d8fb6 100644
--- a/include/linux/keyslot-manager.h
+++ b/include/linux/keyslot-manager.h
@@ -98,7 +98,7 @@ int keyslot_manager_derive_raw_secret(struct keyslot_manager *ksm,
unsigned int wrapped_key_size,
u8 *secret, unsigned int secret_size);
-inline void ksm_flock(struct keyslot_manager *ksm, unsigned int flags);
+void ksm_flock(struct keyslot_manager *ksm, unsigned int flags);
#endif /* CONFIG_BLK_INLINE_ENCRYPTION */