diff options
Diffstat (limited to 'rescue/tree/etc')
-rwxr-xr-x | rescue/tree/etc/oem | 34 |
1 files changed, 26 insertions, 8 deletions
diff --git a/rescue/tree/etc/oem b/rescue/tree/etc/oem index fed8ec4c1..3e810e2a3 100755 --- a/rescue/tree/etc/oem +++ b/rescue/tree/etc/oem @@ -6,14 +6,6 @@ if ($ARGV[0] ne '-f') { } my ($yes, $hd, $cd); -do { - print " - -I'm going to install the OEM version on your hard drive -[1;31;40m!!ALL DATA WILL BE LOST!![0m - -Type \`\`yes'' and [enter] to go on\n" -} while (($yes = <STDIN>) !~ /^\s*yes\s*$/i); #- avoid globing as it is not available in rescue ramdisk. foreach my $device (split ' ', `/bin/ls -d /proc/ide/hd*`) { @@ -68,6 +60,14 @@ for (1..2) { close F; $hd_size and last; print "Unable to detect partition on disk, trying with new label\n"; + do { + print " + +I'm going to install the OEM version on your hard drive +[1;31;40m!!ALL DATA WILL BE LOST!![0m + +Type \`\`yes'' and [enter] to go on\n" + } while (($yes = <STDIN>) !~ /^\s*yes\s*$/i); system "parted", "/dev/$hd", "mklabel", "msdos"; } my ($min_size, $def_size, $trigger_size, $inst_size, $swap_size) = (2100, 2700, 4000, 200, 128); @@ -104,12 +104,30 @@ my $point = 0.0; open F, "| parted -s /dev/$hd"; if (defined $resize_fat_size) { + do { + print " + +[1;31;40m!!An existing Windows partition has been found and will be kept. +Additional Linux partition will be created!![0m + +Type \`\`yes'' and [enter] to go on\n" + } while (($yes = <STDIN>) !~ /^\s*yes\s*$/i); #- keep the current partition table, and try to resize the fat partition #- if the size is not 0. #- KEEP IN MIND there is only one partition defined. $point = $hd_parts[$fat_pos]{start} + $resize_fat_size; printf F "resize %d %s %s\n", $hd_parts[$fat_pos]{minor}, $hd_parts[$fat_pos]{start}, $point; } else { + unless (defined $yes) { + do { + print " + +I'm going to install the OEM version on your hard drive +[1;31;40m!!ALL DATA WILL BE LOST!![0m + +Type \`\`yes'' and [enter] to go on\n" + } while (($yes = <STDIN>) !~ /^\s*yes\s*$/i); + } #- build a new disk label here. print F "mklabel msdos\n"; } |