1
0
mirror of git://projects.qi-hardware.com/openwrt-xburst.git synced 2024-12-19 17:48:27 +02:00
openwrt-xburst/target/linux/rdc/patches-2.6.24/600-x86_lzma.patch
juhosg bff9e9b63b [rdc] refresh 2.6.24 patches
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@14451 3c298f89-4303-0410-b956-a3cf2f4a3e73
2009-02-08 19:17:40 +00:00

63 lines
2.0 KiB
Diff

--- a/scripts/Makefile.lib
+++ b/scripts/Makefile.lib
@@ -166,4 +166,9 @@ cmd_objcopy = $(OBJCOPY) $(OBJCOPYFLAGS)
quiet_cmd_gzip = GZIP $@
cmd_gzip = gzip -f -9 < $< > $@
-
+# LZMA
+#
+quiet_cmd_lzma = LZMA $@
+cmd_lzma = bash -e scripts/lzma_kern $< $@ -lc7 -lp0 -pb0
+# to use lzmacomp,
+# cmd_lzma = lzmacomp $< 700 > $@
--- /dev/null
+++ b/scripts/lzma_kern
@@ -0,0 +1,4 @@
+get-size() { echo "$5" ;}
+printf -v len '%.8x' "$(get-size $(ls -l "$1"))"
+lzma e "$@"
+echo -ne "\x$(echo $len | cut -c 7,8)\x$(echo $len | cut -c 5,6)\x$(echo $len | cut -c 3,4)\x$(echo $len | cut -c 1,2)" >> "$2"
--- a/arch/x86/boot/compressed/Makefile_32
+++ b/arch/x86/boot/compressed/Makefile_32
@@ -4,8 +4,8 @@
# create a compressed vmlinux image from the original vmlinux
#
-targets := vmlinux vmlinux.bin vmlinux.bin.gz head_32.o misc_32.o piggy.o \
- vmlinux.bin.all vmlinux.relocs
+targets := vmlinux vmlinux.bin vmlinux.bin.lzma head_32.o piggy.o \
+ vmlinux.bin.all vmlinux.relocs lzma_misc.o
EXTRA_AFLAGS := -traditional
LDFLAGS_vmlinux := -T
@@ -17,7 +17,7 @@ KBUILD_CFLAGS := -m32 -D__KERNEL__ $(LI
$(call cc-option,-fno-stack-protector)
LDFLAGS := -m elf_i386
-$(obj)/vmlinux: $(src)/vmlinux_32.lds $(obj)/head_32.o $(obj)/misc_32.o $(obj)/piggy.o FORCE
+$(obj)/vmlinux: $(src)/vmlinux_32.lds $(obj)/head_32.o $(obj)/lzma_misc.o $(obj)/piggy.o FORCE
$(call if_changed,ld)
@:
@@ -37,14 +37,14 @@ $(obj)/vmlinux.bin.all: $(vmlinux.bin.al
$(call if_changed,relocbin)
ifdef CONFIG_RELOCATABLE
-$(obj)/vmlinux.bin.gz: $(obj)/vmlinux.bin.all FORCE
- $(call if_changed,gzip)
+$(obj)/vmlinux.bin.lzma: $(obj)/vmlinux.bin.all FORCE
+ $(call if_changed,lzma)
else
-$(obj)/vmlinux.bin.gz: $(obj)/vmlinux.bin FORCE
- $(call if_changed,gzip)
+$(obj)/vmlinux.bin.lzma: $(obj)/vmlinux.bin FORCE
+ $(call if_changed,lzma)
endif
LDFLAGS_piggy.o := -r --format binary --oformat elf32-i386 -T
-$(obj)/piggy.o: $(src)/vmlinux_32.scr $(obj)/vmlinux.bin.gz FORCE
+$(obj)/piggy.o: $(src)/vmlinux_32.scr $(obj)/vmlinux.bin.lzma FORCE
$(call if_changed,ld)