Date:2010-08-17 17:31:27 (2 years 9 months ago)
Author:florian
Commit:12671e163c60a5a5175a7a56b3d3d83451e369ab
Message:[rdc] allow 1MB extra space for JFFS and other enhancements (#7706)

git-svn-id: svn://svn.openwrt.org/openwrt/trunk@22690 3c298f89-4303-0410-b956-a3cf2f4a3e73
Files: target/linux/rdc/image/Makefile (1 diff)
target/linux/rdc/image/mkimg_bifferboard.py (2 diffs)
target/linux/rdc/profiles/bifferboard.mk (1 diff)

Change Details

target/linux/rdc/image/Makefile
2929endef
3030
3131define Image/Build/bifferboard
32    $(TOPDIR)/target/linux/rdc/image/mkimg_bifferboard.py $(KDIR)/bzImage $(KDIR)/root.$(1) $(KDIR)/tmp.img
33    $(CP) $(KDIR)/tmp.img $(BIN_DIR)/$(IMG_PREFIX)-$(1)-$(2).img
32    $(TOPDIR)/target/linux/rdc/image/mkimg_bifferboard.py $(KDIR)/bzImage $(KDIR)/root.$(1) $(BIN_DIR)/$(IMG_PREFIX)-$(1)-$(2).img
3433endef
3534
3635define Image/Build/Initramfs
target/linux/rdc/image/mkimg_bifferboard.py
11#!/usr/bin/env python
22
33"""
4   Create firmware for 8MB Bifferboards
5   Firmware does not include the config blocks
6   Firmware starts just after config
4   Create firmware for 4/8MB Bifferboards, suitable for uploading using
5   either bb_upload8.py or bb_eth_upload8.py
76"""
87
98import struct, sys
109
11kernel_extent = 0x200000
12config = 0x6000
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
12# use here.
13kmax = 0x10
14
15# No need to change this for 4MB devices, it's only used to tell you if
16# the firmware is too large!
17flash_size = 0x800000
18
19# This is always the same, for 1MB, 4MB and 8MB devices
20config_extent = 0x6000
21
22kernel_extent = kmax * 0x10000
1323
1424if __name__ == "__main__":
1525
1626  if len(sys.argv) != 4:
17    print "usage: mkimg_bifferboard.py <kernel> <64k JFFS> <output file>"
18    sys.exit(0)
27    print "usage: mkimg_bifferboard.py <kernel> <rootfs> <output file>"
28    sys.exit(-1)
1929
2030  bzimage = sys.argv[1]
2131  rootfs = sys.argv[2]
...... 
2333
2434  # Kernel first
2535  fw = file(bzimage).read()
26  if len(fw) > (kernel_extent - config):
36  if len(fw) > (kernel_extent - config_extent):
2737    raise IOError("Kernel too large")
2838
29  # Pad up to 0x200000
30  while len(fw) < (kernel_extent - config):
39  # Pad up to end of kernel partition
40  while len(fw) < (kernel_extent - config_extent):
3141    fw += "\xff"
3242
3343  fw += file(rootfs).read()
3444
3545  # Check length of total
36  if len(fw) > (0x800000 - 0x10000 - 0x6000):
46  if len(fw) > (flash_size - 0x10000 - config_extent):
3747    raise IOError("Rootfs too large")
3848
3949  file(target,"wb").write(fw)
target/linux/rdc/profiles/bifferboard.mk
77
88define Profile/bifferboard
99    NAME:=Bifferboard
10    PACKAGES:=kmod-usb-core kmod-usb-ohci kmod-usb2 \
11        kmod-usb-storage kmod-scsi-core kmod-fs-ext3
1012endef
1113$(eval $(call Profile,bifferboard))

Archive Download the corresponding diff file



interactive