FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Ubuntu > Ubuntu Server Development

 
 
LinkBack Thread Tools
 
Old 02-14-2012, 03:50 PM
Matthew Garrett
 
Default Add support for UEFI Mac installs

Macs are slightly special in terms of their UEFI implementation. The
easiest way to handle boot choice is via the firmware boot picker menu,
which doesn't make use of EFI boot variables. In order for something to
show up here, the filesystem needs to be HFS+ and have some magic done
to it. Handle this case by detecting that we're on a Mac and using an HFS+
/boot/efi partition rather than a FAT one. That lets us then install the
mactel-boot package which will deal with configuring the bootloader.
---
anaconda.spec.in | 3 +++
pyanaconda/kickstart.py | 9 ++++++---
pyanaconda/platform.py | 19 ++++++++++++++++++-
3 files changed, 27 insertions(+), 4 deletions(-)

diff --git a/anaconda.spec.in b/anaconda.spec.in
index 7966b93..d1ac562 100644
--- a/anaconda.spec.in
+++ b/anaconda.spec.in
@@ -156,6 +156,9 @@ Requires: fcoe-utils >= %{fcoeutilsver}
%ifarch %{sparc}
Requires: elftoaout piggyback
%endif
+%ifarch x86_64
+Requires: mactel-boot
+%endif
Obsoletes: anaconda-images <= 10
Provides: anaconda-images = %{version}-%{release}
Obsoletes: anaconda-runtime < %{version}-%{release}
diff --git a/pyanaconda/kickstart.py b/pyanaconda/kickstart.py
index 27cf6d1..5484c82 100644
--- a/pyanaconda/kickstart.py
+++ b/pyanaconda/kickstart.py
@@ -855,9 +855,12 @@ class PartitionData(commands.partition.F12_PartData):
self.anaconda.ksdata.onPart[kwargs["name"]] = self.onPart
self.mountpoint = ""
elif self.mountpoint == "/boot/efi":
- type = "EFI System Partition"
- self.fsopts = "defaults,uid=0,gid=0,umask=0077,shortname=win nt"
- kwargs["weight"] = self.anaconda.platform.weight(fstype="efi")
+ kwargs["weight"] = self.anaconda.platform.weight(mountpoint="/boot/efi")
+ if iutil.isMactel():
+ type = "hfs+"
+ else:
+ type = "EFI System Partition"
+ self.fsopts = "defaults,uid=0,gid=0,umask=0077,shortname=win nt"
else:
if self.fstype != "":
type = self.fstype
diff --git a/pyanaconda/platform.py b/pyanaconda/platform.py
index 9840f03..c57c76e 100644
--- a/pyanaconda/platform.py
+++ b/pyanaconda/platform.py
@@ -215,6 +215,20 @@ class EFI(Platform):
else:
return 0

+class MacEFI(EFI):
+ _boot_stage1_format_types = ["hfs+"]
+ _boot_efi_description = N_("Apple EFI Boot Partition")
+ _non_linux_format_types = ["hfs+"]
+ _packages = ["mactel-boot"]
+
+ def setDefaultPartitioning(self):
+ from storage.partspec import PartSpec
+ ret = Platform.setDefaultPartitioning(self)
+ ret.append(PartSpec(mountpoint="/boot/efi", fstype="hfs+", size=20,
+ maxSize=200,
+ grow=True, weight=self.weight(mountpoint="/boot/efi")))
+ return ret
+
class PPC(Platform):
_ppcMachine = iutil.getPPCMachine()
_bootloaderClass = bootloader.Yaboot
@@ -338,7 +352,10 @@ def getPlatform(anaconda):
elif iutil.isSparc():
return Sparc(anaconda)
elif iutil.isEfi():
- return EFI(anaconda)
+ if iutil.isMactel():
+ return MacEFI(anaconda)
+ else:
+ return EFI(anaconda)
elif iutil.isX86():
return X86(anaconda)
else:
--
1.7.7.6

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 02-14-2012, 04:52 PM
Matthew Garrett
 
Default Add support for UEFI Mac installs

Macs are slightly special in terms of their UEFI implementation. The
easiest way to handle boot choice is via the firmware boot picker menu,
which doesn't make use of EFI boot variables. In order for something to
show up here, the filesystem needs to be HFS+ and have some magic done
to it. Handle this case by detecting that we're on a Mac and using an HFS+
/boot/efi partition rather than a FAT one. That lets us then install the
mactel-boot package which will deal with configuring the bootloader.
---
anaconda.spec.in | 3 +++
pyanaconda/kickstart.py | 9 ++++++---
pyanaconda/platform.py | 19 ++++++++++++++++++-
3 files changed, 27 insertions(+), 4 deletions(-)

diff --git a/anaconda.spec.in b/anaconda.spec.in
index 7966b93..d1ac562 100644
--- a/anaconda.spec.in
+++ b/anaconda.spec.in
@@ -156,6 +156,9 @@ Requires: fcoe-utils >= %{fcoeutilsver}
%ifarch %{sparc}
Requires: elftoaout piggyback
%endif
+%ifarch x86_64
+Requires: mactel-boot
+%endif
Obsoletes: anaconda-images <= 10
Provides: anaconda-images = %{version}-%{release}
Obsoletes: anaconda-runtime < %{version}-%{release}
diff --git a/pyanaconda/kickstart.py b/pyanaconda/kickstart.py
index 27cf6d1..5484c82 100644
--- a/pyanaconda/kickstart.py
+++ b/pyanaconda/kickstart.py
@@ -855,9 +855,12 @@ class PartitionData(commands.partition.F12_PartData):
self.anaconda.ksdata.onPart[kwargs["name"]] = self.onPart
self.mountpoint = ""
elif self.mountpoint == "/boot/efi":
- type = "EFI System Partition"
- self.fsopts = "defaults,uid=0,gid=0,umask=0077,shortname=win nt"
- kwargs["weight"] = self.anaconda.platform.weight(fstype="efi")
+ kwargs["weight"] = self.anaconda.platform.weight(mountpoint="/boot/efi")
+ if iutil.isMactel():
+ type = "hfs+"
+ else:
+ type = "EFI System Partition"
+ self.fsopts = "defaults,uid=0,gid=0,umask=0077,shortname=win nt"
else:
if self.fstype != "":
type = self.fstype
diff --git a/pyanaconda/platform.py b/pyanaconda/platform.py
index 9840f03..c57c76e 100644
--- a/pyanaconda/platform.py
+++ b/pyanaconda/platform.py
@@ -215,6 +215,20 @@ class EFI(Platform):
else:
return 0

+class MacEFI(EFI):
+ _boot_stage1_format_types = ["hfs+"]
+ _boot_efi_description = N_("Apple EFI Boot Partition")
+ _non_linux_format_types = ["hfs+"]
+ _packages = ["mactel-boot"]
+
+ def setDefaultPartitioning(self):
+ from storage.partspec import PartSpec
+ ret = Platform.setDefaultPartitioning(self)
+ ret.append(PartSpec(mountpoint="/boot/efi", fstype="hfs+", size=20,
+ maxSize=200,
+ grow=True, weight=self.weight(mountpoint="/boot/efi")))
+ return ret
+
class PPC(Platform):
_ppcMachine = iutil.getPPCMachine()
_bootloaderClass = bootloader.Yaboot
@@ -338,7 +352,10 @@ def getPlatform(anaconda):
elif iutil.isSparc():
return Sparc(anaconda)
elif iutil.isEfi():
- return EFI(anaconda)
+ if iutil.isMactel():
+ return MacEFI(anaconda)
+ else:
+ return EFI(anaconda)
elif iutil.isX86():
return X86(anaconda)
else:
--
1.7.7.6

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 

Thread Tools




All times are GMT. The time now is 12:31 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org