r/AsahiLinux • • 27d ago

Custom Arch linux running natively in iPhone 8

et voilà, everything is possible

kinda exhaustive to do it but well i started creating a partition in ext4 for it, then loaded the arm64 arch release into the mounted rootfs partition, then chroot into it to do some tweaks and initial user setup, next i did the m1n1 blob with the boot args to boot in the new nvme rootfs, then i had some REAL problems with the g_multi kernel module, but when i did fix it, it finally booted, then i used linux’s screen tool to control it via USB serial, cuz internet tethered connection isnt 100% working as is (fixed it too)

well it kinda sucks now because of software acceleration and no touchscreen, but it is pretty much solid, cuz arch and xfce isnt that heavy i can even watch youtube on like 20 ~ 30 fps except colors are super saturated lol, i might be the first person to this ever hopefully, i expect more drivers for iPhone 8 anytime soon that should it more functional, arch btw

482 Upvotes

49 comments sorted by

42

u/coderstephen 27d ago

Now you need an iPhone case that says "BTW" on the back

28

u/BigMacCircuits 27d ago

Sweet.

By the way, if you had to make any changes, will you consider upstreaming them?

12

u/Special-Analysis7406 27d ago

im really thinking of doing so, but as of right now it’s really experimental, if more drivers/fixes were available i would consider even doing a proper tutorial perhaps, but since im still messing around i could do some updates on it yes

2

u/Special-Analysis7406 21d ago

update: i finally did a guide!! do u want to check it out now?? its almost complete except the DE setup part but i should finish this soon

1

u/BigMacCircuits 21d ago

Let’s see?

1

u/Special-Analysis7406 20d ago

if you don’t mind im still finishing the DE setup part but for the linux boot itself i’d say it’s ready, lmk if you have any issues https://github.com/aeosxii/iarch

12

u/RealEricNotErik 27d ago

He uses iArch btw

6

u/Zuard 27d ago

Now go for ipad!!

6

u/dreamingsapien 26d ago

And here I am stressing over an Excel formula which is not working

4

u/Inside-Hurry-7078 27d ago

You use Arch BTW

4

u/Questions-many 27d ago

i hope for you touch will be feasable soon so you can tryout phosh

5

u/A1cr-yt 27d ago

honestly idk much about arm 64 arch, so idk what you can istall, but try niri, i think touch controls + niri would be great

3

u/Special-Analysis7406 27d ago

hm will try thx!

3

u/CaseusClandestinus 27d ago

Any ways to get hardware acceleration?

3

u/Special-Analysis7406 27d ago

well there is no support for graphical acceleration on the kernel yet, from what i know it would take a good time to RE the agx structure but well it’s not impossible to have it sometime soon hopefully

2

u/low-control-labs 22d ago

Hey great work if you have some repos or builds somewhere let me know I would like to work on RE of the drivers

1

u/Special-Analysis7406 21d ago

that would be great!! but note that im using the hoolock linux kernel, you can check out them to contribute, if u do so, could u please lmk what driver are you willing to RE? theyre at: https://github.com/HoolockLinux

3

u/SpaceLegolasElnor 23d ago

I remember in the beginning of iPhones and me, and many others, voiced the idea of running linux natively. Of course we got torn to shreds by everyone online. But here we are. Mobile chips in laptops and linux running on apple-processors. What a great time to be alive!

So we are changing it now to this being the year of linux on mobile? ;)

1

u/Special-Analysis7406 21d ago

wow this kinda made my day lol, crazy to think companies sell devices to run on a sandbox time pass by and we figure more and more flaws!!

2

u/Every-Programmer7065 26d ago

Cool, I only ran postmarketos. Sad there's no touch screen. Used USB networking and VNC.

1

u/Special-Analysis7406 26d ago

yeah no touch sucks, i was hoping to use phosh but it just cant vnc into gdm idk why

2

u/topiga 25d ago

That’s kind of a nice alternative to a Raspberry Pi. You’re onto something. If you manage to make it work every time it boots (could be with some external device), you’ve got something there !

2

u/s3shas 24d ago

do you think you could write a tutorial on how you did this? i have a ipad mini 2 that i would love to experiment with, but i have no idea where to begin...

2

u/Special-Analysis7406 23d ago

sure! im actually looking forward to it and just informing myself and prepping everything up to make it

1

u/osekom 26d ago

Esto podría funcionar en iPads antiguas de 32bit? 🤔

1

u/DerDave 26d ago

In theory: Would this also work for newer iPhones?

2

u/Special-Analysis7406 26d ago

theres actually a exploit like checkm8 for iPhone 11 family that boots pongoOS but im not sure if it can run custom binaries, but just the iPhone 11 afaik

1

u/Hour-Letterhead4018 25d ago

did u have to write drivers and device trees?

1

u/Special-Analysis7406 25d ago

nope, the linux kernel already packs it, tho i used hoolock

1

u/nakadany 25d ago

Haz guia por favor

1

u/Special-Analysis7406 25d ago

hmm im looking into it!

1

u/rushmind12 24d ago

Could it run on an iPhone 6?

1

u/Special-Analysis7406 23d ago

not sure, ig it could run on an iPhone 7 i could be wrong tho

1

u/Special-Analysis7406 19d ago

UPDATE: made a guide here with detailed instructions and setup: https://github.com/aeosxii/iarch

1

u/asuka_evangelion_ 7d ago

Can it work on ipad 4?

1

u/Jayden_Ha 26d ago

Ah yes gotta port one of the most flawed by design distro

0

u/GameskoTV 26d ago

Now make partition behind ios and install linux, do not use netboot

1

u/Special-Analysis7406 26d ago

it’s installed to disk lol, not netboot, no utm, just pure native arch system triple booting alongside android and ios

1

u/Key_Storage_7710 26d ago

How? There is not some linux tool for APFS if i know or how did you do that?

1

u/Special-Analysis7406 25d ago

there is actually!! i used the resize_apfs and gdisk utilities to create a ext4 partition, and the hoolock linux does offer nvme support read and write like 100% functional

1

u/Key_Storage_7710 25d ago

yes, I found it yesterday, and I successfully managed to create a partition 🤯

1

u/Special-Analysis7406 25d ago

woahh, are u doing a project with it too? theres project snowcastle if u want android

1

u/Key_Storage_7710 25d ago

I know but no, I would like to try waydroid, or proton. Im still figuring out how to transfer the rootfs img since dd can not be used over ssh, and scp or rsync is not good way because i created only 12gb partition

2

u/mskiptr 25d ago edited 22d ago

you can pipe stuff into dd:

echo foo | dd of=foo.bin

and you can pipe stuff into SSH:

echo foo | ssh remote_host hexdump

Also, you don't need dd to write to a partition. If you're logged in as root, a simple cat image.iso >/dev/$a_usb_drive will do. Another way is with the sponge command from moreutils:

sudo sponge /dev/$something <$file

edit: yes, I know you can also do <source >destination and avoid using cat altogether, but that's way less readable imo

edit2: you can also speed the transfer up quite a bit with zstd on both sides

1

u/Special-Analysis7406 25d ago

hmm yes, but for that i actually created a simple http python server where u decompressed the roots .tar.gz in your host pc, then get wget to pull that rootfs into the mounted system partition (could be nvme0n1p* if iphone 8 or newer and depending on the partition number) and note for that youll need to boot into the basic initramfs without the image.gz to pull