diff options
Diffstat (limited to 'arch/powerpc/boot/wrapper')
-rwxr-xr-x | arch/powerpc/boot/wrapper | 36 |
1 files changed, 21 insertions, 15 deletions
diff --git a/arch/powerpc/boot/wrapper b/arch/powerpc/boot/wrapper index 5cedd901201f..2ed8b8b3f0ec 100755 --- a/arch/powerpc/boot/wrapper +++ b/arch/powerpc/boot/wrapper | |||
@@ -163,20 +163,19 @@ fi | |||
163 | 163 | ||
164 | vmz="$vmz$gzip" | 164 | vmz="$vmz$gzip" |
165 | 165 | ||
166 | case "$platform" in | 166 | # Extract kernel version information, some platforms want to include |
167 | uboot|cuboot*) | 167 | # it in the image header |
168 | version=`${CROSS}strings "$kernel" | grep '^Linux version [-0-9.]' | \ | 168 | version=`${CROSS}strings "$kernel" | grep '^Linux version [-0-9.]' | \ |
169 | cut -d' ' -f3` | 169 | cut -d' ' -f3` |
170 | if [ -n "$version" ]; then | 170 | if [ -n "$version" ]; then |
171 | version="-n Linux-$version" | 171 | uboot_version="-n Linux-$version" |
172 | fi | 172 | fi |
173 | esac | ||
174 | 173 | ||
175 | case "$platform" in | 174 | case "$platform" in |
176 | uboot) | 175 | uboot) |
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,32 @@ if [ "$platform" != "miboot" ]; then | |||
212 | rm $tmp | 211 | rm $tmp |
213 | fi | 212 | fi |
214 | 213 | ||
214 | # Some platforms need the zImage's entry point and base address | ||
215 | base=0x`${CROSS}nm "$ofile" | grep ' _start$' | cut -d' ' -f1` | ||
216 | entry=`${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 |
216 | case "$platform" in | 219 | case "$platform" in |
217 | pseries|chrp) | 220 | pseries|chrp) |
218 | $object/addnote "$ofile" | 221 | $object/addnote "$ofile" |
219 | ;; | 222 | ;; |
220 | pmaccoff) | 223 | pmaccoff) |
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 | ;; |
226 | cuboot*) | 227 | cuboot*) |
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" |
233 | ;; | ||
234 | treeboot*) | ||
235 | mv "$ofile" "$ofile.elf" | ||
236 | $object/mktree "$ofile.elf" "$ofile" "$base" "$entry" | ||
237 | if [ -z "$cacheit" ]; then | ||
238 | rm -f "$ofile.elf" | ||
239 | fi | ||
240 | exit 0 | ||
235 | ;; | 241 | ;; |
236 | esac | 242 | esac |