Showing posts with label Gentoo. Show all posts
Showing posts with label Gentoo. Show all posts

Sunday, March 25, 2007

Installing Gnome on Gentoo

Installing Gnome


Gnome Base


first of all you have to make sure sun-jdk-1.4.2.13 is installed, so before installing gnome, do the following:


emerge =dev-java/sun-jdk-1.4.2.13

there will come a text that says you have to download a file, follow the instructions and do the emerge command again.


emerge -DuN gnome
rc-update add dbus default
rc-update add hald default

  • If you are missing either dbus or hald, make sure USE="hal" and see HOWTO gnome-volume-manager. I think it's highly unlikely that you meant to not install this.

On a decent system, if you start it before going to bed and wait until work is over the next day, it should be done compiling. If that's too long for you, then check out my page. I've listed there my grp and make.conf.


  • If you have difficulties with gstreamer or your gnome session starts with an error about "no audio device found", check this out: TIP Troubleshooting Gstreamer
  • A couple of times when emerge-ing gnome the merge has failed at merging gtk+. To fix, re-emerge cairo.

Logging In


In order to log into gnome after installation you will need to do one of the following tasks:


  • Text-based Login - Per User Basis - Create your .xinitrc

nano -w ~/.xinitrc
xinit
# #OR
# startx

Your .xinitrc might look something like this:






File: ~/.xinitrc



exec gnome-session
# startkde
# fluxbox &
# eterm &



  • Graphical Login

We need to first install GDM (GNOME Display Manager) so we can login using its pretty interface.


emerge -DuN gdm

If you want extra themes for GDM install this package.


emerge -DuN gdm-themes

We now need to edit the file /etc/rc.conf to tell the system to use GDM instead of XDM.

Edit the following lines in rc.conf:








File: /etc/rc.conf



# DISPLAYMANAGER has moved to /etc/conf.d/xdm
XSESSION="Gnome"










File: /etc/conf.d/xdm



DISPLAYMANAGER="gdm"



We need to add XDM to the default runlevel to be able to start GDM when the system boots up.


rc-update add xdm default

If you would like to have GDM startup quicker at boot find the following line.








File: /etc/init.d/xdm



/sbin/telinit a &>/dev/null



Change it to








File: /etc/init.d/xdm



/etc/X11/startDM.sh &>/dev/null



And change XDM from default runlevel to the boot runlevel.


rc-update del xdm && rc-update add xdm boot

NOTE This will load GDM in the middle of booting so you wont be able to see the entire boot process.



If you want to check out GDM without a reboot start it up.


/etc/init.d/xdm start

Or if you already have XDM running restart the service.


/etc/init.d/xdm restart

Saturday, March 24, 2007

Configuring wireless card in gentoo

Few information before we proceed to make your Gentoo access internet using wi-fi:

1. The default command line text editor in Gentoo is nano.

2. The network cards need to be activated from /etc/init.d

3. Edit the configuration file /etc/conf.d/net

4. To start,stop.restart use /etc/init.d/net.eth0 start/stop/restart

There are currently two ways to configure wireless networking in Gentoo. The first way is by using the options documented in /etc/conf.d/wireless.example to setup a full configuration, which uses iwconfig (located in the "wireless-tools" ebuild). The wireless.example file is well documented and should list everything you need to get started, including information on setting up WEP. Be sure to check this file for variable changes/additions/removals for new versions!

These wireless settings are held in /etc/conf.d/wireless - but could be held in /etc/conf.d/net as well

Here's a sample config for /etc/conf.d/wireless:





File: /etc/conf.d/wireless snippet



key_YOUR-ESSID="s:mywepkey enc open"
preferred_aps=( "YOUR-ESSID" )



Replace YOUR-ESSID with your ESSID and mywepkey with your WEP key - if it's needed
. Some cards (or drivers) may need some time to complete the association with the access point. Add something like this, if needed:








File: /etc/conf.d/wireless snippet



sleep_scan_wlan0="1"
sleep_associate_wlan0="25"



To troubleshoot the connection, set RC_VERBOSE=yes in /etc/conf.d/rc for more wireless output.

It's possible to run completely different network settings per ESSID connected to - check the /etc/conf.d/wireless.example file for details on how to achieve this.

To connect, first create a link that corresponds to your network inteface in /etc/init.d and then start it:








Code: in /etc/init.d


# cd /etc/init.d
# ln -s net.lo net.eth0
# ./net.eth0 start


To start the interface automatically, execute:








Code: /


# rc-update add net.eth0 default


Of course, one can also create a script to connect to your home protected wireless wep connection, for example:








Code: /root/wireless


#!/bin/bash
ifconfig eth0 down
rmmod ipw2200
modprobe ipw2200
ifconfig eth0 up
iwconfig eth0 key E7D6CA05773D038378F5E26748 #change this to your wep key
dhcpcd eth0


then make the wireless executable:






Code:

# chmod +x wireless


To use the script just do






Code:

# ./wireless


Configuration using wpa_supplicant


The second way of configuring wireless, and in my opinion, the best way, is by using wpa_supplicant. To install, simply emerge wpa_supplicant. Once installed, you can edit the /etc/wpa_supplicant/wpa_supplicant.conf file by checking out the examples in /usr/share/doc/wpa_supplicant-0.4.9/wpa_supplicant.conf.example.gz. This file contains many options, and is well documented, and is a little easier to setup for multiple APs than by using /etc/conf.d/wireless. The bonus in configuring your wireless setup using wpa_supplicant is that it supports all types of encryption currently used: WEP, WPA, and even non-encrypted.

To use wpa_supplicant over iwconfig for wireless configuration, put the following in /etc/conf.d/net:






File: /etc/conf.d/net snippet



modules=( "wpa_supplicant" )
# Users of madwifi add this:
wpa_supplicant_ath0="-Dmadwifi"
# Users of Intel ipw2100/2200 (Centrino) chips with older kernels add this:
wpa_supplicant_ath0="-Dipw"
wpa_timeout_ath0=60

# As of kernel 2.6.15 (and probably earlier), centrino users have to use
wpa_supplicant_ath0="-Dwext -c /etc/wpa_supplicant/wpa_supplicant.conf"
# wpa_supplicant.conf by default now is located in /etc/wpa_supplicant
# but yours could be in /etc.
wpa_timeout_ath0=60



Note: Replace ath0 as required with wlan0, eth1 etc, and madwifi with ndiswrapper or the correct drivers for your wireless card (see wpa_supplicant --help for a list of drivers).

Note: You will need to comment out any config_ESSID settings, as they do not work in conjunction with wpa_supplicant. If not, you will receive the following hard-to-read error:



Nov 13 06:14:20 yourhost wpa_cli: interface ath0 CONNECTED
Nov 13 06:14:21 yourhost wpa_cli: executing '/etc/init.d/net.ath0 --quiet start' failed

FAQ


  • Q. How I can connect to several wireless networks at the same time?
  • A. You can't, at least not with only one wireless card. Just as a single ethernet card cannot be on two (physical) networks at once, a wireless card can only be associated with one wireless network at once. However, with the proper configuration, a card could be configured to intelligently switch between available wireless networks dynamically. wpa_supplicant makes this an easier task than with wireless-tools, but neither is quite as simple as in Windows XP at this time.




  • Q. I don't have net.wlan0, net.eth1, net.ath0 or similar in /etc/init.d!
  • A. Read up on Gentoo networking in their handbook:

http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=1&chap=8#doc_chap2

Link to net.lo instead of net.eth0 if you are using a current baselayout (>=1.11).




  • Q. I'm seeing Wireless extensions not found for $interface - but it's a wireless device!
  • A. You need to enable wireless-extensions in your kernel.

To do this, enable the following config options in /usr/src/linux/.config






Linux Kernel Configuration:


CONFIG_NET_RADIO=y
CONFIG_NET_WIRELESS=y


Then recompile your kernel and modules and re-install them
If your driver is external then re-compile and re-install that.
Finally, re-emerge wireless-tools against the new kernel and driver