fix(disk_util): Install syslinux as part of filesystem formatting.

This means scripts later don't need to deal with the ESP block device
directly, they can just copy the config files into place.
This commit is contained in:
Michael Marineau 2013-12-28 16:56:21 -08:00
parent d1fee3653e
commit 359505490d
2 changed files with 16 additions and 1 deletions

View File

@ -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.

View File

@ -12,7 +12,8 @@
"type":"efi",
"blocks":"262144",
"fs_type":"vfat",
"mount":"/boot/efi"
"mount":"/boot/efi",
"features": ["syslinux"]
},
"2":{
"label":"BOOT-B",