Browse Source

Default hard drive for normalboot now taken from lilo.conf

master
freesource 25 years ago
parent
commit
f3aa211fc8
  1. 42
      gBootRoot

42
gBootRoot

@ -34,6 +34,7 @@ init Gtk;
# If you want gBootRoot to do it's stuff somewhere else, change the # If you want gBootRoot to do it's stuff somewhere else, change the
# value for $tmp1. # value for $tmp1.
my $tmp1 = "/tmp"; # tmp should be default - Cristian my $tmp1 = "/tmp"; # tmp should be default - Cristian
my $lilo_conf = "/etc/lilo.conf";
# CHANGES # CHANGES
# 1.0.3 - 08.09.2000 # 1.0.3 - 08.09.2000
@ -86,6 +87,7 @@ my $error_window;
my ($kernel,$root_image,$device,$size); my ($kernel,$root_image,$device,$size);
my $mtab; my $mtab;
my ($tmp,$mnt); my ($tmp,$mnt);
my $norm_root_device;
# My own creation - the roots touch the ground if three lines are added. # My own creation - the roots touch the ground if three lines are added.
my @xpm_data = ( my @xpm_data = (
@ -341,6 +343,30 @@ sub signal {
Gtk->exit(0); Gtk->exit(0);
} }
# Cristian's idea - bug 111579 enh for brlilo
sub norm_root_device {
my $norm_root_dev = "hda1";
if (!-d $lilo_conf) {
if (-e $lilo_conf) {
open(LIL, $lilo_conf);
while (<LIL>) {
chomp;
if ( m< ^\s*[^#]+\s*root\s*=\s*/dev/([\w\d]+)\s*.*$
| ^\s*[^#]+\s*default\s*=\s*/dev/([\w\d]+)\s*.*$ >x ) {
($1) ? ($norm_root_dev = $1) : ($norm_root_dev = $2);
last;
}
}
}
}
return $norm_root_dev;
}
sub create_text { sub create_text {
if (not defined $text_window) { if (not defined $text_window) {
@ -837,12 +863,20 @@ sub lilo_put_it_together {
#V#print "Making stuff for lilo\n"; #V#print "Making stuff for lilo\n";
return if err(system "mkdir $mnt/{boot,dev} >> $tmp/verbose 2>&1; cp -a /dev/{null,fd?,hda1} $mnt/dev >> $tmp/verbose 2>&1") == 2; return if err(system "mkdir $mnt/{boot,dev} >> $tmp/verbose 2>&1; cp -a /dev/{null,fd?,hda1} $mnt/dev >> $tmp/verbose 2>&1") == 2;
# Hopefully, this works, but have never tested it # Hopefully, this works, but have never tested it
if ($device !~ m,/dev/fd\d{1}$,) { if ($device !~ m,/dev/fd\d{1}$,) {
return if err( return if err(
system "cp -a $device $mnt/dev >> $tmp/verbose 2>&1") == 2; system "cp -a $device $mnt/dev >> $tmp/verbose 2>&1") == 2;
} }
# This adds that next device
$norm_root_device = norm_root_device();
if (!-e "$mnt/dev/$norm_root_device") {
return if err(
system "cp -a /dev/$norm_root_device $mnt/dev >> $tmp/verbose 2>&1") == 2;
}
#pb($B,3); #pb($B,3);
#V#print "Copy over important lilo stuff\n"; #V#print "Copy over important lilo stuff\n";
return if return if
@ -853,6 +887,9 @@ sub lilo_put_it_together {
$remain_boot = $remain_boot - (stat("/boot/boot.b"))[12]/2 - 3; $remain_boot = $remain_boot - (stat("/boot/boot.b"))[12]/2 - 3;
$entry5->set_text("$remain_boot k"); $entry5->set_text("$remain_boot k");
#
# Write out the HEREDOCS # Write out the HEREDOCS
open(LC, ">$mnt/brlilo.conf") or die "Couldn't write $mnt/brlilo.conf\n"; open(LC, ">$mnt/brlilo.conf") or die "Couldn't write $mnt/brlilo.conf\n";
print LC brlilo($device); close(LC); print LC brlilo($device); close(LC);
@ -1285,7 +1322,7 @@ read-write
# normalboot # normalboot
image = kernel image = kernel
root = /dev/hda1 root = /dev/$norm_root_device
label = normalboot label = normalboot
read-only read-only
LILOCONF LILOCONF
@ -1309,8 +1346,7 @@ Press [Tab] to see a list of boot options.
bootdisk = This will boot a compressed root filesystem bootdisk = This will boot a compressed root filesystem
on another floppy. on another floppy.
normalboot = This will boot up a specified filesystem. normalboot = This will boot up a specified filesystem.
default: /dev/hda1 a = 1st drive default: /dev/$norm_root_device
1 = 1st partition
Use root=/dev/(h or s)dXX Use root=/dev/(h or s)dXX
h = IDE Drive h = IDE Drive
s = SCSI Drive s = SCSI Drive

Loading…
Cancel
Save