Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
Calamares
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
osak
Calamares
Commits
83b341b0
Commit
83b341b0
authored
Aug 23, 2016
by
Teo Mrnjavac
Browse files
Options
Downloads
Patches
Plain Diff
Handle a variety of case-insensitive situations on the VFAT ESP.
This fixes CAL-385 #close
parent
e4fda2e4
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/modules/bootloader/main.py
+29
-8
29 additions, 8 deletions
src/modules/bootloader/main.py
with
29 additions
and
8 deletions
src/modules/bootloader/main.py
+
29
−
8
View file @
83b341b0
...
@@ -9,6 +9,7 @@
...
@@ -9,6 +9,7 @@
# Copyright 2014, Benjamin Vaudour <benjamin.vaudour@yahoo.fr>
# Copyright 2014, Benjamin Vaudour <benjamin.vaudour@yahoo.fr>
# Copyright 2014, Kevin Kofler <kevin.kofler@chello.at>
# Copyright 2014, Kevin Kofler <kevin.kofler@chello.at>
# Copyright 2015, Philip Mueller <philm@manjaro.org>
# Copyright 2015, Philip Mueller <philm@manjaro.org>
# Copyright 2016, Teo Mrnjavac <teo@kde.org>
#
#
# Calamares is free software: you can redistribute it and/or modify
# Calamares is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# it under the terms of the GNU General Public License as published by
...
@@ -23,11 +24,11 @@
...
@@ -23,11 +24,11 @@
# You should have received a copy of the GNU General Public License
# You should have received a copy of the GNU General Public License
# along with Calamares. If not, see <http://www.gnu.org/licenses/>.
# along with Calamares. If not, see <http://www.gnu.org/licenses/>.
import
libcalamares
import
os
import
os
import
subprocess
import
subprocess
import
libcalamares
from
libcalamares.utils
import
check_target_env_call
from
libcalamares.utils
import
check_target_env_call
...
@@ -192,7 +193,8 @@ def install_grub(efi_directory, fw_type):
...
@@ -192,7 +193,8 @@ def install_grub(efi_directory, fw_type):
"""
"""
if
fw_type
==
"
efi
"
:
if
fw_type
==
"
efi
"
:
print
(
"
Bootloader: grub (efi)
"
)
print
(
"
Bootloader: grub (efi)
"
)
efi_directory_firmware
=
efi_directory
+
"
/EFI
"
if
not
os
.
path
.
isdir
(
efi_directory
):
check_target_env_call
([
"
mkdir
"
,
"
-p
"
,
"
{!s}
"
.
format
(
efi_directory
)])
check_target_env_call
([
"
mkdir
"
,
"
-p
"
,
"
{!s}
"
.
format
(
efi_directory
)])
if
"
efiBootloaderId
"
in
libcalamares
.
job
.
configuration
:
if
"
efiBootloaderId
"
in
libcalamares
.
job
.
configuration
:
...
@@ -216,11 +218,23 @@ def install_grub(efi_directory, fw_type):
...
@@ -216,11 +218,23 @@ def install_grub(efi_directory, fw_type):
"
--efi-directory={!s}
"
.
format
(
efi_directory
),
"
--efi-directory={!s}
"
.
format
(
efi_directory
),
"
--bootloader-id={!s}
"
.
format
(
efi_bootloader_id
),
"
--bootloader-id={!s}
"
.
format
(
efi_bootloader_id
),
"
--force
"
])
"
--force
"
])
# VFAT is weird, see issue CAL-385
efi_directory_firmware
=
case_insensitive_subdir
(
efi_directory
,
[
"
EFI
"
,
"
Efi
"
,
"
efi
"
])
if
not
efi_directory_firmware
:
efi_directory_firmware
=
os
.
path
.
join
(
efi_directory
,
"
EFI
"
)
efi_boot_directory
=
case_insensitive_subdir
(
efi_directory_firmware
,
[
"
Boot
"
,
"
boot
"
,
"
BOOT
"
])
if
not
efi_boot_directory
:
efi_boot_directory
=
os
.
path
.
join
(
efi_directory_firmware
,
"
boot
"
)
check_target_env_call
([
"
mkdir
"
,
"
-p
"
,
efi_boot_directory
])
# Workaround for some UEFI firmwares
# Workaround for some UEFI firmwares
check_target_env_call
([
"
mkdir
"
,
"
-p
"
,
"
{!s}/boot
"
.
format
(
efi_directory_firmware
)])
check_target_env_call
([
"
cp
"
,
check_target_env_call
([
"
cp
"
,
"
{!s}/{!s}/grubx64.efi
"
.
format
(
efi_directory_firmware
,
os
.
path
.
join
(
efi_directory_firmware
,
efi_bootloader_id
,
"
grubx64.efi
"
),
efi_bootloader_id
),
os
.
path
.
join
(
efi_boot_directory
,
"
bootx64.efi
"
)])
"
{!s}/boot/bootx64.efi
"
.
format
(
efi_directory_firmware
)])
else
:
else
:
print
(
"
Bootloader: grub (bios)
"
)
print
(
"
Bootloader: grub (bios)
"
)
boot_loader
=
libcalamares
.
globalstorage
.
value
(
"
bootLoader
"
)
boot_loader
=
libcalamares
.
globalstorage
.
value
(
"
bootLoader
"
)
...
@@ -237,6 +251,13 @@ def install_grub(efi_directory, fw_type):
...
@@ -237,6 +251,13 @@ def install_grub(efi_directory, fw_type):
libcalamares
.
job
.
configuration
[
"
grubCfg
"
]])
libcalamares
.
job
.
configuration
[
"
grubCfg
"
]])
def
case_insensitive_subdir
(
parent
,
candidate_dirnames
):
for
dirname
in
candidate_dirnames
:
if
os
.
path
.
isdir
(
os
.
path
.
join
(
parent
,
dirname
)):
return
os
.
path
.
join
(
parent
,
dirname
)
return
""
def
prepare_bootloader
(
fw_type
):
def
prepare_bootloader
(
fw_type
):
"""
Prepares bootloader and set proper flags to EFI boot partition (esp,boot).
"""
Prepares bootloader and set proper flags to EFI boot partition (esp,boot).
Based on value
'
efi_boot_loader
'
, it either calls systemd-boot or grub to be installed.
Based on value
'
efi_boot_loader
'
, it either calls systemd-boot or grub to be installed.
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment