4 Create firmware for 4/8MB Bifferboards, suitable for uploading using
5 either bb_upload8.py or bb_eth_upload8.py
10 # Increase the kmax value if the script gives errors about the kernel being
11 # too large. You need to set the Biffboot kmax value to the same value you
15 # No need to change this for 4MB devices, it's only used to tell you if
16 # the firmware is too large!
19 # This is always the same, for 1MB, 4MB and 8MB devices
20 config_extent
= 0x6000
22 kernel_extent
= kmax
* 0x10000
24 if __name__
== "__main__":
26 if len(sys
.argv
) != 4:
27 print "usage: mkimg_bifferboard.py <kernel> <rootfs> <output file>"
35 fw
= file(bzimage
).read()
36 if len(fw
) > (kernel_extent
- config_extent
):
37 raise IOError("Kernel too large")
39 # Pad up to end of kernel partition
40 while len(fw
) < (kernel_extent
- config_extent
):
43 fw
+= file(rootfs
).read()
45 # Check length of total
46 if len(fw
) > (flash_size
- 0x10000 - config_extent
):
47 raise IOError("Rootfs too large")
49 file(target
,"wb").write(fw
)
50 print "Firmware written to '%s'" % target
This page took 0.054146 seconds and 5 git commands to generate.