Re: Booting remaster candidate.

Fabian Franz <[email protected]> Wed, 9 Jun 2004 23:32:43 +0200
Newsgroups gmane.linux.debian.knoppix
Message-ID <[email protected]>
Am Dienstag, 8. Juni 2004 16:57 schrieb Sebastian Rahtz:
> What I do is go through the remastering process, and create
> a final .iso image; then I reboot using the original Knoppix
> CD and enter eg
>
>    knoppix bootfrom=/dev/hda1/foo.iso
>
> at the prompt. This boots from the CD, but then switches to
> do everything else from the iso (wherever you put it).

Nice, someone is using it ;-).

>
> This does not test any changes to the boot itself, but you
> probably haven't made any. 

I also use for my developments an combination of bootfrom and grub + memdisk + 
boot.img.

I've attached a small script (to share some knowledge ;-) ), that makes it 
possible to create from an isolinux tree a boot.img, which is bigger than 
1.44 MB ...

You can then boot that one with memdisk and for example grub.

So I do:

mount -o loop KNOPPIX.iso /cdrom

sudo ./make_floppy_3.4.sh
sudo mv boot.img /

and I also have memdisk from /usr/lib/syslinux/memdisk in /.

And in my grub.conf I have:

kernel /memdisk
initrd /boot.img

Works quite well.

Also note that for testing changes to the boot you can use qemu.

qemu -cdrom test.iso

is everything you have to do.

Sadly at least in my version it crashes the kernel, when knoppix' init boots 
up.

But with another init (for example the original 2.84 from debian sarge) you 
can even completely boot and work with it. (I found this out during my 
research in the field of "knoppix from scratch")

Klaus, seems "init 2.78" has some problems still ... :-/

Hope that helps,

cu

Fabian
make_floppy_3.4.sh (application/x-shellscript, 1.3 KB)
# Make floppy from CD-ROM
# Run this on another system from a running knoppix-cd.
# 
# License: GPL
#
# Copyright (c) 2004 by Fabian Franz.

abort()
{
  echo "$@"
  exit 1
}

[ $UID -ne 0 ] && abort "Need root-rights."

# preparations
TMPDIR=/tmp/make_floppy.$$
mkdir $TMPDIR || abort "Fatal security error"

clean_exit()
{
  [ -d "$TMPDIR" ] && rm -rf $TMPDIR
}

trap "clean_exit" EXIT

ORIG_DIR=$(pwd)
cd $TMPDIR
mkdir floppy
mkdir miniroot
mkdir old_miniroot

#[ -r /cdrom/boot/isolinux/minirt24.gz ] || abort "CD-ROM in /cdrom/ needed."

#cp -f /cdrom/boot/isolinux/minirt24.gz .

# Now make the bootdisk

BACKUP=$(date +%s)
mv -f ~/.mtoolsrc ~/.mtoolsrc.$BACKUP
echo "drive x: file=\"$TMPDIR/boot.img\"" > ~/.mtoolsrc
mformat -C -t 160 -s 36 -h 2 x:
rm -f ~/.mtoolsrc
mv -f ~/.mtoolsrc.$BACKUP ~/.mtoolsrc

mount -o loop boot.img floppy

(cd /cdrom/boot/isolinux/; cp -f * $TMPDIR/floppy/)
mv floppy/isolinux.cfg floppy/syslinux.cfg
[ -n "$LANGUAGE" ] && perl -pi -e "s/lang=de/lang=$LANGUAGE/g" floppy/syslinux.cfg
[ -n "$LANGUAGE" ] && perl -pi -e "s/lang=us/lang=$LANGUAGE/g" floppy/syslinux.cfg
umount floppy
syslinux boot.img

cp -i boot.img $ORIG_DIR

echo "Die erzeugte Datei boot.img kann jetzt mittels des Befehls dd if=boot.img of=/dev/fd0 auf Diskette geschrieben werden."