samsung-beyond2lte: new device (MR 6161)

[ci:skip-build]: already built successfully in CI
This commit is contained in:
vboxuser 2025-02-06 18:24:31 +11:00 committed by Pablo Correa Gómez
parent e087403c1f
commit c43f2078ed
No known key found for this signature in database
GPG key ID: 7A342565FF635F79
9 changed files with 6851 additions and 0 deletions

View file

@ -0,0 +1,37 @@
# Reference: <https://postmarketos.org/devicepkg>
pkgname=device-samsung-beyond2lte
pkgdesc="Samsung Galaxy S10+"
pkgver=1
pkgrel=0
url="https://postmarketos.org"
license="MIT"
arch="aarch64"
options="!check !archcheck"
depends="
linux-samsung-beyond2lte
mkbootimg
msm-fb-refresher
postmarketos-base
"
makedepends="devicepkg-dev"
source="deviceinfo initfs-hook.sh"
subpackages="$pkgname-nonfree-firmware:nonfree_firmware"
build() {
devicepkg_build $startdir $pkgname
}
package() {
devicepkg_package $startdir $pkgname
}
nonfree_firmware() {
pkgdesc="Firmware for the Samsung Galaxy S10+"
depends="firmware-samsung-beyond2lte"
mkdir "$subpkgdir"
}
sha512sums="
72d383e4d27be2679619e5d0958c7f6d7e1004a4baf826f51b1f3097f064002524fd59164bd6fcba99665c441ef961623b9c2873e32cd3db86b53bec36799baa deviceinfo
03deb65563f4b4421491643854927e88b2d5880b8b19ee6baa4d3fa1ec3f7d7a1c2977fd2c3c41270254efea6fa0c5fdae0a382e7c427d5a3bf6fad34c25375e initfs-hook.sh
"

View file

@ -0,0 +1,42 @@
# Reference: <https://postmarketos.org/deviceinfo>
# Please use double quotes only. You can source this file in shell
# scripts.
deviceinfo_format_version="0"
deviceinfo_name="Samsung Galaxy S10+"
deviceinfo_manufacturer="Samsung"
deviceinfo_codename="samsung-beyond2lte"
deviceinfo_year="2019"
deviceinfo_arch="aarch64"
# Device related
deviceinfo_chassis="handset"
deviceinfo_keyboard="false"
deviceinfo_external_storage="true"
deviceinfo_screen_width="1440"
deviceinfo_screen_height="3040"
# Bootloader related
deviceinfo_flash_method="heimdall-bootimg"
deviceinfo_flash_sparse="true"
deviceinfo_kernel_cmdline=" androidboot.super_partition=system buildvariant=userdebug"
deviceinfo_header_version="1"
deviceinfo_generate_bootimg="true"
deviceinfo_bootimg_custom_args="--header_version 1 --os_version 12.0.0 --os_patch_level 2021-12"
deviceinfo_bootimg_qcdt="false"
deviceinfo_bootimg_dtb_second="false"
deviceinfo_flash_offset_base="0x10000000"
deviceinfo_flash_offset_kernel="0x00008000"
deviceinfo_flash_offset_ramdisk="0x01000000"
deviceinfo_flash_offset_second="0xf0000000"
deviceinfo_flash_offset_tags="0x00000100"
deviceinfo_flash_pagesize="2048"
deviceinfo_flash_heimdall_partition_vbmeta="VBMETA"
deviceinfo_flash_heimdall_partition_kernel="BOOT"
deviceinfo_flash_heimdall_partition_rootfs="SYSTEM"
deviceinfo_no_framebuffer="true"
deviceinfo_rootfs_image_sector_size="4096"
deviceinfo_bootimg_append_seandroidenforce="true"
deviceinfo_create_initfs_extra="true"

View file

@ -0,0 +1,3 @@
#!/bin/sh
echo 16 > /sys/devices/platform/19030000.decon_f/graphics/fb0/bits_per_pixel

View file

@ -0,0 +1,45 @@
pkgname=firmware-samsung-beyond2lte
pkgver=1
pkgrel=0
pkgdesc="Firmware for the Samsung Galaxy S10+"
url="https://github.com/Linux4/proprietary_vendor_samsung"
arch="aarch64"
license="proprietary"
options="!check !archcheck !strip !spdx !tracedeps pmb:cross-native"
# Source
_commit="7f9ff5be60218fffd6d0474eb78f72067330b347"
_wifi_files_common="bcmdhd_mfg.bin_b1 bcmdhd_mon.bin_b1 bcmdhd_sta.bin_b1 nvram.txt_ES00_semco_b0 nvram.txt_ES01_semco_b0 nvram.txt_ES02_semco_b0"
_wifi_files_device="bcmdhd_clm.blob nvram.txt_1rh_es11_b0 nvram.txt_1rh_es12_b0 nvram.txt_1rh_es13_b0 nvram.txt_1rh_es43_b1 nvram.txt_CS01_semco_b1 nvram.txt_ES03_semco_b0"
for _file in $_wifi_files_common; do
source="$source $pkgname-$_commit-$_file::$url/raw/$_commit/exynos9820-common/proprietary/vendor/firmware/$_file"
done
for _file in $_wifi_files_device; do
source="$source $pkgname-$_commit-$_file::$url/raw/$_commit/beyond2lte/proprietary/vendor/firmware/$_file"
done
package() {
# Wifi
local file
for file in $_wifi_files_common $_wifi_files_device; do
install -Dm644 "$srcdir/$pkgname-$_commit-$file" \
"$pkgdir/lib/firmware/postmarketos/$file"
done
}
sha512sums="
82fdca632de16ae8ae86c9e6daa1e2407f93e41df16c3a52490bf8353be7d3f75d66ad193875cbbca0e5b05efb52c1e0691d5c153ca3cd5f0ef64e053217414b firmware-samsung-beyond2lte-7f9ff5be60218fffd6d0474eb78f72067330b347-bcmdhd_mfg.bin_b1
6c40e03c1d32651fba382bfb4e75c9240e49f527b5591d3e68410df35c0d1ec5fd2074e4b5c607b573276005735b767a959c8f6c580bbaab209ca4a908fbecd4 firmware-samsung-beyond2lte-7f9ff5be60218fffd6d0474eb78f72067330b347-bcmdhd_mon.bin_b1
12d4278041f104ffd6276a5a76a1a4820c4439bc6871ccde48eb6cd9ea474cbaf3fe75cd667ac86c16c320adadbf914d1b454ce00dace61eb3949d91ef06c622 firmware-samsung-beyond2lte-7f9ff5be60218fffd6d0474eb78f72067330b347-bcmdhd_sta.bin_b1
a18ceea8b753102bfacdcc713eb6d22e942adc7ded2232fcf3d2e02b4ba780b588d40f91f3994d3e87fe04ab318f561171adcd80ab1a1730fcf33e70f87402f2 firmware-samsung-beyond2lte-7f9ff5be60218fffd6d0474eb78f72067330b347-nvram.txt_ES00_semco_b0
aa3a52150f87c60b77e2b9df8e3e19d60cdedfe9137be67c25466e068b33ff53d587b96e0657721d37002e44af9b8b86a0c92948da7927900ea3a783afd41d73 firmware-samsung-beyond2lte-7f9ff5be60218fffd6d0474eb78f72067330b347-nvram.txt_ES01_semco_b0
6887150124ea7227833104e8eacdaf305fcb4c57755fd44a2ae3d8b2c2565a6c282875923967a889c672f5992485849174d981eba2f9fd95e90f15cf03ebbe47 firmware-samsung-beyond2lte-7f9ff5be60218fffd6d0474eb78f72067330b347-nvram.txt_ES02_semco_b0
d1219801334a83537f1b410abdb058eef8a4b600ddd23d73d078d5b682a067cf1d128e9b1b2484864205d3c56937896e9440a350ba0424102cf4823c78acba1a firmware-samsung-beyond2lte-7f9ff5be60218fffd6d0474eb78f72067330b347-bcmdhd_clm.blob
e8263dc21849228b88a61ab9ab1c5bf3f9e6742e0d6125f28c65ee1bf54bdd473e72e608fb6eede5727aa8ea881e215326289a601274e34757f9665e4214f2e4 firmware-samsung-beyond2lte-7f9ff5be60218fffd6d0474eb78f72067330b347-nvram.txt_1rh_es11_b0
f95cb09859718fde6df2c9e2f855c0280ff97d94d57e40aeaa7639d6b7200cd0a5ced7d9afc0b69504c981a85f969d9d58c3be16585ab98c7212be70bde1bca6 firmware-samsung-beyond2lte-7f9ff5be60218fffd6d0474eb78f72067330b347-nvram.txt_1rh_es12_b0
2448da911a6007352cfa5c693f450f12e55d9b9758e86dcf4b0bbdf418fa3424d5f495d8a198f172d99a6aed217915a7ab7aa531780fedf8efe5a1846b82b328 firmware-samsung-beyond2lte-7f9ff5be60218fffd6d0474eb78f72067330b347-nvram.txt_1rh_es13_b0
5fd0705c58b72463282145ca69523ed38a1a5b6ca2e1c549dacc3d5160f727e92d2dfe65cc3fc2440819ddf3dfc2f6724350e00c029967651ad7a3b95ab8e08f firmware-samsung-beyond2lte-7f9ff5be60218fffd6d0474eb78f72067330b347-nvram.txt_1rh_es43_b1
e33ccf8bbf04b0350deecc79b1a31b638365568ac3f496898cb3865f9b8bdc48c05db36caa2baaee1dde377e576ac3e9ccbc9f58dcb57f892b7f9f7d37bc13f9 firmware-samsung-beyond2lte-7f9ff5be60218fffd6d0474eb78f72067330b347-nvram.txt_CS01_semco_b1
b2aea1ed59a57ea3934049bb6d787e2ed85458d646c1dd95d2dec299d428e60081d7ca78b47aee1ae4b99d941a80db900501a8824598141d1d8eb858888d10b4 firmware-samsung-beyond2lte-7f9ff5be60218fffd6d0474eb78f72067330b347-nvram.txt_ES03_semco_b0
"

View file

@ -0,0 +1,65 @@
# Reference: <https://postmarketos.org/vendorkernel>
# Kernel config based on: arch/arm64/configs/exynos9820-beyond2lte_defconfig
pkgname=linux-samsung-beyond2lte
pkgver=4.14.316
pkgrel=0
pkgdesc="Samsung Galaxy S10+ kernel fork"
arch="aarch64"
_carch="arm64"
_flavor="samsung-beyond2lte"
url="https://kernel.org"
license="GPL-2.0-only"
options="!strip !check !tracedeps pmb:cross-native"
makedepends="
bash
bc
bison
clang
devicepkg-dev
findutils
flex
openssl-dev
perl
"
export CC="clang"
export HOSTCC="clang"
# Source
_repository="android_kernel_samsung_exynos9820"
_commit="7d08ec364a0659edcf90a8dae4453b21e4542311"
_config="config-$_flavor.$arch"
source="
$pkgname-$_commit.tar.gz::https://github.com/LineageOS/$_repository/archive/$_commit.tar.gz
$_config
remove-header-lkc.patch
fix-check-lxdialog.patch
selinux_include_generated_headers.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() {
downstreamkernel_package "$builddir" "$pkgdir" "$_carch" "$_flavor" "$_outdir"
}
sha512sums="
8ac222f644a534204fd5ea5e657991214bfc069042b48620b956ce0c249af6639b9a18c20892481c8514d2cdd3c3bd967062a4d16ba53504fd76d1227a365d44 linux-samsung-beyond2lte-7d08ec364a0659edcf90a8dae4453b21e4542311.tar.gz
88c92dc69a3564d8fb1460490fa7324761f7e1bc12e53e67c515de1ad624095cec321134b1f8359ed641cda7b06f13283c4574aa6ec6b6afde2e392ad6d51b9e config-samsung-beyond2lte.aarch64
1872a4d9963f128965ab46b329d448e6b776d373cf99f2b8e11d025aa3e10a0308da19beb715c6bdced0b2c6ef44c47a5c013554a19787a64f8ac58d34bc912f remove-header-lkc.patch
f6627992b6a9626fa2db1145f1babddfa5e865115842a967a466568659d28549aa09d29a069d66651ca16c4155b52342272c9499df5c9b58d405810213032609 fix-check-lxdialog.patch
6ab9db01d35f7f5cc2c19ebe5f65a7dc479a1c68de587300cdde9a6c759d34610666c72f0f321cd450cf56c13df3b54a774e0f7ebdbf0f8608fbfd66b49d04e7 selinux_include_generated_headers.patch
"

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,35 @@
diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile
index 844bc9da..911c6ba1 100644
--- a/scripts/kconfig/Makefile
+++ b/scripts/kconfig/Makefile
@@ -192,6 +192,8 @@ clean-files += zconf.tab.c zconf.lex.c zconf.hash.c gconf.glade.h
clean-files += mconf qconf gconf nconf
clean-files += config.pot linux.pot
+HOSTLOADLIBES_mconf = $(shell $(CONFIG_SHELL) $(check-lxdialog) -ldflags $(HOSTCC))
+
# Check that we have the required ncurses stuff installed for lxdialog (menuconfig)
PHONY += $(obj)/dochecklxdialog
$(addprefix $(obj)/,$(lxdialog)): $(obj)/dochecklxdialog
@@ -217,8 +219,6 @@ HOSTLOADLIBES_gconf = `pkg-config --libs gtk+-2.0 gmodule-2.0 libglade-2.0`
HOSTCFLAGS_gconf.o = `pkg-config --cflags gtk+-2.0 gmodule-2.0 libglade-2.0` \
-Wno-missing-prototypes
-HOSTLOADLIBES_mconf = $(shell $(CONFIG_SHELL) $(check-lxdialog) -ldflags $(HOSTCC))
-
HOSTLOADLIBES_nconf = $(shell \
pkg-config --libs menu panel ncurses 2>/dev/null \
|| echo "-lmenu -lpanel -lncurses" )
diff --git a/scripts/kconfig/lxdialog/check-lxdialog.sh b/scripts/kconfig/lxdialog/check-lxdialog.sh
index 9d2a4c58..364eaecb 100644
--- a/scripts/kconfig/lxdialog/check-lxdialog.sh
+++ b/scripts/kconfig/lxdialog/check-lxdialog.sh
@@ -43,7 +43,7 @@ trap "rm -f $tmp" 0 1 2 3 15
check() {
$cc -x c - -o $tmp 2>/dev/null <<'EOF'
#include CURSES_LOC
-main() {}
+int main() { return 0; }
EOF
if [ $? != 0 ]; then
echo " *** Unable to find the ncurses libraries or the" 1>&2

View file

@ -0,0 +1,13 @@
diff --git a/scripts/kconfig/lkc.h b/scripts/kconfig/lkc.h
index e2fc50ae4b90..63627df05e89 100644
--- a/scripts/kconfig/lkc.h
+++ b/scripts/kconfig/lkc.h
@@ -12,7 +12,7 @@
# include <libintl.h>
#else
# include <features.h>
-__attribute_format_arg__(1)
+
static inline const char *gettext(const char *txt) { return txt; }
static inline void textdomain(const char *domainname) {}
static inline void bindtextdomain(const char *name, const char *dir) {}

View file

@ -0,0 +1,33 @@
Arm64 has generated headers that other arches don't, didn't investigate why this
is able to compile in downstream (our upstream). Possibly due to out-of-tree build.
Note the hacky relative include. May not work in more complicated setups.
diff --git a/scripts/selinux/genheaders/Makefile b/scripts/selinux/genheaders/Makefile
index e8c533140..62475f060 100644
--- a/scripts/selinux/genheaders/Makefile
+++ b/scripts/selinux/genheaders/Makefile
@@ -2,6 +2,8 @@
hostprogs-y := genheaders
HOST_EXTRACFLAGS += \
-I$(srctree)/include/uapi -I$(srctree)/include \
- -I$(srctree)/security/selinux/include
+ -I$(srctree)/security/selinux/include \
+ -I./arch/$(ARCH)/include/generated/uapi \
+ -I$(srctree)/arch/$(ARCH)/include/uapi
always := $(hostprogs-y)
diff --git a/scripts/selinux/mdp/Makefile b/scripts/selinux/mdp/Makefile
index e9c92db7e..09e626fa4 100644
--- a/scripts/selinux/mdp/Makefile
+++ b/scripts/selinux/mdp/Makefile
@@ -2,7 +2,9 @@
hostprogs-y := mdp
HOST_EXTRACFLAGS += \
-I$(srctree)/include/uapi -I$(srctree)/include \
- -I$(srctree)/security/selinux/include
+ -I$(srctree)/security/selinux/include \
+ -I./arch/$(ARCH)/include/generated/uapi \
+ -I$(srctree)/arch/$(ARCH)/include/uapi
always := $(hostprogs-y)
clean-files := policy.* file_contexts