Skip to content

Commit

Permalink
New device: xiaomi-cereus (Xiaomi Redmi 6)
Browse files Browse the repository at this point in the history
  • Loading branch information
jerinphilip committed Sep 19, 2023
1 parent 01b8e81 commit d20d00e
Show file tree
Hide file tree
Showing 7 changed files with 5,779 additions and 0 deletions.
33 changes: 33 additions & 0 deletions device/testing/device-xiaomi-cereus/APKBUILD
@@ -0,0 +1,33 @@
# 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
modules-initfs
"

build() {
devicepkg_build $startdir $pkgname
}

package() {
devicepkg_package $startdir $pkgname
}

sha512sums="
544ec7dedbf2471eba1fce425a8e98f6b6d3cf1e73a447a42f8b2715391aa6b3b3f2502e822c1eef77f24b79343bfd808ab6ef58d17d23b0aacb56f3b87c3efc deviceinfo
03cab135b4d8d249724a36e30af94404ad56fb14f30819838a2fa35a84ec4f65152a72db7534c97fcfe0aa4de16c112f556f799f66ec8134f76aba84efc3eafa modules-initfs
"
35 changes: 35 additions & 0 deletions device/testing/device-xiaomi-cereus/deviceinfo
@@ -0,0 +1,35 @@
# 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_dtb=""
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"

6 changes: 6 additions & 0 deletions device/testing/device-xiaomi-cereus/modules-initfs
@@ -0,0 +1,6 @@
# Remove this comment after reading, or the file if unnecessary (CHANGEME!)
# This file can contain a list of modules to be included in the initramfs,
# so that they are available in early boot stages. It should have one
# module name per line. If there are multiple kernel variants with different
# requirements for modules into the initramfs, one modules-initfs.$variant
# file should be created for each of them.
@@ -0,0 +1,51 @@
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

0 comments on commit d20d00e

Please sign in to comment.