Files
makronix/mobile/tools/build-kernel.sh
T
lotherkandClaude Opus 5.5 c520f2ea26 mobile: hotdogb DTS in the kernel series, OTG, BTF, wall clock, warnings fixed
- kernel/patches 0007-0012: the DTS of the baseline moves into the tree
  (0007, with the PON modes), the ABL framebuffer is reserved memory (0008),
  msm's fbdev marks its memory virtual (0009), the MDSS no longer resets
  the Ethernet MAC (0010; the real dispcc reset leaves the panel white,
  measured), u_serial closes a hung-up port once (0011, the gs_close WARN),
  USB dual role with the pm8150b Type-C port (0012).
- KERNEL_DTB in device.conf: tools/build-kernel.sh builds the DTB in the
  tree, mkbootimg takes it from there; the binary DTB and its pin are gone.
- kernel.config: BTF (pahole 1.32 on the host).
- rtc-offset: the wall clock across reboots on the read-only PMIC RTC;
  tools/phone-time.sh sets it from the host.

Measured: kernel 7.0.0-sm8150-g3c5fa409ca54, 10 of 10 warm reboots, no
WARNING in dmesg, display good, Type-C data role device on the laptop.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 13:24:46 +00:00

23 lines
804 B
Bash

#!/bin/sh
#
# Build the kernel Image for one device from a kernel tree.
#
# Usage: build-kernel.sh DEVICEDIR KERNEL_TREE
# The device's kernel.config becomes the tree's .config; an up-to-date tree
# is not rebuilt. With KERNEL_DTB in device.conf (a path below
# arch/$ARCH/boot/dts, as the tree's Makefile names it) the device tree is
# built from the tree's sources too. Prints the path of the Image.
set -eu
. "$(dirname "$0")/lib.sh"
[ $# -eq 2 ] || { echo "usage: $0 DEVICEDIR KERNEL_TREE" >&2; exit 2; }
load_device "$1"
tree=$2
cmp -s "$KERNEL_CONFIG" "$tree/.config" || cp "$KERNEL_CONFIG" "$tree/.config"
make -C "$tree" ARCH="$ARCH" CROSS_COMPILE="$CROSS_COMPILE" \
-j"$(nproc)" olddefconfig "$(basename "$KERNEL_IMAGE")" modules \
${KERNEL_DTB:+"$KERNEL_DTB"}
echo "$tree/$KERNEL_IMAGE"