Hi,
I found that installing GnuHurd and configuring it with grub very painful.
After that I wrote a script to help people configure GRUB for gnu/Hurd
<See attached>
I hope it saves someone a lot of pain.
-=+Marcello Mathias Herreshoff
#!/usr/bin/perl
#
# Programmer:      Marcello Mathias Herreshoff
# Creation Date:  Sun Mar 23 19:00:53 PST 2003
# Last Modified:  Sun Mar 23 19:00:53 PST 2003
# Filename:       mkhurd_grub_conf.pl
# Syntax:         perl 5
# License:        GPL
#
# Description:    Ask for some info and spit out a piece of menu.lst for \
# booting GNU/Hurd
#

use strict;

my ($hd, $zi_hd, $sec, $zi_sec) = (0, 0, 0, 0);
#zi -> zero index
my $mach_location; #where is the .gz file
my $output;



#The actual program:
print "First let me ask you some questions about the disk HURD is on.\n";
print "Enter IDE(prim/sec):";
chomp($_ = <STDIN>);
if(/s/i){
   print "Secondary.\n";
   $zi_hd += 2;
}else{
   print "Primary.\n";
}
print "Enter IDE(master/slave):";
chomp($_ = <STDIN>);
unless(/m/i){
   print "Slave.\n";
   $zi_hd += 1;
}else{
   print "Master.\n";
}
$hd = $zi_hd+1;
#print "DEBUG hd = $hd\n";

print "Next let me ask you about the sector HURD is on.\n";
print "Do you like to count sectors starting at zero or one (0/1)?";
chomp($_ = <STDIN>);
if($_){ #one
   print "Starting from one, what sector is HURD on:";
   chomp($_ = <STDIN>);
   $sec = +$_; #Important we numify!
   print "Starting from one, sector $sec.\n";
   $zi_sec = $sec-1;
}else{ #zero
   print "Starting from zero, what sector is HURD on:";
   chomp($_ = <STDIN>);
   $zi_sec = +$_; #Important we numify!
   print "Starting from zero, sector $zi_sec.\n";
   $sec = $zi_sec+1;
}

print "Where is mach located on this disk [/boot/gnumach.gz]:";
chomp($_ = <STDIN>);
$mach_location = $_ || '/boot/gnumach.gz';

$output = <<EOT;
####################
#Automatically Generated by Hurd Grub configurator!
#
title GNU/Hurd
\troot (hd$zi_hd,$zi_sec)
\tkernel /boot/gnumach.gz root=device:hd${zi_hd}s$sec -s
\tmodule /hurd/ext2fs.static --multiboot-command-line=\${kernel-command-line} 
--host-priv-port=\${host-port} --device-master-port=\${device-port} 
--exec-server-task=\${exec-task} -T typed \${root} \$(task-create) \$(task-resume)
\tmodule /lib/ld.so.1 /hurd/exec \$(exec-task=task-create)
EOT

print "The output is:\n$output\n\n";
print "Would you like to append it to /boot/grub/menu.lst(y/n)?\n";
print "(Type n if you wish to save this elsewhere)\n>";
chomp($_ = <STDIN>);
if(/y/){
   open(GRUBCONF, ">> /boot/grub/menu.lst");
   print GRUBCONF $output;  
   close GRUBCONF;
   print "Reboot to use GNU/Hurd\nHappy Hacking!\n"
}else{
   print "Enter a place to save the configuration, or nothing to quit.\n";
   print "Note: Appends if file already existent.\n>";
   chomp($_ = <STDIN>);
   exit unless($_);
   open(OUT, ">>", $_);
   print "Data written to $_.\n";
}


_______________________________________________
Help-hurd mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/help-hurd

Reply via email to