2 # Copyright (C) 2007 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
15 ifeq ($(CONFIG_OLPC_BOOTSCRIPT_IMAGES),y)
16 define Image/cmdline/squashfs
17 block2mtd.block2mtd=$(ROOTPART),65536,rootfs root=/dev/mtdblock0 rootfstype=squashfs init=/etc/preinit
20 define Image/cmdline/jffs2-64k
21 block2mtd.block2mtd=$(ROOTPART),65536,rootfs root=/dev/mtdblock0 rootfstype=jffs2 init=/etc/preinit
24 define Image/cmdline/jffs2-128k
25 block2mtd.block2mtd=$(ROOTPART),131072,rootfs root=/dev/mtdblock0 rootfstype=jffs2 init=/etc/preinit
28 define Image/cmdline/ext2
29 root=$(ROOTPART) rootfstype=ext2 init=/etc/preinit
32 define Image/Build/bootscript
33 # left here because the image builder doesnt need these
34 $(INSTALL_DIR) $(KDIR)/root.bootscript/boot
35 $(CP) $(KDIR)/bzImage $(KDIR)/root.bootscript/boot/vmlinuz
36 $(CP) ./olpc.fth $(KDIR)/root.bootscript/boot/olpc.fth
37 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)
42 cp $(LINUX_DIR)/arch/*86/boot/bzImage $(KDIR)/bzImage
43 $(call Image/Prepare/bootscript)
46 define Image/Build/squashfs
47 $(call prepare_generic_squashfs,$(KDIR)/root.squashfs)
50 define Image/BuildKernel
51 $(CP) $(KDIR)/bzImage $(BIN_DIR)/openwrt-$(BOARD)-vmlinuz
55 $(call Image/Build/$(1))
56 $(call Image/Build/bootscript,$(1))
57 $(CP) $(KDIR)/root.$(1) $(BIN_DIR)/openwrt-$(BOARD)-$(1).fs
58 $(CP) $(KDIR)/bzImage $(BIN_DIR)/openwrt-$(BOARD)-vmlinuz
61 $(eval $(call BuildImage))