1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66
|
#!/bin/sh
# SPDX-License-Identifier: MIT
# Truncation guard
if true; then
set -e
if [ ! -e /System ]; then
echo "You appear to be running this script from Linux or another non-macOS system."
echo "Asahi Linux can only be installed from macOS (or recoveryOS)."
exit 1
fi
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
export PATH="/usr/bin:/bin:/usr/sbin:/sbin:$PATH"
export VERSION_FLAG=https://cdn.asahilinux.org/installer-dev/latest
export INSTALLER_BASE=https://cdn.asahilinux.org/installer-dev
export INSTALLER_DATA=https://github.com/AsahiLinux/asahi-installer/raw/main/data/installer_data.json
export REPO_BASE=https://cdn.asahilinux.org
export REPORT=https://stats.asahilinux.org/report
export REPORT_TAG=alx-dev
export EXPERT=1
#TMP="$(mktemp -d)"
TMP=/tmp/asahi-install
echo
echo "Bootstrapping installer:"
if [ -e "$TMP" ]; then
mv "$TMP" "$TMP-$(date +%Y%m%d-%H%M%S)"
fi
mkdir -p "$TMP"
cd "$TMP"
echo " Checking version..."
PKG_VER="$(curl --no-progress-meter -L "$VERSION_FLAG")"
echo " Version: $PKG_VER"
PKG="installer-$PKG_VER.tar.gz"
echo " Downloading..."
curl --no-progress-meter -L -o "$PKG" "$INSTALLER_BASE/$PKG"
curl --no-progress-meter -L -O "$INSTALLER_DATA"
echo " Extracting..."
tar xf "$PKG"
echo " Initializing..."
echo
if [ "$USER" != "root" ]; then
echo "The installer needs to run as root."
echo "Please enter your sudo password if prompted."
exec caffeinate -dis sudo -E ./install.sh "$@"
else
exec caffeinate -dis ./install.sh "$@"
fi
fi
|