forked from pool/systemd
9fc3254595
- Update of patch 0001-detect-s390-virt.patch (bnc#880438) - Shut up stupid check scripts crying for not mentioned systemd-mini-rpmlintrc - Add upstream patchs 0001-core-use-correct-format-string-for-UIDs.patch 0002-core-transaction-fix-cycle-break-attempts-outside-tr.patch 0003-fsck-consider-a-fsck-implementation-linked-to-bin-tr.patch - Add upstream patch 0001-units-order-network-online.target-after-network.targ.patch to make sure that etwork-online.target follows network.target - rules: re-enable dev_id conditionally in persistent rules (bnc#884403 and bnc#882714). Add 1040-re-enable-dev_id-conditionally-in-persistent-rules.patch - Add upstream patches 0001-vconsole-also-copy-character-maps-not-just-fonts-fro.patch 0002-core-make-sure-Environment-fields-passed-in-for-tran.patch 0003-core-You-can-not-put-the-cached-result-of-use_smack-.patch 0004-cryptsetup-don-t-add-unit-dependency-on-dev-null-dev.patch 0005-man-fix-path-in-crypttab-5.patch - Add upstream patch 1039-udevadm-settle-fixed-return-code-for-empty-queue.patch it fixes udevadm settle exit code which may had roken dracut scripts (bnc#884271 comment#18) - Temporary disable patch 1022 (bnc#884271 and bnc#882714). OBS-URL: https://build.opensuse.org/request/show/238853 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/systemd?expand=0&rev=190
99 lines
3.7 KiB
Diff
99 lines
3.7 KiB
Diff
Based on 571d0134bd464444567cf4eb0d2ed8df40045f36 Mon Sep 17 00:00:00 2001
|
|
From: Lennart Poettering <lennart@poettering.net>
|
|
Date: Tue, 24 Jun 2014 19:37:22 +0200
|
|
Subject: [PATCH] fsck: consider a fsck implementation linked to /bin/true
|
|
non-existant
|
|
|
|
---
|
|
src/fsck/fsck.c | 32 ++++++++++++++++++++++----------
|
|
src/shared/path-util.c | 26 +++++++++++++++-----------
|
|
2 files changed, 37 insertions(+), 21 deletions(-)
|
|
|
|
--- src/fsck/fsck.c
|
|
+++ src/fsck/fsck.c 2014-06-26 09:19:58.591864710 +0000
|
|
@@ -280,16 +280,28 @@ int main(int argc, char *argv[]) {
|
|
|
|
type = udev_device_get_property_value(udev_device, "ID_FS_TYPE");
|
|
if (type) {
|
|
- const char *checker = strappenda("/sbin/fsck.", type);
|
|
- r = access(checker, X_OK);
|
|
- if (r < 0) {
|
|
- if (errno == ENOENT) {
|
|
- log_info("%s doesn't exist, not checking file system on %s",
|
|
- checker, device);
|
|
- return EXIT_SUCCESS;
|
|
- } else
|
|
- log_warning("%s cannot be used for %s: %m",
|
|
- checker, device);
|
|
+ _cleanup_free_ char *p = NULL, *d = NULL;
|
|
+ const char *checker = strappenda("fsck.", type);
|
|
+ r = find_binary(checker, &p);
|
|
+ if (r == -ENOENT) {
|
|
+ log_info("fsck.%s doesn't exist, not checking file system on %s",
|
|
+ type, device);
|
|
+ return EXIT_SUCCESS;
|
|
+ } else if (r < 0) {
|
|
+ log_warning("fsck.%s cannot be used for %s: %m",
|
|
+ type, device);
|
|
+ return r;
|
|
+ }
|
|
+
|
|
+ /* An fsck that is linked to /bin/true is a non-existant fsck */
|
|
+ r = readlink_malloc(p, &d);
|
|
+ if (r >= 0 &&
|
|
+ (path_equal(d, "/bin/true") ||
|
|
+ path_equal(d, "/usr/bin/true") ||
|
|
+ path_equal(d, "/dev/null"))) {
|
|
+ log_info("fsck.%s doesn't exist, not checking file system on %s",
|
|
+ type, device);
|
|
+ return EXIT_SUCCESS;
|
|
}
|
|
}
|
|
|
|
--- src/shared/path-util.c
|
|
+++ src/shared/path-util.c 2014-06-26 09:14:15.651559638 +0000
|
|
@@ -425,19 +425,21 @@ int path_is_os_tree(const char *path) {
|
|
|
|
int find_binary(const char *name, char **filename) {
|
|
assert(name);
|
|
- assert(filename);
|
|
|
|
- if (strchr(name, '/')) {
|
|
- char *p;
|
|
+ if (is_path(name)) {
|
|
+ if (access(name, X_OK) < 0)
|
|
+ return -errno;
|
|
+
|
|
+ if (filename) {
|
|
+ char *p;
|
|
|
|
- if (path_is_absolute(name))
|
|
- p = strdup(name);
|
|
- else
|
|
p = path_make_absolute_cwd(name);
|
|
- if (!p)
|
|
- return -ENOMEM;
|
|
+ if (!p)
|
|
+ return -ENOMEM;
|
|
+
|
|
+ *filename = p;
|
|
+ }
|
|
|
|
- *filename = p;
|
|
return 0;
|
|
} else {
|
|
const char *path;
|
|
@@ -463,8 +465,10 @@ int find_binary(const char *name, char *
|
|
continue;
|
|
}
|
|
|
|
- path_kill_slashes(p);
|
|
- *filename = p;
|
|
+ if (filename) {
|
|
+ path_kill_slashes(p);
|
|
+ *filename = p;
|
|
+ }
|
|
|
|
return 0;
|
|
}
|