summaryrefslogtreecommitdiff
path: root/package/linux
diff options
context:
space:
mode:
authorwbx <wbx@3c298f89-4303-0410-b956-a3cf2f4a3e73>2005-04-02 12:12:58 +0000
committerwbx <wbx@3c298f89-4303-0410-b956-a3cf2f4a3e73>2005-04-02 12:12:58 +0000
commit21db875713e9dab2d6560f121b8e856fd182a773 (patch)
tree242788637a26f3f16ea5b2cf9912f9274b46ad51 /package/linux
parent59cf9955ada396f84414e779e62d9742b7451d66 (diff)
lzma loader patch from oleg, great thanks good work, saves another 300 kb flashmemory
git-svn-id: svn://svn.openwrt.org/openwrt/trunk/openwrt@513 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/linux')
-rw-r--r--package/linux/kernel-source/arch/mips/brcm-boards/bcm947xx/compressed/Makefile71
-rw-r--r--package/linux/kernel-source/arch/mips/brcm-boards/bcm947xx/setup.c3
-rw-r--r--package/linux/linux.mk2
3 files changed, 5 insertions, 71 deletions
diff --git a/package/linux/kernel-source/arch/mips/brcm-boards/bcm947xx/compressed/Makefile b/package/linux/kernel-source/arch/mips/brcm-boards/bcm947xx/compressed/Makefile
index 4004653268..ead9d07439 100644
--- a/package/linux/kernel-source/arch/mips/brcm-boards/bcm947xx/compressed/Makefile
+++ b/package/linux/kernel-source/arch/mips/brcm-boards/bcm947xx/compressed/Makefile
@@ -11,40 +11,11 @@
#
# $Id$
#
-# Copyright 2004 Manuel Novoa III <mjn3@codepoet.org>
-# Modified to support bzip'd kernels.
-# Of course, it would be better to integrate bunzip capability into CFE.
-#
-
-# Link at 3 MB offset in RAM
-#TEXT_START ?= 0x80300000
-TEXT_START ?= 0x80001000
-BZ_MEM_TOP := 0x81000000
-BZ_TEXT_START := BZ_MEM_TOP-0x4000
-BZ_STACK_TOP := BZ_TEXT_START-4
OBJCOPY := $(CROSS_COMPILE)objcopy -O binary -R .reginfo -R .note -R .comment -R .mdebug -S
-
-SRCBASE := $(TOPDIR)/../..
-VPATH := $(SRCBASE)/shared
-ASFLAGS += -D__ASSEMBLY__ -I$(SRCBASE)/include -DLOADADDR=$(LOADADDR)
-ASFLAGS += -DBZ_MEM_TOP=$(BZ_MEM_TOP)
-ASFLAGS += -DBZ_TEXT_START=$(BZ_TEXT_START)
-ASFLAGS += -DBZ_STACK_TOP=$(BZ_STACK_TOP)
-CFLAGS += -I$(SRCBASE)/include -DLOADADDR=$(LOADADDR)
-CFLAGS += -DBZ_MEM_TOP=$(BZ_MEM_TOP)
-CFLAGS += -DBZ_TEXT_START=$(BZ_TEXT_START)
-CFLAGS += -DBZ_STACK_TOP=$(BZ_STACK_TOP)
-ifdef CONFIG_MCOUNT
-CFLAGS := $(subst -pg,,$(CFLAGS))
-endif
-CFLAGS += -ffunction-sections $(call check_gcc, -fvtable-gc, )
-SEDFLAGS := s/BZ_TEXT_START/$(BZ_TEXT_START)/;s/BZ_MEM_TOP/$(BZ_MEM_TOP)/;s/TEXT_START/$(TEXT_START)/
-
SYSTEM ?= $(TOPDIR)/vmlinux
-OBJECTS := head.o data.o
-all: bzImage vmlinuz
+all: vmlinuz
# Don't build dependencies, this may die if $(CC) isn't gcc
dep:
@@ -53,48 +24,10 @@ dep:
vmlinuz: piggy
gzip -c9 $< > $@
-# Our bzImage is a gzip'd binary that decompresses and runs
-# the appended bzip'd kernel.
-bzImage: bzLoaderImage.gz piggz
- cat bzLoaderImage.gz piggz > $@
-
-bzLoaderImage.gz: bzLoaderImage
- gzip -nc9 $< > $@
-
-bzLoaderImage: bzLoader
- $(OBJCOPY) $< $@
-
-bzLoader: vmlinux.lds $(OBJECTS)
- $(LD) -static --gc-sections -no-warn-mismatch -T vmlinux.lds -o $@ $(OBJECTS)
-
-vmlinux.lds: vmlinux.lds.in Makefile
- @sed "$(SEDFLAGS)" < $< > $@
-
-piggz: piggy
- bzip2 -c9 $< > $@
-
piggy: $(SYSTEM)
$(OBJCOPY) $< $@
-data.o: data.lds data.image
- $(LD) -no-warn-mismatch -T data.lds -r -o $@ -b binary data.image -b elf32-tradlittlemips
-
-data.lds:
- @echo "SECTIONS { .data : { code_start = .; *(.data) code_stop = .; }}" > $@
-
-data.image: decompress_bunzip2.image
- $(OBJCOPY) $< $@
-
-decompress_bunzip2.image: decompress_bunzip2.lds decompress_bunzip2.o
- $(LD) -static --gc-sections -no-warn-mismatch -T decompress_bunzip2.lds -o $@ decompress_bunzip2.o
-
-decompress_bunzip2.lds: decompress_bunzip2.lds.in Makefile
- @sed "$(SEDFLAGS)" < $< > $@
-
mrproper: clean
clean:
- rm -f vmlinux vmlinuz piggz piggy *.lds *.o \
- bzLoader bzLoaderImage bzLoaderImage.gz bzImage \
- data.lds data.image \
- decompress_bunzip2.lds decompress_bunzip2.image
+ rm -f vmlinuz piggy
diff --git a/package/linux/kernel-source/arch/mips/brcm-boards/bcm947xx/setup.c b/package/linux/kernel-source/arch/mips/brcm-boards/bcm947xx/setup.c
index e1b0050a45..2132c00837 100644
--- a/package/linux/kernel-source/arch/mips/brcm-boards/bcm947xx/setup.c
+++ b/package/linux/kernel-source/arch/mips/brcm-boards/bcm947xx/setup.c
@@ -195,7 +195,8 @@ find_root(struct mtd_info *mtd, size_t size, struct mtd_partition *part)
/* found a TRX header */
if (le32_to_cpu(trx->magic) == TRX_MAGIC) {
- part->offset = le32_to_cpu(trx->offsets[1]);
+ part->offset = le32_to_cpu(trx->offsets[2]) ? :
+ le32_to_cpu(trx->offsets[1]);
part->size = le32_to_cpu(trx->len);
part->size -= part->offset;
diff --git a/package/linux/linux.mk b/package/linux/linux.mk
index 02cc3bb8ae..4284c38f00 100644
--- a/package/linux/linux.mk
+++ b/package/linux/linux.mk
@@ -25,7 +25,7 @@ LINUX_SOURCE=linux-$(LINUX_VERSION).tar.bz2
LINUX_KCONFIG=./linux.config
LINUX_PATCHES=./kernel-patches
LINUX_KERNEL_SOURCE=./kernel-source
-LINUX_BINLOC=arch/$(LINUX_KARCH)/brcm-boards/bcm947xx/compressed/vmlinuz
+LINUX_BINLOC=arch/$(LINUX_KARCH)/brcm-boards/bcm947xx/compressed/piggy
# Used by pcmcia-cs and others
LINUX_SOURCE_DIR=$(LINUX_DIR)-$(LINUX_VERSION)