mirror of
https://github.com/raspberrypi/rpi-eeprom.git
synced 2026-01-21 06:13:33 +08:00
Merge pull request #288 from vianpl/blconfig-fixes
rpi-eeprom-config: Properly decode sysfs binary files
This commit is contained in:
@@ -163,11 +163,11 @@ def read_current_config():
|
|||||||
nvmem_base = "/sys/bus/nvmem/devices/"
|
nvmem_base = "/sys/bus/nvmem/devices/"
|
||||||
|
|
||||||
if os.path.exists(fw_base + "/aliases/blconfig"):
|
if os.path.exists(fw_base + "/aliases/blconfig"):
|
||||||
with open(fw_base + "/aliases/blconfig") as f:
|
with open(fw_base + "/aliases/blconfig", "rb") as f:
|
||||||
nvmem_ofnode_path = fw_base + f.read().encode('ascii')
|
nvmem_ofnode_path = fw_base + f.read().decode('utf-8')
|
||||||
for d in os.listdir(nvmem_base):
|
for d in os.listdir(nvmem_base):
|
||||||
if os.path.realpath(nvmem_base + d + "/of_node") in os.path.normpath(nvmem_ofnode_path):
|
if os.path.realpath(nvmem_base + d + "/of_node") in os.path.normpath(nvmem_ofnode_path):
|
||||||
return (open(nvmem_base + d + "/nvmem").read(), "blconfig device")
|
return (open(nvmem_base + d + "/nvmem", "rb").read().decode('utf-8'), "blconfig device")
|
||||||
|
|
||||||
return (shell_cmd(['vcgencmd', 'bootloader_config']), "vcgencmd bootloader_config")
|
return (shell_cmd(['vcgencmd', 'bootloader_config']), "vcgencmd bootloader_config")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user