Alper Akcan : ~/documents/slackware linux on macbook

News

Projects

Documents

Contact

RSS Feed

Donations (SF)

 
Installing Slackware Linux on Apple MacBook
2007-09-20 13:00

I've bought a brand new Apple MacBook, and installed slackware linux 12.0. Here is the step by step instructions;

1. First of all grep the iso images, and burn them...
Grab install DVD from http://www.slackware.org, and burn...

2. Use Mac OSX to intall refit, and resizing OSX partition

2a. Install Refit.
The easiest, and maybe the best solution for dual booting is refit. With refit you will not have to do fancy tricks, and will able to use standart linux tools for dual booting. Also, you may try tripple booting (macosx, linux, windows) in future which is quite easy with refit. Anyway, download and install refit from http://refit.sf.net
The steps to install rEFIt this way are as follows:

  • 1. Download and mount the rEFIt-0.10.dmg disk image.
  • 2. Double-click on the 'rEFIt.mpkg' package.
  • 3. Follow the instructions and select your Mac OS X installation volume as the destination volume for the install.
  • 4. Open terminal

    ~# cd /efi/refit
    ~# ./enable.sh

If everything went well, you will see the rEFIt boot menu on the next restart.

2b. Resize Mac OSX partition.
Resizing could be done with parted, but using diskutil is safer.


~# diskutil resizeVolume /dev/disk0s2 40G Linux Linux 40G

3. Boot the MacBook with Install DVD.
Just press and hold the key 'C' while MacBoot is booting, or wait for refit to show up and select boot from DVD in menu.
You will see Iso Linux instructions, and kernel selection for either huge.s or hugesmp.s. Just press 'enter' to continue booting with default kernel image. If keyboard does not work do not worry, sometimes happens in lilo session, just wait untill it boots (i guess timeout value is 120 secs). You will not deal with keyboard issues after intalled slackware and lilo, since you will use lilo just for loading linux kernel, not for OS selection (no promt, no worries).

4. Prepare partitions with parted
You must use parted for partitioning, because it is the only tool that can handle EFI GPT (at least for now). Although, parted is not included in slackware 12.0, luckly it is included in install dvd. Use parted to delete the linux partition that you had created with distutil and create one linux, one linux swap, and what ever you want.


~# parted /dev/sda
(parted) rm 3
(parted) mkpart primary linux 44G 84G
(parted) mkpart primary linux-swap(new) 84G 86G
(parted) p
p
Model: ATA ST9120822AS (scsi)
Disk /dev/sda: 120GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt

Number  Start   End     Size    File system  Name                  Flags
 1      20.5kB  210MB   210MB   fat32        EFI system partition  boot 
 2      210MB   43.2GB  42.9GB  hfs+         Customer                   
 3      43.2GB  84.0GB  40.8GB  ext3         Linux                      
 4      84.0GB  86.0GB  2000MB  linux-swap   Linux Swap                 

(parted) quit

~# mkfs.ext2 -j /dev/sda4
~# mkswap /dev/sda4


Outputs may be differ (should not, but i did not takes notes for outputs)

5. Correct partition table with refit
This step is required for setup process, since slackware setup uses probe to check root and swap partitions, and it is not able to understand EFI GPT you need to syncronize MBR with GPT. Anyway, just reboot and use partitions tool in refit menu. Just say 'y' when it asks for syncronizing. Nothing special. There should be several ways to do the syncronizing, but this is the safest, and easiest way to do.

6. Install slackware linux
Boot the install dvd again, and install slackware. I guess you already know how to install. Just follow the instructions.


~# setup


Skip lilo install in setup, you will install lilo manually.

7. Install lilo
After installing slackware you should install lilo before rebooting. Assuming that you install linux to /dev/sda3.


~# cd /
/# umount /mnt
/# mount /dev/sda3 /mnt
/# chroot /mnt
~# cat > /etc/lilo.conf << EOF
boot = /dev/sda3

image = /boot/vmlinuz
    root = /dev/sda3
    label = linux
    read-only
EOF
~# lilo
~# exit
/# umount /mnt
/# reboot

8. Configure Xorg
here is my xorg.conf; xorg.conf


Enable mouse buttons emulation, left mac button as middle, right mac button as left mouse button.

~# cat > /etc/sysctl.conf << EOF
dev.mac_hid.mouse_button_emulation = 1
dev.mac_hid.mouse_button3_keycode = 126
dev.mac_hid.mouse_button2_keycode = 125
EOF

9. Upgrade to linux-2.6.23.14 kernel.

here is my kernel configuration file; kconfig-2.6.23.14



# cd /usr/src/
# wget http://kernel.org/pub/linux/kernel/v2.6/linux-2.6.23.14.tar.bz2
# wget http://alperakcan.net/documents/slackware%20linux%20on%20macbook/kconfig-2.6.23.14
# tar -jxvf linux-2.6.23.14.tar.bz2
# rm linux
# ln -s linux-2.6.23.14 linux
# cd /usr/include
# rm -rf linux asm asm-i386 asm-generic
# ln -sf /usr/src/linux/include/asm ./asm
# ln -sf /usr/src/linux/include/asm-i386 ./asm-i386
# ln -sf /usr/src/linux/include/asm-generic ./asm-generic
# ln -sf /usr/src/linux/include/linux ./linux
# cd /usr/src/linux
# make mrproper
# cp ../kconf-2.6.23.14 ./.config
# make bzImage && make modules && make modules_install
# cp arch/i386/boot/bzImage /boot/vmlinuz-2.6.23.14


change your /etc/lilo.conf properly


# lilo
# reboot

10. Install Atheros AR5418 driver, and be wireless
Grab latest sources from http://madwifi.org. But, latest stable driver does not support AR5418 chip, so use the latest snapshot from svn.


~# tar -zxvf madwifi-ng-r2708-20070915.tar.gz
~# cd madwifi-ng-r2708-20070915
~# make
~# make install

11. Connect to AP


# modprobe ath_pci


11.1 Connect to AP - no encryption


# iwlist ath0 scanning
...
# iwconfig ath0 essid "essid"
# iwconfig ath0 key off
# dhcpcd ath0

11.2 Connect to AP - WEP
it is very easy to connect with WEP (atheros ar5418).


# iwlist ath0 scanning
...
# iwconfig ath0 essid "essid"
# iwconfig ath0 key s:"key"
# dhcpcd ath0

11.3 Connect to AP - WPA
i know that you need wpa (atheros ar5418) ;)


# wpa_passphrase SSID_TO_CONNECT YOUR_PASSWORD > /etc/wpa_supplicant.con
# wpa_supplicant -iath0 -Dwext -c/etc/wpa_supplicant.conf -dd -B
# dhcpcd ath0

12. BlueTooth
I have a logitech bluetooth mouse and here is the instructions to use a bluetooth input device. As the kernel.conf file above has bluetooth options turned on, there is nothing to do with the kernel, all we need is to download and setup bluez-libs and bluez-utils.


# wget -c http://bluez.sf.net/download/bluez-libs-3.24.tar.gz
# wget -c http://bluez.sf.net/download/bluez-utils-3.24.tar.gz
# wget -c http://dbus.freedesktop.org/releases/dbus-python/dbus-python-0.82.3.tar.gz

# tar -zxvf bluez-libs-3.24.tar.gz
# cd bluez-libs-3.24
# ./configure
# make
# make install
# ldconfig
# cd ..

# tar -zxvf bluez-utils-3.24.tar.gz
# cd bluez-utils-3.24
# ./configure --enable-all
# make
# make install
# ldconfig
# cd ..


# tar -zxvf dbus-python-0.82.3.tar.gz
# cd dbus-python-0.82.3
# ./configure --prefix=/usr
# make
# make install
# ldconfig
# cd ..

# cat > /etc/rc.d/init.d/bluetooth.mouse << EOF

import dbus

bus = dbus.SystemBus()
# service activation
bmgr = dbus.Interface(bus.get_object('org.bluez', '/org/bluez'), 'org.bluez.Manager')
bus_id = bmgr.ActivateService('input')
imgr = dbus.Interface(bus.get_object(bus_id, '/org/bluez/input'), 'org.bluez.input.Manager')

# device creation
path = imgr.CreateDevice('xx:xx:xx:xx:xx:xx')
idev = dbus.Interface (bus.get_object(bus_id, path), 'org.bluez.input.Device')

# host initiated connection
idev.Connect()

EOF

# cat > /etc/rc.d/init.d/bluetooth.remove_all << EOF

import dbus

bus = dbus.SystemBus()

# service activation
bmgr = dbus.Interface(bus.get_object('org.bluez', '/org/bluez'), 'org.bluez.Manager')
bus_id = bmgr.ActivateService('input')
imgr = dbus.Interface(bus.get_object(bus_id, '/org/bluez/input'), 'org.bluez.input.Manager')
devlist = imgr.ListDevices()

# removing all devices objects and file system stored data
for dev in devlist:
    imgr.RemoveDevice(dev)

EOF

13. Cheers!



(CL) alper akcan
http://www.valgrind.org   hacker emblem   Valid HTML 4.01!   Viewable With Any Browser   [Valid Rss]   Open Source