diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 8829dfd..5c153c4 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -2,142 +2,178 @@ name: CI # yamllint disable-line rule:truthy on: - [push] + [push, workflow_dispatch] jobs: - Kernel: - runs-on: ubuntu-22.04 + + ISO-Kubuntu: + runs-on: ubuntu-latest steps: - - name: Free up disk space for the CI - uses: AdityaGarg8/remove-unwanted-software@v1 - with: - remove-android: 'true' - remove-dotnet: 'true' - remove-haskell: 'false' + - uses: actions/checkout@v4 - - uses: actions/checkout@v3 + - name: Generate Tag + id: tag + run: | + VER=$(egrep ^KERNEL_VERSION build.sh|cut -d= -f2) + 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: Build kernel with internal SSD removed + - name: Run build script run: | - VERSION=$(grep ^KERNEL_VERSION build.sh | head -n1| cut -d = -f2) - REL=$(grep "PKGREL=\d*" build.sh | cut -d = -f2) - echo "kerneltag=${VERSION}-${REL}" >> $GITHUB_ENV - sudo apt install git - mkdir /tmp/artifacts - git clone https://github.com/t2linux/T2-Ubuntu-Kernel.git - sed -i 's/LOCALVERSION=-t2-\"${CODENAME}\"/LOCALVERSION=-t2-external/g' ${{ github.workspace }}/T2-Ubuntu-Kernel/build.sh - cd ${{ github.workspace }}/T2-Ubuntu-Kernel/patches - wget https://github.com/AdityaGarg8/T2-Ubuntu/raw/ssd/ssd.patch - cd ${{ github.workspace }}/T2-Ubuntu-Kernel - sudo ./build.sh - sudo rm /tmp/artifacts/*dbg* - sudo rm /tmp/artifacts/*libc-dev* + chmod +x ${{ github.workspace }}/build_in_docker.sh + ${{ github.workspace }}/build_in_docker.sh kubuntu - name: Upload package artifact - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: - name: kernel-${{ env.kerneltag }} - path: /tmp/artifacts/* + name: Kubuntu-25.04 + path: ${{ github.workspace }}/output/*.iso + - name: Remove unsplit ISO + run: | + sudo rm ${{ github.workspace }}/output/*.iso - name: Release - if: github.ref == 'refs/heads/jammy' - uses: softprops/action-gh-release@v1 + if: github.ref == 'refs/heads/flavourMainline' + uses: softprops/action-gh-release@v2 with: - files: | - /tmp/artifacts/*.deb - tag_name: v${{ env.kerneltag }}-kernel + files: ${{ github.workspace }}/output/* + tag_name: v${{ env.isotag }} + #body_path: ${{ github.workspace }}/.github/workflows/instructions.txt draft: false - prerelease: true + prerelease: false env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - Safe-graphics: - needs: [Kernel] - runs-on: ubuntu-22.04 - steps: - - name: 'Checkout Jammy Repo' - uses: actions/checkout@v3 - - - name: Get version + - name: Update the json + if: github.ref == 'refs/heads/flavourMainline' run: | - VERSION=$(grep ^KERNEL_VERSION build.sh | head -n1| cut -d = -f2) - REL=$(grep "PKGREL=\d*" build.sh | cut -d = -f2) - echo "ver=${VERSION}" >> $GITHUB_ENV - echo "release=${REL}" >> $GITHUB_ENV - - - name: 'Checkout jammy-16,4 Repo' - uses: actions/checkout@v3 - with: - ref: jammy-16,4 - persist-credentials: false + git clone https://github.com/t2linux/wiki.git + cd wiki/docs/tools + + cat << EOF > update.py + import json + # Define the new links + new_link1 = "https://github.com/t2linux/T2-Ubuntu/releases/download/v${{ env.isotag }}/kubuntu-25.04-${{ env.kver }}-t2-plucky.iso.00" + new_link2 = "https://github.com/t2linux/T2-Ubuntu/releases/download/v${{ env.isotag }}/kubuntu-25.04-${{ env.kver }}-t2-plucky.iso.01" + new_link3 = "https://github.com/t2linux/T2-Ubuntu/releases/download/v${{ env.isotag }}/kubuntu-25.04-${{ env.kver }}-t2-plucky.iso.02" + # Load the JSON file + with open('distro-metadata.json', 'r') as file: + data = json.load(file) + # Function to update the links + def update_links(distros, name, new_links): + for distro in distros: + if distro['name'] == name: + distro['iso'] = new_links + # Update the links + update_links(data['all'], "Kubuntu 25.04 - Plucky Puffin", [new_link1, new_link2, new_link3]) + # Save the updated JSON back to the file + with open('distro-metadata.json', 'w') as file: + json.dump(data, file, indent=2) + print("Links updated successfully.") + EOF - - name: 'Push new version to jammy-16,4' - id: publish - run: | - sed -i "s/KERNEL_VERSION=6.*/KERNEL_VERSION=${{ env.ver }}/g" build.sh - sed -i "s/PKGREL=.*/PKGREL=${{ env.release }}/g" build.sh - git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" - git config --local user.name "github-actions[bot]" - git commit -m "${{ env.ver }}-${{ env.release }}" -a - - name: Push changes to the repo - uses: ad-m/github-push-action@master - with: - github_token: ${{ secrets.PAT }} - branch: jammy-16,4 + python3 update.py + rm update.py + cd - - ISO: - needs: [Kernel] - runs-on: ubuntu-22.04 + - name: Push updated links to t2linux.org + if: github.ref == 'refs/heads/flavourMainline' + uses: cpina/github-action-push-to-another-repository@main + env: + API_TOKEN_GITHUB: ${{ secrets.PAT }} + with: + source-directory: 'wiki' + destination-github-username: 't2linux' + destination-repository-name: 'wiki' + user-email: github-actions[bot]@users.noreply.github.com + user-name: github-actions[bot] + target-branch: master + commit-message: Distro metadata - Update Kubuntu 25.04 to v${{ env.isotag }} + + ISO-Ubuntu-Unity: + runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - - name: Build - run: sudo ./build.sh - - - name: print sha256sum - run: cat output/sha256 + - uses: actions/checkout@v4 - 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: Upload iso artifact - uses: actions/upload-artifact@v2 + - name: Run build script + run: | + chmod +x ${{ github.workspace }}/build_in_docker.sh + ${{ github.workspace }}/build_in_docker.sh ubuntu-unity + + - name: Upload package artifact + uses: actions/upload-artifact@v4 with: - name: mbp-ubuntu-${{ steps.tag.outputs.tag }}.z01 - path: ${{ github.workspace }}/output/* + name: Ubuntu-Unity-25.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/jammy' - uses: softprops/action-gh-release@v1 + if: github.ref == 'refs/heads/flavourMainline' + uses: softprops/action-gh-release@v2 with: - files: ${{ github.workspace }}/*.iso - tag_name: v22.04-${{ env.isotag }} - body_path: ${{ github.workspace }}/.github/workflows/instructions.txt + files: ${{ github.workspace }}/output/* + tag_name: v${{ env.isotag }} + #body_path: ${{ github.workspace }}/.github/workflows/instructions.txt draft: false prerelease: false env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Delete kernel from releases - if: github.ref == 'refs/heads/jammy' - uses: dev-drprasad/delete-tag-and-release@v0.2.0 - with: - delete_release: true - tag_name: v${{ env.isotag }}-kernel + - name: Update the json + if: github.ref == 'refs/heads/flavourMainline' + run: | + git clone https://github.com/t2linux/wiki.git + cd wiki/docs/tools + + cat << EOF > update.py + import json + # Define the new links + new_link1 = "https://github.com/t2linux/T2-Ubuntu/releases/download/v${{ env.isotag }}/ubuntu-unity-25.04-${{ env.kver }}-t2-plucky.iso.00" + new_link2 = "https://github.com/t2linux/T2-Ubuntu/releases/download/v${{ env.isotag }}/ubuntu-unity-25.04-${{ env.kver }}-t2-plucky.iso.01" + new_link3 = "https://github.com/t2linux/T2-Ubuntu/releases/download/v${{ env.isotag }}/ubuntu-unity-25.04-${{ env.kver }}-t2-plucky.iso.02" + # Load the JSON file + with open('distro-metadata.json', 'r') as file: + data = json.load(file) + # Function to update the links + def update_links(distros, name, new_links): + for distro in distros: + if distro['name'] == name: + distro['iso'] = new_links + # Update the links + update_links(data['all'], "Ubuntu Unity 25.04 - Plucky Puffin", [new_link1, new_link2, new_link3]) + # Save the updated JSON back to the file + with open('distro-metadata.json', 'w') as file: + json.dump(data, file, indent=2) + print("Links updated successfully.") + EOF + + python3 update.py + rm update.py + cd - + + - name: Push updated links to t2linux.org + if: github.ref == 'refs/heads/flavourMainline' + uses: cpina/github-action-push-to-another-repository@main env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + API_TOKEN_GITHUB: ${{ secrets.PAT }} + with: + source-directory: 'wiki' + destination-github-username: 't2linux' + destination-repository-name: 'wiki' + user-email: github-actions[bot]@users.noreply.github.com + user-name: github-actions[bot] + target-branch: master + commit-message: Distro metadata - Update Ubuntu Unity 25.04 to v${{ env.isotag }} diff --git a/.github/workflows/instructions.txt b/.github/workflows/instructions.txt index 979ee8b..d00d29c 100644 --- a/.github/workflows/instructions.txt +++ b/.github/workflows/instructions.txt @@ -1,7 +1,13 @@ -If you are facing blank screen after installation, try [booting using refind](https://wiki.t2linux.org/guides/refind/). +## How to download the ISO? -Follow [this guide](https://wiki.t2linux.org/guides/wifi-bluetooth/) for Wi-Fi and Bluetooth to work. +Download the "iso.sh" script in the **assets** below, run it on the terminal and follow the on screen instructions. -Users of **MacBookPro16,4** are recommended to use the safe graphics ISO as the kernel doesn't have the driver for their AMD Graphics Card. Rest users can use the normal ISO. +## Adding Wi-Fi and Bluetooth support: -The **t2-external** ISO has the internal SSD support removed in the kernel. This can be useful if you wish to install in an external SSD. After installation, you can update your kernel to a **t2** kernel by following [this guide](https://github.com/t2linux/T2-Ubuntu-Kernel#installation) which shall bring back internal SSD support. +Once you're booted and in your desktop, run `get-apple-firmware` and choose the option **"Retrieve the firmware directly from macOS"**. + +If this method doesn't work, follow [this guide](https://wiki.t2linux.org/guides/wifi-bluetooth/) to get firmware for Wi-Fi and Bluetooth. + +## Adding support for customisable Touch Bar: + +If your Mac has a Touch Bar, and you want to customise it, install `tiny-dfr` by running `sudo apt update && sudo apt install tiny-dfr`. After installing restart your Mac and run `sudo touchbar` to customise. diff --git a/.gitignore b/.gitignore index b0e16d3..d8d7702 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ output /.idea +.DS_Store \ No newline at end of file diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 80f4515..0000000 --- a/.travis.yml +++ /dev/null @@ -1,49 +0,0 @@ ---- -language: bash - -os: - - linux - -services: - - docker - -# branches: -# only: -# - master - -stages: - - test - - build_deploy - -jobs: - include: - - stage: test - name: "YamlLint" - script: | - docker run --rm -v $(pwd):/repo -it alpine:latest /bin/sh -c ' - cd /repo - apk add --no-cache python3 py-pip - pip install yamllint - yamllint . - ' - - stage: test - name: "ShellCheck" - script: | - docker run --rm -v $(pwd):/repo -it alpine:latest /bin/sh -c ' - cd /repo - apk add --no-cache shellcheck bash - shellcheck ./*.sh - shellcheck ./files/*.sh - ' - - stage: build_deploy - name: "Build Ubuntu and Deploy to GitHub Releases" - script: ./build_in_docker.sh - deploy: - provider: releases - api_key: "$GITHUB_TOKEN" - file_glob: true - file: "output/*" - skip_cleanup: true - # yamllint disable-line rule:truthy - on: - tags: true diff --git a/01_build_file_system.sh b/01_build_file_system.sh deleted file mode 100755 index 265e0ae..0000000 --- a/01_build_file_system.sh +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/bash -set -eu -o pipefail - -echo >&2 "===]> Info: Checkout bootstrap... " -debootstrap \ - --arch=amd64 \ - --variant=minbase \ - jammy \ - "${CHROOT_PATH}" \ - http://archive.ubuntu.com/ubuntu/ - -echo >&2 "===]> Info: Creating chroot environment... " -mount --bind /dev "${CHROOT_PATH}/dev" -mount --bind /run "${CHROOT_PATH}/run" - -cp -r "${ROOT_PATH}/files" "${CHROOT_PATH}/tmp/setup_files" -chroot "${CHROOT_PATH}" /bin/bash -c "KERNEL_VERSION=${KERNEL_VERSION} /tmp/setup_files/chroot_build.sh" - -echo >&2 "===]> Info: Cleanup the chroot environment... " -# In docker there is no run? -#umount "${CHROOT_PATH}/run" -umount "${CHROOT_PATH}/dev" - - -## Copy audio config files -#echo >&2 "===]> Info: Copy audio config files... " -#mkdir -p "${CHROOT_PATH}"/usr/share/alsa/cards/ -#cp -fv "${ROOT_PATH}"/files/audio/AppleT2.conf "${CHROOT_PATH}"/usr/share/alsa/cards/AppleT2.conf -#cp -fv "${ROOT_PATH}"/files/audio/apple-t2.conf "${CHROOT_PATH}"/usr/share/pulseaudio/alsa-mixer/profile-sets/apple-t2.conf -#cp -fv "${ROOT_PATH}"/files/audio/91-pulseaudio-custom.rules "${CHROOT_PATH}"/usr/lib/udev/rules.d/91-pulseaudio-custom.rules -#printf "\n load-module module-combine-sink channels=6 channel_map=front-left,front-right,rear-left,rear-right,front-center,lfe" >> /etc/pulse/default.pa -#printf "\ndefault-sample-channels = 6\nremixing-produce-lfe = yes\nremixing-consume-lfe = yes" >> /etc/pulse/daemon.conf - -### Copy grub config without finding macos partition -echo >&2 "===]> Info: Patch Grub... " -cp -rfv "${ROOT_PATH}"/files/grub/30_os-prober "${CHROOT_PATH}"/etc/grub.d/30_os-prober -chmod 755 "${CHROOT_PATH}"/etc/grub.d/30_os-prober - -### Copy suspend fix -echo >&2 "===]> Info: Fix suspend... " -cp -rfv "${ROOT_PATH}"/files/suspend/rmmod_tb.sh "${CHROOT_PATH}"/lib/systemd/system-sleep/rmmod_tb.sh -chmod +x "${CHROOT_PATH}"/lib/systemd/system-sleep/rmmod_tb.sh diff --git a/01_edit_iso.sh b/01_edit_iso.sh new file mode 100755 index 0000000..e5d7ceb --- /dev/null +++ b/01_edit_iso.sh @@ -0,0 +1,17 @@ +#!/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" diff --git a/02_build_image.sh b/02_build_image.sh deleted file mode 100755 index 1f8a66a..0000000 --- a/02_build_image.sh +++ /dev/null @@ -1,49 +0,0 @@ -#!/bin/bash -set -eu -o pipefail - -echo >&2 "===]> Info: Create image directory and populate it... " -cd "${WORKING_PATH}" - -if [ -d "${IMAGE_PATH}" ]; then - rm -rf "${IMAGE_PATH}" -fi - -mkdir -p "${IMAGE_PATH}"/{casper,install,isolinux} -cp "${CHROOT_PATH}"/boot/vmlinuz-"${KERNEL_VERSION}" "${IMAGE_PATH}"/casper/vmlinuz -cp "${CHROOT_PATH}"/boot/initrd.img-"${KERNEL_VERSION}" "${IMAGE_PATH}"/casper/initrd - -echo >&2 "===]> Info: Grub configuration... " -# we add an empty file to use it with the search command in grub later on. -touch "${IMAGE_PATH}"/ubuntu -cp -r "${ROOT_PATH}"/files/preseed "${IMAGE_PATH}"/preseed -cp "${ROOT_PATH}/files/grub/grub.cfg" "${IMAGE_PATH}"/isolinux/grub.cfg - - -echo >&2 "===]> Info: Compress the chroot... " -cd "${WORKING_PATH}" -mksquashfs "${CHROOT_PATH}" "${IMAGE_PATH}"/casper/filesystem.squashfs -printf "%s" "$(du -sx --block-size=1 "${CHROOT_PATH}" | cut -f1)" >"${IMAGE_PATH}"/casper/filesystem.size - -echo >&2 "===]> Info: Create manifest... " -# shellcheck disable=SC2016 -chroot "${CHROOT_PATH}" dpkg-query -W --showformat='${Package} ${Version}\n' | - tee "${IMAGE_PATH}"/casper/filesystem.manifest -cp -v "${IMAGE_PATH}"/casper/filesystem.manifest "${IMAGE_PATH}"/casper/filesystem.manifest-desktop - -REMOVE='ubiquity casper lupin-casper user-setup discover discover-data os-prober laptop-detect' -for i in $REMOVE; do - sed -i "/${i}/d" "${IMAGE_PATH}"/casper/filesystem.manifest-desktop -done - -echo >&2 "===]> Info: Create diskdefines... " -cat <"${IMAGE_PATH}"/README.diskdefines -#define DISKNAME Ubuntu MBP 22.04 LTS "Jammy Jellyfish" - Beta amd64 -#define TYPE binary -#define TYPEbinary 1 -#define ARCH amd64 -#define ARCHamd64 1 -#define DISKNUM 1 -#define DISKNUM1 1 -#define TOTALNUM 0 -#define TOTALNUM0 1 -EOF diff --git a/02_create_iso.sh b/02_create_iso.sh new file mode 100755 index 0000000..4a46c0c --- /dev/null +++ b/02_create_iso.sh @@ -0,0 +1,52 @@ +#!/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-$(echo ${FLAVOUR} | tr '[a-z]' '[A-Z]')" \ + -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} ..." + + diff --git a/03_prepare_iso.sh b/03_prepare_iso.sh deleted file mode 100755 index 5644107..0000000 --- a/03_prepare_iso.sh +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/bash -set -eu -o pipefail - -echo >&2 "===]> Info: Create ISO Image for a LiveCD... " -cd "${IMAGE_PATH}" - -### Create a grub UEFI image -grub-mkstandalone \ - --format=x86_64-efi \ - --output=isolinux/BOOTx64.EFI \ - --locales="" \ - --fonts="" \ - "boot/grub/grub.cfg=isolinux/grub.cfg" - -### Create a FAT16 UEFI boot disk image containing the EFI bootloader -( - cd isolinux && - dd if=/dev/zero of=efiboot.img bs=1M count=10 && - mkfs.vfat efiboot.img && - LC_CTYPE=C mmd -i efiboot.img EFI EFI/BOOT && - LC_CTYPE=C mcopy -i efiboot.img ./BOOTx64.EFI ::EFI/BOOT/ -) - -### Create a grub BIOS image -grub-mkstandalone \ - --format=i386-pc \ - --output=isolinux/core.img \ - --install-modules="linux16 linux normal iso9660 biosdisk memdisk search tar ls" \ - --modules="linux16 linux normal iso9660 biosdisk search" \ - --locales="" \ - --fonts="" \ - "boot/grub/grub.cfg=isolinux/grub.cfg" - -### Combine a bootable grub cdboot.img -cat "/usr/lib/grub/i386-pc/cdboot.img" "${IMAGE_PATH}/isolinux/core.img" \ - >"${IMAGE_PATH}/isolinux/bios.img" diff --git a/04_create_iso.sh b/04_create_iso.sh deleted file mode 100755 index 0abbe28..0000000 --- a/04_create_iso.sh +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/bash -set -eu -o pipefail - -cd "${IMAGE_PATH}" -### Generate md5sum.txt. Generate it two times, to get the own checksum right. -(find . -type f -print0 | xargs -0 md5sum >"${IMAGE_PATH}/md5sum.txt") - - -echo >&2 "===]> Info: Create Isolinux... " -xorriso -as mkisofs \ - -iso-level 3 \ - -full-iso9660-filenames \ - -volid "UBUNTU_MBP" \ - -b boot/grub/bios.img \ - -no-emul-boot \ - -boot-load-size 4 \ - -boot-info-table \ - -c boot/grub/boot.cat \ - --grub2-boot-info \ - --grub2-mbr "/usr/lib/grub/i386-pc/boot_hybrid.img" \ - -eltorito-alt-boot \ - -e "EFI/efiboot.img" \ - -no-emul-boot \ - -isohybrid-mbr "${ROOT_PATH}/files/isohdpfx.bin" \ - -isohybrid-gpt-basdat -isohybrid-apm-hfsplus \ - -output "${ROOT_PATH}/ubuntu-22.04-${KERNEL_VERSION}.iso" \ - -graft-points \ - "." \ - /boot/grub/bios.img=isolinux/bios.img \ - /EFI/efiboot.img=isolinux/efiboot.img diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..d159169 --- /dev/null +++ b/LICENSE @@ -0,0 +1,339 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. diff --git a/README.md b/README.md index 3e3ca41..69d4348 100644 --- a/README.md +++ b/README.md @@ -1,25 +1,30 @@ # T2-Ubuntu -The ISOs from this repo should allow you to install Ubuntu without using an external keyboard or mouse on a T2 Mac. It works in my MacBook Pro 16 inch, 2019. +The ISOs from this repo should allow you to install Ubuntu without using an external keyboard or mouse on a T2 Mac. -![CI](https://github.com/AdityaGarg8/T2-Ubuntu/actions/workflows/CI.yml/badge.svg?branch=jammy) +![CI](https://github.com/t2linux/T2-Ubuntu/actions/workflows/CI.yml/badge.svg?branch=kubuntuMainline) **If this repo helped you in any way, consider inviting a coffee to the people in the [credits](https://github.com/AdityaGarg8/T2-Ubuntu#credits), [link](https://wiki.t2linux.org/contribute/).** -UBUNTU ISO with Apple T2 patches built-in. +Supported flavours: -Apple T2 drivers are integrated with this iso. +- Ubuntu +- Kubuntu +- Ubuntu Unity -This repo is a rework of the great work done by [@mikeeq](https://github.com/mikeeq/mbp-fedora) and [@marcosfad](https://github.com/marcosfad/mbp-ubuntu) +We support Kubuntu thanks to [@lemmyg](https://github.com/lemmyg)! -I'm using the Kernel from - +Apple T2 drivers are integrated with the ISOs. -Using additional drivers: -- [Apple T2 (apple-bce) (audio, keyboard, touchpad)](https://github.com/t2linux/apple-bce-drv) -- [Touchbar (apple-ibridge, apple-ib-tb, apple-ib-als)](https://github.com/t2linux/apple-ib-drv) +This repo is a rework of the great work done by [@mikeeq](https://github.com/mikeeq/mbp-fedora). It originally was [@marcosfad's mbp-ubuntu repo](https://github.com/marcosfad/mbp-ubuntu) and has been transferred to [t2linux](https://github.com/t2linux). + +Kernel is being used from - + +Using additional patches to support T2 Macs - Bootloader is configure correctly out of the box. No workaround needed. + ## Installation 1. Reduce the size of the mac partition in MacOS @@ -70,7 +75,7 @@ and then: ## Update to newer kernels -Follow [this guide](https://github.com/t2linux/T2-Ubuntu-Kernel#pre-installation-steps). +Follow [this guide](https://github.com/t2linux/T2-Debian-and-Ubuntu-Kernel?tab=readme-ov-file#installation). ## Know issues diff --git a/build.sh b/build.sh index 57f85f3..2bc7782 100755 --- a/build.sh +++ b/build.sh @@ -1,96 +1,98 @@ #!/bin/bash + set -eu -o pipefail -ROOT_PATH=$(pwd) -WORKING_PATH=/root/work -CHROOT_PATH="${WORKING_PATH}/chroot" -IMAGE_PATH="${WORKING_PATH}/image" -KERNEL_VERSION=6.0.7 +ROOT_PATH=$(pwd)/work +OUTPUT_PATH=$(pwd)/output + +FLAVOUR=$1 +ISO_MOUNT_DIR="$ROOT_PATH/${FLAVOUR}-original" # Temporary mount point for the original ISO +VER=25.04 +CODENAME=plucky +KERNEL_VERSION=6.15.8 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 - -if [ -d "$WORKING_PATH" ]; then - rm -rf "$WORKING_PATH" -fi -mkdir -p "$WORKING_PATH" -if [ -d "${ROOT_PATH}/output" ]; then - rm -rf "${ROOT_PATH}/output" -fi -mkdir -p "${ROOT_PATH}/output" - -echo >&2 "===]> Info: Build dependencies... " -export DEBIAN_FRONTEND=noninteractive -apt-get update -apt-get install -y -qq -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" \ - binutils \ - debootstrap \ - squashfs-tools \ - xorriso \ - grub-pc-bin \ - grub-efi-amd64-bin \ - mtools \ - dosfstools \ - zip \ - isolinux \ - syslinux - -echo >&2 "===]> Info: Start loop... " -for ALTERNATIVE in t2-jammy t2-external -do - echo >&2 "===]> Info: Start building ${ALTERNATIVE}... " - - echo >&2 "===]> Info: Build Ubuntu Jammy... " - /bin/bash -c " - ROOT_PATH=${ROOT_PATH} \\ - WORKING_PATH=${WORKING_PATH} \\ - CHROOT_PATH=${CHROOT_PATH}_${ALTERNATIVE} \\ - IMAGE_PATH=${IMAGE_PATH} \\ - KERNEL_VERSION=${KERNEL_VERSION}-${ALTERNATIVE} \\ - ALTERNATIVE=${ALTERNATIVE} \\ - ${ROOT_PATH}/01_build_file_system.sh - " - - echo >&2 "===]> Info: Build Image Jammy... " - /bin/bash -c " +ISO_IMAGE=${FLAVOUR}-25.04-desktop-amd64.iso +ISO_IMAGE_OUTPUT="${OUTPUT_PATH}/${FLAVOUR}-${VER}-${KERNEL_VERSION}-t2-${CODENAME}.iso" +ISO_WORK_DIR="$ROOT_PATH/${FLAVOUR}-iso" +CHROOT_DIR="$ROOT_PATH/${FLAVOUR}-edit" + +echo "ROOT_PATH=$ROOT_PATH" +echo "ISO_MOUNT_DIR=$ISO_MOUNT_DIR" +echo "ISO_WORK_DIR=$ISO_WORK_DIR" +echo "CHROOT_DIR=$CHROOT_DIR" + +mkdir -p "$ROOT_PATH" +mkdir -p "$ISO_WORK_DIR" +mkdir -p "$CHROOT_DIR" +mkdir -p "$(dirname "$ISO_IMAGE_OUTPUT")" +touch "$ISO_IMAGE_OUTPUT" +echo >&2 "===]> Info: Installing required packages..." + +apt update && apt update && \ + DEBIAN_FRONTEND=noninteractive apt install -y tzdata \ + && apt install -y util-linux rsync squashfs-tools grub-pc-bin grub-common \ + xorriso isolinux grub-efi-amd64-bin mtools dosfstools curl + +echo >&2 "===]> Info: Download ISO..." +curl -L -o "$(pwd)/${ISO_IMAGE}" "https://cdimage.ubuntu.com/${FLAVOUR}/releases/${VER}/release/${ISO_IMAGE}" + +# Run entrypoint.sh to extract and customize the ISO +echo >&2 "===]> Info: Starting extraction and customization..." +/bin/bash -c " + ISO_IMAGE=${ISO_IMAGE} \\ + ISO_MOUNT_DIR=${ISO_MOUNT_DIR} \\ + ISO_WORK_DIR=${ISO_WORK_DIR} \\ + CHROOT_DIR=${CHROOT_DIR} \\ ROOT_PATH=${ROOT_PATH} \\ - WORKING_PATH=${WORKING_PATH} \\ - CHROOT_PATH=${CHROOT_PATH}_${ALTERNATIVE} \\ - IMAGE_PATH=${IMAGE_PATH} \\ - KERNEL_VERSION=${KERNEL_VERSION}-${ALTERNATIVE} \\ - ALTERNATIVE=${ALTERNATIVE} \\ - ${ROOT_PATH}/02_build_image.sh - " - - echo >&2 "===]> Info: Prepare Boot for ISO... " - /bin/bash -c " - IMAGE_PATH=${IMAGE_PATH} \\ - CHROOT_PATH=${CHROOT_PATH}_${ALTERNATIVE} \\ - ${ROOT_PATH}/03_prepare_iso.sh - " - - echo >&2 "===]> Info: Create ISO... " - /bin/bash -c " + KERNEL_VERSION=${KERNEL_VERSION} \\ + FLAVOUR=${FLAVOUR} \\ + $(pwd)/01_edit_iso.sh" + +# Enter the Chroot Environment and Apply Customizations +echo >&2 "===]> Info: Creating chroot environment... " +# Mount Required Filesystems for Chroot +mount --bind /dev "${CHROOT_DIR}/dev" +mount --bind /dev/pts "${CHROOT_DIR}/dev/pts" +mount --bind /proc "${CHROOT_DIR}/proc" +mount --bind /sys "${CHROOT_DIR}/sys" + +mkdir -p "${CHROOT_DIR}/tmp/setup_files" +#rm -f "${CHROOT_DIR}/etc/resolv.conf" +#make a back up +cp -p "${CHROOT_DIR}/etc/resolv.conf" "${CHROOT_DIR}/etc/resolv.conf.backup" +cp -p /etc/resolv.conf "${CHROOT_DIR}/etc/resolv.conf" +cp "$(pwd)/chroot_iso.sh" "${CHROOT_DIR}/tmp/setup_files" +ls "${CHROOT_DIR}/tmp/setup_files" +echo >&2 "===]> Info: Running chroot environment... " +chroot "${CHROOT_DIR}" /bin/bash -c "KERNEL_VERSION=${KERNEL_VERSION} PKGREL=${PKGREL} /tmp/setup_files/chroot_iso.sh" +echo >&2 "===]> Info: Getting Kernel environment... " +T2_KERNEL=${KERNEL_VERSION}-${PKGREL}-t2-${CODENAME} + +echo >&2 "===]> Info: Cleanup the chroot environment... " +# restore backup +cp -p "${CHROOT_DIR}/etc/resolv.conf.backup" "${CHROOT_DIR}/etc/resolv.conf" +umount "${CHROOT_DIR}/dev/pts" +umount "${CHROOT_DIR}/dev" +umount "${CHROOT_DIR}/proc" +umount "${CHROOT_DIR}/sys" + +echo >&2 "===]> Info: Squashing $(echo ${FLAVOUR} | cut -c1 | tr '[a-z]' '[A-Z]')$(echo ${FLAVOUR} | cut -c2-) file system ... " +mksquashfs "$CHROOT_DIR" "$ISO_WORK_DIR/casper/filesystem.squashfs" -comp xz -noappend + +# Run create_iso.sh to generate the new ISO +# echo "Creating the custom ISO..." +echo >&2 "===]> Info: Creating iso ... " +/bin/bash -c " + ISO_WORK_DIR=${ISO_WORK_DIR} \\ + CHROOT_DIR=${CHROOT_DIR} \\ + ISO_IMAGE_OUTPUT=${ISO_IMAGE_OUTPUT} \\ ROOT_PATH=${ROOT_PATH} \\ - IMAGE_PATH=${IMAGE_PATH} \\ - CHROOT_PATH=${CHROOT_PATH}_${ALTERNATIVE} \\ - KERNEL_VERSION=${KERNEL_VERSION}-${ALTERNATIVE} \\ - ALTERNATIVE=${ALTERNATIVE} \\ - ${ROOT_PATH}/04_create_iso.sh - " - livecd_exitcode=$? - if [ "${livecd_exitcode}" -ne 0 ]; then - echo "Error building ${KERNEL_VERSION}-${ALTERNATIVE}" - exit "${livecd_exitcode}" - fi - ### Zip iso and split it into multiple parts - github max size of release attachment is 2GB, where ISO is sometimes bigger than that - cd "${ROOT_PATH}" - zip -s 1500m "${ROOT_PATH}/output/livecd-${KERNEL_VERSION}-${ALTERNATIVE}.zip" "${ROOT_PATH}/ubuntu-22.04-${KERNEL_VERSION}-${ALTERNATIVE}.iso" -done -## Calculate sha256 sums of built ISO -sha256sum "${ROOT_PATH}"/*.iso >"${ROOT_PATH}/output/sha256" - -find ./ | grep ".iso" -find ./ | grep ".zip" - -exit "${livecd_exitcode}" + T2_KERNEL=${T2_KERNEL} \\ + FLAVOUR=${FLAVOUR} \\ + $(pwd)/02_create_iso.sh" +# split iso + +split -b 1500M -x "${OUTPUT_PATH}/${FLAVOUR}-${VER}-${KERNEL_VERSION}-t2-${CODENAME}.iso" "${OUTPUT_PATH}/${FLAVOUR}-${VER}-${KERNEL_VERSION}-t2-${CODENAME}.iso." +sha256sum "${OUTPUT_PATH}"/*.iso > "${OUTPUT_PATH}/sha256-${FLAVOUR}-${VER}" + + diff --git a/build_in_docker.sh b/build_in_docker.sh index b603421..79a92d6 100755 --- a/build_in_docker.sh +++ b/build_in_docker.sh @@ -2,13 +2,16 @@ set -eu -o pipefail -DOCKER_IMAGE=ubuntu:20.04 +DOCKER_IMAGE=ubuntu:25.04 +echo "DOCKER_IMAGE=${DOCKER_IMAGE}" docker pull ${DOCKER_IMAGE} + docker run \ --privileged \ --rm \ -t \ -v "$(pwd)":/repo \ ${DOCKER_IMAGE} \ - /bin/bash -c 'cd /repo && ./build.sh' + /bin/bash -c "cd /repo && ./build.sh $1" + diff --git a/chroot_iso.sh b/chroot_iso.sh new file mode 100755 index 0000000..fc9cf60 --- /dev/null +++ b/chroot_iso.sh @@ -0,0 +1,59 @@ +#!/bin/bash + +set -eu -o pipefail + +echo >&2 "===]> Info: Configure and update apt... " + +apt update +apt install -y curl +# Add T2 Repository and Install Packages +CODENAME=$(lsb_release -cs) +curl -s --compressed "https://adityagarg8.github.io/t2-ubuntu-repo/KEY.gpg" | gpg --dearmor | tee /etc/apt/trusted.gpg.d/t2-ubuntu-repo.gpg >/dev/null +curl -s --compressed -o /etc/apt/sources.list.d/t2.list "https://adityagarg8.github.io/t2-ubuntu-repo/t2.list" +echo "deb [signed-by=/etc/apt/trusted.gpg.d/t2-ubuntu-repo.gpg] https://github.com/AdityaGarg8/t2-ubuntu-repo/releases/download/${CODENAME} ./" | tee -a /etc/apt/sources.list.d/t2.list + +apt update + +# Add Kernel Parameters to GRUB for Installed System +sed -i 's/GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"/GRUB_CMDLINE_LINUX_DEFAULT="quiet splash intel_iommu=on iommu=pt pcie_ports=native"/' /etc/default/grub +update-grub +apt install -y apple-t2-audio-config apple-firmware-script +apt install -y linux-t2=${KERNEL_VERSION}-${PKGREL}-${CODENAME} + +echo >&2 "===]> Info: Add udev Rule to stop annoying WiFi popup... " +mkdir -p /etc/NetworkManager/conf.d +cat <&2 "===]> Info: Add udev Rule for AMD GPU Power Management... " +cat < /etc/udev/rules.d/30-amdgpu-pm.rules +KERNEL=="card[012]", SUBSYSTEM=="drm", DRIVERS=="amdgpu", ATTR{device/power_dpm_force_performance_level}="low" +EOF + +KERNEL_VERSION=$(dpkg -l | grep -E "^ii linux-image-[0-9]+\.[0-9]+\.[0-9\.\-]+-generic" | awk '{print $2}' | sed 's/linux-image-\(.*\)-generic/\1/') +#apt purge -y -qq \ +# linux-generic \ +# linux-headers-${KERNEL_VERSION} \ +# linux-headers-${KERNEL_VERSION}-generic \ +# linux-headers-generic \ +# linux-image-${KERNEL_VERSION}-generic \ +# linux-image-generic \ +# linux-modules-${KERNEL_VERSION}-generic \ +# linux-modules-extra-${KERNEL_VERSION}-generic + +# Clean up +#apt-get autoremove -y +apt clean +rm -rf /var/cache/apt/archives/* +rm -rf /tmp/* ~/.bash_history +rm -rf /tmp/setup_files + + + + diff --git a/files/audio/91-pulseaudio-custom.rules b/files/audio/91-pulseaudio-custom.rules deleted file mode 100644 index 33c2d91..0000000 --- a/files/audio/91-pulseaudio-custom.rules +++ /dev/null @@ -1,7 +0,0 @@ -SUBSYSTEM!="sound", GOTO="pulseaudio_end" -ACTION!="change", GOTO="pulseaudio_end" -KERNEL!="card*", GOTO="pulseaudio_end" - -SUBSYSTEMS=="pci", ATTRS{vendor}=="0x106b", ATTRS{device}=="0x1803", ENV{PULSE_PROFILE_SET}="apple-t2.conf" - -LABEL="pulseaudio_end" diff --git a/files/audio/AppleT2.conf b/files/audio/AppleT2.conf deleted file mode 100644 index 527492a..0000000 --- a/files/audio/AppleT2.conf +++ /dev/null @@ -1,103 +0,0 @@ - - -AppleT2.pcm.default { - @args [ CARD ] - @args.CARD { - type string - } - type asym - playback.pcm { - type plug - ttable { - 0.0= 1 - 1.3= 1 - 2.1= 1 - 3.4= 1 - 4.0= 1 - 5.5= 1 - } - slave { - pcm { - type hw - card $CARD - device 0 - } - channels 6 - } - } - capture.pcm { - type plug - slave.pcm { - type hw - card $CARD - device 1 - } - } - hint.device_output 0 - hint.device_input 1 -} - -AppleT2.pcm.front.0 { - @args [ CARD ] - @args.CARD { - type string - } - type asym - playback.pcm { - type plug - ttable { - 0.0= 1 - 1.3= 1 - 2.1= 1 - 3.4= 1 - 4.0= 1 - 5.5= 1 - } - slave { - pcm { - type hw - card $CARD - device 0 - } - channels 6 - } - } - capture.pcm { - type plug - slave.pcm { - type hw - card $CARD - device 1 - } - } - hint.device_output 0 - hint.device_input 1 -} -AppleT2.pcm.front.1 { - @args [ CARD ] - @args.CARD { - type string - } - type asym - playback.pcm { - type hw - card $CARD - device 2 - } - capture.pcm { - type hw - card $CARD - device 3 - } - hint.device_output 2 - hint.device_input 3 -} -AppleT2.pcm.front.2 { - @args [ CARD ] - @args.CARD { - type string - } - type hw - card $CARD - device 4 -} diff --git a/files/audio/apple-t2.conf b/files/audio/apple-t2.conf deleted file mode 100644 index 51045f2..0000000 --- a/files/audio/apple-t2.conf +++ /dev/null @@ -1,55 +0,0 @@ -[General] -auto-profiles = no - -[Mapping builtin-speaker] -description = Built-in Speaker -device-strings = front:%f -paths-output = builtin-speaker-output -channel-map = front-left,front-right,rear-left,rear-right,front-center,lfe -priority = 100 -direction = output - -[Mapping builtin-mic] -description = Built-in Mic -device-strings = front:%f -paths-output = builtin-mic-input -channel-map = left,center,right -priority = 100 -direction = input - -[Mapping codec-output] -description = Headphone -device-strings = front:%f,1 -paths-output = codec-output -channel-map = left,right -priority = 100 -direction = output - -[Mapping codec-input] -description = Headphone Mic -device-strings = front:%f,1 -paths-output = codec-input -channel-map = mono -priority = 100 -direction = input - -[Profile output:builtin-speaker+input:builtin-mic] -description = Built-in Speaker + Built-in Mic -output-mappings = builtin-speaker -input-mappings = builtin-mic -skip-probe = yes - -[Profile output:codec-output+input:builtin-mic] -description = Headphones + Built-in Mic -output-mappings = codec-output -input-mappings = builtin-mic - -[Profile output:codec-output+input:codec-input] -description = Headphones + External Mic -output-mappings = codec-output -input-mappings = codec-input - -[Profile output:builtin-speaker+input:codec-input] -description = Built-in Speaker + External Mic -output-mappings = builtin-speaker -input-mappings = codec-input diff --git a/files/chroot_build.sh b/files/chroot_build.sh deleted file mode 100755 index 2229392..0000000 --- a/files/chroot_build.sh +++ /dev/null @@ -1,212 +0,0 @@ -#!/bin/bash - -set -eu -o pipefail - -echo >&2 "===]> Info: Configure environment... " - -mount none -t proc /proc -mount none -t sysfs /sys -mount none -t devpts /dev/pts - -export HOME=/root -export LC_ALL=C - -echo "ubuntu-jammy-live" >/etc/hostname - -echo >&2 "===]> Info: Configure and update apt... " - -cat </etc/apt/sources.list -deb http://archive.ubuntu.com/ubuntu/ jammy main restricted universe multiverse -deb-src http://archive.ubuntu.com/ubuntu/ jammy main restricted universe multiverse -deb http://archive.ubuntu.com/ubuntu/ jammy-security main restricted universe multiverse -deb-src http://archive.ubuntu.com/ubuntu/ jammy-security main restricted universe multiverse -deb http://archive.ubuntu.com/ubuntu/ jammy-updates main restricted universe multiverse -deb-src http://archive.ubuntu.com/ubuntu/ jammy-updates main restricted universe multiverse -EOF -apt-get update - -echo >&2 "===]> Info: Install systemd and Ubuntu MBP Repo... " - -apt-get install -y systemd-sysv gnupg curl wget - -mkdir -p /etc/apt/sources.list.d -curl -s --compressed "https://adityagarg8.github.io/t2-ubuntu-repo/KEY.gpg" | gpg --dearmor | tee /etc/apt/trusted.gpg.d/t2-ubuntu-repo.gpg >/dev/null -curl -s --compressed -o /etc/apt/sources.list.d/t2.list "https://adityagarg8.github.io/t2-ubuntu-repo/t2.list" -apt-get update - -echo >&2 "===]> Info: Configure machine-id and divert... " - -dbus-uuidgen >/etc/machine-id -ln -fs /etc/machine-id /var/lib/dbus/machine-id -dpkg-divert --local --rename --add /sbin/initctl -ln -s /bin/true /sbin/initctl - -echo >&2 "===]> Info: Install packages needed for Live System... " - -export DEBIAN_FRONTEND=noninteractive -apt-get install -y -qq -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" \ - ubuntu-standard \ - sudo \ - casper \ - discover \ - laptop-detect \ - os-prober \ - network-manager \ - resolvconf \ - net-tools \ - wireless-tools \ - wpagui \ - locales \ - initramfs-tools \ - binutils \ - linux-generic \ - linux-headers-generic \ - grub-efi-amd64-signed \ - intel-microcode \ - thermald \ - grub2 \ - nautilus-admin - -if [[ ${ALTERNATIVE} = t2-external ]] -then -curl -L https://github.com/AdityaGarg8/T2-Ubuntu/releases/download/vKVER-PREL-kernel/linux-headers-KVER-${ALTERNATIVE}_KVER-PREL_amd64.deb > /tmp/headers.deb -curl -L https://github.com/AdityaGarg8/T2-Ubuntu/releases/download/vKVER-PREL-kernel/linux-image-KVER-${ALTERNATIVE}_KVER-PREL_amd64.deb > /tmp/image.deb -else -curl -L https://github.com/t2linux/T2-Ubuntu-Kernel/releases/download/vKVER-PREL/linux-headers-KVER-${ALTERNATIVE}_KVER-PREL_amd64.deb > /tmp/headers.deb -curl -L https://github.com/t2linux/T2-Ubuntu-Kernel/releases/download/vKVER-PREL/linux-image-KVER-${ALTERNATIVE}_KVER-PREL_amd64.deb > /tmp/image.deb -fi -file /tmp/* -apt install /tmp/headers.deb /tmp/image.deb - -echo >&2 "===]> Info: Install window manager... " - -apt-get install -y -qq -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" \ - plymouth-theme-ubuntu-logo \ - ubuntu-desktop-minimal \ - ubuntu-gnome-wallpapers \ - snapd - -echo >&2 "===]> Info: Install Graphical installer... " - -apt-get install -y -qq -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" \ - ubiquity \ - ubiquity-casper \ - ubiquity-frontend-gtk \ - ubiquity-slideshow-ubuntu \ - ubiquity-ubuntu-artwork - -echo >&2 "===]> Info: Install useful applications and sound configuration... " - -apt-get install -y -qq -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" \ - git \ - curl \ - nano \ - make \ - gcc \ - dkms \ - iwd \ - apple-t2-audio-config - -echo >&2 "===]> Info: Change initramfs format (for grub)... " -sed -i "s/COMPRESS=lz4/COMPRESS=gzip/g" "/etc/initramfs-tools/initramfs.conf" - -echo >&2 "===]> Info: Configure drivers... " - -# thunderbolt is working for me. -#printf '\nblacklist thunderbolt' >>/etc/modprobe.d/blacklist.conf - -printf 'apple-bce' >>/etc/modules-load.d/t2.conf -printf '\n### apple-bce start ###\nsnd\nsnd_pcm\napple-bce\n### apple-bce end ###' >>/etc/initramfs-tools/modules -printf '\n# display f* key in touchbar\noptions apple-ib-tb fnmode=1\n' >> /etc/modprobe.d/apple-tb.conf -#printf '\n# delay loading of the touchbar driver\ninstall apple-ib-tb /bin/sleep 7; /sbin/modprobe --ignore-install apple-ib-tb' >> /etc/modprobe.d/delay-tb.conf - -echo ' -#!/usr/bin/env bash -echo "Select Touch Bar mode" -echo -echo "0: Only show F1-F12" -echo "1: Show media and brightness controls, use the fn key to switch to F1-12" -echo "2: Show F1-F12, use the fn key to switch to media and brightness controls" -echo "3: Only show media and brightness controls" -echo "4: Only show the escape key" -read tb -echo "Changing default mode ..." -echo "# display f* key in touchbar" > /etc/modprobe.d/apple-tb.conf -echo "options apple-ib-tb fnmode=$tb" >> /etc/modprobe.d/apple-tb.conf -bash -c "echo $tb > /sys/class/input/*/device/fnmode" -echo "Done!"' | tee /usr/local/bin/touchbar >/dev/null - -chmod a+x /usr/local/bin/touchbar -chown root:root /usr/local/bin/touchbar - - -echo >&2 "===]> Info: Update initramfs... " - -## Add custom drivers to be loaded at boot -/usr/sbin/depmod -a "${KERNEL_VERSION}" -update-initramfs -u -v -k "${KERNEL_VERSION}" - -echo >&2 "===]> Info: Remove unused applications ... " - -apt-get purge -y -qq \ - transmission-gtk \ - transmission-common \ - gnome-mahjongg \ - gnome-mines \ - gnome-sudoku \ - aisleriot \ - hitori \ - xiterm+thai \ - make \ - gcc \ - vim \ - binutils \ - linux-generic \ - linux-headers-5.15.0-30 \ - linux-headers-5.15.0-30-generic \ - linux-headers-generic \ - linux-image-5.15.0-30-generic \ - linux-image-generic \ - linux-modules-5.15.0-30-generic \ - linux-modules-extra-5.15.0-30-generic - -apt-get autoremove -y - -echo >&2 "===]> Info: Reconfigure environment ... " - -locale-gen --purge en_US.UTF-8 en_US -printf 'LANG="C.UTF-8"\nLANGUAGE="C.UTF-8"\n' >/etc/default/locale - -dpkg-reconfigure -f readline resolvconf - -cat </etc/NetworkManager/NetworkManager.conf -[main] -plugins=ifupdown,keyfile - -[ifupdown] -managed=false - -[device] -wifi.scan-rand-mac-address=no -EOF -dpkg-reconfigure network-manager - -echo >&2 "===]> Info: Configure Network Manager to use iwd... " -mkdir -p /etc/NetworkManager/conf.d -printf '#[device]\n#wifi.backend=iwd\n' > /etc/NetworkManager/conf.d/wifi_backend.conf -#systemctl enable iwd.service - -echo >&2 "===]> Info: Cleanup the chroot environment... " - -truncate -s 0 /etc/machine-id -rm /sbin/initctl -dpkg-divert --rename --remove /sbin/initctl -apt-get clean -rm -rf /tmp/* ~/.bash_history -rm -rf /tmp/setup_files - -umount -lf /dev/pts -umount -lf /sys -umount -lf /proc - -export HISTSIZE=0 diff --git a/files/grub/30_os-prober b/files/grub/30_os-prober deleted file mode 100644 index 1ec418d..0000000 --- a/files/grub/30_os-prober +++ /dev/null @@ -1,326 +0,0 @@ -#!/usr/bin/sh -set -e - -# grub-mkconfig helper script. -# Copyright (C) 2006,2007,2008,2009 Free Software Foundation, Inc. -# -# GRUB is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# GRUB is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GRUB. If not, see . - -prefix="/usr" -exec_prefix="/usr" -datarootdir="/usr/share" - -export TEXTDOMAIN=grub -export TEXTDOMAINDIR="${datarootdir}/locale" - -. "$pkgdatadir/grub-mkconfig_lib" - -if [ "x${GRUB_DISABLE_OS_PROBER}" = "xtrue" ]; then - exit 0 -fi - -if [ -z "`which os-prober 2> /dev/null`" ] || [ -z "`which linux-boot-prober 2> /dev/null`" ] ; then - # missing os-prober and/or linux-boot-prober - exit 0 -fi - -OSPROBED="`os-prober | tr ' ' '^' | paste -s -d ' '`" -if [ -z "${OSPROBED}" ] ; then - # empty os-prober output, nothing doing - exit 0 -fi - -osx_entry() { - found_other_os=1 - # TRANSLATORS: it refers on the OS residing on device %s - onstr="$(gettext_printf "(on %s)" "${DEVICE}")" - hints="" - for hint in `"${grub_probe}" --device ${device} --target=efi_hints 2> /dev/null` ; do - hints="${hints} --hint=${hint}" - done - cat << EOF -menuentry '$(echo "${LONGNAME} $onstr" | grub_quote)' --class osx --class darwin --class os \$menuentry_id_option 'osprober-xnu-$2-$(grub_get_device_id "${DEVICE}")' { -EOF - save_default_entry | grub_add_tab - prepare_grub_to_access_device ${DEVICE} | grub_add_tab - cat << EOF - set gfxpayload=keep - load_video - insmod part_gpt - insmod hfsplus - search --no-floppy --fs-uuid --set=root ${hints} $(grub_get_device_id "${DEVICE}") - chainloader (\$root)/System/Library/CoreServices/boot.efi - boot -} -EOF -} - -used_osprober_linux_ids= - -for OS in ${OSPROBED} ; do - DEVICE="`echo ${OS} | cut -d ':' -f 1`" - LONGNAME="`echo ${OS} | cut -d ':' -f 2 | tr '^' ' '`" - LABEL="`echo ${OS} | cut -d ':' -f 3 | tr '^' ' '`" - BOOT="`echo ${OS} | cut -d ':' -f 4`" - if UUID="`${grub_probe} --target=fs_uuid --device ${DEVICE%@*}`"; then - EXPUUID="$UUID" - - if [ x"${DEVICE#*@}" != x ] ; then - EXPUUID="${EXPUUID}@${DEVICE#*@}" - fi - - if [ "x${GRUB_OS_PROBER_SKIP_LIST}" != "x" ] && [ "x`echo ${GRUB_OS_PROBER_SKIP_LIST} | grep -i -e '\b'${EXPUUID}'\b'`" != "x" ] ; then - echo "Skipped ${LONGNAME} on ${DEVICE} by user request." >&2 - continue - fi - fi - - BTRFS="`echo ${OS} | cut -d ':' -f 5`" - if [ "x$BTRFS" = "xbtrfs" ]; then - BTRFSuuid="`echo ${OS} | cut -d ':' -f 6`" - BTRFSsubvol="`echo ${OS} | cut -d ':' -f 7`" - fi - - if [ -z "${LONGNAME}" ] ; then - LONGNAME="${LABEL}" - fi - - # os-prober returns text string followed by optional counter - CLASS="--class $(echo "${LABEL}" | LC_ALL=C sed 's,[[:digit:]]*$,,' | cut -d' ' -f1 | tr 'A-Z' 'a-z' | LC_ALL=C sed 's,[^[:alnum:]_],_,g')" - - gettext_printf "Found %s on %s\n" "${LONGNAME}" "${DEVICE}" >&2 - - case ${BOOT} in - chain) - found_other_os=1 - - onstr="$(gettext_printf "(on %s)" "${DEVICE}")" - cat << EOF -menuentry '$(echo "${LONGNAME} $onstr" | grub_quote)' $CLASS --class os \$menuentry_id_option 'osprober-chain-$(grub_get_device_id "${DEVICE}")' { -EOF - save_default_entry | grub_add_tab - prepare_grub_to_access_device ${DEVICE} | grub_add_tab - - if [ x"`${grub_probe} --device ${DEVICE} --target=partmap`" = xmsdos ]; then - cat << EOF - parttool \${root} hidden- -EOF - fi - - case ${LONGNAME} in - Windows\ Vista*|Windows\ 7*|Windows\ Server\ 2008*) - ;; - *) - cat << EOF - drivemap -s (hd0) \${root} -EOF - ;; - esac - - cat < /dev/null; do - counter=$((counter+1)); - done - if [ -z "$boot_device_id" ]; then - boot_device_id="$(grub_get_device_id "${DEVICE}")" - fi - used_osprober_linux_ids="$used_osprober_linux_ids 'osprober-gnulinux-$LKERNEL-${recovery_params}-$counter-$boot_device_id'" - - if [ -z "${prepare_boot_cache}" ]; then - prepare_boot_cache="$(prepare_grub_to_access_device ${LBOOT} | grub_add_tab)" - fi - - if [ "x$is_top_level" = xtrue ] && [ "x${GRUB_DISABLE_SUBMENU}" != xy ]; then - cat << EOF -menuentry '$(echo "$OS $onstr" | grub_quote)' $CLASS --class gnu-linux --class gnu --class os \$menuentry_id_option 'osprober-gnulinux-simple-$boot_device_id' { -EOF - save_default_entry | grub_add_tab - printf '%s\n' "${prepare_boot_cache}" - cat << EOF - linux ${LKERNEL} ${LPARAMS} -EOF - if [ -n "${LINITRD}" ] ; then - cat << EOF - initrd ${LINITRD} -EOF - fi - cat << EOF -} -EOF - echo "submenu '$(gettext_printf "Advanced options for %s" "${OS} $onstr" | grub_quote)' \$menuentry_id_option 'osprober-gnulinux-advanced-$boot_device_id' {" - is_top_level=false - fi - title="${LLABEL} $onstr" - cat << EOF - menuentry '$(echo "$title" | grub_quote)' --class gnu-linux --class gnu --class os \$menuentry_id_option 'osprober-gnulinux-$LKERNEL-${recovery_params}-$boot_device_id' { -EOF - save_default_entry | sed -e "s/^/$grub_tab$grub_tab/" - printf '%s\n' "${prepare_boot_cache}" | grub_add_tab - cat << EOF - linux ${LKERNEL} ${LPARAMS} -EOF - if [ -n "${LINITRD}" ] ; then - cat << EOF - initrd ${LINITRD} -EOF - fi - cat << EOF - } -EOF - if [ x"$title" = x"$GRUB_ACTUAL_DEFAULT" ] || [ x"Previous Linux versions>$title" = x"$GRUB_ACTUAL_DEFAULT" ]; then - replacement_title="$(echo "Advanced options for ${OS} $onstr" | sed 's,>,>>,g')>$(echo "$title" | sed 's,>,>>,g')" - quoted="$(echo "$GRUB_ACTUAL_DEFAULT" | grub_quote)" - title_correction_code="${title_correction_code}if [ \"x\$default\" = '$quoted' ]; then default='$(echo "$replacement_title" | grub_quote)'; fi;" - grub_warn "$(gettext_printf "Please don't use old title \`%s' for GRUB_DEFAULT, use \`%s' (for versions before 2.00) or \`%s' (for 2.00 or later)" "$GRUB_ACTUAL_DEFAULT" "$replacement_title" "gnulinux-advanced-$boot_device_id>gnulinux-$version-$type-$boot_device_id")" - fi - done - if [ x"$is_top_level" != xtrue ]; then - echo '}' - fi - echo "$title_correction_code" - ;; - macosx) - # for subdevice in ${DEVICE%[[:digit:]]*}* ; do - # parttype="`"${grub_probe}" --device ${device} --target=gpt_parttype "${subdevice}" 2> /dev/null`" - # if [[ "$parttype" = "426f6f74-0000-11aa-aa11-00306543ecac" ]]; then - # DEVICE="${subdevice}" osx_entry - # fi - # done - ;; - hurd) - found_other_os=1 - onstr="$(gettext_printf "(on %s)" "${DEVICE}")" - cat << EOF -menuentry '$(echo "${LONGNAME} $onstr" | grub_quote)' --class hurd --class gnu --class os \$menuentry_id_option 'osprober-gnuhurd-/boot/gnumach.gz-false-$(grub_get_device_id "${DEVICE}")' { -EOF - save_default_entry | grub_add_tab - prepare_grub_to_access_device ${DEVICE} | grub_add_tab - grub_device="`${grub_probe} --device ${DEVICE} --target=drive`" - mach_device="`echo "${grub_device}" | sed -e 's/(\(hd.*\),msdos\(.*\))/\1s\2/'`" - grub_fs="`${grub_probe} --device ${DEVICE} --target=fs`" - case "${grub_fs}" in - *fs) hurd_fs="${grub_fs}" ;; - *) hurd_fs="${grub_fs}fs" ;; - esac - cat << EOF - multiboot /boot/gnumach.gz root=device:${mach_device} - module /hurd/${hurd_fs}.static ${hurd_fs} --readonly \\ - --multiboot-command-line='\${kernel-command-line}' \\ - --host-priv-port='\${host-port}' \\ - --device-master-port='\${device-port}' \\ - --exec-server-task='\${exec-task}' -T typed '\${root}' \\ - '\$(task-create)' '\$(task-resume)' - module /lib/ld.so.1 exec /hurd/exec '\$(exec-task=task-create)' -} -EOF - ;; - minix) - found_other_os=1 - cat << EOF -menuentry "${LONGNAME} (on ${DEVICE}, Multiboot)" { -EOF - save_default_entry | sed -e "s/^/\t/" - prepare_grub_to_access_device ${DEVICE} | sed -e "s/^/\t/" - cat << EOF - multiboot /boot/image_latest -} -EOF - ;; - *) - case ${DEVICE} in - *.efi) - cat << EOF -menuentry '$(echo "${LONGNAME}" | grub_quote)' { -EOF - save_default_entry | grub_add_tab - cat << EOF - chainloader /EFI/${DEVICE} - boot -} -EOF - ;; - *) - echo -n " " - # TRANSLATORS: %s is replaced by OS name. - gettext_printf "%s is not yet supported by grub-mkconfig.\n" "${LONGNAME}" >&2 - ;; - esac - esac -done - -# We override the results of the menu_auto_hide code here, this is a bit ugly, -# but grub-mkconfig writes out the file linearly, so this is the only way -if [ "${found_other_os}" = "1" ]; then - cat << EOF -# Other OS found, undo autohiding of menu unless menu_auto_hide=2 -if [ "\${orig_timeout_style}" -a "\${menu_auto_hide}" != "2" ]; then - set timeout_style=\${orig_timeout_style} - set timeout=\${orig_timeout} -fi -EOF -fi diff --git a/files/grub/grub.cfg b/files/grub/grub.cfg deleted file mode 100644 index c31253d..0000000 --- a/files/grub/grub.cfg +++ /dev/null @@ -1,24 +0,0 @@ - -search --set=root --file /ubuntu - -insmod all_video - -set default="0" -set timeout=30 - -menuentry "Try Ubuntu Jammy Jellyfish without installing" { - linux /casper/vmlinuz file=/cdrom/preseed/mbp.seed boot=casper ro pcie_ports=compat intel_iommu=on iommu=pt --- - initrd /casper/initrd -} -menuentry "Try Ubuntu Jammy Jellyfish without installing (Safe Graphics)" { - linux /casper/vmlinuz file=/cdrom/preseed/mbp.seed boot=casper ro nomodeset pcie_ports=compat intel_iommu=on iommu=pt --- - initrd /casper/initrd -} -menuentry "Install Ubuntu Jammy Jellyfish" { - linux /casper/vmlinuz preseed/file=/cdrom/preseed/mbp.seed boot=casper only-ubiquity pcie_ports=compat intel_iommu=on iommu=pt --- - initrd /casper/initrd -} -menuentry "Check disc for defects" { - linux /casper/vmlinuz boot=casper integrity-check enforcing=0 efi=noruntime pcie_ports=compat --- - initrd /casper/initrd -} diff --git a/files/isohdpfx.bin b/files/isohdpfx.bin deleted file mode 100644 index a87faf5..0000000 Binary files a/files/isohdpfx.bin and /dev/null differ diff --git a/files/preseed/mbp.seed b/files/preseed/mbp.seed deleted file mode 100644 index a15c7db..0000000 --- a/files/preseed/mbp.seed +++ /dev/null @@ -1,11 +0,0 @@ -# Enable extras.ubuntu.com. -# d-i apt-setup/extra boolean true -# Install the Ubuntu desktop. -# tasksel tasksel/first multiselect ubuntu-desktop -# On live DVDs, don't spend huge amounts of time removing substantial -# application packages pulled in by language packs. Given that we clearly -# have the space to include them on the DVD, they're useful and we might as -# well keep them installed. -#ubiquity ubiquity/keep-installed string icedtea6-plugin openoffice.org - -d-i debian-installer/add-kernel-opts string pcie_ports=compat intel_iommu=on iommu=pt diff --git a/files/suspend/rmmod_tb.sh b/files/suspend/rmmod_tb.sh deleted file mode 100755 index 30c6ead..0000000 --- a/files/suspend/rmmod_tb.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh -if [ "${1}" = "pre" ]; then - modprobe -r apple_ib_tb -elif [ "${1}" = "post" ]; then - modprobe apple_ib_tb -fi