Makefile 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. #
  2. # Copyright (C) 2007 OpenWrt.org
  3. #
  4. # This is free software, licensed under the GNU General Public License v2.
  5. # See /LICENSE for more information.
  6. #
  7. include $(TOPDIR)/rules.mk
  8. include $(INCLUDE_DIR)/image.mk
  9. export PATH=$(TARGET_PATH):/sbin
  10. ROOTPART=$(strip $(subst ",, $(CONFIG_OLPC_BOOTSCRIPT_ROOTPART)))
  11. #"))")) # fix vim's broken syntax highlighting
  12. ifeq ($(CONFIG_OLPC_BOOTSCRIPT_IMAGES),y)
  13. define Image/cmdline/squashfs
  14. block2mtd.block2mtd=$(ROOTPART),65536,rootfs root=/dev/mtdblock0 rootfstype=squashfs init=/etc/preinit
  15. endef
  16. define Image/cmdline/jffs2-64k
  17. block2mtd.block2mtd=$(ROOTPART),65536,rootfs root=/dev/mtdblock0 rootfstype=jffs2 init=/etc/preinit
  18. endef
  19. define Image/cmdline/jffs2-128k
  20. block2mtd.block2mtd=$(ROOTPART),131072,rootfs root=/dev/mtdblock0 rootfstype=jffs2 init=/etc/preinit
  21. endef
  22. define Image/cmdline/ext2
  23. root=$(ROOTPART) rootfstype=ext2 init=/etc/preinit
  24. endef
  25. define Image/Build/bootscript
  26. # left here because the image builder doesnt need these
  27. $(INSTALL_DIR) $(KDIR)/root.bootscript/boot
  28. $(CP) $(KDIR)/bzImage $(KDIR)/root.bootscript/boot/vmlinuz
  29. $(CP) ./olpc.fth $(KDIR)/root.bootscript/boot/olpc.fth
  30. 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)
  31. endef
  32. endif
  33. define Image/Prepare
  34. cp $(LINUX_DIR)/arch/*86/boot/bzImage $(KDIR)/bzImage
  35. $(call Image/Prepare/bootscript)
  36. endef
  37. define Image/Build/squashfs
  38. $(call prepare_generic_squashfs,$(KDIR)/root.squashfs)
  39. endef
  40. define Image/BuildKernel
  41. $(CP) $(KDIR)/bzImage $(BIN_DIR)/openwrt-$(BOARD)-vmlinuz
  42. endef
  43. define Image/Build
  44. $(call Image/Build/$(1))
  45. $(call Image/Build/bootscript,$(1))
  46. $(CP) $(KDIR)/root.$(1) $(BIN_DIR)/openwrt-$(BOARD)-$(1).fs
  47. $(CP) $(KDIR)/bzImage $(BIN_DIR)/openwrt-$(BOARD)-vmlinuz
  48. endef
  49. $(eval $(call BuildImage))