Skip to content
This repository has been archived by the owner on Feb 7, 2020. It is now read-only.

Commit

Permalink
Release #2 fixes several bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
Ronsor committed Nov 23, 2019
1 parent 1400297 commit ce3044c
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 19 deletions.
15 changes: 11 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ ra1nstorm is 100% legal

#### 2. Does it work on iPads or iPods?

ra1nstorm setup does not currently work with iPads or iPods, but after initial
setup, they should work fine.
ra1nstorm setup ~~does not~~ *should* currently work with iPads or iPods, but after initial
setup, they will definitely work fine.

#### 3. How do I run checkra1n?

Expand All @@ -36,8 +36,10 @@ and follow the instructions.

#### 4. Does this work with AMD CPUs?

ra1nstorm does not currently support AMD CPUs. This is because macOS does not
work properly with them. Please complain to Apple, not us.
Yes it does.

~~ra1nstorm does not currently support AMD CPUs. This is because macOS does not
work properly with them. Please complain to Apple, not us.~~

#### 5. BootVM tells me that I need to enable "VT-d" or something. How?

Expand Down Expand Up @@ -72,4 +74,9 @@ This software is *beta quality*. Be careful.

ra1nstorm (C) 2019 Ronsor Labs. This software is licensed under the terms of the
MIT/X11 license.

checkra1n (C) 2019 Kim Jong Cracks. Development by qwertyoruiop, axi0mx, et al.

Thanks to the creator of OSX-KVM and all contributors.


8 changes: 4 additions & 4 deletions stage1/main.iss
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ OutputDir = ..\
Source: "..\ra1nstorm.run"; DestDir: "{app}"

[Run]
Filename: "{tmp}\ra1nlinux\wubi.exe"; Parameters: "--size=64000"
Filename: "{localappdata}\ra1nlinux\wubi.exe"; Parameters: "--size=64000"

[Code]
procedure InitializeWizard();
begin
CreateDir(ExpandConstant('{tmp}\ra1nlinux'));
idpAddFile('https://github.com/hakuna-m/wubiuefi/releases/download/18042r333/wubi18042r333.exe', ExpandConstant('{tmp}\ra1nlinux\wubi.exe'));
idpAddFile('http://mirror.us.leaseweb.net/ubuntu-cdimage/xubuntu/releases/18.04/release/xubuntu-18.04.2-desktop-amd64.iso', ExpandConstant('{tmp}\ra1nlinux\xubuntu-18.04.2-desktop-amd64.iso'));
CreateDir(ExpandConstant('{localappdata}\ra1nlinux'));
idpAddFile('https://github.com/hakuna-m/wubiuefi/releases/download/18042r333/wubi18042r333.exe', ExpandConstant('{localappdata}\ra1nlinux\wubi.exe'));
idpAddFile('http://mirror.us.leaseweb.net/ubuntu-cdimage/xubuntu/releases/18.04/release/xubuntu-18.04.2-desktop-amd64.iso', ExpandConstant('{localappdata}\ra1nlinux\xubuntu-18.04.2-desktop-amd64.iso'));
idpDownloadAfter(wpReady);
end;
Expand Down
23 changes: 15 additions & 8 deletions stage2/main.awk
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ function execforline(n,\
return ret
}

function cpu_is_intel() {
return system("lscpu | grep 'Model name' | grep -q Intel") == 0
}

function wiz_intro() {
if (zenity_html("./intro.html", 0, gzenity " --ok-label 'Get Started' --cancel-label 'Exit'") == 0) {
wizard_next()
Expand All @@ -24,14 +28,14 @@ function wiz_checksys(\
if (!match(execforline("id -u"), /^0/)) {
print "# Error: you need to run ra1nstorm as root" | h
failed = 1
} else if (!match(execforline("lscpu | grep Vendor && sleep 1"), /.*GenuineIntel.*/)) {
print "# Error: this computer does not have an Intel CPU" | h
failed = 1
#} else if (!match(execforline("lscpu | grep Vendor && sleep 1"), /.*GenuineIntel.*/)) {
# print "# Error: this computer does not have an Intel CPU" | h
# failed = 1
} else if (execforline("df --output=avail $HOME | tail -n1") < (40 * 1024 * 1024)) { # 40GiB
print "# Error: at least 40G of disk space is required" | h
failed = 1
} else if (execforline("cat /proc/meminfo | grep MemTotal | tr -d '[A-Za-z: ]'") < (4.5 * 1024 * 1024)) { # 8GiB
print "# Error: at least 6G of RAM is required" | h
} else if (execforline("cat /proc/meminfo | grep MemTotal | tr -d '[A-Za-z: ]'") < (4 * 1000 * 1000)) { # 4GiB
print "# Error: at least 4G of RAM is required" | h
failed = 1
} else if (!match(execforline("lscpu | grep Flags"), /.*vmx.*/)) {
print "# Error: your CPU does not support hardware virtualization (or it is not enabled in the BIOS)" | h
Expand All @@ -54,6 +58,7 @@ function wiz_installreq(\
h, failed, status) {
h = zenity_progress("Installing required packages (this may take a long time)...", 0, gzenity " --ok-label 'Next' --cancel-label 'Back'")
# TODO: support other distros?
system("apt update")
for (i = 0; i < length(REQPKGS); i++) {
print "# Installing " REQPKGS[i] "..." | h
if (system("apt install -y " REQPKGS[i]) > 0) {
Expand Down Expand Up @@ -142,9 +147,11 @@ function wiz_bootinstructions() {
}

function wiz_configiommu(\
h,status,failed,pciid) {
h,status,failed,pciid,cpumanf) {
cpumanf = "intel"
if (!cpu_is_intel()) cpumanf = "amd"
zenity_alert("info", "ra1nstorm will now attempt to detect which USB controller to forward.\n" \
"Please disconnect all other USB devices and connect ONLY your iPhone directly to your computer.\n" \
"Please disconnect all other USB devices (except your keyboard and/or mouse) and connect ONLY your iPhone directly to your computer.\n" \
"Do NOT use a USB hub or any similar gadgets.\n\nPress OK to continue.")
h = zenity_progress("Autodetecting USB configuration...", 0, gzenity " --ok-label 'Reboot' --cancel-label 'Back'")
print "20" | h
Expand All @@ -160,7 +167,7 @@ function wiz_configiommu(\
print "45" | h
print "# Patching GRUB..." | h
ok = system("echo vfio >> /etc/modules && echo vfio_iommu_type1 >> /etc/modules && echo vfio_pci >> /etc/modules && echo vfio_virqfd >> /etc/modules &&" \
"sed -i 's/GRUB_CMDLINE_LINUX_DEFAULT=\"/GRUB_CMDLINE_LINUX_DEFAULT=\"iommu=pt intel_iommu=on video=efifb:off/' /etc/default/grub &&" \
"sed -i 's/GRUB_CMDLINE_LINUX_DEFAULT=\"/GRUB_CMDLINE_LINUX_DEFAULT=\"iommu=pt amd_iommu=on intel_iommu=on video=efifb:off/' /etc/default/grub &&" \
"echo 'options vfio-pci ids=" pciid "' > /etc/modprobe.d/vfio.conf &&" \
"update-grub2 && update-initramfs -k all -u")
if (ok != 0)
Expand Down
7 changes: 4 additions & 3 deletions stage2/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@
ID="$(id -u)"
if [ "$ID" != 0 ]; then
echo "ra1nstorm must be run as root"
which sudo 2>&1 >/dev/null && exec sudo gawk -f main.awk
which sudo 2>&1 >/dev/null && exec sudo $0
echo "enter root password below"
exec su -c 'gawk -f main.awk'
exec su -c $0
fi
echo "Checking if zenity is installed..."
echo "Checking if zenity and gawk are installed..."
which gawk 2>&1 >/dev/null || apt install -y gawk
which zenity 2>&1 >/dev/null || apt install -y zenity
echo "Launching setup..."
exec gawk -f main.awk

0 comments on commit ce3044c

Please sign in to comment.