diff --git a/0010-check-yajl-only-when-have-isulad.patch b/0010-check-yajl-only-when-have-isulad.patch new file mode 100644 index 0000000000000000000000000000000000000000..e4ea3c1b4d729db4c1b99deff3f814c84756499c --- /dev/null +++ b/0010-check-yajl-only-when-have-isulad.patch @@ -0,0 +1,70 @@ +From d4cb8f6a8f46a3f5d72f22d7f79df83ad82215e0 Mon Sep 17 00:00:00 2001 +From: zhangxiaoyu +Date: Mon, 25 Jul 2022 16:42:03 +0800 +Subject: [PATCH] check yajl only when have isulad + +Signed-off-by: zhangxiaoyu +--- + configure.ac | 6 +++--- + src/lxc/Makefile.am | 7 +++++-- + src/lxc/af_unix.c | 2 +- + 3 files changed, 9 insertions(+), 6 deletions(-) + +diff --git a/configure.ac b/configure.ac +index ce8854e..2180586 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -120,9 +120,6 @@ AM_CONDITIONAL([DISTRO_UBUNTU], [test "x$with_distro" = "xubuntu"]) + + AC_CONFIG_LINKS([config/etc/default.conf:config/etc/${distroconf}]) + +-# Check yajl +-PKG_CHECK_MODULES([YAJL], [yajl >= 2],[],[AC_MSG_ERROR([You must install yajl >= 2])]) +- + # Check for init system type + AC_MSG_CHECKING([for init system type]) + AC_ARG_WITH([init-script], +@@ -839,6 +836,9 @@ AM_CONDITIONAL([HAVE_ISULAD], [test "x$adapt_isulad" = "xyes"]) + if test "x$adapt_isulad" = "xyes"; then + AC_DEFINE([HAVE_ISULAD], 1, [adapt to iSulad]) + AC_MSG_RESULT([yes]) ++ ++ # Check yajl ++ PKG_CHECK_MODULES([YAJL], [yajl >= 2],[],[AC_MSG_ERROR([You must install yajl >= 2])]) + else + AC_MSG_RESULT([no]) + fi +diff --git a/src/lxc/Makefile.am b/src/lxc/Makefile.am +index b9a8750..61a229f 100644 +--- a/src/lxc/Makefile.am ++++ b/src/lxc/Makefile.am +@@ -360,8 +360,11 @@ LDADD = liblxc.la \ + @OPENSSL_LIBS@ \ + @SECCOMP_LIBS@ \ + @SELINUX_LIBS@ \ +- @DLOG_LIBS@ \ +- @YAJL_LIBS@ ++ @DLOG_LIBS@ ++ ++if HAVE_ISULAD ++ LDADD += @YAJL_LIBS@ ++endif + + if ENABLE_TOOLS + lxc_attach_SOURCES = tools/lxc_attach.c \ +diff --git a/src/lxc/af_unix.c b/src/lxc/af_unix.c +index cb4233e..0be9368 100644 +--- a/src/lxc/af_unix.c ++++ b/src/lxc/af_unix.c +@@ -382,7 +382,7 @@ int lxc_unix_connect_type(struct sockaddr_un *addr, int type) + offsetof(struct sockaddr_un, sun_path) + len); + if (ret < 0) + #ifdef HAVE_ISULAD +- return log_error_errno(-1, errno, ++ return log_warn_errno(-1, errno, + "Failed to connect new AF_UNIX socket"); + #else + return log_error_errno(-1, errno, +-- +2.25.1 + diff --git a/lxc.spec b/lxc.spec index 5dc52b687d5729a9ab0767b3fba51c2b3d8d5daf..c3717829f1ce85a3b9917773b5e811dc7cffc324 100644 --- a/lxc.spec +++ b/lxc.spec @@ -1,4 +1,4 @@ -%global _release 2022072501 +%global _release 2022072502 Name: lxc Version: 4.0.3 @@ -17,6 +17,7 @@ Patch0006: 0006-refactor-patch-about-namespace-log-terminal.patch Patch0007: 0007-refactor-patches-on-terminal.c-start.c-and-so-on.patch Patch0008: 0008-refactor-patch-code-of-json.patch Patch0009: 0009-fix-HOME-env-of-container-unset-error.patch +Patch0010: 0010-check-yajl-only-when-have-isulad.patch BuildRequires: systemd-units git libtool graphviz docbook2X doxygen chrpath BuildRequires: pkgconfig(libseccomp) @@ -188,6 +189,12 @@ make check %{_mandir}/*/man7/%{name}* %changelog +* Mon Jul 25 2022 zhangxiaoyu - 4.0.3-2022072502 +- Type:bugfix +- ID:NA +- SUG:NA +- DESC: check yajl only when have isulad + * Mon Jul 25 2022 haozi007 - 4.0.3-2022072501 - Type:bugfix - ID:NA @@ -236,7 +243,7 @@ make check - SUG:NA - DESC: refactor patch code of lxccontainer and so on -* Thu Jul 19 2022 haozi007 - 4.0.3-2022071901 +* Tue Jul 19 2022 haozi007 - 4.0.3-2022071901 - Type:bugfix - ID:NA - SUG:NA diff --git a/series.conf b/series.conf index 2416293553ec785cf4ebb14fcdbf6bfb818a192e..530ec3679bf8465968dd428bb80660e5075858d7 100644 --- a/series.conf +++ b/series.conf @@ -7,3 +7,4 @@ 0007-refactor-patches-on-terminal.c-start.c-and-so-on.patch 0008-refactor-patch-code-of-json.patch 0009-fix-HOME-env-of-container-unset-error.patch +0010-check-yajl-only-when-have-isulad.patch