From 6c74455c702f520e7f0f3b59f4faebcb9e1c9b5d Mon Sep 17 00:00:00 2001 From: Aditya Garg Date: Sat, 3 Jun 2023 14:05:25 +0530 Subject: [PATCH] 6.3.5 --- .github/workflows/CI.yml | 4 ++ .github/workflows/iso.sh | 131 +++++++++++++++++++++++++++++++++++++++ build.sh | 2 +- 3 files changed, 136 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/iso.sh diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index f71fccb..32dfd46 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -83,6 +83,10 @@ jobs: tar -czvf ${ISONAME}.tar.gz ${ISONAME}.iso ls -l + - name: Get the ISO script + run: | + cp ${{ github.workspace }}/.github/workflows/iso.sh ${{ github.workspace }}/output/iso.sh + - name: Release if: github.ref == 'refs/heads/jammy' uses: softprops/action-gh-release@v1 diff --git a/.github/workflows/iso.sh b/.github/workflows/iso.sh new file mode 100644 index 0000000..67ba200 --- /dev/null +++ b/.github/workflows/iso.sh @@ -0,0 +1,131 @@ +#!/bin/bash + +os=$(uname -s) +case "$os" in + (Darwin) + true + ;; + (Linux) + true + ;; + (*) + echo "This script is meant to be run only on Linux or macOS" + exit 1 + ;; +esac + +echo -e "GET http://github.com HTTP/1.0\n\n" | nc github.com 80 > /dev/null 2>&1 + +if [ $? -eq 0 ]; then + true +else + echo "Please connect to the internet" + exit 1 +fi + +set -e + +cd $HOME/Downloads + +latest=$(curl -sL https://github.com/t2linux/T2-Ubuntu/releases/latest/ | grep "Release" | awk -F " " '{print $2}' ) +latestkver=$(echo $latest | cut -d "v" -f 2 | cut -d "-" -f 1) + +cat <<EOF + +Choose the flavour of Ubuntu you wish to install: + +1. Ubuntu +2. Kubuntu + +Type your choice (1 or 2) from the above list and press return. +EOF + +read flavinput + +case "$flavinput" in + (1) + flavour=ubuntu + ;; + (2) + flavour=kubuntu + ;; + (*) + echo "Invalid input. Aborting!" + exit 1 + ;; +esac + +cat <<EOF + +Choose the version of Ubuntu you wish to install: + +1. 22.04 LTS - Jammy Jellyfish +2. 23.04 - Lunar Lobstar + +Type your choice (1 or 2) from the above list and press return. +EOF + +read verinput + +case "$verinput" in + (1) + iso="${flavour}-22.04-${latestkver}-t2-jammy" + ver="22.04 LTS - Jammy Jellyfish" + ;; + (2) + iso="${flavour}-23.04-${latestkver}-t2-lunar" + ver="23.04 - Lunar Lobstar" + ;; + (*) + echo "Invalid input. Aborting!" + exit 1 + ;; +esac + +flavourcap=`echo ${flavour:0:1} | tr '[a-z]' '[A-Z]'`${flavour:1} + +echo -e "\nDownloading ${flavourcap} ${ver}" +echo -e "\nPart 1" +curl -#L https://github.com/t2linux/T2-Ubuntu/releases/download/${latest}/${iso}.z01 > ${iso}.z01 +echo -e "\nPart 2" +curl -#L https://github.com/t2linux/T2-Ubuntu/releases/download/${latest}/${iso}.zip > ${iso}.zip +echo -e "\nCreating ISO" + +isofinal=$RANDOM +zip -F ${iso}.zip --out ${isofinal}.zip > /dev/null +unzip ${isofinal}.zip > /dev/null +mv $HOME/Downloads/repo/${iso}.iso $HOME/Downloads + +echo -e "\nVerifying sha256 checksums" + +actual_iso_chksum=$(curl -sL https://github.com/t2linux/T2-Ubuntu/releases/download/${latest}/sha256-${flavour}-$(echo ${ver} | cut -d " " -f 1) | cut -d " " -f 1) + +case "$os" in + (Darwin) + downloaded_iso_chksum=$(shasum -a 256 $HOME/Downloads/${iso}.iso | cut -d " " -f 1) + ;; + (Linux) + downloaded_iso_chksum=$(sha256sum $HOME/Downloads/${iso}.iso | cut -d " " -f 1) + ;; + (*) + echo "This script is meant to be run only on Linux or macOS" + exit 1 + ;; +esac + +if [[ ${actual_iso_chksum} != ${downloaded_iso_chksum} ]] +then +echo -e "\nError: Failed to verify sha256 checksums of the ISO" +rm $HOME/Downloads/${iso}.iso +fi + +rm -r $HOME/Downloads/repo +rm $HOME/Downloads/${isofinal}.zip +rm $HOME/Downloads/${iso}.z?? + +if [[ ${actual_iso_chksum} != ${downloaded_iso_chksum} ]] +then +exit 1 +fi + +echo -e "\nISO saved to Downloads" diff --git a/build.sh b/build.sh index 69de4aa..6ed9a0c 100755 --- a/build.sh +++ b/build.sh @@ -5,7 +5,7 @@ ROOT_PATH=$(pwd) WORKING_PATH=/root/work CHROOT_PATH="${WORKING_PATH}/chroot" IMAGE_PATH="${WORKING_PATH}/image" -KERNEL_VERSION=6.3.3 +KERNEL_VERSION=6.3.5 PKGREL=1 sed -i "s/KVER/${KERNEL_VERSION}/g" $(pwd)/files/chroot_build.sh sed -i "s/PREL/${PKGREL}/g" $(pwd)/files/chroot_build.sh