Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[install] Issue flashing MacBook Pro (2016) internal NVMe (booting) #544

Open
loicloic opened this issue Jan 7, 2023 · 15 comments
Open
Labels
bug Something isn't working

Comments

@loicloic
Copy link

loicloic commented Jan 7, 2023

I've put the MacBook in target disk mode and used Balena Etcher to flash the image to it, it doesn't show as a boot device nor boot (Option key at boot). I also tried dd'ing to the same result.

I've successfully booted from a mass storage so I also tried using Balena Ether from within winesapOS to flash the image to the NVMe. same result.

What am I doing wrong here ?

@loicloic loicloic changed the title Issue to flash on MacBook Pro (2016) internal NVMe [install] Issue flashing MacBook Pro (2016) internal NVMe (booting) Jan 7, 2023
@LukeShortCloud
Copy link
Owner

Thanks for reporting this issue, @loicloic ! I've only tried winesapOS on internal drives on non-Mac desktops and laptops. The only Mac I have is for work so I can't wipe the internal drive. I'll do some research online and see if there are any known issues with Linux being setup like this on a Mac.

@LukeShortCloud LukeShortCloud added bug Something isn't working release_alpha Finish this issue before the next alpha release labels Jan 8, 2023
@LukeShortCloud
Copy link
Owner

@loicloic What model and year MacBook do you have?

I suspect the problem is that newer Macs with the T2 security chip require special drivers to access much of the underlying hardware (including the NVMe drive). It's a possible situation where Linux bootloader can't even access or understand what internal storage is available yet. The bootloader is essentially lost. That's my current theory, anyways.

@loicloic
Copy link
Author

loicloic commented Feb 11, 2023

@LukeShortCloud it’s not a T2 laptop. It’s a Macbook Pro 15” 2016, Model Number is A1707 hosting a T1 chip.

@LukeShortCloud
Copy link
Owner

@loicloic Thanks for confirming! My theory must be wrong then and we can at least rule out the T2 chip being a problem. The T1 chip is way less invasive and should have better native Linux support.

@loicloic
Copy link
Author

loicloic commented Feb 12, 2023

@LukeShortCloud you’re welcome. Just to reiterate a point I made above if I boot from external I can then see and flash the NVMe. I don’t know enough about the linux boot process / initramfs but this seems to be “missing” the drivers to access the NVMe because “a full kernel” can see it as mentioned.

@LukeShortCloud
Copy link
Owner

Yeah, I've been able to successfully test booting from an external USB device on a wide range of Mac hardware in the past. I'm not sure how to workaround the internal storage issues. It seems like a "chicken or the egg" kind of problem.

@LukeShortCloud LukeShortCloud modified the milestones: 3.3.0 - The Major Upgrade Update, 5.0.0 - The Apple Silicon Mar 18, 2023
@LukeShortCloud
Copy link
Owner

rEFInd may be the actual solution we need. It's a bootloader that helps to boot standard UEFI operating systems (i.e., Linux and Windows) on a Mac.

https://www.rodsbooks.com/refind/

The problem is that installing winesapOS would wipe out that bootloader if it's installed. This likely depends on us finishing having a live image installer.

#370

@loicloic
Copy link
Author

Indeed. Been using rEFInd for a while and I think you're right with the issue
being the peculiar way winesapOS installs.

Hope #370 is the way to fix this. Thanks for keeping an eye on this issue!

@LukeShortCloud
Copy link
Owner

The biggest blocker at this point is that I need to get a personal MacBook Pro to try this on. I'm happy to try to get this to work!

@LukeShortCloud
Copy link
Owner

LukeShortCloud commented Jun 11, 2023

Here are some good hints. These are the key takeaways for me:

  • Partitions on Macs should have gaps between them as Apple sometimes changes the alignment. The guide below recommends a 128 MB gap.
  • The last and large partition in macOS needs to be shrunk. The free space is used as the root and home partition (using LVM volumes, Btrfs subvolumes, etc.). Alternatively, we could make as many partitions as we want but only one is required.
  • The only other partition we need is the UEFI partition which should be the first partition. Mount that to /boot/efi and do a normal install with GRUB or systemd-boot.

https://0xadada.pub/2016/03/05/install-encrypted-arch-linux-on-apple-macbook-pro/

I still need to get my hands on an Intel Mac before I can automate all this.

@LukeShortCloud
Copy link
Owner

LukeShortCloud commented Jun 11, 2023

Here's how to have Linux boot by default instead of macOS:

When OSX loaded. Using Disk Utility to format /dev/sda3 (128MB HFS+ we have created before) with Journaled format.

Then create this file structure:

|___mach_kernel   
|___System   
    |___Library   
        |___CoreServices   
            |___SystemVersion.plist   
            |___boot.efi              (Is the file we'v copy, upload in the previous step)   

Edit SystemVersion.plist content:

<xml version="1.0" encoding="utf-8"?>
<plist version="1.0">
<dict>
    <key>ProductBuildVersion</key>
    <string></string>
    <key>ProductName</key>
    <string>Linux</string>
    <key>ProductVersion</key>
    <string>Arch Linux</string>
</dict>
</plist>

To make arch auto boot with out holding alt/option, run this command:

sudo bless --device /dev/disk0s4 --setBoot

https://github.com/kyoz/mac-arch#make-arch-duo-bootable

See also: https://github.com/pandeiro/arch-on-air

@LukeShortCloud
Copy link
Owner

I found more context about this bless command. It basically removes the need to install and use rEFIt or rEFInd.

https://bbs.archlinux.org/viewtopic.php?id=275322
https://wiki.archlinux.org/title/mac#Using_blessing

@LukeShortCloud
Copy link
Owner

I bought a cheap non-T2 Mac for testing. I hope to able to test and replicate this issue in the near future.

@LukeShortCloud
Copy link
Owner

Here is another good guide I will try out: https://linuxnewbieguide.org/how-to-install-linux-on-a-macintosh-computer/

@LukeShortCloud LukeShortCloud removed this from the 4.2.0 - The Installer Update milestone May 15, 2024
@GuestSneezeOSDev
Copy link

what type of mac and version of winesapos are you using since there could be a chance of a kernel error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants