diff options
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 @@ | |||
| 1 | install: | ||
| 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 | |||
| 16 | sample 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 @@ | |||
| 1 | From d69c856f90c752637b33e59fbbcfa31f619e2285 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Bruce Ashfield <bruce.ashfield@gmail.com> | ||
| 3 | Date: Sun, 14 Aug 2022 22:44:24 -0400 | ||
| 4 | Subject: [PATCH] download: don't try compatbility index | ||
| 5 | |||
| 6 | This is being mistaken for a valid, non compat index .. and we never | ||
| 7 | try for the one that exists (the index without a compatibility | ||
| 8 | extension). So we just drop the compat try for now. | ||
| 9 | |||
| 10 | Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com> | ||
| 11 | --- | ||
| 12 | templates/lxc-download.in | 8 ++------ | ||
| 13 | 1 file changed, 2 insertions(+), 6 deletions(-) | ||
| 14 | |||
| 15 | diff --git a/templates/lxc-download.in b/templates/lxc-download.in | ||
| 16 | index 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 | -- | ||
| 42 | 2.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 @@ | |||
| 1 | From 0cfa202f5d96a35692f063f35bf4706f310b17e4 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Jim Somerville <Jim.Somerville@windriver.com> | ||
| 3 | Date: Fri, 25 Sep 2015 15:08:17 -0400 | ||
| 4 | Subject: [PATCH] logs: optionally use base filenames to report src files | ||
| 5 | |||
| 6 | Message-Id: <4729d0f4c4d1dacd150ddfd7061dda875eb94e34.1443216870.git.Jim.Somerville@windriver.com> | ||
| 7 | |||
| 8 | Problem: Logs are nice in that they report the source file, | ||
| 9 | routine, and line number where an issue occurs. But the | ||
| 10 | file is printed as the absolute filename. Users do not | ||
| 11 | need to see a long spew of path directory names where the package | ||
| 12 | was built. It just confuses things. | ||
| 13 | |||
| 14 | Solution: Optionally chop off all leading directories so that just | ||
| 15 | the source filename ie. basename is printed. This is done by | ||
| 16 | setting a #ifdef LXC_LOG_USE_BASENAME check in the code. That | ||
| 17 | define is done via the optional --enable-log-src-basename provided | ||
| 18 | at configure time. | ||
| 19 | |||
| 20 | Using __BASE_FILE__ instead of __FILE__ did not work. It | ||
| 21 | refers to the file name as presented to the compile | ||
| 22 | machinery, and that may still be the absolute pathname to | ||
| 23 | the file. | ||
| 24 | |||
| 25 | Signed-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 | |||
| 32 | diff --git a/configure.ac b/configure.ac | ||
| 33 | index 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]])], | ||
| 52 | diff --git a/src/lxc/log.h b/src/lxc/log.h | ||
| 53 | index 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 @@ | |||
| 1 | From 85d1e77acbfde2aa1045cfda877a91a9e57c405d Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Jim Somerville <Jim.Somerville@windriver.com> | ||
| 3 | Date: Tue, 11 Aug 2015 14:05:00 -0400 | ||
| 4 | Subject: [PATCH] lxc: doc: upgrade to use docbook 3.1 DTD | ||
| 5 | |||
| 6 | docbook2man fails to build the man pages in poky | ||
| 7 | due to missing the ancient Davenport 3.0 DTD. | ||
| 8 | Poky meta has the Oasis 3.1 version so upgrade | ||
| 9 | to use that instead. | ||
| 10 | |||
| 11 | Signed-off-by: Jim Somerville <Jim.Somerville@windriver.com> | ||
| 12 | |||
| 13 | --- | ||
| 14 | configure.ac | 2 +- | ||
| 15 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
| 16 | |||
| 17 | diff --git a/configure.ac b/configure.ac | ||
| 18 | index 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 @@ | |||
| 1 | From dc2e71f060c25b94f011fce12ef59d2f5ae4e6a9 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Dmitry Eremin-Solenikov <dmitry_eremin@mentor.com> | ||
| 3 | Date: Thu, 9 Apr 2015 23:01:48 +0300 | ||
| 4 | Subject: [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 | |||
| 10 | diff --git a/config/init/upstart/Makefile.am b/config/init/upstart/Makefile.am | ||
| 11 | index 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 @@ | |||
| 1 | From 1db2db7783bd7ec2aa1da86e640019891634c659 Mon Sep 17 00:00:00 2001 | 1 | From 3e4cb0b738649f7750413cefbcfdb2115213ad0d Mon Sep 17 00:00:00 2001 |
| 2 | From: Joakim Roubert <joakimr@axis.com> | 2 | From: Bruce Ashfield <bruce.ashfield@gmail.com> |
| 3 | Date: Fri, 16 Aug 2019 07:52:48 +0200 | 3 | Date: Sun, 14 Aug 2022 14:08:56 -0400 |
| 4 | Subject: [PATCH] Use curl instead of wget | 4 | Subject: [PATCH] download: Use curl instead of wget |
| 5 | 5 | ||
| 6 | When curl's MIT license is preferable to wget's GPLv3. | 6 | When curl's MIT license is preferable to wget's GPLv3. |
| 7 | 7 | ||
| 8 | Change-Id: I4684ae7569704514fdcc63e0655c556efcaf44f8 | ||
| 9 | Signed-off-by: Joakim Roubert <joakimr@axis.com> | 8 | Signed-off-by: Joakim Roubert <joakimr@axis.com> |
| 10 | Signed-off-by: Yanfei Xu <yanfei.xu@windriver.com> | 9 | Signed-off-by: Yanfei Xu <yanfei.xu@windriver.com> |
| 10 | Signed-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 | ||
| 15 | Index: git/templates/lxc-download.in | 15 | diff --git a/templates/lxc-download.in b/templates/lxc-download.in |
| 16 | =================================================================== | 16 | index 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 | -- | ||
| 50 | 2.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 | ||
| 37 | RDEPENDS:${PN}-networking += "iptables" | 37 | RDEPENDS:${PN}-networking += "iptables" |
| 38 | 38 | ||
| 39 | SRC_URI = "git://github.com/lxc/lxc.git;branch=stable-4.0;protocol=https \ | 39 | SRC_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 | ||
| 53 | SRCREV = "5ba5725cb4a210c25707beeca64fde5f561d1c71" | 51 | SRCREV = "133aa416ca2a5996090ec0e697e253646364d274" |
| 54 | PV = "4.0.12+git${SRCPV}" | 52 | PV = "5.0.1+git${SRCPV}" |
| 55 | 53 | ||
| 56 | S = "${WORKDIR}/git" | 54 | S = "${WORKDIR}/git" |
| 57 | 55 | ||
| 58 | # Let's not configure for the host distro. | 56 | # Let's not configure for the host distro. |
| 59 | # | 57 | # |
| 60 | PTEST_CONF = "${@bb.utils.contains('DISTRO_FEATURES', 'ptest', '--enable-tests', '', d)}" | 58 | PTEST_CONF = "${@bb.utils.contains('DISTRO_FEATURES', 'ptest', '-Dtests=true', '', d)}" |
| 61 | EXTRA_OECONF += "--with-distro=${DISTRO} ${PTEST_CONF}" | ||
| 62 | 59 | ||
| 63 | EXTRA_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)}" | 62 | EXTRA_OEMESON += "${PTEST_CONF}" |
| 66 | 63 | # No meson equivalent for these yet | |
| 67 | EXTRA_OECONF += "--enable-log-src-basename --disable-werror" | 64 | # EXTRA_OECONF += "--enable-log-src-basename --disable-werror" |
| 68 | 65 | ||
| 69 | PACKAGECONFIG ??= "templates \ | 66 | PACKAGECONFIG ??= "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 | " |
| 74 | PACKAGECONFIG[doc] = "--enable-doc --enable-api-docs,--disable-doc --disable-api-docs,," | 71 | |
| 75 | PACKAGECONFIG[rpath] = "--enable-rpath,--disable-rpath,," | 72 | # Meson doesn't seem to be as fine grained as the autotools releases |
| 76 | PACKAGECONFIG[apparmor] = "--enable-apparmor,--disable-apparmor,apparmor,apparmor" | 73 | # PACKAGECONFIG[doc] = "--enable-doc --enable-api-docs,--disable-doc --disable-api-docs,," |
| 74 | PACKAGECONFIG[doc] = "-Dman=true,-Dman=false,," | ||
| 75 | # No meson equiv found for rpath yet | ||
| 76 | # PACKAGECONFIG[rpath] = "--enable-rpath,--disable-rpath,," | ||
| 77 | PACKAGECONFIG[apparmor] = "-Dapparmor=true,-Dapparmor=false,apparmor,apparmor" | ||
| 77 | PACKAGECONFIG[templates] = ",,, ${PN}-templates" | 78 | PACKAGECONFIG[templates] = ",,, ${PN}-templates" |
| 78 | PACKAGECONFIG[selinux] = "--enable-selinux,--disable-selinux,libselinux,libselinux" | 79 | PACKAGECONFIG[selinux] = "-Dselinux=true,-Dselinux=false,libselinux,libselinux" |
| 79 | PACKAGECONFIG[seccomp] ="--enable-seccomp,--disable-seccomp,libseccomp,libseccomp" | 80 | PACKAGECONFIG[seccomp] ="-Dseccomp=true,-Dseccomp=false,libseccomp,libseccomp" |
| 80 | PACKAGECONFIG[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," | ||
| 83 | PACKAGECONFIG[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 |
| 83 | export BUILD_SYS | 86 | export BUILD_SYS |
| @@ -85,18 +88,18 @@ export HOST_SYS | |||
| 85 | export STAGING_INCDIR | 88 | export STAGING_INCDIR |
| 86 | export STAGING_LIBDIR | 89 | export STAGING_LIBDIR |
| 87 | 90 | ||
| 88 | inherit autotools pkgconfig ptest update-rc.d systemd python3native | 91 | inherit meson pkgconfig ptest update-rc.d systemd python3native |
| 89 | 92 | ||
| 90 | SYSTEMD_PACKAGES = "${PN} ${PN}-networking" | 93 | SYSTEMD_PACKAGES = "${PN} ${PN}-networking" |
| 91 | SYSTEMD_SERVICE:${PN} = "lxc.service" | 94 | SYSTEMD_SERVICE:${PN} = "lxc.service lxc-monitord.service" |
| 92 | SYSTEMD_AUTO_ENABLE:${PN} = "disable" | 95 | SYSTEMD_AUTO_ENABLE:${PN} = "disable" |
| 93 | SYSTEMD_SERVICE:${PN}-networking = "lxc-net.service" | 96 | SYSTEMD_SERVICE:${PN}-networking = "lxc-net.service" |
| 94 | SYSTEMD_AUTO_ENABLE:${PN}-networking = "enable" | 97 | SYSTEMD_AUTO_ENABLE:${PN}-networking = "enable" |
| 95 | 98 | ||
| 96 | INITSCRIPT_PACKAGES = "${PN} ${PN}-networking" | 99 | INITSCRIPT_PACKAGES = "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', '', '${PN}', d)} ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', '', '${PN}-networking',d)}" |
| 97 | INITSCRIPT_NAME:${PN} = "lxc-containers" | 100 | INITSCRIPT_NAME:${PN} = "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', '', 'lxc-containers', d)}" |
| 98 | INITSCRIPT_PARAMS:${PN} = "defaults" | 101 | INITSCRIPT_PARAMS:${PN} = "defaults" |
| 99 | INITSCRIPT_NAME:${PN}-networking = "lxc-net" | 102 | INITSCRIPT_NAME:${PN}-networking = "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', '', 'lxc-net', d)}" |
| 100 | INITSCRIPT_PARAMS:${PN}-networking = "defaults" | 103 | INITSCRIPT_PARAMS:${PN}-networking = "defaults" |
| 101 | 104 | ||
| 102 | FILES:${PN}-doc = "${mandir} ${infodir}" | 105 | FILES:${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 | ||
| 120 | CACHED_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 | ||
| 126 | do_install:append() { | 130 | do_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 |
