aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/boot/wrapper
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc/boot/wrapper')
-rwxr-xr-xarch/powerpc/boot/wrapper28
1 files changed, 13 insertions, 15 deletions
diff --git a/arch/powerpc/boot/wrapper b/arch/powerpc/boot/wrapper
index 5cedd901201f..1ea208096b15 100755
--- a/arch/powerpc/boot/wrapper
+++ b/arch/powerpc/boot/wrapper
@@ -163,20 +163,19 @@ fi
163 163
164vmz="$vmz$gzip" 164vmz="$vmz$gzip"
165 165
166case "$platform" in 166# Extract kernel version information, some platforms want to include
167uboot|cuboot*) 167# it in the image header
168 version=`${CROSS}strings "$kernel" | grep '^Linux version [-0-9.]' | \ 168version=`${CROSS}strings "$kernel" | grep '^Linux version [-0-9.]' | \
169 cut -d' ' -f3` 169 cut -d' ' -f3`
170 if [ -n "$version" ]; then 170if [ -n "$version" ]; then
171 version="-n Linux-$version" 171 uboot_version="-n Linux-$version"
172 fi 172fi
173esac
174 173
175case "$platform" in 174case "$platform" in
176uboot) 175uboot)
177 rm -f "$ofile" 176 rm -f "$ofile"
178 mkimage -A ppc -O linux -T kernel -C gzip -a 00000000 -e 00000000 \ 177 mkimage -A ppc -O linux -T kernel -C gzip -a 00000000 -e 00000000 \
179 $version -d "$vmz" "$ofile" 178 $uboot_version -d "$vmz" "$ofile"
180 if [ -z "$cacheit" ]; then 179 if [ -z "$cacheit" ]; then
181 rm -f "$vmz" 180 rm -f "$vmz"
182 fi 181 fi
@@ -212,25 +211,24 @@ if [ "$platform" != "miboot" ]; then
212 rm $tmp 211 rm $tmp
213fi 212fi
214 213
214# Some platforms need the zImage's entry point and base address
215base=0x`${CROSS}nm "$ofile" | grep ' _start$' | cut -d' ' -f1`
216entry=`${CROSS}objdump -f "$ofile" | grep '^start address ' | cut -d' ' -f3`
217
215# post-processing needed for some platforms 218# post-processing needed for some platforms
216case "$platform" in 219case "$platform" in
217pseries|chrp) 220pseries|chrp)
218 $object/addnote "$ofile" 221 $object/addnote "$ofile"
219 ;; 222 ;;
220pmaccoff) 223pmaccoff)
221 entry=`objdump -f "$ofile" | grep '^start address ' | \
222 cut -d' ' -f3`
223 ${CROSS}objcopy -O aixcoff-rs6000 --set-start "$entry" "$ofile" 224 ${CROSS}objcopy -O aixcoff-rs6000 --set-start "$entry" "$ofile"
224 $object/hack-coff "$ofile" 225 $object/hack-coff "$ofile"
225 ;; 226 ;;
226cuboot*) 227cuboot*)
227 base=`${CROSS}nm "$ofile" | grep ' _start$' | cut -d' ' -f1`
228 entry=`${CROSS}objdump -f "$ofile" | grep '^start address ' | \
229 cut -d' ' -f3`
230 mv "$ofile" "$ofile".elf 228 mv "$ofile" "$ofile".elf
231 ${CROSS}objcopy -O binary "$ofile".elf "$ofile".bin 229 ${CROSS}objcopy -O binary "$ofile".elf "$ofile".bin
232 gzip -f -9 "$ofile".bin 230 gzip -f -9 "$ofile".bin
233 mkimage -A ppc -O linux -T kernel -C gzip -a "$base" -e "$entry" \ 231 mkimage -A ppc -O linux -T kernel -C gzip -a "$base" -e "$entry" \
234 $version -d "$ofile".bin.gz "$ofile" 232 $uboot_version -d "$ofile".bin.gz "$ofile"
235 ;; 233 ;;
236esac 234esac