From 44a5828e827ca42cee1ec415b0c8229fe4ba78bb Mon Sep 17 00:00:00 2001 From: freesource Date: Mon, 26 Nov 2001 06:22:44 +0000 Subject: [PATCH] This solves the problem of extra devices in boot_device_table.txt --- gbootroot | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/gbootroot b/gbootroot index 3ef1f49..7f2faa2 100755 --- a/gbootroot +++ b/gbootroot @@ -2772,7 +2772,10 @@ sub lilo_put_it_together { # Keep a record of the devices required @devices = qw(/dev/null /dev/fd0 /dev/fd1 /dev/hda1); for ( split(" ", $container[BOOT_DEVICE] ) ) { - push(@devices, $_ ) if $_; + my @existing_device_test = grep ( /$_/, @devices ); + if ( !@existing_device_test ) { + push(@devices, $_ ) if $_; + } } # This adds that next device if found in lilo.conf @@ -2780,7 +2783,7 @@ sub lilo_put_it_together { if ( $norm_root_device ) { my @existing_device_test = grep ( /\/dev\/$norm_root_device/, @devices ); - if ( @existing_device_test ) { + if ( !@existing_device_test ) { push( @devices, "/dev/$norm_root_device" ); } } @@ -2788,10 +2791,15 @@ sub lilo_put_it_together { # For frame buffer devices and the like. if ( $entry_advanced[1] ) { for ( split(" ", $entry_advanced[1] ) ) { - push(@devices, $_ ) if $_; + my @existing_device_test = grep ( /$_/, @devices ); + if ( !@existing_device_test ) { + push(@devices, $_ ) if $_; + } } } + info(0,"DEVICES @devices\n"); + device_table( @devices ); close(BootRoot::Yard::DEVICE_TABLE); @@ -2818,6 +2826,7 @@ sub lilo_put_it_together { return if errcp(sys("cp -a $entry_advanced[1] $mnt/dev")) == 2; } + } # end DEVICES SECTION info(0, "Copy over important lilo stuff\n");