发在这里了

http://www.linuxsir.org/bbs/thread342035.html

每次清理world file都要去找那一堆命令,之前找到英文版的在这里

现在我将主要过程写在一个脚本里了,下次只要执行一下这个脚本就行了。
用wgetpaste贴在了这里

主要会执行如下步骤:

代码:
echo "***********************************************" echo "The system will do the follow steps automaticly:" echo "1.cp /var/lib/portage/world ~ && >/var/lib/portage/world" echo "2.regenworld" echo "3.emerge --depclean -p" echo "4.emerge --depclean" echo "5.emerge -uDN world -pv" echo "6.emerge -uDN world" echo "7.revdep-rebuild" echo "8.eclean-dist -d" echo "***********************************************"

脚本代码:

代码:
pjq@Gentoo-PJQ ~ $ cat clwd.sh ######################################################################### # Author: pengjianqing@sina.com # Created Time: Sun 28 Dec 2008 07:50:48 PM CST # File Name: clwd.sh # Description: # This file is used to clean your world file. #USAGE: # ./clwd.sh -y,Clean your world file automaticly. # ./clwd.sh -n,You need to answer the question by yourself. ######################################################################### #!/bin/bash cleanworld() { echo "***********************************************" read -p "Back up the world file and regenerate the world file?[y/n]:" ANSWER if [ "y" = $ANSWER ];then echo "cp /var/lib/portage/world ~ && >/var/lib/portage/world" cp /var/lib/portage/world ~ && >/var/lib/portage/world echo "regenworld" regenworld fi echo "***********************************************" read -p "Execute emerge --depclean -p?[y/n]:" ANSWER if [ "y" = $ANSWER ];then emerge --depclean -p fi echo "***********************************************" read -p "Execute emerge --depclean ?[y/n]:" ANSWER if [ "y" = $ANSWER ];then emerge --depclean fi echo "***********************************************" read -p "Execute emerge -uDN world -pv?[y/n]:" ANSWER if [ "y" = $ANSWER ];then emerge -uDN world -pv fi echo "***********************************************" read -p "Execute emerge -uDN world ?[y/n]:" ANSWER if [ "y" = $ANSWER ];then emerge -uDN world fi echo "***********************************************" read -p "Execute revdep-rebuild?[y/n]:" ANSWER if [ "y" = $ANSWER ];then revdep-rebuild fi echo "***********************************************" } autocleanworld() { echo "***********************************************" echo "The system will do the follow steps automaticly:" echo "1.cp /var/lib/portage/world ~ && >/var/lib/portage/world" echo "2.regenworld" echo "3.emerge --depclean -p" echo "4.emerge --depclean" echo "5.emerge -uDN world -pv" echo "6.emerge -uDN world" echo "7.revdep-rebuild" echo "***********************************************" read -p "Are you sure?[y/n]:" ANSWER if [ "y" = $ANSWER ];then echo "***********************************************" cp /var/lib/portage/world ~ && >/var/lib/portage/world echo "***********************************************" regenworld echo "***********************************************" emerge --depclean -p echo "***********************************************" emerge --depclean echo "***********************************************" emerge -uDN world -pv echo "***********************************************" emerge -uDN world echo "***********************************************" revdep-rebuild echo "***********************************************" fi } help() { echo "***********************************************" echo "-h:help" echo "-y:do the clean world automaticly." echo "-n:you need to answer the question one by one." echo "***********************************************" exit 0; } myexit() { echo "Unknown parameter,exit" exit 0; } STARTTIME=`date|cut -d " " -f4` echo "***********************************************" echo "This is used to clean your world file" echo "USAGE:" echo "-h:help" echo "-y:do the clean world automaticly." echo "-n:you need to answer the question one bye one." echo "***********************************************" case "$1" in -y ) autocleanworld;; -n ) cleanworld;; -h ) help;; * ) myexit;; esac read -p "Do you want to delete the independency files in /usr/portage/distfiles/?[y/n]:" ANSWER if [ "y" = $ANSWER ];then eclean-dist -d -p fi if [ "y" = $ANSWER ];then read -p "Are you sure to delete those files?[y/n]:" ANSWER if [ "y" = $ANSWER ];then eclean-dist -d fi fi FINISHEDTIME=`date|cut -d " " -f4` echo "***********************************************" echo "OK,All done!Enjoy your clean world:)" echo "***********************************************" echo Start at:$STARTTIME echo Finished at:$FINISHEDTIME echo "***********************************************"
以前在终端下要显示中文都要另外再安装zhcon,大概知道也有中文补丁但一直没有在意,今天在linuxsir上无意中看到了一个中文补丁的贴子,就想试试.
之前没打过补丁,所以先搜了一下patch的用法,下面是我的大概操作过程:
1.先将补丁(*.patch)解压放到/usr/src/linux 下面
2.patch -p1 <*.patch
这样就差不多算打上了,但我这里有一个错误,后来搜了一下,需要手动patch那个error:
grep “^+” *.c.rej|sed ‘s/^+//g’ >>*.c
然后再把加的这部分代码提到#include <>下面去.
然后再编译一下,copy内核,用新内核引导到终端,ls 一下,可以正常显示中文了.

Gentoo内核昨天又升级了(NVIDIA驱动也升级了),直接从2.6.26-r4干到了2.6.27-r7,升级真多,前两天圣诞2.6.28的内核才刚出来,下面是简易升级过程:
1.emerge -uDN world
2.将原先的/usr/src/linux 软链接删掉,
然后将新内核链接过去
3.拷贝一下先前的.config到新的内核目录下.
4.然后make menuconfig,一般我都不需要重新配置了,然后直接保存就行了,这种有可能会有问题,但我一直是这样操作的,现在也没有发现什么问题.
5.然后再time make
6.OK,编译成功,
make modules_install,
拷贝新内核,成功引导系统.
7.进入系统,再重新编译相关模块
modules-rebuild rebuild
这里一般不会太多,主要是一个显卡驱动,还有VirtualBox 模块.
8.至此一个内核的升级就基本完成.

然后再照着上面的方法patch上了中文补丁,ls -lh /boot/kernel-*一看,这个中文补丁居然把内核增加了大概0.4M,原来都是2M,现在差不多2.5M了.

这几天将firefox升级到了3.0.5,发现很容易假死,随便打开几个网页,然后点TAP,很容易造成假死,要过10S左右才能恢复过来,这个很是郁闷,不知道为什么会有这个问题,之前的都没有一点问题,为什么一升级就会有这样的问题.