mkefiboot: Copy Mac bootloader, rather than linking it

The Mac firmware needs special-casing for hardlinked bootloaders, and
it's kind of awkward to handle that in python. Just copy them for now
instead.
This commit is contained in:
Matthew Garrett 2012-04-13 09:29:52 -04:00 committed by Brian C. Lane
parent 3996d9c9e0
commit a37389d574
2 changed files with 4 additions and 2 deletions

View File

@ -146,6 +146,8 @@ def estimate_size(rootdir, graft={}, fstype=None, blocksize=4096, overhead=128):
getsize = lambda f: os.lstat(f).st_size getsize = lambda f: os.lstat(f).st_size
if fstype == "btrfs": if fstype == "btrfs":
overhead = 64*1024 # don't worry, it's all sparse overhead = 64*1024 # don't worry, it's all sparse
if fstype == "hfsplus":
overhead = 200 # hack to deal with two bootloader copies
if fstype in ("vfat", "msdos"): if fstype in ("vfat", "msdos"):
blocksize = 2048 blocksize = 2048
getsize = lambda f: os.stat(f).st_size # no symlinks, count as copies getsize = lambda f: os.stat(f).st_size # no symlinks, count as copies

View File

@ -70,8 +70,8 @@ def macmunge(imgfile, product):
</dict> </dict>
</plist> </plist>
''' % (product,)) ''' % (product,))
os.link(loader, os.path.join(sysdir,'boot.efi')) shutil.copy(loader, os.path.join(sysdir,'boot.efi'))
os.link(config, os.path.join(sysdir,'boot.conf')) shutil.copy(config, os.path.join(sysdir,'boot.conf'))
# format data properly (big-endian UInt32) # format data properly (big-endian UInt32)
nodedata = struct.pack(">i", blessnode) nodedata = struct.pack(">i", blessnode)
dirdata = struct.pack(">i", dirnode) dirdata = struct.pack(">i", dirnode)