How can I read windows product licence key from UEFI in Linux?

Solution 1:

The key is stored in an ACPI table named MSDM which can be retrieved via

~# xxd /sys/firmware/acpi/tables/MSDM 
00000000: 4d53 444d 5500 0000 0364 4d45 4449 4f4e  MSDMU....dMEDION
00000010: 4d45 4449 4f4e 4147 0000 0000 5445 5354  MEDIONAG....TEST
00000020: 0000 0000 0100 0000 0000 0000 0100 0000  ................
00000030: 0000 0000 1d00 0000 1234 1234 1234 1234  ........HERE-THE
00000040: 1234 1234 1234 1234 1234 1234 1234 1234  WINDOWS-PRODUCT-
00000050: 1234 1234 12                             KEY

Or, even simpler

~# strings /sys/firmware/acpi/tables/MSDM 
MSDMU
dMEDIONMEDIONAG
TEST
YOUR-WINDOWS-LICENCE

Source