View Single Post
  #2 (permalink)  
Old 1st November, 2007, 09:49 PM
ccperf721p ccperf721p is offline
Member
 
Join Date: April 2005
Location: AZ
Posts: 2,446

10. Post install clean up and creating user accounts

After you log in as root we will remove the installation folders downloaded at the beginning of the guide

Code:
 # rm /*.tar.bz2
[b]10a. User Administration[/color]

Adding a User for Daily Use

Working as root on a Unix/Linux system is dangerous and should be avoided as much as possible. Therefore it is strongly recommended to add a user for day-to-day use.

The groups the user is member of define what activities the user can perform. The following table lists a number of important groups you might wish to use:

Code:
Group  	Description
audio -->	be able to access the audio devices
cdrom -->      be able to directly access optical devices
floppy -->	be able to directly access floppy devices
games -->      be able to play games
portage -->    be able to use emerge --pretend as a normal user
usb -->        	 be able to access USB devices
plugdev -->    Be able to mount and use pluggable devices such as cameras and USB sticks
video -->       be able to access video capturing hardware and doing hardware acceleration
wheel -->      be able to use su
To create a user account for a primary user with access to everything run the following command

Code:
 
 # groupadd games
 # groupadd plugdev
 # useradd -m -G users,wheel,video,audio,plugdev,games,cdrom,portage,usb,cron -s /bin/bash 
 # passwd  
>> Note: Do not add any user to the wheel group you do not want to have root privileges. (Usually you will be the only member of the wheel group)

Installing Sudo

Sudo is an app to allow users temporary root privileges without logging in as root, as soon as it runs the command or commands it drops root privileges. Sudo also gives you the ability to control which users can run commands. I will assume you are on a single user computer not get to in depth on sudo for this guide. I will add a linux security section in the FAQ portion at some point just to keep the guide going with decent material.

Code:
 # emerge sudo
Next we will configure sudo to allow users in the wheel group to run all commands

Code:
 # visudo
scroll to and uncomment (remove the # sign) this line > %wheel ALL=(ALL)       ALL
> Note: To use sudo, log in as the user you created, lets say you wanted to install foo, you would type # sudo emerge foo , sudo will ask for the password, you use your user password and not your root password.

Lets move on to installing X server

11. Installing X server

11a. Configuring the make.conf variables

Use variables

The ideas behind USE flags

When you are installing Gentoo (or any other distribution, or even operating system for that matter) you make choices depending on the environment you are working with. A setup for a server differs from a setup for a workstation. A gaming workstation differs from a 3D rendering workstation.

This is not only true for choosing what packages you want to install, but also what features a certain package should support. If you don't need OpenGL, why would you bother installing OpenGL and build OpenGL support in most of your packages? If you don't want to use KDE, why would you bother compiling packages with KDE support if those packages work flawlessly without?

I have put together a list of use flags that will give most users everything they need to have a fully functioning multi-media capable system. It will still need slight changes depending on your machine and which Desktop Environment you choose. (Check section 12 and pick your Desktop environment. before altering your use flags If you choose to run KDE add these to the USE= line > kde qt3 qt4 qt3support , if you choose to run gnome add > gnome gtk to the line

>> Note: Before emerging a package use -pv (--pretend --verbose) to see what Use flags it will use. Example: # emerge -pv sudo.
Code:
 # nano -w /etc/make.conf 

USE="a52 aac acpi alsa bash-completion -bindist cairo cdr dbus dvd dvdr dvdread encode ffmpeg firefox flac gif glitz hal -ipv6 jpeg jpeg2k lm_sensors logrotate mad mmx mp3 mp4 mpeg nptl nptlonly opengl openntpd pdf png sse sse2 spell symlink theora tiff truetype type1 usb vorbis win32codecs X xcomposite xine xv"
Also check Gentoo-Portage - USE Flags for a list of Use flags and there descriptions.

>> Note: Try to stay light on Use flags, if you have a specific package that needs a certain use flag you can allow the Use flag for just that package instead of system wide by using /etc/portage/package.use. As an example, I compile pciutils with the -zlib flag set, but this will break other packages if set system wide so:

Code:
 # nano -w /etc/portage/package.use
 sys-apps/pciutils* - zlib (the star indicates any version of that app)
You can also use echo to accomplish this. # echo "sys-apps/pciutils* -zlib" >> /etc/portage/package.use

Video Cards and Input Devices

Next we will add a couple of lines to the make.conf

Code:
 # nano -w /etc/make.conf 

(use "nvidia" for nvidia cards   11b. Emerging X-server 

With over 100 packages this step will take a while. Find something to do for 1.5 hours or so

Code:
 # emerge xorg-x11
When it's finished reinitialize the environment

Code:
 # env-update
# source /etc/profile
Configuring Xorg

The configuration file of Xorg is called xorg.conf and it resides in /etc/X11. The Xorg-X11 package provides an example configuration as /etc/X11/xorg.conf.example which you can use to create your own configuration. It is heavily commented, but if you are in need of more documentation regarding the syntax, don't hesitate to read the man page, but it is not necessary

Code:
 # man 5 xorg.conf
Xorg itself is able to guess most parameters for you. In most cases, you will only have to change some lines to get the resolution you want up and running. If you are interested in more in-depth tweaking, be sure to check the resources at the end of this chapter. But first, let us generate a (hopefully working) Xorg configuration file.

Generating an xorg.conf file

Code:
 # Xorg -configure
Be sure to read the last lines printed on your screen when Xorg has finished probing your hardware. If it tells you it failed at some point, you're forced to manually write an xorg.conf file. Assuming that it didn't fail, it will have told you that it has written /root/xorg.conf.new ready for you to test. So let's test.

Code:
 # X -config /root/xorg.conf.new
If all goes well, you should see a simple black and white pattern. Verify if your mouse works correctly and if the resolution is good. If you received errors about "/dev/mouse", try changing your mouse device to /dev/input/mice in the "InputDevice" section of xorg.conf. You might not be able to deduce the exact resolution, but you should be able to see if it's too low. You can exit any time by pressing Ctrl-Alt-Backspace.

If this does not work try:

Semi-Automatic Generation of xorg.conf

Xorg provides a tool called xorgconfig which will ask you for various information regarding your system (graphical adapter, keyboard, ...). Based on your input it will create a xorg.conf file.

Code:
 # xorgconfig
Go through the questions, answer no to the card database question as we will load binary drivers from nvidia or ati

After running xorgconfig we will need to edit xorg.conf

Code:
 # nano -w /etc/X11/xorg.conf 
 nvidia users uncomment the "Load glx" line > ATI users uncomment the "Load glx and Load dri" lines
 Scroll down to "Section Device" nvidia users will change > Driver "vga" to Driver "nvidia"  flgrx users will change it to flgrx. 
 CTRL + X to save and exit
Nvidia users:
Code:
# eselect opengl set nvidia
# env-update; source /etc/profile
ATI users:
Code:
 eselect opengl set ati 
# env-update; source /etc/profile
Lets find out if our config works

Code:
 # startx
If you get a screen with a few white boxes then your set and it is time to install a desktop environment

>> Note:: These are basic configs for the video section, they will have hardware accleration but there are many more features that can be enable for both sets of drivers. I hope to cover these options soon enough in a part 3 of the guide..

12. Installing a Desktop Environment

Choices, Choices

There are many choices for a Desktop Environment under Linux. The two most popular are Gnome and KDE for full featured Desktops with programs to handle most tasks built in. If you are working with an old system running a small amount of memory you may also want to look into Xfce4 and Fluxbox

To help you decide I have included links to KDE and Gnome. Take a look at the feature set offered by both, decide what you need then emerge it.

K Desktop Environment - Conquer your Desktop!

GNOME: The Free Software Desktop Project

Code:
 # emerge kde
Code:
 # emerge gnome
Both Desktop environments take a while to compile so take a break or scratch a honey-do off the list.

Once they are compiled we need to edit a couple of files to let Gentoo know which Window manager and Desktop environment we will be using.

For KDE users:

Code:
 # nano -w /etc/rc.conf

scroll down and change the line to this  XSESSION="kde-3.5"
We will also need to change the Display manager

Code:
 # nano -w /etc/conf.d/xdm
 scroll and change DISPLAYMANGER="xdm" to DISPLAYMANGER="kdm"
For Gnome users:

Code:
 # nano -w /etc/rc.conf

 Uncomment the XSESSION line
Changing the display manager
Code:
 # nano -w /etc/conf.d/xdm

 scroll and change DISPLAYMANGER="xdm" to DISPLAYMANGER="gdm"
Now run these commands to set run levels for hald dbus and xdm

Code:
 # rc-update add hald default
 # rc-update add xdm default
I usually just reboot at this point

Code:
 shutdown -r now
After reboot you will be greeted with a login screen and will now have a working desktop environment..

Welcome to Gentoo Linux and open source freedom..

Sources:
LikeWhoa
Gentoo.org: Gentoo Linux -- Gentoo Documentation Resources
Official IRC Channel: irc.freenode.net #gentoo
Official Gentoo Linux Guides: Gentoo Linux -- Gentoo Documentation Resources
Official Gentoo Overlays: Gentoo Overlays
Forums: Gentoo Forums :: Index
Gentoo Wiki: Main Page - Gentoo Linux Wiki
Grub Error Collection: Gentoo Linux Documentation -- Gentoo Grub Error Collection
__________________
Biostar TForce X58 - Core i7 920 - 12GB Corsair Dominator DDR3 - EVGA 560ti - PCP&C 750W - Dual boot, Arch Linux/WinXP