ar71xx: put squash image right after the kernel on TP-Link boards
[openwrt.git] / target / linux / ar71xx / image / Makefile
index 324899d..6fd72c1 100644 (file)
@@ -11,6 +11,10 @@ define imgname
 $(BIN_DIR)/$(IMG_PREFIX)-$(2)-$(patsubst jffs2-%,jffs2,$(patsubst squashfs-%,squashfs,$(1)))
 endef
 
+define rootfs_align
+$(patsubst %-128k,0x20000,$(patsubst %-64k,0x10000,$(patsubst squashfs-%,4,$(1))))
+endef
+
 define sysupname
 $(call imgname,$(1),$(2))-sysupgrade.bin
 endef
@@ -25,13 +29,11 @@ VMLINUX:=$(BIN_DIR)/$(IMG_PREFIX)-vmlinux
 UIMAGE:=$(BIN_DIR)/$(IMG_PREFIX)-uImage
 fs_squash:=squashfs-only
 fs_all:=all
-fs_4k:=4k
 fs_64k:=64k
 fs_128k:=128k
 ifeq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),y)
        fs_squash:=initramfs
        fs_all:=initramfs
-       fs_4k:=initramfs
        fs_64k:=initramfs
        fs_128k:=initramfs
        VMLINUX:=$(BIN_DIR)/$(IMG_PREFIX)-vmlinux-initramfs
@@ -335,12 +337,14 @@ define Image/Build/TPLINK
        -$(STAGING_DIR_HOST)/bin/mktplinkfw \
                -H $(4) -W $(5) -F $(6) -N OpenWrt -V $(REVISION)\
                -k $(KDIR)/kernel-$(2).bin \
-               -r $(BIN_DIR)/$(IMG_PREFIX)-root.$(1) -a 0x10000 \
+               -r $(BIN_DIR)/$(IMG_PREFIX)-root.$(1) \
+               -a $(call rootfs_align,$(1)) -j \
                -o $(call factoryname,$(1),$(2))
        -$(STAGING_DIR_HOST)/bin/mktplinkfw \
                -H $(4) -W $(5) -F $(6) -N OpenWrt -V $(REVISION) -s\
                -k $(KDIR)/kernel-$(2).bin \
-               -r $(BIN_DIR)/$(IMG_PREFIX)-root.$(1) -a 0x10000 \
+               -r $(BIN_DIR)/$(IMG_PREFIX)-root.$(1) \
+               -a $(call rootfs_align,$(1)) -j \
                -o $(call sysupname,$(1),$(2))
 endef
 
@@ -357,12 +361,14 @@ define Image/Build/TPLINK-LZMA
        -$(STAGING_DIR_HOST)/bin/mktplinkfw \
                -H $(4) -W $(5) -F $(6) -N OpenWrt -V $(REVISION)\
                -k $(KDIR)/vmlinux-$(2).bin.lzma \
-               -r $(BIN_DIR)/$(IMG_PREFIX)-root.$(1) -a 0x10000 \
+               -r $(BIN_DIR)/$(IMG_PREFIX)-root.$(1) \
+               -a $(call rootfs_align,$(1)) -j \
                -o $(call factoryname,$(1),$(2))
        -$(STAGING_DIR_HOST)/bin/mktplinkfw \
                -H $(4) -W $(5) -F $(6) -N OpenWrt -V $(REVISION) -s \
                -k $(KDIR)/vmlinux-$(2).bin.lzma \
-               -r $(BIN_DIR)/$(IMG_PREFIX)-root.$(1) -a 0x10000 \
+               -r $(BIN_DIR)/$(IMG_PREFIX)-root.$(1) \
+               -a $(call rootfs_align,$(1)) -j \
                -o $(call sysupname,$(1),$(2))
 endef
 
@@ -532,10 +538,6 @@ define Image/Build/Template/squashfs-only/squashfs
        $(call Image/Build/$(1),squashfs,$(2),$(3),$(4),$(5),$(6),$(7),$(8))
 endef
 
-define Image/Build/Template/4k/squashfs
-       $(call Image/Build/$(1),squashfs-4k,$(2),$(3),$(4),$(5),$(6),$(7),$(8))
-endef
-
 define Image/Build/Template/64k/squashfs
        $(call Image/Build/$(1),squashfs-64k,$(2),$(3),$(4),$(5),$(6),$(7),$(8))
 endef
@@ -558,7 +560,7 @@ ap121_mtdlayout_4M=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,2752k(rootfs
 
 ap121_cmdline=board=AP121 console=ttyATH0,115200
 define Image/Build/Profile/AP121
-       $(call Image/Build/Template/$(fs_4k)/$(1),AthLzma,ap121-2M,$(ap121_cmdline),ap121_mtdlayout_2M,720896,1245184,RK)
+       $(call Image/Build/Template/$(fs_64k)/$(1),AthLzma,ap121-2M,$(ap121_cmdline),ap121_mtdlayout_2M,720896,1245184,RK)
        $(call Image/Build/Template/$(fs_64k)/$(1),AthLzma,ap121-4M,$(ap121_cmdline),ap121_mtdlayout_4M,917504,2818048,RK)
 endef
 
@@ -620,6 +622,12 @@ define Image/Build/Profile/EAP7660D
        $(call Image/Build/Template/$(fs_128k)/$(1),PB4X,eap7660d,$(eap7660d_cmdline))
 endef
 
+hornetub_cmdline=board=HORNET-UB console=ttyATH0,115200
+hornetub_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,6144k(rootfs),1600k(kernel),64k(nvram),64k(art)ro,7744k@0x50000(firmware)
+define Image/Build/Profile/HORNETUB
+       $(call Image/Build/Template/$(fs_64k)/$(1),AthLzma,hornet-ub,$(hornetub_cmdline),hornetub_mtdlayout,1638400,6291456,RK)
+endef
+
 ja76pf_cmdline=board=JA76PF console=ttyS0,115200
 define Image/Build/Profile/JA76PF
        $(call Image/Build/Template/$(fs_64k)/$(1),PB4X,ja76pf,$(ja76pf_cmdline))
@@ -795,8 +803,10 @@ wndr3700_mtdlayout=mtdparts=spi0.0:320k(u-boot)ro,128k(u-boot-env)ro,1024k(kerne
 wndr3700v2_mtdlayout=mtdparts=spi0.0:320k(u-boot)ro,128k(u-boot-env)ro,1024k(kernel),14848k(rootfs),64k(art)ro,15872k@0x70000(firmware)
 define Image/Build/Profile/WNDR3700
        $(call Image/Build/Template/$(fs_64k)/$(1),Netgear,wndr3700,$(wndr3700_cmdline),$(wndr3700_mtdlayout),3700,WNDR3700,"" NA,)
-       $(call Image/Build/Template/$(fs_64k)/$(1),Netgear,wndr3700v2,$(wndr3700_cmdline),$(wndr3700v2_mtdlayout),3701,WNDR3700,"",-H 29763654+16+64)
-       $(call Image/Build/Template/$(fs_64k)/$(1),Netgear,wndr3800,$(wndr3700_cmdline),$(wndr3700v2_mtdlayout),3701,WNDR3700,"",-H 29763654+16+128)
+       $(call Image/Build/Template/$(fs_64k)/$(1),Netgear,wndr3700v2,$(wndr3700_cmdline),$(wndr3700v2_mtdlayout),3701,WNDR3700v2,"",-H 29763654+16+64)
+       $(call Image/Build/Template/$(fs_64k)/$(1),Netgear,wndrmac,$(wndr3700_cmdline),$(wndr3700v2_mtdlayout),3701,WNDRMAC,"",-H 29763654+16+64)
+       $(call Image/Build/Template/$(fs_64k)/$(1),Netgear,wndr3800,$(wndr3700_cmdline),$(wndr3700v2_mtdlayout),3701,WNDR3800,"",-H 29763654+16+128)
+       $(call Image/Build/Template/$(fs_64k)/$(1),Netgear,wndrmacv2,$(wndr3700_cmdline),$(wndr3700v2_mtdlayout),3701,WNDRMACv2,"",-H 29763654+16+128)
 endef
 
 wr400n_cmdline=board=WRT400N console=ttyS0,115200
@@ -873,6 +883,7 @@ define Image/Build/Profile/Default
        $(call Image/Build/Profile/DIR825B1,$(1))
        $(call Image/Build/Profile/EAP7660D,$(1))
        $(call Image/Build/Profile/FR54RTR,$(1))
+       $(call Image/Build/Profile/HORNETUB,$(1))
        $(call Image/Build/Profile/JA76PF,$(1))
        $(call Image/Build/Profile/JWAP003,$(1))
        $(call Image/Build/Profile/MZKW04NU,$(1))
@@ -923,11 +934,8 @@ define Image/Build/Profile/Madwifi
 endef
 
 define Image/Build/squashfs
-       cp $(KDIR)/root.squashfs $(KDIR)/root.squashfs-4k
-       $(STAGING_DIR_HOST)/bin/padjffs2 $(KDIR)/root.squashfs-4k 4
-       cp $(KDIR)/root.squashfs-4k $(BIN_DIR)/$(IMG_PREFIX)-root.squashfs-4k
        cp $(KDIR)/root.squashfs $(KDIR)/root.squashfs-64k
-       $(STAGING_DIR_HOST)/bin/padjffs2 $(KDIR)/root.squashfs-64k 4 8 64
+       $(STAGING_DIR_HOST)/bin/padjffs2 $(KDIR)/root.squashfs-64k 64
        cp $(KDIR)/root.squashfs-64k $(BIN_DIR)/$(IMG_PREFIX)-root.squashfs-64k
        $(call prepare_generic_squashfs,$(KDIR)/root.squashfs)
 endef
This page took 0.025835 seconds and 4 git commands to generate.