[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: bootable CDs for mipsel [was: Reading fibmap]



On Sun, Apr 28, 2002 at 12:17:32AM +0200, Florian Lohoff wrote:
> On Sat, Apr 27, 2002 at 02:44:13PM +0200, Karsten Merker wrote:
> > Problems:
> > - I used the "simple" method without second stage loader, so we can only
> >   boot one file per CD, meaning kernels for different systems have to
> >   be spread over different CDs, although I do not think this should
> >   be much of a problem - i386 handles different kernel versions similarly.
> 
> They will switch - The netinst cd already offers 3 or 4 different
> kernels. Teaching delo how to read an iso9660 shouldnt be too hard.
> While doing that i'll teach arcboot the same :) Sounds like a hacking
> session.

Well - for now there is still one kernel per CD in the current debian-cd.
The use of multiboot is an optional feature.

> >   the address of the kernel_entry label. Unfortunately the tftpimage 
> >   (which has to be in ECOFF on DECstations) is generated from an 
> >   intermediate ELF file by using elf2ecoff from the mips-tools package,
> >   which discards all symbol information. I could get the address
> >   either from the symbol table in System.map or from the intermediate
> >   ELF image, but current boot-floppies include neither of them, so this
> >   could be used only with future boot-floppies revisions, where I could
> >   include the needed information.

I have been digging on my harddisk and found the intermediate files
from building the bf-3.0.22 in the archive, so building bootable CDs
is also possible with current boot-floppies.

I have attached a /usr/share/debian-cd/tools/boot/woody/boot-mipsel
for building ISO-images that can be made bootable for mipsel. It
creates the needed raw files and stores them in 
$CDROOT/cdboot/tftpimage-<subarch>.raw, with subarch r3k-kn02 (the
most often used one) on the first CD and r4k-kn04 on the second.
Running this script requires objcopy (part of binutils), or, when
not running on mipsel, mipsel-linux-objcopy (objcopy ist platform
specific, so for creating a bootable mipsel CD on i386 you need
installed mipsel-cross-binutils).

When the images are created, they can be made bootable with the
mkdecbootcd tool - currently waiting for an entry in the override file,
but also available from 

http://people.debian.org/~merker/experimental_packages/mkdecbootcd-0.1/)

To make an image bootable, just loop-mount the image somewhere (e.g. /mnt)
and call "mkdecbootcd bootfile cdimage kernel_entry", with 

- bootfile: the file in the cdimage (e.g. /mnt/cdboot/tftpimage-r3k-kn02.raw)
- cdimage: the cdimage file itself
- kernel_entry: the value of the kernel_entry label, which is
  for r3k-kn02: 0x80040464
  for r4k-kn04: 0x8004046c

This replaces the first 512 bytes of the CD image with the particular
boot sector required to boot the tftpimage-<subarch>.raw file from CD.
I have tested this for r4k-kn04 (no r3k-kn02 system available for
testing currently) and it worked without problems.
So my question to the debian-cd folks: are you willing to integrate this
into debian-cd for woody?

Regards,
Karsten
-- 
#include <standard_disclaimer>
Nach Paragraph 28 Abs. 3 Bundesdatenschutzgesetz widerspreche ich der Nutzung
oder Uebermittlung meiner Daten fuer Werbezwecke oder fuer die Markt- oder
Meinungsforschung.
#!/bin/bash
#
# boot-mipsel
#
# $1 is the CD number
# $2 is the temporary CD build dir

N=$1
CDROOT=$2

# Strip NONUS part of disk number
# NN will be 1...N so it can be used as an index
#
NN=`echo $N | sed -e 's/_NONUS//'`

cd $CDROOT/..

:> $1.mkisofs_opts

KTYPE[1]="r3k-kn02"
KTYPE[2]="r4k-kn04"
KTYPE[3]=""
KTYPE[4]=""
KTYPE[5]=""
KTYPE[6]=""
KTYPE[7]=""
KTYPE[8]=""


# Only disks 1 and 2 bootable
if [ $NN != 1 -a $NN != 2 ]; then
	exit 0
fi

mkdir -p $CDROOT/cdboot

# If we are running natively, use objcopy, else use mipsel-linux-objcopy
# from the cross-binutils
HOSTARCH=`dpkg --print-installation-architecture`
if [ $HOSTARCH = "mipsel" ]; then
	OBJCOPY=objcopy
else
	OBJCOPY=mipsel-linux-objcopy
fi

$OBJCOPY -O binary CD1/dists/$CODENAME/main/disks-$ARCH/current/tftpimage-${KTYPE[$NN]} $CDROOT/cdboot/tftpimage-${KTYPE[$NN]}.raw

exit 0


Reply to: