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
862ed86a
Commit
862ed86a
authored
May 13, 2016
by
Teo Mrnjavac
Browse files
Options
Downloads
Patches
Plain Diff
Use root_mount_point.
parent
4c2a327d
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/modules/luksopenswaphookcfg/main.py
+6
-5
6 additions, 5 deletions
src/modules/luksopenswaphookcfg/main.py
with
6 additions
and
5 deletions
src/modules/luksopenswaphookcfg/main.py
+
6
−
5
View file @
862ed86a
...
@@ -19,9 +19,9 @@
...
@@ -19,9 +19,9 @@
# 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
libcalamares
import
os.path
def
write_openswap_conf
(
partitions
,
root_mount_point
,
openswap_conf_path
):
def
write_openswap_conf
(
partitions
,
openswap_conf_path
):
swap_outer_uuid
=
""
swap_outer_uuid
=
""
swap_mapper_name
=
""
swap_mapper_name
=
""
mountable_keyfile_device
=
""
mountable_keyfile_device
=
""
...
@@ -40,7 +40,7 @@ def write_openswap_conf(partitions, openswap_conf_path):
...
@@ -40,7 +40,7 @@ def write_openswap_conf(partitions, openswap_conf_path):
swap_device_path
=
"
/dev/disk/by-uuid/{!s}
"
.
format
(
swap_outer_uuid
)
swap_device_path
=
"
/dev/disk/by-uuid/{!s}
"
.
format
(
swap_outer_uuid
)
lines
=
[]
lines
=
[]
with
open
(
openswap_conf_path
,
'
r
'
)
as
openswap_file
:
with
open
(
os
.
path
.
join
(
root_mount_point
,
openswap_conf_path
)
,
'
r
'
)
as
openswap_file
:
lines
=
[
x
.
strip
()
for
x
in
openswap_file
.
readlines
()]
lines
=
[
x
.
strip
()
for
x
in
openswap_file
.
readlines
()]
for
i
in
range
(
len
(
lines
)):
for
i
in
range
(
len
(
lines
)):
...
@@ -56,7 +56,7 @@ def write_openswap_conf(partitions, openswap_conf_path):
...
@@ -56,7 +56,7 @@ def write_openswap_conf(partitions, openswap_conf_path):
elif
lines
[
i
].
startswith
(
"
keyfile_filename
"
):
elif
lines
[
i
].
startswith
(
"
keyfile_filename
"
):
lines
[
i
]
=
"
keyfile_filename=crypto_keyfile.bin
"
lines
[
i
]
=
"
keyfile_filename=crypto_keyfile.bin
"
with
open
(
openswap_conf_path
,
'
w
'
)
as
openswap_file
:
with
open
(
os
.
path
.
join
(
root_mount_point
,
openswap_conf_path
)
,
'
w
'
)
as
openswap_file
:
openswap_file
.
write
(
"
\n
"
.
join
(
lines
)
+
"
\n
"
)
openswap_file
.
write
(
"
\n
"
.
join
(
lines
)
+
"
\n
"
)
return
None
return
None
...
@@ -68,6 +68,7 @@ def run():
...
@@ -68,6 +68,7 @@ def run():
:return:
:return:
"""
"""
root_mount_point
=
libcalamares
.
globalstorage
.
value
(
"
rootMountPoint
"
)
openswap_conf_path
=
libcalamares
.
job
.
configuration
[
"
configFilePath
"
]
openswap_conf_path
=
libcalamares
.
job
.
configuration
[
"
configFilePath
"
]
partitions
=
libcalamares
.
globalstorage
.
value
(
"
partitions
"
)
partitions
=
libcalamares
.
globalstorage
.
value
(
"
partitions
"
)
return
write_openswap_conf
(
partitions
,
openswap_conf_path
)
return
write_openswap_conf
(
partitions
,
root_mount_point
,
openswap_conf_path
)
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