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 366cd617b2
commit 0ec326eb3c
2 changed files with 4 additions and 2 deletions

View File

@ -147,6 +147,8 @@ def estimate_size(rootdir, graft={}, fstype=None, blocksize=4096, overhead=128):
getsize = lambda f: os.lstat(f).st_size
if fstype == "btrfs":
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"):
blocksize = 2048
getsize = lambda f: os.stat(f).st_size # no symlinks, count as copies

View File

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