From c29f3dc2ef1178e075f8d60309122150a4d14446 Mon Sep 17 00:00:00 2001 From: RayBB Date: Mon, 5 Jan 2026 12:56:26 -0800 Subject: [PATCH 1/3] feat: Add systemd service to auto-fetch Apple firmware and ensure its execution on first boot. --- 02_build_image.sh | 2 ++ files/chroot_build.sh | 20 ++++++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/02_build_image.sh b/02_build_image.sh index e45da98..256fc83 100755 --- a/02_build_image.sh +++ b/02_build_image.sh @@ -18,6 +18,8 @@ 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: Reset firmware flag for fresh boot... " +rm -f "${CHROOT_PATH}/etc/get_apple_firmware_attempted" || true echo >&2 "===]> Info: Compress the chroot... " cd "${WORKING_PATH}" diff --git a/files/chroot_build.sh b/files/chroot_build.sh index 4fe527d..7e45b3d 100755 --- a/files/chroot_build.sh +++ b/files/chroot_build.sh @@ -123,6 +123,26 @@ printf 'apple-bce' >>/etc/modules-load.d/t2.conf #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 >&2 "===]> Info: Setup auto-fetch firmware service... " + +cat <<'EOF' >/etc/systemd/system/get-apple-firmware.service +[Unit] +Description=Get Apple WiFi and Bluetooth firmware +ConditionPathExists=!/etc/get_apple_firmware_attempted +ConditionPathExists=/lib/firmware/brcm + +[Service] +Type=oneshot +RemainAfterExit=yes +ExecStart=-/usr/libexec/get-apple-firmware -i get_from_macos +ExecStart=touch /etc/get_apple_firmware_attempted + +[Install] +WantedBy=multi-user.target +EOF + +systemctl enable get-apple-firmware.service + echo >&2 "===]> Info: Update initramfs... " ## Add custom drivers to be loaded at boot From 1d0c02d93b447e69611c6745574d349c01d56a79 Mon Sep 17 00:00:00 2001 From: RayBB Date: Thu, 8 Jan 2026 18:02:00 -0800 Subject: [PATCH 2/3] use curl instead --- files/chroot_build.sh | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/files/chroot_build.sh b/files/chroot_build.sh index 7e45b3d..6dc6814 100755 --- a/files/chroot_build.sh +++ b/files/chroot_build.sh @@ -125,21 +125,7 @@ printf 'apple-bce' >>/etc/modules-load.d/t2.conf echo >&2 "===]> Info: Setup auto-fetch firmware service... " -cat <<'EOF' >/etc/systemd/system/get-apple-firmware.service -[Unit] -Description=Get Apple WiFi and Bluetooth firmware -ConditionPathExists=!/etc/get_apple_firmware_attempted -ConditionPathExists=/lib/firmware/brcm - -[Service] -Type=oneshot -RemainAfterExit=yes -ExecStart=-/usr/libexec/get-apple-firmware -i get_from_macos -ExecStart=touch /etc/get_apple_firmware_attempted - -[Install] -WantedBy=multi-user.target -EOF +curl -s https://raw.githubusercontent.com/t2linux/wiki/refs/heads/master/docs/tools/get-apple-firmware.service -o /etc/systemd/system/get-apple-firmware.service systemctl enable get-apple-firmware.service From 4291140a3cc4f9578add1d897a0f5ee7c2baadaf Mon Sep 17 00:00:00 2001 From: Aditya Garg Date: Wed, 14 Jan 2026 13:28:49 +0530 Subject: [PATCH 3/3] Use wget on Linux to check for Internet --- .github/workflows/iso.sh | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/.github/workflows/iso.sh b/.github/workflows/iso.sh index 0876c33..e927c1b 100644 --- a/.github/workflows/iso.sh +++ b/.github/workflows/iso.sh @@ -3,10 +3,21 @@ os=$(uname -s) case "$os" in (Darwin) - true + 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 ;; (Linux) - true + if wget -q --spider --timeout=5 --tries=1 http://github.com >/dev/null 2>&1; then + true + else + echo "Please connect to the internet" + exit 1 + fi ;; (*) echo "This script is meant to be run only on Linux or macOS" @@ -14,15 +25,6 @@ case "$os" in ;; 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