From ba5a573617a7c35c817a0940dad83bab05ccbf84 Mon Sep 17 00:00:00 2001 From: Vishwas Udupa Date: Fri, 17 Nov 2023 01:03:29 -0800 Subject: [PATCH] android-tools-conf-configfs: read android device serial number Read android serial number value from sysfs node /sys/class/mmc_host/mmc0/mmc0:0001/serial instead of kernel command line. Upstream boot managers e.g., systemd-boot does not populate kernel command line with parameter androidboot.serialno. This approach generalizes and makes serial number population independent of bootloader that loads kernel. Signed-off-by: Vishwas Udupa --- .../qcom/android-gadget-setup.machine | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dynamic-layers/openembedded-layer/recipes-devtools/android-tools/android-tools-conf-configfs/qcom/android-gadget-setup.machine b/dynamic-layers/openembedded-layer/recipes-devtools/android-tools/android-tools-conf-configfs/qcom/android-gadget-setup.machine index 37f26bbf4..5fe7db7ec 100644 --- a/dynamic-layers/openembedded-layer/recipes-devtools/android-tools/android-tools-conf-configfs/qcom/android-gadget-setup.machine +++ b/dynamic-layers/openembedded-layer/recipes-devtools/android-tools/android-tools-conf-configfs/qcom/android-gadget-setup.machine @@ -1,4 +1,4 @@ manufacturer=Qualcomm model=`hostname` -androidserial="$(sed -n -e '/androidboot.serialno/ s/.*androidboot.serialno=\([^ ]*\).*/\1/gp ' /proc/cmdline)" +androidserial="$(sed 's/0x//' /sys/class/mmc_host/mmc0/mmc0:0001/serial)" [ -n "$androidserial" ] && serial="$androidserial"