summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBruce Ashfield <bruce.ashfield@gmail.com>2022-08-12 10:41:29 -0400
committerBruce Ashfield <bruce.ashfield@gmail.com>2022-08-25 22:55:48 -0400
commit05f316f70a4d2edb0ec63299bbd5de21fe0038cb (patch)
tree84bcc2152393c3b0d9215051876356f230cfaa23
parent538e94e674dc1be0b0fee5da54083ca040b2f7b9 (diff)
downloadmeta-virtualization-05f316f70a4d2edb0ec63299bbd5de21fe0038cb.tar.gz
lxc: update to 5.x and meson
This is a significant update to lxc as autotools has been replaced with meson. Not all existing autotools options have meson equivalents, so there may be differences in functionallity. As part of this update, and unused features have been dropped, mainly when the meson equivalent was not available. Basic / core functionality has been tested with systemd, sysvinit requires more work, and patches will be accepted to restore that capability. Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
-rw-r--r--recipes-containers/lxc/README23
-rw-r--r--recipes-containers/lxc/files/0001-download-don-t-try-compatbility-index.patch43
-rw-r--r--recipes-containers/lxc/files/logs-optionally-use-base-filenames-to-report-src-fil.patch69
-rw-r--r--recipes-containers/lxc/files/lxc-doc-upgrade-to-use-docbook-3.1-DTD.patch29
-rw-r--r--recipes-containers/lxc/files/lxc-fix-B-S.patch25
-rw-r--r--recipes-containers/lxc/files/templates-use-curl-instead-of-wget.patch38
-rw-r--r--recipes-containers/lxc/lxc_git.bb73
7 files changed, 127 insertions, 173 deletions
diff --git a/recipes-containers/lxc/README b/recipes-containers/lxc/README
new file mode 100644
index 00000000..e6e3f1af
--- /dev/null
+++ b/recipes-containers/lxc/README
@@ -0,0 +1,23 @@
1install:
2--------
3
4 Install the following packages to your image:
5
6 IMAGE_INSTALL:append = "lxc lxc-networking kernel-modules"
7
8 These will put the core lxc application and networking onto your image.
9 No other configuration is required for a basic system.
10
11 Note: has only been tested with systemd, sysvinit patches are welcome
12
13 Note: Partially conflicts with packages such as k3s, networking will fail to
14 start.
15
16sample test:
17-----------
18
19 % lxc-create -n test -t download -- --server us.lxd.images.canonical.com -d alpine -r 3.16 -a amd64
20 % lxc-start test
21 % lxc-console test
22
23
diff --git a/recipes-containers/lxc/files/0001-download-don-t-try-compatbility-index.patch b/recipes-containers/lxc/files/0001-download-don-t-try-compatbility-index.patch
new file mode 100644
index 00000000..fee3b61a
--- /dev/null
+++ b/recipes-containers/lxc/files/0001-download-don-t-try-compatbility-index.patch
@@ -0,0 +1,43 @@
1From d69c856f90c752637b33e59fbbcfa31f619e2285 Mon Sep 17 00:00:00 2001
2From: Bruce Ashfield <bruce.ashfield@gmail.com>
3Date: Sun, 14 Aug 2022 22:44:24 -0400
4Subject: [PATCH] download: don't try compatbility index
5
6This is being mistaken for a valid, non compat index .. and we never
7try for the one that exists (the index without a compatibility
8extension). So we just drop the compat try for now.
9
10Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
11---
12 templates/lxc-download.in | 8 ++------
13 1 file changed, 2 insertions(+), 6 deletions(-)
14
15diff --git a/templates/lxc-download.in b/templates/lxc-download.in
16index 9a3290fbc..216e4dda7 100755
17--- a/templates/lxc-download.in
18+++ b/templates/lxc-download.in
19@@ -234,9 +234,7 @@ if [ "${DOWNLOAD_LIST_IMAGES}" = "true" ] || [ "${DOWNLOAD_INTERACTIVE}" = "true
20 DOWNLOAD_INDEX_PATH="/meta/1.0/index-${DOWNLOAD_MODE}"
21
22 echo "Downloading the image index"
23- if ! download_file "${DOWNLOAD_INDEX_PATH}.${DOWNLOAD_COMPAT_LEVEL}" "${DOWNLOAD_TEMP}/index" noexit; then
24- download_file "${DOWNLOAD_INDEX_PATH}" "${DOWNLOAD_TEMP}/index" normal
25- fi
26+ download_file "${DOWNLOAD_INDEX_PATH}" "${DOWNLOAD_TEMP}/index" normal
27
28 # Parse it
29 echo ""
30@@ -316,9 +314,7 @@ if [ "${DOWNLOAD_USE_CACHE}" = "false" ]; then
31 DOWNLOAD_INDEX_PATH="/meta/1.0/index-${DOWNLOAD_MODE}"
32
33 echo "Downloading the image index"
34- if ! download_file "${DOWNLOAD_INDEX_PATH}.${DOWNLOAD_COMPAT_LEVEL}" "${DOWNLOAD_TEMP}/index" noexit; then
35- download_file "${DOWNLOAD_INDEX_PATH}" "${DOWNLOAD_TEMP}/index" normal
36- fi
37+ download_file "${DOWNLOAD_INDEX_PATH}" "${DOWNLOAD_TEMP}/index" normal
38
39 # Parse it
40 while IFS=';' read -r f1 f2 f3 f4 f5 f6; do
41--
422.25.1
43
diff --git a/recipes-containers/lxc/files/logs-optionally-use-base-filenames-to-report-src-fil.patch b/recipes-containers/lxc/files/logs-optionally-use-base-filenames-to-report-src-fil.patch
deleted file mode 100644
index a8c76bc8..00000000
--- a/recipes-containers/lxc/files/logs-optionally-use-base-filenames-to-report-src-fil.patch
+++ /dev/null
@@ -1,69 +0,0 @@
1From 0cfa202f5d96a35692f063f35bf4706f310b17e4 Mon Sep 17 00:00:00 2001
2From: Jim Somerville <Jim.Somerville@windriver.com>
3Date: Fri, 25 Sep 2015 15:08:17 -0400
4Subject: [PATCH] logs: optionally use base filenames to report src files
5
6Message-Id: <4729d0f4c4d1dacd150ddfd7061dda875eb94e34.1443216870.git.Jim.Somerville@windriver.com>
7
8Problem: Logs are nice in that they report the source file,
9routine, and line number where an issue occurs. But the
10file is printed as the absolute filename. Users do not
11need to see a long spew of path directory names where the package
12was built. It just confuses things.
13
14Solution: Optionally chop off all leading directories so that just
15the source filename ie. basename is printed. This is done by
16setting a #ifdef LXC_LOG_USE_BASENAME check in the code. That
17define is done via the optional --enable-log-src-basename provided
18at configure time.
19
20Using __BASE_FILE__ instead of __FILE__ did not work. It
21refers to the file name as presented to the compile
22machinery, and that may still be the absolute pathname to
23the file.
24
25Signed-off-by: Jim Somerville <Jim.Somerville@windriver.com>
26
27---
28 configure.ac | 9 +++++++++
29 src/lxc/log.h | 5 +++++
30 2 files changed, 14 insertions(+)
31
32diff --git a/configure.ac b/configure.ac
33index a3272e9..a2d4c29 100644
34--- a/configure.ac
35+++ b/configure.ac
36@@ -378,6 +378,15 @@ AC_ARG_ENABLE([examples],
37 [enable_examples=$enableval], [enable_examples=yes])
38 AM_CONDITIONAL([ENABLE_EXAMPLES], [test "x$enable_examples" = "xyes"])
39
40+# Enable basenames in the logs for source files
41+AC_ARG_ENABLE([log-src-basename],
42+ [AC_HELP_STRING([--enable-log-src-basename], [Use the shorter source file basename in the logs [default=no]])],
43+ [], [enable_log_src_basename=no])
44+
45+if test "x$enable_log_src_basename" = "xyes"; then
46+ AC_DEFINE([LXC_LOG_USE_BASENAME], 1, [Enabling shorter src filenames in the logs])
47+fi
48+
49 # Enable dumping stack traces
50 AC_ARG_ENABLE([mutex-debugging],
51 [AS_HELP_STRING([--enable-mutex-debugging], [Makes mutexes to report error and provide stack trace [default=no]])],
52diff --git a/src/lxc/log.h b/src/lxc/log.h
53index d280656..62cbf4f 100644
54--- a/src/lxc/log.h
55+++ b/src/lxc/log.h
56@@ -47,8 +47,13 @@ struct lxc_log_locinfo {
57 int line;
58 };
59
60+#ifdef LXC_LOG_USE_BASENAME
61+#define LXC_LOG_LOCINFO_INIT \
62+ { .file = (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__), .func = __func__, .line = __LINE__ }
63+#else
64 #define LXC_LOG_LOCINFO_INIT \
65 { .file = __FILE__, .func = __func__, .line = __LINE__ }
66+#endif
67
68 /* brief logging event object */
69 struct lxc_log_event {
diff --git a/recipes-containers/lxc/files/lxc-doc-upgrade-to-use-docbook-3.1-DTD.patch b/recipes-containers/lxc/files/lxc-doc-upgrade-to-use-docbook-3.1-DTD.patch
deleted file mode 100644
index be5dddf1..00000000
--- a/recipes-containers/lxc/files/lxc-doc-upgrade-to-use-docbook-3.1-DTD.patch
+++ /dev/null
@@ -1,29 +0,0 @@
1From 85d1e77acbfde2aa1045cfda877a91a9e57c405d Mon Sep 17 00:00:00 2001
2From: Jim Somerville <Jim.Somerville@windriver.com>
3Date: Tue, 11 Aug 2015 14:05:00 -0400
4Subject: [PATCH] lxc: doc: upgrade to use docbook 3.1 DTD
5
6docbook2man fails to build the man pages in poky
7due to missing the ancient Davenport 3.0 DTD.
8Poky meta has the Oasis 3.1 version so upgrade
9to use that instead.
10
11Signed-off-by: Jim Somerville <Jim.Somerville@windriver.com>
12
13---
14 configure.ac | 2 +-
15 1 file changed, 1 insertion(+), 1 deletion(-)
16
17diff --git a/configure.ac b/configure.ac
18index 90a4bd4..a3272e9 100644
19--- a/configure.ac
20+++ b/configure.ac
21@@ -227,7 +227,7 @@ AM_CONDITIONAL([ENABLE_DOCBOOK], [test "x$db2xman" != "x"])
22 AM_CONDITIONAL([USE_DOCBOOK2X], [test "x$db2xman" != "xdocbook2man"])
23
24 if test "x$db2xman" = "xdocbook2man"; then
25- docdtd="\"-//Davenport//DTD DocBook V3.0//EN\""
26+ docdtd="\"-//OASIS//DTD DocBook V3.1//EN\""
27 else
28 docdtd="\"-//OASIS//DTD DocBook XML\" \"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd\""
29 fi
diff --git a/recipes-containers/lxc/files/lxc-fix-B-S.patch b/recipes-containers/lxc/files/lxc-fix-B-S.patch
deleted file mode 100644
index 7a807b7c..00000000
--- a/recipes-containers/lxc/files/lxc-fix-B-S.patch
+++ /dev/null
@@ -1,25 +0,0 @@
1From dc2e71f060c25b94f011fce12ef59d2f5ae4e6a9 Mon Sep 17 00:00:00 2001
2From: Dmitry Eremin-Solenikov <dmitry_eremin@mentor.com>
3Date: Thu, 9 Apr 2015 23:01:48 +0300
4Subject: [PATCH] %% original patch: lxc-fix-B-S.patch
5
6---
7 config/init/upstart/Makefile.am | 4 ++--
8 1 file changed, 2 insertions(+), 2 deletions(-)
9
10diff --git a/config/init/upstart/Makefile.am b/config/init/upstart/Makefile.am
11index 5552d32..186ae3d 100644
12--- a/config/init/upstart/Makefile.am
13+++ b/config/init/upstart/Makefile.am
14@@ -3,9 +3,9 @@ EXTRA_DIST = lxc.conf lxc-instance.conf lxc-net.conf.in
15 if INIT_SCRIPT_UPSTART
16 install-upstart: lxc.conf lxc-instance.conf lxc-net.conf
17 $(MKDIR_P) $(DESTDIR)$(sysconfdir)/init/
18- $(INSTALL_DATA) lxc.conf $(DESTDIR)$(sysconfdir)/init/
19+ $(INSTALL_DATA) $(srcdir)/lxc.conf $(DESTDIR)$(sysconfdir)/init/
20 $(INSTALL_DATA) $(srcdir)/lxc-instance.conf $(DESTDIR)$(sysconfdir)/init/
21- $(INSTALL_DATA) lxc-net.conf $(DESTDIR)$(sysconfdir)/init/
22+ $(INSTALL_DATA) $(srcdir)/lxc-net.conf $(DESTDIR)$(sysconfdir)/init/
23
24 uninstall-upstart:
25 rm -f $(DESTDIR)$(sysconfdir)/init/lxc.conf
diff --git a/recipes-containers/lxc/files/templates-use-curl-instead-of-wget.patch b/recipes-containers/lxc/files/templates-use-curl-instead-of-wget.patch
index f06e5969..3c96c5e0 100644
--- a/recipes-containers/lxc/files/templates-use-curl-instead-of-wget.patch
+++ b/recipes-containers/lxc/files/templates-use-curl-instead-of-wget.patch
@@ -1,22 +1,22 @@
1From 1db2db7783bd7ec2aa1da86e640019891634c659 Mon Sep 17 00:00:00 2001 1From 3e4cb0b738649f7750413cefbcfdb2115213ad0d Mon Sep 17 00:00:00 2001
2From: Joakim Roubert <joakimr@axis.com> 2From: Bruce Ashfield <bruce.ashfield@gmail.com>
3Date: Fri, 16 Aug 2019 07:52:48 +0200 3Date: Sun, 14 Aug 2022 14:08:56 -0400
4Subject: [PATCH] Use curl instead of wget 4Subject: [PATCH] download: Use curl instead of wget
5 5
6When curl's MIT license is preferable to wget's GPLv3. 6When curl's MIT license is preferable to wget's GPLv3.
7 7
8Change-Id: I4684ae7569704514fdcc63e0655c556efcaf44f8
9Signed-off-by: Joakim Roubert <joakimr@axis.com> 8Signed-off-by: Joakim Roubert <joakimr@axis.com>
10Signed-off-by: Yanfei Xu <yanfei.xu@windriver.com> 9Signed-off-by: Yanfei Xu <yanfei.xu@windriver.com>
10Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
11--- 11---
12 templates/lxc-download.in | 10 +++++----- 12 templates/lxc-download.in | 8 ++++----
13 1 file changed, 5 insertions(+), 5 deletions(-) 13 1 file changed, 4 insertions(+), 4 deletions(-)
14 14
15Index: git/templates/lxc-download.in 15diff --git a/templates/lxc-download.in b/templates/lxc-download.in
16=================================================================== 16index a62ddf482..690307338 100755
17--- git.orig/templates/lxc-download.in 17--- a/templates/lxc-download.in
18+++ git/templates/lxc-download.in 18+++ b/templates/lxc-download.in
19@@ -59,9 +59,9 @@ 19@@ -59,9 +59,9 @@ cleanup() {
20 fi 20 fi
21 } 21 }
22 22
@@ -28,19 +28,16 @@ Index: git/templates/lxc-download.in
28 return 0 28 return 0
29 fi 29 fi
30 done 30 done
31@@ -70,8 +70,9 @@ 31@@ -70,7 +70,7 @@ wget_wrapper() {
32 } 32 }
33 33
34 download_file() { 34 download_file() {
35- if ! wget_wrapper --user-agent="lxc/@PACKAGE_VERSION@ compat:${DOWNLOAD_COMPAT_LEVEL}" -T 30 -q "https://${DOWNLOAD_SERVER}/$1" -O "$2" >/dev/null 2>&1; then 35- if ! wget_wrapper --user-agent="lxc/@PACKAGE_VERSION@ compat:${DOWNLOAD_COMPAT_LEVEL}" -T 30 -q "https://${DOWNLOAD_SERVER}/$1" -O "$2" >/dev/null 2>&1; then
36- if [ "$3" = "noexit" ]; then 36+ if ! curl_wrapper --user-agent "lxc/@PACKAGE_VERSION@ compat:${DOWNLOAD_COMPAT_LEVEL}" -m 30 -s "https://${DOWNLOAD_SERVER}/$1" -o "$2" >/dev/null 2>&1; then
37+ if ! curl_wrapper --user-agent="lxc/@PACKAGE_VERSION@ compat:${DOWNLOAD_COMPAT_LEVEL}" -m 30 -s "https://${DOWNLOAD_SERVER}/$1" -o "$2" >/dev/null 2>&1; then 37 if [ "$3" = "noexit" ]; then
38+ if ! curl_wrapper --user-agent="lxc/@PACKAGE_VERSION@ compat:${DOWNLOAD_COMPAT_LEVEL}" -m 30 -s "http://${DOWNLOAD_SERVER}/$1" -o "$2" >/dev/null 2>&1; then
39+ if [ "$3" = "noexit" ]; then
40 return 1 38 return 1
41 else 39 else
42 echo "ERROR: Failed to download https://${DOWNLOAD_SERVER}/$1" 1>&2 40@@ -176,7 +176,7 @@ while :; do
43@@ -176,7 +177,7 @@
44 done 41 done
45 42
46 # Check for required binaries 43 # Check for required binaries
@@ -49,3 +46,6 @@ Index: git/templates/lxc-download.in
49 if ! command -V "${bin}" >/dev/null 2>&1; then 46 if ! command -V "${bin}" >/dev/null 2>&1; then
50 echo "ERROR: Missing required tool: ${bin}" 1>&2 47 echo "ERROR: Missing required tool: ${bin}" 1>&2
51 exit 1 48 exit 1
49--
502.25.1
51
diff --git a/recipes-containers/lxc/lxc_git.bb b/recipes-containers/lxc/lxc_git.bb
index cecb5914..bcc17953 100644
--- a/recipes-containers/lxc/lxc_git.bb
+++ b/recipes-containers/lxc/lxc_git.bb
@@ -36,48 +36,51 @@ RDEPENDS:${PN}-ptest += "file make gmp nettle gnutls bash libgcc"
36 36
37RDEPENDS:${PN}-networking += "iptables" 37RDEPENDS:${PN}-networking += "iptables"
38 38
39SRC_URI = "git://github.com/lxc/lxc.git;branch=stable-4.0;protocol=https \ 39SRC_URI = "git://github.com/lxc/lxc.git;branch=master;protocol=https \
40 file://lxc-1.0.0-disable-udhcp-from-busybox-template.patch \ 40 file://lxc-1.0.0-disable-udhcp-from-busybox-template.patch \
41 file://run-ptest \ 41 file://run-ptest \
42 file://lxc-fix-B-S.patch \
43 file://lxc-doc-upgrade-to-use-docbook-3.1-DTD.patch \
44 file://logs-optionally-use-base-filenames-to-report-src-fil.patch \
45 file://templates-actually-create-DOWNLOAD_TEMP-directory.patch \ 42 file://templates-actually-create-DOWNLOAD_TEMP-directory.patch \
46 file://template-make-busybox-template-compatible-with-core-.patch \ 43 file://template-make-busybox-template-compatible-with-core-.patch \
47 file://templates-use-curl-instead-of-wget.patch \ 44 file://templates-use-curl-instead-of-wget.patch \
45 file://0001-download-don-t-try-compatbility-index.patch \
48 file://tests-our-init-is-not-busybox.patch \ 46 file://tests-our-init-is-not-busybox.patch \
49 file://dnsmasq.conf \ 47 file://dnsmasq.conf \
50 file://lxc-net \ 48 file://lxc-net \
51 " 49 "
52 50
53SRCREV = "5ba5725cb4a210c25707beeca64fde5f561d1c71" 51SRCREV = "133aa416ca2a5996090ec0e697e253646364d274"
54PV = "4.0.12+git${SRCPV}" 52PV = "5.0.1+git${SRCPV}"
55 53
56S = "${WORKDIR}/git" 54S = "${WORKDIR}/git"
57 55
58# Let's not configure for the host distro. 56# Let's not configure for the host distro.
59# 57#
60PTEST_CONF = "${@bb.utils.contains('DISTRO_FEATURES', 'ptest', '--enable-tests', '', d)}" 58PTEST_CONF = "${@bb.utils.contains('DISTRO_FEATURES', 'ptest', '-Dtests=true', '', d)}"
61EXTRA_OECONF += "--with-distro=${DISTRO} ${PTEST_CONF}"
62 59
63EXTRA_OECONF += "--with-init-script=\ 60# No meson equivalent for --with-distro
64${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'sysvinit,', '', d)}\ 61# EXTRA_OECONF += "--with-distro=${DISTRO} ${PTEST_CONF}"
65${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd', '', d)}" 62EXTRA_OEMESON += "${PTEST_CONF}"
66 63# No meson equivalent for these yet
67EXTRA_OECONF += "--enable-log-src-basename --disable-werror" 64# EXTRA_OECONF += "--enable-log-src-basename --disable-werror"
68 65
69PACKAGECONFIG ??= "templates \ 66PACKAGECONFIG ??= "templates \
70 ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd', '', d)} \ 67 ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd', '', d)} \
71 ${@bb.utils.contains('DISTRO_FEATURES', 'selinux', 'selinux', '', d)} \ 68 ${@bb.utils.contains('DISTRO_FEATURES', 'selinux', 'selinux', '', d)} \
72 ${@bb.utils.contains('DISTRO_FEATURES', 'seccomp', 'seccomp', '', d)} \ 69 ${@bb.utils.contains('DISTRO_FEATURES', 'seccomp', 'seccomp', '', d)} \
73" 70"
74PACKAGECONFIG[doc] = "--enable-doc --enable-api-docs,--disable-doc --disable-api-docs,," 71
75PACKAGECONFIG[rpath] = "--enable-rpath,--disable-rpath,," 72# Meson doesn't seem to be as fine grained as the autotools releases
76PACKAGECONFIG[apparmor] = "--enable-apparmor,--disable-apparmor,apparmor,apparmor" 73# PACKAGECONFIG[doc] = "--enable-doc --enable-api-docs,--disable-doc --disable-api-docs,,"
74PACKAGECONFIG[doc] = "-Dman=true,-Dman=false,,"
75# No meson equiv found for rpath yet
76# PACKAGECONFIG[rpath] = "--enable-rpath,--disable-rpath,,"
77PACKAGECONFIG[apparmor] = "-Dapparmor=true,-Dapparmor=false,apparmor,apparmor"
77PACKAGECONFIG[templates] = ",,, ${PN}-templates" 78PACKAGECONFIG[templates] = ",,, ${PN}-templates"
78PACKAGECONFIG[selinux] = "--enable-selinux,--disable-selinux,libselinux,libselinux" 79PACKAGECONFIG[selinux] = "-Dselinux=true,-Dselinux=false,libselinux,libselinux"
79PACKAGECONFIG[seccomp] ="--enable-seccomp,--disable-seccomp,libseccomp,libseccomp" 80PACKAGECONFIG[seccomp] ="-Dseccomp=true,-Dseccomp=false,libseccomp,libseccomp"
80PACKAGECONFIG[systemd] = "--with-systemdsystemunitdir=${systemd_unitdir}/system/,--without-systemdsystemunitdir,systemd," 81# meson equiv for the unitdir found yet
82# PACKAGECONFIG[systemd] = "--with-systemdsystemunitdir=${systemd_unitdir}/system/,--without-systemdsystemunitdir,systemd,"
83PACKAGECONFIG[systemd] = "-Dinit-script=systemd,-Dinit-script=sysvinit,systemd,"
81 84
82# required by python3 to run setup.py 85# required by python3 to run setup.py
83export BUILD_SYS 86export BUILD_SYS
@@ -85,18 +88,18 @@ export HOST_SYS
85export STAGING_INCDIR 88export STAGING_INCDIR
86export STAGING_LIBDIR 89export STAGING_LIBDIR
87 90
88inherit autotools pkgconfig ptest update-rc.d systemd python3native 91inherit meson pkgconfig ptest update-rc.d systemd python3native
89 92
90SYSTEMD_PACKAGES = "${PN} ${PN}-networking" 93SYSTEMD_PACKAGES = "${PN} ${PN}-networking"
91SYSTEMD_SERVICE:${PN} = "lxc.service" 94SYSTEMD_SERVICE:${PN} = "lxc.service lxc-monitord.service"
92SYSTEMD_AUTO_ENABLE:${PN} = "disable" 95SYSTEMD_AUTO_ENABLE:${PN} = "disable"
93SYSTEMD_SERVICE:${PN}-networking = "lxc-net.service" 96SYSTEMD_SERVICE:${PN}-networking = "lxc-net.service"
94SYSTEMD_AUTO_ENABLE:${PN}-networking = "enable" 97SYSTEMD_AUTO_ENABLE:${PN}-networking = "enable"
95 98
96INITSCRIPT_PACKAGES = "${PN} ${PN}-networking" 99INITSCRIPT_PACKAGES = "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', '', '${PN}', d)} ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', '', '${PN}-networking',d)}"
97INITSCRIPT_NAME:${PN} = "lxc-containers" 100INITSCRIPT_NAME:${PN} = "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', '', 'lxc-containers', d)}"
98INITSCRIPT_PARAMS:${PN} = "defaults" 101INITSCRIPT_PARAMS:${PN} = "defaults"
99INITSCRIPT_NAME:${PN}-networking = "lxc-net" 102INITSCRIPT_NAME:${PN}-networking = "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', '', 'lxc-net', d)}"
100INITSCRIPT_PARAMS:${PN}-networking = "defaults" 103INITSCRIPT_PARAMS:${PN}-networking = "defaults"
101 104
102FILES:${PN}-doc = "${mandir} ${infodir}" 105FILES:${PN}-doc = "${mandir} ${infodir}"
@@ -117,11 +120,12 @@ FILES:${PN}-networking += " \
117 ${sysconfdir}/default/lxc-net \ 120 ${sysconfdir}/default/lxc-net \
118" 121"
119 122
120CACHED_CONFIGUREVARS += " \ 123# Not needed for meson
121 ac_cv_path_PYTHON='${STAGING_BINDIR_NATIVE}/python3-native/python3' \ 124# CACHED_CONFIGUREVARS += " \
122 am_cv_python_pyexecdir='${PYTHON_SITEPACKAGES_DIR}' \ 125# ac_cv_path_PYTHON='${STAGING_BINDIR_NATIVE}/python3-native/python3' \
123 am_cv_python_pythondir='${PYTHON_SITEPACKAGES_DIR}' \ 126# am_cv_python_pyexecdir='${PYTHON_SITEPACKAGES_DIR}' \
124" 127# am_cv_python_pythondir='${PYTHON_SITEPACKAGES_DIR}' \
128#"
125 129
126do_install:append() { 130do_install:append() {
127 # The /var/cache/lxc directory created by the Makefile 131 # The /var/cache/lxc directory created by the Makefile
@@ -134,8 +138,15 @@ do_install:append() {
134 for i in `grep -l "#! */bin/bash" ${D}${datadir}/lxc/hooks/*`; do \ 138 for i in `grep -l "#! */bin/bash" ${D}${datadir}/lxc/hooks/*`; do \
135 sed -e 's|#! */bin/bash|#!/bin/sh|' -i $i; done 139 sed -e 's|#! */bin/bash|#!/bin/sh|' -i $i; done
136 140
137 install -d ${D}${sysconfdir}/init.d 141 if "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}"; then
138 install -m 755 config/init/sysvinit/lxc* ${D}${sysconfdir}/init.d 142 # nothing special for systemd at the moment
143 true
144 else
145 # with meson, these aren't built unless sysvinit is the enabled
146 # init system.
147 install -d ${D}${sysconfdir}/init.d
148 install -m 755 config/init/sysvinit/lxc* ${D}${sysconfdir}/init.d
149 fi
139 150
140 # since python3-native is used for install location this will not be 151 # since python3-native is used for install location this will not be
141 # suitable for the target and we will have to correct the package install 152 # suitable for the target and we will have to correct the package install