Garbage File

January 29, 2008

XMonad, Gentoo on MacBook Pro

Filed under: Gentoo / Linux — kevin @ 10:48 pm

Installing XMonad (a tiling window manager, GPL and superior to Ion)

emerge layman
layman --fetch
layman -a haskell
echo "source /usr/portage/local/layman/make.conf" >> /etc/make.conf

echo "dev-lang/ghc binary" >> /etc/portage/package.use
emerge xmonad
emerge xmonad-contrib

This should result in a version of XMonad 0.5 or higher. The absolute latest version can be installed if ‘xmonad-darcs’ and ‘xmonad-contrib-darcs’ are used, however this also means there is a good chance of the install failing due to broken code. The default install can be tested by adding ‘xmonad’ to ‘.xinitrc’ and running ’startx’.

Alt + Shift + Enter = new terminal
Alt + Shift + q = quit
Alt + j/k = cycle through windows
Alt + h/l = move center divide
Alt + Shift + c = close window

My conf files (xmonad + dzen): xmonadconf.tar.bz2

January 26, 2008

Networking, Gentoo on MacBook Pro

Filed under: Gentoo / Linux — kevin @ 2:55 pm

Installing ethernet and wireless on a MacBook Pro using wpa_supplicant and a 2.6.23 kernel.

Network Cards

  • Network controller: Atheros Communications, Inc. AR5418 802.11a/b/g/n Wireless PCI Express Adapter (rev 01)
  • Ethernet controller: Marvell Technology Group Ltd. Unknown device 436a (rev 13)

Ethernet Driver - SysKonnect Yukon2

Device Drivers
    [*] Network Device Support
        [*] Ethernet (1000 Mbit)
            <*> SysKonnect Yukon2 support

Note: This driver is somewhat new, so older kernels (like the one on the gentoo 2007.1 install disc) will not support the ethernet card. I do not know at what specific point it was added to the kernel, but 2.6.23 and later have it.

Ethernet Tweak
I use ifplugd to speed up boot time, as eth0 is hardly ever connected.

emerge ifplugd

Wireless Driver - MadWifi-NG
I had to install the latest version of madwifi-ng from source as even the unstable version in portage did not support my card. Run the commands below but substitute ’source_folder’ with the folder created by ‘tar xzf madwifi-ng-current.tar.gz’. (Source: gentoo wiki)

cd /usr/src
wget http://snapshots.madwifi.org/madwifi-ng-current.tar.gz
tar xzf madwifi-ng-current.tar.gz
cd source_folder
make
make install
ln -s /usr/src/source_folder /usr/include/madwifi
reboot

Note: Check ‘lsmod’ to for ‘ath_pci’ and ‘wlan_scan_sta’ after reboot. Run ‘modprobe’ if either is missing. When changing kernel versions, rerun ‘make & make install’.

Detecting Wireless Networks

emerge wireless-tools
iwlist ath0 scan

Note: There is also ‘wlanconfig ath0 list scan’ but I prefer ‘iwlist’ because of the extra information.

Connecting to a Wireless Network
I chose to use wpa_supplicant to manage the list of servers my notebook should connect to, however ‘iwconfig ath0 essid any’ can also be used. (Source: gentoo wireless howto)

echo "net-wireless/wpa_supplicant madwifi" >> /etc/portage/package.use
emerge wpa_supplicant
ln -s /etc/init.d/net.lo /etc/init.d/net.ath0
rc-update add net.ath0 default

/etc/wpa_supplicant/wpa_supplicant.conf

ctrl_interface=/var/run/wpa_supplicant
eapol_version=1
ap_scan=1
fast_reauth=1

network={
  ssid="some wep network"
  key_mgmt=NONE
  wep_key0=xxxxxxxxxx
  wep_tx_keyidx=0
  priority=5
}

network={
  ssid="a network with no encryption"
  key_mgmt=NONE
  priority=10
}

/etc/conf.d/net

#wpa
modules=("wpa_supplicant")
wpa_supplicant_auth0="-Dmadwifi"
wpa_timeout_ath0=20

#ath0
config_ath0=("dhcp")
dhcp_ath0="nontp nonis"

Note: It is possible that emerging wpa_supplicant with the madwifi use flag as above, will also emerge madwifi-ng requiring an ‘emerge –unmerge madwifi-ng’ and a reinstall of madwifi from source, but I did not encounter this.

Powered by WordPress