diff --git a/build_library/disk_util b/build_library/disk_util index 6ea07fa57d..f1b4514324 100755 --- a/build_library/disk_util +++ b/build_library/disk_util @@ -8,6 +8,7 @@ import json import os import subprocess import sys +import tempfile import uuid # First sector we can use. @@ -283,6 +284,19 @@ def FormatFat(part, device): vfat_blocks], stdout_null=True) + if 'syslinux' in part.get('features', []): + # The syslinux directory must exist before installing ldlinux.sys to it. + vfat_mount = tempfile.mkdtemp() + Sudo(['mount', '-t', 'vfat', device, vfat_mount]) + try: + Sudo(['mkdir', os.path.join(vfat_mount, 'syslinux')]) + finally: + Sudo(['umount', vfat_mount]) + os.rmdir(vfat_mount) + + Sudo(['syslinux', '-d', '/syslinux', device]) + print "Installed SYSLINUX to %s" % part['label'] + def Format(options): """Writes the given partition table and initialize fresh filesystems. diff --git a/build_library/legacy_disk_layout.json b/build_library/legacy_disk_layout.json index dbe1628d9b..31248796dd 100644 --- a/build_library/legacy_disk_layout.json +++ b/build_library/legacy_disk_layout.json @@ -12,7 +12,8 @@ "type":"efi", "blocks":"262144", "fs_type":"vfat", - "mount":"/boot/efi" + "mount":"/boot/efi", + "features": ["syslinux"] }, "2":{ "label":"BOOT-B",