From eb2cfebe29f45964a79e33cdd10cf272bf414ef0 Mon Sep 17 00:00:00 2001 From: Itxaka Date: Tue, 24 Dec 2024 08:34:52 +0100 Subject: [PATCH] Drop uneeded scripts Signed-off-by: Itxaka --- image-assets/add-cloud-init.sh | 18 ------------------ image-assets/azure.sh | 24 ------------------------ image-assets/gce.sh | 26 -------------------------- image-assets/ipxe.tmpl | 7 ------- image-assets/kairos-release.tmpl | 13 ------------- image-assets/netboot.sh | 25 ------------------------- image-assets/update-os-release.sh | 25 ------------------------- 7 files changed, 138 deletions(-) delete mode 100755 image-assets/add-cloud-init.sh delete mode 100755 image-assets/azure.sh delete mode 100755 image-assets/gce.sh delete mode 100644 image-assets/ipxe.tmpl delete mode 100644 image-assets/kairos-release.tmpl delete mode 100755 image-assets/netboot.sh delete mode 100755 image-assets/update-os-release.sh diff --git a/image-assets/add-cloud-init.sh b/image-assets/add-cloud-init.sh deleted file mode 100755 index f414a4f..0000000 --- a/image-assets/add-cloud-init.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash -# docker run --entrypoint /add-cloud-init.sh -v $PWD:/work -ti --rm test https://github.com/kairos-io/kairos/releases/download/v1.1.2/kairos-alpine-v1.1.2.iso /work/test.iso /work/config.yaml - -set -ex - -ISO=$1 -OUT=$2 -CONFIG=$3 - -case ${ISO} in -http*) - curl -L "${ISO}" -o in.iso - ISO=in.iso - ;; -esac - -# Needs xorriso >=1.5.4 -xorriso -indev $ISO -outdev $OUT -map $CONFIG /config.yaml -boot_image any replay \ No newline at end of file diff --git a/image-assets/azure.sh b/image-assets/azure.sh deleted file mode 100755 index 2c2d277..0000000 --- a/image-assets/azure.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/bash - -set -ex -# Transform a raw image disk to azure vhd -RAWIMAGE="$1" -# The final name of the image -OUT="${2:-$RAWIMAGE.vhd}" - -# Check if OUT has .vhd extension, if not add it -if [[ "$OUT" != *.vhd ]]; then - OUT="$OUT.vhd" -fi - - -MB=$((1024*1024)) -size=$(qemu-img info -f raw --output json "$RAWIMAGE" | gawk 'match($0, /"virtual-size": ([0-9]+),/, val) {print val[1];exit}') -# shellcheck disable=SC2004 -ROUNDED_SIZE=$(((($size+$MB-1)/$MB)*$MB)) -echo "Resizing raw image from $size MB to $ROUNDED_SIZE MB" -qemu-img resize -f raw "$RAWIMAGE" $ROUNDED_SIZE -echo "Converting $RAWIMAGE to Azure VHD format" -qemu-img convert -f raw -o subformat=fixed,force_size -O vpc "$RAWIMAGE" "$OUT" -echo "Done" -rm -rf "$RAWIMAGE" \ No newline at end of file diff --git a/image-assets/gce.sh b/image-assets/gce.sh deleted file mode 100755 index b6f2080..0000000 --- a/image-assets/gce.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/bash - -set -ex -# Transform a raw image disk to gce compatible -RAWIMAGE="$1" -# The final name of the image -# This is the one we have control over as the raw image inside the tarball will be named disk.raw as required by GCE -OUT="${2:-$RAWIMAGE.gce.tar.gz}" - -# Check if OUT has .tar.gz extension, if not add it -if [[ "$OUT" != *.tar.gz ]]; then - OUT="$OUT.tar.gz" -fi - -GB=$((1024*1024*1024)) -MB=$((1024*1024)) -size=$(qemu-img info -f raw --output json "$RAWIMAGE" | gawk 'match($0, /"virtual-size": ([0-9]+),/, val) {print val[1];exit}') -# shellcheck disable=SC2004 -ROUNDED_SIZE=$(echo "$size/$GB+1"|bc) -CURRENT_SIZE=$(echo "$size/$MB"|bc) -echo "Resizing raw image from \"$size\"MB to \"$ROUNDED_SIZE\"GB" -qemu-img resize -f raw "$RAWIMAGE" "$ROUNDED_SIZE"G -echo "Renaming image to disk.raw as required by GCE" -mv "$RAWIMAGE" disk.raw -echo "Compressing raw image disk.raw to $OUT" -tar -c -z --format=oldgnu -f "$OUT" disk.raw diff --git a/image-assets/ipxe.tmpl b/image-assets/ipxe.tmpl deleted file mode 100644 index 9549fa3..0000000 --- a/image-assets/ipxe.tmpl +++ /dev/null @@ -1,7 +0,0 @@ -#!ipxe - -set dns 8.8.8.8 -ifconf -kernel ${RELEASE_URL}/${VERSION}/${ISO_NAME}-kernel root=live:${RELEASE_URL}/${VERSION}/${ISO_NAME}.squashfs initrd=${ISO_NAME}-initrd rd.neednet=1 ip=dhcp rd.cos.disable netboot install-mode config_url=${config} console=tty1 console=ttyS0 rd.live.overlay.overlayfs ${cmdline} -initrd ${RELEASE_URL}/${VERSION}/${ISO_NAME}-initrd -boot \ No newline at end of file diff --git a/image-assets/kairos-release.tmpl b/image-assets/kairos-release.tmpl deleted file mode 100644 index 0e74e5f..0000000 --- a/image-assets/kairos-release.tmpl +++ /dev/null @@ -1,13 +0,0 @@ -KAIROS_NAME="${OS_NAME}" -KAIROS_VERSION="${OS_VERSION}" -KAIROS_ID="${OS_ID}" -KAIROS_ID_LIKE="${OS_NAME}" -KAIROS_VERSION_ID="${OS_VERSION}" -KAIROS_PRETTY_NAME="${OS_NAME} ${OS_VERSION}" -KAIROS_BUG_REPORT_URL="${BUG_REPORT_URL}" -KAIROS_HOME_URL="${HOME_URL}" -KAIROS_IMAGE_REPO="${OS_REPO}" -KAIROS_IMAGE_LABEL="${OS_LABEL}" -KAIROS_GITHUB_REPO="${GITHUB_REPO}" -KAIROS_VARIANT="${VARIANT}" -KAIROS_FLAVOR="${FLAVOR}" diff --git a/image-assets/netboot.sh b/image-assets/netboot.sh deleted file mode 100755 index 34da4cc..0000000 --- a/image-assets/netboot.sh +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/bash -# Extracts squashfs, kernel, initrd and generates a ipxe template script - -ISO=$1 -OUTPUT_NAME=$2 -ARTIFACT_NAME=$(basename $OUTPUT_NAME) - -isoinfo -x /rootfs.squashfs -R -i $ISO > $OUTPUT_NAME.squashfs -isoinfo -x /boot/kernel -R -i $ISO > $OUTPUT_NAME-kernel -isoinfo -x /boot/initrd -R -i $ISO > $OUTPUT_NAME-initrd - -URL=${URL:-https://github.com/kairos-io/kairos/releases/download} - -cat > $OUTPUT_NAME.ipxe << EOF -#!ipxe -set url ${URL}/ -set kernel $ARTIFACT_NAME-kernel -set initrd $ARTIFACT_NAME-initrd -set rootfs $ARTIFACT_NAME.squashfs -# set config https://example.com/machine-config -# set cmdline extra.values=1 -kernel \${url}/\${kernel} initrd=\${initrd} ip=dhcp rd.cos.disable root=live:\${url}/\${rootfs} netboot install-mode config_url=\${config} console=tty1 console=ttyS0 \${cmdline} -initrd \${url}/\${initrd} -boot -EOF \ No newline at end of file diff --git a/image-assets/update-os-release.sh b/image-assets/update-os-release.sh deleted file mode 100755 index 00f064f..0000000 --- a/image-assets/update-os-release.sh +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/bash -# usage: -# docker run --rm -ti --entrypoint /update-os-release.sh \ -# -v /etc:/workspace \ # mount the directory where your os-release is, this is by default in /etc but you can mount a different dir for testing -# -e OS_NAME=kairos-core-opensuse-leap \ -# -e OS_VERSION=v2.2.0 \ -# -e OS_ID="kairos" \ -# -e OS_NAME=kairos-core-opensuse-leap \ -# -e BUG_REPORT_URL="https://github.com/kairos-io/kairos/issues" \ -# -e HOME_URL="https://github.com/kairos-io/kairos" \ -# -e OS_REPO="quay.io/kairos/core-opensuse-leap" \ -# -e OS_LABEL="latest" \ -# -e GITHUB_REPO="kairos-io/kairos" \ -# -e VARIANT="core" \ -# -e FLAVOR="opensuse-leap" -# quay.io/kairos/osbuilder-tools:latest - -set -ex - -[ -f "/workspace/kairos-release" ] && sed -i -n '/KAIROS_/!p' /workspace/kairos-release -# Clean up old os-release just in case so we dont have stuff lying around -sed -i -n '/KAIROS_/!p' /workspace/os-release -envsubst >>/workspace/kairos-release < /kairos-release.tmpl - -cat /workspace/kairos-release