You are not logged in.

#1 2012-06-26 20:48:32

0x530302
Member
Registered: 2012-06-26
Posts: 14

problems booting archlinux on a MacBook Air Mid 2012

Hi!

I've installed archlinux on my new MacBook Air (Mid 2012) using Archboot and everything looked fine.
After the installation i wanted to boot archlinux (using grub2-efi) and it ended in a black screen.

If i add noefi as a kernel parameter arch linux boots normal, but the keyboard and probably other stuff does not work.
If i manually boot through the grub2 command line, the screen freezes after entering the boot command.

With the Mid 2011 MacBook Air the installation with archboot succeeds without problems.

Has anybody an idea how to fix my problems?

Offline

#2 2012-06-26 21:02:02

litemotiv
Forum Fellow
Registered: 2008-08-01
Posts: 5,026

Re: problems booting archlinux on a MacBook Air Mid 2012

I'm typing this on a mid-2012 Air too, i haven't used grub2-efi with it but originally installed with syslinux (bios) which worked okay. Now i'm using rEFInd with efi_stub as described here:

https://wiki.archlinux.org/index.php/UE … ing_rEFInd

to EFI-boot directly to linux without a bootloader.


ᶘ ᵒᴥᵒᶅ

Offline

#3 2012-06-26 21:03:14

Trilby
Forum Moderator
From: Massachusetts, USA
Registered: 2011-11-29
Posts: 13,812
Website

Re: problems booting archlinux on a MacBook Air Mid 2012

Mid 2012?  So it's brand new?

Unfortunately I can't contribute to a solution, but there have been other threads worth checking out about macbook airs.  The consensus seems to be that linux will run on them, but not until a while after they've been "out in the wild" so the driver hackers can catch up to the hardware changes.


InterrobangSlider
• How's my coding? See this page.
• How's my moderating? Feel free to email any concerns, complaints, or objections.

Offline

#4 2012-06-26 21:08:36

0x530302
Member
Registered: 2012-06-26
Posts: 14

Re: problems booting archlinux on a MacBook Air Mid 2012

litemotiv wrote:

I'm typing this on a mid-2012 Air too, i haven't used grub2-efi with it but originally installed with syslinux (bios) which worked okay. Now i'm using rEFInd with efi_stub as described here:

https://wiki.archlinux.org/index.php/UE … ing_rEFInd

to EFI-boot directly to linux without a bootloader.

thx i'll try it and tell later if it worked

Offline

#5 2012-06-26 21:39:23

Janhouse
Member
Registered: 2010-10-02
Posts: 28

Re: problems booting archlinux on a MacBook Air Mid 2012

I installed Arch using latest archboot iso (dd'ed to USB flash).
No problems with installing bootloader (grub2 with efi works perfectly).

I had to add noapic to kernel line when booting archboot or it would show a kernel panic. If you don't add it to the grub2 config after the install is done, booting in the Arch won't work and all you get is a black screen. So just add noapic and it should boot just fine.

There are some warnings or errors displayed during the boot (something about the wifi card and maybe something else) but it doesn't matter much for now.

Almost everything works with Kernel 3.4.4 out of the box.

I used wpa_supplicant, so didn't need any USB ethernet adapters to install X and other things.



The thing that doesn't work is applesmc module for controlling fan speed/keyboard backlight.

I tried to modprobe applesmc but got:
ERROR: could not insert 'applesmc': Input/output error

And dmesg is full of:
[ 1579.746760] applesmc: : read arg fail
[ 1579.833217] applesmc: : read arg fail
[ 1579.920595] applesmc: LCSA: read arg fail
[ 1580.006595] applesmc: : read arg faili
[ 1580.093070] applesmc: : read arg fail
[ 1580.180382] applesmc: LCSA: read arg fail
[ 1580.232584] applesmc: driver init failed (ret=-5)!

Any ideas how to get it working?

Offline

#6 2012-06-26 21:49:34

nTia89
Banned
From: varese, italy
Registered: 2008-12-22
Posts: 1,230

Re: problems booting archlinux on a MacBook Air Mid 2012

i've not experience strictly about your problem, but...

i think the problem is the lack of the module/kernel to support the controller, the new controller because is very new hardware.....


+pc: custom | AMD Opteron 175 | nForce4 Ultra | 2GB ram DDR400 | nVidia 9800GT 1GB | ArchLinux x86_64 w/ openbox
+laptop: Apple | MacBook (2,1) | 2GB ram | Mac OS X 10.4 -> DIED
+ultrabook: Dell | XPS 13 (9343) | 8GB ram | 256GB ssd | FullHD display | Windows 8.1 64bit ArchLinux x86_64 w/ Gnome

Offline

#7 2012-06-26 21:57:21

Janhouse
Member
Registered: 2010-10-02
Posts: 28

Re: problems booting archlinux on a MacBook Air Mid 2012

Even tho it is almost the same as the previous MBA, you are probably right.

Has anyone else tried setting up Arch on the new MBA?

Offline

#8 2012-06-27 08:25:22

0x530302
Member
Registered: 2012-06-26
Posts: 14

Re: problems booting archlinux on a MacBook Air Mid 2012

I've tried the whole night through various things and came to the result that it's not a problem of the bootloader (as i already thought), but of the kernel.
It's not possible to load the kernel without the noefi paramter, neither with grub2 nor with rEFInd nor with pure efi_stub.

With the noefi parameter to kernel boots fine, but it does not recognize the built in usb devices (e.g. the keyboard). If i plug in another usb keyboard it works fine.

Another problem is that reboot and shutdown don't work, but this can be fixed with the kernel parameter reboot=acpi http://en.gentoo-wiki.com/wiki/Apple_Ma … boot_hangs

The last problem that i've noted is that i'm not able to set up wifi. Using the livecd it works out of the box, but using the booted arch, there is no interface but the loopback interface. I think this problem is also related to the noefi boot.

litemotiv wrote:

I'm typing this on a mid-2012 Air too, i haven't used grub2-efi with it but originally installed with syslinux (bios) which worked okay. Now i'm using rEFInd with efi_stub as described here:

https://wiki.archlinux.org/index.php/UE … ing_rEFInd

to EFI-boot directly to linux without a bootloader.

do you use any kernel parameters or worked it out of the box?

Offline

#9 2012-06-27 08:26:30

litemotiv
Forum Fellow
Registered: 2008-08-01
Posts: 5,026

Re: problems booting archlinux on a MacBook Air Mid 2012

litemotiv wrote:

I'm typing this on a mid-2012 Air

Trilby wrote:

Mid 2012?  So it's brand new?

Uh oh.. I posted that one a bit too late at night, i don't have a brand new Air... Sorry @TS, i must've miscounted by a year or something.. hmm


ᶘ ᵒᴥᵒᶅ

Offline

#10 2012-06-27 08:38:38

0x530302
Member
Registered: 2012-06-26
Posts: 14

Re: problems booting archlinux on a MacBook Air Mid 2012

litemotiv wrote:
litemotiv wrote:

I'm typing this on a mid-2012 Air

Trilby wrote:

Mid 2012?  So it's brand new?

Uh oh.. I posted that one a bit too late at night, i don't have a brand new Air... Sorry @TS, i must've miscounted by a year or something.. hmm

Ah okay smile a friend of mine has a mid 2011 using grub2 to boot and it works fine, so i think it's related to the 2012 macbook air.
nevertheless thx a lot!

Maybe EFI boot with this macbook is (at this time) impossible, because of the following (from https://help.ubuntu.com/community/UEFIB … ot_options)

In 2.6.27-2.6.28, amd64 kernel, there is a bug that would cause EFI to hang. Since 2.6.27, it would only map available RAM, and the EFI runtime needs to be mapped with efi_ioremap. However, efi_ioremap only reserves MAX_EFI_IO_PAGES (100) pages for EFI, which is not enough for Apple 64-bit firmware (about 17M). To workaround this, you need to pass the "noefi" option which tells the kernel to disable EFI. However, some models do not need this workaround (eg MacBookPro5,3).

But if there are any other ideas i would be very pleased!

Offline

#11 2012-06-27 09:25:53

the.ridikulus.rat
Member
From: Indiana, USA
Registered: 2011-10-04
Posts: 765

Re: problems booting archlinux on a MacBook Air Mid 2012

@0x530302: If you think the problem is in the kernel, then try latest -rc kernel linux-mainline https://aur.archlinux.org/packages.php?ID=50893 and check whether that boots properly. Chances are macbook air support migth be fixed in the -rc kernels. If linux-mainline gives the same issues, then file a ticket in kernel bugzilla (but first try linux-mainline).

Offline

#12 2012-06-28 00:21:54

0x530302
Member
Registered: 2012-06-26
Posts: 14

Re: problems booting archlinux on a MacBook Air Mid 2012

the.ridikulus.rat wrote:

@0x530302: If you think the problem is in the kernel, then try latest -rc kernel linux-mainline https://aur.archlinux.org/packages.php?ID=50893 and check whether that boots properly. Chances are macbook air support migth be fixed in the -rc kernels. If linux-mainline gives the same issues, then file a ticket in kernel bugzilla (but first try linux-mainline).

Using the mainline kernel does not make any changes, but i found a dirty workaround (at least until booting with efi is possible).
I just needed a usb thumb drive (assume that it is /dev/sdb)
1. Format usb thumb drive
create one big partition in fdisk and create an ext2 filesystem on it:

# fdisk /dev/sdb
# mkfs.ext2 /dev/sdb1

2. Install Grub Legacy to thumb drive
Make sure that the grub package is installed.

# mount /dev/sdb1 /mnt
# mkdir -p /mnt/boot/grub
# cp /usr/lib/grub/i386-pc/* /mnt/boot/grub/
# echo '(hd0)     /dev/sdb' > /media/usb/boot/grub/device.map
# grub-install --root-directory=/mnt/ /dev/sdb

3. Copy Kernel and Initramfs to the thumb drive

# cp /boot/vmlinuz-linux /boot/initramfs-linux.img /mnt/

4. Create grub's menu.lst

create /mnt/boot/grub/menu.lst with the following content:

default   0

# (0) Arch Linux
title  Arch Linux
root   (hd0,0)
kernel /vmlinuz-linux root=<<change to your root partition (e.g /dev/sda5)>> ro
initrd /initramfs-linux.img

5. unmount and reboot

# umount /mnt
# reboot

Press alt/option key while booting until the apple boot menu appears. The Apple Bootloader should recognize the usb pendrive as an USB Icon Labeled with Windows. Booting from this will load the Grub Legacy from the thumb drive. Booting the Arch Linux entry in Grub loads the kernel and the initramfs from the pendrive and loads your system from the harddrive. You can safely remove the stick after the initramfs was loaded.

That is neither a good nor an elegant way, but it is the only one worked so far.

Last edited by 0x530302 (2012-06-29 02:07:59)

Offline

#13 2012-06-28 05:22:56

litemotiv
Forum Fellow
Registered: 2008-08-01
Posts: 5,026

Re: problems booting archlinux on a MacBook Air Mid 2012

0x530302, would just installing grub-bios instead of grub-efi to your harddrive give the same effect? If the problem lies in efi-boot then any form of bios-boot will probably work okay, without needing a usb stick.


ᶘ ᵒᴥᵒᶅ

Offline

#14 2012-06-28 13:41:09

0x530302
Member
Registered: 2012-06-26
Posts: 14

Re: problems booting archlinux on a MacBook Air Mid 2012

Janhouse wrote:

I had to add noapic to kernel line when booting archboot or it would show a kernel panic. If you don't add it to the grub2 config after the install is done, booting in the Arch won't work and all you get is a black screen. So just add noapic and it should boot just fine.

I also have the Macbook Air 5,2, but if i add noapic to the kernel line, the screen also becomes black after Waiting for UDev events to be processed.
Have you done something else to get arch booting?

Offline

#15 2012-06-28 19:26:21

Inxsible
Forum Fellow
From: Chicago
Registered: 2008-06-09
Posts: 9,071

Re: problems booting archlinux on a MacBook Air Mid 2012

merged ...


Forum Rules

There's no such thing as a stupid question, but there sure are a lot of inquisitive idiots !

Offline

#16 2012-06-28 19:44:59

Janhouse
Member
Registered: 2010-10-02
Posts: 28

Re: problems booting archlinux on a MacBook Air Mid 2012

0x530302 wrote:
Janhouse wrote:

I had to add noapic to kernel line when booting archboot or it would show a kernel panic. If you don't add it to the grub2 config after the install is done, booting in the Arch won't work and all you get is a black screen. So just add noapic and it should boot just fine.

I also have the Macbook Air 5,2, but if i add noapic to the kernel line, the screen also becomes black after Waiting for UDev events to be processed.
Have you done something else to get arch booting?

Firs time I installed from archboot I booted from LTS kernel (because I didn't know about the noapic thing and the new one didn't boot), so it installed LTS kernel and I was not able to successfully boot because the display got all weird after Udev events.

The 2nd time I installed, I added the noapic to the archboot, so I could boot the new kernel and install it normally.
Then the noapic line worked.

Offline

#17 2012-06-29 02:07:17

0x530302
Member
Registered: 2012-06-26
Posts: 14

Re: problems booting archlinux on a MacBook Air Mid 2012

litemotiv wrote:

0x530302, would just installing grub-bios instead of grub-efi to your harddrive give the same effect? If the problem lies in efi-boot then any form of bios-boot will probably work okay, without needing a usb stick.

Yes, but i wanted to let the grub2-efi be untouched on my harddrive, to test if something changed.

Janhouse wrote:

The 2nd time I installed, I added the noapic to the archboot, so I could boot the new kernel and install it normally.
Then the noapic line worked.

That's awkward. I assume i've installed it the same way, but i still have the problem. Could you please show me the contents of your /etc/mkinitcpio.conf?

Offline

#18 2012-06-29 11:01:02

Janhouse
Member
Registered: 2010-10-02
Posts: 28

Re: problems booting archlinux on a MacBook Air Mid 2012

0x530302 wrote:
litemotiv wrote:

0x530302, would just installing grub-bios instead of grub-efi to your harddrive give the same effect? If the problem lies in efi-boot then any form of bios-boot will probably work okay, without needing a usb stick.

Yes, but i wanted to let the grub2-efi be untouched on my harddrive, to test if something changed.

Janhouse wrote:

The 2nd time I installed, I added the noapic to the archboot, so I could boot the new kernel and install it normally.
Then the noapic line worked.

That's awkward. I assume i've installed it the same way, but i still have the problem. Could you please show me the contents of your /etc/mkinitcpio.conf?

Yes, it worked with grub2-efi without any problems for me.

And sure, here is my mkinitcpio.conf: http://pastebin.com/WeWntT3D
Besides the LUKS and uresume stuff, the rest was generated by the arch install.

And grub.cfg (just in case): http://pastebin.com/iTuqmZHW

Offline

#19 2012-06-29 14:18:43

0x530302
Member
Registered: 2012-06-26
Posts: 14

Re: problems booting archlinux on a MacBook Air Mid 2012

Janhouse wrote:

Yes, it worked with grub2-efi without any problems for me.

And sure, here is my mkinitcpio.conf: http://pastebin.com/WeWntT3D
Besides the LUKS and uresume stuff, the rest was generated by the arch install.

And grub.cfg (just in case): http://pastebin.com/iTuqmZHW

There are no big differences to my configuration. I've tried the normal arch kernel and the current mainline (3.5) kernel. Both don't work.
It seems to be a problem related to the i915 driver. I've added i915.diescreaming=1 to the kernel line and i could boot, because i915 was not loaded.

Have you tried suspend to ram through pm-utils?

Offline

#20 2012-06-29 15:12:06

Janhouse
Member
Registered: 2010-10-02
Posts: 28

Re: problems booting archlinux on a MacBook Air Mid 2012

Yes, suspending to ram and disk works.
And I am using whatever is the latest kernel fron arch repos (testing enabled).

Offline

#21 2012-06-29 15:50:00

0x530302
Member
Registered: 2012-06-26
Posts: 14

Re: problems booting archlinux on a MacBook Air Mid 2012

I figured out what the problem is.

The i915 driver can't correctly identify my screens. When i wait until the system has booted and then blindly login, open a terminal and type

$ xrandr --output eDP1 --off
$ xrandr --output eDP1 --auto

everything seems to work!

Last edited by 0x530302 (2012-07-02 06:15:04)

Offline

#22 2012-07-03 22:23:28

Janhouse
Member
Registered: 2010-10-02
Posts: 28

Re: problems booting archlinux on a MacBook Air Mid 2012

Did you figure out how to get the applesmc driver working?

Offline

#23 2012-07-09 06:35:03

rydberg
Member
Registered: 2012-07-09
Posts: 1

Re: problems booting archlinux on a MacBook Air Mid 2012

Janhouse wrote:

Did you figure out how to get the applesmc driver working?

This patch, contributed by a user at the ubuntu forums, works on a MacBookPro9,2:

diff --git a/drivers/hwmon/applesmc.c b/drivers/hwmon/applesmc.c
index 0162f55..f41585e 100644
--- a/drivers/hwmon/applesmc.c
+++ b/drivers/hwmon/applesmc.c
@@ -54,7 +54,7 @@
#define APPLESMC_MAX_DATA_LENGTH 32

/* wait up to 32 ms for a status change. */
-#define APPLESMC_MIN_WAIT      0x0040
+#define APPLESMC_MIN_WAIT      0x0010
#define APPLESMC_MAX_WAIT      0x8000

#define APPLESMC_STATUS_MASK   0x0f

Offline

#24 2012-07-09 08:05:17

Janhouse
Member
Registered: 2010-10-02
Posts: 28

Re: problems booting archlinux on a MacBook Air Mid 2012

Yes, I already found it yesterday, works great. smile
I also compiled the kernel with B43_BCMA_EXTRA so I could use b43 driver with my wireless card on Macbook Air.

So, seems like everything is working now. smile

Offline

#25 2012-07-11 16:41:15

OhneHerren
Member
Registered: 2012-07-09
Posts: 32

Re: problems booting archlinux on a MacBook Air Mid 2012

Has anyone had any success enabling AHCI on the Air? I've tried following the instructions here, but the kernel refuses to boot when I add "setpci -d 8086:1e03 90.b=40" to grub.

Offline

Board footer

Powered by FluxBB