wrapper (10ce3cc919f50c2043b41ca968b43c26a3672600) | wrapper (dfbc2d75c1bd47c3186fa91f1655ea2f3825b0ec) |
---|---|
1#!/bin/sh 2 3# Copyright (C) 2006 Paul Mackerras, IBM Corporation <paulus@samba.org> 4# This program may be used under the terms of version 2 of the GNU 5# General Public License. 6 7# This script takes a kernel binary and optionally an initrd image 8# and/or a device-tree blob, and creates a bootable zImage for a --- 130 unchanged lines hidden (view full) --- 139platformo=$object/"$platform".o 140lds=$object/zImage.lds 141ext=strip 142objflags=-S 143tmp=$tmpdir/zImage.$$.o 144ksection=.kernel:vmlinux.strip 145isection=.kernel:initrd 146link_address='0x400000' | 1#!/bin/sh 2 3# Copyright (C) 2006 Paul Mackerras, IBM Corporation <paulus@samba.org> 4# This program may be used under the terms of version 2 of the GNU 5# General Public License. 6 7# This script takes a kernel binary and optionally an initrd image 8# and/or a device-tree blob, and creates a bootable zImage for a --- 130 unchanged lines hidden (view full) --- 139platformo=$object/"$platform".o 140lds=$object/zImage.lds 141ext=strip 142objflags=-S 143tmp=$tmpdir/zImage.$$.o 144ksection=.kernel:vmlinux.strip 145isection=.kernel:initrd 146link_address='0x400000' |
147make_space=y |
|
147 148case "$platform" in 149pseries) 150 platformo=$object/of.o 151 link_address='0x4000000' 152 ;; 153maple) 154 platformo=$object/of.o --- 50 unchanged lines hidden (view full) --- 205 platformo="$object/ps3-head.o $object/ps3-hvcall.o $object/ps3.o" 206 lds=$object/zImage.ps3.lds 207 gzip= 208 ext=bin 209 objflags="-O binary --set-section-flags=.bss=contents,alloc,load,data" 210 ksection=.kernel:vmlinux.bin 211 isection=.kernel:initrd 212 link_address='' | 148 149case "$platform" in 150pseries) 151 platformo=$object/of.o 152 link_address='0x4000000' 153 ;; 154maple) 155 platformo=$object/of.o --- 50 unchanged lines hidden (view full) --- 206 platformo="$object/ps3-head.o $object/ps3-hvcall.o $object/ps3.o" 207 lds=$object/zImage.ps3.lds 208 gzip= 209 ext=bin 210 objflags="-O binary --set-section-flags=.bss=contents,alloc,load,data" 211 ksection=.kernel:vmlinux.bin 212 isection=.kernel:initrd 213 link_address='' |
214 make_space=n |
|
213 pie= 214 ;; 215ep88xc|ep405|ep8248e) 216 platformo="$object/fixed-head.o $object/$platform.o" 217 binary=y 218 ;; 219adder875-redboot) 220 platformo="$object/fixed-head.o $object/redboot-8xx.o" --- 52 unchanged lines hidden (view full) --- 273 fi 274else 275 # Calculate the vmlinux.strip size 276 ${CROSS}objcopy $objflags "$kernel" "$vmz.$$" 277 strip_size=$(stat -c %s $vmz.$$) 278 rm -f $vmz.$$ 279fi 280 | 215 pie= 216 ;; 217ep88xc|ep405|ep8248e) 218 platformo="$object/fixed-head.o $object/$platform.o" 219 binary=y 220 ;; 221adder875-redboot) 222 platformo="$object/fixed-head.o $object/redboot-8xx.o" --- 52 unchanged lines hidden (view full) --- 275 fi 276else 277 # Calculate the vmlinux.strip size 278 ${CROSS}objcopy $objflags "$kernel" "$vmz.$$" 279 strip_size=$(stat -c %s $vmz.$$) 280 rm -f $vmz.$$ 281fi 282 |
281# Round the size to next higher MB limit 282round_size=$(((strip_size + 0xfffff) & 0xfff00000)) | 283if [ "$make_space" = "y" ]; then 284 # Round the size to next higher MB limit 285 round_size=$(((strip_size + 0xfffff) & 0xfff00000)) |
283 | 286 |
284round_size=0x$(printf "%x" $round_size) 285link_addr=$(printf "%d" $link_address) | 287 round_size=0x$(printf "%x" $round_size) 288 link_addr=$(printf "%d" $link_address) |
286 | 289 |
287if [ $link_addr -lt $strip_size ]; then 288 echo "INFO: Uncompressed kernel (size 0x$(printf "%x\n" $strip_size))" \ 289 "overlaps the address of the wrapper($link_address)" 290 echo "INFO: Fixing the link_address of wrapper to ($round_size)" 291 link_address=$round_size | 290 if [ $link_addr -lt $strip_size ]; then 291 echo "INFO: Uncompressed kernel (size 0x$(printf "%x\n" $strip_size))" \ 292 "overlaps the address of the wrapper($link_address)" 293 echo "INFO: Fixing the link_address of wrapper to ($round_size)" 294 link_address=$round_size 295 fi |
292fi 293 294vmz="$vmz$gzip" 295 296# Extract kernel version information, some platforms want to include 297# it in the image header 298version=`${CROSS}strings "$kernel" | grep '^Linux version [-0-9.]' | \ 299 cut -d' ' -f3` --- 139 unchanged lines hidden --- | 296fi 297 298vmz="$vmz$gzip" 299 300# Extract kernel version information, some platforms want to include 301# it in the image header 302version=`${CROSS}strings "$kernel" | grep '^Linux version [-0-9.]' | \ 303 cut -d' ' -f3` --- 139 unchanged lines hidden --- |