SHA256
1
0
forked from pool/systemd
systemd/crypt-loop-file.patch
Stephan Kulow 85f340d6af Accepting request 101505 from Base:System
- Update to version 39:
  + New systemd-cgtop tool to show control groups by their resource
    usage.
  + Linking against libacl for ACLs is optional again.
  + If a group "adm" exists, journal files are automatically owned
    by them, thus allow members of this group full access to the
    system journal as well as all user journals.
  + The journal now stores the SELinux context of the logging
    client for all entries.
  + Add C++ inclusion guards to all public headers.
  + New output mode "cat" in the journal to print only text
    messages, without any meta data like date or time.
  + Include tiny X server wrapper as a temporary stop-gap to teach
    XOrg udev display enumeration (until XOrg supports udev
    hotplugging for display devices).
  + Add new systemd-cat tool for executing arbitrary programs with
    STDERR/STDOUT connected to the journal. Can also act as BSD
    logger replacement, and does so by default.
  + Optionally store all locally generated coredumps in the journal
    along with meta data.
  + systemd-tmpfiles learnt four new commands: n, L, c, b, for
    writing short strings to files (for usage for /sys), and for
    creating symlinks, character and block device nodes.
  + New unit file option ControlGroupPersistent= to make cgroups
    persistent.
  + Support multiple local RTCs in a sane way.
  + No longer monopolize IO when replaying readahead data on
    rotating disks.
  + Don't show kernel threads in systemd-cgls anymore, unless
    requested with new -k switch. (forwarded request 101496 from fcrozat)

OBS-URL: https://build.opensuse.org/request/show/101505
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/systemd?expand=0&rev=85
2012-01-26 15:00:42 +00:00

77 lines
2.6 KiB
Diff

Index: systemd-37/src/cryptsetup/cryptsetup-generator.c
===================================================================
--- systemd-37.orig/src/cryptsetup/cryptsetup-generator.c
+++ systemd-37/src/cryptsetup/cryptsetup-generator.c
@@ -138,7 +138,7 @@ static int create_disk(
const char *password,
const char *options) {
- char *p = NULL, *n = NULL, *d = NULL, *u = NULL, *from = NULL, *to = NULL, *e = NULL;
+ char *p = NULL, *n = NULL, *d = NULL, *u = NULL, *from = NULL, *to = NULL, *e = NULL, *path_file = NULL;
int r;
FILE *f = NULL;
bool noauto, nofail;
@@ -167,10 +167,50 @@ static int create_disk(
goto fail;
}
- if (!(d = unit_name_from_path(u, ".device"))) {
- r = -ENOMEM;
- log_error("Failed to allocate device name.");
- goto fail;
+ if (!startswith(device,"/dev/")) {
+
+ if (!(d = unit_name_build_escape("cryptsetup", name, ".path"))) {
+ r = -ENOMEM;
+ log_error("Failed to allocate path name.");
+ goto fail;
+ }
+
+ if (asprintf(&path_file, "%s/%s", arg_dest, d) < 0) {
+ r = -ENOMEM;
+ log_error("Failed to allocate unit file name.");
+ goto fail;
+ }
+
+ if (!(f = fopen(path_file, "wxe"))) {
+ r = -errno;
+ log_error("Failed to create unit file: %m");
+ goto fail;
+ }
+
+ fprintf(f,
+ "[Unit]\n"
+ "Description=Cryptography Setup for %s\n"
+ "DefaultDependencies=no\n"
+ "[Path]\n"
+ "PathExists=%s\n",
+ device, device);
+
+ fflush(f);
+
+ if (ferror(f)) {
+ r = -errno;
+ log_error("Failed to write file: %m");
+ goto fail;
+ }
+
+ f = NULL;
+ } else {
+
+ if (!(d = unit_name_from_path(u, ".device"))) {
+ r = -ENOMEM;
+ log_error("Failed to allocate device name.");
+ goto fail;
+ }
}
if (!(f = fopen(p, "wxe"))) {
@@ -300,6 +340,7 @@ fail:
free(n);
free(d);
free(e);
+ free(path_file);
free(from);
free(to);