Skip to content

Commit

Permalink
Use Official Kubuntu ISO
Browse files Browse the repository at this point in the history
  • Loading branch information
AdityaGarg8 committed Dec 13, 2024
1 parent 2ae4bbd commit 86c0e14
Show file tree
Hide file tree
Showing 20 changed files with 214 additions and 1,053 deletions.
34 changes: 14 additions & 20 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ jobs:

- name: Get version
run: |
VERSION=$(grep ^KERNEL_VERSION build.sh | head -n1| cut -d = -f2)
REL=$(grep "PKGREL=\d*" build.sh | cut -d = -f2)
VERSION=$(egrep ^KERNEL_VERSION build.sh|cut -d= -f2)
REL=$(egrep ^PKGREL build.sh|cut -d= -f2)
echo "ver=${VERSION}" >> $GITHUB_ENV
echo "release=${REL}" >> $GITHUB_ENV
Expand Down Expand Up @@ -46,40 +46,34 @@ jobs:
- name: Build
run: sudo ./build_in_docker.sh

- name: print sha256sum
run: cat output/sha256*

- name: Generate Tag
id: tag
run: |
VER=$(egrep ^KERNEL_VERSION build.sh|cut -d= -f2)
REL=$(grep "PKGREL=\d*" build.sh | cut -d = -f2)
echo Version is $VER
REL=$(egrep ^PKGREL build.sh|cut -d= -f2)
echo Version is ${VER}-${REL}
echo "kver=${VER}" >> $GITHUB_ENV
echo "isotag=${VER}-${REL}" >> $GITHUB_ENV
- name: Run build script
run: |
chmod +x ${{ github.workspace }}/build_in_docker.sh
${{ github.workspace }}/build_in_docker.sh
- name: Upload iso artifact
- name: Upload package artifact
uses: actions/upload-artifact@v4
with:
name: mbp-ubuntu-${{ steps.tag.outputs.tag }}.z01
path: ${{ github.workspace }}/output/*
name: Kubuntu-24.04
path: ${{ github.workspace }}/output/*.iso

- name: Instructions for putting it back together
- name: Remove unsplit ISO
run: |
cat << EOF
Download all the artifacts, and put them in a folder
without other files. Then run:"
unzip "*.z??.zip"
cat livecd-${{ env.isotag }}-t2.z?? > cd.zip
echo unzip cd.zip
EOF
sudo rm ${{ github.workspace }}/output/*.iso
- name: Release
if: github.ref == 'refs/heads/kubuntuLTS'
uses: softprops/action-gh-release@v2
with:
#files: ${{ github.workspace }}/ISO/*.tar.gz
#files: ${{ github.workspace }}/ISO/*.iso
files: ${{ github.workspace }}/output/*
tag_name: v${{ env.isotag }}
body_path: ${{ github.workspace }}/.github/workflows/instructions.txt
Expand Down
49 changes: 0 additions & 49 deletions .travis.yml

This file was deleted.

37 changes: 0 additions & 37 deletions 01_build_file_system.sh

This file was deleted.

18 changes: 18 additions & 0 deletions 01_edit_iso.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/bash

set -eu -o pipefail
# Prepare the ISO Directories
mkdir -p "$ISO_MOUNT_DIR" "$ISO_WORK_DIR" "$CHROOT_DIR"
# Mount the Original ISO and Copy Files
echo "mounting $ISO_IMAGE"
if [ ! -f "$ISO_IMAGE" ]; then
echo "Error: ISO file $ISO_IMAGE not found."
exit 1
fi
mount -o loop "$(pwd)/$ISO_IMAGE" "$ISO_MOUNT_DIR"
rsync -a "$ISO_MOUNT_DIR/" "$ISO_WORK_DIR"
umount "$ISO_MOUNT_DIR"
unsquashfs -d "$CHROOT_DIR" "$ISO_WORK_DIR/casper/filesystem.squashfs"
rm "$(pwd)/$ISO_IMAGE"


49 changes: 0 additions & 49 deletions 02_build_image.sh

This file was deleted.

51 changes: 51 additions & 0 deletions 02_create_iso.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
#!/bin/bash

set -eu -o pipefail
echo >&2 "===]> Info: Getting Kernel version ... "
echo $T2_KERNEL
# Update GRUB Configuration in ISO
echo >&2 "===]> Info: Copying Linux vmlinuz and initrd ... "
cp "$CHROOT_DIR/boot/vmlinuz-$T2_KERNEL" "$ISO_WORK_DIR/casper/vmlinuz"
cp "$CHROOT_DIR/boot/initrd.img-$T2_KERNEL" "$ISO_WORK_DIR/casper/initrd"

echo >&2 "===]> Info: Modify existing grub.cfg ..."
sed -i 's/--- quiet splash/boot=casper quiet splash intel_iommu=on iommu=pt pcie_ports=native ---/g' "$ISO_WORK_DIR/boot/grub/grub.cfg"

echo >&2 "===]> Info: Creating EFI image ... "
dd if=/dev/zero of="$ISO_WORK_DIR/EFI/efiboot.img" bs=1M count=10
mkfs.vfat "$ISO_WORK_DIR/EFI/efiboot.img"

mkdir -p /mnt/efiboot
mount "$ISO_WORK_DIR/EFI/efiboot.img" /mnt/efiboot
# Create the EFI/boot directory
mkdir -p /mnt/efiboot/EFI/boot
cp "$ISO_WORK_DIR/EFI/boot/grubx64.efi" /mnt/efiboot/EFI/boot/bootx64.efi
# Clean up EFI temp folders
umount /mnt/efiboot
rmdir /mnt/efiboot
echo >&2 "===]> Info: Generating final ISO ... "
(cd "$ISO_WORK_DIR" && find . -type f -print0 | xargs -0 md5sum > md5sum.txt)

# Ensure the output directory exists
mkdir -p "$(dirname "$ISO_IMAGE_OUTPUT")"

xorriso -as mkisofs \
-iso-level 3 \
-full-iso9660-filenames \
-volid "T2-KUBUNTU" \
-eltorito-boot boot/grub/i386-pc/eltorito.img \
-no-emul-boot \
-boot-load-size 4 \
-boot-info-table \
-eltorito-alt-boot \
-eltorito-platform efi \
-eltorito-boot EFI/efiboot.img \
-no-emul-boot \
-isohybrid-gpt-basdat \
-isohybrid-apm-hfsplus \
-output ${ISO_IMAGE_OUTPUT} \
${ISO_WORK_DIR}

echo >&2 "===]> Info: Custom ISO creation process complete. Find the ISO at ${ISO_IMAGE_OUTPUT} ..."


36 changes: 0 additions & 36 deletions 03_prepare_iso.sh

This file was deleted.

30 changes: 0 additions & 30 deletions 04_create_iso.sh

This file was deleted.

Loading

0 comments on commit 86c0e14

Please sign in to comment.