Skip to content

Commit eed01e0

Browse files
authored
adb serial number: fall back option to populate serial number (#793)
when androidboot.serialno is not available in cmdline then populate adb serial number from firmware platform-parts-info dt entry.
2 parents 758bd9a + 1206a7f commit eed01e0

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)