# set up lilo -*-perl-*- $liloconf = ""; $append_text = ""; sub install_lilo { local ( $boot ); if (! -e "$fsmount/vmlinuz") { &rhs_msgbox("Error", < No kernel is installed! > LILO can not be configured without a kernel. > EOM , 60); return 0; } if (! &rhs_yesno("LILO", < LILO is a Boot Manager which allows you to start Red Hat Commercial Linux directly from your hard drive. It will also let you boot other operating systems on other partitions. > If you do not install LILO, you will have to use your boot diskette or some other boot loader to start the Network Desktop. > Do you want to install LILO? > EOM , 60)) { return 1; } $_ = $root_dev; if (/\/dev\/hd.*/) { $p1 = "/dev/hda"; $p2 = "/dev/sda"; $t1 = "IDE"; $t2 = "SCSI"; } else { $p2 = "/dev/hda"; $p1 = "/dev/sda"; $t2 = "IDE"; $t1 = "SCSI"; } if (! &rhs_menu("LILO Installation", < Where do you want to install LILO? > EOM , 70, 5, $p1, "On the MBR of $p1. (The first $t1 hard disk)", $p2, "On the MBR of $p2. (The first $t2 hard disk)", "/dev/fd0", "On a floppy in /dev/fd0. (Drive A:)", $root_dev, "On the superblock of your root Linux partition", "other", "On some other partition")) { return 1; } $boot = $dialog_result; if ($boot eq "other") { if (! &rhs_inputbox("LILO Installation", < Where do you want to put LILO? > EOM , 50, "/dev/")) { return 1; } $boot = $dialog_result; } $liloconf = <$fsmount/etc/lilo.conf"); print FD $liloconf; close(FD); if (! $express_install) { &rhs_textbox("Review /etc/lilo.conf", "$fsmount/etc/lilo.conf", 78, 22); if (! &rhs_yesno("Notice", < If you think that the lilo.conf file you just reviewed is incorrect, cancel the LILO configuration, start a shell, fix $fsmount/etc/lilo.conf, and run lilo -r $fsmount. > Continue with LILO configuration? > EOM , 60)) { return 0; } } &rhs_infobox("LILO", < Installing LILO... > EOM , 50); if (&invoke("lilo -r $fsmount")) { &rhs_msgbox("Error", < Something went wrong running LILO. Try configuring LILO again. > EOM , 60); return 0; } else { return 1; } } sub do_append_stuff { if (&rhs_yesno("LILO Configuration", < If you needed to specify hardware parameters on the LILO command line to boot the install disk, you will need to add some information to your lilo configuration. > Do you need to specify hardware parameters? > EOM , 60)) { if (&rhs_inputbox("LILO Configuration", < Enter the parameter below (ex: hd=64,32,202). This will be added as an append line to your LILO configuration. > EOM , 70, $append_text)) { $append_text = $dialog_result; } } $liloconf .= < Do you want to indicate another operating system as an option for LILO to start? > EOM , 60)) { if (! &rhs_menu("LILO Configuration", < Which operating system do you wish to add? > EOM , 60, 4, "Linux", "Another Linux partition", "DOS", "A DOS partition", "OS/2", "An OS/2 partition", "Other", "An operating system not listed here")) { next; } if ($dialog_result eq "Linux") { %tmpparlist = (); open(SAVEERR, ">&STDERR"); open(STDERR, ">/dev/null"); open(PROC, "fdisk -l |"); while () { if (/^(.{10}).{5}(.{31}).*Linux native$/) { $p = $1; $r = $2; $p =~ s/\s$//; $tmpparlist{$p} = "$r"; } } close PROC; open(STDERR, ">&SAVEERR"); if (! &rhs_menua("LILO Configuration", < Which Linux partition? > > Device Begin Start End Blocks EOM , 54, %tmpparlist)) { next; } $dev = $dialog_result; $label = &lilo_getlabel; next if ($label eq ""); $liloconf .= <&STDERR"); open(STDERR, ">/dev/null"); open(PROC, "fdisk -l |"); while () { if (/^(.{20}).{5}(.{31}).*DOS.*$/) { $p = $1; $r = $2; $p =~ s/\s$//; $tmpparlist{$p} = "$r"; } } close PROC; open(STDERR, ">&SAVEERR"); if (! &rhs_menua("LILO Configuration", < Which DOS partition? > > Device Begin Start End Blocks EOM , 54, %tmpparlist)) { next; } $dev = $dialog_result; $label = &lilo_getlabel; next if ($label eq ""); $table = substr($dev, 0, 8); $liloconf .= <&STDERR"); open(STDERR, ">/dev/null"); open(PROC, "fdisk -l |"); while () { if (/^(.{10}).{5}(.{31}).*DOS.*$/) { $p = $1; $r = $2; $p =~ s/\s$//; $tmpparlist{$p} = "$r"; } if (/^(.{10}).{5}(.{31}).*HPFS.*$/) { $p = $1; $r = $2; $p =~ s/\s$//; $tmpparlist{$p} = "$r"; } } close PROC; open(STDERR, ">&SAVEERR"); if (! &rhs_menua("LILO Configuration", < Which OS/2 partition? > > Device Begin Start End Blocks EOM , 54, %tmpparlist)) { next; } $dev = $dialog_result; $label = &lilo_getlabel; next if ($label eq ""); $table = substr($dev, 0, 8); $liloconf .= <&STDERR"); open(STDERR, ">/dev/null"); open(PROC, "fdisk -l |"); while () { if (/^(\/dev\/.{5}).{5}(.{31}).*$/) { $p = $1; $r = $2; $p =~ s/\s$//; $tmpparlist{$p} = "$p"; } } close PROC; open(STDERR, ">&SAVEERR"); if (! &rhs_menua("LILO Configuration", < Which is your main Linux parition? > > Device Begin Start End Blocks EOM , 54, %tmpparlist)) { next; } $dev = $dialog_result; $label = &lilo_getlabel; next if ($label eq ""); $table = substr($dev, 0, 8); $liloconf .= < Enter a single word as a name for this system. A LILO: prompt appears when you start your computer; this is the name that you will type to start this operating system. > EOM , 60, "")) { return ""; } return $dialog_result; } ########################## 1;