mirror of
git://projects.qi-hardware.com/nn-usb-fpga.git
synced 2025-01-21 14:21:06 +02:00
18e79c4816
Signed-off-by: Xiangfu Liu <xiangfu@sharism.cc>
53 lines
1.5 KiB
Makefile
53 lines
1.5 KiB
Makefile
#
|
|
# Written 2010, by Xiangfu Liu.
|
|
#
|
|
|
|
LOADER=openwrt-xburst-qi_lb60-u-boot.bin
|
|
KERNEL=openwrt-xburst-qi_lb60-uImage.bin
|
|
ROOTFS=openwrt-xburst-qi_lb60-root.ubi
|
|
|
|
UBIFS =openwrt-xburst-qi_lb60-root.ubifs
|
|
|
|
QI_IMAGE_URL=http://downloads.qi-hardware.com/software/images/Ben_NanoNote_2GB_NAND/latest/
|
|
QI_MIRKO_URL=http://downloads.qi-hardware.com/people/mirko/testing/
|
|
|
|
DL=$(if $(wildcard ../dl/.),../dl,dl)
|
|
|
|
.PHONY: all clean reflash_rootfs reflash_kernel reflash_uboot
|
|
|
|
all: reflash_rootfs reflash_kernel reflash_uboot
|
|
|
|
$(DL)/$(ROOTFS).ok:
|
|
mkdir -p dl
|
|
wget -c -O $(DL)/$(ROOTFS) $(QI_IMAGE_URL)/$(ROOTFS)
|
|
touch $@
|
|
|
|
$(DL)/$(KERNEL).ok:
|
|
mkdir -p dl
|
|
wget -c -O $(DL)/$(KERNEL) $(QI_MIRKO_URL)/$(KERNEL)
|
|
touch $@
|
|
|
|
$(DL)/$(LOADER).ok:
|
|
mkdir -p dl
|
|
wget -c -O $(DL)/$(LOADER) $(QI_MIRKO_URL)/$(LOADER)
|
|
touch $@
|
|
|
|
$(DL)/create_rootfs.ok: $(DL)/$(ROOTFS).ok
|
|
mkdir -p $(DL)/rootfs_tmp
|
|
tar zxf ./dl/openwrt-xburst-qi_lb60-rootfs.tar.gz -C ./$(DL)/rootfs_tmp/
|
|
cp -rf ../sie_rootfs_files/* ./$(DL)/rootfs_tmp/
|
|
mkfs.ubifs -r $(DL)/rootfs_tmp/ -m 4096 -e 516096 -c 4095 -o $(UBIFS)
|
|
ubinize -o $(ROOTFS) -m 4096 -p 512KiB ubinize.cfg
|
|
touch $@
|
|
|
|
reflash_rootfs: $(DL)/create_rootfs.ok
|
|
sudo usbboot -f ./usbboot_2gb_nand.cfg -c "boot;nerase 16 512 0 0;nprog 2048 $(DL)/$(ROOTFS) 0 0 -n"
|
|
|
|
reflash_kernel: $(DL)/$(KERNEL).ok
|
|
sudo usbboot -f ./usbboot_2gb_nand.cfg -c "boot;nprog 1024 $(DL)/$(KERNEL) 0 0 -n"
|
|
|
|
reflash_uboot: $(DL)/$(LOADER).ok
|
|
sudo usbboot -f ./usbboot_2gb_nand.cfg -c "boot;nprog 0 $(DL)/$(LOADER) 0 0 -n"
|
|
|
|
clean:
|
|
rm -rf $(DL)
|