summaryrefslogtreecommitdiff
path: root/packages/linux/linux-2.6.28/stb225/uImage.patch
blob: f43a221e62fe62f0b20243e66809cb659915b84d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
diff -urN linux-2.6.28.orig/arch/mips/Makefile linux-2.6.28/arch/mips/Makefile
--- linux-2.6.28.orig/arch/mips/Makefile	2009-01-28 16:12:23.000000000 +0200
+++ linux-2.6.28/arch/mips/Makefile	2009-01-28 16:13:54.000000000 +0200
@@ -682,6 +682,19 @@
 
 all:	$(all-y)
 
+# Support for U-Boot image creation (from U-Boot README)
+uImage: vmlinux
+	$(OBJCOPY) -O binary -R .note -R .comment -S vmlinux vmlinux.bin
+	rm -f vmlinux.bin.gz
+	gzip -9 vmlinux.bin
+	LA=`$(OBJDUMP) -p vmlinux | sed -n 's/LOAD.*vaddr \([^ ]*\).*/\1/p'`; \
+	EN=`$(OBJDUMP) -f vmlinux | sed -n 's/.*start address \([^ ]*\).*/\1/p'`; \
+	echo $$LA; \
+	echo $$EN; \
+	mkimage -A mips -O linux -T kernel -C gzip \
+		-a $$LA -e $$EN -n "Linux Kernel Image" \
+		-d vmlinux.bin.gz uImage
+
 vmlinux.bin: $(vmlinux-32)
 	+@$(call makeboot,$@)