3
# post-boot-mipsel - (C) 2002 by Karsten Merker <merker@debian.org>
5
# Do post-image-building tasks for mipsel, to make CDs bootable.
6
# requires mkdecbootcd >= 0.2
8
# You may copy, modify and distribute this under the terms of the GNU
9
# General Public License as published by the Free Software Foundation;
10
# either version 2 of the License, or (at your option) any later version.
12
# Using this script on any architecture other than mipsel requires
13
# having binutils-multiarch installed, as it uses objdump (a part
14
# of binutils) which is platform dependent. The binutils-multiarch
15
# package contains an objdump which is capable of dealing with other
16
# arches' binary formats.
19
# $2 is the temporary CD build dir
20
# $3 is the image file
28
echo "post-boot-mipsel called"
29
echo "pwd=${PWD}, N=$N, CDROOT=${CDROOT}, CDIMAGE=${CDIMAGE}"
32
# Strip NONUS part of disk number
33
# NN will be 1...N so it can be used as an index
35
NN=`echo $N | sed -e 's/_NONUS//'`
39
# Only disks 1 and 2 bootable
40
if [ $NN != 1 -a $NN != 2 ]; then
53
LINE=$(isoinfo -i ${CDIMAGE} -lR |grep tftpimage-${KTYPE[$NN]}.raw)
54
CDSTARTEXTEND=$(echo $LINE | cut -d "[" -f 2 | cut -d "]" -f 1 | awk '{print $1}')
55
CDNUMBLOCKS=$((($(echo $LINE |tr -s " "| cut -f 5 -d " ") + 2047)/2048))
56
KERNEL_ENTRY=$(objdump -f CD1/dists/$CODENAME/main/disks-$ARCH/current/tftpimage-${KTYPE[$NN]} | grep "start address" | cut -f 3 -d " ")
58
# echo "CDSTARTEXTEND=${CDSTARTEXTEND}"
59
# echo "CDNUMBLOCKS=${CDNUMBLOCKS}"
60
# echo "KERNEL_ENTRY=${KERNEL_ENTRY}"
61
mkdecbootcd -m ${CDSTARTEXTEND} ${CDNUMBLOCKS} ${CDIMAGE} ${KERNEL_ENTRY}