我用的亚洲上海的时间:
Code:
#ln -sf /usr/share/zoneinfo/Asia/Harbin /etc/localtime
当前有了两个时间:一个是系统启动时候的时间,就是主板上的硬件时间一个是当前系统时间。系统以启动时的系统时间安作为UTC-格林威治标准时间为标准再根据当前时区增加或减少了时差得到的结果。所以是不准确的。
先读取主板上的硬件时间:
Code:
#hwclock --show
用这个时间同步系统时间:
#hwclock --hctosys
编辑系统时间为本地时间而不是UTC时间:
Code:
#nano -w /etc/conf.d/clock
就是把这一句:
CLOCK="UTC" 改成CLOCK="local"
重启系统,重新设置时间,并把系统时间 同步回硬件时间
Code:
#date 095502132009
#hwclock --systohc
中间牵扯到系统的UTC和local的变更问题,逻辑关系挺麻烦。做个笔记吧,至少解决了。
posted @
2009-02-25 15:35 狐狸贝贝 阅读(565) |
评论 (0) |
编辑 收藏
livecd / # eix sys-kernel/ sources
* sys-kernel/cell-sources
Available versions:
(2.6.18-r6) ~*2.6.18-r6!b!s
(2.6.19_rc5-r1) ~*2.6.19_rc5-r1!b!s
(2.6.19_rc6-r1) ~*2.6.19_rc6-r1!b!s
(2.6.24-r1) ~*2.6.24-r1!b!s
{build symlink}
Homepage: http://www.kernel.org/pub/linux/kernel/people/geoff/cell/ps3-linux/
Description: Full sources including the cell/ps3 patchset for the 2.6 kernel tree
* sys-kernel/gentoo-sources
Available versions:
(2.6.16-r13) 2.6.16-r13!b!s
(2.6.20-r10) (~)2.6.20-r10!b!s
(2.6.24-r8) 2.6.24-r8!b!s
(2.6.25-r9) 2.6.25-r9!b!s
(2.6.26-r2) (~)2.6.26-r2!b!s
(2.6.26-r3) 2.6.26-r3!b!s
(2.6.26-r4) 2.6.26-r4!b!s
(2.6.27) (~)2.6.27!b!s
(2.6.27-r1) (~)2.6.27-r1!b!s
(2.6.27-r2) (~)2.6.27-r2!b!s
(2.6.27-r3) (~)2.6.27-r3!b!s
(2.6.27-r4) (~)2.6.27-r4!b!s
(2.6.27-r5) (~)2.6.27-r5!b!s
(2.6.27-r6) (~)2.6.27-r6!b!s
(2.6.27-r7) 2.6.27-r7!b!s
(2.6.27-r8) 2.6.27-r8!b!s
(2.6.27-r9) (~)2.6.27-r9!b!s
(2.6.28) (~)2.6.28!b!s
(2.6.28-r1) (~)2.6.28-r1!b!s
(2.6.28-r2) (~)2.6.28-r2!b!s
{build symlink ultra1}
Homepage: http://dev.gentoo.org/~dsd/genpatches/
Description: Full sources including the Gentoo patchset for the 2.6 kernel tree
* sys-kernel/git-sources
Available versions:
(2.6.29_rc5-r1) (~)2.6.29_rc5-r1!b!s
(2.6.29_rc5-r2) (~)2.6.29_rc5-r2!b!s
(2.6.29_rc5-r3) (~)2.6.29_rc5-r3!b!s
(2.6.29_rc5-r4) (~)2.6.29_rc5-r4!b!s
(2.6.29_rc5-r5) (~)2.6.29_rc5-r5!b!s
(2.6.29_rc5-r6) (~)2.6.29_rc5-r6!b!s
(2.6.29_rc5-r7) (~)2.6.29_rc5-r7!b!s
(2.6.29_rc6-r1) (~)2.6.29_rc6-r1!b!s
{build symlink}
Homepage: http://www.kernel.org
Description: The very latest -git version of the Linux kernel
* sys-kernel/hardened-sources
Available versions:
(2.6.25-r13) 2.6.25-r13!b!s
(2.6.26-r9) 2.6.26-r9!b!s
(2.6.27-r7) (~)2.6.27-r7!b!s
(2.6.27-r8) (~)2.6.27-r8!b!s
(2.6.28) (~)2.6.28!b!s
{build symlink}
Homepage: http://www.gentoo.org/proj/en/hardened/
Description: Hardened kernel sources (kernel series 2.6)
* sys-kernel/mips-sources
Available versions:
(2.6.20.18) *2.6.20.18
(2.6.27.10) ~*2.6.27.10
(2.6.28.7) ~*2.6.28.7
{build cobalt ip27 ip28 ip30 ip32r10k}
Homepage: http://www.linux-mips.org/ http://www.gentoo.org/
Description: Linux-Mips GIT sources for MIPS-based machines, dated 20090223
* sys-kernel/mm-sources
Available versions: (2.6.28_rc2-r1) (~)2.6.28_rc2-r1!b!s
{build symlink}
Homepage: http://www.kernel.org/ http://www.gentoo.org/
Description: Andrew Morton's kernel, mostly fixes for 2.6 vanilla, some vm stuff too
* sys-kernel/openvz-sources
Available versions:
(2.6.18.028.056.1) 2.6.18.028.056.1!b!s
(2.6.18.028.059.6) (~)2.6.18.028.059.6!b!s
(2.6.24.006.5) [M](~)2.6.24.006.5!b!s
(2.6.26.9999) [M]**2.6.26.9999!b!s
{build symlink}
Homepage: http://openvz.org/
Description: OpenVZ 26 git
* sys-kernel/sh-sources
Available versions:
(2.6.13) *2.6.13!b!s
(2.6.14) *2.6.14!b!s
(2.6.15) *2.6.15!b!s
(2.6.16.20) *2.6.16.20!b!s
{build symlink}
Homepage: http://dev.gentoo.org/~dsd/genpatches
Description: Full SuperH sources including the gentoo patchset for the 2.6 kernel tree
* sys-kernel/sparc-sources
Available versions: (2.4.34) *2.4.34!b!s
{build symlink ultra1}
Homepage: http://www.kernel.org/ http://www.gentoo.org
Description: Full sources for the Gentoo Sparc Linux kernel
* sys-kernel/tuxonice-sources
Available versions:
(2.6.24-r9) 2.6.24-r9!b!s
(2.6.28-r3) (~)2.6.28-r3!b!s
{build symlink}
Homepage: http://dev.gentoo.org/~dsd/genpatches/ http://www.tuxonice.net
Description: TuxOnIce + Gentoo patchset sources
* sys-kernel/usermode-sources
Available versions:
(2.6.16-r3) (~)2.6.16-r3!b!s
(2.6.16-r4) (~)2.6.16-r4!b!s
(2.6.16-r5) (~)2.6.16-r5!b!s
(2.6.18) (~)2.6.18!b!s
(2.6.18-r1) (~)2.6.18-r1!b!s
(2.6.18-r2) (~)2.6.18-r2!b!s
{build symlink}
Homepage: http://www.kernel.org/ http://user-mode-linux.sourceforge.net
Description: Full sources for the User Mode Linux kernel
* sys-kernel/vanilla-sources
Available versions:
(2.4.36.9) 2.4.36.9!b!s
(2.4.37) 2.4.37!b!s
(2.6.16.62) 2.6.16.62!b!s
(2.6.19.7) 2.6.19.7!b!s
(2.6.23.17) 2.6.23.17!b!s
(2.6.24.7) 2.6.24.7!b!s
(2.6.25.20) 2.6.25.20!b!s
(2.6.26.7) 2.6.26.7!b!s
(2.6.26.8) 2.6.26.8!b!s
(2.6.27) (~)2.6.27!b!s
(2.6.27.10) 2.6.27.10!b!s
(2.6.27.11) (~)2.6.27.11!b!s
(2.6.27.12) 2.6.27.12!b!s
(2.6.27.13) (~)2.6.27.13!b!s
(2.6.27.14) (~)2.6.27.14!b!s
(2.6.27.15) (~)2.6.27.15!b!s
(2.6.27.16) (~)2.6.27.16!b!s
(2.6.27.17) (~)2.6.27.17!b!s
(2.6.27.18) (~)2.6.27.18!b!s
(2.6.27.19) (~)2.6.27.19!b!s
(2.6.28) (~)2.6.28!b!s
(2.6.28.1) (~)2.6.28.1!b!s
(2.6.28.2) (~)2.6.28.2!b!s
(2.6.28.3) (~)2.6.28.3!b!s
(2.6.28.4) (~)2.6.28.4!b!s
(2.6.28.5) (~)2.6.28.5!b!s
(2.6.28.6) (~)2.6.28.6!b!s
(2.6.28.7) (~)2.6.28.7!b!s
(2.6.29_rc1) (~)2.6.29_rc1!b!s
(2.6.29_rc2) (~)2.6.29_rc2!b!s
(2.6.29_rc3) (~)2.6.29_rc3!b!s
(2.6.29_rc4) (~)2.6.29_rc4!b!s
(2.6.29_rc5) (~)2.6.29_rc5!b!s
(2.6.29_rc6) (~)2.6.29_rc6!b!s
{build symlink}
Homepage: http://www.kernel.org
Description: Full sources for the Linux kernel
* sys-kernel/vserver-sources
Available versions:
(2.2.0.6) 2.2.0.6!b!s
(2.2.0.7) 2.2.0.7!b!s
(2.3.0.34) [M](~)2.3.0.34!b!s
(2.3.0.35.6) [M](~)2.3.0.35.6!b!s
(2.3.0.36.4) [M](~)2.3.0.36.4!b!s
{build symlink}
Homepage: http://www.gentoo.org/proj/en/vps/
Description: Full sources including Gentoo and Linux-VServer patchsets for the 2.6 kernel tree.
* sys-kernel/xbox-sources
Available versions: (2.6.16.26) (~)2.6.16.26!b!s
{build symlink}
Homepage: http://www.kernel.org/ http://www.gentoo.org/
Description: Full sources for the Xbox Linux kernel
* sys-kernel/xen-sources
Available versions:
(2.6.18-r11) (~)2.6.18-r11!b!s
(2.6.18-r12) (~)2.6.18-r12!b!s
(2.6.20-r7) [M](~)2.6.20-r7!b!s
(2.6.21) [M](~)2.6.21!b!s
{build symlink}
Homepage: http://xen.org/
Description: Full sources for a dom0/domU Linux kernel to run under Xen
Found 15 matches.
posted @
2009-02-25 15:14 狐狸贝贝 阅读(466) |
评论 (0) |
编辑 收藏
在虚拟机安装步骤
1、由于硬盘设置为SATA,如果引导的时候不加参数默认引导可能会发生SATA硬盘无法识别的现象,故加引导参数doscsi
代码:
gentoo doscsi
成功引导后会见到 livecd root # 开头的控制台
2 修改root密码
代码:
passwd
(输入两次新密码)
3、查看当前ip设置
代码:
ifconfig
(为了方便以后操作,记录下ip地址)
如果出现network is unreachable的情况可能要重新启动一下网卡或者重新设置
代码:
/etc/init.d/net.eth0 restart
4、开启SSH服务
代码:
/etc/init.d/sshd start
下面的操作都在putty里操作
5、用putty登录主机
打开putty输入主机ip(前面的ifconfig记录下的)连接,可以把会话保存,下次直接载入会话,就不必输入ip地址了
提示安全密钥验证,接受即可
然后输入用户名root和密码(第2步设置的密码)登录
6、硬盘分区
代码:
cfdisk
Name Flags Part Type FS Type [Label] Size (MB)
------------------------------------------------------------------------------
sda1 Boot Primary Linux 82.26
sda2 Primary Linux swap / Solaris 1019.94
sda3 Primary Linux
保存后退出
7、格式化分区
代码:
mke2fs /dev/sda1 //格式EXT2
mke2fs -j /dev/sda3 //格式EXT3
mkswap /dev/sda2 && swapon /dev/sda2 //格式并激活SWAP分区
8、挂载需要的分区
代码:
mount /dev/sda3 /mnt/gentoo
mkdir /mnt/gentoo/boot
mount /dev/sda1 /mnt/gentoo/boot
mkdir /mnt/gentoo/tmp
cd /mnt/gentoo/tmp
9、把下载好的Stage和Portage用pscp传送到主机
打开命令行cmd,切换到pscp所在目录
代码参考:
pscp portage-latest.tar.bz2 root@192.168.128.139:/mnt/gentoo/tmp
pscp stage3-i686-2008.0.tar.bz2 root@192.168.128.139:/mnt/gentoo/tmp
10、设置时间和日期
代码:
date MMDDhhmmYYYY
11、解压Stage和Portage
代码:
tar -xjpvf /mnt/gentoo/tmp/stage3-i686-2008.0.tar.bz2 -C /mnt/gentoo
tar -xjpvf /mnt/gentoo/tmp/portage-latest.tar.bz2 -C /mnt/gentoo/usr
12、复制DNS配置
代码:
cp -L /etc/resolv.conf /mnt/gentoo/etc/
13、加载proc proc文件系统是一个虚拟文件系统,通过它可以使用一种新的方法在Linux 内核空间和用户空间之间进行通信
mount -t proc proc /mnt/gentoo/proc
14、进入并设置新环境
代码:
chroot /mnt/gentoo /bin/bash
15、修改make.conf
代码参考:
nano -w /etc/make.conf
#---------------------------------------------------------------
CFLAGS="-march=i686 -pipe -O3 -fomit-frame-pointer"
CXXFLAGS="${CFLAGS}"
MAKEOPTS="-j2"
LDFLAGS="-Wl,-O1"
CHOST="i686-pc-linux-gnu"
ACCEPT_KEYWORDS="~x86"
FEATURES="sandbox ccache parallel-fetch"
CCACHE_SIZE="2G"
CCACHE_DIR="/var/tmp/ccache/"
INPUT_DEVICES="keyboard mouse"
VIDEO_CARDS="VMware"
ALSA_CARDS="ES1371"
LINGUAS="zh_CN zh en_US"
AUTOCLEAN="yes"
#PORTAGE_BINHOST="https://e.ututo.org.ar/i686/"
#PKGDIR="/usr/portage/packages"
GENTOO_MIRRORS="http://61.135.158.199/"
SYNC="rsync://61.135.158.199/gentoo-portage"
#PORTAGE_NICENESS=3
#PORTAGE_NICENESS=10
#--------------------------------------------------------------------
#FETCHCOMMAND="/usr/bin/axel -a -o \${DISTDIR}/\${FILE} \${URI}"
#RESUMECOMMAND="/usr/bin/axel -a -o \${DISTDIR}/\${FILE} \${URI}"
#FETCHCOMMAND="/usr/bin/wget -t 5 -T 60 --passive-ftp \${URI} -P \${DISTDIR}"
#RESUMECOMMAND="/usr/bin/wget -c -t 5 -T 60 --passive-ftp \${URI} -P \${DISTDIR}"
#--------------------------------------------------------------------
#---------------------------------------------------------------------------
#PORTAGE_ELOG_SYSTEM="save"
#PORTAGE_ELOG_CLASSES="warn error info"
#PORT_LOGDIR="/var/log/portage"
#---------------------------------------------------------------------------
#---------------------------------------------------------------------------
#PORTAGE_RSYNC_EXTRA_OPTS="--exclude-from=/etc/portage/rsync_excludes"
#---------------------------------------------------------------------------
USE="X gnome gtk gtk2 aac alsa acpi bash-completion bluetooth cdr cjk cups dbus divx4linux dvb dvd dvdr exif firefox ffmpeg flac ftp gif gphoto2 gpm hal jpeg mad mmx mp3 mpeg mplayer nls nptl nptlonly ogg opengl pcmcia png quicktime real samba sse sse2 ssl svg symlink truetype truetype-fonts udev unicode usb wireless win32codecs xine xv xvid -arts -esd -ipv6 -kde -oss -qt -qt3 -qt4"
#---------------------------------------------------------------
16、更新配置文件及系统
代码:
env-update && source /etc/profile
升级一下portage
代码:
emerge --sync
也许还会提示升级portage
代码:
emerge portage
安装快速下载工具axel
代码:
emerge axel
安装后修改make.conf
nano /etc/make.conf
取消前面的#号
#FETCHCOMMAND="/usr/bin/axel -a -o \${DISTDIR}/\${FILE} \${URI}"
#RESUMECOMMAND="/usr/bin/axel -a -o \${DISTDIR}/\${FILE} \${URI}"
增加常用快速命令:
nano /etc/profile
添加以下内容
alias cp='cp -i'
alias mv='mv -i'
alias rm='rm -i'
alias ls='ls --color=auto'
alias ll='ls -hl'
alias grep='grep --color=auto'
保存退出
env-update && source /etc/profile
17、开启ccache
代码:
emerge ccache
18、设置时区
代码:
ln -sf /usr/share/zoneinfo/Asia/Harbin /etc/localtime
nano -w /etc/conf.d/clock
修改使 CLOCK="Asia/Harbin"
19、设置locale
代码:
nano -w /etc/locale.gen
参考:
en_US.UTF-8 UTF-8
zh_CN.UTF-8 UTF-8
zh_CN.GBK GBK
代码:
locale-gen
20、安装内核源码
代码:
emerge gentoo-sources
Opening output file /usr/portage/distfiles/linux-2.6.28.tar.bz2
Unpacking linux-2.6.28.tar.bz2 to /var/tmp/portage/sys-kernel/gentoo-sources-2.6.28/work
检查源码链接
代码:
ls -l /usr/src/linux
结果类似于:
lrwxrwxrwx 1 root root 19 May 16 18:56 /usr/src/linux -> linux-2.6.21-gentoo
21、安装genkernel及grub
代码:
emerge genkernel grub
22、编译内核 采用genkernel
genkernel --menuconfig --bootloader=grub all
23、修改/etc/fstab
代码:
nano -w /etc/fstab
参考:
# NOTE: If your BOOT partition is ReiserFS, add the notail option to opts.
/dev/sda1 /boot ext2 noauto,noatime 1 2
/dev/sda3 / ext3 noatime 0 1
/dev/sda2 none swap sw 0 0
/dev/cdrom /mnt/cdrom auto noauto,ro 0 0
#/dev/fd0 /mnt/floppy auto noauto 0 0
24、设定主机名
代码:
nano -w /etc/conf.d/hostname
例如:
HOSTNAME="mygentoo"
25 设定域名
代码:
nano -w /etc/conf.d/net
例如:
//dns_domain_lo="workgroup"
config_eth=( "dchp" )
26、配置网络
代码:
nano -w /etc/conf.d/net
我是DHCP,内容类似:
config_eth0=( "dhcp" )
修改网络信息:
代码:
nano -w /etc/hosts
127.0.0.1 mygentoo.workgroup mygentoo localhost
27 安装dhcp工具
代码:
emerge dhcp dhcpcd
28 设置root密码
代码:
passwd
29 安装必要的系统工具并默认启动
日志管理工具
代码:
emerge syslog-ng
rc-update add syslog-ng default
Cron工具
代码:
emerge vixie-cron
rc-update add vixie-cron default
30、配置grub并安装
配置grub.conf
代码:
nano -w /boot/grub/grub.conf
参考
default 0
timeout 10
splashimage=(hd0,0)/grub/splash.xpm.gz
title=Gentoo Linux (2.6.28)
root (hd0,0)
kernel /kernel-genkernel-x86-2.6.28-gentoo root=/dev/ram0 init=/linuxrc ramdisk=8192 real_root=/dev/sda3
initrd /initramfs-genkernel-x86-2.6.28-gentoo
安装grub
代码:
grub --no-floppy
root (hd0,0)
setup (hd0)
quit
31、重启
代码
exit
umount /mnt/gentoo/proc /mnt/gentoo/boot /mnt/gentoo
reboot
(别忘了取出光盘)
posted @
2009-01-15 09:36 狐狸贝贝 阅读(2062) |
评论 (0) |
编辑 收藏