2 # Copyright (C) 2007-2008 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
7 include $(TOPDIR
)/rules.mk
8 include $(INCLUDE_DIR
)/image.mk
10 export PATH
=$(TARGET_PATH
):/sbin
11 ROOTPART
=$(strip $(subst ",, $(CONFIG_OLPC_BOOTSCRIPT_ROOTPART)))
12 #"))")) # fix vim's broken syntax highlighting
16 ifeq ($(CONFIG_OLPC_BOOTSCRIPT_IMAGES),y)
17 define Image/cmdline/squashfs
18 block2mtd.block2mtd=$(ROOTPART),65536,rootfs root=/dev/mtdblock0 rootfstype=squashfs rootdelay=$(ROOTDELAY)
21 define Image/cmdline/jffs2-64k
22 block2mtd.block2mtd=$(ROOTPART),65536,rootfs root=/dev/mtdblock0 rootfstype=jffs2 rootdelay=$(ROOTDELAY)
25 define Image/cmdline/jffs2-128k
26 block2mtd.block2mtd=$(ROOTPART),131072,rootfs root=/dev/mtdblock0 rootfstype=jffs2 rootdelay=$(ROOTDELAY)
29 define Image/cmdline/ext2
30 root=$(ROOTPART) rootfstype=ext2
33 define Image/Build/bootscript
34 # left here because the image builder doesnt need these
35 $(INSTALL_DIR) $(KDIR)/root.bootscript/boot
36 $(CP) $(KDIR)/bzImage $(KDIR)/root.bootscript/boot/vmlinuz
37 sed -e 's#@CMDLINE@#$(strip $(call Image/cmdline/$(1))) $(BOOTOPTS)#g' \
38 ./olpc.fth > $(KDIR)/root.bootscript/boot/olpc.fth
39 PADDING="$(CONFIG_OLPC_BOOTSCRIPT_IMAGES_PAD
)" PATH="$(TARGET_PATH
)" ./gen_image.sh $(BIN_DIR)/openwrt-$(BOARD)-$(1).image $(CONFIG_OLPC_BOOTSCRIPT_KERNELPART) $(KDIR)/root.bootscript $(CONFIG_TARGET_ROOTFS_FSPART) $(KDIR)/root.$(1)
44 cp $(LINUX_DIR)/arch/x86/boot/bzImage $(KDIR)/bzImage
45 $(call Image/Prepare/bootscript)
48 define Image/Build/squashfs
49 $(call prepare_generic_squashfs,$(KDIR)/root.squashfs)
52 define Image/BuildKernel
53 $(CP) $(KDIR)/bzImage $(BIN_DIR)/openwrt-$(BOARD)-vmlinuz
57 $(call Image/Build/$(1))
58 $(call Image/Build/bootscript,$(1))
59 $(CP) $(KDIR)/root.$(1) $(BIN_DIR)/openwrt-$(BOARD)-$(1).fs
60 $(CP) $(KDIR)/bzImage $(BIN_DIR)/openwrt-$(BOARD)-vmlinuz
63 $(eval $(call BuildImage))