gcb
gcb

Reputation: 14558

Why I get permission denied when trying to read ROM from a device in sysfs?

reading the docs for sysfs on https://mjmwired.net/kernel/Documentation/filesystems/sysfs-pci.txt

The 'rom' file is special in that it provides read-only access to the device's ROM file, if available. It's disabled by default, however, so applications should write the string "1" to the file to enable it before attempting a read call, and disable it following the access by writing "0" to the file. Note that the device must be enabled for a rom read to return data successfully. In the event a driver is not bound to the device, it can be enabled using the 'enable' file, documented above.

i'm trying to figure out which firmware/microcode version i'm running. The specific device is a GPU included in an APU package.

$ lspci
...
03:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Rembrandt [Radeon 680M] (rev d5) (prog-if 00 [VGA controller])
...
$ cd /sys/bus/pci/devices/0000:03:00.0
$ pwd -P
/sys/devices/pci0000:00/0000:00:08.1/0000:03:00.0
$ cat vbios_version
113-REMBRANDT-X37
$ cat enable
1
$ echo 1 > enable
bash: echo: write error: Device or resource busy
$ cat enable
1
$ cat rom
cat: rom: No such file or directory
$ echo 1 > rom
bash: rom: Permission denied
$ id
uid=0(root) gid=0(root) groups=0(root)

Upvotes: 0

Views: 772

Answers (0)

Related Questions