Skip to content

Commit

Permalink
- fix boot partition filesystem check for efi systems (bnc #784907)
Browse files Browse the repository at this point in the history
  • Loading branch information
wfeldt committed Feb 1, 2013
1 parent e7c569b commit e83fc08
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 10 deletions.
2 changes: 1 addition & 1 deletion VERSION
@@ -1 +1 @@
2.17.89
2.17.90
6 changes: 6 additions & 0 deletions package/yast2-bootloader.changes
@@ -1,3 +1,9 @@
-------------------------------------------------------------------
Mon Oct 29 14:48:39 CET 2012 - snwint@suse.de

- fix boot partition filesystem check for efi systems (bnc #784907)
- 2.17.90

-------------------------------------------------------------------
Fri Jul 13 10:13:35 CEST 2012 - snwint@suse.de

Expand Down
11 changes: 7 additions & 4 deletions src/routines/lilolike.ycp
Expand Up @@ -335,22 +335,25 @@ define string soft_MDraid_boot_disk(list<map> partitions)
// return;
map mp = Storage::GetMountPoints();

list mountdata_boot = mp["/boot"]:(mp["/"]:[]);
list mountdata_root = mp["/"]:[];
list mountdata_boot = mp["/boot"]:mountdata_root;
list mountdata_boot_efi = mp["/boot/efi"]:mountdata_boot;

y2milestone( "mountPoints %1", mp );
y2milestone( "mountdata_boot %1", mountdata_boot );
y2milestone( "mountdata_boot_efi %1", mountdata_boot_efi );

BootCommon::RootPartitionDevice = mp["/", 0]:"";
BootCommon::RootPartitionDevice = mountdata_root[0]:"";

if (BootCommon::RootPartitionDevice == "")
{
y2error ("No mountpoint for / !!");
}

// if /boot changed, re-configure location
BootCommon::BootPartitionDevice
= mountdata_boot[0]:BootCommon::RootPartitionDevice;
BootCommon::BootPartitionDevice = mountdata_boot[0]:BootCommon::RootPartitionDevice;

BootCommon::BootEFIPartitionDevice = mountdata_boot_efi[0]:BootCommon::BootPartitionDevice;

if (BootCommon::mbrDisk == "" || BootCommon::mbrDisk == nil)
{
Expand Down
18 changes: 13 additions & 5 deletions src/routines/misc.ycp
Expand Up @@ -2117,9 +2117,14 @@ global boolean BootloaderInstallable () {
// the only relevant is the partition holding the /boot filesystem
{
DetectDisks ();
y2milestone ("Boot partition device: %1",
BootCommon::BootPartitionDevice);
map dev = Storage::GetDiskPartition( BootCommon::BootPartitionDevice);
string loader = BootCommon::getLoaderType (false);
boolean is_efi = loader == "elilo" || loader == "grub2-efi";

// FIXME: what about using getBootPartition() ???
string boot_partition = is_efi ? BootCommon::BootEFIPartitionDevice : BootCommon::BootPartitionDevice;

y2milestone ("Boot partition device: %1", boot_partition);
map dev = Storage::GetDiskPartition( boot_partition );
y2milestone ("Disk info: %1", dev);
// MD, but not mirroring is OK
// FIXME: type detection by name deprecated
Expand All @@ -2130,7 +2135,7 @@ global boolean BootloaderInstallable () {
list<map> parts = md["partitions"]:[];
map info = $[];
foreach (map p, parts, {
if (p["device"]:"" == BootPartitionDevice)
if (p["device"]:"" == boot_partition)
info = p;
});
if (tolower (info["raid_type"]:"") != "raid1")
Expand All @@ -2152,7 +2157,7 @@ global boolean BootloaderInstallable () {
}
// EVMS
// FIXME: type detection by name deprecated
else if (search (getBootPartition(), "/dev/evms/") == 0)
else if (search (boot_partition, "/dev/evms/") == 0)
{
y2milestone ("Cannot install bootloader on EVMS");
return false;
Expand Down Expand Up @@ -2621,6 +2626,9 @@ global define void WriteToSysconf(boolean inst_bootloader)
}

/**
*
* FIXME: what is the difference to using BootCommon::BootPartitionDevice directly ???
*
* Function return boot device it means
* return boot partition or root partition if boot partition deosn't exist
* function return "" if boot partition or root partition is not defined (autoyast)
Expand Down

0 comments on commit e83fc08

Please sign in to comment.