From 9b7a0286140df1742a35516a8db96091b3e0f6d6 Mon Sep 17 00:00:00 2001 From: Ward from fusion-voyager-3 Date: Thu, 1 Aug 2024 02:32:19 +0300 Subject: [PATCH] attempt 0 at making rootfs from docker --- .github/push-iso | 1 + .github/workflows/push-iso.yml | 37 ++++++++++++++++++++++++++++++++++ generate_roofs_from_docker.sh | 31 ++++++++++++++++++++++++++++ get_iso_build_dep.sh | 19 +++++++++++++++++ 4 files changed, 88 insertions(+) create mode 100644 .github/push-iso create mode 100644 .github/workflows/push-iso.yml create mode 100755 generate_roofs_from_docker.sh create mode 100755 get_iso_build_dep.sh 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