diff --git a/.github/push-iso b/.github/push-iso new file mode 100644 index 0000000..56a6051 --- /dev/null +++ b/.github/push-iso @@ -0,0 +1 @@ +1 \ No newline at end of file diff --git a/.github/workflows/push-iso.yml b/.github/workflows/push-iso.yml new file mode 100644 index 0000000..36ef937 --- /dev/null +++ b/.github/workflows/push-iso.yml @@ -0,0 +1,37 @@ +name: Push ISO + +on: + push: + branches: + - main + paths: + - '.github/push-iso' + +jobs: + build: + runs-on: ubuntu-latest + container: + image: ubuntu:latest + volumes: + - /proc:/proc + options: --privileged -it + + steps: + - uses: actions/checkout@v3 + + - name: Install SSH key + uses: shimataro/ssh-key-action@v2 + with: + key: ${{ secrets.SSH_KEY }} + name: id_rsa + known_hosts: ${{ secrets.KNOWN_HOSTS }} + if_key_exists: replace + + - name: Update APT Cache + run: apt-get update -y + + - name: Get ISO Build Dependencies + run: ./generate_roofs_from_docker.sh + + - name: Generate Image ROOTFS from PikaOS Docker image + run: ./generate_roofs_from_docker.sh diff --git a/generate_roofs_from_docker.sh b/generate_roofs_from_docker.sh new file mode 100755 index 0000000..c5584a7 --- /dev/null +++ b/generate_roofs_from_docker.sh @@ -0,0 +1,31 @@ +#! /bin/bash + +set -e + +mkdir -p "./LIVE_BOOT/rootfs" + +ROOTFS_PATH="./LIVE_BOOT/rootfs" + +# Pull and mount docker image + +podman pull ghcr.io/pikaos-linux/pikaos-base:canaryv3 + +podman image mount pikaos-linux/pikaos-base:canaryv3 > ./docker-merged-path + +DOCKER_MERGED_PATH=$(cat ./docker-merged-path) + +# Safely Copy merged path contents to rootfs + +rsync -av $DOCKER_MERGED_PATH/* $ROOTFS_PATH/ + +# Clean up Docker specific things + +rm -rfv $ROOTFS_PATH/etc/apt/preferences.d/*docker* + +rm -rfv $ROOTFS_PATH/etc/dpkg/dpkg.cfg.d/*docker* + +# Setup hostname + +echo "pikaos" | tee "$ROOTFS_PATH/etc/hostname" + +ls $ROOTFS_PATH/ diff --git a/get_iso_build_dep.sh b/get_iso_build_dep.sh new file mode 100755 index 0000000..602d9f6 --- /dev/null +++ b/get_iso_build_dep.sh @@ -0,0 +1,19 @@ +#! /bin/bash + +set -e + +export DEBIAN_FRONTEND="noninteractive" + +apt-get install -y --option Dpkg::Options::="--force-confnew" \ + debootstrap \ + squashfs-tools \ + xorriso \ + isolinux \ + syslinux-efi \ + grub-pc-bin \ + grub-efi-amd64-bin \ + grub-efi-ia32-bin \ + mtools \ + dosfstools \ + rsync \ + podman