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/devices/soc0/serial_number 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 <quic_vudupa@quicinc.com>
  • Loading branch information
vishwasudupa authored and Linux Build Service Account committed Nov 17, 2023
1 parent 41e37ca commit 0f6895d
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="$(printf "%x" "$(cat /sys/devices/soc0/serial_number)")"
[ -n "$androidserial" ] && serial="$androidserial"

0 comments on commit 0f6895d

Please sign in to comment.