samsung-i9100g: new device (MR 2493)

[ci:skip-build] Already built on CI in MR
This commit is contained in:
Ungeskriptet 2021-09-13 09:15:41 +02:00 committed by Alexey Minnekhanov
parent 402ad5deaa
commit 08462de926
No known key found for this signature in database
GPG key ID: EBF5ECFFFEE34DED
12 changed files with 3077 additions and 0 deletions

View file

@ -0,0 +1,39 @@
# Reference: <https://postmarketos.org/devicepkg>
pkgname=device-samsung-i9100g
pkgdesc="Samsung Galaxy SII (GT-I9100G)"
pkgver=0.1
pkgrel=0
url="https://postmarketos.org"
license="MIT"
arch="armv7"
options="!check !archcheck"
depends="
linux-samsung-i9100g
mesa-dri-gallium
postmarketos-base
"
makedepends="devicepkg-dev"
subpackages="$pkgname-nonfree-firmware:nonfree_firmware"
source="
deviceinfo
modules-load.conf
"
build() {
devicepkg_build $startdir $pkgname
}
package() {
devicepkg_package $startdir $pkgname
}
nonfree_firmware() {
pkgdesc="WiFi firmware"
depends="firmware-samsung-i9100"
mkdir "$subpkgdir"
}
sha512sums="
b5ae5d9fb240b9a7edf594d10f30f550c302eda786d1cc0466aa9525dcb943a7002b3c0979bff4efd599003d5bcf1c9b48a3976a9fdca13627a957941b89bcb4 deviceinfo
2a9b4212269ca367effb8c336cf8432498297988b3cb2b1ea4bef0ce4bcc1ed2975f8a798ef9b4c3131f7e2366e25c2c1abafe9302bee6679ed6440ba10c3d36 modules-load.conf
"

View file

@ -0,0 +1,26 @@
# 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 SII (GT-I9100G)"
deviceinfo_manufacturer="Samsung"
deviceinfo_codename="samsung-i9100g"
deviceinfo_year="2011"
deviceinfo_dtb=""
deviceinfo_modules_initfs=""
deviceinfo_arch="armv7"
# Device related
deviceinfo_chassis="handset"
deviceinfo_keyboard="false"
deviceinfo_external_storage="true"
deviceinfo_screen_width="480"
deviceinfo_screen_height="800"
# Bootloader related
deviceinfo_flash_method="heimdall-isorec"
deviceinfo_flash_heimdall_partition_kernel="KERNEL"
deviceinfo_flash_heimdall_partition_initfs="RECOVERY"
deviceinfo_flash_heimdall_partition_system="DATAFS"
deviceinfo_flash_sparse="true"

View file

@ -0,0 +1,5 @@
# This file contains the names of kernel modules that should be loaded
# at boot time, one per line. Lines beginning with "#" are ignored.
# WiFi module
dhd firmware_path=/lib/firmware/postmarketos/brcm/brcmfmac4330-sdio.bin nvram_path=/lib/firmware/postmarketos/brcm/brcmfmac4330-sdio.samsung,i9100.txt

View file

@ -0,0 +1,27 @@
From 7041266a29e9681fc13034f345cdcc269d672f83 Mon Sep 17 00:00:00 2001
From: Alejandro Mery <amery@geeks.cl>
Date: Fri, 11 May 2012 23:57:15 +0200
Subject: [PATCH] security: fixed to build with ANDROID_PARANOID_NETWORK
disabled
---
security/commoncap.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/security/commoncap.c b/security/commoncap.c
index ccfe568b396fb..8bfbd13497467 100644
--- a/security/commoncap.c
+++ b/security/commoncap.c
@@ -88,10 +88,12 @@ EXPORT_SYMBOL(cap_netlink_recv);
int cap_capable(struct task_struct *tsk, const struct cred *cred,
struct user_namespace *targ_ns, int cap, int audit)
{
+#ifdef CONFIG_ANDROID_PARANOID_NETWORK
if (cap == CAP_NET_RAW && in_egroup_p(AID_NET_RAW))
return 0;
if (cap == CAP_NET_ADMIN && in_egroup_p(AID_NET_ADMIN))
return 0;
+#endif
for (;;) {
/* The creator of the user namespace has all caps. */

View file

@ -0,0 +1,104 @@
# Reference: <https://postmarketos.org/vendorkernel>
# Kernel config based on: arch/arm/configs/cyanogenmod_i9100g_defconfig
pkgname=linux-samsung-i9100g
pkgver=3.0.101
pkgrel=0
pkgdesc="Samsung Galaxy SII (GT-I9100G) kernel fork"
arch="armv7"
_carch="arm"
_flavor="samsung-i9100g"
url="https://kernel.org"
license="GPL-2.0-only"
options="!strip !check !tracedeps pmb:cross-native"
makedepends="
bash
bc
bison
devicepkg-dev
flex
openssl-dev
perl
findutils
busybox-static-armv7
xz
"
# Source
_repository="android_kernel_samsung_t1"
_commit="10ca03795f659f6f1fa995e8c300a08c3a133354"
_config="config-$_flavor.$arch"
source="
$pkgname-$_commit.tar.gz::https://github.com/LineageOS/$_repository/archive/$_commit.tar.gz
$_config
gcc7-give-up-on-ilog2-const-optimizations.patch
gcc8-fix-put-user.patch
gcc10-extern_YYLOC_global_declaration.patch
kernel-use-the-gnu89-standard-explicitly.patch
timeconst.pl-Eliminate-Perl-warning.patch
01_fix_aid_net_on_apn_disable.patch
init
"
builddir="$srcdir/$_repository-$_commit"
_outdir="out"
prepare_isorec() {
# Use Alpine's busybox.static instead of the pre-compiled busybox shipped
# with the source
cp -v /usr/$(arch_to_hostspec $arch)/bin/busybox.static \
"$builddir"/usr/i9100g_initramfs_files/busybox
# do not use ramdisk.cpio and ramdisk-recovery-device.cpio, always use
# the initramfs from the recovery partition ("isorec"), so we can build
# it later and independently from the kernel. also directly boot that
# partition, not only when the recovery key combination was used.
cd "$builddir"/usr/
mv i9100g_initramfs.list i9100g_initramfs.list_old
grep -v "../../ramdisk" i9100g_initramfs.list_old > i9100g_initramfs.list
cp -v "$srcdir"/init "$builddir"/usr/i9100g_initramfs_files/init
# Paths supplied to gen_initramfs_list.sh are prefixed with "source/".
ln -s "$builddir" "$builddir"/source
cd "$builddir"
}
prepare() {
default_prepare
prepare_isorec
. downstreamkernel_prepare
}
build() {
unset LDFLAGS
make O="$_outdir" ARCH="$_carch" CC="${CC:-gcc}" \
KBUILD_BUILD_VERSION="$((pkgrel + 1 ))-postmarketOS"
# the 'no-pic' flag is necessary to avoid the
# error 'Unknown symbol _GLOBAL_OFFSET_TABLE_ (err 0)' when loading the module
make O="$_outdir" ARCH="$_carch" CC="${CC:-gcc}" \
KBUILD_BUILD_VERSION="$((pkgrel + 1 ))-postmarketOS" \
CFLAGS_MODULE="-fno-pic" modules
}
package() {
downstreamkernel_package "$builddir" "$pkgdir" "$_carch" "$_flavor" "$_outdir"
unset LDFLAGS
make O="$_outdir" ARCH="$_carch" CC="${CC:-gcc}" \
KBUILD_BUILD_VERSION="$((pkgrel + 1 ))-postmarketOS" \
INSTALL_MOD_PATH="$pkgdir" INSTALL_MOD_STRIP=1 modules_install
}
sha512sums="
b50bfa745dfabff5d415833f55e72c0e78d2df4ab14340ce99be94a8ef1871cb23b138b36416d58bd276e3629bfe527520eeff17892ccd000d8b67dba43845b9 linux-samsung-i9100g-10ca03795f659f6f1fa995e8c300a08c3a133354.tar.gz
44950920f4a8c89ef292e4ae78948eb06231c0866e93cba27a9755f52646e65cc844c8b13dddd8f672428057064865d44c45f0074c726942fc94f74a59f110fe config-samsung-i9100g.armv7
77eba606a71eafb36c32e9c5fe5e77f5e4746caac292440d9fb720763d766074a964db1c12bc76fe583c5d1a5c864219c59941f5e53adad182dbc70bf2bc14a7 gcc7-give-up-on-ilog2-const-optimizations.patch
197d40a214ada87fcb2dfc0ae4911704b9a93354b75179cd6b4aadbb627a37ec262cf516921c84a8b1806809b70a7b440cdc8310a4a55fca5d2c0baa988e3967 gcc8-fix-put-user.patch
2b48f1bf0e3f70703d2cdafc47d5e615cc7c56c70bec56b2e3297d3fa4a7a1321d649a8679614553dde8fe52ff1051dae38d5990e3744c9ca986d92187dcdbeb gcc10-extern_YYLOC_global_declaration.patch
ad0182a483791fc88e058838bc331b2f04a75ba291e763767babdb815efadfc3b4fda97e69e2e3f00a426cabea088e35297a92bd287592597d1e309be68ee92c kernel-use-the-gnu89-standard-explicitly.patch
1fcfb5f06a2bfdcc55d53054ca80d1b989599a39a5379d057a0724fc405187d74da4309a650e70b9c79d39444e81923cfc5c9199ed8c0a77c83dcd7998446bb7 timeconst.pl-Eliminate-Perl-warning.patch
1cae09c775d787e877f82cb164b5d68530f4bd9b108b7abaf8192bd85a3d8975456762ce9f563fa766b1c03519e09ef93e177fd6972e439e4aa0c3a5709ea691 01_fix_aid_net_on_apn_disable.patch
dd4094d5f4ec281d32f12af88cb22a782e497c8e52f69cf60b73ac7d6171fc95f1f8040b3d0ad2ff3f016d22ac1d91c5b522e5d03203534a76742bc55a082af5 init
"

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1 @@
../../.shared-patches/linux/gcc10-extern_YYLOC_global_declaration.patch

View file

@ -0,0 +1 @@
../../.shared-patches/linux/gcc7-give-up-on-ilog2-const-optimizations.patch

View file

@ -0,0 +1 @@
../../.shared-patches/linux/gcc8-fix-put-user.patch

View file

@ -0,0 +1,29 @@
#!/stage1/busybox sh
# Samsung kernels come with their own initramfs, which extract and load another
# initramfs. Usually that depends on the recovery key combination being pressed
# or not. For simplicity, we always boot the recovery image (from the recovery
# partition) here.
_PATH="$PATH"
export PATH=/stage1
busybox cd /
busybox date >>boot.txt
exec >>boot.txt 2>&1
busybox rm init
busybox mount -t proc proc /proc
busybox mount -t sysfs sysfs /sys
# always use the "isorec"-style lzop compressed initramfs
# from the recovery partition
load_image=/stage1/isorec.cpio
busybox lzop -dc /dev/block/mmcblk0p6 > ${load_image}
busybox cpio -i < ${load_image}
busybox umount /sys
busybox umount /proc
busybox date >>boot.txt
busybox rm -fr /stage1 /dev/*
export PATH="${_PATH}"
exec /init

View file

@ -0,0 +1 @@
../../.shared-patches/linux/kernel-use-the-gnu89-standard-explicitly.patch

View file

@ -0,0 +1 @@
../../.shared-patches/linux/timeconst.pl-Eliminate-Perl-warning.patch