• debian-installer for mac

    From westlake@21:1/5 to All on Sat Oct 23 01:50:01 2021
    hello d-i team members, i noticed there is probably an area for
    improvement regarding getting bullseye to boot correctly on a mac.
    (mac-mini 2012 in my case --- which has intel x86)

    I discovered where the problem was for my particular case and the fix
    was relatively simple.

    Basically all I did was take one of the official bullseye installer
    iso's and gave it a GPT-header.

    The problem with working with a DOS-mbr iso (and placing it on a usb
    stick with "cat [bullseye].iso > /dev/[usb]), is that the Apple UEFI
    firmware is not seen fully with any debian boot-loader from install.

    *** I also want to avoid using any gptsync or "hybrid" DOSMBR+GPT ***

    I tested two methods so that the bullseye installer can boot from a
    usb-stick.
    (((
    Problem::
    - The problem is none of the debian iso installers can boot into
    UEFI-mode on this mac. (mac-mini 2012 -- intel)

    Solution::
    - Provide some tool/mechanism so that an iso image can be placed onto
    a GPT-tabled usb device -- and the mac is then able to boot correctly in UEFI-mode.

    (no dangerous hybrid DOSMBR+GPT tasks are needed and this is a big plus)
    )))

    The two methods I used to test having the bullseye installer boot
    successfully in UEFI-mode::

    Method 1)
    Use Rufus on windows.

    This was simple enough. Tell Rufus to use the iso, but then select "GPT"
    as the partition type. By default it will use a FAT32 partition with it.

    This works, and any normal user can do this. (but it isn't largely
    documented -- and I suppose there may be another simple front-end that
    can also do this -- but Windows is not my general workstation system so
    I wouldn't know of any other)

    Method 2)
    Extract EFI files from the iso image, and "dump" (with dd or cat
    command), the "partition" containing the ISO9660 filesystem.

    ^ this was done using a number of commands with losetup, and other
    command partitioning tools. Could be done completely without any other
    tool than gdisk, cfdisk, sfdisk, losetup, cp and "dd" (or cat), mount,
    and mkfs.vfat.

    The work is more tedious and difficult but it is merely creating a
    partition large enough to contain the original iso9660 filesystem.

    I have used "gdisk /dev/[usb]", "x", followed by "z" to zap any MBR and
    GPT partition tables (since there can be a lingering "backup" GPT table
    at the end of the disk)..

    I then proceeded to create one EFI partition of 3 megabytes, and one
    partition of 480 megabytes.

    I used mkfs.vfat for the efi partition, and marked the 480MB partition
    with the partition GUID of "4f68bce3-e8cd-4db1-96e7-fbcaf984b709". This
    GUID is more for aesthetics, and I suppose one might as well use "8483-4772-8e79-3d69d8477de4" as a choice for the GUID type as it is
    described as "Other Data Partitions"..

    note: I did not use the mac iso, but another from bullseye installer iso
    that contained an EFI section as the mac iso doesn't have this.

    ..
    The install went flawless with the newly created GPT-enabled usb
    bootdisk -- efibootmgr shows debian got set as the first os..

    Since the fix was relatively simple, I thought it might be a good idea
    to feedback on this because there's a few people I think who have to
    manage the more dangerous task of keeping up to date the hybrid DOSMBR+GPT.

    Booting the debian installer in UEFI-mode is relatively simple, just
    need to have a GPT header on the usb stick, and that was pretty much it.

    hope this helps for anyone wanting to avoid having to deal with the
    dangerous hybrid dosmbr+gpt setup as much documentation suggests, but
    this can be easily avoided with something like rufus, or if the d -i
    team cares much about fixing this relatively simple issue for many other
    users trying debian on their mactels.

    please support gpt headers for usb install devices, as you can see it is
    not at all that difficult.

    thanks

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Pascal Hambourg@21:1/5 to All on Sun Oct 24 12:40:02 2021
    Hello,

    Le 23/10/2021 à 01:34, westlake a écrit :
    hello d-i team members, i noticed there is probably an area for
    improvement regarding getting bullseye to boot correctly on a mac.
    (mac-mini 2012 in my case --- which has intel x86)

    I discovered where the problem was for my particular case and the fix
    was relatively simple.

    Basically all I did was take one of the official bullseye installer
    iso's and gave it a GPT-header.

    Which ISO image ? AFAICS,

    debian-11.1.0-amd64-DVD-1.iso
    debian-11.1.0-amd64-i386-netinst.iso
    debian-11.1.0-amd64-netinst.iso
    debian-11.1.0-i386-DVD-1.iso
    debian-11.1.0-i386-netinst.iso

    already have a GPT header and an EFI system partition. Only

    debian-mac-11.1.0-amd64-netinst.iso
    debian-mac-11.1.0-i386-netinst.iso

    do not have either.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Andrew M.A. Cater@21:1/5 to Pascal Hambourg on Sun Oct 24 13:30:02 2021
    On Sun, Oct 24, 2021 at 12:36:06PM +0200, Pascal Hambourg wrote:
    Hello,

    Le 23/10/2021 à 01:34, westlake a écrit :
    hello d-i team members, i noticed there is probably an area for
    improvement regarding getting bullseye to boot correctly on a mac. (mac-mini 2012 in my case --- which has intel x86)

    I discovered where the problem was for my particular case and the fix
    was relatively simple.

    Basically all I did was take one of the official bullseye installer
    iso's and gave it a GPT-header.

    Which ISO image ? AFAICS,

    debian-11.1.0-amd64-DVD-1.iso
    debian-11.1.0-amd64-i386-netinst.iso
    debian-11.1.0-amd64-netinst.iso
    debian-11.1.0-i386-DVD-1.iso
    debian-11.1.0-i386-netinst.iso

    already have a GPT header and an EFI system partition. Only

    debian-mac-11.1.0-amd64-netinst.iso
    debian-mac-11.1.0-i386-netinst.iso

    do not have either.


    As mentioned on debian-user: the debian-11.1.0-amd64-netinst.iso or the debian-11.1.0-amd-DVD-1.iso are the appropriate ones to use.

    The debian-mac images are for a couple of specific models from 2008/2009
    which had problems recognising El Torito images.

    Hope this helps,

    Andy Cater

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Nicholas D Steeves@21:1/5 to Andrew M.A. Cater on Sun Oct 24 20:30:02 2021
    "Andrew M.A. Cater" <amacater@einval.com> writes:

    As mentioned on debian-user: the debian-11.1.0-amd64-netinst.iso or the debian-11.1.0-amd-DVD-1.iso are the appropriate ones to use.

    The debian-mac images are for a couple of specific models from 2008/2009 which had problems recognising El Torito images.


    Oh yeah! I remember having to ask about this for a 2014 installation I
    did on a 2012 MBP. Has it not been documented yet?

    Seems like the website and installation guide could benefit from bug
    reports requesting documentation of this fact. I believe it's worth the effort, because recent macOS versions don't work well with older Apple hardware.

    Regards,
    Nicholas

    -----BEGIN PGP SIGNATURE-----

    iQJEBAEBCgAuFiEE4qYmHjkArtfNxmcIWogwR199EGEFAmF1o9gQHHN0ZW5AZGVi aWFuLm9yZwAKCRBaiDBHX30QYSc+D/wNfvHzrsiDsusbHIQZb6+6+1ZhO4XHwJbt yB30FTBCWoZpb+lnjnoPsiGUPtWGY9wN+GHF+jaBVrJ5zJJEBHE+MiFnTNTg76eY YEsQsHz3Orz0DzCq+pcFOeSizxd7EAO1CKaxU8scfD615QhNj8LDdlntAGGpTyVF j3ldZ6tz+Vz3+XW2WkbF69Z99wg9tN71t65pn3+JD8bJTxZODSoi7odarXtFHxOa K0ovRzmwydLIWBFaL8FQ7EhAusQJYcKqXz+RM4d4x2ZsUJHn+ipYysJrzzmF3Qfk 3mx3bDe2x5FJo8CMiV2BVa54bVn9PUAcP1wIlLo6MMeFuyrBx0/c3SWFQHpYPb1P bR1kwZPDYuAfJUwxHXfujz8KtDsrKZluSb0FeD1+duU/Pf8MaDxQIzqB1ev7ODpQ ialic9jsvWHDGIfMmJkpAq1olLobq+psKydPZjzIvGunrQkMY5zM/Xlzy4Hbe45n zlAF1VCc4MM05q9YX2GpwbKvS6xYrWptWjAUFEIDI0h4Njo+tM1yAkE4uotl+jwz tbwvX96OSJuRtcodfFOa7jg1e8SZmjTjsFD8Lv3vAVm6QKl5N/TLoIUie+cfMYKw 12IMTBub4i3JDe7QDvfy8LIJnP/T2x07hzeNCdgMPQ51iBSQ5UAd+yLWXz+Ba2BR
    eRYxH6R+Yg==
    =wuMW
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Andrew M.A. Cater@21:1/5 to Nicholas D Steeves on Sun Oct 24 21:40:02 2021
    On Sun, Oct 24, 2021 at 02:20:08PM -0400, Nicholas D Steeves wrote:
    "Andrew M.A. Cater" <amacater@einval.com> writes:

    As mentioned on debian-user: the debian-11.1.0-amd64-netinst.iso or the debian-11.1.0-amd-DVD-1.iso are the appropriate ones to use.

    The debian-mac images are for a couple of specific models from 2008/2009 which had problems recognising El Torito images.


    Oh yeah! I remember having to ask about this for a 2014 installation I
    did on a 2012 MBP. Has it not been documented yet?

    Seems like the website and installation guide could benefit from bug
    reports requesting documentation of this fact. I believe it's worth the effort, because recent macOS versions don't work well with older Apple hardware.


    https://cdimage.debian.org/debian-cd/current/amd64/iso-cd/ references
    "What is a mac netinst image" and points back to Debian Wiki.

    Issues referenced here: https://wiki.debian.org/MacMiniIntel#Macmini_2.2C1

    It is fairly well referenced: it just takes you to read from the top of
    the page on the downloads page.

    https://wiki.debian.org/InstallingDebianOn/Apple is also quite a good location to work out what's what. [And I note the problematic machines are 2007/2008
    so anyone who has one will be running on 13 year old hardware - we had a similar discussion at https://lists.debian.org/debian-cd/2021/04/msg00008.html

    Most of this will be up in the air with Mac machines based on the M1 chip though given Apple demonstrated Debian as their first demo when the chips
    were announced, the arm64 variant can certainly run as a virtual machine.

    Hope this helps,

    All the very best, as ever,

    Andy Cater

    Regards,
    Nicholas

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From westlake@21:1/5 to Nicholas D Steeves on Sat Nov 6 08:40:01 2021
    the original post I made speculates there could be improvement for
    booting UEFI on certain models given that for a MacMini 2012 model there
    is no way debian will boot in "UEFI" mode.

    There is probably a "glitch" or strict-policy set in this MacMini's UEFI firmware preventing debian seeing the UEFI variables.

    ^ This all changes just by using RUFUS OR "dd"(dumping) the ISO
    filesystem from one of the debian isos...

    There's a hybridness feature of these ISOs, but for some reason creating
    a GPT-header iso image allows the debian installer to perform a proper installation of

    ------> """grub-efi""" <-----
    and not grub-pc(bios) ...

    If I do not specificially set just a GPT-header for the iso(and place it
    on a usb-boot stick), the MacMini 2012 will not boot, as debian will try
    to install grub-pc(bios), and it will complain about not being able to
    install grub, reboot the machine in stuck loops, and so on.

    The nice thing here, is I am not using "gptsync" or any crazy MBR+GPT
    hybrid nonsense for the internal SSD disk of this MacMini.

    Once debian finishes installing(UEFI-mode), it can boot straight on its own.

    "efibootmgr" shows debian right at the top, and it has bumped the macos
    down one.

    The intructions for any Mac or Windows user is very simple of a task to
    have the debian-installer boot successfully: (that is in UEFI-mode)

    1) Download rufus on Mac or Windows, and then use the program to choose GPT-header for the USB stick, and that's pretty much it.

    2) Boot and expect your Mac UEFI to be happy it can see a GPT-header
    from the usb stick...

    The nice thing here, is that mac users do not have to do any special
    "gptsync" task or dangerous hybrid MBR+GPT syncs for their internal
    drives, which can render data loss if not done correctly... this problem
    goes away entirely..

    I believe Apple's UEFI firmware breaks the specs it is supposed to allow
    -- even though it's an MBR-header on the iso, iirc the UEFI firmware is supposed to still to grant installers in accessing UEFI variables..
    maybe Apple is breaking exactly this.

    -- and as many know it's not possible to disable CSM/BIOS on a mactel..

    .. though there is also problems I think similarly on PCs... to mitigate
    the UEFI-detection problem there is the option to disable CSM/BIOS and
    have "strict UEFI-only".

    so force the Mac to see the GPT-header only, and that works very well
    afaict.

    fwiw, I also tested making the USB-boot stick with just Linux without
    the need for rufus.

    .. as long as there is a GPT-header, the debian-installer boots as
    expected in UEFI-mode always, and never in BIOS-mode, as it's
    installer-boot menu shows. "BIOS" or "UEFI" in parenthesis.

    Here are the few ways I tested making the debian-instaler:

    1) GPT-header made with Rufus on Windows
    2) Using loopbacks against the iso image, and creating a full GPT-header
    USB, then cloning the iso-loopback directly onto the USB stick. <<<
    this means that I have tested the USB-stick with the
    "GPT-Backup-reserved table" at the end of the disk
    3) creating a brand new ISO image with a GPT-header only, and then
    dumping that ISO onto a usb.

    ^ last one 3) wouldn't have a GPT-backup-header on the usb media itself
    (though the iso-image I made would have it far away somewhere in the
    middle of the disk)..

    I wanted to make sure 2) can boot as well as 3), so I took the extra
    time to use "gdisk" to wipe out any end-of-disk GPT reserve tables, MBR
    tables, etc...

    and so far the tests have always been very quick to verify.

    A Mac Mini 2012 always boots into UEFI-mode with the debian-installer as
    long as there is a GPT-header... never when it sees a DOSMBR header..

    gdisk was used to remove any GPT-backup reserve table on each test... so
    I can distinguish whether having or lacking the GPT-backup table made a difference.

    ^ It doesn't... so this is important, because essentially I can just
    dump the ISO (that containst the GPT-header), and not worry about there
    not being a backup-GPT table for this MacMini to process without any
    further issues.

    So after-all 2) works just as well as 3)..

    And so by that, this means, no special tool would be required to have
    this placed on a USB directly ...

    ... for those stubborn Macs like this one(Mac Mini 2012), it is always
    looking for a GPT-header exclusively for it to grant UEFI-mode for the installer, otherwise debian will require extra foot-work around with
    things like "Refind", and having to deal with an "MBR" table.

    ^ By having the debian-installer boot into UEFI-mode, dual-booting this
    with a macos was extremely easy:::

    In fact here is my current setup::

    - Two disks: One disk has 50% of it occupied by Catalina MacOS..

    - The same two disks, I have Debian 11.1 md-raid1 spread across both of
    these disks.

    If I want to boot MacOS, I just hold the option key and select Macos.

    If I want to boot into Debian, I just hit the power-button and it boots directly into Debian.

    No refind or extra magic is required.

    I don't know if there are other macs that have this problem -- but it
    really does get rid of the complexiity of having to deal with extra
    tools like Refind or maybe even go as far as using the ancient "gptsync".

    Dual-booting a Mac is very easy, only if you can boot the
    debian-installer in UEFI-mode..

    It actually turned out much better than I expected.

    I recall trying a debian-install on this years ago (I barely used this
    mac-mini ;-) -- and had to work around refind, gptsync, it was an
    absolute nightmare.

    How common is it to have Debian install with "grub-pc" rather than
    "grub-efi" when it comes to Mactels?

    I'm kind of interested. .. otherwise this information is definitely
    worth sharing.

    It is pretty much two mouse clicks with Rufus, and that sovles the
    problem of having Debian boot into UEFI mode on Mactels.

    It's that simple.

    thanks for everyone answering, it was great feedback.






    On 2021-10-24 2:20 p.m., Nicholas D Steeves wrote:
    "Andrew M.A. Cater" <amacater@einval.com> writes:

    As mentioned on debian-user: the debian-11.1.0-amd64-netinst.iso or the
    debian-11.1.0-amd-DVD-1.iso are the appropriate ones to use.

    The debian-mac images are for a couple of specific models from 2008/2009
    which had problems recognising El Torito images.


    Oh yeah! I remember having to ask about this for a 2014 installation I
    did on a 2012 MBP. Has it not been documented yet?

    Seems like the website and installation guide could benefit from bug
    reports requesting documentation of this fact. I believe it's worth the effort, because recent macOS versions don't work well with older Apple hardware.

    Regards,
    Nicholas


    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From westlake@21:1/5 to Nicholas D Steeves on Sat Nov 6 09:20:02 2021
    both official (and checked out the non-official :D) would boot in
    UEFI-mode when I set an exclusive GPT-header for their images.

    I wasn't very informed that the debian-mac*iso is made more for specific
    mac models that came out in 2008-2009. I didn't use any of the
    debian-mac iso images to re-surface the GPT-header, because those images
    do not have a partition I can try to extract an EFI app...

    someone wrote to me on another debian ml, that Ubuntu is started making
    their ISO images with GPT headers. I can confirm this with basically
    fdisk -l ./ubuntu-image.iso... and it says GPT... I believe it was 20.04
    or 20.10, -- the first one I am noticing as well -- all their other
    iso's are MBR...

    Perhaps it's time for debian to start looking at the same.. because
    there are times when the same problem occurs on PCs, that the "grub-pc"
    is getting attempted for install CSM/BIOS boot-ups, and the
    debian-installer sometimes gets confused for particular hardware...

    ^ having a GPT-header for the installer, might force UEFI detection
    better for debian's support on other UEFI-makes beyond just the mactels
    imho -- and from experience I have had to disable CSM/BIOS completely
    after noticing that Debian is requesting to install the wrong grub
    version for UEFI.

    [ debian-installer wants to install on GPT, but then later installs
    grub-pc instead of grub-efi -- this problem also has been happening
    similarly with other distributions as well -- so there must be some
    cause for this ]

    ^ this happens on both Mactels and PCs... abd also regardless of how
    broken Apple UEFI hardware can really be.

    so maybe there is a better deal for GPT-header disks as installers to
    work more correctly..

    just a food for thought

    thanks


    On 2021-10-24 2:20 p.m., Nicholas D Steeves wrote:
    "Andrew M.A. Cater" <amacater@einval.com> writes:

    As mentioned on debian-user: the debian-11.1.0-amd64-netinst.iso or the
    debian-11.1.0-amd-DVD-1.iso are the appropriate ones to use.

    The debian-mac images are for a couple of specific models from 2008/2009
    which had problems recognising El Torito images.


    Oh yeah! I remember having to ask about this for a 2014 installation I
    did on a 2012 MBP. Has it not been documented yet?

    Seems like the website and installation guide could benefit from bug
    reports requesting documentation of this fact. I believe it's worth the effort, because recent macOS versions don't work well with older Apple hardware.

    Regards,
    Nicholas


    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)