[systemd-devel] [PATCH] detect-virt: do not return exit failure code when the state is none

2018-05-23 Thread Lee, Chun-Yi
Currently the systemd-detect-virt returns exit failure code when it
detected none state. But actually the none state is still a valid
state but not a process failed.

This patch changes the logic to return success code when the state
is none. It can avoid that subsequent activity is blocked by the
failure code of systemd-detect-virt process.

For example:
 # Hotplug physical memory
 SUBSYSTEM=="memory", ACTION=="add", PROGRAM="/usr/bin/systemd-detect-virt", \
 RESULT!="zvm", ATTR{state}=="offline", ATTR{state}="online_movable", \
 TAG+="tmpfs"

In the above rule, the ATTR{state} can not be set to "online_movable"
when the systemd-detect-virt returns exit failure on a phyical
environment.

Cc: Michal Hocko <mho...@suse.com> 
Cc: Franck Bui <f...@suse.com> 
Cc: GM Chen <guomin.c...@suse.com>
Signed-off-by: "Lee, Chun-Yi" <j...@suse.com>
---
 src/detect-virt/detect-virt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/detect-virt/detect-virt.c b/src/detect-virt/detect-virt.c
index 197e526b0..71f0d1817 100644
--- a/src/detect-virt/detect-virt.c
+++ b/src/detect-virt/detect-virt.c
@@ -178,5 +178,5 @@ int main(int argc, char *argv[]) {
 if (!arg_quiet)
 puts(virtualization_to_string(r));
 
-return r != VIRTUALIZATION_NONE ? EXIT_SUCCESS : EXIT_FAILURE;
+return EXIT_SUCCESS;
 }
-- 
2.12.3

___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] [PATCH] systemd: mount the EFI variable filesystem

2012-10-26 Thread Lee, Chun-Yi
Add efivarfs to the mount_table in mount-setup.c, so the EFI variable
filesystem will be mounted when systemd executed.

The EFI variable filesystem will merge in v3.7 or v3.8 linux kernel.

Cc: Kay Sievers k...@vrfy.org
Cc: Lennart Poettering lenn...@poettering.net
Cc: Mantas Mikulėnas graw...@gmail.com
Cc: Zbigniew Jędrzejewski-Szmek zbys...@in.waw.pl
Cc: Matt Fleming matt.flem...@intel.com
Cc: Jeremy Kerr jeremy.k...@canonical.com
Cc: Matthew Garrett m...@redhat.com
Signed-off-by: Lee, Chun-Yi j...@suse.com
---
 src/core/kmod-setup.c  |1 +
 src/core/mount-setup.c |1 +
 2 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/src/core/kmod-setup.c b/src/core/kmod-setup.c
index cc2a2d9..14a4778 100644
--- a/src/core/kmod-setup.c
+++ b/src/core/kmod-setup.c
@@ -33,6 +33,7 @@
 static const char * const kmod_table[] = {
 autofs4, /sys/class/misc/autofs,
 ipv6,/sys/module/ipv6,
+   efivarfs, /sys/firmware/efi/efivars,
 unix,/proc/net/unix
 };
 
diff --git a/src/core/mount-setup.c b/src/core/mount-setup.c
index 0fd112f..8ce4ddc 100644
--- a/src/core/mount-setup.c
+++ b/src/core/mount-setup.c
@@ -66,6 +66,7 @@ static const MountPoint mount_table[] = {
 { sysfs,/sys,   sysfs,NULL,  
  MS_NOSUID|MS_NOEXEC|MS_NODEV,true,  true  },
 { devtmpfs, /dev,   devtmpfs, mode=755,
  MS_NOSUID|MS_STRICTATIME,true,  true  },
 { securityfs, /sys/kernel/security, securityfs, NULL,
  MS_NOSUID|MS_NOEXEC|MS_NODEV,false, false },
+   { efivarfs, /sys/firmware/efi/efivars, efivarfs, NULL,
 MS_NOSUID|MS_NOEXEC|MS_NODEV,false, false },
 { tmpfs,/dev/shm,   tmpfs,mode=1777,   
  MS_NOSUID|MS_NODEV|MS_STRICTATIME,   true,  true  },
 { devpts,   /dev/pts,   devpts,   mode=620,gid= 
STRINGIFY(TTY_GID), MS_NOSUID|MS_NOEXEC,  false, true  },
 { tmpfs,/run,   tmpfs,mode=755,
  MS_NOSUID|MS_NODEV|MS_STRICTATIME,   true,  true  },
-- 
1.6.0.2

___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] [PATCH] systemd: mount the EFI variable filesystem

2012-10-25 Thread Lee, Chun-Yi
Add efivarfs to the mount_table in mount-setup.c, so the EFI variable
filesystem will be mounted when systemd executed.

The EFI variable filesystem will merge in v3.7 or v3.8 linux kernel.

Cc: Kay Sievers k...@vrfy.org
Cc: Lennart Poettering lenn...@poettering.net
Cc: Mantas Mikulėnas graw...@gmail.com
Cc: Zbigniew Jędrzejewski-Szmek zbys...@in.waw.pl
Cc: Matt Fleming matt.flem...@intel.com
Cc: Jeremy Kerr jeremy.k...@canonical.com
Cc: Matthew Garrett m...@redhat.com
Signed-off-by: Lee, Chun-Yi j...@suse.com
---
 src/core/kmod-setup.c  |1 +
 src/core/mount-setup.c |1 +
 2 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/src/core/kmod-setup.c b/src/core/kmod-setup.c
index cc2a2d9..14a4778 100644
--- a/src/core/kmod-setup.c
+++ b/src/core/kmod-setup.c
@@ -33,6 +33,7 @@
 static const char * const kmod_table[] = {
 autofs4, /sys/class/misc/autofs,
 ipv6,/sys/module/ipv6,
+   efivarfs, /sys/firmware/efi/efivars,
 unix,/proc/net/unix
 };
 
diff --git a/src/core/mount-setup.c b/src/core/mount-setup.c
index 0fd112f..8ce4ddc 100644
--- a/src/core/mount-setup.c
+++ b/src/core/mount-setup.c
@@ -66,6 +66,7 @@ static const MountPoint mount_table[] = {
 { sysfs,/sys,   sysfs,NULL,  
  MS_NOSUID|MS_NOEXEC|MS_NODEV,true,  true  },
 { devtmpfs, /dev,   devtmpfs, mode=755,
  MS_NOSUID|MS_STRICTATIME,true,  true  },
 { securityfs, /sys/kernel/security, securityfs, NULL,
  MS_NOSUID|MS_NOEXEC|MS_NODEV,false, false },
+   { efivarfs, /sys/firmware/efi/efivars, efivarfs, NULL,
 MS_NOSUID|MS_NOEXEC|MS_NODEV,false, false },
 { tmpfs,/dev/shm,   tmpfs,mode=1777,   
  MS_NOSUID|MS_NODEV|MS_STRICTATIME,   true,  true  },
 { devpts,   /dev/pts,   devpts,   mode=620,gid= 
STRINGIFY(TTY_GID), MS_NOSUID|MS_NOEXEC,  false, true  },
 { tmpfs,/run,   tmpfs,mode=755,
  MS_NOSUID|MS_NODEV|MS_STRICTATIME,   true,  true  },
-- 
1.6.0.2

___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] [PATCH] systemd: mount the EFI variable filesystem

2012-10-25 Thread Lee, Chun-Yi
Add efivarfs to the mount_table in mount-setup.c, so the EFI variable
filesystem will be mounted when systemd executed.

The EFI variable filesystem will merge in v3.7 or v3.8 linux kernel.

Cc: Kay Sievers k...@vrfy.org
Cc: Lennart Poettering lenn...@poettering.net
Cc: Mantas Mikulėnas graw...@gmail.com
Cc: Zbigniew Jędrzejewski-Szmek zbys...@in.waw.pl
Cc: Matt Fleming matt.flem...@intel.com
Cc: Jeremy Kerr jeremy.k...@canonical.com
Cc: Matthew Garrett m...@redhat.com
Signed-off-by: Lee, Chun-Yi j...@suse.com
---
 src/core/kmod-setup.c  |1 +
 src/core/mount-setup.c |1 +
 2 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/src/core/kmod-setup.c b/src/core/kmod-setup.c
index cc2a2d9..14a4778 100644
--- a/src/core/kmod-setup.c
+++ b/src/core/kmod-setup.c
@@ -33,6 +33,7 @@
 static const char * const kmod_table[] = {
 autofs4, /sys/class/misc/autofs,
 ipv6,/sys/module/ipv6,
+   efivarfs, /sys/firmware/efi/efivars,
 unix,/proc/net/unix
 };
 
diff --git a/src/core/mount-setup.c b/src/core/mount-setup.c
index 0fd112f..8ce4ddc 100644
--- a/src/core/mount-setup.c
+++ b/src/core/mount-setup.c
@@ -66,6 +66,7 @@ static const MountPoint mount_table[] = {
 { sysfs,/sys,   sysfs,NULL,  
  MS_NOSUID|MS_NOEXEC|MS_NODEV,true,  true  },
 { devtmpfs, /dev,   devtmpfs, mode=755,
  MS_NOSUID|MS_STRICTATIME,true,  true  },
 { securityfs, /sys/kernel/security, securityfs, NULL,
  MS_NOSUID|MS_NOEXEC|MS_NODEV,false, false },
+   { efivarfs, /sys/firmware/efi/efivars, efivarfs, NULL,
 MS_NOSUID|MS_NOEXEC|MS_NODEV,false, false },
 { tmpfs,/dev/shm,   tmpfs,mode=1777,   
  MS_NOSUID|MS_NODEV|MS_STRICTATIME,   true,  true  },
 { devpts,   /dev/pts,   devpts,   mode=620,gid= 
STRINGIFY(TTY_GID), MS_NOSUID|MS_NOEXEC,  false, true  },
 { tmpfs,/run,   tmpfs,mode=755,
  MS_NOSUID|MS_NODEV|MS_STRICTATIME,   true,  true  },
-- 
1.6.0.2

___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] [PATCH] Add syste-firmware-efi-efivars.mount for support automount EFI variable filesystem

2012-10-24 Thread Lee, Chun-Yi
Add units/sys-firmware-efi-efivars.mount rule for support automount EFI 
variable filesystem

Cc: Kay Sievers k...@vrfy.org
Cc: Lennart Poettering lenn...@poettering.net
Cc: Matt Fleming matt.flem...@intel.com
Cc: Jeremy Kerr jeremy.k...@canonical.com
Cc: Matthew Garrett m...@redhat.com
Signed-off-by: Lee, Chun-Yi j...@suse.com
---
 units/sys-firmware-efi-efivars.mount |   17 +
 1 files changed, 17 insertions(+), 0 deletions(-)
 create mode 100644 units/sys-firmware-efi-efivars.mount

diff --git a/units/sys-firmware-efi-efivars.mount 
b/units/sys-firmware-efi-efivars.mount
new file mode 100644
index 000..641d771
--- /dev/null
+++ b/units/sys-firmware-efi-efivars.mount
@@ -0,0 +1,17 @@
+#  This file is part of systemd.
+#
+#  systemd is free software; you can redistribute it and/or modify it
+#  under the terms of the GNU General Public License as published by
+#  the Free Software Foundation; either version 2 of the License, or
+#  (at your option) any later version.
+
+[Unit]
+Description=EFI Variables File System
+DefaultDependencies=no
+ConditionPathExists=/sys/firmware/efi/efivars
+Before=sysinit.target
+
+[Mount]
+What=efivarfs
+Where=/sys/firmware/efi/efivars
+Type=efivarfs
-- 
1.6.0.2

___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel