abstract
Little tips in using gentoo linux.
To start kinput2 under KDE3&kdm environment automatically
Add line below to /etc/X11/Sessions/kde-*
kinput2 -canna -xim &
To use kinput2 with software built with gtk+2 toolkit
Add lines below to /usr/X11R6/lib/X11/app-defaults/Kinput2
*SeparateConversion.input: false
*selectionShell.input: false
*auxShell.input: false
!*SeparateConversion.title: Kana-Kanji Conversion
!*selectionShell.title: Candidate Selection
!*auxShell.title: Auxiliary Control
To set the systemwide default language Japanese
Create the file /etc/env.d/99lang_env and add lines below
LANG=ja_JP.eucJP
XMODIFIERS="@im=kinput2"
To add cannadic & canna-2ch
add lines below to /var/lib/canna/dic/dics.dir
gcanna.ctd(gcanna.mwd) -gcanna---
gcannaf.ctd(.swd) -gcannaf---
nichan.ctd(.mwd) -nichan---
add “gcanna” “gcannaf” “nichan” to /usr/share/canna/default.canna
To compile kernel without genkernel
For kernel 2.4.
# make menuconfig
# make dep && make clean bzImage modules modules_install
# cp /usr/src/linux/arch/i386/boot/bzImage /boot
For kernel 2.6.
# make menuconfig
# make && make modules_install
# cp System.map /boot
# cp arch/i386/boot/bzImage /boot/vmlinuz
# cp .config /boot/config
To fix the shared library link(?)
e.g. When you update gcc or python or whatever, and emerge stop working correctly
# ldconfig
My make.conf
CHOST="i686-pc-linux-gnu"
USE="cjk nls qt kde -gtk gtk2 -gnome alsa cups crypto mmx sse
dvd f2c divx4linux dvd dvdread live xvid"
CFLAGS="-O3 -mcpu=pentium4 -march=pentium4 -mfpmath=sse -msse2
-mmmx -fforce-addr -fomit-frame-pointer -funroll-loops
-frerun-cse-after-loop -frerun-loop-opt -falign-functions=4
-pipe -s -z combreloc"
CXXFLAGS="${CFLAGS}"
MAKEOPTS="-j3"
PORTAGE_NICENESS=+10
ALSA_CARDS='intel8x0'
LINGUAS="ja"
SYNC="rsync://rsync.us.gentoo.org/gentoo-portage"
VIDEO_CARDS="i830"
AUTOCLEAN="yes"
Location of the world favorite list
/var/cache/edb/world
SSH RSA key generation
On the destination console:
$ ssh-keygen -t rsa
enter passphrase, then id_rsa.pub will be generated at ~/.ssh/
at the client console:
$ ssh-keygen -t rsa
enter passphrase, then id_rsa.pub will be generated at ~/.ssh/ After this, execute following at the client console
$ scp ~/.ssh/id_rsa.pub $DESTINATION:/home/$USERNAME/.ssh/authorized_keys
$ ssh $DESTINATION
$ chmod 600 ~/.ssh/authorized_keys
Please replase $DESTINATION with either IP address or domain name of the destination.
rsync usage (with SSH)
rsync -avz -e ssh $SOURCE $DESTINATION:$TARGET_DIR
Please replace $SOURCE with the file/directory you want to copy, $DESTINATION with either IP address or domain name of the destination, and $TARGET_DIR with the directory that you want your $SOURCE to be copied at.
if you want to delete the file from $TARGET_DIR which is deleted from $SOURCE recently, add --delete option.
if you want to exclude certain kinds of files, use --exclude 'filename' option. You can use wildcards.
enable cron for normal user on Gentoo system
# gpasswd -a masumi cron
allow su user to run X program
$ xhost +localhost
Change OpenOffice UI font
Startup the OpenOffice.org, and go to Tools -> Options -> OpenOffice.org -> Font Replacement. Then replace Andale Sans UI with desired font.
Add Truetype font to OpenOffice.org
# /opt/OpenOffice.org/program/spadmin
Location may vary, depending on the installation method.
NTP time adjustment
when the internal clock was messed up a lot
$ ntpdate [server IP]
to retrieve the status of local NTP daemon (ntpd)
$ ntpq -p
When GCC is messed up
Installing pre-compiled GCC may help.
# mkdir /usr/portage/packages/All
# wget -P /usr/portage/packages/All
# http://dev.gentoo.org/~avenj/bins/gcc-3.2.3-r1.tbz2
# tar -xvjpf /usr/portage/packages/All/gcc-3.2.3-r1.tbz2 -C /
# env-update && source /etc/profile
When GCC is messed up [2]
If you experience difficulties emerging with the following error message (after updating GCC to Version 3.3.5)
grep: /usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.4/libstdc++.la: No such file or directory
/bin/sed: can't read /usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.4/libstdc++.la: No such file or directory
libtool: link: `/usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.4/libstdc++.la' is not a valid libtool archive
make[4]: *** [libdirectfb_sdlinput.la] Error 1
make[4]: *** Waiting for unfinished jobs....
grep: /usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.4/libstdc++.la: No such file or directory
/bin/sed: can't read /usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.4/libstdc++.la: No such file or directory
libtool: link: `/usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.4/libstdc++.la' is not a valid libtool archive
Try executing the following command
emerge libtool && fix_libtool_files.sh 3.3.4 && env-update && source /etc/profile
References
- [resolved] Problems after upgrade gcc to 3.3.5
- GF18: Emerge fails after upgrading gcc. libstdc++.la missing
emerge xfree problem fix
For xfree-4.3.0-r5
ln -sf /usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.3/libstdc++.so.5 /usr/lib/libstdc++.so.5
To remove all the packages with no dependency
emerge depclean
Prelinking
prelink -afmR
ALSA stopped working with kernel 2.6.11
Soundcard is intel8x0. After compiling kernel 2.6.11, the audio stopped working. To workaround with this problem, execute
amixer sset 'Headphone Jack Sense' off
Reference
- Article 1091@Gentoo.gr.jp mailing list(Japanese) (dead link)
- Help with ALSA & kernel2.6.11 please, Gentoo Forum (English)