#
✕ nick:marcan
#asahi · 2021-12-02 15:28
marcanyou *can* run the installer from macOS but it comes with one caveat: that way requires phoning home to Apple and Apple can (and probably will) cut off old macOS versions from this method at some point, for security reasons
#asahi · 2021-12-02 15:27
marcanI'm not sure if that works from recoveryOS
#asahi · 2021-12-02 15:26
marcanalso one advantage of the curl|sh method is that when Apple ships new machines we can support with just DT changes, we do that on our end and magically all distros work already, no re-building install images ;)
#asahi · 2021-12-02 15:26
marcanbut you can certainly ship our script, it just needs a bit of coordination since I want to avoid significant divergence (especially since people will want to be able to upgrade with the curl|sh method or some other download... we don't want to end up with divergent installers somehow getting confused by each other's output)
#asahi · 2021-12-02 15:25
marcanwell, the way I see it is that our curl|sh makes your Mac into something Linux capable, then you can just boot whatever installer you want from USB :-)
#asahi · 2021-12-02 15:23
marcanwe could also give users the option of "installing" the installer as a netinstall ramdisk or whatever, and then have that run on first boot and install the real distro
#asahi · 2021-12-02 15:22
marcanthough as I said I would expect most EFI-compatible installers to work out of the box, modulo kernel, as far as the general flow is concerned
#asahi · 2021-12-02 15:22
marcanyeah
#asahi · 2021-12-02 15:22
marcanfor people who want that they'd want to run a proper installetr
#asahi · 2021-12-02 15:21
marcanyup
#asahi · 2021-12-02 15:21
marcanyes, of course, it's limited
#asahi · 2021-12-02 15:20
marcan:)
#asahi · 2021-12-02 15:20
marcanI'm also going to write a spec for the prebuilt distro images as part of that, in case you're interested in shipping like that too (i.e. as an option in our installer, bypassing d-i and just dumping out a rootfs, more like the typical cloud imaging stuff)
#asahi · 2021-12-02 15:19
marcanmostly the firmware copying stuff and such
#asahi · 2021-12-02 15:18
marcanI plan on doing an Arch Linux ARM remix as a reference, which will also give an idea of what bits and pieces have to change
#asahi · 2021-12-02 15:18
marcanyeah, I'd recommend lurking for a bit as we put together something end-user-approachable for the installer :)
#asahi · 2021-12-02 15:17
marcanRetr0id: I wasn't actually thinking about that, but... that might not actually be a bad idea, bottle.py and some HTML/CSS/JS is a lot lighter weight than any UI framework we might choose
#asahi · 2021-12-02 15:16
marcanI mostly know how all that works, but haven't attempted to do it myself
#asahi · 2021-12-02 15:16
marcanright now the installer uses a hybrid approach where we copy all the "raw" files from the installation image, which Apple's magic bootability code (which runs when the user selects the volume to boot, or if we use bputil) then copies and personalizes into the actual boot directory that the first-stage bootloader will use
#asahi · 2021-12-02 15:14
marcanthat's a long way out though, and would also involve re-inventing more of Apple's process
#asahi · 2021-12-02 15:14
marcanin principle once we figure out SEP, we could access the services that make this possible, but we wouldn't be able to provision a new m1n1 because that only works from recovery mode; however, I don't know if we'd be able to update the boot policy with a new NSIH (the hash of the apple boot stuff) while preserving the existing m1n1
#asahi · 2021-12-02 15:13
marcanI'm not sure, actually; it's uncharted territory.
#asahi · 2021-12-02 15:11
marcanI should also do an offline install test (truly offline, i.e. no phoning home by Apple's stuff); I think that won't work right now but I know how to make it work
#asahi · 2021-12-02 15:09
marcanand that will finally install m1n1 as the "macOS" kernel
#asahi · 2021-12-02 15:08
marcanso right now the installer does its thing, then drops a .sh file and tells users to boot holding down power, go to options, pull up the terminal, then run it and follow the last few prompts
#asahi · 2021-12-02 15:08
marcanthis is relatively cumbersome in part because Apple's secureboot requires users to assert physical presence (via long pressing power) before they can install a third-party bootloader, and *that* action, since 12.x, has to happen in a paired recoveryOS for the OS you're trying to mess with, which means it has to happen *after* you've already installed the boot components
#asahi · 2021-12-02 15:07
marcan(I still haven't figured out how to do upgrades, fwiw; I think that would involve another couple reboots and re-provisioning our bootloader, but I need to run some tests)
#asahi · 2021-12-02 15:04
marcan(as long as system firmware is equal or newer)
#asahi · 2021-12-02 15:04
marcanthis does *not* limit what macOS versions the user can have installed, it's just what "macOS" our partition is based on
#asahi · 2021-12-02 15:04
marcanso we only need to upgrade when there are important bugs fixed or new machine support
#asahi · 2021-12-02 15:04
marcanwouter: this is their design, I don't see them changing it. however, as long as we can pick a macOS version to pin to, we don't have to support all possible ABIs
#asahi · 2021-12-02 15:03
marcanmatthewayers[m]: those are kernel functions, we can't run kernel code
#asahi · 2021-12-02 15:01
marcanyou could literally just... do that instead of running step2.sh as it tells you, and end up with a functional macOS install (ish, there's the signed system volume thing to deal with, but you get the idea)
#asahi · 2021-12-02 15:01
marcanit just doesn't do the "copy out the rootfs bit"
#asahi · 2021-12-02 15:01
marcaneffectively the Asahi Linux installer is... a macOS installer, for all practical purposes
#asahi · 2021-12-02 15:01
marcanwhere we then replace the XNU kernel with our bootloader that bridges into U-Boot and EFI services
#asahi · 2021-12-02 15:00
marcangetting the firmware bits that Linux itself needs is easy, you can re-do that if you really want to using some other script; the hairy bit is setting up what is essentially a macOS install minus the root filesystem
#asahi · 2021-12-02 14:59
marcanso part of this whole dance is picking macOS versions to bless as "Linux is compatible with these ABIs"
#asahi · 2021-12-02 14:59
marcanand because they don't keep firmware ABIs stable, all that comes as one bundle including signed firmwares loaded by the prior components that expose an unstable ABI to the OS
#asahi · 2021-12-02 14:59
marcanthat means that any third-party OS needs to first install the signed boot components from Apple, *then* install itself as the next stage, all within its own OS container
#asahi · 2021-12-02 14:58
marcanthe way this works is that the OS demarcation point is *not* the unsigned code demarcation point
#asahi · 2021-12-02 14:58
marcanit's not just that
#asahi · 2021-12-02 14:57
marcanwe ship python with the installer
#asahi · 2021-12-02 14:56
marcanthis runs under macos
#asahi · 2021-12-02 14:56
marcanyeah, you can ship the installer and I'm also happy to make it more modular than it already is (it's python fwiw) in case people want to wrap it in their own UI or whatever
#asahi · 2021-12-02 14:55
marcanof course
#asahi · 2021-12-02 14:55
marcanso that part is either online or tell people to download it on another machine and copy it to the install media, or similar
#asahi · 2021-12-02 14:55
marcanyou can't ship Apple's IPSWs, they are not redistributable
#asahi · 2021-12-02 14:53
marcan(and it means you need to figure out *what* ipsw they need ahead of time using documentation instead of having the installer magically work it out)
#asahi · 2021-12-02 14:53
marcanfwiw the current installer does not have an offline option, but it's trivial to implement with the caveat that you need to tell people to download the entire ipsw from Apple, and that means 14+GB instead of the ~1GB of partial contents the installer will normally download

plus ›