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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
osak
Calamares
Commits
041db6e3
Commit
041db6e3
authored
8 years ago
by
Kevin Kofler
Committed by
Philip
8 years ago
Browse files
Options
Downloads
Patches
Plain Diff
[dracutlukscfg] Don't include keyfile in initramfs on unencrypted /boot.
This matches the fix in initcpiocfg and initramfscfg.
parent
423c7b57
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/modules/dracutlukscfg/DracutLuksCfgJob.cpp
+28
-3
28 additions, 3 deletions
src/modules/dracutlukscfg/DracutLuksCfgJob.cpp
src/modules/dracutlukscfg/DracutLuksCfgJob.h
+4
-1
4 additions, 1 deletion
src/modules/dracutlukscfg/DracutLuksCfgJob.h
with
32 additions
and
4 deletions
src/modules/dracutlukscfg/DracutLuksCfgJob.cpp
+
28
−
3
View file @
041db6e3
...
...
@@ -33,14 +33,22 @@
const
QString
DracutLuksCfgJob
::
CONFIG_FILE
=
QStringLiteral
(
"/etc/dracut.conf.d/calamares-luks.conf"
);
// static
const
char
*
DracutLuksCfgJob
::
CONFIG_FILE_
CONTENTS
=
const
char
*
DracutLuksCfgJob
::
CONFIG_FILE_
HEADER
=
"# Configuration file automatically written by the Calamares system installer
\n
"
"# (This file is written once at install time and should be safe to edit.)
\n
"
"# Enables support for LUKS full disk encryption with single sign on from GRUB.
\n
"
"
\n
"
"
\n
"
;
// static
const
char
*
DracutLuksCfgJob
::
CONFIG_FILE_CRYPTTAB_KEYFILE_LINE
=
"# force installing /etc/crypttab even if hostonly=
\"
no
\"
, install the keyfile
\n
"
"install_items+=
\"
/etc/crypttab /crypto_keyfile.bin
\"\n
"
;
// static
const
char
*
DracutLuksCfgJob
::
CONFIG_FILE_CRYPTTAB_LINE
=
"# force installing /etc/crypttab even if hostonly=
\"
no
\"\n
"
"install_items+=
\"
/etc/crypttab
\"\n
"
;
// static
const
QString
DracutLuksCfgJob
::
CONFIG_FILE_SWAPLINE
=
QStringLiteral
(
"# enable automatic resume from swap
\n
add_device+=
\"
/dev/disk/by-uuid/%1
\"\n
"
);
...
...
@@ -75,6 +83,21 @@ DracutLuksCfgJob::isRootEncrypted()
return
false
;
}
// static
bool
DracutLuksCfgJob
::
hasUnencryptedSeparateBoot
()
{
const
QVariantList
partitions
=
DracutLuksCfgJob
::
partitions
();
for
(
const
QVariant
&
partition
:
partitions
)
{
QVariantMap
partitionMap
=
partition
.
toMap
();
QString
mountPoint
=
partitionMap
.
value
(
QStringLiteral
(
"mountPoint"
)
).
toString
();
if
(
mountPoint
==
QStringLiteral
(
"/boot"
)
)
return
!
partitionMap
.
contains
(
QStringLiteral
(
"luksMapperName"
)
);
}
return
false
;
}
// static
QString
DracutLuksCfgJob
::
swapOuterUuid
()
...
...
@@ -126,7 +149,9 @@ DracutLuksCfgJob::exec()
return
Calamares
::
JobResult
::
error
(
tr
(
"Failed to open %1"
).
arg
(
realConfigFilePath
)
);
}
QTextStream
outStream
(
&
configFile
);
outStream
<<
CONFIG_FILE_CONTENTS
;
outStream
<<
CONFIG_FILE_HEADER
<<
(
hasUnencryptedSeparateBoot
()
?
CONFIG_FILE_CRYPTTAB_LINE
:
CONFIG_FILE_CRYPTTAB_KEYFILE_LINE
);
const
QString
swapOuterUuid
=
DracutLuksCfgJob
::
swapOuterUuid
();
if
(
!
swapOuterUuid
.
isEmpty
()
)
{
...
...
This diff is collapsed.
Click to expand it.
src/modules/dracutlukscfg/DracutLuksCfgJob.h
+
4
−
1
View file @
041db6e3
...
...
@@ -42,12 +42,15 @@ public:
private:
static
const
QString
CONFIG_FILE
;
static
const
char
*
CONFIG_FILE_CONTENTS
;
static
const
char
*
CONFIG_FILE_HEADER
;
static
const
char
*
CONFIG_FILE_CRYPTTAB_KEYFILE_LINE
;
static
const
char
*
CONFIG_FILE_CRYPTTAB_LINE
;
static
const
QString
CONFIG_FILE_SWAPLINE
;
static
QString
rootMountPoint
();
static
QVariantList
partitions
();
static
bool
isRootEncrypted
();
static
bool
hasUnencryptedSeparateBoot
();
static
QString
swapOuterUuid
();
};
...
...
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