https://old.reddit.com/r/linux/comments/kux9xx/success_iphone_7_with_dead_nand_netbooting/ jump to content my subreddits edit subscriptions * popular * -all * -random * -users | * AskReddit * -funny * -gaming * -news * -pics * -movies * -explainlikeimfive * -worldnews * -aww * -todayilearned * -videos * -IAmA * -Jokes * -science * -mildlyinteresting * -tifu * -LifeProTips * -GetMotivated * -askscience * -Showerthoughts * -TwoXChromosomes * -gifs * -dataisbeautiful * -books * -nottheonion * -Futurology * -OldSchoolCool * -Music * -DIY * -food * -nosleep * -sports * -UpliftingNews * -Documentaries * -Art * -history * -space * -EarthPorn * -InternetIsBeautiful * -photoshopbattles * -creepy * -WritingPrompts * -philosophy * -listentothis * -gadgets * -announcements * -blog more >> linux linux * comments * other discussions (3) Want to join? Log in or sign up in seconds.| * English [ ][] [ ]limit my search to r/linux use the following search parameters to narrow your results: subreddit:subreddit find submissions in "subreddit" author:username find submissions by "username" site:example.com find submissions from "example.com" url:text search for "text" in url selftext:text search for "text" in self post contents self:yes (or self:no) include (or exclude) self posts nsfw:yes (or nsfw:no) include (or exclude) results marked as NSFW e.g. subreddit:aww site:imgur.com dog see the search faq for details. advanced search: by author, subreddit... this post was submitted on 11 Jan 2021 532 points (98% upvoted) shortlink: [https://redd.it/kux9] [ ][ ] [ ]remember mereset password login Submit a new link Submit a new text post Get an ad-free experience with special benefits, and directly support Reddit. get reddit premium linux joinleave608,661 readers 31,094 users here now Please Read the full Rules here before posting or commenting GNU/Linux is a free and open source software operating system for computers. The operating system is a collection of the basic instructions that tell the electronic parts of the computer what to do and how to work. Free, Libre and open source software (FLOSS) means that everyone has the freedom to use it, see how it works, and change it. GNU/Linux is a collaborative effort between the GNU project, formed in 1983 to develop the GNU operating system and the development team of Linux, a kernel. Initially Linux was intended to develop into an operating system of its own, but these plans were shelved somewhere along the way. Linux is also used without GNU in embedded systems, mobile phones, and more often with BusyBox or other such embedded tools. These can include things like Android, ChromeOS, or sometimes be referred to as * What is free software? * Basic history of GNU/Linux * Linux announcement post from 1991 * The Linux Kernel^[/] Join us on IRC at #r/linux on freenode.net! Frequently Asked Questions Recent AMA's * Bedrock Linux * Plasma Mobile (KDE) * sway wlroots * Greg Kroah-Hartman * For more AMAs, check out our wiki link by clicking here. GNU/Linux resources GNU/Linux Related: * Kernel * GNU * LinuxAdmin * LinuxDevices * FreeGaming / OpenSourceGames / LinuxGaming * LinuxQuestions / Linux4noobs * DistroHopping / DistroReviews * Linux Weekly News^[/] * Linux Hardware Distributions: * Arch * elementary OS * Gentoo * openSUSE / SUSE * Slackware * Solus Debian based * Debian * Bunsen Labs / CrunchBang * LinuxMint * MX Linux * Pop!_OS * Ubuntu / Xubuntu / Ubuntu Budgie Remix, Lubuntu RedHat * Red Hat * CentOS * Fedora Unique * NixOS * Bedrock Linux with Proprietary Elements * Chrome OS Embedded * OpenWRT Linux on Mobile: * Android + Termux * Jolla (SailfishOS) * PostmarketOS * Replicant^[/] Replicant * ZeroPhone Movements: * Free Culture * Free Software * Hack Bloc Desktop Environments: * Cinnamon * Enlightenment / e17 * GNOME * KDE * LXDE / LXQt * XFCE Window Managers: * awesomewm * Openbox * xmonad * i3 Fluff * LinuxMemes * UnixPorn * UsabilityPorn * WildLinuxAppears Learning/resources * Ask Linux Users * /r/bash * CommandLine * Linuxadmin * LinuxDev * Linux From Scratch * Linux Projects * Software Freedom Law Center^[/] * Raspberry Pi * OSdev Creativity: * Blender * FOSSPhotography * FreeCAD * GIMP * Krita * LibreDesign * LibreOffice * LibreStudio * LinuxAudio * LinuxFilmMaking Help * /r/linuxquestions * /r/bash with [HELP] tag Webcasts: * Level 1 Techs^[/] * The Lunduke Hour^[/] * Linux Unplugged (formerly Linux Action Show) * Bad Voltage^[/] * Hacker Public Radio^[/] * FaiFCast^[/] Other operating systems: * AROS^[/] * BSD * FreeBSD * Genode^[/] * Haiku * HelenOS^[/] * HURD * Minix * Plan 9 Rules * No support requests - This is not a support forum! Head to /r/ linuxquestions or /r/linux4noobs for support or help. Looking for a distro? Try r/findmeadistro. * No spamblog submissions - Posts that are identified as either blog-spam, a link aggregator, or an otherwise low-effort website are to be removed. * No memes, image macros or rage comics - Meme posts are not allowed in r/linux outside of the weekend megathread. Feel free to post over at /r/linuxmemes instead. * Reddiquette, trolling, or poor discussion - r/linux asks all users follow Reddiquette. Top violations of this rule are trolling, starting a flamewar, or not "remembering the human" aka being hostile or incredibly impolite. * Relevance to r/linux community - Posts should follow what the community likes: GNU/Linux, Linux kernel itself, the developers of the kernel or open source applications, any application on Linux, and more. Take some time to get the feel of the subreddit if you're not sure! * Spamming self-promotion and surveys - Submitting your own original content is welcome on r/linux, but we do ask that you contribute more than just your own content to the subreddit as well as require you to interact with the comments of your submission. Additionally, surveys are not allowed. * No misdirecting links, sites that require a login, or URL shorteners - In short: if your link doesn't go right to the content it will be removed. * No NSFW - If you're posting a screenshot of your background, make sure it's SFW! Please review full details on rules here. See even more subreddit and external links over at the supplemental page a community for 12 years MODERATORS * message the mods * kylev * Kruug * iamedwards * dokuhebi * jampola * CAP_NAME_NOW_UPVOTE * robbit42 * MarlinMr * AutoModerator * sandragen * ...and 5 more >> discussions in r/linux <> X 1570 * 418 comments Linux is the most "vulnerable" OS in the world. 531 * 49 comments SUCCESS: iPhone 7 with dead NAND netbooting unmodified Ubuntu 20.04 arm64 over usb gadget ethernet 105 * 29 comments Teamspeak 5 to be based on the Matrix protocol. 1365 * 166 comments Firefox - we're finally getting HW acceleration on Linux 48 * 1 comment Reversed the Z3 series LCD display USB protocol as I use Linux 11 * 2 comments I made a tool for remembering linux commands 793 * 130 comments New pacman parallel download. installing five apps in 10 seconds 2 I made a fuzzy systemctl service helper powered by fzf 11 * 1 comment juicedata/juicefs: JuiceFS is an open-source POSIX file system built on top of Redis and object storage in Golang 114 * 9 comments Firefox 86: AVIF support enabled by default Welcome to Reddit, the front page of the internet. Become a Redditor and join one of thousands of communities. x 531 532 533 Mobile LinuxSUCCESS: iPhone 7 with dead NAND netbooting unmodified Ubuntu 20.04 arm64 over usb gadget ethernet (self.linux) submitted 14 hours ago * by newhacker1746[klvxk1wggf][5izbv4fn0m] [fpm0r5ryq1]2 I just got done with this incredible experiment, and I couldn't resist sharing. EDIT: VIDEO!!! https://youtu.be/DrntxWqDuvI -------- Prerequisites 1. writable directory available over nfs, including dhcp server on local network 2. checkra1n 0.10.2-beta (get at https://checkra.in/releases/ 0.10.2-beta#all-downloads) 3. Kernel fork for h9x/A10 (https://github.com/corellium/ linux-sandcastle) 4. projectsandcastle utilities (https://github.com/corellium/ projectsandcastle) 5. EITHER arm64 cross compiler or an arm64 native device. I used a rpi4 on 20.04 <-- way helpful to be able to chroot and setup, otherwise you'd have to use qemu-user 6. Bridge setup script/udev rules by me https://github.com/ newperson1746/iphone7-linux-nfsroot 1. Rootfs setup Make sure you have debootstrap. I'm assuming an arm64 native ubuntu device already running to which you have mounted the nfs directory at /mnt/nfsrootarm64 * sudo debootstrap focal /mnt/nfsrootarm64 * Now you can chroot into it and run some important pre-setup: + I'd install nano for convenience, I'll assume you have it from now on + apt install nano network-manager openssh-server + dpkg-reconfigure locales o This'll fix the famous debootstrap LC_ALL error. I chose en_US.utf-8 and also chose it as default. + dpkg-reconfigure tzdata o Here you can fix the clock + adduser o This'll be your non-root admin user for regular use + adduser sudo + nano /etc/apt/sources.list o Add focal-updates, focal-backports, and focal-security! o You can also add universe if you want to at this point 2. Kernel setup clone the sandcastle kernel, and make hx_h9p_defconfig , now we need to make quite a few changes to the config. I did them manually by editing .config: * CONFIG_USB_ETH=y * CONFIG_NFS_FS=y * CONFIG_IP_PNP=y * CONFIG_IP_PNP_DHCP=y * CONFIG_BLK_DEV_INITRD=n // (none needed, otherwise it'll complain about wanting one) * CONFIG_CMDLINE="earlycon=hx_uart,0x20a0c0000 console=tty0 root=/ dev/nfs rw nfsroot=:/nfsrootarm64,vers=4,tcp init=/usr/bin/systemd rootwait ip=dhcp g_ether.host_addr= 12:a5:cf:42:92:fd g_ether.dev_addr=5e:bc:ca:27:92:b1 g_ether.idVendor=1317 g_ether.idProduct=42146 mitigations=off" + Replace the MAC addresses if you'd like, but I'll assume these are the ones moving forward + Fill in your nfs server ip + All of the flags are needed, I spent like 30 power cycles figuring out why nfs wouldn't mount unless i specified tcp. * CONFIG_ROOT_NFS=y * CONFIG_CMDLINE_FORCE=y * CONFIG_DEBUG_INFO=n // to speed up compile drastically Now you can export LOCALVERSION if you'd like, and CROSS_COMPILE and ARCH=arm64if needed, but now it's just the good old: make -j 4 Image * Now run ./dtbpack.sh to generate the device-trees that PongoOS will use later. * lzma -z --stdout arch/arm64/boot/Image > ../Image.lzma to create the linux image that PongoOS can boot 3. Project Sandcastle utilities: clone the repo and cd to loader. * make will fail so simply run manually cc -O2 -Wall load-linux.c -lusb-1.0 -o load-linux + (-lusb was before load-linux.c, which broke sometime after sandcastle was first released) 4. Networking setup: clone my repo. * edit ethbridge.sh with your ethernet ifname (it can trivially be modified to accept it as an argument from udev or something like that, but I'm lazy) + Place it somewhere static so you can call it from udev later * edit 70-iphone7.rules with the MAC of your g_ether if you changed it, and put the correct path to ethbridge.sh + Move 70-iphone7.rules to /etc/udev/rules.d + sudo udevadm control --reload 5. checkra1n: you'll need 0.10.2-beta due to a command in PongoOS that was removed in later versions. It was added back after its open-sourcing, but the linux loader fails, so let's stick to this one. ----- PUTTING IT ALL TOGETHER * Have the iPhone in recovery mode * Launch checkra1n normally (no args) * Hit start, and follow the DFU instructions. Once it tells you you've successfully entered DFU mode (sometimes it doesn't, just verify by dmesg -w in another terminal window reporting Apple Mobile Device (DFU mode) ), immediately CTRL-C before it starts attempting to boot into iOS. * Now, run checkra1n -cpE + This will launch PongoOS' command line only * Now run load-linux Sit back and watch the iPhone show the two Tuxs on the top, autoconfigure DHCP, mount rootfs, and start systemd and go to a login prompt! You should be able to ssh into it by checking what ip lease it was given by your dhcp server. Or, add a manual assignment by MAC address so you know exactly what it will be, as the bridge to ethernet exposes the usb-gadget's own MAC to the LAN, and it'll be visible independently from the tethered computer. ----- To be honest, I felt a lot of pride in using Linux for one of its classic purposes: repurposing otherwise-unusable devices. This iPhone would never be able to boot iOS again, as its nvme nand is completely dead. Yet, it boots Linux and mounts a filesystem over USB ethernet no problem! Go Linux! EDIT 3: Apparently they struggled to get Android to run because A10 mandates 16k page sizes, yet on mainline distros, there's no problem... Credits https://blog.project-insanity.org/2020/04/22/ linux-with-wayland-is-now-running-on-iphone-7/ * 49 comments * share * save * hide * report all 49 comments sorted by: best topnewcontroversialoldrandomq&alive (beta) [ ] Want to add to the discussion? Post a comment! Create an account [-]stpaulgym 70 points71 points72 points 14 hours ago (0 children) r/madlads * permalink * embed * save * report * give award * reply [-]imagineusingloonix 49 points50 points51 points 9 hours ago (4 children) "Hey man you know of any phones that support linux?" "oh you mean like an iphone?" * permalink * embed * save * report * give award * reply [-]Accuria 10 points11 points12 points 4 hours ago (3 children) iPhone has been able to run linux(android) for many years now, theres been previous projects which has gotten this far: https://github.com/ planetbeing/iphonelinux Writing the drivers for all the things is the really big hurdle it seems. But none the less awesome to get back to this level of unlocked state! * permalink * embed * save * parent * report * give award * reply [-]brownstain 3 points4 points5 points 1 hour ago (2 children) Android isn't Linux. ^^^^^inb4 ^^^^^"but ^^^^^it ^^^^^uses ^^^^^the ^^^^^Linux ^^^^^ kernel" * permalink * embed * save * parent * report * give award * reply [-]dudeimconfused 4 points5 points6 points 1 hour ago (0 children) ^^^^But ^^^^it ^^^^uses ^^^^the ^^^^Linux ^^^^kernel * permalink * embed * save * parent * report * give award * reply [-]Accuria 0 points1 point2 points 1 hour ago (0 children) Regardless of how you gatekeep the word linux, the project is literally named "iphonelinux"? It was worked on by some of the highest profile hackers of our time, and somehow they managed to misunderstand what linux is and is not? * permalink * embed * save * parent * report * give award * reply [-]carboronato 15 points16 points17 points 15 hours ago (0 children) Great job!!! * permalink * embed * save * report * give award * reply [-]chratoc 12 points13 points14 points 11 hours ago (1 child) Holy fucking shit!! * permalink * embed * save * report * give award * reply [-]luckytaxi -3 points-2 points-1 points 3 hours ago (0 children) it's a phone * permalink * embed * save * parent * report * give award * reply [-]AnomalyNexus 9 points10 points11 points 8 hours ago (0 children) Wow. Presumably also way more powerful than a raspberry * permalink * embed * save * report * give award * reply [-]TheRedBased 14 points15 points16 points 12 hours ago (2 children) Ok that's cool! Can it run Xorg or Wayland? * permalink * embed * save * report * give award * reply [-]khrontrans 25 points26 points27 points 12 hours ago (1 child) Yes. * permalink * embed * save * parent * report * give award * reply [-]techcentre 24 points25 points26 points 6 hours ago (0 children) Tfw iPhones have better Wayland support than Nvidia * permalink * embed * save * parent * report * give award * reply [-]linuxcommunist 10 points11 points12 points 7 hours ago (0 children) Install box86 and run crysis * permalink * embed * save * report * give award * reply [-]coder111 14 points15 points16 points 10 hours ago (11 children) I'm torn between "Holy shit, cool, that took some serious hacking to achieve" and... Why spend so much time on a platform that obviously doesn't want you there? I mean I'd rather spend time engineering improving Linux mobile platform for hardware vendors that support Linux... * permalink * embed * save * report * give award * reply [-]Gregorein 12 points13 points14 points 9 hours ago (0 children) Why? Because hacking iOS devices has been increasingly more difficult with recent Apple changes, and could be useful for when we need an ARM hackintosh ;) * permalink * embed * save * parent * report * give award * reply [-]AccurateVictory 11 points12 points13 points 9 hours ago (0 children) I thought the same at first but then I read further I find it's genius. I have laying around some old but perfectly working galaxy S4 and Note 3 but there is no support anymore. We are still unable to get upstream linux on these devices. No don't talk about LineageOS. I have two broken s5 and s6... would love to use these SoC in an iot setup. :) * permalink * embed * save * parent * report * give award * reply [-]elhopanesromtik 4 points5 points6 points 8 hours ago (3 children) for hardware vendors that support Linux... Because the hardware these vendor provide unfortunately always have a downside: they either only offer low power socs or they offer decent socs but at a higher cost, now imagine how great the experience would be linux mobile on a phone running a snapdragon 865? that's what people are chasing * permalink * embed * save * parent * report * give award * reply [-]kokoseij 6 points7 points8 points 5 hours ago (1 child) This just explains the current state of Pinephone. Open source phone sounds great, until you realize SoC vendors don't like open source. They only offer low power SoCs because high-performance SoC vendors won't release a source code, making it impossible to make the project completely open-sourced without proprietary codes. SoC with its source opened? sure there are some of them, but they're nowhere near to SoCs that mainstream phones are using, let alone flagships. It's kinda sad. but they are the ones with the technology. they get to decide what to do with it. all we can do is to hack our way through it. * permalink * embed * save * parent * report * give award * reply [-]coder111 1 point2 points3 points 3 hours ago (0 children) How many chips did Broadcom sell because Pi is open-source? I think SOC vendors SHOULD care about open-source, it definitely won't hurt their business. * permalink * embed * save * parent * report * give award * reply [-]micaiahf 1 point2 points3 points 4 hours ago (0 children) Yes but just like Rome wasn't built in a day super computers were neither... The pine phone is pretty good for what it is though Been running arch for five months * permalink * embed * save * parent * report * give award * reply [-]RobbingYouBloind 2 points3 points4 points 5 hours ago (4 children) Pollution. You might not need your old phone anymore, but somebody else might. Some people might also want to use the functional hardware with newer software. Apple doesn't care about polluting the environment and forcing people to buy a new phone because their old one isn't supported anymore (or as glossy or whatever). * permalink * embed * save * parent * report * give award * reply [-]Gender_Ender 0 points1 point2 points 2 hours ago (1 child) That's not a problem unique to Apple * permalink * embed * save * parent * report * give award * reply [-]RobbingYouBloind 1 point2 points3 points 1 hour ago (0 children) Definitely not, that's true. That still doesn't mean we can't call them out and stop buying their crap. * permalink * embed * save * parent * report * give award * reply [-]coder111 -1 points0 points1 point 3 hours ago (1 child) Apple doesn't care about polluting the environment and forcing people to buy a new phone Sorry, but that's the problem for the government. WE should not spend our time fixing Apple's problems. Apple should be mandated to care about environment (force recycling of all phones), and planned obsolescence should be outlawed as well. The problem is that US is the most powerful country on Earth right now, and its government is owned by corporations. Well, there's China, but they don't care about environment either... * permalink * embed * save * parent * report * give award * reply [-]RobbingYouBloind 0 points1 point2 points 1 hour ago (0 children) I partially agree with you. The government should be making it Apple's problem. We however vote for government, so we should be telling government to make it Apple's problem. Additionally, we do have the power to simply not buy Apple's products. Buy responsibly. * permalink * embed * save * parent * report * give award * reply [-]micaiahf 2 points3 points4 points 4 hours ago (0 children) Can I put Ubuntu on my iphone5? * permalink * embed * save * report * give award * reply [-]Kormoraan 3 points4 points5 points 9 hours ago (0 children) holy fucking shit... this here. * permalink * embed * save * report * give award * reply [-]codeforces_help 3 points4 points5 points 7 hours ago (4 children) Does that mean that I can have a server running on iphone? Will it let me open TCP ports? * permalink * embed * save * report * give award * reply [-]newhacker1746[S] 2 points3 points4 points 3 hours ago (0 children) Absolutely. While you are booted into Linux, there is nothing Apple about the software anymore. The USB ethernet gadget driver (g_ether) completely takes over the USB endpoint, so the iPhone appears as a network interface to the USB host computer. I simply bridged it to that computer's ethernet. Thus, the iPhone gets a real ip on the network and can interact with and be interacted with as a computer, because now it is one. It is simply a Ubuntu 20.04 ARM64 Ethernet machine at that point. Oh, and brcmfmac works too if you want to use that. * permalink * embed * save * parent * report * give award * reply [-]francois-siefken 0 points1 point2 points 7 hours ago (2 children) Yes and no, it means that you iOS is gone forever and in it's place is a linux distribution. You have to configure the dialer and whatever use your phone for yourself. So, why would you? Perhaps just running linux on the best possible and smallest hardware? * permalink * embed * save * parent * report * give award * reply [-]Pcdoodle 2 points3 points4 points 7 hours ago (0 children) Because, it's liberation. Operation iPhoney Freedom! * permalink * embed * save * parent * report * give award * reply [-]Artistic-Yoghurt7764 0 points1 point2 points 3 hours ago (0 children) An SoC is an SoC. I'd consider upcycling an iPhone into some kind of low grade server if I had one lying around and needed it. The lack of storage/expandability is an issue but if nothing else you can do a local caching DNS resolver * permalink * embed * save * parent * report * give award * reply [-]_ARF_ 1 point2 points3 points 7 hours ago (1 child) Sounds like a good candidate for PostmarketOS * permalink * embed * save * report * give award * reply [-]bionade24 3 points4 points5 points 5 hours ago (0 children) The PostmarketOS people already did this a while ago, it's not new. * permalink * embed * save * parent * report * give award * reply [-]musta1337x 1 point2 points3 points 5 hours ago (0 children) My old Samsung galaxy S3 Neo supports Ubuntu Mobile, Should I give it a shot? Just for science and messing with stuff * permalink * embed * save * report * give award * reply [-]bitwrangler_ 1 point2 points3 points 5 hours ago (0 children) This is a really newbie Tuesday question but when you look at systemd logs on boot and it shows a tux, or on a pi, 4 raspberries, what is that? Is it like some kernel graphical check? Why does it do that, I've always wondered. * permalink * embed * save * report * give award * reply [-]Guisseppi 1 point2 points3 points 4 hours ago (0 children) You're a freaking genius man! I salute you! * permalink * embed * save * report * give award * reply [-]Bob-The-One 1 point2 points3 points 10 hours ago (0 children) HOLY CRAP! Good job OP! * permalink * embed * save * report * give award * reply [-]developerbot-not 1 point2 points3 points 5 hours ago (0 children) r/homelab you seeing this ? * permalink * embed * save * report * give award * reply [-]Star_kid9460 0 points1 point2 points 10 hours ago (0 children) Thats great to run a Adguard Home * permalink * embed * save * report * give award * reply [-]gijoe3k 0 points1 point2 points 5 hours ago (0 children) With this method, how far off are we using/installing Mobian or UBports on the iPhone 7 and above? I'm sure there be a lot of work to be done in regards to getting everything working hardware wise but with this post it seems like a huge step foreword in right direction. * permalink * embed * save * report * give award * reply [-]first_lvr 0 points1 point2 points 5 hours ago (0 children) beyond amazing * permalink * embed * save * report * give award * reply [-]in_the_comatorium 0 points1 point2 points 5 hours ago (0 children) How does this not have more upvotes? Nice job! * permalink * embed * save * report * give award * reply [-]Memer-man-man 0 points1 point2 points 2 hours ago (0 children) would this make checkra1n possible to be able to install without a pc? * permalink * embed * save * report * give award * reply [-]d33pnull 0 points1 point2 points 1 hour ago (0 children) does it run Doom? * permalink * embed * save * report * give award * reply [+]Illustrious-Dig194 -1 points0 points1 point 10 hours ago (0 children) [Noob Question] I have a iPhone 6 12.5 with Chimera JB, must we use checkra1n? Thanks in advance! * permalink * embed * save * report * give award * reply * about * blog * about * advertising * careers * help * site rules * Reddit help center * reddiquette * mod guidelines * contact us * apps & tools * Reddit for iPhone * Reddit for Android * mobile website * <3 * reddit premium * reddit coins * redditgifts Use of this site constitutes acceptance of our User Agreement and Privacy Policy. (c) 2021 reddit inc. All rights reserved. REDDIT and the ALIEN Logo are registered trademarks of reddit inc. Advertise - technology [pixel] p Rendered by PID 3333 on r2-app-002a876396e02c07d at 2021-01-11 22:00:26.318207+00:00 running 39678f0 country code: US.