Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- perl -Mautodie -E 'my $path = "/sys/bus/i2c/devices/0-0050/0-00500/nvmem"; $path = "/sys/bus/i2c/devices/0-0050/eeprom" if -w "/sys/bus/i2c/devices/0-0050/eeprom" || ! -f $path; open my $fh, "<:raw", $path; sysread $fh, $_, 0x70, 0; s/[^ -~]{1,32}\z|X{9}\z//; say for grep $_, unpack "x4a12a12x52a32", $_'
- ----- older beaglebone ---------------------------------------
- script output:
- A335BNLT00C0
- 4215BBBK0789
- 400524+1301+001929+1542
- breakdown of second line:
- 42 week number
- 15 year without century
- BBBK (fixed string)
- 0789 serial number in hexadecimal
- printed on label:
- 400524 (fixed string)
- 1301 (fixed string)
- 001929 serial number in decimal
- 1542 year and week number
- ----- recent beaglebone ---------------------------------------
- script output:
- A335BNLT00C0
- 2251SBB10986
- breakdown of second line:
- 22 year without century
- 51 week number
- SBB (fixed string)
- 10986 serial number in decimal
- printed on label:
- BBBVC (fixed string)
- 202212 year and month
- 010986 serial number in decimal
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement