QUICK and DIRTY Gentoo installation guide

Installation of Gentoo

#FDISK PARTITIONS / SET INSTALLATION VARS
fdisk/cfdisk your disk


echo MOUNTING INSTALL DIR;
mount /dev/sda1 /mnt/gentoo;

# GET STAGES LAN / INET
cd /mnt/gentoo
# WGET STAGES INET
wget http://gentoo.osuosl.org/snapshots/portage-latest.tar.bz2;
wget http://gentoo.osuosl.org/releases/amd64/current-iso/stage3-amd64-20141204.tar.bz2

#LAN
echo MOUNT NETWORK DOLFIJN;
mkdir -p /mnt/gentoo/lan/Cat; mount //192.168.1.200/Media /mnt/gentoo/lan/Cat -o username=HATHISISSECRET,password=HATHISISSECRET;

cd /mnt/gentoo;
cp -v /mnt/gentoo/lan/Cat/software/Gentoo/stage3-*.bz2 /mnt/gentoo; echo copied;
cp -v /mnt/gentoo/lan/Cat/software/Gentoo/portage-latest.tar.bz2 /mnt/gentoo; echo copied;

#UNTAR STAGES / PORTAGE
    cd /mnt/gentoo;

tar xjpf stage3-*.bz2; echo untarred stage;
tar xjf portage-latest.tar.bz2 -C /mnt/gentoo/usr; echo untarred latest portage



#CHROOT IN YOUR NEW ENV
cp -L /etc/resolv.conf /mnt/gentoo/etc/;
mount -t proc none /mnt/gentoo/proc;
mount --rbind /sys /mnt/gentoo/sys;
mount --rbind /dev /mnt/gentoo/dev;
chroot /mnt/gentoo /bin/bash;
echo chrooted in new env

# SET COMPILE PROFILE + CLOCK
env-update; source /etc/profile;
echo env updated;
emerge --sync; eselect profile set 3;
echo profile set to desktop;
cp /usr/share/zoneinfo/Europe/Amsterdam /etc/localtime;
echo time set to amsterdam;
mkdir /mnt/portage; echo hostname="Edge" > /etc/conf.d/hostname;
echo hostname set to Edge;
passwd;


#MAKE.CONF
nano /etc/protage/make.conf
# GET CPU FLAGS
cat /proc/cpuinfo | grep flags

#PORTAGE RAM TWEAK
PORTAGE_TMPDIR= /mnt/ram/
echo tmpfs                   /mnt/ram        tmpfs  size=10G >> /etc/fstab;
mount /mnt/ram

#EXTRA
MAKEOPTS="-j12"
FEATURES = "parallel-fetch parallel-install"
VIDEO_CARDS="nvidia"





# EMERGE BASIC CONTENT
emerge -j8 portage; emerge -vtq -j8 gentoo-sources genkernel dhcpcd;
rc-update add sshd default; rc-update add dhcpcd default;

# RAID SOFTWARE/HARDWARE
emerge mdadm dmraid;
rc-update add mdadm boot;
mdadm --detail --scan >> /etc/mdadm.conf


# EXTRA SETUP EMAIL ALERT
http://ubuntuforums.org/showthread.php?t=1185134
   



# KERNEL

# KERNEL MANUAL
ls -l /usr/src/linux;
cd /usr/src/linux;
make menuconfig;


make -j8 && make modules_install;
make install;
*cp arch/i386/boot/bzImage /boot/kernel-2.6.17-gentoo-r5


# GENKERNEL AUTOMATIC
genkernel all --menuconfig --makeopts=-j10
genkernel --menuconfig --dmraid all --makeopts=-j10




# GRUB THE BOOTLOADER
emerge sys-boot/grub:0;
nano /etc/fstab; mount /boot; ls /boot; nano /boot/grub/grub.conf


grub-install --no-floppy /dev/sda

# error ? df: Warning: cannot read table of mounted file systems
grep -v rootfs /proc/mounts > /etc/mtab












#XORG
emerge x11-base/xorg-drivers; Xorg -configure && cp /root/xorg.conf.new /etc/X11/xorg.conf

sqlite threads icu




# QUICK AND DIRTY SAMBA SHARE
http://www.linux.com/learn/tutorials/305771-quick-and-dirty-samba-setup

emerge samba
smbpasswd -a root

### smb.conf
# Global parameters
[global]
       workgroup = Oldowan
       netbios name = Alf
       server string = Samba Server %v
       map to guest = Bad User
       log file = /var/log/samba/log.%m
       max log size = 50
       socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192
       preferred master = No
       local master = No
       dns proxy = No
       security = User

# Share
[Data]
       path = /disk2/data
       valid users = Oldowan
       read only = No
       create mask = 0777
       directory mask = 0777









# MAINTAINENCE
/var/lib/portage/world geinstalleerde programma’s die gentoo moet behouden
emerge --depclean -vp
gooi alle pakketen die niet gebruikt worden door deze lijst er uit

#CLEANUP GENTOO
If you wish to see the list of installed packages sorted in ascending order by the amount of space they take: qsize -a -k | sort -n -k 6
remove “unneeded” packages, DONT DO THIS ON A PRODUCTION MACHINE
emerge --depclean -p shows a list of packages going to be removed.\

# SOFTWARE INSTALL

#OPTIONAL SOFTWARE INSTALL HELP FOR HOSTERROR
nano /etc/hosts
192.168.1.75 Lap.Oldowan Lap

http://forums.gentoo.org/viewtopic.php?p=519288
sys-libs/libselinux ( needed for icons )




# INSTALL MAYA
emerge -1 tiff libpng:1.2 openssl tcsh fam rpm2targz x11-libs/libXp tiff nvidia-cg-toolkit liberation-fonts font-adobe-75dpi font-adobe-100dpi ;
flexlm
#MAIN SETUP FIL
tar -xzf autodesk_maya_2012_hotfix1_linux_64bit.tgz ;

rpm2targz Maya2011_0_64-2011.0-372.x86_64.rpm ;
rpm2targz adlmapps*.rpm ;
tar -xzf Maya2012_0_64-2012.0-203.x86_64.tar.gz -C / ;
tar -xzf adlmapps*.tar.gz -C / ;

cd /usr/lib64 &&  ln -s libtiff.so libtiff.so.3 &&  ln -s libssl.so libssl.so.6 && ln -s libcrypto.so libcrypto.so.6 ;

ln -s /usr/autodesk/maya2015-x64/bin/maya2015 /usr/local/bin/Maya ;
ln -s /usr/autodesk/maya2015-x64/bin/fcheck /usr/local/bin/ ;
ln -s /usr/autodesk/maya2015-x64/bin/imgcvt /usr/local/bin/ ;
ln -s /usr/autodesk/maya2015-x64/bin/Render /usr/local/bin/ ;




mv /usr/autodesk/maya2012-x64/lib/libadlmint.so.4.0.35 /usr/autodesk/maya2012-x64/lib/libadlmint.so.4.0.35_backup
 cp ./libadlmint /usr/autodesk/maya2012-x64/lib/libadlmint.so.4.0.35

# Broken libaries
ln -s /usr/lib/libssl.so.0.9.8 /usr/lib/libssl.so.10
n -s libcrypto.so.1.0.0 /usr/lib64/libcrypto.so.10

# install licence only by ./setup
   





# SOFTWARE RAID
mdadm --stop /dev/md0
mdadm --assemble /dev/md0 /dev/sda1 /dev/sdb1
mdadm --detail --scan
 mdadm --detail --scan >> /etc/mdadm/mdadm.conf

# RAID 5 with 4 DISKS
  mdadm --create --verbose /dev/md0 --level=5 --raid-devices=4 /dev/sdb1 /dev/sdc1 /dev/sdd1 /dev/sde1

#SEE STATUS
 cat /proc/mdstat

CANT FIND SAS DRIVERS? USE GENKERNEL

# Software Raid assemble
mdadm --stop /dev/md127
mdadm --assemble /dev/md1 /dev/sda1 /dev/sdb1

# REMOVE META PACKAGES
# generate a list of gnome-base packages you have installed
basepack=gnome-base && eix -C $basepack --only-names --installed && emerge -C `eix -C $basepack --only-names --installed`

revdep-rebuild

# Trash module missing kde\dolphin also provides smb
kde-base/kioslaves kde-base/kpasswdserver libsmbclient net-fs/samba


http://urukrama.wordpress.com/openbox-guide/









#REVIST YOUR INSTALLATION ( CHROOTINGS ) if something goes wrong like forgot to install the raid drivers :)
mount /dev/sda1 /mnt/gentoo && 
mount -t proc none /mnt/gentoo/proc &&
mount --rbind /sys /mnt/gentoo/sys &&
mount --rbind /dev /mnt/gentoo/dev && chroot /mnt/gentoo /bin/bash

# OPTIONAL EMERGE BASIC APPLICATIONS ( takes a while )
emerge -j6 xfce4-cpugraph-plugin xfce4-terminal geany vlc www-client/firefox file-roller libreoffice-bin app-emulation/wine xf86-input-wacom qpdf qpdfview smplayer htop kde-base/filelight

# OPTIONAL DISTCC
USE='-*' emerge sys-devel/distcc; rc-update add distccd default; echo “192.168.1.100/16,cpp,lzo”  > /etc/distcc/hosts;

echo DISTCCD_OPTS="${DISTCCD_OPTS} --allow 192.168.1.0/24" > /etc/conf.d/distccd;
echo DISTCCD_OPTS="${DISTCCD_OPTS} --port 3632" >> /etc/conf.d/distccd;
 
#OPTIONAL SSH AUTOMATION
ssh-keygen -t dsa
cat .ssh/id_rsa.pub | ssh root@192.168.1.100 'cat >> .ssh/authorized_keys'

# OPTIONAL MUTE ANNOYING CONSOLE BEEPS
echo 'set bell-style none' >> ~/.inputrc && xset b off && setterm -blength 0

# AFTER INSTALL ADD LAN MOUNTS TO FSTAB
//192.168.1.200/Media   /mnt/lan/Dolfijn        cifs    username=HATHISISSOSECRET,password=HATHISISSOSECRET        0 0

#STATIC NETWORK
nano /etc/conf.d/net
config_enp9s0=( "192.168.1.75 netmask 255.255.0.0" )
routes_enp9s0=( "default gw 192.168.1.1" )
dns_servers_enp9s0=( "192.168.1.1" )

cd /etc/init.d
ln -s net.lo net.enp8s0
rc-update add net.enp8s0 default

#ifconfig for card name
# cd /etc/init.d
# ln -s net.lo net.enp8s0
# rc-update add net.eth0 default

 If you have several network interfaces, you need to create the appropriate net.* files just like you did with net.eth0.

If you later find out the assumption about the network interface name (which we currently document as eth0) was wrong, then

    update the /etc/conf.d/net file with the correct interface name (like enp3s0 instead of eth0),
    create new symbolic link (like /etc/init.d/net.enp3s0),
    remove the old symbolic link (rm /etc/init.d/net.eth0),
    add the new one to the default runlevel, and
    remove the old one using rc-update del net.eth0 default.

#BUGS / ANNOYING STUFF

 


#KRUSADER NO COPY POPUP
emerge kdebase-runtime-meta

   
   
#UDEV BLOCKS ITSELF,
emerge udev

# MOUSE WONT WORK
Add to the xorg.conf file in the serverlayout
option "AutoAddDevices" "false"
option "AllowEmptyInput" "false"

# MOUSE / KEYBOARD STOPPED WORKING
emerge -av1 $(qlist -I -C x11-drivers)

#LANMOUNT ERROR 13
Since 3.8 update no longer support for ntlm.
As a workaround, add "sec=ntlm" to your mount options.

Here is my mount:
mount -t cifs //192.168.1.5/share /mnt/share -o nosuid,nodev,sec=ntlm,workgroup=WORKGROUP,ip=192.168.1.5

#TIPS/TWEAKS

#AUTOSTART PROFILE.D
Each time /etc/profile is executed, it sources the following scripts if they exist
/etc/profile.d/*.sh

 

#AUTOSTART AT SYSTEM BOOT

chmod +x /etc/init.d/start_my_app
if this does not run you have to create a symlink to /etc/rc.d/
ln -s /etc/init.d/start_my_app /etc/conf.d/
dont forget #!/bin/sh

 



#AUTOSTART AT BOOT
place sh files in /etc/profile to start them automaticly at boot of the linux workstation.

#HARDWARE RAID
http://en.Gentoo-wiki.com/wiki/RAID/NVRAID_with_dmraid

#VLC AS ROOT
./configure --enable-run-as-root --prefix=/opt/vlc



#DISTCCD
distcc-config --set-hosts "192.168.1.100,cpp,lzo 192.168.1.250,cpp,lzo 192.168.1.50,cpp,lzo"
DISTCC_DIR="/var/tmp/portage/.distcc/" distccmon-text 1

    #SWAPPINESS TWEAK
sysctl -w vm.swappiness=0

#AUTOLOGIN TO TERMINAL
/etc/inittab
# TERMINALS
c1:12345:respawn:/sbin/agetty -a username --noclear 38400 tty1 linux
c2:2345:respawn:/sbin/agetty 38400 tty2 linux
c3:2345:respawn:/sbin/agetty 38400 tty3 linux
c4:2345:respawn:/sbin/agetty 38400 tty4 linux
c5:2345:respawn:/sbin/agetty 38400 tty5 linux
c6:2345:respawn:/sbin/agetty 38400 tty6 linux

#AUTOSTART SCRIPTS
make in /etc/profile.d/ a .sh script with what you want to start ( counts for all users )

#CHECK WHAT HARDWARE YOU HAVE?
sys-apps/lshw
hwinfo


#CGRU ADD TO INITSCRIPTS
 ./initlinks.sh c add afserver