mirror of
https://github.com/outbackdingo/incus-os.git
synced 2026-01-27 10:19:24 +00:00
base: Add kpx daemon and service definition
Signed-off-by: Mathias Gibbens <mathias.gibbens@futurfusion.io>
This commit is contained in:
4
.gitignore
vendored
4
.gitignore
vendored
@@ -8,12 +8,14 @@ mkosi.key
|
||||
certs/
|
||||
|
||||
mkosi.images/base/mkosi.extra/boot/EFI/
|
||||
mkosi.images/base/mkosi.extra/usr/local/bin/incus-osd
|
||||
mkosi.images/base/mkosi.extra/usr/local/bin/
|
||||
|
||||
incus-osd/flasher-tool
|
||||
incus-osd/image-customizer
|
||||
incus-osd/image-publisher
|
||||
incus-osd/incus-osd
|
||||
incus-osd/kpx
|
||||
|
||||
mkosi.packages/initrd-tmpfs-root*
|
||||
|
||||
*.swp
|
||||
|
||||
15
Makefile
15
Makefile
@@ -18,6 +18,18 @@ flasher-tool:
|
||||
(cd incus-osd && go build ./cmd/flasher-tool)
|
||||
strip incus-osd/flasher-tool
|
||||
|
||||
.PHONY: kpx
|
||||
kpx:
|
||||
$(eval KPX_VERSION := 1.11.0)
|
||||
ifeq (,$(wildcard incus-osd/kpx/))
|
||||
git clone https://github.com/momiji/kpx incus-osd/kpx/ --depth 1 -b "v${KPX_VERSION}"
|
||||
else
|
||||
(cd incus-osd/kpx && git fetch --depth 1 origin "v${KPX_VERSION}":refs/tags/"v${KPX_VERSION}" && git checkout "v${KPX_VERSION}")
|
||||
endif
|
||||
|
||||
(cd incus-osd/kpx/cli && go build -o kpx -ldflags="-s -w -X github.com/momiji/kpx.AppVersion=${KPX_VERSION}")
|
||||
strip incus-osd/kpx/cli/kpx
|
||||
|
||||
.PHONY: initrd-deb-package
|
||||
initrd-deb-package:
|
||||
$(eval OSNAME := $(shell grep "ImageId=" mkosi.conf | cut -d '=' -f 2))
|
||||
@@ -48,7 +60,7 @@ ifeq (,$(wildcard ./certs/))
|
||||
endif
|
||||
|
||||
.PHONY: build
|
||||
build: incus-osd flasher-tool initrd-deb-package
|
||||
build: incus-osd flasher-tool kpx initrd-deb-package
|
||||
ifeq (, $(shell which mkosi))
|
||||
@echo "mkosi couldn't be found, please install it and try again"
|
||||
exit 1
|
||||
@@ -59,6 +71,7 @@ endif
|
||||
openssl x509 -in mkosi.crt -out mkosi.images/base/mkosi.extra/boot/EFI/mkosi.der -outform DER
|
||||
mkdir -p mkosi.images/base/mkosi.extra/usr/local/bin/
|
||||
cp incus-osd/incus-osd mkosi.images/base/mkosi.extra/usr/local/bin/
|
||||
cp incus-osd/kpx/cli/kpx mkosi.images/base/mkosi.extra/usr/local/bin/
|
||||
sudo rm -Rf mkosi.output/base* mkosi.output/debug* mkosi.output/incus*
|
||||
sudo -E $(shell command -v mkosi) --cache-dir .cache/ build
|
||||
sudo chown $(shell id -u):$(shell id -g) mkosi.output
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
[Unit]
|
||||
Description=kpx proxy daemon
|
||||
|
||||
[Service]
|
||||
User=nobody
|
||||
Group=nogroup
|
||||
ExecStart=/usr/local/bin/kpx -c /etc/kpx.yaml
|
||||
Restart=on-failure
|
||||
Reference in New Issue
Block a user