feat: add incus
- manage the build of incus, incus-tools and incus-client
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
[Unit]
|
||||
Description=Incus - Instance startup
|
||||
After=incus.socket incus.service
|
||||
Requires=incus.socket
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
ExecStart=/usr/libexec/incus/incusd activateifneeded
|
||||
ExecStop=/usr/libexec/incus/shutdown
|
||||
TimeoutStartSec=600s
|
||||
TimeoutStopSec=600s
|
||||
RemainAfterExit=yes
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
@@ -0,0 +1,11 @@
|
||||
[Unit]
|
||||
Description=Incus - User daemon
|
||||
After=incus-user.socket incus.service
|
||||
Requires=incus-user.socket
|
||||
|
||||
[Service]
|
||||
ExecStart=/usr/libexec/incus/incus-user --group incus
|
||||
Restart=on-failure
|
||||
|
||||
[Install]
|
||||
Also=incus-user.socket
|
||||
@@ -0,0 +1,11 @@
|
||||
[Unit]
|
||||
Description=Incus - Daemon (user unix socket)
|
||||
|
||||
[Socket]
|
||||
ListenStream=/run/incus/unix.socket.user
|
||||
SocketGroup=incus
|
||||
SocketMode=0660
|
||||
Service=incus-user.service
|
||||
|
||||
[Install]
|
||||
WantedBy=sockets.target
|
||||
@@ -0,0 +1,21 @@
|
||||
[Unit]
|
||||
Description=Incus - Daemon
|
||||
After=network-online.target openvswitch-switch.service lxcfs.service incus.socket
|
||||
Requires=network-online.target lxcfs.service incus.socket
|
||||
|
||||
[Service]
|
||||
Environment=INCUS_OVMF_PATH=/usr/share/edk2/ovmf
|
||||
Environment=INCUS_SOCKET=/run/incus/unix.socket
|
||||
ExecStart=/usr/libexec/incus/incusd --group incus-admin
|
||||
ExecStartPost=/usr/libexec/incus/incusd waitready --timeout=600
|
||||
KillMode=process
|
||||
TimeoutStartSec=600s
|
||||
TimeoutStopSec=30s
|
||||
Restart=on-failure
|
||||
Delegate=yes
|
||||
LimitNOFILE=1048576
|
||||
LimitNPROC=infinity
|
||||
TasksMax=infinity
|
||||
|
||||
[Install]
|
||||
Also=incus-startup.service incus.socket
|
||||
@@ -0,0 +1,11 @@
|
||||
[Unit]
|
||||
Description=Incus - Daemon (unix socket)
|
||||
|
||||
[Socket]
|
||||
ListenStream=/run/incus/unix.socket
|
||||
SocketGroup=incus-admin
|
||||
SocketMode=0660
|
||||
Service=incus.service
|
||||
|
||||
[Install]
|
||||
WantedBy=sockets.target
|
||||
@@ -0,0 +1,38 @@
|
||||
# nfpm_incus-client.yaml
|
||||
|
||||
name: incus-client
|
||||
version: ${PACKAGE_VERSION}
|
||||
release: ${PACKAGE_RELEASE}
|
||||
arch: amd64
|
||||
platform: linux
|
||||
section: default
|
||||
priority: extra
|
||||
description: "Powerful system container and virtual machine manager."
|
||||
|
||||
maintainer: Incus
|
||||
homepage: https://github.com/lxc/incus
|
||||
license: Apache-2.0
|
||||
|
||||
disable_globbing: false
|
||||
|
||||
replaces:
|
||||
- incus-client
|
||||
|
||||
recommends:
|
||||
- incus-tools
|
||||
|
||||
# Files to include in the package
|
||||
contents:
|
||||
- src: /root/go/bin/incus
|
||||
dst: /usr/bin/incus
|
||||
file_info:
|
||||
mode: 0755
|
||||
owner: root
|
||||
group: root
|
||||
|
||||
# Scripts to run during installation/removal (optional)
|
||||
# scripts:
|
||||
# postinstall: ./scripts/postinstall.sh
|
||||
# postremove: ./scripts/postremove.sh
|
||||
# preinstall: ./scripts/preinstall.sh
|
||||
# preremove: ./scripts/preremove.sh
|
||||
@@ -0,0 +1,59 @@
|
||||
# nfpm_incus-tools.yaml
|
||||
|
||||
name: incus-tools
|
||||
version: ${PACKAGE_VERSION}
|
||||
release: ${PACKAGE_RELEASE}
|
||||
arch: amd64
|
||||
platform: linux
|
||||
section: default
|
||||
priority: extra
|
||||
description: "Powerful system container and virtual machine manager."
|
||||
|
||||
maintainer: Incus
|
||||
homepage: https://github.com/lxc/incus
|
||||
license: Apache-2.0
|
||||
|
||||
disable_globbing: false
|
||||
|
||||
replaces:
|
||||
- incus-tools
|
||||
|
||||
# Files to include in the package
|
||||
contents:
|
||||
- src: /root/go/bin/incus-benchmark
|
||||
dst: /usr/bin/incus-benchmark
|
||||
file_info:
|
||||
mode: 0755
|
||||
owner: root
|
||||
group: root
|
||||
- src: /root/go/bin/incus-migrate
|
||||
dst: /usr/bin/incus-migrate
|
||||
file_info:
|
||||
mode: 0755
|
||||
owner: root
|
||||
group: root
|
||||
- src: /root/go/bin/incus-agent
|
||||
dst: /usr/bin/incus-agent
|
||||
file_info:
|
||||
mode: 0755
|
||||
owner: root
|
||||
group: root
|
||||
- src: /root/go/bin/lxc-to-incus
|
||||
dst: /usr/bin/lxc-to-incus
|
||||
file_info:
|
||||
mode: 0755
|
||||
owner: root
|
||||
group: root
|
||||
- src: /root/go/bin/lxd-to-incus
|
||||
dst: /usr/bin/lxd-to-incus
|
||||
file_info:
|
||||
mode: 0755
|
||||
owner: root
|
||||
group: root
|
||||
|
||||
# Scripts to run during installation/removal (optional)
|
||||
# scripts:
|
||||
# postinstall: ./scripts/postinstall.sh
|
||||
# postremove: ./scripts/postremove.sh
|
||||
# preinstall: ./scripts/preinstall.sh
|
||||
# preremove: ./scripts/preremove.sh
|
||||
@@ -0,0 +1,98 @@
|
||||
# nfpm_incus.yaml
|
||||
|
||||
name: incus
|
||||
version: ${PACKAGE_VERSION}
|
||||
release: ${PACKAGE_RELEASE}
|
||||
arch: amd64
|
||||
platform: linux
|
||||
section: default
|
||||
priority: extra
|
||||
description: "Powerful system container and virtual machine manager."
|
||||
|
||||
maintainer: Incus
|
||||
homepage: https://github.com/lxc/incus
|
||||
license: Apache-2.0
|
||||
|
||||
disable_globbing: false
|
||||
|
||||
replaces:
|
||||
- incus
|
||||
|
||||
depends:
|
||||
- incus-client
|
||||
- lxcfs
|
||||
- cowsql
|
||||
- raft
|
||||
|
||||
recommends:
|
||||
- incus-tools
|
||||
|
||||
# Files to include in the package
|
||||
contents:
|
||||
- src: /root/go/bin/incusd
|
||||
dst: /usr/libexec/incus/incusd
|
||||
file_info:
|
||||
mode: 0755
|
||||
owner: root
|
||||
group: root
|
||||
- src: /root/go/bin/incus-user
|
||||
dst: /usr/libexec/incus/incus-user
|
||||
file_info:
|
||||
mode: 0755
|
||||
owner: root
|
||||
group: root
|
||||
- src: /app/resources/shutdown
|
||||
dst: /usr/libexec/incus/shutdown
|
||||
file_info:
|
||||
mode: 0755
|
||||
owner: root
|
||||
group: root
|
||||
- src: /app/resources/incus.service
|
||||
dst: /usr/lib/systemd/system/incus.service
|
||||
file_info:
|
||||
mode: 0644
|
||||
owner: root
|
||||
group: root
|
||||
- src: /app/resources/incus.socket
|
||||
dst: /usr/lib/systemd/system/incus.socket
|
||||
file_info:
|
||||
mode: 0644
|
||||
owner: root
|
||||
group: root
|
||||
- src: /app/resources/incus-user.service
|
||||
dst: /usr/lib/systemd/system/incus-user.service
|
||||
file_info:
|
||||
mode: 0644
|
||||
owner: root
|
||||
group: root
|
||||
- src: /app/resources/incus-user.socket
|
||||
dst: /usr/lib/systemd/system/incus-user.socket
|
||||
file_info:
|
||||
mode: 0644
|
||||
owner: root
|
||||
group: root
|
||||
- src: /app/resources/incus-startup.service
|
||||
dst: /usr/lib/systemd/system/incus-startup.service
|
||||
file_info:
|
||||
mode: 0644
|
||||
owner: root
|
||||
group: root
|
||||
- src: /app/resources/sysusers.d.incus.conf
|
||||
dst: /usr/lib/sysusers.d/incus.conf
|
||||
file_info:
|
||||
mode: 0644
|
||||
owner: root
|
||||
group: root
|
||||
- src: /app/resources/tmpfiles.d.incus.conf
|
||||
dst: /usr/lib/tmpfiles.d/incus.conf
|
||||
file_info:
|
||||
mode: 0644
|
||||
owner: root
|
||||
group: root
|
||||
|
||||
# Scripts to run during installation/removal (optional)
|
||||
scripts:
|
||||
postinstall: ./scripts/postinstall.sh
|
||||
preremove: ./scripts/preremove.sh
|
||||
postremove: ./scripts/postremove.sh
|
||||
preinstall: ./scripts/preinstall.sh
|
||||
@@ -0,0 +1,7 @@
|
||||
#!/usr/bin/sh
|
||||
|
||||
if ! systemctl -q is-active incus.service; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
exec /usr/lib/incus/incusd shutdown
|
||||
@@ -0,0 +1,2 @@
|
||||
g incus-admin -
|
||||
g incus -
|
||||
@@ -0,0 +1,4 @@
|
||||
d /var/cache/incus 0700 root root - -
|
||||
d /var/log/incus 0700 root root - -
|
||||
d /var/lib/incus 0711 root root - -
|
||||
d /run/incus 0711 root root - -
|
||||
Reference in New Issue
Block a user