Garbage File

March 6, 2008

Gentoo MythTV

Filed under: Gentoo / Linux — kevin @ 5:45 pm

I recently setup a HD MythTV (digital video recorder) Gentoo box using my Motorola 6200 set top box over ieee1394 (firewire). The setup was a bit painful and took over a week to get right, largely due to my inexperience with this sort of thing.

The box is excessively powerful as I mean to use it as a personal server in addition, but the important details are that it is using an ‘MSI NX8500GT-MTD256EH GeForce 8500GT’ for graphics (which is far overpowered) and ‘ASUS P5K-E LGA 775 Intel P35 ATX Intel’ motherboard which has an ieee1394 port.

# echo "media-tv/mythtv alsa ieee1394 lirc opengl" >> /etc/portage/package.use
# emerge mythtv

MythTV uses MySQL to keep track of information like system settings and television program details, forcing us to initialize MySQL and then initialize the MythTV database.

# rc-update add mysql default
# /etc/init.d/mysql start
# mysql -u root -p < /usr/share/mythtv/database/mc.sql

For the Motorola 6200, check the status of the firewire by executing ‘plugreport’ before starting mythtv-setup and check the output. Here is a great guide for discovering your firewire status. Keep in mind incorrect firewire port and node settings will crash most programs including mythbackend along with some of the debugging tools, so when executing ‘plugreport’ notice that the port number is the adapter number and the node number is obvious.

Next start X and run ‘mythtv-setup’ as a normal user to change backend settings. I am not entirely sold on this implementation as the security of the system seems to fall apart at this point. Any user on the box can run this program and change the settings of a program that is run at boot. This would be more appropriate as a /etc/conf.d/mythtv instead of some weird gui application coupled with MySQL…

General
- change the recording directory to one with permissions 775 and ownership of mythtv:users
- change TV format to ‘NTSC’
- change channel frequency to ‘us-cable’
Capture Cards
- select firewire
- set port and node to the values found earlier
Video Sources
- select schedules direct
- set username and password
Input Connections
- connect capture card to video source
- get channel lineup from video source

Exit the setup utility and fill the database with channel information.

$ mythfilldatabase

At this point mythbackend should be configured well enough for a basic television watching system.

# rc-update add mythbackend default
# /etc/init.d/mythbackend start
$ mythfrontend

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