Author: juhliarik Date: Fri Jun 6 17:08:15 2008 New Revision: 48119 URL: http://svn.opensuse.org/viewcvs/yast?rev=48119&view=rev Log: added "fix" for problem with broken Vista... bnc #396444 M bootloader/src/grub/misc.ycp * added propose install GRUB to MBR if Vista was found M bootloader/src/routines/lilolike.ycp * added propose insall LILO to MBR if Vista was found M bootloader/scripts/examine_mbr.pl * added detection for Vista's MBR Modified: branches/SuSE-Linux-11_0-Branch/bootloader/scripts/examine_mbr.pl branches/SuSE-Linux-11_0-Branch/bootloader/src/grub/misc.ycp branches/SuSE-Linux-11_0-Branch/bootloader/src/routines/lilolike.ycp Modified: branches/SuSE-Linux-11_0-Branch/bootloader/scripts/examine_mbr.pl URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Linux-11_0-Branch/bootloader/scripts/examine_mbr.pl?rev=48119&r1=48118&r2=48119&view=diff ============================================================================== --- branches/SuSE-Linux-11_0-Branch/bootloader/scripts/examine_mbr.pl (original) +++ branches/SuSE-Linux-11_0-Branch/bootloader/scripts/examine_mbr.pl Fri Jun 6 17:08:15 2008 @@ -63,6 +63,13 @@ exit 0; } +if (substr($MBR, 320, 126) =~ + m,invalid partition table.*Error loading operating system,i) { + print "Vista MBR\n"; + exit 200; +} + + print "unknown\n"; exit 0; Modified: branches/SuSE-Linux-11_0-Branch/bootloader/src/grub/misc.ycp URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Linux-11_0-Branch/bootloader/src/grub/misc.ycp?rev=48119&r1=48118&r2=48119&view=diff ============================================================================== --- branches/SuSE-Linux-11_0-Branch/bootloader/src/grub/misc.ycp (original) +++ branches/SuSE-Linux-11_0-Branch/bootloader/src/grub/misc.ycp Fri Jun 6 17:08:15 2008 @@ -559,6 +559,8 @@ boolean keep_mbr = BootCommon::KeepMBR (BootCommon::mbrDisk); // if is primary, store bootloader there + + integer exit = 0; if (boot_partition_is_on_mbr_disk && ! is_logical) { selected_location = `boot; @@ -575,8 +577,17 @@ map out = (map)SCR::Execute (.target.bash_output, sformat ( "/usr/lib/YaST2/bin/examine_mbr.pl %1", boot_partition_disk)); y2milestone ("MBR examining script returned %1", out); - integer exit = out["exit"]:0; - BootCommon::globals["generic_mbr"] = ((exit == 254) && (! keep_mbr)) ? "true" : "false"; + exit = out["exit"]:0; + // hack for vista - instal GRUB to MBR + if (exit != 200) + { + BootCommon::globals["generic_mbr"] = ((exit == 254) && (! keep_mbr)) ? "true" : "false"; + } else { + y2milestone("Detected Vista MBR"); + BootCommon::globals["generic_mbr"] = "false"; + selected_location = `mbr; + } + } else if (size (underlying_boot_partition_devices) > 1) { @@ -619,8 +630,12 @@ // partition can remain activated, which causes less problems with // other installed OSes like Windows (older versions assign the C: // drive letter to the activated partition). - BootCommon::globals["activate"] = - (size (Storage::GetBootPartition (BootCommon::mbrDisk)) == 0) ? "true" : "false"; + // hack for vista - doesn't activate just install GRUB to MBR + if (exit != 200) + BootCommon::globals["activate"] = + (size (Storage::GetBootPartition (BootCommon::mbrDisk)) == 0) ? "true" : "false"; + else + y2milestone("Detected Vista MBR don't activate"); } else { Modified: branches/SuSE-Linux-11_0-Branch/bootloader/src/routines/lilolike.ycp URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Linux-11_0-Branch/bootloader/src/routines/lilolike.ycp?rev=48119&r1=48118&r2=48119&view=diff ============================================================================== --- branches/SuSE-Linux-11_0-Branch/bootloader/src/routines/lilolike.ycp (original) +++ branches/SuSE-Linux-11_0-Branch/bootloader/src/routines/lilolike.ycp Fri Jun 6 17:08:15 2008 @@ -204,6 +204,7 @@ // is recognized) boolean keep_mbr = KeepMBR (loader_device); + integer exit = 0; // if is primary, store bootloader there if (disk_is_mbr && ! is_logical) { @@ -222,8 +223,14 @@ map out = (map)SCR::Execute (.target.bash_output, sformat ( "/usr/lib/YaST2/bin/examine_mbr.pl %1", disk)); y2milestone ("MBR examining script returned %1", out); - integer exit = out["exit"]:0; + exit = out["exit"]:0; repl_mbr = (exit == 254) && (! keep_mbr); + // hack for vista install GRUB to MBR + if (exit == 200) + { + repl_mbr = false; + selected_location = "mbr"; + } } else if (size (needed_devices) > 1) { @@ -254,7 +261,9 @@ // we are installing into MBR: // if there is an active partition, then we do not need to activate // one (otherwise we do) - activate = size (Storage::GetBootPartition (mbrDisk)) == 0; + // hack for vista + if (exit != 200) + activate = size (Storage::GetBootPartition (mbrDisk)) == 0; } else { -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org