Skip to content

Commit

Permalink
android-tools-conf-configfs: read android device serial number
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
vishwasudupa committed Nov 17, 2023
1 parent 41e37ca commit ba5a573
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
@@ -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"

0 comments on commit ba5a573

Please sign in to comment.