Skip to content
Snippets Groups Projects
Commit 76c0923d authored by Dzmitry Sankouski's avatar Dzmitry Sankouski Committed by Dzmitry
Browse files

samsung-starqltechn: add device SM-G9600

Device uses mainline kernel. What works:
- boots
- pstore log

* payload mock device tree:

Payload mock device tree is needed to mock device tree,
when we're overriding linux with u-boot in android boot image.
Stock bootloader needs this dtb appended to gzipped u-boot.

Bootscript is a simple hush shell script, dedicated to boot OS.
It may be customized to implement dual boot.
parent fe05f5b8
No related branches found
No related tags found
No related merge requests found
# Reference: <https://postmarketos.org/devicepkg>
pkgname="device-samsung-starqltechn"
pkgdesc="Samsung Galaxy S9"
pkgver=0.1
pkgrel=0
url="https://postmarketos.org"
license="MIT"
arch="aarch64"
options="!check !archcheck"
depends="postmarketos-base linux-postmarketos-qcom-sdm845-starqltechn mesa-dri-swrast mkbootimg u-boot"
makedepends="devicepkg-dev linux-postmarketos-qcom-sdm845-starqltechn postmarketos-mkinitfs dtc"
source="deviceinfo *.its payload_mock.dts bootscript.sh"
build() {
devicepkg_build $startdir $pkgname
}
package() {
devicepkg_package $startdir $pkgname
mkdir -p "$pkgdir"/usr/share/u-boot/starqltechn/
payload_mock_dtb="$builddir/payload_mock.dtb"
dtc -I dts -O dtb -o "$payload_mock_dtb" "$srcdir/payload_mock.dts"
install -D -m644 "$payload_mock_dtb" \
"$pkgdir"/usr/share/u-boot/starqltechn/payload_mock.dtb
install -D -m644 "$srcdir/"*.its \
"$pkgdir"/usr/share/u-boot/starqltechn/
install -D -m644 "$srcdir/"bootscript.sh \
"$pkgdir"/usr/share/u-boot/starqltechn/
}
sha512sums="
0c9e31466939ccc79d1cc33a0393c98541f09ca67ef6362fb3b4bb7902a7aabc0748f591228265d07a90dab1ccf8b74cbe2e7fe97b98a3c0dc17aa64be9e0778 deviceinfo
8e33da25b994a6258e0c1769182d873428c311158f420c28d91566b7d1eb9809b0076a5a2b41726ff5039859dd7c2e1c13efd608dc707fc3b6bc9d93ef147cde boot_image.its
ba782c324c14cf0947c752b51a607ae1b08def885b0cf0afe89d1fcade3491ab2f547551eb08bd8074f608dac46bdcdf75c5c633bd7a15e6eb63a10f30994c82 payload_mock.dts
ec5766ff9329f0e54e76ba1aebfe15545bfd9a31b60a5bf26676023567548615e8d9e92f9e2a1d712471ede043c273eda6ed90f2084235ebb270d0fcff5082fc bootscript.sh
"
/dts-v1/;
/ {
description = "Samsung S9 SM-G9600 starqltechn FIT Image";
#address-cells = <1>;
images {
bootscript {
description = "Boot script";
data = /incbin/("bootscript.sh");
type = "script";
compression = "none";
load = <0x90000000>;
entry = <0x90000000>;
hash {
algo = "sha1";
};
};
kernel {
description = "Kernel";
data = /incbin/("vmlinuz");
type = "kernel";
arch = "arm64";
os = "linux";
compression = "gzip";
load = <0x80000000>;
entry = <0x80000000>;
hash {
algo = "sha1";
};
};
fdt {
description = "DTB";
data = /incbin/("/usr/share/dtb/qcom/sdm845-samsung-starqltechn.dtb");
type = "flat_dt";
arch = "arm64";
compression = "none";
load = <0x81a80000>;
entry = <0x81a80000>;
hash {
algo = "sha1";
};
};
initrd {
description = "Initrd";
compression = "none";
data = /incbin/("initramfs");
type = "ramdisk";
arch = "arm64";
load = <0x81000000>;
os = "linux";
hash {
algo = "sha1";
};
};
};
configurations {
default = "standard";
standard {
description = "Standard Boot";
kernel = "kernel";
fdt = "fdt";
ramdisk = "initrd";
hash {
algo = "sha1";
};
};
};
};
bootm $prevbl_initrd_start_addr
\ No newline at end of file
# 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 S9"
deviceinfo_manufacturer="Samsung"
deviceinfo_codename="samsung-starqltechn"
deviceinfo_boardname="starqltechn"
deviceinfo_year="2018"
deviceinfo_dtb=""
deviceinfo_modules_initfs=""
deviceinfo_arch="aarch64"
# Device related
deviceinfo_chassis="handset"
deviceinfo_keyboard="false"
deviceinfo_external_storage="true"
deviceinfo_screen_width="2960"
deviceinfo_screen_height="1440"
deviceinfo_dev_touchscreen=""
deviceinfo_dev_touchscreen_calibration=""
# Bootloader related
deviceinfo_flash_method="heimdall-isorec"
deviceinfo_kernel_cmdline="console=null androidboot.hardware=qcom video=vfb:640x400,bpp=32,memsize=3072000 msm_rtb.filter=0x237 ehci-hcd.park=3 lpm_levels.sleep_disabled=1 service_locator.enable=1 swiotlb=2048"
deviceinfo_generate_bootimg="true"
deviceinfo_generate_uboot_fit_images="true"
deviceinfo_bootimg_qcdt="false"
deviceinfo_bootimg_dtb_second="false"
deviceinfo_bootimg_override_payload="u-boot.bin"
deviceinfo_bootimg_override_payload_compression="gzip"
deviceinfo_bootimg_override_payload_append_dtb="payload_mock.dtb"
deviceinfo_bootimg_override_initramfs="boot_image.itb"
deviceinfo_flash_offset_base="0x00000000"
deviceinfo_flash_offset_kernel="0x00008000"
deviceinfo_flash_offset_ramdisk="0x02000000"
deviceinfo_flash_offset_second="0x00f00000"
deviceinfo_flash_offset_tags="0x01e00000"
deviceinfo_flash_pagesize="4096"
deviceinfo_flash_heimdall_partition_kernel="boot"
deviceinfo_flash_heimdall_partition_initfs="boot"
deviceinfo_flash_heimdall_partition_system="system"
/dts-v1/;
/ {
memory {
/* We expect the bootloader to fill in the size */
reg = <0 0 0 0>;
};
chosen { };
};
\ No newline at end of file
# Temprorary package, based on linux-postmarketos-qcom-sdm845
_flavor="postmarketos-qcom-sdm845-starqltechn"
pkgname=linux-$_flavor
pkgver=5.10.12
pkgrel=1
pkgdesc="Mainline Kernel fork for starqltechn"
arch="aarch64"
_carch="arm64"
url="https://gitlab.com/dsankouski"
license="GPL-2.0-only"
options="!strip !check !tracedeps
pmb:cross-native
pmb:kconfigcheck-nftables
pmb:kconfigcheck-containers
pmb:kconfigcheck-zram
pmb:kconfigcheck-anbox"
makedepends="bison findutils flex installkernel openssl-dev perl"
_repo="sdm845-linux-next"
_config="config-$_flavor.$arch"
_commit="d3aaebf8c611a24bf9876d5961acfc1d1a373ab9"
# Source
source="
$_repo-$_commit.tar.gz::$url/$_repo/-/archive/$_commit/$_repo-$_commit.tar.gz
$_config
"
builddir="$srcdir/$_repo-$_commit"
prepare() {
default_prepare
cp "$srcdir/config-$_flavor.$arch" .config
}
build() {
unset LDFLAGS
make ARCH="$_carch" CC="${CC:-gcc}" \
KBUILD_BUILD_VERSION="$((pkgrel + 1 ))-$_flavor"
}
package() {
mkdir -p "$pkgdir"/boot
install -Dm644 "$builddir/arch/$_carch/boot/Image.gz" \
"$pkgdir/boot/vmlinuz"
make modules_install dtbs_install \
ARCH="$_carch" \
INSTALL_PATH="$pkgdir"/boot/ \
INSTALL_MOD_PATH="$pkgdir" \
INSTALL_MOD_STRIP=1 \
INSTALL_DTBS_PATH="$pkgdir"/usr/share/dtb
rm -f "$pkgdir"/lib/modules/*/build "$pkgdir"/lib/modules/*/source
install -D "$builddir"/include/config/kernel.release \
"$pkgdir"/usr/share/kernel/$_flavor/kernel.release
}
sha512sums="
d0733263feb6b3d2487eabbd3605e75e744c59f758b4c4b12bfcedc6748e1cf91ead54ffc2850ed391a181b8c8a2aef4c3ae858ac55649aab77058e1dd670fc0 sdm845-linux-next-d3aaebf8c611a24bf9876d5961acfc1d1a373ab9.tar.gz
13df82fde5b1a72a2b34852fb8ed354a0cd1845c3628b797406cb2c9a1b6b64e119397b54e46f42528d20c5ea157363b384968d1cf155a81cfc17a5f1e8a6508 config-postmarketos-qcom-sdm845-starqltechn.aarch64
"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment