forked from pool/systemd
Accepting request 197612 from home:fcrozat:branches:Base:System
- Remove force-lvm-restart-after-cryptsetup-target-is-reached.patch and remove additional dependencies on LVM in other patches: LVM has now systemd support, no need to work around it anymore in systemd. OBS-URL: https://build.opensuse.org/request/show/197612 OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd?expand=0&rev=426
This commit is contained in:
parent
6f44dd5eb8
commit
72c0c7777a
@ -1,6 +1,6 @@
|
||||
From: Frederic Crozat <fcrozat@suse.com>
|
||||
Date: Wed, 9 Nov 2011 11:10:49 +0100
|
||||
Subject: delay fsck / cryptsetup after md / dmraid / lvm are started
|
||||
Subject: delay fsck / cryptsetup after md / dmraid are started
|
||||
|
||||
---
|
||||
src/cryptsetup/cryptsetup-generator.c | 1 +
|
||||
@ -13,7 +13,7 @@ Subject: delay fsck / cryptsetup after md / dmraid / lvm are started
|
||||
"Conflicts=umount.target\n"
|
||||
"DefaultDependencies=no\n"
|
||||
"BindsTo=dev-mapper-%i.device\n"
|
||||
+ "After=md.service dmraid.service lvm.service\n"
|
||||
+ "After=md.service dmraid.service\n"
|
||||
"After=systemd-readahead-collect.service systemd-readahead-replay.service\n",
|
||||
f);
|
||||
|
||||
@ -24,7 +24,7 @@ Subject: delay fsck / cryptsetup after md / dmraid / lvm are started
|
||||
DefaultDependencies=no
|
||||
BindsTo=%i.device
|
||||
-After=systemd-readahead-collect.service systemd-readahead-replay.service %i.device
|
||||
+After=systemd-readahead-collect.service systemd-readahead-replay.service %i.device lvm.service md.service dmraid.service
|
||||
+After=systemd-readahead-collect.service systemd-readahead-replay.service %i.device md.service dmraid.service
|
||||
Before=shutdown.target
|
||||
|
||||
[Service]
|
||||
|
@ -1,8 +1,8 @@
|
||||
From: Frederic Crozat <fcrozat@suse.com>
|
||||
Date: Thu, 9 Feb 2012 16:19:38 +0000
|
||||
Subject: ensure DM and LVM are started before local-fs-pre-target
|
||||
Subject: ensure DM and dmraid are started before local-fs-pre-target
|
||||
|
||||
ensure md / lvm /dmraid is started before mounting partitions,
|
||||
ensure md / dmraid is started before mounting partitions,
|
||||
if fsck was disabled for them (bnc#733283).
|
||||
---
|
||||
units/local-fs-pre.target | 1 +
|
||||
@ -14,4 +14,4 @@ if fsck was disabled for them (bnc#733283).
|
||||
Description=Local File Systems (Pre)
|
||||
Documentation=man:systemd.special(7)
|
||||
RefuseManualStart=yes
|
||||
+After=md.service lvm.service dmraid.service
|
||||
+After=md.service dmraid.service
|
||||
|
@ -1,102 +0,0 @@
|
||||
From: Frederic Crozat <fcrozat@suse.com>
|
||||
Date: Mon, 7 Nov 2011 18:04:20 +0100
|
||||
Subject: force lvm restart after cryptsetup target is reached
|
||||
|
||||
---
|
||||
src/cryptsetup/cryptsetup-generator.c | 57 ++++++++++++++++++++++++++++++++++-
|
||||
1 file changed, 56 insertions(+), 1 deletion(-)
|
||||
|
||||
--- systemd-206.orig/src/cryptsetup/cryptsetup-generator.c
|
||||
+++ systemd-206/src/cryptsetup/cryptsetup-generator.c
|
||||
@@ -22,6 +22,7 @@
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
#include <unistd.h>
|
||||
+#include <stdlib.h>
|
||||
|
||||
#include "log.h"
|
||||
#include "util.h"
|
||||
@@ -64,6 +65,54 @@ static bool has_option(const char *hayst
|
||||
return false;
|
||||
}
|
||||
|
||||
+static int create_storage_after_cryptsetup (void) {
|
||||
+ _cleanup_free_ char *to = NULL, *p = NULL;
|
||||
+ _cleanup_fclose_ FILE *f = NULL;
|
||||
+
|
||||
+ if (asprintf(&p, "%s/storage-after-cryptsetup.service", arg_dest) < 0)
|
||||
+ return log_oom();
|
||||
+
|
||||
+ if (!(f = fopen(p, "wxe"))) {
|
||||
+ log_error("Failed to create unit file: %m");
|
||||
+ return -errno;
|
||||
+ }
|
||||
+
|
||||
+ fprintf(f,
|
||||
+ "[Unit]\n"
|
||||
+ "Description=Restart storage after cryptsetup\n"
|
||||
+ "DefaultDependencies=no\n"
|
||||
+ "After=cryptsetup.target\n"
|
||||
+ "Wants=cryptsetup.target\n"
|
||||
+ "Before=local-fs.target\n"
|
||||
+ "Before=shutdown.target\n");
|
||||
+
|
||||
+ fprintf(f,
|
||||
+ "\n[Service]\n"
|
||||
+ "RemainAfterExit=true\n"
|
||||
+ "Type=oneshot\n"
|
||||
+ "TimeoutSec=0\n"
|
||||
+ "ExecStart=/usr/bin/systemctl restart lvm.service\n");
|
||||
+
|
||||
+ fflush(f);
|
||||
+
|
||||
+ if (ferror(f)) {
|
||||
+ log_error("Failed to write file: %m");
|
||||
+ return -errno;
|
||||
+ }
|
||||
+
|
||||
+ if (asprintf(&to, "%s/local-fs.target.wants/storage-after-cryptsetup.service", arg_dest) < 0)
|
||||
+ return log_oom();
|
||||
+
|
||||
+ mkdir_parents(to, 0755);
|
||||
+
|
||||
+ if (symlink("../storage-after-cryptsetup.service", to) < 0) {
|
||||
+ log_error("Failed to create symlink ../storage-after-cryptsetup.service to '%s': %m", to);
|
||||
+ return -errno;
|
||||
+ }
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
static int create_disk(
|
||||
const char *name,
|
||||
const char *device,
|
||||
@@ -334,6 +383,7 @@ int main(int argc, char *argv[]) {
|
||||
_cleanup_fclose_ FILE *f = NULL;
|
||||
unsigned n = 0;
|
||||
int r = EXIT_SUCCESS;
|
||||
+ bool no_crypttab = false;
|
||||
char **i;
|
||||
|
||||
if (argc > 1 && argc != 4) {
|
||||
@@ -361,8 +411,10 @@ int main(int argc, char *argv[]) {
|
||||
|
||||
f = fopen("/etc/crypttab", "re");
|
||||
if (!f) {
|
||||
- if (errno == ENOENT)
|
||||
+ if (errno == ENOENT) {
|
||||
+ no_crypttab = true;
|
||||
r = EXIT_SUCCESS;
|
||||
+ }
|
||||
else {
|
||||
r = EXIT_FAILURE;
|
||||
log_error("Failed to open /etc/crypttab: %m");
|
||||
@@ -464,5 +516,8 @@ next:
|
||||
r = EXIT_FAILURE;
|
||||
}
|
||||
|
||||
+ if ((r == EXIT_SUCCESS && !no_crypttab) && (create_storage_after_cryptsetup () < 0))
|
||||
+ r = EXIT_FAILURE;
|
||||
+
|
||||
return r;
|
||||
}
|
@ -1,3 +1,12 @@
|
||||
-------------------------------------------------------------------
|
||||
Fri Sep 6 15:02:08 UTC 2013 - fcrozat@suse.com
|
||||
|
||||
- Remove
|
||||
force-lvm-restart-after-cryptsetup-target-is-reached.patch and
|
||||
remove additional dependencies on LVM in other patches: LVM has
|
||||
now systemd support, no need to work around it anymore in
|
||||
systemd.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Wed Aug 21 10:42:35 UTC 2013 - idonmez@suse.com
|
||||
|
||||
|
@ -128,7 +128,6 @@ Patch6: insserv-generator.patch
|
||||
Patch7: service-flags-sysv-service-with-detected-pid-as-RemainAfte.patch
|
||||
Patch8: module-load-handle-SUSE-etc-sysconfig-kernel-module-list.patch
|
||||
Patch9: remain_after_exit-initscript-heuristic-and-add-new-LSB-hea.patch
|
||||
Patch10: force-lvm-restart-after-cryptsetup-target-is-reached.patch
|
||||
Patch11: delay-fsck-cryptsetup-after-md-dmraid-lvm-are-started.patch
|
||||
Patch12: Fix-run-lock-directories-permissions-to-follow-openSUSE-po.patch
|
||||
Patch13: ensure-sysctl-are-applied-after-modules-are-loaded.patch
|
||||
@ -393,7 +392,6 @@ cp %{SOURCE7} m4/
|
||||
%patch7 -p1
|
||||
%patch8 -p1
|
||||
%patch9 -p1
|
||||
%patch10 -p1
|
||||
%patch11 -p1
|
||||
%patch12 -p1
|
||||
%patch13 -p1
|
||||
|
@ -1,3 +1,12 @@
|
||||
-------------------------------------------------------------------
|
||||
Fri Sep 6 15:02:08 UTC 2013 - fcrozat@suse.com
|
||||
|
||||
- Remove
|
||||
force-lvm-restart-after-cryptsetup-target-is-reached.patch and
|
||||
remove additional dependencies on LVM in other patches: LVM has
|
||||
now systemd support, no need to work around it anymore in
|
||||
systemd.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Wed Aug 21 10:42:35 UTC 2013 - idonmez@suse.com
|
||||
|
||||
|
@ -123,7 +123,6 @@ Patch6: insserv-generator.patch
|
||||
Patch7: service-flags-sysv-service-with-detected-pid-as-RemainAfte.patch
|
||||
Patch8: module-load-handle-SUSE-etc-sysconfig-kernel-module-list.patch
|
||||
Patch9: remain_after_exit-initscript-heuristic-and-add-new-LSB-hea.patch
|
||||
Patch10: force-lvm-restart-after-cryptsetup-target-is-reached.patch
|
||||
Patch11: delay-fsck-cryptsetup-after-md-dmraid-lvm-are-started.patch
|
||||
Patch12: Fix-run-lock-directories-permissions-to-follow-openSUSE-po.patch
|
||||
Patch13: ensure-sysctl-are-applied-after-modules-are-loaded.patch
|
||||
@ -388,7 +387,6 @@ cp %{SOURCE7} m4/
|
||||
%patch7 -p1
|
||||
%patch8 -p1
|
||||
%patch9 -p1
|
||||
%patch10 -p1
|
||||
%patch11 -p1
|
||||
%patch12 -p1
|
||||
%patch13 -p1
|
||||
|
Loading…
Reference in New Issue
Block a user