I may be wrong but that isn't going to work on RPiOS Legacy (Bullseye). It'll return "/boot/firmware/something" when it should return "/boot/something".Now -The biggest challenge was finding what code needed changing.Code:
def FixBootFilename(filename): if not os.path.islink(filename): n = filename.rfind("/") firmware = filename[:n] + "/firmware" + filename[n:] if os.path.isfile(firmware): filename = firmware return filename
I'd probably do something like this (untested):
Code:
import os.pathif os.path.exists('/boot/firmware') and os.path.ismount('/boot/firmware'): boot_partition = '/boot/firmware'else: boot_partition = '/boot'with open(os.path.join(boot_partition, 'config.txt')) as f: [...]
Statistics: Posted by thagrol — Tue Jan 30, 2024 5:02 pm