Skip to content
Snippets Groups Projects
Unverified Commit 00c7d621 authored by Jerin Philip's avatar Jerin Philip
Browse files

xiaomi-cereus: new device (Xiaomi Redmi 6)

parent 0b5f362f
No related branches found
No related tags found
No related merge requests found
# Reference: <https://postmarketos.org/devicepkg>
pkgname=device-xiaomi-cereus
pkgdesc="Xiaomi Redmi 6"
pkgver=0.1
pkgrel=0
url="https://postmarketos.org"
license="MIT"
arch="armv7"
options="!check !archcheck"
depends="
linux-xiaomi-cereus
mkbootimg
postmarketos-base
msm-fb-refresher
"
makedepends="devicepkg-dev"
source="
deviceinfo
"
build() {
devicepkg_build $startdir $pkgname
}
package() {
devicepkg_package $startdir $pkgname
}
sha512sums="
5baa0ab15944fd10547bd47896fbcca78a42062e39458c062d609d2e97f75d5d22cfbb9fdee868d48ed7ae7c6bde67234f7bc369c3d4fca8c1438c3736a874ae deviceinfo
"
# Reference: <https://postmarketos.org/deviceinfo>
# Please use double quotes only. You can source this file in shell
# scripts.
deviceinfo_format_version="0"
deviceinfo_name="Xiaomi Redmi 6"
deviceinfo_manufacturer="Xiaomi"
deviceinfo_codename="xiaomi-cereus"
deviceinfo_year="2018"
deviceinfo_arch="armv7"
# Device related
deviceinfo_chassis="handset"
deviceinfo_keyboard="false"
deviceinfo_external_storage="true"
deviceinfo_screen_width="720"
deviceinfo_screen_height="1440"
# Bootloader related
deviceinfo_flash_method="mtkclient"
# deviceinfo_flash_method="fastboot"
deviceinfo_kernel_cmdline="bootopt=64S3,32S1,32S1 buildvariant=user"
deviceinfo_generate_bootimg="true"
deviceinfo_bootimg_qcdt="false"
deviceinfo_bootimg_mtk_mkimage="false"
deviceinfo_bootimg_dtb_second="false"
deviceinfo_flash_pagesize="2048"
deviceinfo_header_version="1"
deviceinfo_flash_offset_base="0x40000000"
deviceinfo_flash_offset_kernel="0x00008000"
deviceinfo_flash_offset_ramdisk="0x11b00000"
deviceinfo_flash_offset_second="0x00f00000"
deviceinfo_flash_offset_tags="0x07880000"
From 1978be4d1641894fe7f1c6999d77a6a455b4c655 Mon Sep 17 00:00:00 2001
From: Jerin Philip <jerinphilip@live.in>
Date: Mon, 11 Sep 2023 02:15:18 +0530
Subject: [PATCH 1/2] gcc10 extern YYLOC global declaration
Based on https://lkml.org/lkml/2020/4/1/1206. In original patch, YYLOC declaration was removed.
However, using original patch, which removes yylloc declaration on 3.18.14 kernel version results in 'yylloc not declared' error.
See part of the original description below:
gcc 10 will default to -fno-common, which causes this error at link
time:
(.text+0x0): multiple definition of `yylloc'; dtc-lexer.lex.o (symbol from plugin):(.text+0x0): first defined here
This is because both dtc-lexer as well as dtc-parser define the same
global symbol yyloc. Before with -fcommon those were merged into one
defintion. The proper solution would be to to mark this as "extern",
---
scripts/dtc/dtc-lexer.l | 2 +-
scripts/dtc/dtc-lexer.lex.c_shipped | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/scripts/dtc/dtc-lexer.l b/scripts/dtc/dtc-lexer.l
index 790fbf6cf2d7..e7eab4d7c5a9 100644
--- a/scripts/dtc/dtc-lexer.l
+++ b/scripts/dtc/dtc-lexer.l
@@ -38,7 +38,7 @@ LINECOMMENT "//".*\n
#include "srcpos.h"
#include "dtc-parser.tab.h"
-YYLTYPE yylloc;
+extern YYLTYPE yylloc;
extern bool treesource_error;
/* CAUTION: this will stop working if we ever use yyless() or yyunput() */
diff --git a/scripts/dtc/dtc-lexer.lex.c_shipped b/scripts/dtc/dtc-lexer.lex.c_shipped
index ba525c2f9fc2..a2fe8dbc0fd3 100644
--- a/scripts/dtc/dtc-lexer.lex.c_shipped
+++ b/scripts/dtc/dtc-lexer.lex.c_shipped
@@ -637,7 +637,7 @@ char *yytext;
#include "srcpos.h"
#include "dtc-parser.tab.h"
-YYLTYPE yylloc;
+extern YYLTYPE yylloc;
extern bool treesource_error;
/* CAUTION: this will stop working if we ever use yyless() or yyunput() */
--
2.42.0
# Reference: <https://postmarketos.org/vendorkernel>
# Kernel config based on: arch/arm/configs/ranchu_defconfig
pkgname=linux-xiaomi-cereus
pkgver=4.9.119
pkgrel=0
pkgdesc="Xiaomi Redmi 6 kernel fork"
arch="armv7"
_carch="arm"
_flavor="xiaomi-cereus"
url="https://github.com/xiaomi-mt6765/android_kernel_xiaomi_mt6765"
license="GPL-2.0-only"
options="!strip !check !tracedeps pmb:cross-native"
makedepends="
bash
bc
bison
devicepkg-dev
findutils
flex
openssl-dev
perl
python3
"
# Source
_repository="android_kernel_xiaomi_mt6765"
_commit="31dbe7b6881b35094fa220a68f6c476c615f10dc"
_config="config-$_flavor.$arch"
source="
$pkgname-$_commit.tar.gz::https://github.com/xiaomi-mt6765/$_repository/archive/$_commit.tar.gz
$_config
0001-gcc10-extern-YYLOC-global-declaration.patch
0002-Port-drvgen-scripts-to-Python3.patch
"
builddir="$srcdir/$_repository-$_commit"
_outdir="out"
prepare() {
default_prepare
. downstreamkernel_prepare
}
build() {
unset LDFLAGS
make O="$_outdir" ARCH="$_carch" CC="${CC:-gcc}" \
KBUILD_BUILD_VERSION="$((pkgrel + 1))-postmarketOS" KBUILD_VERBOSE=0
}
package() {
downstreamkernel_package "$builddir" "$pkgdir" "$_carch" \
"$_flavor" "$_outdir"
}
sha512sums="
c543d691eac482c6bef8c6b5c42cf2643e53745ac437c659de6b31720e5e879cc5ecfab1ac63c60eea24acb7a9e40db5e54d3ac5a461c6136d073bdc1ff3560f linux-xiaomi-cereus-31dbe7b6881b35094fa220a68f6c476c615f10dc.tar.gz
601be85e17467b0afb1bb34acc3cb878b70555acf9dc95fe2bec28991c725f7e8c088c28ad7837329a326df5352fad715f82b1b5e6d1a455df2761463bd4e701 config-xiaomi-cereus.armv7
6d3dd281d69b561ab18693b07b72fe1bc87626a27f72ae1b0f72be2bc42fe45611bf3d8d35543107ac5673ee099a1013b615274f9135627f5b878a9f2cd51b5f 0001-gcc10-extern-YYLOC-global-declaration.patch
6e8e12268c0c5eff0e3d0964f26678929410138a8783c628953112e449400cf8660e83321cd9cebf34ac74dd008f32dd4b0b6bdfa7097083cbaa23920367f13e 0002-Port-drvgen-scripts-to-Python3.patch
"
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment