@@ -980,12 +980,7 @@ offer_lima_for_usb_get_rfswift() {
980980 fi
981981 else
982982 if prompt_yes_no " Would you like to install Lima for USB passthrough?" " n" ; then
983- if command_exists brew; then
984- brew install lima qemu
985- color_echo " green" " Lima installed. Use 'rfswift --engine lima' when you need USB devices."
986- else
987- color_echo " red" " Homebrew is required. Install it first: https://brew.sh/"
988- fi
983+ install_lima_fork
989984 fi
990985 fi
991986}
@@ -1087,15 +1082,7 @@ check_container_engine() {
10871082 if [ " $( uname -s) " = " Darwin" ]; then
10881083 # Lima option on macOS
10891084 color_echo " blue" " 🦙 Installing Lima..."
1090- if command_exists brew; then
1091- brew install lima qemu
1092- color_echo " green" " ✅ Lima installed."
1093- color_echo " cyan" " RF Swift will auto-create a QEMU VM on first 'rfswift run'."
1094- color_echo " cyan" " Or create one manually: limactl create --name rfswift lima/rfswift.yaml"
1095- else
1096- color_echo " red" " ❌ Homebrew is required. Install it first: https://brew.sh/"
1097- return 1
1098- fi
1085+ install_lima_fork
10991086 else
11001087 color_echo " yellow" " ⚠️ Container engine installation skipped."
11011088 color_echo " yellow" " You will need Docker or Podman before using RF-Swift."
@@ -1134,6 +1121,65 @@ check_container_engine() {
11341121# Podman Installation
11351122# ═══════════════════════════════════════════════════════════════════════════════
11361123
1124+ # Install Lima from PentHertz fork (with USB passthrough support) + QEMU
1125+ LIMA_VERSION=" 2.1.1"
1126+ LIMA_RELEASE_BASE=" https://github.com/PentHertz/lima/releases/download/v${LIMA_VERSION} "
1127+
1128+ install_lima_fork () {
1129+ if [ " $( uname -s) " != " Darwin" ]; then
1130+ color_echo " yellow" " Lima is only needed on macOS for USB passthrough."
1131+ return 0
1132+ fi
1133+
1134+ if ! command_exists brew; then
1135+ color_echo " red" " Homebrew is required to install QEMU."
1136+ color_echo " yellow" " Install Homebrew: https://brew.sh/"
1137+ return 1
1138+ fi
1139+
1140+ # Install QEMU via Homebrew
1141+ if ! command_exists qemu-img; then
1142+ color_echo " blue" " Installing QEMU via Homebrew..."
1143+ brew install qemu
1144+ fi
1145+
1146+ # Remove Homebrew Lima if present (we use the PentHertz fork)
1147+ if brew list lima & > /dev/null; then
1148+ color_echo " yellow" " Removing Homebrew Lima in favor of PentHertz fork (USB support)..."
1149+ brew uninstall lima
1150+ fi
1151+
1152+ local arch
1153+ arch=$( uname -m)
1154+ case " $arch " in
1155+ arm64|aarch64) arch=" arm64" ;;
1156+ x86_64|amd64) arch=" x86_64" ;;
1157+ * )
1158+ color_echo " red" " Unsupported architecture: $arch "
1159+ return 1
1160+ ;;
1161+ esac
1162+
1163+ local tarball=" lima-${LIMA_VERSION} -Darwin-${arch} .tar.gz"
1164+ local url=" ${LIMA_RELEASE_BASE} /${tarball} "
1165+ local tmp=" /tmp/${tarball} "
1166+
1167+ color_echo " blue" " Installing Lima ${LIMA_VERSION} (PentHertz fork with USB support)..."
1168+ curl -fsSL " $url " -o " $tmp "
1169+ sudo tar xz -C /usr/local -f " $tmp "
1170+ rm -f " $tmp "
1171+
1172+ if ! command_exists limactl; then
1173+ color_echo " red" " Lima installation failed — limactl not found in PATH."
1174+ color_echo " yellow" " Ensure /usr/local/bin is in your PATH."
1175+ return 1
1176+ fi
1177+
1178+ color_echo " green" " ✅ Lima ${LIMA_VERSION} (PentHertz fork) and QEMU installed."
1179+ limactl --version
1180+ color_echo " cyan" " Use 'rfswift --engine lima' when you need USB devices."
1181+ }
1182+
11371183install_podman () {
11381184 color_echo " blue" " 🦭 Installing Podman..."
11391185
@@ -2331,7 +2377,7 @@ main() {
23312377 color_echo " cyan" " Or let RF Swift auto-create it on first 'rfswift run' when no Docker/Podman is found."
23322378 fi
23332379 else
2334- color_echo " yellow" " Lima is not installed. Install with: brew install lima qemu "
2380+ color_echo " yellow" " Lima is not installed. Run the installer or see https://github.com/PentHertz/lima/releases "
23352381 color_echo " cyan" " After installing, RF Swift can auto-manage a QEMU VM with USB passthrough."
23362382 color_echo " cyan" " USB commands: rfswift macusb list | attach | detach | status"
23372383 fi
0 commit comments