|
转载自http://forums.gentoo.org/viewtopic-t-281345.html
我试试效果,不错。大内存的朋友有福了:)
以下为原文:
-----------------
買了新PC,Dell 4700c,配置了1GB內存,但由於散熱不好,就所以就在這頭疼。於是找?硪韵碌姆椒ǎ http://gentoo-wiki.com/TIP_Speeding_up_portage_with_tmpfs
原理: 用內存虚擬硬盘,?頃捍婢幾g時的臨時文件。
好處:
1. 快;
2. 硬盘少轉幾圈,熱量減少些(環保,保謢地球 --就看你有沒有看到這個帖了 8) );
使用:
0. 把下面的腳本於在/usr/bin/temerge;
1. chmod u+x temerge;
2. 以前用emerge 的,現在全用 temerge;
- #!/bin/bash
- MEMSIZE=850M
- mounted=false
-
- . /sbin/functions.sh
-
- mounttmpfs() {
- mount -t tmpfs tmpfs -o size=$MEMSIZE /var/tmp/portage
- mounted="true"
- }
- compile() {
- ebegin "emerging ${*}"
- emerge ${*}
- eend $?
- }
- unmount() {
- ebegin "unmounting tmpfs"
- umount -f /var/tmp/portage
- eend $?
- }
- ebegin "Mounting $MEMSIZE of memory to /var/tmp/portage"
- if [ -z "$(mount | grep /var/tmp/portage)" ]
- then
- mounttmpfs
- else
- eerror "tmpfs already mounted!"
- exit 0
- fi
- eend $?
- compile ${*}
-
- if [ -n "$mounted" ]
- then
- unmount
- fi
复制代码
_________________
Akar
我也?凵线@五個字: 時時事事試!
---------------------------
以上是原文 |
|