ramips: build initramfs image for DIR-{3,6}00 boards
[openwrt/staging/lynxis/omap.git] / target / linux / ramips / image / Makefile
index d303ed8b39fd6e8b3718cf75d4a80bebd62505d3..97f4a9a42d4f082497a5e6f60710f62c45cc2c6d 100644 (file)
@@ -104,9 +104,9 @@ define BuildFirmware/Generic/initramfs
        $(CP) $(KDIR)/vmlinux-$(2).uImage $(call imgname,$(1),$(2))-uImage.bin
 endef
 
-mtdlayout_4M=192k(u-boot)ro,64k(u-boot-env)ro,64k(factory)ro,832k(kernel),2944k(rootfs),3776k@0x50000(firmware)
+mtdlayout_4M=192k(u-boot)ro,64k(u-boot-env)ro,64k(factory)ro,896k(kernel),2880k(rootfs),3776k@0x50000(firmware)
 define BuildFirmware/GENERIC_4M
-       $(call BuildFirmware/Generic,$(1),$(2),$(call mkcmdline,$(3),$(4),$(5)) $(call mkmtd/$(6),$(mtdlayout_4M)),851968,3014656)
+       $(call BuildFirmware/Generic,$(1),$(2),$(call mkcmdline,$(3),$(4),$(5)) $(call mkmtd/$(6),$(mtdlayout_4M)),917504,2949120)
 endef
 
 define BuildFirmware/GENERIC_4M/initramfs
@@ -164,10 +164,16 @@ define BuildFirmware/DIR300B1
                -o $(call imgname,$(1),$(2))-factory.bin
 endef
 
+define BuildFirmware/DIR300B1/initramfs
+       $(call BuildFirmware/Generic/initramfs,$(1),$(2),board=$(3) $(call mkmtd/phys,$(mtdlayout_dir300b1)),$(mtd_dir300b1_kernel_part_size),$(mtd_dir300b1_rootfs_part_size))
+endef
+
 define BuildFirmware/Edimax
-       mkedimaximg -i $(call sysupname,$(1),$(2)) \
-               -o $(call imgname,$(1),$(2))-factory.bin \
-               -s $(3) -m $(4) -f $(5) -S $(6)
+       if [ -e "$(call sysupname,$(1),$(2))" ]; then \
+               mkedimaximg -i $(call sysupname,$(1),$(2)) \
+                       -o $(call imgname,$(1),$(2))-factory.bin \
+                       -s $(3) -m $(4) -f $(5) -S $(6); \
+       fi
 endef
 
 mtdlayout_f5d8235=320k(u-boot)ro,1536k(kernel),6208k(rootfs),64k(nvram),64k(factory),7744k@0x50000(firmware)
@@ -178,13 +184,13 @@ define BuildFirmware/F5D8235
 endef
 
 define BuildFirmware/FONERA20N
-       $(call Image/Build/Template/GENERIC_8M,$(1),fonera20n,FONERA20N,ttyS1,57600,phys)
+       $(call BuildFirmware/GENERIC_8M,$(1),fonera20n,FONERA20N,ttyS1,57600,phys)
        $(call BuildFirmware/Edimax,$(1),fonera20n,RSDK,NL1T,0x50000,0xc0000)
 endef
 
-mtdlayout_nw718=192k(u-boot)ro,128k(config)ro,64k(factory)ro,832k(kernel),2880k(rootfs),3712k@0x60000(firmware)
-kernel_size_nw718=851968
-rootfs_size_nw718=2949120
+mtdlayout_nw718=192k(u-boot)ro,128k(config)ro,64k(factory)ro,896k(kernel),2816k(rootfs),3712k@0x60000(firmware)
+kernel_size_nw718=917504
+rootfs_size_nw718=2883584
 cmdline_nw718=$(call mkcmdline,NW718,ttyS1,57600) $(call mkmtd/spi,$(mtdlayout_nw718))
 define BuildFirmware/NW718
        $(call BuildFirmware/Generic,$(1),$(2),$(cmdline_nw718),$(kernel_size_nw718),$(rootfs_size_nw718))
@@ -196,13 +202,20 @@ define BuildFirmware/NW718
        $(call CatFiles,$(KDIR)/vmlinux-$(2).uImage,$(kernel_size_nw718),$(KDIR)/root.$(1),$(rootfs_size_nw718),$(call imgname,$(1),$(2))-factory.bin)
 endef
 
-mtdlayout_rtg32b1=192k(u-boot)ro,64k(devdata)ro,64k(devconf)ro,832k(kernel),2944k(rootfs),3776k@0x50000(firmware)
-mtd_rtg32b1_kernel_part_size=851968
-mtd_rtg32b1_rootfs_part_size=3014656
+mtdlayout_rtg32b1=192k(u-boot)ro,64k(devdata)ro,64k(devconf)ro,896k(kernel),2880k(rootfs),3776k@0x50000(firmware)
+mtd_rtg32b1_kernel_part_size=917504
+mtd_rtg32b1_rootfs_part_size=2949120
 define BuildFirmware/RTG32B1
        $(call BuildFirmware/Generic,$(1),$(2),board=$(3) $(call mkmtd/spi,$(mtdlayout_rtg32b1)),$(mtd_rtg32b1_kernel_part_size),$(mtd_rtg32b1_rootfs_part_size))
 endef
 
+mtdlayout_rtn10plus=192k(u-boot)ro,64k(devdata)ro,64k(devconf)ro,896k(kernel),2880k(rootfs),3776k@0x50000(firmware)
+mtd_rtn10plus_kernel_part_size=917504
+mtd_rtn10plus_rootfs_part_size=2949120
+define BuildFirmware/RTN10PLUS
+       $(call BuildFirmware/Generic,$(1),$(2),board=$(3) $(call mkmtd/phys,$(mtdlayout_rtn10plus)),$(mtd_rtn10plus_kernel_part_size),$(mtd_rtn10plus_rootfs_part_size))
+endef
+
 mtdlayout_whrg300n=192k(u-boot)ro,64k(u-boot-env)ro,64k(factory)ro,960k(kernel),2752k(rootfs),64k(user)ro,3712k@0x50000(firmware)
 define BuildFirmware/WHRG300N
        $(call Image/Build/Template/GENERIC_4M,$(1),whr-g300n,WHR-G300N,ttyS1,57600,phys)
@@ -216,9 +229,9 @@ define BuildFirmware/WHRG300N
                -o $(call imgname,$(1),whr-g300n)-tftp.bin
 endef
 
-mtdlayout_wl341v3=128k(u-boot)ro,64k(board-nvram)ro,64k(u-boot-env)ro,832k(kernel),2944k(rootfs),64k(signature-eRcOmM),3776k@0x40000(firmware),4096k@0x0(fullflash)
-kernel_size_wl341v3=851968
-rootfs_size_wl341v3=3014656
+mtdlayout_wl341v3=128k(u-boot)ro,64k(board-nvram)ro,64k(u-boot-env)ro,896k(kernel),2880k(rootfs),64k(signature-eRcOmM),3776k@0x40000(firmware),4096k@0x0(fullflash)
+kernel_size_wl341v3=917504
+rootfs_size_wl341v3=2949120
 define BuildFirmware/WL341V3
        $(call BuildFirmware/Generic,$(1),$(2),board=$(3) $(call mkmtd/phys,$(mtdlayout_wl341v3)),$(kernel_size_wl341v3),$(rootfs_size_wl341v3))
        if [ -e "$(call sysupname,$(1),$(2))" ]; then \
@@ -236,9 +249,9 @@ define BuildFirmware/WL341V3
        fi
 endef
 
-mtdlayout_wlitx4ag300n=192k(u-boot)ro,64k(u-boot-env)ro,64k(factory)ro,832k(kernel),2880k(rootfs),64k(user)ro,3712k@0x50000(firmware)
+mtdlayout_wlitx4ag300n=192k(u-boot)ro,64k(u-boot-env)ro,64k(factory)ro,896k(kernel),2816k(rootfs),64k(user)ro,3712k@0x50000(firmware)
 define BuildFirmware/WLITX4AG300N
-       $(call BuildFirmware/Buffalo2,$(1),wli-tx4-ag300n,WLI-TX4-AG300N,$(call mkmtd/phys,$(mtdlayout_wlitx4ag300n)),851968,2949120)
+       $(call BuildFirmware/Buffalo2,$(1),wli-tx4-ag300n,WLI-TX4-AG300N,$(call mkmtd/phys,$(mtdlayout_wlitx4ag300n)),917504,2883584)
 endef
 
 #
@@ -341,6 +354,10 @@ define Image/Build/Profile/RTG32B1
        $(call Image/Build/Template/$(fs_squash)/$(1),RTG32B1,rt-g32-b1,RT-G32-B1)
 endef
 
+define Image/Build/Profile/RTN10PLUS
+       $(call Image/Build/Template/$(fs_squash)/$(1),RTN10PLUS,rt-n10-plus,RT-N10-PLUS)
+endef
+
 define Image/Build/Profile/SLR7205
        $(call Image/Build/Template/$(fs_squash)/$(1),GENERIC_4M,sl-r7205,SL-R7205,ttyS1,57600,phys)
 endef
@@ -378,6 +395,10 @@ define Image/Build/Profile/WR6202
        $(call Image/Build/Template/$(fs_squash)/$(1),GENERIC_8M,wr6202,WR6202,ttyS1,115200,phys)
 endef
 
+define Image/Build/Profile/XDXRN502J
+       $(call Image/Build/Template/$(fs_squash)/$(1),GENERIC_4M,xdxrn502j,XDXRN502J,ttyS1,57600,phys)
+endef
+
 ifeq ($(CONFIG_RALINK_RT305X),y)
 define Image/Build/Profile/Default
        $(call Image/Build/Profile/ALL0256N,$(1))
@@ -386,6 +407,7 @@ define Image/Build/Profile/Default
        $(call Image/Build/Profile/DIR300B1,$(1))
        $(call Image/Build/Profile/ESR9753,$(1))
        $(call Image/Build/Profile/F5D8235V2,$(1))
+       $(call Image/Build/Profile/RTN10PLUS,$(1))
        $(call Image/Build/Profile/FONERA20N,$(1))
        $(call Image/Build/Profile/HW5503G,$(1))
        $(call Image/Build/Profile/MOFI35003GN,$(1))
@@ -403,6 +425,7 @@ define Image/Build/Profile/Default
        $(call Image/Build/Profile/WL351,$(1))
        $(call Image/Build/Profile/WR5123GN,$(1))
        $(call Image/Build/Profile/WR6202,$(1))
+       $(call Image/Build/Profile/XDXRN502J,$(1))
 endef
 endif