I've a bunch of ARM devices. They don't differ in hardware. Can I somehow obtain a unique ID for each device without using MAC-address? This ID must stay the same even if I reflash the NAND with a new kernel and rootfs. Its hardware based on the Atmel AT91SAM9.
Get the serial of the device from /proc/cpuinfo
grep Serial /proc/cpuinfo Serial : 1651660a0642ebb0
(taken from my A20 based SoC, Lamobo R1 aka Banana Pi R1 and ArmBian/Jessie with kernel 4.5.2)
grep Serial /proc/cpuinfo Serial : 64355040058f0d000000
(taken from my H3 based Soc, Orange Pi One with Armbian/Jessie kernel 3.4)
About this serial number : It is supposed to be unique, but it is read differently on different SoCs. And sometimes either software or configurations fail.
Few use cases for the SID are, but not limited to:
- Generate per-device unique MAC address
- Store/use as an RSA etc key
- Write in-house serial numbers
In the raspberry this number is generally used as a SN to buy a video codec license. It is also known that the reading can fail when u-boot is not properly configured.
Not all ARM SoCs support this functionality. As per the updated question, the Atmel AT91SAM9 seems to not have this functionality. However, I will leave this answer here for others searching for it.