From fe62849cb0dc609b1c830e067a28232f0204097e Mon Sep 17 00:00:00 2001 From: Brendan Szymanski Date: Tue, 14 Jul 2026 20:30:36 -0400 Subject: [PATCH] Make vendor.prop the single source of truth for WiFi country code ro.boot.wificountrycode was set in two places: androidboot.wificountrycode=US on the kernel cmdline (mkimg.sh extlinux heredoc) and ro.boot.wificountrycode=00 in vendor.prop. Because ro.* properties are set-once and init processes the cmdline first, the cmdline always won and the vendor.prop value silently lost (init logs 'Read-only property was already set' every boot). Worse, the vendor.prop value was 00 (world regulatory domain), a landmine that would activate if the cmdline param were ever dropped. Remove the cmdline param and set vendor.prop to US so the country code lives in exactly one place, delivered via vendor.img instead of a hand-maintained boot heredoc. Note this only feeds the Android framework (WifiCountryCode); the kernel side additionally needs regulatory.db to actually apply it (fixed separately by embedding it via CONFIG_EXTRA_FIRMWARE in the kernel). --- mkimg.sh | 2 +- vendor.prop | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/mkimg.sh b/mkimg.sh index 197619a..ac4bcc1 100755 --- a/mkimg.sh +++ b/mkimg.sh @@ -140,7 +140,7 @@ label LineageOS Android TV kernel /Image fdt /rk3588-orangepi-5-ultra.dtb initrd /ramdisk.img - append console=ttyS2,1500000 no_console_suspend root=/dev/ram0 rootwait androidboot.hardware=tart androidboot.selinux=permissive androidboot.boot_devices=fe2c0000.mmc androidboot.console=ttyS2 androidboot.wificountrycode=US + append console=ttyS2,1500000 no_console_suspend root=/dev/ram0 rootwait androidboot.hardware=tart androidboot.selinux=permissive androidboot.boot_devices=fe2c0000.mmc androidboot.console=ttyS2 EXTLINUX_EOF sudo cp ${KERNEL_PATH}/boot.scr "${BOOT_MOUNT}/" sudo cp ${KERNEL_PATH}/android-sdcard.dtbo "${BOOT_MOUNT}/" diff --git a/vendor.prop b/vendor.prop index 4636678..47fd3c4 100644 --- a/vendor.prop +++ b/vendor.prop @@ -81,7 +81,10 @@ persist.device_config.mglru_native.lru_gen_config=core ro.boot.hypervisor.vm.supported=1 # Wifi -ro.boot.wificountrycode=00 +# Single source of truth for the regulatory country code. Init exports this to +# the framework's WifiCountryCode; ro.boot.* is set-once, so this must NOT also +# appear as androidboot.wificountrycode on the kernel cmdline (mkimg.sh). +ro.boot.wificountrycode=US wifi.interface=wlan0 # Window extensions