diff --git a/device/testing/device-motorola-rtwo/APKBUILD b/device/testing/device-motorola-rtwo/APKBUILD index ad160d720..7a2f9e579 100644 --- a/device/testing/device-motorola-rtwo/APKBUILD +++ b/device/testing/device-motorola-rtwo/APKBUILD @@ -2,7 +2,7 @@ maintainer="snlavaise " pkgname=device-motorola-rtwo pkgver=1 -pkgrel=11 +pkgrel=12 pkgdesc="Motorola Moto Edge 40 Pro" url="https://postmarketos.org" arch="aarch64" @@ -36,6 +36,6 @@ package() { } sha512sums=" -1493ab4b2572a0245a189d3c8e1a53130cad87d999eb20e6d674d6aea4530b527f3478491ff1247adbd78b84e38eb3c7f404cafad1640726eeb21983aed613c6 deviceinfo +9ec843d537c386e5de46b345e70d7b68a3d5b175720b8b3c5731e73f68b3691c2b8aedaed8a90047e246117de46265a57737428b5c75caa94618c8ef4ad5865c deviceinfo c572e21cb0624b554a22a218b0c4faab9b6412654bed6bfef530f3068d076b21c573bd7f4b3ca65f510f8756f636a861191cce925ef49587db7d68d09558826c modules-initfs " diff --git a/device/testing/device-motorola-rtwo/deviceinfo b/device/testing/device-motorola-rtwo/deviceinfo index 81857f08a..e179d13af 100644 --- a/device/testing/device-motorola-rtwo/deviceinfo +++ b/device/testing/device-motorola-rtwo/deviceinfo @@ -8,6 +8,7 @@ deviceinfo_manufacturer="Motorola" deviceinfo_codename="motorola-rtwo" deviceinfo_year="2023" deviceinfo_dtb="qcom/sm8550-motorola-rtwo" +deviceinfo_append_dtb="true" deviceinfo_arch="aarch64" # Device related @@ -17,30 +18,29 @@ deviceinfo_external_storage="true" deviceinfo_screen_width="1080" deviceinfo_screen_height="2400" deviceinfo_getty="ttyMSM0;115200" - -# The DTS ships a simple-framebuffer pointing at the bootloader's continuous -# splash buffer, so there should be an early console on the panel. If the -# screen stays black, set this to "true" (and fix the framebuffer@ node). -# There is no DRM/mdss yet, so no mode setting / backlight control. deviceinfo_no_framebuffer="true" -# Split the initramfs: a small base archive (fits in init_boot, 8 MB) plus a -# separate initramfs-extra loaded from the rootfs later. deviceinfo_create_initfs_extra="true" -# Bootloader related +# Bootloader related. Modelled on device-motorola-dubai (Motorola Edge 30, +# the closest working Motorola mainline port): monolithic header v2 boot.img +# with the DTB appended to the kernel, flashed to the boot partition. deviceinfo_flash_method="fastboot" deviceinfo_flash_fastboot_partition_dtbo="dtbo" deviceinfo_flash_fastboot_partition_vbmeta="vbmeta" -deviceinfo_kernel_cmdline="console=ttyMSM0,115200n8 ignore_loglevel" +# 'earlycon' is REQUIRED: the Motorola ABL reboots the phone immediately +# without it (see device-motorola-dubai/kernel-cmdline.conf). +deviceinfo_kernel_cmdline="console=ttyMSM0,115200n8 earlycon" deviceinfo_generate_bootimg="true" -# The Motorola bootloader places the DTB / kernel at the addresses in the -# vendor_boot header. mkbootimg defaults to base 0x10000000 (dtb ends up at -# 0x11f00000, outside RAM) - stock uses base 0. Force the stock layout. -deviceinfo_bootimg_custom_args="--base 0x00000000 --kernel_offset 0x00008000 --ramdisk_offset 0x01000000 --tags_offset 0x00000100 --dtb_offset 0x01f00000 --os_version 16.0.0 --os_patch_level 2026-08" -deviceinfo_bootimg_qcdt="false" -deviceinfo_header_version="4" +deviceinfo_header_version="2" deviceinfo_flash_pagesize="4096" +deviceinfo_flash_offset_base="0x00000000" +deviceinfo_flash_offset_kernel="0x00008000" +deviceinfo_flash_offset_ramdisk="0x01000000" +deviceinfo_flash_offset_second="0x00000000" +deviceinfo_flash_offset_tags="0x00000100" +deviceinfo_flash_offset_dtb="0x01f00000" +deviceinfo_bootimg_custom_args="--os_patch_level 2026-08-01" deviceinfo_flash_sparse="true" # UFS storage diff --git a/device/testing/linux-postmarketos-qcom-sm8550/APKBUILD b/device/testing/linux-postmarketos-qcom-sm8550/APKBUILD index 130e2df04..d75187ac5 100644 --- a/device/testing/linux-postmarketos-qcom-sm8550/APKBUILD +++ b/device/testing/linux-postmarketos-qcom-sm8550/APKBUILD @@ -5,7 +5,7 @@ maintainer="snlavaise " _flavor="postmarketos-qcom-sm8550" pkgname=linux-$_flavor pkgver=7.2 -pkgrel=8 +pkgrel=9 pkgdesc="Mainline kernel for Qualcomm SM8550 (Snapdragon 8 Gen 2) + Motorola rtwo" arch="aarch64" _carch="arm64" @@ -74,10 +74,9 @@ build() { } package() { - # The Motorola bootloader boots a *raw* uncompressed arm64 Image - # (BOARD_KERNEL_IMAGE_NAME := Image); Image.gz / vmlinuz.efi make it - # reset in <2s. CONFIG_EFI_ZBOOT is off in rtwo.config. - install -Dm644 "$builddir/arch/$_carch/boot/Image" \ + # gzip'd Image for the Android boot.img (like device-motorola-dubai; + # CONFIG_EFI_ZBOOT is off in rtwo.config so Image.gz is produced). + install -Dm644 "$builddir/arch/$_carch/boot/Image.gz" \ "$pkgdir/boot/vmlinuz" make modules_install dtbs_install \ @@ -87,26 +86,12 @@ package() { INSTALL_MOD_STRIP=1 \ INSTALL_DTBS_PATH="$pkgdir"/boot/dtbs - # Android DT-overlay image with a single no-op overlay. The bootloader - # would otherwise apply the stock kalama dtbo overlay onto our mainline - # base DTB - the phandles don't match, the merged tree is corrupt and - # the kernel panics. A no-op overlay keeps the base DTB intact. (A - # zero-entry table fails Motorola's pre-flash validation.) + # All-zero dtbo image (full partition size), same trick as + # device-motorola-dubai: the bootloader finds no valid DT-overlay + # table magic and applies nothing, so the stock kalama overlay does + # not get merged onto our mainline base DTB. mkdir -p "$pkgdir"/boot - printf '/dts-v1/;\n/plugin/;\n/ { };\n' > "$srcdir"/empty-overlay.dts - scripts/dtc/dtc -@ -O dtb -o "$srcdir"/empty.dtbo "$srcdir"/empty-overlay.dts - python3 - "$srcdir/empty.dtbo" "$pkgdir/boot/dtbo.img" <<-'EOF' - import struct, sys - fdt = open(sys.argv[1], "rb").read() - hdr_sz = ent_sz = 32 - ent_off = hdr_sz + ent_sz - hdr = struct.pack(">IIIIIIII", 0xd7b7ab1e, ent_off + len(fdt), - hdr_sz, ent_sz, 1, hdr_sz, 2048, 0) - ent = struct.pack(">IIIIIIII", len(fdt), ent_off, 0, 0, 0, 0, 0, 0) - blob = hdr + ent + fdt - blob += b"\x00" * ((4096 - len(blob) % 4096) % 4096) - open(sys.argv[2], "wb").write(blob) - EOF + dd if=/dev/zero of="$pkgdir/boot/dtbo.img" bs=1M count=24 status=none rm -f "$pkgdir"/usr/lib/modules/*/build "$pkgdir"/usr/lib/modules/*/source