image/Makefile Details

FIXME This section is new and deliberately not linked too by other pages yet. once a person of some experience has a chance to look over this they may then choose to add it.

I think its(this page) needed to clarify the intent, preferred style and function of the image/Makefile.

I believe it should be placed here:

  • Adding a new platform (new buildroot howto section?)
  • OpenWrt Buildroot - new platform (new page/how-to on adding platform support to the buildroot system)

image/Makefile from scratch or modify

Inside your platform directory you will need to create a file to tell the buildroot system how to process the results of a compiled kernel. Most of the work is done automatically by but different platforms and individual devices will need specific work for images to be useful.

Basic Function

see example.


can be used to append data to image but often used simply to move to another directory such as $(KDIR)

for example:

cat $(LINUX_DIR)/arch/arm/boot/zImage >> $(KDIR)/$(call zimage_name,$(1))


This section allows automated modification of the elf file before loading onto the device. The file can be found with this line






Appears to be used to call the other build defines (squashfs, jffs2-64k, jffs2-128k, etc) after they were processed and their resulting files were placed into $(TARGET_DIR)

to call a define for each use:

$(call Image/Build/$(1),$(1))


Example of: trunk/target/linux/platform/image/Makefile

# Copyright (C) 2010
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
include $(TOPDIR)/
include $(INCLUDE_DIR)/
define Image/Prepare
define Image/Build/Initramfs
define Image/BuildKernel
define Image/Build/jffs2-64k
	dd if=$(KDIR)/root.$(1) of=$(BIN_DIR)/openwrt-$(BOARD)-$(1).img bs=65536 conv=sync
define Image/Build/jffs2-128k
	dd if=$(KDIR)/root.$(1) of=$(BIN_DIR)/openwrt-$(BOARD)-$(1).img bs=131072 conv=sync
define Image/Build/squashfs
	$(call prepare_generic_squashfs,$(KDIR)/root.squashfs)
define Image/Build
	$(call Image/Build/$(1),$(1))

See also

have a look at your copy of trunk/include/

david_ausengineer 2012/05/15 03:10

Back to top

doc/techref/image.makefile.txt · Last modified: 2012/05/15 05:27 by david_ausengineer