[lxc-devel] [lxcfs/master] Dev

wlm86 on Github lxc-bot at linuxcontainers.org
Wed Jan 8 02:12:01 UTC 2020


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 359 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20200107/5ab55032/attachment.bin>
-------------- next part --------------
From bbf993985de952d29e1e476067e35c59bd03b28a Mon Sep 17 00:00:00 2001
From: LiMing Wu <19092205 at suning.com>
Date: Tue, 7 Jan 2020 18:01:03 +0800
Subject: [PATCH 1/2] Add compile method to README

Signed-off-by: LiMing Wu <19092205 at suning.com>
---
 README.md | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/README.md b/README.md
index d4ece85..e2b92ee 100644
--- a/README.md
+++ b/README.md
@@ -28,6 +28,17 @@ only had access to cgroups underneath it's own cgroups and thus provided
 additional safety. For systems without support for cgroup namespaces `LXCFS`
 will still provide this feature.
 
+## Building
+Build lxcfs as follows:
+
+    yum install fuse fuse-lib fuse-devel
+    git clone git://github.com/lxc/lxcfs
+    cd lxcfs
+    ./bootstrap.sh
+    ./configure
+    make
+    make install
+
 ## Usage
 The recommended command to run lxcfs is:
 

From 23b42f470f707e5f082efa8af7b00ee780d7b8f0 Mon Sep 17 00:00:00 2001
From: LiMing Wu <19092205 at suning.com>
Date: Wed, 8 Jan 2020 08:59:51 +0800
Subject: [PATCH 2/2] Enhance version option

Signed-off-by: LiMing Wu <19092205 at suning.com>
---
 lxcfs.c | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/lxcfs.c b/lxcfs.c
index ee94b75..1ee3845 100644
--- a/lxcfs.c
+++ b/lxcfs.c
@@ -969,6 +969,7 @@ static void usage()
 	fprintf(stderr, "  -u no swap \n");
 	fprintf(stderr, "  Default pidfile is %s/lxcfs.pid\n", RUNTIME_PATH);
 	fprintf(stderr, "lxcfs -h\n");
+	fprintf(stderr, "lxcfs -v\n");
 	exit(1);
 }
 
@@ -982,6 +983,16 @@ static bool is_help(char *w)
 	return false;
 }
 
+static bool is_version(char *w)
+{
+	if (strcmp(w, "-v") == 0 ||
+			strcmp(w, "--version") == 0 ||
+			strcmp(w, "-version") == 0 ||
+			strcmp(w, "version") == 0)
+		return true;
+	return false;
+}
+
 bool swallow_arg(int *argcp, char *argv[], char *which)
 {
 	int i;
@@ -1113,10 +1124,11 @@ int main(int argc, char *argv[])
 	if (swallow_option(&argc, argv, "-p", &v))
 		pidfile = v;
 
-	if (argc == 2  && strcmp(argv[1], "--version") == 0) {
+	if (argc == 2  && is_version(argv[1])) {
 		fprintf(stderr, "%s\n", VERSION);
 		exit(EXIT_SUCCESS);
 	}
+
 	if (argc != 2 || is_help(argv[1]))
 		usage();
 


More information about the lxc-devel mailing list