Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
systemd
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
steam
systemd
Commits
cb41b45f
Commit
cb41b45f
authored
Apr 16, 2015
by
Martin Pitt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cryptsetup: Implement offset and skip options
Closes: #751707 LP: #953875
parent
772d1aae
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
74 additions
and
0 deletions
+74
-0
debian/changelog
debian/changelog
+7
-0
debian/patches/cryptsetup-Implement-offset-and-skip-options.patch
...atches/cryptsetup-Implement-offset-and-skip-options.patch
+66
-0
debian/patches/series
debian/patches/series
+1
-0
No files found.
debian/changelog
View file @
cb41b45f
systemd
(
215
-
17
)
UNRELEASED
;
urgency
=
medium
*
cryptsetup
:
Implement
offset
and
skip
options
.
(
Closes
:
#
751707
,
LP
:
#
953875
)
--
Martin
Pitt
<
mpitt
@
debian
.
org
>
Thu
,
16
Apr
2015
07
:
12
:
08
-
0500
systemd
(
215
-
16
)
unstable
;
urgency
=
medium
[
Christian
Seiler
]
...
...
debian/patches/cryptsetup-Implement-offset-and-skip-options.patch
0 → 100644
View file @
cb41b45f
From: Martin Pitt <martin.pitt@ubuntu.com>
Date: Thu, 16 Apr 2015 06:44:07 -0500
Subject: cryptsetup: Implement offset and skip options
These are useful for plain devices as they don't have any metadata by
themselves. Instead of using an unreliable hardcoded device name in crypttab
you can then put static meatadata at the start of the partition for a stable
UUID or label.
https://bugs.freedesktop.org/show_bug.cgi?id=87717
https://bugs.debian.org/751707
https://launchpad.net/bugs/953875
---
src/cryptsetup/cryptsetup.c | 21 +++++++++++++++++++--
1 file changed, 19 insertions(+), 2 deletions(-)
diff --git a/src/cryptsetup/cryptsetup.c b/src/cryptsetup/cryptsetup.c
index a67d85e..a7c7eb2 100644
--- a/src/cryptsetup/cryptsetup.c
+++ b/src/cryptsetup/cryptsetup.c
@@ -50,12 +50,12 @@
static bool arg_discards = false;
static bool arg_tcrypt_hidden = false;
static bool arg_tcrypt_system = false;
static char **arg_tcrypt_keyfiles = NULL;
+static uint64_t arg_offset = 0;
+static uint64_t arg_skip = 0;
static usec_t arg_timeout = 0;
/* Options Debian's crypttab knows we don't:
- offset=
- skip=
precheck=
check=
checkargs=
@@ -168,6 +168,20 @@
static int parse_one_option(const char *option) {
return 0;
}
+ } else if (startswith(option, "offset=")) {
+
+ if (safe_atou64(option+7, &arg_offset) < 0) {
+ log_error("offset= parse failure, ignoring.");
+ return 0;
+ }
+
+ } else if (startswith(option, "skip=")) {
+
+ if (safe_atou64(option+5, &arg_skip) < 0) {
+ log_error("skip= parse failure, ignoring.");
+ return 0;
+ }
+
} else if (!streq(option, "none"))
log_error("Encountered unknown /etc/crypttab option '%s', ignoring.", option);
@@ -403,6 +417,9 @@
static int attach_luks_or_plain(struct crypt_device *cd,
} else
params.hash = "ripemd160";
+ params.offset = arg_offset;
+ params.skip = arg_skip;
+
if (arg_cipher) {
size_t l;
debian/patches/series
View file @
cb41b45f
...
...
@@ -204,3 +204,4 @@ PrivateTmp-shouldn-t-require-tmpfs.patch
sysv-generator-add-support-for-etc-insserv-overrides.patch
syslog-Increase-max_dgram_qlen-by-pulling-in-systemd.patch
Skip-filesystem-check-if-already-done-by-the-initram.patch
cryptsetup-Implement-offset-and-skip-options.patch
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment