mirror of
https://github.com/flatcar/scripts.git
synced 2025-09-23 14:41:31 +02:00
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:
parent
d1fee3653e
commit
359505490d
@ -8,6 +8,7 @@ import json
|
|||||||
import os
|
import os
|
||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
|
import tempfile
|
||||||
import uuid
|
import uuid
|
||||||
|
|
||||||
# First sector we can use.
|
# First sector we can use.
|
||||||
@ -283,6 +284,19 @@ def FormatFat(part, device):
|
|||||||
vfat_blocks],
|
vfat_blocks],
|
||||||
stdout_null=True)
|
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):
|
def Format(options):
|
||||||
"""Writes the given partition table and initialize fresh filesystems.
|
"""Writes the given partition table and initialize fresh filesystems.
|
||||||
|
@ -12,7 +12,8 @@
|
|||||||
"type":"efi",
|
"type":"efi",
|
||||||
"blocks":"262144",
|
"blocks":"262144",
|
||||||
"fs_type":"vfat",
|
"fs_type":"vfat",
|
||||||
"mount":"/boot/efi"
|
"mount":"/boot/efi",
|
||||||
|
"features": ["syslinux"]
|
||||||
},
|
},
|
||||||
"2":{
|
"2":{
|
||||||
"label":"BOOT-B",
|
"label":"BOOT-B",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user