Gentoo on Quad Xeon
Overview:
Installation of Gentoo Linux on an Intel Quad Xeon machine.
Links:
GCC optmisation for p4 (xeon) system
Linux 2.6 and Hyper-Threading
Gentoo on PIII
First of all I attempted a practice install of Gentoo 2005 on a PIII 600 machine.
I followed this guide doing a stage 3 install. I found I had to set /etc/hostname even though in the instructions it said to set the hostname in /etc/conf.d/hostname also from looking at the /etc/init.d/hostname and domainname scripts it looks like the domainname should be set in /etc/dnsdomainname. I also found the network instructions syntax did not work and used the syntax found in the /etc/conf.d/net file instead. Remember to set /etc/resolv.conf to the DNS server!
UPDATE: The reason for the above was I was using old config scripts (presumably from the stage 3 install). After executing "emerge --update --deep world" and running "dispatch-conf" (to update /etc scripts) it was clear that the ways to set some settings had changed. For example the hostname and domain names. The keymap should now be set in /etc/conf.d/keymaps rather than /etc/rc.conf. Clock should also be set in /etc/conf.d/clock rather than /etc/rc.conf.
For the framebuffer to work make sure you select frambuffer console support as a kernel option (not a module)! I used the vesa-tng option with "video=vesafb:mtrr,ywrap,1280x1024-16@60" in /boot/grub/grub.conf
To get mouse supported under X I had to do the following:
Type in 'ln -s /dev/psaux /dev/mouse'. That'll create a symlink called /dev/mouse that will point to /dev/psaux (Your PS/2 mouse).
Install Xorg , info for proprietry ATI Drivers and X11 HOWTO. I enabled the following kernel modules under the character devices section of device drivers: /dev/agpgart with ATI chipset and Direct Rendering Manager with the ATI Rage 128 support. I set up x manually using xorgconfig.
Emerge-progress script system ground to a halt when updating the perl package when using this, therefore i decided to turn off the emerge-progress function.
I installed gnome by simply doing emerge gnome, however it did take a very long time to compile everything! I can run gnome by typing gdm. X runs on dispaly ALT-F7.
emerge 3ddesk (switch desktop with a fancy 3d animation)
Make sure you have DRM enabled in the kernel (character devices), MTTR support (processor type and features) and your correct chipset loaded under /dev/agpart (character devices). Then edit /etc/X11/xorg.conf so that load "dri", load "glx" have the correct device driver and enable the section "dri". See this guide for more details.
Gentoo on Quad Xeon:
I followed the same procudure as for the PIII machine above, however this time I performed a stage 1 install to obtain the best performance (as all system software is compiled from source with optimisation settings set for the xeon (p4) processor).
A few things to watch out for were:
ATI Mach 64 XL Graphics Card
When compiling the kernel, under Device Drivers - Graphics Support only select the ATI Mach64 display support as a module (otherwise the framebuffer does not seem to work).
SCSI
Compile in support to the kernel for Adaptec AIC 7XXX SCSI controller.
Mouse
To get mouse supported under X I had to do the following:
Type in 'ln -s /dev/psaux /dev/mouse'. That'll create a symlink called /dev/mouse that will point to /dev/psaux (Your PS/2 mouse).
UPDATE (06/11/05): I have found since performing an update the link is not maintained in the dev directory. Therefore I simply change the mouse device section of /etc/X11/xorg.conf from /dev/mouse to /dev/psaux.
Xconfig
Xorg -configure (auto configuration)
emerge sys-apps/ddcxinfo-knoppix
copy output from "ddcxinfo-knoppix -monitor" to /root/xorg.conf.new under monitor section
also add
"DefaultDepth 24" and Modes "1024x768" to relavent section
cp /root/xorg.conf.new /etc/X11/xorg.conf
Samba:
To enable samba access via smb:// in kde add samba to the USE variable in make.conf and emerge kdenetwork again. Also make sure you have samba support loaded as a module or compiled into the kernel.
To enable windows machines to access your samba shares here is an example configuration. Use "smbpasswd -a <user>" to generate the passwords for samba users. (These users must exist as unix users). The password file is located at /etc/samba/private/smbpasswd. If this file does not exist, create it manually.
[global]
workgroup = WORKGROUP
netbios name = quadxeon
name resolve order = lmhosts bcast
# hosts allow = 192.168.0. 127.
security = user
# interfaces = eth0
encrypt passwords = yes
smb passwd file = /etc/samba/private/smbpasswd
passdb backend = smbpasswd
preserve case = yes
default case = lower
load printers = no
[<user>home]
comment = <user> Home Dir
path = /home/<user>
valid users = <user>
public = no
writable = yes
printable = no
create mask = 0600
directory mask = 0700
XVnc:
I followed HOWTO Xvnc terminal server using realvnc (rather than tightvnc).
I set up a total of three VNC servers. The first two are started through xinetd.
Add the following to /etc/services:
nobodyvnc 5900/tcp
waitvnc 5901/tcp
Then put xvncserver in /etc/xinet.d/
Connecting to display 0 (port 5900) will result in the XDMCP login screen appearing. When the vnc session is closed the vncserver is killed and hence your session on the server is closed. Multiple connections can be made to this port as xinetd will spawn new vncserver's for each connection.
Connecting to display 1 (port 5901) will prompt for the vnc password defined in /root/.vnc/passwd. This can be set using the vncpasswd command (make sure you run it as the user you want to set the password for, e.g. root). Since wait=yes in the service desription held in xvncserver if you disconnect your vnc viewer the session will persist and applications will continue to run. You can reconnect at any time.
Under the user jws I changed the /home/jws/.vnc/xstartup file to this and set the password using vncpasswd. The xstartup file will load kde and start ktorrent. I also added jwsvncserver to the /etc/init.d directory. This allows the vnc server to be started and stopped using /etc/init.d/jwsvncserver start and /etc.init.d/jwsvncserver stop. Running rc-update -a jwsvncserver default will start the vncserver at boot time.
Connecting to display 11 (port 5911) will prompt for the vnc password defined in /home/jws/.vnc/passwd and then display the kde desktop which will have been running since boot time. This is useful if you want applications to start when the system is booted.
UPDATE:
Replacing VNC with TightVNC:
emerge --unmerge vnc
emerge tightvnc
remove "securitytypes=none" from /etc/xinetd.d/xnvcserver
I also added "-rfbwait 120000" as a server_args to both nobodyvnc and waitvnc services to allow time for the client to connect remotely.
Updating World:
After adding ACCEPT_KEYWORDS="~x86" to make.conf and performing:
emerge --update --newuse --deep world
I received an error:
!!! You need to use java-config to set your JVM to a JDK!
To fix this I performed the following:
#emerge --unmerge blackdown-jdk
#emerge --unmerge java-config
#emerge java-config
added nsplugin as a USE var to make.conf
#emerge blackdown-jdk
#etc-update && env-update
#source /etc/profile
Mutliple Displays:
Some links for investigating idea of displaying streaming video on a seperate dedicated monitor (or tv-out). May be problem with running multiple instances of Xorg /Xfree86 without patch. Also problem with multiple keyboards... Probably could use one server layout specifying one screen is to the right of another. Xinerama extension seems to provide multi-monitor support in the window manager, I guess without it you simply get seperate screens (acting like sepearte xservers). e.g localhost0:0 and localhost0:1.
Multiple local XFree users under Linux
XFree Local Multi-User HOWTO
HOWTO Dual Monitors
Colour ls:
put the following in .bashrc
eval `dircolors -b /etc/DIR_COLORS`
alias ls="ls --color=auto -lh"
XDMCP:
I use the display manager: gdm (set in /etc/rc.conf). To enable XDMCP to allow remote access:
edit /etc/X11/gdm/gdm.conf
Go to [xdmcp] section and change to Enable=true
You may also want to set:
RemoteGreeter=/usr/libexec/gdmlogin
Then perform a restart of gdm:
/etc/init.d/xdm restart
gdmsetup can also be used instead. This is a GUI interface for editing these settings.
Useful Commands:
Portage Related:
| emerge --sync |
update portage tree |
| emerge --update --deep --newuse world |
update entire system (if changed use vars) |
| emerge --depclean |
remove the conditional dependencies no longer needed |
| revdep-rebuild |
rebuild the applications that are dynamically linked against shared objects provided by possibly removed packages |
| equery uses <package> |
find what USE options are available on <package> (emerge gentoolkit first) |
| equery files <package> |
list files used by <package> |
| emerge --unmerge <package> |
uninstall package (use depclean etc. after). NOTE:
Portage will not check if the package you want to remove is required by another package |
| USE="-java" emerge mozilla |
USE as environment variable |
| emerge --info |
shows current USE vars |
| quickpkg |
create prebuilt package if package is already installed |
| emerge --buildpkg <package> |
build binary package and install (goes to
/usr/portage/packages) |
| emerge --buildpkgonly <package> |
build binary package only (goes to /usr/portage/packages) |
| emerge --usepkg --getbinpkg <package> |
install from binary package if possible, otherwise compile. The following needs to be set in /etc/make.conf
PORTAGE_BINHOST="ftp://buildhost/gentoo" |
| emerge --usepkgonly --getbinpkg <package> |
install from binary package only, otherwise produce error. |
| emerge -vp <package> |
check USE flags on a particular package |
| USE="..." emerge... |
set temporary USE flag |
| /etc/make.conf |
define global USE flags here |
| etc-update |
updates configuration files (if new ones need adding/altering after emerge, remeber not use the -mv i option when prompted if you do not want to overwrite some config files) |
| dispatch-conf |
use this instead of etc-update. It can update any scripts that have easy changes to comments, or that hasn't been changed between updates. It will display the diff of the config new and old files and give you options of how you would like them updated. Old config files are archived to /etc/config-archive |
| ACCEPT_KEYWORDS="~x86" |
put in make.conf to enable installation of masked packages. |
tail -n 10 -F /var/log/emerge.log
|
check progress of emerge |
Init Scripts:
| rc-update show |
show at what runlevel services load |
| rc-update add <service> default |
add <service> to run at default runlevel |
| rc-update del <service> default |
delete<service> to run at default runlevel |
| /etc/conf.d Directory |
each service has config file which you can set options in e.g.
APACHE2_OPTS="-D PHP4" |
| /etc/rc.conf |
global startup configurations file |
Network:
| /etc/conf.d/net |
network config file |
| /etc/hostname |
set hostname in this file |
| /etc/dnsdomainname |
set domainname in this file (
rc-update add domainname default) |
| /etc/resolv.conf |
set DNS server(s) in this file |
Modules:
| modprobe -l |
list available modules |
| /etc/modules.autoload.d/kernel-2.6 |
edit this file to add modules to load when the system starts |
| lsmod |
show loaded modules |
| find /lib/modules/<kernel version>/ -type f -iname '*.o' -or -iname '*.ko' |
show modules that have been compiled |
Kernel Recompile:
| cd /usr/src/linux
make menuconfig
make && make modules_install
|
change to kernel source directory
set kernel options
compile kernel |
| mount /dev/hda1 /boot |
mount boot partition if required |
| cp arch/i386/boot/bzImage /boot/kernel-2.6.11-gentoo-r11 |
copy kernel image |
| cp System.map /boot/System.map-2.6.11-gentoo-r11 |
copy System.map (contains symbols for kernel, e.g. where certain function are location in memory) |
| cp .config /boot/config-2.6.11-gentoo-r11 |
copy .config file for backup |
X11:
emerge xorg-x11
env-update
source /etc/profile
|
install xorg-x11 |
| Xorg -configure |
automatic configuration |
| X -config /root/xorg.conf.new |
test configuration |
| cp /root/xorg.conf.new /etc/X11/xorg.conf |
copy config file to default location |
| xorgconfig |
for manual setup |
| startx |
starts x and runs graphical applications on top of it as defined by:
.xinitrc (in home dir) or
XSESSION in /etc/rc.conf (will
execute one of the sessions available in /etc/X11/Sessions/ accordingly)
|
| export DISPLAY=0.0.0.0:0.0 |
Change to IP address of remote host if you want to change the Xserver from local to remote. |
| xhost + |
turn off access control on the xserver you are using. |
Environment Variables :
| env |
show current environment variables |
| /etc/env.d Directory |
contains files which define environment variables, these are applied by the env-update script. |
| env-update && source /etc/profile |
updates the environment immediately (env-update updates /etc/profile with new environment variables, source reloads system profile) |
Hardware:
| lspci |
list installed pci devices |
| lshw |
show hardware information |
Graphics - Framebuffer:
| fbset |
show the current framebuffer resolution. |
Screen:
Screen allows for multi-window terminals, it allows detaching and reattaching and also shared viewing of screens.
| screen -r |
reattach to a detached screen |
| screen -x |
shared view of a screen |
| <C>a " |
show list of windows |
| <C>a c |
create new window |
| <C>a n |
next window |
| <C>a p |
previous window |
| <C>a a |
last window |
| <C> a d |
detach window |
| <C>a <num> |
view window number <num> |
| <C> a <C>t |
show system info |
| <C> a <C> \ |
kill all windows and quit screen |
| <C> a : |
command mode |
| <C> a k |
kill current window |
| <C> a i |
show info about current window |
Misc:
| tail -n 10 -F <file> |
show the last 10 lines of <file> and update screen when it changes. |
watch -n 3 -d ls -l
|
watch the contents of current directory (ls -l), highlight changes (-d) and refresh every 3 secs (-n 3) |
Misc Links:
Daves World - How to use SSH without passwords (use authorized keys)
|