File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33os=$( uname -s)
44case " $os " in
55 (Darwin)
6- true
6+ echo -e " GET http://github.com HTTP/1.0\n\n" | nc github.com 80 > /dev/null 2>&1
7+ if [ $? -eq 0 ]; then
8+ true
9+ else
10+ echo " Please connect to the internet"
11+ exit 1
12+ fi
713 ;;
814 (Linux)
9- true
15+ if wget -q --spider --timeout=5 --tries=1 http://github.com > /dev/null 2>&1 ; then
16+ true
17+ else
18+ echo " Please connect to the internet"
19+ exit 1
20+ fi
1021 ;;
1122 (* )
1223 echo " This script is meant to be run only on Linux or macOS"
1324 exit 1
1425 ;;
1526esac
1627
17- echo -e " GET http://github.com HTTP/1.0\n\n" | nc github.com 80 > /dev/null 2>&1
18-
19- if [ $? -eq 0 ]; then
20- true
21- else
22- echo " Please connect to the internet"
23- exit 1
24- fi
25-
2628set -e
2729
2830cd $HOME /Downloads
Original file line number Diff line number Diff line change @@ -18,6 +18,8 @@ touch "${IMAGE_PATH}"/ubuntu
1818cp -r " ${ROOT_PATH} " /files/preseed " ${IMAGE_PATH} " /preseed
1919cp " ${ROOT_PATH} /files/grub/grub.cfg" " ${IMAGE_PATH} " /isolinux/grub.cfg
2020
21+ echo >&2 " ===]> Info: Reset firmware flag for fresh boot... "
22+ rm -f " ${CHROOT_PATH} /etc/get_apple_firmware_attempted" || true
2123
2224echo >&2 " ===]> Info: Compress the chroot... "
2325cd " ${WORKING_PATH} "
Original file line number Diff line number Diff line change @@ -65,6 +65,12 @@ cat <<EOF | sudo tee /etc/NetworkManager/conf.d/99-network-t2-ncm.conf
6565no-auto-default=t2_ncm
6666EOF
6767
68+ echo >&2 " ===]> Info: Setup auto-fetch firmware service... "
69+
70+ 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
71+
72+ systemctl enable get-apple-firmware.service
73+
6874echo >&2 " ===]> Info: Cleanup the chroot environment... "
6975
7076truncate -s 0 /etc/machine-id || true
You can’t perform that action at this time.
0 commit comments