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

Boot floppy for powerpc



I put together a script that patches the powerpc installer floppy image to 
create a new floppy image which will boot an installed system. (Or just 
add the boot arguments you want).

Here it is. Is it worthwhile to try to work this into the 'Make a Boot 
Floppy' menu (after woody's release), or should we just fuggedaboudit?


   *** patch-floppy-image ***

#!/usr/bin/perl -w

# patches powerpc hfs-boot-floppy.img with desired boot arguments

# for example, to create a boot floppy for a /dev/hda8 root: 
# ./patch-floppy-image 'root=/dev/hda8' hfs-boot-floppy.img > hfs-boot-hda8.img

# We have 98 characters to work with in the floppy's System CMDL resource
# (Always maintain the right number of bytes in the floppy image)

my $absolute_max_length = 98;

# $current must be the same as what is currently inside
# boot-floppies/powerpc-specials/miBoot/System.bin.

my $current = "root=0200 load_ramdisk=1 prompt_ramdisk=1 adb_buttons=103,111 video=ofonly                        ";

# I think it's a good idea to maintain "adb_buttons=103,111 video=ofonly "

my $maintain = "adb_buttons=103,111 video=ofonly ";
my $pad_len = $absolute_max_length - length( $maintain );

my $new_arguments = shift;
if ( length( $new_arguments ) > $pad_len ) { 
    die "arguments longer than $pad_len characters; aborting" 
}
$new_arguments = pack( "A$pad_len" , $new_arguments );

my $subst = $maintain . $new_arguments;

while (<>) { s|$current|$subst|; print }


-- 
*------v--------- Installing Debian GNU/Linux 3.0 --------v------*
|      <http://www.debian.org/releases/woody/installmanual>      |
|   debian-imac (potato): <http://debian-imac.sourceforge.net>   |
|            Chris Tillman        tillman@voicetrak.com          |
|                   May the Source be with you                   |
*----------------------------------------------------------------*


-- 
To UNSUBSCRIBE, email to debian-boot-request@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org



Reply to: