From 9476ddba6073a4ba85472bc0c382a0acfc1f47af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Sun, 15 Oct 2017 19:47:16 +0200 Subject: [PATCH 1/5] meson: drop unneeded check for grep --- meson.build | 1 - 1 file changed, 1 deletion(-) diff --git a/meson.build b/meson.build index f7a610af3b..e84bcf2696 100644 --- a/meson.build +++ b/meson.build @@ -462,7 +462,6 @@ endif ##################################################################### sed = find_program('sed') -grep = find_program('grep') awk = find_program('awk') m4 = find_program('m4') stat = find_program('stat') From 545a30a9a921018a2b59cd92f78a6b287defc8cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Sun, 15 Oct 2017 21:24:32 +0200 Subject: [PATCH 2/5] logind: drop unnecessary braces --- src/login/logind-user.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/login/logind-user.c b/src/login/logind-user.c index dcf367e22d..a90db3b33c 100644 --- a/src/login/logind-user.c +++ b/src/login/logind-user.c @@ -425,12 +425,11 @@ static int user_start_service(User *u) { u->service, &error, &job); - if (r < 0) { + if (r < 0) /* we don't fail due to this, let's try to continue */ log_error_errno(r, "Failed to start user service, ignoring: %s", bus_error_message(&error, r)); - } else { + else u->service_job = job; - } return 0; } From c47f86e660176a1149f3afc5e2eb12ea3bcbb6d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Sun, 15 Oct 2017 23:00:54 +0200 Subject: [PATCH 3/5] util-lib: simplify kexec_loaded() --- src/basic/util.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/basic/util.c b/src/basic/util.c index 687de40993..37fbfbf97f 100644 --- a/src/basic/util.c +++ b/src/basic/util.c @@ -177,15 +177,12 @@ int block_get_whole_disk(dev_t d, dev_t *ret) { } bool kexec_loaded(void) { - bool loaded = false; - char *s; + _cleanup_free_ char *s = NULL; - if (read_one_line_file("/sys/kernel/kexec_loaded", &s) >= 0) { - if (s[0] == '1') - loaded = true; - free(s); - } - return loaded; + if (read_one_line_file("/sys/kernel/kexec_loaded", &s) < 0) + return false; + + return s[0] == '1'; } int prot_from_flags(int flags) { From 551072321e2beb97e2fb6a195c40bdc7612cbb51 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Wed, 18 Oct 2017 09:39:30 +0200 Subject: [PATCH 4/5] man: recommend using /var/lib/machines in systemd-nspawn(1) Also update the instruction to latest Fedora version. --- man/systemd-nspawn.xml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/man/systemd-nspawn.xml b/man/systemd-nspawn.xml index 3951e32e8f..b741a1fff9 100644 --- a/man/systemd-nspawn.xml +++ b/man/systemd-nspawn.xml @@ -1075,14 +1075,17 @@ Build and boot a minimal Fedora distribution in a container - # dnf -y --releasever=25 --installroot=/srv/mycontainer \ + # dnf -y --releasever=27 --installroot=/var/lib/machines/f27container \ --disablerepo='*' --enablerepo=fedora --enablerepo=updates install \ systemd passwd dnf fedora-release vim-minimal -# systemd-nspawn -bD /srv/mycontainer +# systemd-nspawn -bD /var/lib/machines/f27container This installs a minimal Fedora distribution into the - directory /srv/mycontainer/ - and then boots an OS in a namespace container in it. + directory /var/lib/machines/f27container + and then boots an OS in a namespace container in it. Because the installation + is located underneath the standard /var/lib/machines/ + directory, it is also possible to start the machine using + systemd-nspawn -M f27container. From 78344935fd21e1eedac962f305efc76ac69b5b19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Wed, 18 Oct 2017 17:31:51 +0200 Subject: [PATCH 5/5] rfkill: include the device name in error message --- src/rfkill/rfkill.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/rfkill/rfkill.c b/src/rfkill/rfkill.c index 3aa468f40b..c14b5ea3ee 100644 --- a/src/rfkill/rfkill.c +++ b/src/rfkill/rfkill.c @@ -88,7 +88,8 @@ static int find_device( device = udev_device_new_from_subsystem_sysname(udev, "rfkill", sysname); if (!device) - return log_full_errno(errno == ENOENT ? LOG_DEBUG : LOG_ERR, errno, "Failed to open device: %m"); + return log_full_errno(errno == ENOENT ? LOG_DEBUG : LOG_ERR, errno, + "Failed to open device %s: %m", sysname); name = udev_device_get_sysattr_value(device, "name"); if (!name) { @@ -146,7 +147,8 @@ static int wait_for_initialized( /* Check again, maybe things changed */ d = udev_device_new_from_subsystem_sysname(udev, "rfkill", sysname); if (!d) - return log_full_errno(errno == ENOENT ? LOG_DEBUG : LOG_ERR, errno, "Failed to open device: %m"); + return log_full_errno(errno == ENOENT ? LOG_DEBUG : LOG_ERR, errno, + "Failed to open device %s: %m", sysname); if (udev_device_get_is_initialized(d) != 0) { *ret = d;