From 1859f5824810b66b617b6f80b02614dd9db9b03f Mon Sep 17 00:00:00 2001 From: Ward from fusion-voyager-3 Date: Sat, 10 Aug 2024 17:20:06 +0300 Subject: [PATCH] add pika branches and nvidia support --- .github/workflows/build-canary-v3-iso.yml | 43 ++++++++++++++++ .../workflows/build-canary-v3-nvidia-iso.yml | 46 +++++++++++++++++ .../{build-iso.yml => build-nest-v3-iso.yml} | 9 ++-- .../workflows/build-nest-v3-nvidia-iso.yml | 46 +++++++++++++++++ .github/workflows/release-canary-v3-iso.yml | 46 +++++++++++++++++ .../release-canary-v3-nvidia-iso.yml | 49 +++++++++++++++++++ ...elease-iso.yml => release-nest-v3-iso.yml} | 9 ++-- .../workflows/release-nest-v3-nvidia-iso.yml | 49 +++++++++++++++++++ ... => generate_roofs_from_canaryv3_docker.sh | 0 generate_roofs_from_nestv3_docker.sh | 33 +++++++++++++ info.sh | 5 +- nvidia-hooks/2-link-uname-to-kernel.chroot | 15 ++++++ nvidia-hooks/3-install-nvidia-driver.chroot | 4 ++ 13 files changed, 346 insertions(+), 8 deletions(-) create mode 100644 .github/workflows/build-canary-v3-iso.yml create mode 100644 .github/workflows/build-canary-v3-nvidia-iso.yml rename .github/workflows/{build-iso.yml => build-nest-v3-iso.yml} (78%) create mode 100644 .github/workflows/build-nest-v3-nvidia-iso.yml create mode 100644 .github/workflows/release-canary-v3-iso.yml create mode 100644 .github/workflows/release-canary-v3-nvidia-iso.yml rename .github/workflows/{release-iso.yml => release-nest-v3-iso.yml} (79%) create mode 100644 .github/workflows/release-nest-v3-nvidia-iso.yml rename generate_roofs_from_docker.sh => generate_roofs_from_canaryv3_docker.sh (100%) create mode 100755 generate_roofs_from_nestv3_docker.sh create mode 100755 nvidia-hooks/2-link-uname-to-kernel.chroot create mode 100755 nvidia-hooks/3-install-nvidia-driver.chroot diff --git a/.github/workflows/build-canary-v3-iso.yml b/.github/workflows/build-canary-v3-iso.yml new file mode 100644 index 0000000..b9ae31a --- /dev/null +++ b/.github/workflows/build-canary-v3-iso.yml @@ -0,0 +1,43 @@ +name: Build Canary amd64-v3 ISO + +on: + push: + branches: + - main + paths: + - '.github/build-canary-v3-iso' + +jobs: + build: + runs-on: ubuntu-latest + container: + image: ubuntu:latest + volumes: + - /proc:/proc + options: --privileged -it --cap-add=sys_admin --cap-add mknod --device=/dev/fuse --security-opt seccomp=unconfined --security-opt label=disable + + steps: + - name: Install Some essentials + run: apt-get update -y && apt-get install -y wget npm rsync nodejs + + - 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: Set ISO Info + run: sed "s/#DISTNAME#/PikaOS-Canary/g" -i ./info.sh && sed "s/#ARCH#/amd64-v3/g" -i ./info.sh + + - name: Get ISO Build Dependencies + run: ./get_iso_build_dep.sh + + - name: Generate Image ROOTFS from PikaOS Docker image + run: ./generate_roofs_from_canaryv3_docker.sh + + - name: Build ISO + run: ./build.sh diff --git a/.github/workflows/build-canary-v3-nvidia-iso.yml b/.github/workflows/build-canary-v3-nvidia-iso.yml new file mode 100644 index 0000000..a4367b5 --- /dev/null +++ b/.github/workflows/build-canary-v3-nvidia-iso.yml @@ -0,0 +1,46 @@ +name: Build Canary NVIDIA amd64-v3 ISO + +on: + push: + branches: + - main + paths: + - '.github/build-canary-v3-nvidia-iso' + +jobs: + build: + runs-on: ubuntu-latest + container: + image: ubuntu:latest + volumes: + - /proc:/proc + options: --privileged -it --cap-add=sys_admin --cap-add mknod --device=/dev/fuse --security-opt seccomp=unconfined --security-opt label=disable + + steps: + - name: Install Some essentials + run: apt-get update -y && apt-get install -y wget npm rsync nodejs + + - 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: Set ISO Info + run: sed "s/#DISTNAME#/PikaOS-Canary-NVIDIA/g" -i ./info.sh && sed "s/#ARCH#/amd64-v3/g" -i ./info.sh + + - name: Get ISO Build Dependencies + run: ./get_iso_build_dep.sh + + - name: Enable NVIDIA hooks + run: cp -vf ./nvidia-hooks/* ./hooks/ + + - name: Generate Image ROOTFS from PikaOS Docker image + run: ./generate_roofs_from_canaryv3_docker.sh + + - name: Build ISO + run: ./build.sh diff --git a/.github/workflows/build-iso.yml b/.github/workflows/build-nest-v3-iso.yml similarity index 78% rename from .github/workflows/build-iso.yml rename to .github/workflows/build-nest-v3-iso.yml index a4b67d9..60960bd 100644 --- a/.github/workflows/build-iso.yml +++ b/.github/workflows/build-nest-v3-iso.yml @@ -1,11 +1,11 @@ -name: Build ISO +name: Build Nest amd64-v3 ISO on: push: branches: - main paths: - - '.github/build-iso' + - '.github/build-nest-v3-iso' jobs: build: @@ -30,11 +30,14 @@ jobs: known_hosts: ${{ secrets.KNOWN_HOSTS }} if_key_exists: replace + - name: Set ISO Info + run: sed "s/#DISTNAME#/PikaOS-Nest/g" -i ./info.sh && sed "s/#ARCH#/amd64-v3/g" -i ./info.sh + - name: Get ISO Build Dependencies run: ./get_iso_build_dep.sh - name: Generate Image ROOTFS from PikaOS Docker image - run: ./generate_roofs_from_docker.sh + run: ./generate_roofs_from_nestv3_docker.sh - name: Build ISO run: ./build.sh diff --git a/.github/workflows/build-nest-v3-nvidia-iso.yml b/.github/workflows/build-nest-v3-nvidia-iso.yml new file mode 100644 index 0000000..88c5ee2 --- /dev/null +++ b/.github/workflows/build-nest-v3-nvidia-iso.yml @@ -0,0 +1,46 @@ +name: Build Nest NVIDIA amd64-v3 ISO + +on: + push: + branches: + - main + paths: + - '.github/build-nest-v3-nvidia-iso' + +jobs: + build: + runs-on: ubuntu-latest + container: + image: ubuntu:latest + volumes: + - /proc:/proc + options: --privileged -it --cap-add=sys_admin --cap-add mknod --device=/dev/fuse --security-opt seccomp=unconfined --security-opt label=disable + + steps: + - name: Install Some essentials + run: apt-get update -y && apt-get install -y wget npm rsync nodejs + + - 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: Set ISO Info + run: sed "s/#DISTNAME#/PikaOS-Nest-NVIDIA/g" -i ./info.sh && sed "s/#ARCH#/amd64-v3/g" -i ./info.sh + + - name: Get ISO Build Dependencies + run: ./get_iso_build_dep.sh + + - name: Enable NVIDIA hooks + run: cp -vf ./nvidia-hooks/* ./hooks/ + + - name: Generate Image ROOTFS from PikaOS Docker image + run: ./generate_roofs_from_nestv3_docker.sh + + - name: Build ISO + run: ./build.sh diff --git a/.github/workflows/release-canary-v3-iso.yml b/.github/workflows/release-canary-v3-iso.yml new file mode 100644 index 0000000..fb5d359 --- /dev/null +++ b/.github/workflows/release-canary-v3-iso.yml @@ -0,0 +1,46 @@ +name: Release Canary amd64-v3 ISO + +on: + push: + branches: + - main + paths: + - '.github/release-canary-v3-iso' + +jobs: + build: + runs-on: ubuntu-latest + container: + image: ubuntu:latest + volumes: + - /proc:/proc + options: --privileged -it --cap-add=sys_admin --cap-add mknod --device=/dev/fuse --security-opt seccomp=unconfined --security-opt label=disable + + steps: + - name: Install Some essentials + run: apt-get update -y && apt-get install -y wget npm rsync nodejs + + - 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: Set ISO Info + run: sed "s/#DISTNAME#/PikaOS-Canary/g" -i ./info.sh && sed "s/#ARCH#/amd64-v3/g" -i ./info.sh + + - name: Get ISO Build Dependencies + run: ./get_iso_build_dep.sh + + - name: Generate Image ROOTFS from PikaOS Docker image + run: ./generate_roofs_from_canaryv3_docker.sh + + - name: Build ISO + run: ./build.sh + + - name: Release ISO + run: ./release.sh diff --git a/.github/workflows/release-canary-v3-nvidia-iso.yml b/.github/workflows/release-canary-v3-nvidia-iso.yml new file mode 100644 index 0000000..c61f9ae --- /dev/null +++ b/.github/workflows/release-canary-v3-nvidia-iso.yml @@ -0,0 +1,49 @@ +name: Release Canary NVIDIA amd64-v3 ISO + +on: + push: + branches: + - main + paths: + - '.github/release-canary-v3-nvidia-iso' + +jobs: + build: + runs-on: ubuntu-latest + container: + image: ubuntu:latest + volumes: + - /proc:/proc + options: --privileged -it --cap-add=sys_admin --cap-add mknod --device=/dev/fuse --security-opt seccomp=unconfined --security-opt label=disable + + steps: + - name: Install Some essentials + run: apt-get update -y && apt-get install -y wget npm rsync nodejs + + - 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: Set ISO Info + run: sed "s/#DISTNAME#/PikaOS-Canary-NVIDIA/g" -i ./info.sh && sed "s/#ARCH#/amd64-v3/g" -i ./info.sh + + - name: Get ISO Build Dependencies + run: ./get_iso_build_dep.sh + + - name: Enable NVIDIA hooks + run: cp -vf ./nvidia-hooks/* ./hooks/ + + - name: Generate Image ROOTFS from PikaOS Docker image + run: ./generate_roofs_from_canaryv3_docker.sh + + - name: Build ISO + run: ./build.sh + + - name: Release ISO + run: ./release.sh diff --git a/.github/workflows/release-iso.yml b/.github/workflows/release-nest-v3-iso.yml similarity index 79% rename from .github/workflows/release-iso.yml rename to .github/workflows/release-nest-v3-iso.yml index ebe5a00..76abaeb 100644 --- a/.github/workflows/release-iso.yml +++ b/.github/workflows/release-nest-v3-iso.yml @@ -1,11 +1,11 @@ -name: Release ISO +name: Release Nest amd64-v3 ISO on: push: branches: - main paths: - - '.github/release-iso' + - '.github/release-nest-v3-iso' jobs: build: @@ -30,11 +30,14 @@ jobs: known_hosts: ${{ secrets.KNOWN_HOSTS }} if_key_exists: replace + - name: Set ISO Info + run: sed "s/#DISTNAME#/PikaOS-Nest/g" -i ./info.sh && sed "s/#ARCH#/amd64-v3/g" -i ./info.sh + - name: Get ISO Build Dependencies run: ./get_iso_build_dep.sh - name: Generate Image ROOTFS from PikaOS Docker image - run: ./generate_roofs_from_docker.sh + run: ./generate_roofs_from_nestv3_docker.sh - name: Build ISO run: ./build.sh diff --git a/.github/workflows/release-nest-v3-nvidia-iso.yml b/.github/workflows/release-nest-v3-nvidia-iso.yml new file mode 100644 index 0000000..68fd43a --- /dev/null +++ b/.github/workflows/release-nest-v3-nvidia-iso.yml @@ -0,0 +1,49 @@ +name: Release Nest NVIDIA amd64-v3 ISO + +on: + push: + branches: + - main + paths: + - '.github/release-nest-v3-nvidia-iso' + +jobs: + build: + runs-on: ubuntu-latest + container: + image: ubuntu:latest + volumes: + - /proc:/proc + options: --privileged -it --cap-add=sys_admin --cap-add mknod --device=/dev/fuse --security-opt seccomp=unconfined --security-opt label=disable + + steps: + - name: Install Some essentials + run: apt-get update -y && apt-get install -y wget npm rsync nodejs + + - 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: Set ISO Info + run: sed "s/#DISTNAME#/PikaOS-Nest-NVIDIA/g" -i ./info.sh && sed "s/#ARCH#/amd64-v3/g" -i ./info.sh + + - name: Get ISO Build Dependencies + run: ./get_iso_build_dep.sh + + - name: Enable NVIDIA hooks + run: cp -vf ./nvidia-hooks/* ./hooks/ + + - name: Generate Image ROOTFS from PikaOS Docker image + run: ./generate_roofs_from_nestv3_docker.sh + + - name: Build ISO + run: ./build.sh + + - name: Release ISO + run: ./release.sh diff --git a/generate_roofs_from_docker.sh b/generate_roofs_from_canaryv3_docker.sh similarity index 100% rename from generate_roofs_from_docker.sh rename to generate_roofs_from_canaryv3_docker.sh diff --git a/generate_roofs_from_nestv3_docker.sh b/generate_roofs_from_nestv3_docker.sh new file mode 100755 index 0000000..da3a5a1 --- /dev/null +++ b/generate_roofs_from_nestv3_docker.sh @@ -0,0 +1,33 @@ +#! /bin/bash + +set -e + +source ./info.sh + +mkdir -p "$ROOTFS_PATH" + +mkdir -p "$LIVE_BOOT_DATA_PATH" + +mkdir -p "$LIVE_BOOT_LIVE_PATH" + +# Pull and mount docker image + +podman --storage-driver=vfs pull ghcr.io/pikaos-linux/pikaos-base:nestv3 + +podman --storage-driver=vfs image mount pikaos-linux/pikaos-base:nestv3 > ./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 $LIVE_HOSTNAME | tee "$ROOTFS_PATH/etc/hostname" diff --git a/info.sh b/info.sh index 5a0d871..589a928 100755 --- a/info.sh +++ b/info.sh @@ -5,8 +5,9 @@ export LIVE_BOOT_DATA_PATH="$LIVE_BOOT_PATH/data" export LIVE_BOOT_LIVE_PATH="$LIVE_BOOT_DATA_PATH/live" export ROOTFS_PATH="$LIVE_BOOT_PATH/rootfs" export LIVE_HOSTNAME="pikaos" -export ISO_DISTNAME="PikaOS" -export ISO_ARCH="amd64-v3" +export ISO_DISTNAME="#DISTNAME#" +export ISO_KERNEL="6.10-pikaos" +export ISO_ARCH="#ARCH#" export ISO_RELEASE="4.0" export ISO_DESKTOP="GNOME" export ISO_PATCH="4" diff --git a/nvidia-hooks/2-link-uname-to-kernel.chroot b/nvidia-hooks/2-link-uname-to-kernel.chroot new file mode 100755 index 0000000..e7b385d --- /dev/null +++ b/nvidia-hooks/2-link-uname-to-kernel.chroot @@ -0,0 +1,15 @@ +#!/bin/bash + +. /chroot_scripts/info.sh + +if [ -z $ISO_KERNEL ] +then + exit 1 +fi + +echo "Workaround: Link chroot kernel to host kernel..." +ln -sfv /boot/config-$ISO_KERNEL /boot/config-$(uname -r) +ln -sfv /boot/initrd.img-$ISO_KERNEL /boot/initrd.img-$(uname -r) +ln -sfv /usr/src/linux-headers-$ISO_KERNEL /usr/src/linux-headers-$(uname -r) +ln -sfv /boot/System.map-$ISO_KERNEL /boot/System.map-$(uname -r) +ln -sfv /boot/vmlinuz-$ISO_KERNEL /boot/vmlinuz-$(uname -r) \ No newline at end of file diff --git a/nvidia-hooks/3-install-nvidia-driver.chroot b/nvidia-hooks/3-install-nvidia-driver.chroot new file mode 100755 index 0000000..4862e74 --- /dev/null +++ b/nvidia-hooks/3-install-nvidia-driver.chroot @@ -0,0 +1,4 @@ +#!/bin/bash + +apt-get install --yes --option Dpkg::Options::="--force-confnew" \ + nvidia-driver-555 \ No newline at end of file