1 # Helper class for installing LXC guest configuration.
3 # - Recipe name is 'lxc-config-' + <guest name>
4 # - Corresponding files {config,system.conf}.<guest name>.in are in
6 # - That references to the DRM lease device name are parameterized
7 # with @DRM_LEASE_DEVICE@ in the .in files
9 # - The .in files can optionally use the @LXC_AUTO_START@ parameter
10 # to pick up the value of the LXC_AUTO_START variable for use in
11 # defining lxc.start.auto. The default value is "0", so recipes
12 # need to assign the variable to "1" to have the associated
13 # container start automatically.
15 python __anonymous() {
17 if not bpn.startswith('lxc-config-'):
18 bb.error('Recipe name does not start with \'lxc-config-\'')
20 d.setVar('LXC_CONFIG_NAME', config)
21 src_uri = 'file://config.' + config + \
22 '.in file://system.conf.' + config + '.in'
23 d.setVar('SRC_URI', src_uri)
30 DRM_LEASE_DEVICE ??= "card0-HDMI-A-1"
32 DRM_LEASE_DEVICE:qemuall ?= "card0-Virtual-1"
34 LXC_AUTO_START ??= "0"
36 do_configure[noexec] = "1"
37 do_compile[noexec] = "1"
40 install -m 0755 -d ${D}/var/lib/lxc/${LXC_CONFIG_NAME}
41 for f in config.${LXC_CONFIG_NAME}.in system.conf.${LXC_CONFIG_NAME}.in; do
42 sed -e 's|@DRM_LEASE_DEVICE@|${DRM_LEASE_DEVICE}|g' \
43 -e 's|@LXC_AUTO_START@|${LXC_AUTO_START}|g' \
44 ${WORKDIR}/$f > ${D}${localstatedir}/lib/lxc/${LXC_CONFIG_NAME}/${f%.${LXC_CONFIG_NAME}.in}
48 FILES:${PN} = "${localstatedir}/lib/lxc/"