mirror of
https://github.com/parchlinux/calamares.git
synced 2025-06-26 17:05:36 -04:00
bootloader: Ensure that the file names are valid.
Change any '/' slashes to '-' dashes. Also change spaces to underscores while we are at it.
This commit is contained in:
parent
8f5b0585cb
commit
76450b44a3
1 changed files with 5 additions and 3 deletions
|
@ -110,9 +110,10 @@ def create_loader(loader_path):
|
|||
branding = libcalamares.globalstorage.value("branding")
|
||||
distribution = branding["productName"]
|
||||
timeout = libcalamares.job.configuration["timeout"]
|
||||
file_name_sanitizer = str.maketrans(" /", "_-")
|
||||
lines = [
|
||||
'timeout %s\n' % timeout,
|
||||
'default %s\n' % distribution,
|
||||
'default %s\n' % distribution.translate(file_name_sanitizer),
|
||||
]
|
||||
|
||||
with open(loader_path, 'w') as f:
|
||||
|
@ -127,10 +128,11 @@ def install_bootloader(boot_loader, fw_type):
|
|||
uuid = get_uuid()
|
||||
branding = libcalamares.globalstorage.value("branding")
|
||||
distribution = branding["productName"]
|
||||
file_name_sanitizer = str.maketrans(" /", "_-")
|
||||
conf_path = os.path.join(
|
||||
install_path, "boot", "loader", "entries", "%s.conf" % distribution)
|
||||
install_path, "boot", "loader", "entries", "%s.conf" % distribution.translate(file_name_sanitizer))
|
||||
fallback_path = os.path.join(
|
||||
install_path, "boot", "loader", "entries", "%s-fallback.conf" % distribution)
|
||||
install_path, "boot", "loader", "entries", "%s-fallback.conf" % distribution.translate(file_name_sanitizer))
|
||||
loader_path = os.path.join(
|
||||
install_path, "boot", "loader", "loader.conf")
|
||||
partitions = libcalamares.globalstorage.value("partitions")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue