From 22739e90330d4ac4849bbf4d9abe9fe6112d10ba Mon Sep 17 00:00:00 2001 From: Ettore Di Giacinto Date: Thu, 6 Oct 2022 15:10:42 +0000 Subject: [PATCH] Add kcrypt packages and to initrd --- packages/initrd/build.yaml | 13 ++++++++++++- packages/initrd/collection.yaml | 6 +++--- packages/system/dracut/kcrypt/build.yaml | 18 ++++++++++++++++++ packages/system/dracut/kcrypt/definition.yaml | 10 ++++++++++ packages/system/kcrypt/build.yaml | 18 ++++++++++++++++++ packages/system/kcrypt/definition.yaml | 10 ++++++++++ 6 files changed, 71 insertions(+), 4 deletions(-) create mode 100644 packages/system/dracut/kcrypt/build.yaml create mode 100644 packages/system/dracut/kcrypt/definition.yaml create mode 100644 packages/system/kcrypt/build.yaml create mode 100644 packages/system/kcrypt/definition.yaml diff --git a/packages/initrd/build.yaml b/packages/initrd/build.yaml index a11086e..c670f7d 100644 --- a/packages/initrd/build.yaml +++ b/packages/initrd/build.yaml @@ -17,7 +17,18 @@ copy: version: ">=0" source: "/usr/bin/elemental" destination: "/usr/bin/elemental" - +- package: + category: "dracut" + name: "kcrypt" + version: ">=0" + source: "/package/." + destination: "/" +- package: + category: "system" + name: "kcrypt" + version: ">=0" + source: "/usr/bin/kcrypt" + destination: "/usr/bin/kcrypt" prelude: # remove if any - rm -rf /boot/initrd || true diff --git a/packages/initrd/collection.yaml b/packages/initrd/collection.yaml index 932a7b5..5ea6fe7 100644 --- a/packages/initrd/collection.yaml +++ b/packages/initrd/collection.yaml @@ -1,10 +1,10 @@ packages: - name: "opensuse" category: "distro-initrd" - version: "0.4" + version: "0.5" - name: "fedora" category: "distro-initrd" - version: "0.4" + version: "0.5" - name: "ubuntu" category: "distro-initrd" - version: "0.4" \ No newline at end of file + version: "0.5" \ No newline at end of file diff --git a/packages/system/dracut/kcrypt/build.yaml b/packages/system/dracut/kcrypt/build.yaml new file mode 100644 index 0000000..7d7b770 --- /dev/null +++ b/packages/system/dracut/kcrypt/build.yaml @@ -0,0 +1,18 @@ +image: "alpine" + +prelude: +- apk add git +- | + PACKAGE_VERSION=${PACKAGE_VERSION%\+*} && \ + git clone https://github.com/${GITHUB_ORG}/{{ .Values.name }}.git && cd {{.Values.name}} && git checkout v"${PACKAGE_VERSION}" + +steps: +- mkdir -p /package/usr/lib/dracut/modules.d +- mkdir -p /package//etc/dracut.conf.d/ +- cp -r {{.Values.name}}/dracut/* /package/usr/lib/dracut/modules.d +- cp {{.Values.name}}/dracut.conf /package/etc/dracut.conf.d/10-kcrypt.conf + +env: +- GITHUB_ORG={{ ( index .Values.labels "github.owner" ) }} + +package_dir: "/package" \ No newline at end of file diff --git a/packages/system/dracut/kcrypt/definition.yaml b/packages/system/dracut/kcrypt/definition.yaml new file mode 100644 index 0000000..dd879c9 --- /dev/null +++ b/packages/system/dracut/kcrypt/definition.yaml @@ -0,0 +1,10 @@ +name: kcrypt +category: dracut +version: "0.1" +labels: + github.repo: "kcrypt" + github.owner: "kairos-io" +uri: + - https://github.com/kairos-io/kcrypt +license: "Apache License v2" +description: "Dracut module for kcrypt" diff --git a/packages/system/kcrypt/build.yaml b/packages/system/kcrypt/build.yaml new file mode 100644 index 0000000..fe37472 --- /dev/null +++ b/packages/system/kcrypt/build.yaml @@ -0,0 +1,18 @@ +requires: +- name: "toolchain-go" + category: "development" + version: ">=0" +prelude: +- mkdir go/src/github.com/${GITHUB_ORG}/ -p +- cd go/src/github.com/${GITHUB_ORG}/ && git clone https://github.com/${GITHUB_ORG}/{{ .Values.name }}.git +env: +- GOPATH=/luetbuild/go/ +- GITHUB_ORG={{ ( index .Values.labels "github.owner" ) }} +- CGO_ENABLED=0 +steps: +- | + PACKAGE_VERSION=${PACKAGE_VERSION%\+*} && \ + cd go/src/github.com/${GITHUB_ORG}/{{ .Values.name }}/ && git checkout v"${PACKAGE_VERSION}" -b build && go build -ldflags="-w -s" && mv {{.Values.name}} /usr/bin/ +- chmod +x /usr/bin/{{.Values.name}} +includes: +- /usr/bin/{{.Values.name}} diff --git a/packages/system/kcrypt/definition.yaml b/packages/system/kcrypt/definition.yaml new file mode 100644 index 0000000..c34695c --- /dev/null +++ b/packages/system/kcrypt/definition.yaml @@ -0,0 +1,10 @@ +name: kcrypt +category: system +version: "0.1" +labels: + github.repo: "kcrypt" + github.owner: "kairos-io" +uri: + - https://github.com/kairos-io/kcrypt +license: "Apache License v2" +description: "Cloud native guardian for persistent data in the edge"