mirror of
https://dev.iopsys.eu/feed/iopsys.git
synced 2025-12-10 07:44:50 +01:00
swmodd: Select lxc utils based on config option
This commit is contained in:
parent
dc4c8bafc2
commit
91d345c7fb
4 changed files with 95 additions and 59 deletions
|
|
@ -1,26 +1,56 @@
|
|||
menu "Configuration"
|
||||
depends on PACKAGE_swmodd
|
||||
|
||||
config SWMODD_LXC_SUPPORT
|
||||
bool "Handles LXC based containers"
|
||||
default y
|
||||
|
||||
config SWMODD_OCI_SUPPORT
|
||||
bool "Handles OCI containers"
|
||||
default y
|
||||
depends on PACKAGE_swmodd
|
||||
select PACKAGE_crun
|
||||
|
||||
config SWMODD_REGISTRY_PULL_SUPPORT
|
||||
bool "Add support to pull images from container image registries (i.e: docker.io, quay.io)"
|
||||
default n
|
||||
depends on PACKAGE_swmodd
|
||||
default n
|
||||
select PACKAGE_skopeo
|
||||
select PACKAGE_umoci
|
||||
|
||||
config SWMODD_LXC_SUPPORT
|
||||
bool "Handles LXC based containers"
|
||||
depends on PACKAGE_swmodd
|
||||
default y
|
||||
select PACKAGE_lxc
|
||||
select PACKAGE_lxc-attach
|
||||
select PACKAGE_lxc-auto
|
||||
select PACKAGE_lxc-cgroup
|
||||
select PACKAGE_lxc-checkconfig
|
||||
select PACKAGE_lxc-common
|
||||
select PACKAGE_lxc-config
|
||||
select PACKAGE_lxc-configs
|
||||
select PACKAGE_lxc-console
|
||||
select PACKAGE_lxc-create
|
||||
select PACKAGE_lxc-destroy
|
||||
select PACKAGE_lxc-execute
|
||||
select PACKAGE_lxc-freeze
|
||||
select PACKAGE_lxc-hooks
|
||||
select PACKAGE_lxc-info
|
||||
select PACKAGE_lxc-init
|
||||
select PACKAGE_lxc-ls
|
||||
select PACKAGE_lxc-start
|
||||
select PACKAGE_lxc-stop
|
||||
select PACKAGE_lxc-templates
|
||||
select PACKAGE_lxc-top
|
||||
select PACKAGE_lxc-unfreeze
|
||||
select PACKAGE_lxc-unprivileged
|
||||
select PACKAGE_lxc-unshare
|
||||
select PACKAGE_lxc-user-nic
|
||||
select PACKAGE_lxc-usernsexec
|
||||
select PACKAGE_lxc-wait
|
||||
|
||||
config SWMODD_OCI_SUPPORT
|
||||
bool "Handles OCI containers"
|
||||
depends on PACKAGE_swmodd
|
||||
default y
|
||||
select PACKAGE_crun
|
||||
|
||||
config SWMODD_KERNEL_OPTIONS
|
||||
bool "Enable kernel support for LXC and OCI containers"
|
||||
depends on PACKAGE_swmodd
|
||||
default y
|
||||
select LXC_KERNEL_OPTIONS
|
||||
select LXC_BUSYBOX_OPTIONS
|
||||
select LXC_SECCOMP
|
||||
select LXC_NETWORKING
|
||||
select KERNEL_CGROUPS
|
||||
select KERNEL_CGROUP_SCHED
|
||||
select KERNEL_CGROUP_DEVICE
|
||||
|
|
@ -44,10 +74,9 @@ menu "Configuration"
|
|||
|
||||
config SWMODD_NETWORKING
|
||||
bool "Enable networking support for LXC/OCI containers"
|
||||
depends on PACKAGE_swmodd
|
||||
default y
|
||||
select PACKAGE_kmod-veth
|
||||
select PACKAGE_kmod-macvlan
|
||||
help
|
||||
Enable "veth pair device" and "macvlan"
|
||||
|
||||
endmenu
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=swmodd
|
||||
PKG_VERSION:=2.2.8
|
||||
PKG_VERSION:=2.2.9
|
||||
|
||||
LOCAL_DEV:=0
|
||||
ifneq ($(LOCAL_DEV),1)
|
||||
|
|
@ -28,6 +28,7 @@ define Package/swmodd
|
|||
CATEGORY:=Utilities
|
||||
SUBMENU:=TRx69
|
||||
TITLE:= Software Modules Daemon
|
||||
MENU:=1
|
||||
DEPENDS:=+libuci +libubox +ubus +libuuid +opkg +libcurl \
|
||||
+PACKAGE_lxc:lxc +PACKAGE_liblxc:liblxc +@BUSYBOX_CONFIG_BUSYBOX \
|
||||
+@BUSYBOX_CONFIG_FEATURE_SHOW_SCRIPT +@BUSYBOX_CONFIG_SCRIPT \
|
||||
|
|
@ -54,12 +55,12 @@ TARGET_CFLAGS += \
|
|||
-D_GNU_SOURCE \
|
||||
-Wall -Werror
|
||||
|
||||
ifeq ($(CONFIG_PACKAGE_crun),y)
|
||||
ifeq ($(CONFIG_SWMODD_OCI_SUPPORT),y)
|
||||
MAKE_FLAGS += \
|
||||
SWMOD_CRUN="yes"
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_PACKAGE_lxc),y)
|
||||
ifeq ($(CONFIG_SWMODD_LXC_SUPPORT),y)
|
||||
MAKE_FLAGS += \
|
||||
SWMOD_LXC="yes"
|
||||
endif
|
||||
|
|
|
|||
|
|
@ -6,6 +6,11 @@ STOP=01
|
|||
USE_PROCD=1
|
||||
PROG=/usr/sbin/swmodd
|
||||
|
||||
log()
|
||||
{
|
||||
logger -t swmodd.init "$*"
|
||||
}
|
||||
|
||||
validate_globals_section()
|
||||
{
|
||||
uci_validate_section swmodd swmodd "globals" \
|
||||
|
|
@ -70,9 +75,15 @@ start_service() {
|
|||
|
||||
[ "${enabled}" -eq 0 ] && return 0
|
||||
|
||||
# Create the bundle paths if not present
|
||||
[ -n "${lxc_bundle_root}" ] && mkdir -p "${lxc_bundle_root}"
|
||||
[ -n "${oci_bundle_root}" ] && mkdir -p "${oci_bundle_root}"
|
||||
if [ ! -d "${lxc_bundle_root}" ]; then
|
||||
log "# Not staring lxc [${lxc_bundle_root}] not present/defined"
|
||||
return 1
|
||||
fi
|
||||
|
||||
if [ ! -d "${oci_bundle_root}" ]; then
|
||||
log "# Not staring oci [${oci_bundle_root}] not present/defined"
|
||||
return 1
|
||||
fi
|
||||
|
||||
procd_open_instance swmodd
|
||||
procd_set_param command ${PROG}
|
||||
|
|
|
|||
|
|
@ -21,23 +21,18 @@ if [ -n "${lxc_bundle}" ]; then
|
|||
elif [ -n "${lxc}" ]; then
|
||||
# if lxc_bundle_root not define in swmodd, update it with lxc path
|
||||
uci_set swmodd globals lxc_bundle_root ${lxc}
|
||||
uci_commit
|
||||
else
|
||||
mkdir -p /etc/lxc
|
||||
echo "lxc.lxcpath = /srv/" > /etc/lxc/lxc.conf
|
||||
uci_set swmodd globals lxc_bundle_root "/srv/"
|
||||
uci_commit
|
||||
fi
|
||||
|
||||
if [ -z "${oci_bundle}" ] && [ -n "${lxc_bundle}" ]; then
|
||||
# if oci_bundle_root not defined in swmodd, update it with lxc_bundle_root if defined
|
||||
uci_set swmodd globals oci_bundle_root ${lxc_bundle}
|
||||
uci_commit
|
||||
elif [ -z "${oci_bundle}" ] && [ -n "${lxc}" ]; then
|
||||
# if oci_bundle_root not defined in swmodd, update it with lxc path
|
||||
uci_set swmodd globals oci_bundle_root ${lxc}
|
||||
uci_commit
|
||||
elif [ -z "${oci_bundle}" ]; then
|
||||
uci_set swmodd globals oci_bundle_root "/srv/"
|
||||
uci_commit
|
||||
fi
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue