summaryrefslogtreecommitdiffstats
path: root/rescue/tree
diff options
context:
space:
mode:
authorFrancois Pons <fpons@mandriva.com>2001-04-06 13:30:26 +0000
committerFrancois Pons <fpons@mandriva.com>2001-04-06 13:30:26 +0000
commit83bf79a35ba95870f3ed2bfd2b32c1f15f157867 (patch)
tree51abb81e06cf1281b8f7be0cc39dca9d46e8e4d3 /rescue/tree
parent9a097e4618b7bc3cf644f431ed9e99441a83ff2f (diff)
downloaddrakx-83bf79a35ba95870f3ed2bfd2b32c1f15f157867.tar
drakx-83bf79a35ba95870f3ed2bfd2b32c1f15f157867.tar.gz
drakx-83bf79a35ba95870f3ed2bfd2b32c1f15f157867.tar.bz2
drakx-83bf79a35ba95870f3ed2bfd2b32c1f15f157867.tar.xz
drakx-83bf79a35ba95870f3ed2bfd2b32c1f15f157867.zip
fixed if label does not exists and grub refuse to read.
Diffstat (limited to 'rescue/tree')
-rwxr-xr-xrescue/tree/etc/oem23
1 files changed, 14 insertions, 9 deletions
diff --git a/rescue/tree/etc/oem b/rescue/tree/etc/oem
index 1c2b5f5c3..3c397731a 100755
--- a/rescue/tree/etc/oem
+++ b/rescue/tree/etc/oem
@@ -55,16 +55,21 @@ print "Found lang $lang\n";
#- other combination are really dangerous and are not supported, ask
#- the user that all data on the disk will be erased and go on.
my ($hd_size, @hd_parts);
-open F, "parted /dev/$hd print |";
-while (<F>) {
- /^Disk geometry [^:]*:\s*([\d\.]+)-([\d\.]+)/ and do { $hd_size = $2 - $1 };
- #/^Disk label type:\s*msdos/ and do { $hd_type = 'msdos' };
- /^(\d+)\s+([\d\.]+)\s+([\d\.]+)\s+(primary|logical|extended)\s*(\S*)/ and do {
- #- this automatically drops extended partition here!
- push @hd_parts, { minor => $1, start => $2, end => $3, type => $4, fstype => $5 };
- };
+for (1..2) {
+ open F, "parted /dev/$hd print |";
+ while (<F>) {
+ /^Disk geometry [^:]*:\s*([\d\.]+)-([\d\.]+)/ and do { $hd_size = $2 - $1 };
+ #/^Disk label type:\s*msdos/ and do { $hd_type = 'msdos' };
+ /^(\d+)\s+([\d\.]+)\s+([\d\.]+)\s+(primary|logical|extended)\s*(\S*)/ and do {
+ #- this automatically drops extended partition here!
+ push @hd_parts, { minor => $1, start => $2, end => $3, type => $4, fstype => $5 };
+ };
+ }
+ close F;
+ $hd_size and last;
+ print "Unable to detect partition on disk, trying with new label\n";
+ system "parted", "/dev/$hd", "mklabel", "msdos";
}
-close F;
my ($min_size, $def_size, $trigger_size, $inst_size, $swap_size) = (1700, 2700, 4000, 200, 128);
$hd_size > $min_size or die "hard disk is too small to contain oem install (${hd_size}MB found, need $min_size at least)";