Gentoo

Kernel

Rebuild Kernel

I use this way now it seems to work better than Gentoo docs
# cd /usr/src/linux
# make clean
# make
# make install

Kernel modules

Find all modules
# find /lib/modules/<kernel version>/ -type f -iname '*.o' -or -iname '*.ko

List installed kernel modules
# lsmod Load kernel modules
# modprob modulename

Load kernel modules at boot time
# nano -w /etc/modules.autoload.d/kernel-2.6

I do not do it this way anymore
Recompile the kernel which has to be done alot in gentoo
# genkernel --menuconfig all

Recompile regular kernel
# make menuconfig
# make && make modules_install

World

Update the whole world

# emerge --sync
# emerge --update --deep --newuse world
# emerge -P --depclean you should run with the -p option first
# revdep-rebuild

Use this to update the protected /etc directory
# dispatch-conf

Packages

Basic emerge config and commands

Create these to install blocked and masked packages
# mkdir /etc/portage
# touch /etc/portage/package.keywords
# touch /etc/portage/package.unmask
# touch /etc/portage/package.mask
# touch /etc/portage/package.use

Update Packages
# emerge --sync

Search for packages # emerge --search pdf or # emerge --searchdesc pdf

Add packages
# emerge -va packagename or # emerge -p packagename

Remove packages
# emerge -unmerge packagename

Emerge with use flags
USE="-java" emerge seamonk

Update packages
see World or

Some Specific Packages

Zoneminder

Moving events DIR
Stop ZM
mv /var/www/html/zm/events /opt or what ever your mount point is.
ln -s /opt/events /var/www/html/zm/events
Check the you can still view existing events both stream and stills. Other wise stop here and find your permission problem (check all your logs for errors, including Apache)
Once the previous step works, start ZM.

cd /usr/src/linux
make menu config
add"Multimedia Devices", "Video 4 Linux" and some usb cams maybe?
make && make modules_install

add these to /etc/make.conf
mysql sockets apache2

add this to /etc/portage.unmask
www-misc/zoneminder
dev-perl/PHP-Serialization

emerge zoneminder

# /etc/init.d/apache2 start
# /usr/bin/mysql_install_db
# /etc/init.d/mysql start
# /usr/bin/mysqladmin -u root -h localhost password 'setapassword'
# mysql mysql -p
mysql > grant select,insert,update,delete on zoneminder.* to 'zm'@localhost identified by '22vu22';
mysql>exit

# mysqladmin -p restart
vim /etc/zm.conf change what needs to be changed
# rc-update add apache2 default
# rc-update add mysql default
# rc-update add zoneminder default

postfix

# vim /etc/mail/aliases
# /usr/bin/newaliases
add this line to main.cf
relayhost = [mx1.hostname.tdl]:325
# /etc/init.d/postfix start
# rc-update add postfix default
Also mailx must be installed for zm to send mail
# emerge mailx

Mondo Rescue
mondoarchive -OVi -d /usr/backups/mondo -E '/usr/backups/mondo /usr/backups/mondo' -p `hostname`-`date +%Y-%m-%d` ALSO you need to edit this for networking to work on new system ?? vim /etc/udev/rules.d/70-persistent-net.rules

Setup some stuff

USE VARIABLES

My current use variables

 

Some of the use variables suggested for zoneminder

a52 aac encode ieee1394 imlib ogg sdl theora truetype v4l vorbis x264 xvid aalib alsa fbcon flac ggi libcaca bzip2 gif jpeg jpeg2k mp3 png tiff mpeg vhosts

USE variables for media-video/ffmpeg

a52 - Enables support for decoding ATSC A/52 streams used in DVD
aac - Enables support for MPEG-4 AAC Audio
encode - Adds support for encoding of audio or video files eee1394 - Enable FireWire/iLink IEEE1394 support (dv, camera, ...)
imlib - Adds support for imlib, an image loading and rendering library
ogg - Adds support for the Ogg container format (commonly used by Vorbis, Theora and flac)
sdl - Adds support for Simple Direct Layer (media library)
theora - Adds support for the Theora Video Compression Codec
truetype - Adds support for FreeType and/or FreeType2 fonts
v4l - Enables video4linux support
vorbis - Adds support for the OggVorbis audio codec
x264 - Enable h264 encoding using x264
xvid - Adds support for xvid.org's open-source mpeg-4 codec

USE variables for media-libs/libsdl

aalib - Adds support for media-libs/aalib (ASCII-Graphics Library)
alsa - Adds support for media-libs/alsa-lib (Advanced Linux Sound Architecture)
fbcon - Adds framebuffer support for the console, via the kernel
flac - Adds support for the flac audio codec
cgi - Adds support for media-libs/libggi (non-X video api/drivers)
libcaca - Add support for colored ASCII-art graphics

USE variables for media-libs/imlib2

bzip2 - Use the bzlib compression library
gif - Adds GIF image support
jpeg - Adds JPEG image support
jpeg2k - Support for JPEG 2000, a wavelet-based image compression format
mp3 - Add support for reading mp3 files tiff - Adds support for the tiff image format

USE variables for www-misc/zoneminder

mpeg -Adds libmpeg3 support to various packages
vhosts - Adds support for installing web-based applications into a virtual-hosting environment

USING DUMP

 

#sbin/dump -0 -j -f /backuplfs.dump /dev/sda3

 

Go to the root directory


#restore rf /backuplfs.dump


 

You can often find out how much shared memory is available by typing the following :- cat /proc/sys/kernel/shmall and the most you can allocate in one go :- cat /proc/sys/kernel/shmmax To change these values type (for example) :- echo 134217728 >/proc/sys/kernel/shmall echo 134217728 >/proc/sys/kernel/shmmax However be aware that sometimes you will only need to change the shmmax value as shmall is often large enough. Also changing these values in this way is only effective until your machine is rebooted. To change them permanently you will need to edit /etc/sysctl.conf and add the following lines (for example) :- kernel.shmall = 134217728 kernel.shmmax = 134217728 Which will enforce the changes the next time your machine is restarted.

Networking
# /etc/conf.d/net
config_eth0=( "192.168.1.202 netmask 255.255.255.0 broadcast 192.168.1.255" )
routes_eth0=( "default gw 192.168.1.1" )
# /etc/resolv.conf
nameserver 192.168.1.1
Stolen from here http://www.gentoo-wiki.info/HOWTO_static_ip_with_dhcp_router

lvextend -L +1G /dev/VolGroup00/LogVolVMWareXP
# resize2fs /dev/VolGroup00/LogVolVMWareXP