MacBook

From openSUSE

(Redirected from Macbook)


Contents

Preparation

This chapter describes the steps you should do before you install openSUSE on your MacBook.

Resizing

The OS X partition has to be resized to make space for the openSUSE OS. This is most easily done with the help of the Mac OS X program diskutil. diskutil is able to nondestructively resize volumes since the version that came with 10.4.6 along with BootCamp (more information on macgeekery.com).

The following command example assumes that "disk0s2" is the OS X partition and will resize it to 60 gigabytes):

$ sudo diskutil resizeVolume disk0s2 60G
Started resizing on disk disk0s2 Mac OS X
Verifying
Resizing Volume
Adjusting Partitions
[ + 0%..10%..20%..30%..40%..50%..60%..70%..80%..90%..100% ] 
Finished resizing on disk disk0s2 Mac OS X
/dev/disk0
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *149.1 Gi   disk0
   1:                        EFI                         200.0 Mi   disk0s1
   2:                  Apple_HFS Mac OS X                59.9 Gi    disk0s2
$

(Warning: this may or may not work depending if your partition has been resized before. Alternate approach: disable journaling in MacOS, boot to Linux, use Parted to resize the MacOS partition and turn journaling back on in MacOS and have the filesystem checked.)

Install rEFIt

After that the new bootmanager rEFIt has to be installed. The easiest is to install the disk image in OS X. We used version 0.11 in this description.

To be sure that the GPT and MBR are synchronized, reboot and choose "Start Partitioning Tool" in rEFIt. After this you have to confirm with an "y". Be aware that rEFIt assumes American keyboard layout...

Now you are ready to install openSUSE. Shut down and restart or reboot your MacBook. Insert the openSUSE install DVD/CD-ROM in drive and boot from it. The installation workflow (language and package selection, timezone, ...) is equivalent to the normal workflow for openSUSE on other hardware. So we just describe the differences here. Right now one has to pass "hwprobe=-parallel,-misc.par" as kernel parameter because at least the MacBook is hit by Bug 371997

Sometimes the built-in keyboard of the MacBook (and Macbook Pro) is not recognized during the boot. When the openSUSE install menu (with install/rescue/options) hangs on the 'boot from hard-drive option', reboot your MacBook . A workaround is connecting a USB keyboard to your MacBook when the installation menu starts.

Partitioning

You must not have more than four partitions—and the first has to be reserved for rEFIt. The following scenarios are suggested:

  • Windows, Linux and MacOSX => One partition for each OS:
    • Partition 1: rEFIt (do not format)
    • Partition 2: Mac OS X (do not format)
    • Partition 3: Windows (prepare and install Windows on it before you go through the next steps)
    • Partition 4: Linux (you should create a swap file on this partition—this can be done later)
  • Linux and MacOSX => One OS X partition, and two Linux partitions (root and swap):
    • Partition 1: rEFIt (do not format)
    • Partition 2: Mac OS X (do not format)
    • Partition 3: SWAP for Linux
    • Partition 4: Linux (root partition)
  • Linux and MacOSX => One OS X partition, and two Linux partitions (root and home):
    • Partition 1: rEFIt (do not format)
    • Partition 2: Mac OS X (do not format)
    • Partition 3: Linux (root partition)
    • Partition 4: Linux (/home)

Location of the Bootloader

This step is very important!

Be sure that the bootloader is NOT installed in the MBR—just in /dev/sda4 (the Linux partition)!

So have a look at the "Expert" tab in the Installation Overview dialog in the Bootloader section and check the correct settings.

Installation

Now you are ready to start the installation. At the end of the installation, the Bootloader installation will fail. So you have to skip this part and reboot your MacBook.

Use the rEFIt GPT/MBR synctool (sync MBR to GPT) to synchronize GPT and MBR again.

Afterwards boot the system using the install medium again and select rescue from the installation menu.

This will launch a rescue shell. When you have shell and logged in as root do as follows within the shell:

  • mount the linux partition:
mount /dev/sda4 /mnt
  • mount the needed /proc and /dev directories:
mount -t proc none /mnt/proc
mount -o bind /dev /mnt/dev
  • chroot in to the environment:
chroot /mnt /bin/bash
  • check the correct settings for the grub menu:
cat /boot/grub/menu.lst

This should show you something like:

# Modified by YaST2. Last modification on Tue Apr 17 14:25:10 CEST 2007
default 0
timeout 8
##YaST - generic_mbr
gfxmenu (hd0,3)/boot/message
##YaST - activate

title openSUSE 10.3 - 2.6.22.17-0.1
    root (hd0,3)
    kernel /boot/vmlinuz-2.6.22.17-0.1-default root=/dev/disk/by-id/scsi-SATA_ST3160812AS_5LS5X8C0-part2 vga=0x31a resume=/dev/sda1 splash=silent showopts
    initrd /boot/initrd-2.6.22.17-0.1-default

###Don't change this comment - YaST2 identifier: Original name: failsafe###
title Failsafe -- openSUSE 10.3 - 2.6.22.17-0.1
    root (hd0,3)
    kernel /boot/vmlinuz-2.6.22.17-0.1-default root=/dev/disk/by-id/scsi-SATA_ST3160812AS_5LS5X8C0-part2 vga=normal showopts ide=nodma apm=off acpi=off noresume nosmp noapic maxcpus=0 edd=off 3
    initrd /boot/initrd-2.6.22.17-0.1-default

If not, just open the file /boot/grub/menu.lst with vi:

vi /boot/grub/menu.lst

and change the settings to your needs.

  • check the grub config:
cat /etc/grub.conf

This should show you something like:

setup --stage2=/boot/grub/stage2 (hd0,3) (hd0,3)
quit

Be sure that the entries for hd are correct. In the above example, grub will be installed in the first hard drive (hd0) on partition 4 (hd0,3) – which is our example configuration. Edit these settings if needed.

  • Install Grub correctly:
grub --batch < /etc/grub.conf

Look at the output of the command – it should show you:


    GNU GRUB  version 0.97  (640K lower / 3072K upper memory)

 [ Minimal BASH-like line editing is supported.  For the first word, TAB
   lists possible command completions.  Anywhere else TAB lists the possible
   completions of a device/filename. ]
grub> setup --stage2=/boot/grub/stage2 (hd0,3) (hd0,3)
 Checking if "/boot/grub/stage1" exists... yes
 Checking if "/boot/grub/stage2" exists... yes
 Checking if "/boot/grub/e2fs_stage1_5" exists... yes
 Running "embed /boot/grub/e2fs_stage1_5 (hd0,3)"... failed (this is not fatal)
 Running "embed /boot/grub/e2fs_stage1_5 (hd0,3)"... failed (this is not fatal)
 Running "install --stage2=/boot/grub/stage2 /boot/grub/stage1 (hd0,3) /boot/grub/stage2 p /boot/grub/menu.lst "... succeeded
Done.
grub> quit

The last line beginning with "Running" is the important one: Running "install[...] succeeded"

  • now reboot and run sync MBR to GPT in rEFIt again.

Now you should be able to boot your openSUSE from rEFIt – afterwards grub starts and you can select the correct kernel (important for future kernel updates...).

Post-Installation

Below are a collection of tips and Tricks to make life with openSUSE on a MacBook easier.

Wireless

If you have a first generation MacBook (Core Duo), then your wireless should work out-of-the-box. However, the second generation MacBooks (Core 2 Duo) have a later version of the Atheros wireless chipset, which require the use of the latest Atheros MadWifi drivers or the use of NDISwrapper. Below covers the use of NDISwrapper to gain control of a wireless card (Atheros AR5418 802.11a/b/g/n Wireless PCI Express Adapter).

Display the make and model of the wireless card.

# /sbin/lspci | grep 02:00.0

Display the PCI ID of the wireless card and look it up to find if it's supported and where to find the driver here

# /sbin/lspci -n | grep 02:00.0
02:00.0 Class 0280: 168c:0024 (rev 01)

The NDISwrapper list of supported cards indicates that the driver can be found here

Run the following in a terminal. It will create a temp directory, download the driver file specified by the NDISwrapper list, and install the driver.

mkdir temp;cd temp
wget http://download.boulder.ibm.com/ibmdl/pub/pc/pccbbs/mobiles/7iwc28ww.exe
cabextract 7iwc28ww.exe
sudo /usr/sbin/ndiswrapper -i WINXP_2K/NET5416.INF
sudo /usr/sbin/ndiswrapper -l
 net5416 : driver installed
         device (168C:0024) present

Load the ndiswrapper module:

sudo /sbin/modprobe ndiswrapper

To load the module every time the system boots:

sudo /usr/sbin/ndiswrapper -m

Bluetooth

You have to run hid2hci Bug 286769. After this, bluetooth should just work.

Motion Sensors

Also known as accelerometers, which are built-in devices for measuring acceleration and gravity. Run the following command to enable the kernel's built-in support of the devices, and then fire up Neverball... (or any other game that uses a joystick)

sudo /sbin/modprobe applesmc

At this point, the module has been loaded, but it will also need to be added to a kernel configuration file (/etc/sysconfig/kernel) so that it is load every time the system boots. This is done by adding "applesmc" into MODULES_LOADED_ON_BOOT section (e.g.: MODULES_LOADED_ON_BOOT="applesmc") of the file. The following command will edit the file with this information:

sudo perl -pi -e 's/MODULES_LOADED_ON_BOOT=""/MODULES_LOADED_ON_BOOT="applesmc"/' /etc/sysconfig/kernel

Touchpad

In order to get the touchpad to respond similar to the way it does in OS X, you will need to edit the xorg.conf file (/etc/X11/xorg.conf). Please note that the following configuration does not work perfectly, so feel free to update the parameters and values if more suitable ones are identified.

Section "InputDevice"
  Identifier   "Mouse[0]"
  Driver       "synaptics"
  Option       "SendCoreEvents" "true"
  Option       "Device" "/dev/psaux"
  Option       "Protocol" "auto-dev"
  Option       "SHMConfig" "true"
# General options
  #Option       "LeftEdge" "150"
  #Option       "RightEdge" "1070"
  #Option       "TopEdge" "100"
  #Option       "BottomEdge" "310"
  #Option       "FingerLow" "25"
  #Option       "FingerHigh" "30"
  Option       "MaxTapTime" "180"
  Option       "MaxTapMove" "220"
  Option       "SingleTapTimeout" "100"
  Option       "MaxDoubleTapTime" "180"
  Option       "LockedDrags" "off"
  Option       "MinSpeed" "1.10"
  Option       "MaxSpeed" "1.30"
  Option       "AccelFactor" "0.08"
# Multi-finger taps - one-finger tap for left-click, two-finger tap for right-click, and three-finger tap for middle-click
  Option       "TapButton1" "1"
  Option       "TapButton2" "3"
  Option       "TapButton3" "2"
# Two-finger scrolling - enabled
  Option       "HorizTwoFingerScroll" "1"
  Option       "VertTwoFingerScroll" "1"
# Edge scrolling - disabled
  Option       "HorizEdgeScroll" "0"
  Option       "VertEdgeScroll" "0"
# Scrolling speed
  Option       "VertScrollDelta" "20"
  Option       "HorizScrollDelta" "50"
EndSection

Volume Control

Sound and volume control should work out-of-the-box. However, KDE users will notice that while using the function key to control increasing (fn+F5) and decreasing (fn+F4) the volume, muting the volume (fn+F3) does not appear to work. To correct this, one must right-click on the KMix system tray icon and select "Select Master Channel...". A list of sound devices will appear in a new window, and the user should select the "Front" device and click "OK". At this point, muting and unmuting should work properly.

Specials

Bug reports concerning the MacBook

  • No right-click support for the touchpad Bug 250427 – See Touchpad section.
  • During Installation there is no touchpad available: Bug 223450
  • MBR and GPT are not synchronized Bug 220839
  • Fn+F3 does not mute the speakers Bug 254164 – See Volume Control section.
  • /etc/init.d/hotkey-setup gives error Bug 255676
  • Brightness control is not working Bug 255676 – It is working with the dbus command from the bugreport, but not from kpowersave ...