Skip to content

Commit 1206a7f

Browse files
committed
adb serial number: fall back option to populate serial number
when androidboot.serialno is not available in cmdline then populate it from ID_SCSI_SERIAL for ufs devices and from sys/class/mmc_host/mmc0 for emmc devices. Signed-off-by: Vishwas Udupa <[email protected]>
1 parent ff2b06a commit 1206a7f

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
manufacturer=Qualcomm
22
model=`hostname`
33
androidserial="$(sed -n -e '/androidboot.serialno/ s/.*androidboot.serialno=\([^ ]*\).*/\1/gp ' /proc/cmdline)"
4+
[ -z "$androidserial" ] && [ -e /dev/sda ] && scsiserialline=$(udevadm info /dev/sda | grep ID_SCSI_SERIAL) && scsiserialvalue=$(echo "$scsiserialline" | awk -F= '{print $2}') && androidserial=$(echo -n "$scsiserialvalue" | crc32)
5+
[ -z "$androidserial" ] && [ -e /sys/class/mmc_host/mmc0/mmc0:0001/serial ] && androidserial=$(sed 's/0x//' /sys/class/mmc_host/mmc0/mmc0:0001/serial)
46
[ -n "$androidserial" ] && serial="$androidserial"
57
true

0 commit comments

Comments
 (0)