Thursday, 12 July 2012

gentoo notes

Notes from gentoo handbook

Search by pkg name
emerge --search
Search by desc
emerge --searchdesc
dry run
emerge --pretend
fetch only
emerge --fetchonly
   This downloads the pkg in /usr/portage/disfiles/. Even the ones which you install are downloaded here and later compiled and installed. Fetchonly downloads but doesnt install.
Query which pkg a file belongs to or which are files provided by the pkg, intall app-portage/gentoolkit and run
equery files
remove a pkg
emerge --unmerge
  This does not remvoe dependencies or warn if it is a dependency. Removing is messy, try and avoid it.
update the entire system
emerge --update --deep --with-bdeps=y --newuse world

SLOTS : are mechanism to allow different ver of same pkg to be installed. The pkg name remains same. The slot is used to differentiate them.
virtuals : are place holder pkgs. for example logger is virtual which is provided to pkges with dependency on logging functionality. This logger virtual can be syslog-ng or ksyslogd, etc.

If you get masked error msg when installing a pkg. Try to get another pkg with same functionality. This pkg has been masked for not suiting your profile or breaking some functionality

use flags can be specified in global loc. /etc/make.conf or in pkg individual loca. /etc/portage/package.use

services are started and stopped via scripts in /etc/init.d/ . it also accepts addition arguments like zap, pause, ineed.
zap resets the current state of the process to stopped
where action = add or del (both are keywords and self explanatory)
service = eg. httpd sendmail, etc
runlevel = mostly this "default"

rc-update -v show :- shows services details like what is starting on what runlevel etc.

gentools provide equery, which you can use to query packages. It accepts wildcard characters, but as usual they must be qouted to prevent shell messing it up.
equery list pkg :- will tell you if pkg is installed on the pc or not.
equery belongs -e /path/to/file :- will tell you which packages the file belongs to. -e option tells equery to stop searching on first match, which is what you would usually want. I dont like one package file belonging to multiple pkgs.
equery files pkg :- gives list of files belonging to the pkg.

There is another tool called q which does the functionalities provided by equery in a much more efficent and faster way. It is a part of portage-utils. But i have postponed learning it for another day, the day when i think equery is limiting for me.

I found that certain utility like emerge will stop giving coloured output when the output device is not tty. So if you do emerge --search pkg | less then less will show colour less output. But it is not less fault. less is capable of showing color. The fix to this is pass the optiion --color=y to emerge.

I see that there are alternatives to emerge --search and portage itself. eix will do the emerge's search but more efficiently. But emerge has evolved since the days when eix solved the problem. Similarly is the case with paludis, but here it is for portage.

sudo hints

I found that you can extend sudo time with sudo -v and you can cancel sudo time with sudo -k. By sudo time, i mean the time duration between subcequent sudo command that dont require you to re-enter sudo password. Usualy this time is 5 mins.

Thursday, 5 July 2012

linux kernel options search

When you compile linux kernel through make menuconfig , you get drowned with options. Suppose you are looking for specific option, but you dont know much about that option and hence you dont know under which category it will come. This happened for me when i knew ssb has to be disable through my google search but didnt know much about it so didnt know under which options it will come under. Then i found this interesting information.You can type a slash (/) to make a search for the option you are looking for and it will give many details about matching module. So when i did / and ssh it gave a list of all portions of menuconfig page where the word ssb apear. Pretty useful and neat trick.

facebook , twitter and blogs

I realised that blogs are here to stay. I thought maybe with the advent of facebook and twitter, blogs may be get diminished. But no i was wrong. Facebook and twitter does not fulfil the purpose which blogs does. Which is blogs exists for lengthier explanation of a idea or a story, which fb and twitter are never meant to do.