Menu

rEFInd not scanning SD cards on rMBP?

2012-10-13
2012-11-15
  • Matthew Petch

    Matthew Petch - 2012-10-13

    Hi, the new Macbooks now use the PCI bus for the SD card reader, rather than the USB that the older models used.

    So in the config file I have

    scanfor internal,external,optical,hdbios,biosexternal,cd

    which I believe scans everything, but my bootable SD card doesn't appear. I know the SD card works because when I borrow an SD card reader and plug that into one of the USB ports I can boot the linux installation on it from rEFInd.

    So, is the problem with rEFInd, my config, or the rMBP itself? I've considered trying a manual scanfor, but I don't actually know what to set the volume as... :(

     

    Last edit: Matthew Petch 2012-10-13
  • Roderick W. Smith

    In theory, the bus type shouldn't matter; rEFInd just obtains a list of devices from the firmware and scans the ones you specify.

    It's possible that the problem is caused by a late-appearing device -- that is, the device might be slow to announce itself to the EFI, so it's not available when rEFInd makes its initial scan, although it might be available a short time later. If so, pressing Esc after rEFInd appears should show you the device. If that works, please try the new "scan_delay" option; imposing a short delay may help. If Esc shows you the device but "scan_delay" has no effect, then I may need to adjust the "scan_delay" code; please contact me off-list and I'll try to get it fixed.

     
  • Matthew Petch

    Matthew Petch - 2012-11-03

    Pressing Esc does nothing. I still haven't found a way to get it to list my SD card on this model (older MBPs seem to be fine, though).

     
  • Roderick W. Smith

    Can you launch an EFI shell from rEFInd and see if you can access the SD card that way? For instance, typing "fs2:" or "fs3:" might switch to the SD card and enable you to view its contents. Typing "map -b" will produce a list of devices. Pay particular to the ones that have "fsn:" mappings, where n is a number. If the device isn't accessible to the EFI, then there's not much I can do in rEFInd. If you can find the device in the EFI shell, though, then in theory rEFInd should be giving you options from the device.

    There are still a couple of things you could try even if you can't find the device in the EFI shell. First, you could see if you can boot the device by holding down Option as you power on the computer. If that works, then there may still be hope for getting rEFInd to detect the device, although I'm not sure just how to do it. Second, you could go looking for an EFI driver for the SD card reader. If you find one, you could try dropping that driver in rEFInd's driver directory to have rEFInd load and use it. Unfortunately, I don't know of any repositories of EFI hardware drivers, so I can't give you any real help in tracking down a suitable driver. In truth, I can't promise that one exists. You could check out the hardware in OS X and Google its name and "EFI," though.

     
  • Matthew Petch

    Matthew Petch - 2012-11-08

    Thank you for the reply!

    Unfortunately, I cannot find the device in the EFI shell, nor will it show by holding Option. I'll have a look for an EFI driver now. If I find one, I'll post it back here in case you want to document it.

    Edit: I've attached a screenshot of the hardware. I tried googling around for it, but no luck.

     

    Last edit: Matthew Petch 2012-11-08
  • Roderick W. Smith

    You probably need to track down the controller for the card reader, rather than the card reader itself.

     
  • Matthew Petch

    Matthew Petch - 2012-11-09

    Apparently, it WILL show up when holding Option if the SD card has blessed EFI software on a HFS+ partition (the whole card must be GUID also, I believe). Then when selecting the SD card from the Option menu, the rEFInd menu of the SD card (with all OSes on the SD card) should show... apparently...

    I'm going to try manually install rEFInd to the SD card. But how can I bless the SD card, just run "sudo bless --setBoot --folder /sd_card/efi/refind --file /sd_card/efi/refind/refind_x64.efi"?

     
  • Matthew Petch

    Matthew Petch - 2012-11-09

    Okay, progress! I'm able to boot the rEFInd installation off the SD card from the rEFInd off my hard drive. HOWEVER to get it to appear it's really strange; I have to hold Option, and from there choose rEFInd (from my hard drive) THEN the rEFInd on the SD card will show up in the boot menu...

    If I just let the macbook boot normally into rEFInd it doesn't find the SD card (pressing Esc 10 or so seconds later also doesn't find it). Holding Option doesn't find the SD card either - it is ONLY when I use Option to boot rEFInd that the SD card is shown. Really, really weird. Would adding a scan delay fix this?

    I've attached a quick photograph of the success.

    I guess next I'll try install linux to a partition on the SD card and see if I can get that to show up somehow.

    Edit: I've installed Ubuntu to another partition on the SD card. As usual, it doesn't show up in rEFInd unless I do the odd sequence of holding Option, selecting rEFInd, then it will show up.

    For some reason it boots my windows partition (that's on my hard drive) when I select Linux (that's on the SD card) from rEFInd.

     

    Last edit: Matthew Petch 2012-11-11
  • Roderick W. Smith

    That is indeed very strange, Matthew! My guess is that holding Option tells the firmware to do some sort of extra scans for media that aren't normally done and that rEFInd doesn't currently do. I'll keep this in mind and try to track down some documentation on the subject, but this could take a while. (EFI documentation is both enormous in quantity and poorly written.)

    I do have one more suggested test for you: Launch an EFI shell, as I suggested earlier, and verify that you can't find the SD card. Then type "map -u" at the shell and try again. If this works, it will give me a starting point for things to change; and as a workaround, you could configure your system to boot by launching a shell with an "startup.nsh" startup script that does a "map -u" and then launches rEFInd. This will add a few seconds to the startup time, and it'll be an ugly display when you start (until rEFInd takes over), but it might just work.

     
  • Matthew Petch

    Matthew Petch - 2012-11-11

    Okay, even stranger stuff now!

    I reinstalled Ubuntu to the SD card (this time via bare metal, rather than through a VM - lack of CD drive is annoying!). Now, when I boot, rEFInd finds the Ubuntu installation, without any messing around! It still doesn't find the rEFInd that's installed on another partition of the SD card, though (not that I need it to)

    However, I get sent to a grub rescue window, saying the device could not be found when I try to boot ubuntu.

    Now the weird stuff begins again. If I hold Option when booting, select rEFInd (from my SSD), then start rEFInd (that's installed on the SD card) THEN choose to boot Ubuntu, it works fine. Not sure how to fix this.

    Also something worth mentioning, I actually get the Ubuntu logo in rEFInd - whereas before I just got Tux the Penguin.

     

    Last edit: Matthew Petch 2012-11-11
  • Roderick W. Smith

    This sounds more and more like some sort of incomplete hardware initialization issue. It's conceivable you could get it to work by setting certain registers via mm in an EFI shell script or using the outb command in GRUB. This is sometimes used to help initialize video hardware, as described here with reference to GRUB or here. I'm afraid those are both very incomplete descriptions, but they might serve as a starting point to figure things out.

     
  • Matthew Petch

    Matthew Petch - 2012-11-11

    Could I make a small partition on my SSD that has GRUB installed, and boot from my SD card via that? I'm not very experienced with GRUB so please excuse my ignorance :)

    Also, I'll post the exact error I get when trying to boot Ubuntu directly from rEFInd

     
  • Roderick W. Smith

    Yes, cross-device boots are fine with GRUB -- at least in theory. If GRUB can't find the device, then it won't be able to load a kernel from the device.

    I think it might be worth stepping back a bit, though. Provided the Linux kernel can activate the device, you can boot Linux by placing the Linux kernel and initial RAM disk file on your main (SSD) disk, either on the ESP or on your main OS X partition. This will work if rEFInd boots the Linux kernel via its EFI stub loader (in a 3.3.0 or later kernel) or if you boot via GRUB. The main drawback to this approach is that you'll continue to see a boot loader entry in rEFInd for Linux even when you've removed the SD card from its reader. If this isn't a big deal to you, then it's an option that's worth pursuing.

     
    • Matthew Petch

      Matthew Petch - 2012-11-14

      Currently, the Ubuntu option persists with or without the SD card. I'm not sure how it got there, but it's there... "Boot EFI\Ubuntu\grubx64.efi from EFI". This will give me an error of

      Starting grubx64.efi
      error: no such device: ba00b298-...
      grub rescue>

      However if I have my SD card in and hold Option whilst booting, then select rEFInd, it starts grub just fine and lets me select Ubuntu (from my SD card), as well as OSX and Windows from my SSD.

      Any idea how to get rid of that (the WHOLE thing, I don't want it in my EFI partition at all)? I'd rather just download and put grubx64.efi in my refind folder on my OSX drive if I need/want it.

      Overall, this is turning out to be quite a lot of work, and since I only need linux for certain classes I don't think I mind holding Option to boot it (though it is a little inconvenient). I just want to get rid of grubx64.efi from my EFI partition so it isn't there every boot now.

       
  • Jack

    Jack - 2012-11-12

    -

     

    Last edit: Jack 2012-12-02
    • Matthew Petch

      Matthew Petch - 2012-11-14

      Yeah, one of them is OSX and the other is a Recovery boot. I don't actually know where the boot.efi file for the recovery boot is, so I don't know what to add to the dont_scan_dirs field.

       

      Last edit: Matthew Petch 2012-11-14
      • Jack

        Jack - 2012-11-15

        -

         

        Last edit: Jack 2012-12-02

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.