From 57bf13e421a22a7476be89529076c8c6bc508c61 Mon Sep 17 00:00:00 2001 From: Naoto Yamaguchi Date: Tue, 2 May 2023 17:57:33 +0900 Subject: Divide lxc autostart from main package Existing lxc package is including autostart feature. In this case, that can't enable/disable using package install. This patch achieve autostare feature enable/disable by package install. Bug-AGL: SPEC-4777 Change-Id: I0373b294b677a39a670b79e3149a6d8a1d5b4432 Signed-off-by: Naoto Yamaguchi --- .../recipes-container/lxc/lxc_%.bbappend | 25 ++++++++++++++++++---- .../images/agl-cluster-demo-lxc-host.bb | 1 + 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/meta-agl-ic-container/recipes-container/lxc/lxc_%.bbappend b/meta-agl-ic-container/recipes-container/lxc/lxc_%.bbappend index 75ab98c0..1b78edfa 100644 --- a/meta-agl-ic-container/recipes-container/lxc/lxc_%.bbappend +++ b/meta-agl-ic-container/recipes-container/lxc/lxc_%.bbappend @@ -1,7 +1,3 @@ -PACKAGECONFIG:remove = "templates" - -SYSTEMD_AUTO_ENABLE:${PN} = "enable" - FILESEXTRAPATHS:prepend := "${THISDIR}/files:" SRC_URI += " \ @@ -9,6 +5,8 @@ SRC_URI += " \ file://lxc-net.service \ " +PACKAGECONFIG:remove = "templates" + do_install:append () { for service in lxc.service lxc-net.service; do install -D -m 0644 ${WORKDIR}/$service ${D}${systemd_system_unitdir}/$service @@ -16,6 +14,25 @@ do_install:append () { done } +# Divide lxc autostart from main package. +SYSTEMD_PACKAGES = "${PN}-autostart ${PN}-networking" +SYSTEMD_SERVICE:${PN} = "" +SYSTEMD_SERVICE:${PN}-autostart = "lxc.service" +SYSTEMD_AUTO_ENABLE:${PN}-autostart = "enable" + +PACKAGES =+ "${PN}-autostart" + +FILES:${PN}-autostart += " \ + ${sysconfdir}/default/lxc \ + ${sysconfdir}/default/volatiles/99_lxc \ +" +FILES:${PN}-doc += " \ + ${datadir}/doc/lxc/examples \ +" +FILES:${PN}-networking += " \ + ${sysconfdir}/dnsmasq.d \ +" + # NOTE: # This needs to be replaced with a rework of the upstream packaging # to do a proper split of core from the template support. diff --git a/meta-agl-ic-container/recipes-platform/images/agl-cluster-demo-lxc-host.bb b/meta-agl-ic-container/recipes-platform/images/agl-cluster-demo-lxc-host.bb index c7424f57..d26e6a63 100644 --- a/meta-agl-ic-container/recipes-platform/images/agl-cluster-demo-lxc-host.bb +++ b/meta-agl-ic-container/recipes-platform/images/agl-cluster-demo-lxc-host.bb @@ -17,6 +17,7 @@ IMAGE_INSTALL += " \ # packages required for network bridge settings via lxc-net IMAGE_INSTALL += " \ + lxc-autostart \ lxc-networking \ iptables-modules \ dnsmasq \ -- cgit 1.2.3-korg