tools/lxterm/json: json file provide relative path, add json file directory to image names.
Allow sharing same json file between serial boot and Ethernet/SDCard/SATAboot: boot.json: { "Image": "0x40000000", "rv32.dtb": "0x40ef0000", "rootfs.cpio": "0x41000000", "opensbi.bin": "0x40f00000" } If boot.json and images are located in images directory, using lxterm --images=images/boot.json will now work.
This commit is contained in:
parent
f777cddefe
commit
4092180662
|
@ -229,7 +229,9 @@ class LiteXTerm:
|
||||||
self.boot_address = kernel_address
|
self.boot_address = kernel_address
|
||||||
if json_images is not None:
|
if json_images is not None:
|
||||||
f = open(json_images, "r")
|
f = open(json_images, "r")
|
||||||
self.mem_regions.update(json.load(f))
|
json_dir = os.path.dirname(json_images)
|
||||||
|
for k, v in json.load(f).items():
|
||||||
|
self.mem_regions[os.path.join(json_dir, k)] = v
|
||||||
self.boot_address = self.mem_regions[list(self.mem_regions.keys())[-1]]
|
self.boot_address = self.mem_regions[list(self.mem_regions.keys())[-1]]
|
||||||
f.close()
|
f.close()
|
||||||
self.flash = flash
|
self.flash = flash
|
||||||
|
|
Loading…
Reference in New Issue