summaryrefslogtreecommitdiff
path: root/target/linux/kirkwood
diff options
context:
space:
mode:
authorluka <luka@3c298f89-4303-0410-b956-a3cf2f4a3e73>2013-10-31 11:44:28 +0000
committerluka <luka@3c298f89-4303-0410-b956-a3cf2f4a3e73>2013-10-31 11:44:28 +0000
commit6af1f99a6982f91fad7b6e790cb1eaeea1352a22 (patch)
tree2376a48cc9400a8800226fa371b56d5c00f9ba10 /target/linux/kirkwood
parent6abdb2370a8f5ea3265f65dc9316f03af9b34f02 (diff)
kirkwood: extend image/Makefile
* use lower case letters in generated images * extend support for boot/ directory * fix some typos Signed-off-by: Luka Perkov <luka@openwrt.org> Signed-off-by: Felix Kaechele <heffer@fedoraproject.org> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@38629 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/kirkwood')
-rw-r--r--target/linux/kirkwood/image/Makefile51
1 files changed, 34 insertions, 17 deletions
diff --git a/target/linux/kirkwood/image/Makefile b/target/linux/kirkwood/image/Makefile
index 94e7bb90b1..397a465993 100644
--- a/target/linux/kirkwood/image/Makefile
+++ b/target/linux/kirkwood/image/Makefile
@@ -9,12 +9,16 @@ include $(INCLUDE_DIR)/image.mk
NAND_BLOCKSIZE := 2048:128k
+define sanitize_profile_name
+$(shell echo $(PROFILE) | tr '[:upper:]' '[:lower:]')
+endef
+
define Image/BuildKernel/Template
$(CP) $(KDIR)/zImage $(BIN_DIR)/$(IMG_PREFIX)-zImage
echo -ne '\x00\x00\x00\x00' >> $(BIN_DIR)/$(IMG_PREFIX)-zImage
$(call Image/BuildKernel/MkuImage, \
- none, 0x00008000, 0x00008000, \
+ none, 0x8000, 0x8000, \
$(BIN_DIR)/$(IMG_PREFIX)-zImage, \
$(BIN_DIR)/$(IMG_PREFIX)-uImage \
)
@@ -23,7 +27,7 @@ define Image/BuildKernel/Template
$(CP) $(KDIR)/zImage-initramfs $(BIN_DIR)/$(IMG_PREFIX)-zImage-initramfs
echo -ne '\x00\x00\x00\x00' >> $(BIN_DIR)/$(IMG_PREFIX)-zImage-initramfs
$(call Image/BuildKernel/MkuImage, \
- none, 0x00008000, 0x00008000, \
+ none, 0x8000, 0x8000, \
$(BIN_DIR)/$(IMG_PREFIX)-zImage-initramfs, \
$(BIN_DIR)/$(IMG_PREFIX)-uImage-initramfs \
)
@@ -32,21 +36,21 @@ define Image/BuildKernel/Template
ifneq ($(1),)
$(CP) $(LINUX_DIR)/arch/arm/boot/dts/kirkwood-$(1).dtb $(BIN_DIR)/$(IMG_PREFIX)-$(1).dtb
- $(CP) $(KDIR)/zImage $(BIN_DIR)/$(IMG_PREFIX)-$(PROFILE)-zImage
- cat $(BIN_DIR)/$(IMG_PREFIX)-$(1).dtb >> $(BIN_DIR)/$(IMG_PREFIX)-$(PROFILE)-zImage
+ $(CP) $(KDIR)/zImage $(BIN_DIR)/$(IMG_PREFIX)-$(call sanitize_profile_name)-zImage
+ cat $(BIN_DIR)/$(IMG_PREFIX)-$(1).dtb >> $(BIN_DIR)/$(IMG_PREFIX)-$(call sanitize_profile_name)-zImage
$(call Image/BuildKernel/MkuImage, \
- none, 0x00008000, 0x00008000, \
- $(BIN_DIR)/$(IMG_PREFIX)-$(PROFILE)-zImage, \
- $(BIN_DIR)/$(IMG_PREFIX)-$(PROFILE)-uImage \
+ none, 0x8000, 0x8000, \
+ $(BIN_DIR)/$(IMG_PREFIX)-$(call sanitize_profile_name)-zImage, \
+ $(BIN_DIR)/$(IMG_PREFIX)-$(call sanitize_profile_name)-uImage \
)
ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),)
- $(CP) $(KDIR)/zImage-initramfs $(BIN_DIR)/$(IMG_PREFIX)-$(PROFILE)-zImage-initramfs
- cat $(BIN_DIR)/$(IMG_PREFIX)-$(1).dtb >> $(BIN_DIR)/$(IMG_PREFIX)-$(PROFILE)-zImage-initramfs
+ $(CP) $(KDIR)/zImage-initramfs $(BIN_DIR)/$(IMG_PREFIX)-$(call sanitize_profile_name)-zImage-initramfs
+ cat $(BIN_DIR)/$(IMG_PREFIX)-$(1).dtb >> $(BIN_DIR)/$(IMG_PREFIX)-$(call sanitize_profile_name)-zImage-initramfs
$(call Image/BuildKernel/MkuImage, \
- none, 0x00008000, 0x00008000,
- $(BIN_DIR)/$(IMG_PREFIX)-$(PROFILE)-zImage-initramfs, \
- $(BIN_DIR)/$(IMG_PREFIX)-$(PROFILE)-uImage-initramfs \
+ none, 0x8000, 0x8000, \
+ $(BIN_DIR)/$(IMG_PREFIX)-$(call sanitize_profile_name)-zImage-initramfs, \
+ $(BIN_DIR)/$(IMG_PREFIX)-$(call sanitize_profile_name)-uImage-initramfs \
)
endif
endif
@@ -56,19 +60,27 @@ define Image/InstallKernel/Template
ifneq ($(CONFIG_TARGET_ROOTFS_INCLUDE_KERNEL),)
$(INSTALL_DIR) $(TARGET_DIR)/boot
+ ifneq ($(CONFIG_TARGET_ROOTFS_INCLUDE_UIMAGE),)
+ $(CP) $(BIN_DIR)/$(IMG_PREFIX)-uImage $(TARGET_DIR)/boot/
+ ln -sf $(IMG_PREFIX)-uImage $(TARGET_DIR)/boot/uImage
+ endif
+ ifneq ($(CONFIG_TARGET_ROOTFS_INCLUDE_ZIMAGE),)
$(CP) $(BIN_DIR)/$(IMG_PREFIX)-zImage $(TARGET_DIR)/boot/
+ ln -sf $(IMG_PREFIX)-zImage $(TARGET_DIR)/boot/zImage
+ endif
endif
ifneq ($(CONFIG_TARGET_ROOTFS_INCLUDE_DTB),)
$(INSTALL_DIR) $(TARGET_DIR)/boot
ifneq ($(1),)
$(CP) $(BIN_DIR)/$(IMG_PREFIX)-$(1).dtb $(TARGET_DIR)/boot/
+ ln -sf $(IMG_PREFIX)-$(1).dtb $(TARGET_DIR)/boot/$(1).dtb
endif
endif
endef
define Image/Build/jffs2-nand-2048-128k
- dd if=$(KDIR)/root.$(1) of=$(BIN_DIR)/$(IMG_PREFIX)-$(PROFILE)-$(1).img \
+ dd if=$(KDIR)/root.$(1) of=$(BIN_DIR)/$(IMG_PREFIX)-$(call sanitize_profile_name)-$(1).img \
bs=2048 conv=sync
endef
@@ -77,20 +89,25 @@ define Image/Build/squashfs
( \
dd if=$(KDIR)/zImage bs=4096k conv=sync; \
dd if=$(KDIR)/root.$(1) bs=128k conv=sync; \
- ) > $(BIN_DIR)/$(IMG_PREFIX)-$(PROFILE)-$(1).img
+ ) > $(BIN_DIR)/$(IMG_PREFIX)-$(call sanitize_profile_name)-$(1).img
+endef
+
+define Image/mkfs/targz
+
+ $(TAR) -czpf $(BIN_DIR)/$(IMG_PREFIX)-$(call sanitize_profile_name)-rootfs.tar.gz --numeric-owner --owner=0 --group=0 -C $(TARGET_DIR)/ .
endef
define Image/Build/ubifs
ifneq ($($(PROFILE)_UBIFS_OPTS),)
- $(CP) $(KDIR)/root.ubifs $(BIN_DIR)/$(IMG_PREFIX)-$(PROFILE)-ubifs.img
+ $(CP) $(KDIR)/root.ubifs $(BIN_DIR)/$(IMG_PREFIX)-$(call sanitize_profile_name)-rootfs.ubifs
endif
endef
define Image/Build/ubi
ifneq ($($(PROFILE)_UBI_OPTS),)
- $(CP) $(KDIR)/root.ubi $(BIN_DIR)/$(IMG_PREFIX)-$(PROFILE)-ubi.img
+ $(CP) $(KDIR)/root.ubi $(BIN_DIR)/$(IMG_PREFIX)-$(call sanitize_profile_name)-rootfs.ubi
endif
endef
@@ -111,7 +128,7 @@ endef
define Image/Build
$(if $(Image/Build/$(1)), \
$(call Image/Build/$(1),$(1)), \
- $(CP) $(KDIR)/root.$(1) $(BIN_DIR)/$(IMG_PREFIX)-$(PROFILE)-$(1).img \
+ $(CP) $(KDIR)/root.$(1) $(BIN_DIR)/$(IMG_PREFIX)-$(call sanitize_profile_name)-$(1).img \
)
endef