From fa64bd0ab1fda18339398bdd0584dfab75b72c15 Mon Sep 17 00:00:00 2001 From: Jake Nabasny Date: Sat, 12 Aug 2023 15:44:41 -0400 Subject: [PATCH 1/2] images: Add support for slackware Supports verisons 15.0 and current Signed-off-by: Jake Nabasny (cherry picked from commit d6af05d18451ce614ef8d21fb5958bad7438186f) Signed-off-by: Din Music License: Apache-2.0 --- images/slackware.yaml | 75 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 images/slackware.yaml diff --git a/images/slackware.yaml b/images/slackware.yaml new file mode 100644 index 000000000..306ec90a3 --- /dev/null +++ b/images/slackware.yaml @@ -0,0 +1,75 @@ +image: + distribution: slackware + +source: + downloader: slackware-http + url: https://mirrors.slackware.com/slackware/ + +packages: + manager: slackpkg + sets: + - packages: + - sudo + action: install + +actions: +- trigger: post-unpack + action: |- + #!/bin/bash + touch /var/lib/slackpkg/current + releases: + - current + +- trigger: post-unpack + action: |- + #!/bin/bash + update-ca-certificates -f + slackpkg update gpg + releases: + - 15.0 + - current + +files: +- name: hostname + path: /etc/hostname + generator: hostname + +- name: hostname + path: /etc/HOSTNAME + generator: hostname + +- name: hosts + path: /etc/hosts + generator: hosts + +targets: + lxc: + create_message: | + You just created a {{ image.description }} container. + config: + - type: all + before: 5 + content: |- + lxc.include = LXC_TEMPLATE_CONFIG/slackware.common.conf + + - type: user + before: 5 + content: |- + lxc.include = LXC_TEMPLATE_CONFIG/slackware.userns.conf + + - type: all + after: 4 + content: |- + lxc.include = LXC_TEMPLATE_CONFIG/common.conf + + - type: user + after: 4 + content: |- + lxc.include = LXC_TEMPLATE_CONFIG/userns.conf + + - type: all + content: |- + lxc.arch = {{ image.architecture_kernel }} + +mappings: + architecture_map: slackware From 338d7c78c7d4baeda06d93322f2b53706c40e01c Mon Sep 17 00:00:00 2001 From: Din Music Date: Tue, 2 Apr 2024 14:14:17 +0200 Subject: [PATCH 2/2] github/workflows: Add slackware image build Signed-off-by: Din Music --- .github/workflows/image-slackware.yml | 84 +++++++++++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 .github/workflows/image-slackware.yml diff --git a/.github/workflows/image-slackware.yml b/.github/workflows/image-slackware.yml new file mode 100644 index 000000000..416351a91 --- /dev/null +++ b/.github/workflows/image-slackware.yml @@ -0,0 +1,84 @@ + +name: Build Slackware Images + +on: + schedule: + # Run at 00:00 UTC daily. + - cron: '0 0 * * *' + workflow_dispatch: + inputs: + publish: + type: boolean + default: false + description: Publish built image + +jobs: + slackware: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + release: + - current + variant: + - default + architecture: + - amd64 + + env: + type: "container" + distro: "${{ github.job }}" + target: "${HOME}/build" + + steps: + - uses: actions/checkout@v4 + + - name: Setup environment + uses: ./.github/actions/image-setup + with: + ssh-key: ${{ secrets.LXD_IMAGEBUILDER_KEY }} + + - name: Build image + run: | + TIMEOUT=3600 + YAML="${{ github.workspace }}/images/${{ env.distro }}.yaml" + ARCH="${{ matrix.architecture }}" + TYPE="${{ env.type }}" + + IMAGE_ARCH="${ARCH}" + [ "${ARCH}" = "amd64" ] && IMAGE_ARCH="x86_64" + + ./bin/build-distro "${YAML}" "${ARCH}" "${TYPE}" "${TIMEOUT}" "${{ env.target }}" \ + -o image.architecture="${IMAGE_ARCH}" \ + -o image.release="${{ matrix.release }}" + + - name: Print build artifacts + run: ls -lah "${{ env.target }}" + + - name: Test container image + uses: ./.github/actions/image-test + if: contains(env.type, 'container') + with: + type: container + target: ${{ env.target }} + distro: ${{ env.distro }} + release: ${{ matrix.release }} + variant: ${{ matrix.variant }} + + - name: Test VM image + uses: ./.github/actions/image-test + if: contains(env.type, 'vm') + with: + type: vm + target: ${{ env.target }} + distro: ${{ env.distro }} + release: ${{ matrix.release }} + variant: ${{ matrix.variant }} + + - name: Upload image + uses: ./.github/actions/image-upload + if: inputs.publish == true + with: + target: ${{ env.target }} + image_dir: "${{ env.distro }}/${{ matrix.release }}/${{ matrix.architecture }}/${{ matrix.variant }}" + ssh_private_key: "${{ secrets.LXD_INFRA_IMAGES_KEY }}"