Initial attempt at pocophone-f1 support.

This commit is contained in:
venji10 2021-02-10 20:06:41 +01:00 committed by parazyd
parent ee3d790b61
commit 8db5c9397b
No known key found for this signature in database
GPG Key ID: 6B636BF0493EE747
1 changed files with 102 additions and 0 deletions

102
boards/pocophone-f1.sh Normal file
View File

@ -0,0 +1,102 @@
#!/usr/bin/env zsh
# Copyright (c) 2016-2021 Ivan J. <parazyd@dyne.org>
# This file is part of arm-sdk
#
# This source code is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This software is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this source code. If not, see <http://www.gnu.org/licenses/>.
vars+=(device_name arch size parted_type parted_boot parted_root bootfs inittab)
vars+=(gitkernel gitbranch)
arrs+=(custmodules)
device_name="pocophone-f1"
arch="arm64"
size=1891
inittab=("T0:23:respawn:/sbin/agetty -L ttyAMA0 115200 vt100")
parted_type="dos"
bootfs="vfat"
rootfs="ext4"
dos_boot="fat32 2048s 264191s"
dos_root="$rootfs 24192s 100%"
extra_packages+=()
custmodules=()
gitkernel="https://gitlab.com/venji10/linux-beryllium"
gitbranch="beryllium-panel-ebbg"
prebuild() {
fn prebuild
req=(device_name strapdir)
ckreq || return 1
notice "Executing $device_name prebuild"
mkdir -p "$R/tmp/kernels/$device_name"
}
postbuild() {
fn postbuild
notice "Executing $device_name postbuild"
copy-root-overlay
pushd "$R/tmp/kernels/$device_name/${device_name}-linux"
cat Image.gz dts/qcom/sdm845-xiaomi-beryllium-ebbg.dtb > Image.gz-dtb || { zerr; return 1; }
mkbootimg \
--kernel Image.gz-dtb \
--base 0x00000000 \
--second_offset 0x00f00000 \
--kernel_offset 0x00008000 \
--ramdisk_offset 0x01000000 \
--tags_offset 0x00000100 \
--pagesize 4096 \
--cmdline "root=LABEL=ALARM rw audit=0" \
-o $R/boot/boot.img || { zerr; return 1; }
popd
}
build_kernel_arm64() {
fn build_kernel_arm64
req=(R arch device_name gitkernel gitbranch strapdir)
ckreq || return 1
notice "Building $arch kernel"
prebuild || { zerr; return 1; }
get-kernel-sources || { zerr; return 1; }
pushd "$R/tmp/kernels/$device_name/${device_name}-linux"
make \
$MAKEOPTS \
ARCH=arm64 \
CROSS_COMPILE=$compiler \
beryllium_defconfig || { zerr; return 1; }
make \
$MAKEOPTS \
ARCH=arm64 \
CROSS_COMPILE=$compiler \
Image.gz modules qcom/sdm845-xiaomi-beryllium-ebbg.dtb || { zerr; return 1; }
popd
postbuild || { zerr; return 1; }
}