Archive for the ‘gentoo’ Category

wtf: UNIX下的英文缩写解释工具

今天在SHLUG的邮件列表里,有朋友提到WTF这个缩写不懂是什么意思,囧。不过我倒是想到有一个叫wtf的UNIX工具,还真是帮助翻译解释英文缩写用的,它是由netbsd开发。在gentoo下,它的信息如下:

thomas@ghosToo ~ $ eix -s wtf
* dev-python/wtforms
Available versions:  0.6 {doc}
Homepage:            <a href="http://wtforms.simplecodes.com/" target="_blank">http://wtforms.simplecodes.com/</a>
<a href="http://pypi.python.org/pypi/WTForms" target="_blank">http://pypi.python.org/pypi/WTForms</a>
Description:         Flexible forms validation and rendering
library for python web development
 
* games-misc/wtf
Available versions:  20090924
Homepage:            <a href="http://netbsd.org/" target="_blank">http://netbsd.org/</a>
Description:         translates acronyms for you
 
Found 2 matches.

被归类到了games-misc的组里,还是很有意思的,可以试试看:

thomas@ghosToo ~ $ wtf asap
ASAP: as soon as possible

让FreeMind支持中文字体

FreeMind是非常优秀的一款思维导图程序(Mind-Mapping Software),它使用Java开发,所以,在Linux也能见到它的身影

在我的gentoo中安装了FreeMind后,我发现FreeMind中无法显示中文(显示为方块),在LinuxSir上求助成功,感谢网友acevery为我解答:

在/opt/sun-jdk-xxx/jre/lib/fonts/下建立一个目录 fallback,
然后把一个你要用的中文字体ln -s到fallback下。

在freemind的 工具->首选项->默认->默认字体中墙上这个字体,比如我用微软雅黑,就写上微软雅黑。

原文地址在这里

gentoo: mysql升级至5.1与amaroK冲突的问题

gentoo近日unmask了mysql 5.1,如果用户升级系统,将会使mysql从原有的5.0升级至5.1

如果你和我一样使用的是KDE 4.4那么有两处问题要注意:

  • 使用了embedded的USE FLAG编译的amaroK将会与mysql 5.1产生冲突
  • 如果你和我一样去除embedded的USE FLAG,成功升级后,启动akonadi服务将会产生错误

针对这些遇到的问题,我个人的解决方法是

  1. 首先将embedded的USE FLAG改为了”-embedded”,然后将系统升级
  2. 完成升级后,执行revdev-rebuild
  3. 初始化mysql数据库: /usr/bin/mysql_install_db,使用mysql创建你想要为amarok使用的数据库帐户、密码和数据库名
  4. rc-update add mysql default

当然,这只是我个人的解决方案,如果你不希望你的amaroK使用额外的mysql数据库,可以手动设置mask掉mysql 5.1

P.S 我在升级的过程中,OpenOffice.org遇到了无法找到perl模块的问题,需要先执行perl-cleaner –reallyall

gentoo: 升级内核后VirtualBox无法启动

朋友送了我一个VPN帐户,一直忘记用,今天想起来就拿来用了一下,启动OpenVPN的时候发现提示说tun/tap在当前kernel没有被支持,我顺便就编译了新emerge到的内核版本,将tun/tap支持加入

编译完成后,OpenVPN成功启动,第一次感觉到自由自在的能够上网不用看到connection reset是件多么幸福的事情

之后我立马想到内核重新编译后,VirtualBox可能无法使用,需要重新编译模块,果然,虚拟机无法启动,说vboxdrv模块没有被正确加载,解决方法很简单:

emerge app-emulation/virtualbox-modules-3.1.2

对,重新编译一下virtualbox的modules即可

问题解决

KDE 4.4发布 改进不小

KDE 4.4于2月9日发布(发布新闻在这里),今天emerge –sync了一下后,已经看到gentoo的portage里有了。

迫不及待的我前面下午赶紧花了大约3个小时升级emerge了KDE,完成后玩了一会儿,发现细节方面有非常多的改进,用户体验又上了一层楼。

上个截图:

推荐大家机器配置不差的话就多用用KDE,用户体验还是Linux下所有DE最优秀的!

gentoo: 配置bootsplash

闲来无聊,就去kde-look上逛逛看看有没有什么好的桌面资源,发现有一个分类是bootsplash,这才想起来一直没配置过bootsplash,所以花了点时间研究了下

bootsplash是形容计算机(操作系统)在启动过程中的图形界面的过程的专业术语,有关bootsplash的详细说明请看这里

在gentoo下,如果你想定制bootsplash,首先需要在内核编译的过程中,选择支持framebuffer,确认内核支持framebuffer后,在系统中安装splashutils:

# emerge splashutils

下载完成后,去寻找一些你喜欢的bootsplash主题,下载主题包,比如我使用的是一个叫natural-gentoo的主题,我们来看一看这个主题包的目录结构:

# tree natural-gentoo/
natural-gentoo/
|-- boot
|   `-- grub
|       `-- gentoo.xpm.gz
|-- etc
|   `-- splash
|       `-- natural-gentoo
|           |-- 1024x600.cfg
|           |-- 1024x768.cfg
|           |-- 1152x864.cfg
|           |-- 1280x1024.cfg
|           |-- 1280x800.cfg
|           |-- 1400x1050.cfg
|           |-- 1440x900.cfg
|           |-- 1600x1200.cfg
|           |-- 1680x1050.cfg
|           |-- 1920x1200.cfg
|           |-- 800x600.cfg
|           `-- images
|               |-- silent-1024x600.jpg
|               |-- silent-1024x768.jpg
|               |-- silent-1152x864.jpg
|               |-- silent-1280x1024.jpg
|               |-- silent-1280x800.jpg
|               |-- silent-1400x1050.jpg
|               |-- silent-1440x900.jpg
|               |-- silent-1600x1200.jpg
|               |-- silent-1680x1050.jpg
|               |-- silent-1920x1200.jpg
|               |-- silent-800x600.jpg
|               |-- verbose-1024x600.jpg
|               |-- verbose-1024x768.jpg
|               |-- verbose-1152x864.jpg
|               |-- verbose-1280x1024.jpg
|               |-- verbose-1280x800.jpg
|               |-- verbose-1400x1050.jpg
|               |-- verbose-1440x900.jpg
|               |-- verbose-1600x1200.jpg
|               |-- verbose-1680x1050.jpg
|               |-- verbose-1920x1200.jpg
|               `-- verbose-800x600.jpg
`-- metadata.xml
 
6 directories, 35 files

可以看到,在一个bootsplash主题包中,boot的grub目录下存放的是grub界面的配套主题,而bootsplash的主题样式与规则存放在/etc/splash目录下,我们在主题包的目录中将这些包复制到系统中去:

# cp -nr ./boot/ /
# cp -nr ./etc/ /

注意cp命令千万别忘了加上命令选项n,意思是仅复制新的文件,忽略已存在的相同文件

现在,我们要生成一个initramfs的splash image文件,语法如下:

splash_geninitramfs --verbose --res NxN --generate /boot/initramfs-bootsplash theme

你所需要修改的只有res命令选项后的分辨率参数以及最后的theme名,我的X61是1024×768的分辨率(分辨率支持的前提是主题包内有相应的分辨率cfg文件),使用的主题包名为natural-gentoo,所以,在/etc目录下,执行:

# splash_geninitramfs --verbose --res 1024x768 --generate /boot/initramfs-bootsplash natural-gentoo/

这时,/boot目录下就会生成一个名为initramfs-bootsplash的splash image文件

很快来到了最后一步,也就是调整你的grub配置,这里直接帖出我的menu.lst,供大家参考:

# This is a sample grub.conf for use with Genkernel, per the Gentoo handbook
# http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=1&chap=10#doc_chap2
# If you are not using Genkernel and you need help creating this file, you
# should consult the handbook. Alternatively, consult the grub.conf.sample that
# is included with the Grub documentation.
 
default 0
timeout 3
#grub界面使用主题包里的图片
splashimage=(hd0,0)/boot/grub/gentoo.xpm.gz
 
title Gentoo Linux 2.6.32-r2
root (hd0,0)
#注意新加的内核load参数: splash=silent(或者verbose),theme:主题名 console=tty1
kernel /boot/ghosTkernel root=/dev/sda1 video=792 splash=silent,theme:natural-gentoo console=tty1
initrd /boot/initramfs-bootsplash
 
# vim:ft=conf:

来看看我的bootsplash效果吧 :)

参考资料:

1. http://en.gentoo-wiki.com/wiki/Fbsplash

2. http://en.wikipedia.org/wiki/Bootsplash

gentoo: 我的/etc/make.conf

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# These settings were set by the catalyst build script that automatically
# built this stage.
# Please consult /usr/share/portage/config/make.conf.example for a more
# detailed example.
CFLAGS="-O2 -march=i686 -pipe"
CXXFLAGS="-O2 -march=i686 -pipe"
# WARNING: Changing your CHOST is not something that should be done lightly.
# Please consult http://www.gentoo.org/doc/en/change-chost.xml before changing.
CHOST="i686-pc-linux-gnu"
MAKEOPTS="-j3"
 
USE="X acpi -aim alsa bash-completion bluetooth cjk consolekit crypt -cups dbus dri embedded ffmpeg firefox flac gif gimp -gnome -gnome-keyring -gpm -gps gnutls gzip gtk hal hardened -icq ipod -ipv6 jabber jpeg kontact kde lm_sensors lua mp3 mplayer mng msn mysql ncurses networkmanager opengl plasma png -qt3 qt3support qt4 -rdesktop readline -scanner semantic-desktop smp -spell sql ssl svg syslog unicode vim-syntax webkit wifi win32codecs -yahoo"
 
ACCEPT_KEYWORDS="~x86"
#安装某些软件时需要同意其License,否则安装会被Mask
ACCEPT_LICENSE="*"
 
INPUT_DEVICES="evdev"
#指定显卡驱动,避免不必要的驱动在emerge xorg-server时被编译进去
VIDEO_CARDS="intel"
 
#镜像
GENTOO_MIRRORS="http://mirrors.163.com/gentoo"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
Return top