Submitted by wh5a on Wed, 12/24/2008 - 18:38.
Useful tools
gentoolkit
portage-utils
sunrise
/usr/portage/profiles/use.desc
/usr/portage/profiles/use.local.desc
Autostart programs
Edit /etc/conf.d/local or /etc/conf.d/local.start.
For agetty, use "-l" to change the login program, and "-n" to avoid prompting for username.
For the custom login program, use "exec login -f username"
Wireless network
In the kernel, enable ipw2200 support. Then emerge ipw2200-firmware. You should NOT build ipw2200 into the kernel. Because it looks for the firmware on the file system, which is not ready yet. See the documentation when you config the kernel. It's easiest to build it as a module. Or, you can use an initramfs.
Udev obsoletes hotplug/coldplug, so you don't need them.
After the driver is installed, just emerge wpa_supplicant and edit your /etc/wpa_supplicant/wpa_supplicant.conf. Everything else should be taken care of automatically.
Portage tips
Exclude packages
http://www.gentoo-wiki.info/HOWTO_Create_an_Updated_Ebuild
autounmask
Tweaking configure. Man 5 ebuild tells us that we can pass extra options to ./configure by setting the environment variable EXTRA_ECONF. There's also EXTRA_EMAKE and EXTRA_EINSTALL. An example looks like this: EXTRA_ECONF="--enable-gold" emerge -av '=sys-devel/binutils-2.18.50.0.6'.
Function keys
First of all, build the i8k support in the kernel. The usespace tool i8kutils is not necessary. Its README could be helpful though. In particular, read "THE I8000 MULTIMEDIA BUTTONS" section. I ended up using the solution described here and here to map mute, volume-down, volume-up buttons under X. I don't know much about sound output, but setting PCM is only effective when "PCM Out" is set to "pre 3D". Setting Master is more reliable.
.Xmodmap
keycode 160 = XF86AudioMute
keycode 174 = XF86AudioLowerVolume
keycode 176 = XF86AudioRaiseVolume
.xbindskeyrc
"amixer set Master toggle"
XF86AudioMute
"amixer set Master 5%-"
XF86AudioLowerVolume
"amixer set Master 5%+"
XF86AudioRaiseVolume
I believe the Fn-CRT/LCD combination is to be handled by the BIOS, but it doesn't seem to do the job. We can use i855crt instead. Examples: i855crt off, i855crt on 1024x768@70.
Bugs and fixes
Fixing broken portage or python
glibc-2.9_p20081201 breaks portage
--as-needed introduction and fixing guide
glibc-2.9_p20081201-r1 breaks firefox-3
升级X的讨论。I didn't encounter this problem on my system, which has evdev and no hal. However, downgrading X to 1.5.2 did cause some issues.
Tips
http://en.gentoo-wiki.com/wiki/Maintain_Gentoo_-_%22Best_Practices%22
http://en.gentoo-wiki.com/wiki/Laptops
http://www.gentoo.org/doc/en/kernel-config.xml
http://www.gentoo.org/doc/en/alsa-guide.xml
http://www.gentoo.org/doc/en/openrc-migration.xml
http://www.gentoo.org/doc/en/utf-8.xml
http://www.gentoo.org/proj/en/lisp/emacs/emacs.xml
http://kunxi.org/archives/2007/07/howto-gentoo-20070-on-dell-700m/
http://forums.gentoo.org/viewtopic-t-279395-highlight-bookstack.html
http://forums.gentoo.org/viewforum-f-12.html
http://www.celifornia.com/documents/dell700m.html
http://www.gentoo-wiki.info/HOWTO_ATAPI_CD_Burning
http://www.gentoo-wiki.info/TIP_Recommended_Packages
http://en.gentoo-wiki.com/wiki/X.Org/Dual_Monitors
http://www.gentoo.org/doc/en/dri-howto.xml
http://en.gentoo-wiki.com/wiki/Intel_GMA
http://en.gentoo-wiki.com/wiki/X.Org/xsession
http://www.thinkwiki.org/wiki/Xorg_RandR_1.2
http://en.gentoo-wiki.com/wiki/Synaptics_Touchpad
http://wiki.archlinux.org/index.php/Xorg_input_hotplugging
The blessed way of configuration is through eselect fontconfig.
Free fonts
I have some Debian machines to speed up compilation. It's important to make sure that all machines have the same version of gcc, in this case, gcc-4.3.2. With older versions of distcc, the client must preprocess the source files first and then send the preprocessed files to the servers. With distcc-3, there's this so-called pump mode that allows the client to send the source files with the header files, and have the servers to do the preprocessing. Enabling pump mode in Gentoo is simple:
distcc-config --set-hosts "foo,cpp,lzo bar,cpp,lzo baz,cpp,lzo"
pump emerge -u world
Unfortunately, Debian only has distcc-2.18. Debian's distcc has a nice zeroconf feature that Gentoo's missing: auto discovery of servers. Check out /usr/share/doc/distcc/README.Debian.
Using the default setup, you're most likely to see errors with exit code 110. The man page of distcc tells us it's "compiler not found". That's because Gentoo uses i686-pc-linux-gnu-gcc as the default compiler, whereas Debian only has i486-linux-gnu-gcc. The solution is to create symlinks on Debian.
For debugging info, we can look at /var/log/distccd.log on the server side. The file was empty on the first run, but restarting the server solved the issue. On the client side, we can DISTCC_DIR="/var/tmp/portage/.distcc/" distccmon-text 5.
First config your kernel to add in necessary support. Then, install acpid, which receives kernel events and performs actions by matching user-defined rules. In my case, I'd like to suspend to ram when I close the lid. The package hibernate-script does just that. It installs two programs: hibernate, and hibernate-ram. Their behavior can be fine-tuned by editing files under /etc/hibernate/. Under the hood, they rely on either one of the two kernel implementations. For more information, refer to /usr/share/doc/hibernate-script-1.98.1/README. The preferred uswusp implementation, which requires the userspace program suspend, doesn't work well with X on my computer.
Now, I'd like to put the computer to sleep when I close the lid. First observe the log file (depending on the syslogd program you use, the file may differ), and I saw a pair of events when I pressed and released the lid button:
acpid: received event "button/lid LID0 00000080 00000001"
acpid: rule from /etc/acpi/events/default matched
acpid: executing action "/etc/acpi/default.sh button/lid LID0 00000080 00000001"
BEGIN HANDLER MESSAGES
END HANDLER MESSAGES
acpid: action exited with status 0
acpid: 1 total rule matched
acpid: completed event "button/lid LID0 00000080 00000001"
acpid: received event "button/lid LID0 00000080 00000002"
acpid: rule from /etc/acpi/events/default matched
acpid: executing action "/etc/acpi/default.sh button/lid LID0 00000080 00000002"
BEGIN HANDLER MESSAGES
END HANDLER MESSAGES
acpid: action exited with status 0
acpid: 1 total rule matched
acpid: completed event "button/lid LID0 00000080 00000002"
Instead of looking at the log, you can also run acpi_listen.
Below are my files for handling the lid closing event:
# /etc/acpi/events/lid
# To only trigger on one, you may use the line
# event=button[ /]lid .*[02468ace]$
# to match only every second event.
# It is more reliable, however, to check the state of the lid:
event=button/lid
action=/etc/acpi/lid.sh %e
#!/bin/sh
# /etc/acpi/lid.sh
if grep -q closed /proc/acpi/button/lid/$2/state ; then
hibernate-ram
fi
Recent comments
1 week 3 days ago
2 weeks 4 days ago
3 weeks 1 day ago
5 weeks 1 day ago
13 weeks 3 days ago
17 weeks 5 days ago
18 weeks 4 days ago
21 weeks 1 day ago
1 year 4 weeks ago
1 year 4 weeks ago