summaryrefslogtreecommitdiff
path: root/openwrt/target/linux/image
diff options
context:
space:
mode:
Diffstat (limited to 'openwrt/target/linux/image')
-rw-r--r--openwrt/target/linux/image/Makefile6
-rw-r--r--openwrt/target/linux/image/ar7/Makefile34
-rw-r--r--openwrt/target/linux/image/brcm/Makefile30
-rw-r--r--openwrt/target/linux/image/jffs2.mk5
-rw-r--r--openwrt/target/linux/image/soekris/Makefile5
-rw-r--r--openwrt/target/linux/image/squashfs.mk6
6 files changed, 68 insertions, 18 deletions
diff --git a/openwrt/target/linux/image/Makefile b/openwrt/target/linux/image/Makefile
index b6a6c56914..74c778a334 100644
--- a/openwrt/target/linux/image/Makefile
+++ b/openwrt/target/linux/image/Makefile
@@ -19,6 +19,12 @@ compile:
install:
$(MAKE) -C $(BOARD) prepare
$(MAKE) -C $(BOARD) compile
+
+install-ib:
+ -$(MAKE) -C $(BOARD) IB_DIR="$(IB_DIR)" install-ib
+ mkdir -p $(IB_DIR)/build_$(ARCH)/linux-$(KERNEL)-$(BOARD)
+ cp $(BUILD_DIR)/linux-$(KERNEL)-$(BOARD)/kernel[-_]*.ipk $(IB_DIR)/build_$(ARCH)/linux-$(KERNEL)-$(BOARD)/
+
rebuild: clean prepare compile install
clean:
diff --git a/openwrt/target/linux/image/ar7/Makefile b/openwrt/target/linux/image/ar7/Makefile
index 4436fa9ba9..8a369edb62 100644
--- a/openwrt/target/linux/image/ar7/Makefile
+++ b/openwrt/target/linux/image/ar7/Makefile
@@ -1,6 +1,6 @@
include $(TOPDIR)/rules.mk
-KDIR:=$(BUILD_DIR)/linux-$(KERNEL)-ar7
+KDIR:=$(BUILD_DIR)/linux-$(KERNEL)-$(BOARD)
PKG_BUILD_DIR:=$(BUILD_DIR)/ar7loader
@@ -47,9 +47,11 @@ $(KDIR)/vmlinux.bin: $(KDIR)/vmlinux.lzma
-o $(KDIR)/loader
$(TARGET_CROSS)objcopy -O srec $(KDIR)/loader $(KDIR)/ram_zimage.sre
$(STAGING_DIR)/bin/srec2bin $(KDIR)/ram_zimage.sre $@
+
+$(BIN_DIR)/openwrt-$(BOARD)-$(KERNEL)-kernel.bin: $(KDIR)/vmlinux.bin
endif
-$(BIN_DIR)/openwrt-ar7-2.4-kernel.bin: $(KDIR)/vmlinux.bin
+$(BIN_DIR)/openwrt-$(BOARD)-$(KERNEL)-kernel.bin:
cp $< $@
ifeq ($(FS),jffs2-8MB)
@@ -59,16 +61,16 @@ ifeq ($(FS),jffs2-4MB)
ALIGN:=bs=65536 conv=sync
endif
-$(BIN_DIR)/openwrt-ar7-$(KERNEL)-$(FS).bin: $(BIN_DIR)/openwrt-ar7-2.4-kernel.bin
+$(BIN_DIR)/openwrt-$(BOARD)-$(KERNEL)-$(FS).bin: $(BIN_DIR)/openwrt-$(BOARD)-$(KERNEL)-kernel.bin
dd if=$< $(ALIGN) > $@
- cat $(BUILD_DIR)/linux-$(KERNEL)-ar7/root.$(FS) >> $@
+ cat $(BUILD_DIR)/linux-$(KERNEL)-$(BOARD)/root.$(FS) >> $@
define pattern_template
-$(BIN_DIR)/openwrt-ar7-$(KERNEL)-$(FS)-$(1).bin: $(BIN_DIR)/openwrt-ar7-$(KERNEL)-$(FS).bin
- (dd if=/dev/zero bs=16 count=1; cat $(BIN_DIR)/openwrt-ar7-$(KERNEL)-$(FS).bin) | \
- $(STAGING_DIR)/bin/addpattern -p $(1) $(2) -o $(BIN_DIR)/openwrt-ar7-$(KERNEL)-$(FS)-$(1).bin
+$(BIN_DIR)/openwrt-$(BOARD)-$(KERNEL)-$(FS)-$(1).bin: $(BIN_DIR)/openwrt-$(BOARD)-$(KERNEL)-$(FS).bin
+ (dd if=/dev/zero bs=16 count=1; cat $(BIN_DIR)/openwrt-$(BOARD)-$(KERNEL)-$(FS).bin) | \
+ $(STAGING_DIR)/bin/addpattern -p $(1) $(2) -o $(BIN_DIR)/openwrt-$(BOARD)-$(KERNEL)-$(FS)-$(1).bin
-install: $(BIN_DIR)/openwrt-ar7-$(KERNEL)-$(FS)-$(1).bin
+install: $(BIN_DIR)/openwrt-$(BOARD)-$(KERNEL)-$(FS)-$(1).bin
endef
$(eval $(call pattern_template,WA22))
@@ -76,11 +78,23 @@ $(eval $(call pattern_template,WAG2))
$(eval $(call pattern_template,WA21))
$(eval $(call pattern_template,WA32,-b))
+ifeq ($(IB),)
clean:
rm -rf $(PKG_BUILD_DIR)
- rm -f $(BIN_DIR)/openwrt-ar7*
+ rm -f $(BIN_DIR)/openwrt-$(BOARD)*
prepare: $(PKG_BUILD_DIR) $(PKG_BUILD_DIR)/zimage.script $(PKG_BUILD_DIR)/ld.script
compile: prepare $(PKG_BUILD_DIR)/loader.o $(PKG_BUILD_DIR)/LzmaDecode.o $(STAGING_DIR)/bin/srec2bin
-install: $(BIN_DIR)/openwrt-ar7-2.4-kernel.bin $(BIN_DIR)/openwrt-ar7-$(KERNEL)-$(FS).bin
+else
+clean:
+prepare:
+compile:
+endif
+install: $(BIN_DIR)/openwrt-$(BOARD)-$(KERNEL)-kernel.bin $(BIN_DIR)/openwrt-$(BOARD)-$(KERNEL)-$(FS).bin
+install-ib:
+ mkdir -p $(IB_DIR)/build_$(ARCH)/linux-$(KERNEL)-$(BOARD)
+ cp -dpR $(KDIR)/vmlinux.bin $(IB_DIR)/build_$(ARCH)/linux-$(KERNEL)-$(BOARD)/
+ mkdir -p $(IB_DIR)/staging_dir_$(ARCH)
+ cp -dpR $(STAGING_DIR)/bin/addpattern $(IB_DIR)/staging_dir_$(ARCH)/bin/
+
diff --git a/openwrt/target/linux/image/brcm/Makefile b/openwrt/target/linux/image/brcm/Makefile
index ec8f72ccac..f551b84bee 100644
--- a/openwrt/target/linux/image/brcm/Makefile
+++ b/openwrt/target/linux/image/brcm/Makefile
@@ -1,6 +1,6 @@
include $(TOPDIR)/rules.mk
-KDIR:=$(BUILD_DIR)/linux-$(KERNEL)-brcm
+KDIR:=$(BUILD_DIR)/linux-$(KERNEL)-$(BOARD)
lzma-loader-clean:
$(MAKE) -C lzma-loader clean
@@ -11,16 +11,20 @@ lzma-loader-prepare:
lzma-loader-compile: lzma-loader-prepare
$(MAKE) -C lzma-loader compile
+ifeq ($(IB),)
$(KDIR)/vmlinux.lzma: $(KDIR)/vmlinux
cat $^ | $(STAGING_DIR)/bin/lzma e -si -so -eos -lc1 -lp2 -pb2 > $@ || (rm -f $@ && false)
+$(BIN_DIR)/openwrt-$(BOARD)-$(KERNEL)-$(FS).trx: $(KDIR)/vmlinux.lzma
+endif
+
ifeq ($(FS),jffs2-8MB)
TRXALIGN:=-a 0x20000
endif
ifeq ($(FS),jffs2-4MB)
TRXALIGN:=-a 0x10000
endif
-$(BIN_DIR)/openwrt-brcm-$(KERNEL)-$(FS).trx: $(KDIR)/vmlinux.lzma
+$(BIN_DIR)/openwrt-$(BOARD)-$(KERNEL)-$(FS).trx:
$(STAGING_DIR)/bin/trx -o $@ $(BUILD_DIR)/loader.gz $(KDIR)/vmlinux.lzma $(TRXALIGN) $(KDIR)/root.$(FS)
@@ -28,26 +32,38 @@ ifeq ($(KERNEL),2.4)
FSNAME:=$(patsubst jffs2-%,jffs2,$(FS))
ifneq ($(FS),jffs2-8MB)
-$(BIN_DIR)/openwrt-wrt54g-$(FSNAME).bin: $(BIN_DIR)/openwrt-brcm-$(KERNEL)-$(FS).trx
+$(BIN_DIR)/openwrt-wrt54g-$(FSNAME).bin: $(BIN_DIR)/openwrt-$(BOARD)-$(KERNEL)-$(FS).trx
$(STAGING_DIR)/bin/addpattern -4 -p W54G -v v4.20.6 -i $< -o $@ -g
install: $(BIN_DIR)/openwrt-wrt54g-$(FSNAME).bin
endif
ifneq ($(FS),jffs2-4MB)
-$(BIN_DIR)/openwrt-wrt54gs-$(FSNAME).bin: $(BIN_DIR)/openwrt-brcm-$(KERNEL)-$(FS).trx
+$(BIN_DIR)/openwrt-wrt54gs-$(FSNAME).bin: $(BIN_DIR)/openwrt-$(BOARD)-$(KERNEL)-$(FS).trx
$(STAGING_DIR)/bin/addpattern -4 -p W54S -v v4.70.6 -i $< -o $@ -g
install: $(BIN_DIR)/openwrt-wrt54gs-$(FSNAME).bin
endif
-$(BIN_DIR)/openwrt-motorola-$(FS).bin: $(BIN_DIR)/openwrt-brcm-$(KERNEL)-$(FS).trx
+$(BIN_DIR)/openwrt-motorola-$(FS).bin: $(BIN_DIR)/openwrt-$(BOARD)-$(KERNEL)-$(FS).trx
$(STAGING_DIR)/bin/motorola-bin $< $@
install: $(BIN_DIR)/openwrt-motorola-$(FS).bin
endif
+ifeq ($(IB),)
clean: lzma-loader-clean
prepare: lzma-loader-prepare
compile: lzma-loader-compile
-install: compile $(BIN_DIR)/openwrt-brcm-$(KERNEL)-$(FS).trx
-
+install: compile $(BIN_DIR)/openwrt-$(BOARD)-$(KERNEL)-$(FS).trx
+else
+clean:
+prepare:
+compile:
+install: $(BIN_DIR)/openwrt-$(BOARD)-$(KERNEL)-$(FS).trx
+endif
+install-ib:
+ mkdir -p $(IB_DIR)/staging_dir_$(ARCH)/bin
+ cp -dpR $(STAGING_DIR)/bin/addpattern $(STAGING_DIR)/bin/trx $(STAGING_DIR)/bin/motorola-bin $(IB_DIR)/staging_dir_$(ARCH)/bin
+ mkdir -p $(IB_DIR)/build_$(ARCH)/linux-$(KERNEL)-$(BOARD)
+ cp -dpR $(BUILD_DIR)/loader.gz $(IB_DIR)/build_$(ARCH)/
+ cp -dpR $(KDIR)/vmlinux.lzma $(IB_DIR)/build_$(ARCH)/linux-$(KERNEL)-$(BOARD)/
diff --git a/openwrt/target/linux/image/jffs2.mk b/openwrt/target/linux/image/jffs2.mk
index 02c56817b3..a2c47e4dcd 100644
--- a/openwrt/target/linux/image/jffs2.mk
+++ b/openwrt/target/linux/image/jffs2.mk
@@ -23,8 +23,13 @@ jffs2-install: $(KDIR)/root.jffs2-4MB $(KDIR)/root.jffs2-8MB
$(MAKE) -C $(BOARD) install KERNEL="$(KERNEL)" FS="jffs2-4MB"
$(MAKE) -C $(BOARD) install KERNEL="$(KERNEL)" FS="jffs2-8MB"
+jffs2-install-ib:
+ mkdir -p $(IB_DIR)/staging_dir_$(ARCH)/bin
+ cp $(STAGING_DIR)/bin/mkfs.jffs2 $(IB_DIR)/staging_dir_$(ARCH)/bin
+
prepare: jffs2-prepare
compile: jffs2-compile
install: jffs2-install
+install-ib: jffs2-install-ib
clean: jffs2-clean
diff --git a/openwrt/target/linux/image/soekris/Makefile b/openwrt/target/linux/image/soekris/Makefile
index 0b4fba9d8e..9ab3a73883 100644
--- a/openwrt/target/linux/image/soekris/Makefile
+++ b/openwrt/target/linux/image/soekris/Makefile
@@ -27,7 +27,10 @@ $(BIN_DIR)/openwrt-$(BOARD)-$(KERNEL)-vmlinuz: $(KDIR)/bzImage
cp $^ $@
+clean:
prepare:
compile:
install: $(BIN_DIR)/openwrt-$(BOARD)-$(KERNEL)-vmlinuz
-
+install-ib:
+ mkdir -p $(IB_DIR)/build_$(ARCH)/linux-$(KERNEL)-$(BOARD)
+ cp -dpR $(KDIR)/bzImage $(IB_DIR)/build_$(ARCH)/linux-$(KERNEL)-$(BOARD)/
diff --git a/openwrt/target/linux/image/squashfs.mk b/openwrt/target/linux/image/squashfs.mk
index 70a85b99ee..42ff77db64 100644
--- a/openwrt/target/linux/image/squashfs.mk
+++ b/openwrt/target/linux/image/squashfs.mk
@@ -14,7 +14,13 @@ $(KDIR)/root.squashfs:
squashfs-install: $(KDIR)/root.squashfs
$(MAKE) -C $(BOARD) install KERNEL="$(KERNEL)" FS="squashfs"
+
+squashfs-install-ib:
+ mkdir -p $(IB_DIR)/staging_dir_$(ARCH)/bin
+ cp $(STAGING_DIR)/bin/mksquashfs-lzma $(IB_DIR)/staging_dir_$(ARCH)/bin
prepare: squashfs-prepare
compile: squashfs-compile
install: squashfs-install
+install-ib: squashfs-install-ib
+clean: squashfs-clean