Tuesday 18 February 2014

Installing and maintaining Gentoo box


1. Touch excursion from nonmultilib to multilib (2013)
After installed gentoo into T5500 machine, I found there are several problem that the system can not handle:

 a. three files can not be updated: (a) sandbox (b) glibc (c) gcc. all of the three are said to be updated due to enabled multilib. once glibc failed, it says stub, x86 compile failed
 b. skype can not be opened up, even if it is properly well installed.
 c. the opensource virtualbox can not be compilled. only the binary version can be installed
 The reason of having this problem, is because the base system I installed is non-multilib. It is found from many websites that changing from non-multilib to multilib is very difficult. The easist way to solve this problem is to reinstall gentoo using another stage3 tarball Although some peole say one can establish another glibc from scratch, this may lead to the problem very complex finally.

2.  can not properly disable nouveau driver
   After the system installed in chroot stage, systemd can not be properly booted, mainly due to two symptons:
a. The running text shows that nouveau has been loaded
b. The systemds hangs at the stage where the following lines are repeatedly showing up:
Jun 4 03:16:56 histon kernel: [ 1067.937418] NVRM: The NVIDIA probe routine was not called for 2 device(s). 
Jun 4 03:16:56 histon kernel: [ 1067.937424] NVRM: This can occur when a driver such as nouveau, rivafb, 
Jun 4 03:16:56 histon kernel: [ 1067.937426] NVRM: nvidiafb, or rivatv was loaded and obtained ownership of 
Jun 4 03:16:56 histon kernel: [ 1067.937428] NVRM: the NVIDIA device(s). 
Jun 4 03:16:56 histon kernel: [ 1067.937432] NVRM: Try unloading the conflicting kernel module (and/or 
Jun 4 03:16:56 histon kernel: [ 1067.937434] NVRM: reconfigure your kernel without the conflicting 
Jun 4 03:16:56 histon kernel: [ 1067.937435] NVRM: driver(s)), then try loading the NVIDIA kernel module 
Jun 4 03:16:56 histon kernel: [ 1067.937437] NVRM: again. 
Jun 4 03:16:56 histon kernel: [ 1067.937439] NVRM: No NVIDIA graphics adapter probed! 
    This is probably due to the reason that nouveau has been loaded before nvidia driver starts to load. The following steps can solve this problem:

a. make sure nouveau is disabled by running
# echo "blacklist nouveal" >> /etc/modprobe.d/blacklist.conf
b. make sure that xorg-drivers has nvidia enabled:

 [ebuild   R    ] x11-base/xorg-drivers-1.14  INPUT_DEVICES="evdev keyboard mouse -acecad -aiptek -elographics -fpit -hyperpen -joystick -mutouch -penmount -synaptics -tslib -vmmouse -void -wacom" VIDEO_CARDS="nvidia -apm -ast -chips -cirrus -dummy -epson -fbdev -fglrx (-geode) -glint -i128 (-i740) -intel -mach64 -mga -modesetting -neomagic -nouveau -nv (-omap) (-omapfb) -qxl -r128 -radeon -radeonsi -rendition -s3virge -savage -siliconmotion -sisusb (-sunbw2) (-suncg14) (-suncg3) (-suncg6) (-sunffb) (-sunleo) (-suntcx) -tdfx -tga -trident -tseng -v4l -vesa -via -virtualbox -vmware (-voodoo)" 0 kB
c. follow the instuctions listed in these websites:
http://wiki.gentoo.org/wiki/X_server
https://wiki.gentoo.org/wiki/NVidia/nvidia-drivers
https://wiki.gentoo.org/wiki/Xorg/Configuration

d. copy xorg.conf into /etc/X11/xorg.conf.d

Then it should be working

3.  common packages required to be installed

# emerge -av --keep-going xorg-server xorg-drivers media-libs/mesa systemd i3lock i3   emacs  rxvt-unicode skype dropbox gnome nvidia-drivers scrot xorg-server xorg-drivers vlc mplayer gimp inkscape fuse htop adobe-flash alsa-utils  gnumeric  virtualbox-guest-additions i3status openssh rdesktop sshfs-fuse R mercurial ranger cmus ntfs3g feh mupdf exiftool ifuse gentoolkit dev-python/pip id3 id3v2 cdparanoia abcde virtualbox-extpack-oracle texlive dvipng dvisvgm texlive-latexextra  matplotlib eix openmpi hdf5 paraview gdb p7zip gv openntpd exiftool screen
4. files required to backup
/etc/portage/{make.conf, package.use,package.keywords}
/usr/src/linux/.config
/etc/fstab

5. webkit-gtk is time consuming to emerge
In my laptop, installing webkit-gtk can take ages, to avoid that, I decided not emerge this atom. First, I have checked the atoms that are dependent on webkit-gtk. i.e.,

query depends webkit-gtk

emerge -C gnome-extra/gnome-documents-3.8.5 gnome-extra/sushi-3.10.0 gnome-extra/yelp-3.8.1 gnome-extra/zenity-3.8.0 media-gfx/gimp-2.8.10-r1 media-gfx/shotwell-0.15.1 media-sound/rhythmbox-3.0.2 net-im/empathy-3.8.6 net-libs/gnome-online-accounts-3.10.4 net-libs/libproxy-0.4.11-r1 webkit-gtk

6. list of useful binary package
It is very time consuming to install all the package in source form. To make sure the labtops can be able to enjoy gentoo, I have listed all the useful binary package so that the compilling time can be reduced significantly.
google-chrome firefox-bin libreoffice-bin thunderbird-bin virtualbox-bin icedtea-bin openfoam-bin
7. locations where files should be cleaned
This is the location where source file are downloaded

/usr/portage/distfiles
or clean distfiles using the following command directly.
# eclean-dist
See a list of installed package by their size:
# qsize -a -k | sort -n -k 6
8. get ip address for enp6s0
# dhcpcd enp6s0
or
# dhclient enp6s0
9. change emul-linux to abi (2015-06-22)
Users should be find that emul-linux is gone, what replaces it is abi.
https://wiki.gentoo.org/wiki/Multilib_System_without_emul-linux_Packages
https://forums.gentoo.org/viewtopic-p-7728476.html?sid=54b9db45ef48cc2eb46dd4f79c9c08e8

two more useful links:
1. https://forums.gentoo.org/viewtopic-t-984500-highlight-ffmpeg.html
abi_x86_32 disabled.

2. https://forums.gentoo.org/viewtopic-t-1020872-highlight-.html
never try to globalize abi_x86_32

useful commands:
find all packages that are dependent on EMUL
root #for EMUL in $(eix -I --only-names emul-linux); do equery depends $EMUL; done
10. keep kernels in the eselect kernel lists (2015-06-22)
One may notice that once emerge -depclean, all the non-listed kernels are gone (one can not make it anymore like 3.10.25 in the laptop).

related:
https://forums.gentoo.org/viewtopic-p-7696064.html#7696064
#emerge --noreplace =gentoo-sources-3.17.8-r1
after running this command, the select atom is add in world set (/var/lib/portage/world) so that emerge --depclean is not going to wipe it off.
11. Problem when using emerge @presserved-rebuild (2015-06-22)
Assuming there is one package in preserved library deleted, the box will produced error when running emerge @presserved-rebuild. The way to delete it is to mannually delete the associated files:
portageq list_preserved_libs /
related:
https://wiki.gentoo.org/wiki/Preserve-libs
https://forums.gentoo.org/viewtopic-t-959998-start-0.html
12. Remove all gnome, kde associated packages. (2015-06-22)
The reason to do so is to make the system compact so that any computer is able to install gentoo.
(1) add -gnome -kde in /etc/make.conf  (it seems there is no flags for lxde and xfce)
(2) Change profiles
eselect profile list
(3)un
emerge -C $(grep gnome /var/lib/portage/world)
also find all installed package associated with gnome and perhapse uninstall all of them.
equery list "*" | grep gnome
Related Links:
https://forums.gentoo.org/viewtopic-t-850239-start-0.html
https://wiki.gentoo.org/wiki/KDE/Removal
13. Check use flags of a package (2015-06-22)
find the use flags
equery uses gnumeric
find the dependency conditions
equery depends gnumeric
all packages associated with gnome

equery list "*" | grep gnome
other infomation

equery 
get all installed package

equery list "*" >> installed
so far i have got 926 on 2015-06-22. try to reduce it.
                         895 for toshiba
equery has bindist
list all the packages that has bindist flag (whether it is enabled or not) 
14. use distcc (2015-06-26)
see the list of compile machines.
distcc-config --get-hosts
list all the packages that has bindis
https://forums.gentoo.org/viewtopic-p-7207506.html
15. a correction to my method of using bash (2015-06-27)
https://forums.gentoo.org/viewtopic-t-1020878-highlight-.html
16. How to properly update a kernel(2015-06-27)
at the moment 4.0.5 is not working on T5500. the reason is that nvidia-drivers (bloody nvidia drivers has to be emerged every single time https://forums.gentoo.org/viewtopic-t-996602-highlight-nvidia.html) are not able to be installed. even i have followed:
https://forums.gentoo.org/viewtopic-p-7766108.html?sid=f4c9970e533b6bf99b7450aa1e9e89b4
it is still not working, anyway.
17. Solving no mouse problem on toshiba laptop [unsloved](2015-06-27)
question posted:
https://forums.gentoo.org/viewtopic-t-1020934-highlight-.html
18. Control tty (2015-06-27)
following:
http://superuser.com/questions/67659/linux-share-keyboard-over-network
do on user machine (client)
cat /dev/input/by-path/pci-0000:00:1a.0-usb-0:1.1:1.0-event-kbd | nc 10.33.21.70 4444
and
nc -l -p 4444 > /dev/input/by-path/platform-i8042-serio-0-event-kbd
on host, then you are able to control tty perfectly.

lsusb -t
qca failed
/var/log/portage/app-crypt:qca-2.1.0.3:20150628-000221.log

list all the running modules
cat /proc/modules

ae429-3176 proc # cd /lib/modules/4.0.5-gentoo/kernel/drivers/hid/
ae429-3176 hid # ls
hid-logitech-dj.ko  hid-logitech-hidpp.ko  uhid.ko

modinfo hid-logitech-hidpp

uqczhan2@macondo03 ~ $ lsmod |grep hid
mac_hid                13253  0
hid_generic            12548  0
usbhid                 53111  0
hid                   106605  2 hid_generic,usbhid

https://forums.gentoo.org/viewtopic-t-883988-highlight-keyboard.html

 qlist -IC x11-drivers

working 3.10.25
ae429-0176 chenming # dmesg |grep Logitech
[    2.760539] usb 4-1: Manufacturer: Logitech
[    2.769325] input: Logitech USB Receiver as /devices/pci0000:00/0000:00:12.0/usb4/4-1/4-1:1.0/input/input5
[    2.770902] hid-generic 0003:046D:C52F.0001: input,hidraw0: USB HID v1.11 Mouse [Logitech USB Receiver] on usb-0000:00:12.0-1/input0
[    2.779733] input: Logitech USB Receiver as /devices/pci0000:00/0000:00:12.0/usb4/4-1/4-1:1.1/input/input6
[    2.783405] hid-generic 0003:046D:C52F.0002: input,hiddev0,hidraw1: USB HID v1.11 Device [Logitech USB Receiver] on usb-0000:00:12.0-1/input1
[    2.829659] input: PS/2 Logitech Wheel Mouse as /devices/platform/i8042/serio1/input/input7

not working case 3.17.??
dmesg |grep Logitech
[    2.515042] input: PS/2 Logitech Wheel Mouse as /devices/platform/i8042/serio1/input/input6

currently i can use
shift+insert to paste things on commandline