- 浏览: 16326 次
- 性别:
最新评论
# 配置网卡
livecd ~ # dhcpcd eth0
显示:offered 192.168.100.230 from 192.168.100.1 表示成功 #不同的机子ip不同
# 启动ssh服务
livecd ~ # /eth/init.d/sshd start
# 设置密码
livecd ~ # passwd
# 使用putty登录
# ip地址是刚才配置网卡时自动分配的ip地址 本机是192.168.100.230 #不同的机子ip不同
# 磁盘分区
livecd ~ # fdisk /dev/sda
提示:按M查看帮助
用n分好区,然后输入a设置sda1为启动分区,输入t再输入82设置sda2为交换分区
然后w保存退出
显示:
Disk /dev/sda: 4034 MB, 4034838528 bytes
255 heads, 63 sectors/track, 490 cylinders, total 7880544 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
Device Boot Start End Blocks Id System
/dev/sda1 * 2048 133119 65536 83 Linux
/dev/sda2 133120 264191 65536 82 Linux swap / Solaris
/dev/sda3 264192 7880543 3808176 83 Linux
表示成功
# 创建文件系统
livecd ~ # mke2fs -j /dev/sda1
显示:
Writing inode tables: done
Writing superblocks and filesystem accounting information: done
表示成功
livecd ~ # mke2fs -j -N 600000 /dev/sda3
显示:
Writing inode tables: done
Creating journal (16384 blocks): done
Writing superblocks and filesystem accounting information: done
表示成功
livecd ~ # mkswap /dev/sda2
显示:
Setting up swapspace version 1, size = 65532 KiB
no label, UUID=86f7c61e-8104-41a3-ada8-7afdff98a548 #ID号每次都不一样
表示成功
livecd ~ # mount /dev/sda3 /mnt/gentoo
livecd ~ # mkdir /mnt/gentoo/boot
livecd ~ # mount /dev/sda1 /mnt/gentoo/boot
livecd ~ # swapon /dev/sda2
# 使用psftp传输文件
#本地运行cmd进入命令行
C:\Users\Administrator>cd C:\Users\Administrator\Desktop\Linux # C:\Users\Administrator\Desktop\Linux 是我要传输的本地文件所在path
C:\Users\Administrator\Desktop\Linux>psftp 192.168.100.230
login as: root
Using keyboard-interactive authentication.
Password:
Remote working directory is /root
psftp> cd /mnt/gentoo
Remote directory is now /mnt/gentoo
psftp> mput *.bz2
local:portage-20120128.tar.bz2 => remote:/mnt/gentoo/portage-20120128.tar.bz2
local:stage3-i686-20120124.tar.bz2 => remote:/mnt/gentoo/stage3-i686-20120124.tar.bz2
psftp>
表示成功
# 解压stage3和portage
livecd ~ # cd /mnt/gentoo/
livecd gentoo # tar xvjpf stage3-i686-20120124.tar.bz2
# x表示解开(Extract),
# v表示详细信息(Verbose)可以用来查看解压缩时发生了什么(可选参数),
# j表示使用bzip2解压缩,
# p表示保留权限(Preserve permissions),
# 还有f表示我们要解开一个文件,而不是标准输入。
livecd gentoo # tar xvjf portage-20120128.tar.bz2 -C /mnt/gentoo/usr
livecd gentoo # chmod 1777 /mnt/gentoo/tmp
# 挂载/proc和/dev文件系统
livecd gentoo # mount -t proc none /mnt/gentoo/proc
livecd gentoo # mount -o bind /dev /mnt/gentoo/dev
# 进入新的系统环境
livecd gentoo # chroot /mnt/gentoo /bin/bash
livecd / # env-update
提示:>>> Regenerating /etc/ld.so.cache...
表示成功
livecd / # source /etc/profile
livecd / # export PS1="(chroot)$PS1"
# 修改新系统的编译选项/etc/make.conf
# 选项文件/etc/make.conf;
(chroot)livecd ~ # cat /etc/make.conf
CFLAGS="-O2 -march=i686 -pipe"
CXXFLAGS="${CFLAGS}"
CHOST="i686-pc-linux-gnu"
MAKEOPTS="-j4"
GENTOO_MIRRORS="http://192.168.100.10/ http://mirrors.xmu.edu.cn/gentoo/"
USE="-gnome -kde -qt3 -qt4 X tomcat php apache2 mysql java6 java gd hal startup-notification"
# 修改新系统的glibc Locales
# 文件/etc/locale.gen
(chroot)livecd ~ # cat /etc/locale.gen
en_US ISO-8859-1
en_US.UTF-8 UTF-8
zh_CN GBK
zh_CN.UTF-8 UTF-8
# 修改时区
(chroot)livecd ~ cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
# 安装源码编译内核
# 使用putty登录时,某些终端类型如xterm-color会导致man页面乱码,用xterm就可以
(chroot)livecd ~ emerge gentoo-sources
显示
Installing (1 of 1) sys-kernel/gentoo-sources-3.1.10-r1
* If you are upgrading from a previous kernel, you may be interested
* in the following document:
* - General upgrade guide: http://www.gentoo.org/doc/en/kernel-upgrade.xml
* For more info on this patchset, and how to report problems, see:
* http://dev.gentoo.org/~mpagano/genpatches
>>> Recording sys-kernel/gentoo-sources in "world" favorites file...
* Messages for package sys-kernel/gentoo-sources-3.1.10-r1:
* If you are upgrading from a previous kernel, you may be interested
* in the following document:
* - General upgrade guide: http://www.gentoo.org/doc/en/kernel-upgrade.xml
表示成功
(chroot)livecd ~ cd /usr/src/linux
(chroot)livecd linux # make menuconfig
提示:File systems ---> <*> Second extended fs support
Ext2 extended attributes
[ ] Ext2 POSIX Access Control Lists (NEW)
[ ] Ext2 Security Labels (NEW)
Ext2 execute in place support
Device Drivers ---> Network device support ---> [*] Ethernet (1000 Mbit) (NEW) ---> <*> Intel(R) 82575/82576 PCI-Express Gigabit Ethernet support
# 检查以下内核选项
# Processor type and features ---> Processor family
# Device Drivers
# 去掉不需要的驱动;
# 确保开了LVM2,默认有开;
# 确保自己使用的网卡有选上,使用lspci可以查看检测到的硬件;
(chroot)livecd linux # make
显示:
LD arch/x86/boot/setup.elf
OBJCOPY arch/x86/boot/setup.bin
OBJCOPY arch/x86/boot/vmlinux.bin
HOSTCC arch/x86/boot/tools/build
BUILD arch/x86/boot/bzImage
Setup is 12668 bytes (padded to 12800 bytes).
System is 4819 kB
CRC f2082df7
Kernel: arch/x86/boot/bzImage is ready (#1)
Building modules, stage 2.
MODPOST 3 modules
CC arch/x86/kernel/test_nx.mod.o
LD [M] arch/x86/kernel/test_nx.ko
CC drivers/scsi/scsi_wait_scan.mod.o
LD [M] drivers/scsi/scsi_wait_scan.ko
CC net/netfilter/xt_mark.mod.o
LD [M] net/netfilter/xt_mark.ko
表示成功
(chroot)livecd linux # cp arch/x86/boot/bzImage /boot/kernel-3.1.10-gentoo-r1
# "x86"根据CPU的不同可能会不同,注意看编译最后的提示;
(chroot)livecd linux # make modules_install
显示:
INSTALL arch/x86/kernel/test_nx.ko
INSTALL drivers/scsi/scsi_wait_scan.ko
INSTALL net/netfilter/xt_mark.ko
DEPMOD 3.1.10-gentoo-r1
表示成功
(chroot)livecd linux # cat /etc/fstab
/dev/sda1 /boot ext3 noauto,noatime 1 2
/dev/sda3 / ext3 noatime 0 1
/dev/sda2 none swap sw 0 0
# 设置密码
(chroot)livecd linux # passwd
# 安装必要的系统工具
(chroot)livecd linux # emerge distcc
显示:
>>> Installing (12 of 12) sys-devel/distcc-3.1-r5
* Compilation and optimization of Python modules for CPython 2.7 ... [ ok ]
*
* IPv6 has not supported yet by distcc-3.1.
*
* Tips on using distcc with Gentoo can be found at
* http://www.gentoo.org/doc/en/distcc.xml
*
* How to use pump mode with Gentoo:
* # distcc-config --set-hosts "foo,cpp,lzo bar,cpp,lzo baz,cpp,lzo"
* # pump emerge -u world
*
* To use the distccmon programs with Gentoo you should use this command:
* # DISTCC_DIR="" distccmon-text 5
*
* ***SECURITY NOTICE***
* If you are upgrading distcc please make sure to run etc-update to
* update your /etc/conf.d/distccd and /etc/init.d/distccd files with
* added security precautions (the --listen and --allow directives)
*
>>> Recording sys-devel/distcc in "world" favorites file...
* Messages for package sys-devel/distcc-3.1-r5:
*
* IPv6 has not supported yet by distcc-3.1.
*
* Tips on using distcc with Gentoo can be found at
* http://www.gentoo.org/doc/en/distcc.xml
*
* How to use pump mode with Gentoo:
* # distcc-config --set-hosts "foo,cpp,lzo bar,cpp,lzo baz,cpp,lzo"
* # pump emerge -u world
*
* To use the distccmon programs with Gentoo you should use this command:
* # DISTCC_DIR="" distccmon-text 5
*
* ***SECURITY NOTICE***
* If you are upgrading distcc please make sure to run etc-update to
* update your /etc/conf.d/distccd and /etc/init.d/distccd files with
* added security precautions (the --listen and --allow directives)
*
>>> Auto-cleaning packages...
>>> No outdated packages were found on your system.
* Regenerating GNU info directory index...
* Processed 66 info files.
* IMPORTANT: 2 news items need reading for repository 'gentoo'.
* Use eselect news to read news items.
表示成功
(chroot)livecd linux # distcc-config --set-hosts "192.168.100.10"
(chroot)livecd linux # emerge syslog-ng logrotate vim dhcpcd grub gentoolkit pciutils
显示:
>>> Installing (40 of 41) app-editors/vim-7.3.266
* Updating documentation tags in /usr/share/vim/vim73
* The 'X' USE flag enables vim <-> X communication, like
* updating the xterm titlebar. It does not install a GUI.
* To install a GUI version of vim, use the app-editors/gvim
* package.
* Vim 7 includes an integrated spell checker. You need to install
* word list files before you can use it. There are ebuilds for
* some of these named app-vim/vim-spell-*. If your language of
* choice is not included, please consult vim-spell.eclass for
* instructions on how to make a package.
* Note that the English word lists are no longer installed by
* default.
* To see what's new in this release, use :help version7.txt
* Calling eselect vi update...
>>> Recording app-editors/vim in "world" favorites file...
>>> Emerging (41 of 41) app-vim/gentoo-syntax-20101212
* gentoo-syntax-20101212.tar.bz2 RMD160 SHA1 SHA256 size ;-) ... [ ok ]
>>> Unpacking source...
>>> Unpacking gentoo-syntax-20101212.tar.bz2 to /var/tmp/portage/app-vim/gentoo-syntax-20101212/work
>>> Source unpacked in /var/tmp/portage/app-vim/gentoo-syntax-20101212/work
>>> Compiling source in /var/tmp/portage/app-vim/gentoo-syntax-20101212/work/gentoo-syntax-20101212 ...
>>> Source compiled.
>>> Test phase [not enabled]: app-vim/gentoo-syntax-20101212
>>> Install gentoo-syntax-20101212 into /var/tmp/portage/app-vim/gentoo-syntax-20101212/image/ category app-vim
* Fixing file permissions ... [ ok ]
>>> Completed installing gentoo-syntax-20101212 into /var/tmp/portage/app-vim/gentoo-syntax-20101212/image/
>>> Installing (41 of 41) app-vim/gentoo-syntax-20101212
* Updating documentation tags in /usr/share/vim/vim73
*
* This plugin provides documentation via vim's help system. To
* view it, use:
* :help gentoo-syntax
*
* This plugin makes use of filetype settings. To enable these,
* add lines like:
* filetype plugin on
* filetype indent on
* to your ~/.vimrc file.
*
* Note for developers and anyone else who edits ebuilds:
* This release of gentoo-syntax now contains filetype rules to set
* fileencoding for ebuilds and ChangeLogs to utf-8 as per GLEP 31.
* If you find this feature breaks things, please submit a bug and
* assign it to vim@gentoo.org. You can use the 'ignore-glep31' USE
* flag to remove these rules.
* Messages for package net-misc/dhcpcd-5.2.12:
* You have installed dhcpcd with zeroconf support.
* This means that it will always obtain an IP address even if no
* DHCP server can be contacted, which will break any existing
* failover support you may have configured in your net configuration.
* This behaviour can be controlled with the -L flag.
* See the dhcpcd man page for more details.
*
* Users upgrading from 4.0 series should pay attention to removal
* of compat useflag. This changes behavior of dhcp in wide manner:
* dhcpcd no longer sends a default ClientID for ethernet interfaces.
* This is so we can re-use the address the kernel DHCP client found.
* To retain the old behaviour of sending a default ClientID based on the
* hardware address for interface, simply add the keyword clientid
* to dhcpcd.conf or use commandline parameter -I ''
*
* Also, users upgrading from 4.0 series should be aware that
* the -N, -R and -Y command line options no longer exist.
* These are controled now by nohook options in dhcpcd.conf.
* Messages for package sys-boot/grub-0.97-r10:
* Fallback PaX marking -m
* /var/tmp/portage/sys-boot/grub-0.97-r10/image//sbin/grub
*
* To avoid automounting and auto(un)installing with /boot,
* just export the DONT_MOUNT_BOOT variable.
*
*
* To avoid automounting and auto(un)installing with /boot,
* just export the DONT_MOUNT_BOOT variable.
*
* To interactively install grub files to another device such as a USB
* stick, just run the following and specify the directory as prompted:
* emerge --config =grub-0.97-r10
* Alternately, you can export GRUB_ALT_INSTALLDIR=/path/to/use to tell
* grub where to install in a non-interactive way.
* Messages for package sys-apps/pciutils-3.1.7:
* Providing a backwards compatibility non-compressed pci.ids
* The 'pcimodules' program has been replaced by 'lspci -k'
* Messages for package dev-util/ctags-5.8:
* You can set the version to be started by /usr/bin/ctags through
* the ctags eselect module. "man ctags.eselect" for details.
* Messages for package app-admin/syslog-ng-3.2.5:
* It is highly recommended that app-admin/logrotate be emerged to
* manage the log files. syslog-ng installs a file in /etc/logrotate.d
* for logrotate to use.
* Messages for package app-admin/logrotate-3.8.0:
* If you wish to have logrotate e-mail you updates, please
* emerge virtual/mailx and configure logrotate in
* /etc/logrotate.conf appropriately
*
* Additionally, /etc/logrotate.conf may need to be modified
* for your particular needs. See man logrotate for details.
* Messages for package x11-proto/xcb-proto-1.6-r2:
* Deleting byte-compiled Python modules needlessly generated by build system:
* /var/tmp/portage/x11-proto/xcb-proto-1.6-r2/image/usr/lib/python2.7/site-packages/xcbgen/state.pyc
* /var/tmp/portage/x11-proto/xcb-proto-1.6-r2/image/usr/lib/python2.7/site-packages/xcbgen/matcher.pyc
* /var/tmp/portage/x11-proto/xcb-proto-1.6-r2/image/usr/lib/python2.7/site-packages/xcbgen/expr.pyc
* /var/tmp/portage/x11-proto/xcb-proto-1.6-r2/image/usr/lib/python2.7/site-packages/xcbgen/xtypes.pyc
* /var/tmp/portage/x11-proto/xcb-proto-1.6-r2/image/usr/lib/python2.7/site-packages/xcbgen/expr.pyo
* /var/tmp/portage/x11-proto/xcb-proto-1.6-r2/image/usr/lib/python2.7/site-packages/xcbgen/state.pyo
* /var/tmp/portage/x11-proto/xcb-proto-1.6-r2/image/usr/lib/python2.7/site-packages/xcbgen/xtypes.pyo
* /var/tmp/portage/x11-proto/xcb-proto-1.6-r2/image/usr/lib/python2.7/site-packages/xcbgen/__init__.pyo
* /var/tmp/portage/x11-proto/xcb-proto-1.6-r2/image/usr/lib/python2.7/site-packages/xcbgen/error.pyo
* /var/tmp/portage/x11-proto/xcb-proto-1.6-r2/image/usr/lib/python2.7/site-packages/xcbgen/matcher.pyo
* /var/tmp/portage/x11-proto/xcb-proto-1.6-r2/image/usr/lib/python2.7/site-packages/xcbgen/error.pyc
* /var/tmp/portage/x11-proto/xcb-proto-1.6-r2/image/usr/lib/python2.7/site-packages/xcbgen/__init__.pyc
* Please rebuild both libxcb and xcb-util if you are upgrading from version 1.6
* Messages for package app-portage/gentoolkit-0.3.0.4-r5:
*
* glsa-check since gentoolkit 0.3 has modified some output,
* options and default behavior. The list of injected GLSAs
* has moved to /var/lib/portage/glsa_injected, please
* run 'glsa-check -p affected' before copying the existing checkfile.
* Messages for package x11-libs/libxcb-1.7:
* Running elibtoolize in: libxcb-1.7/
* We've already been run in this tree; you should
* avoid this if possible (perhaps by filing a bug)
* Messages for package x11-libs/libX11-1.4.4:
* Running elibtoolize in: libX11-1.4.4/
* We've already been run in this tree; you should
* avoid this if possible (perhaps by filing a bug)
* Messages for package app-editors/vim-core-7.3.266:
* Vim 7 includes an integrated spell checker. You need to install
* word list files before you can use it. There are ebuilds for
* some of these named app-vim/vim-spell-*. If your language of
* choice is not included, please consult vim-spell.eclass for
* instructions on how to make a package.
* Note that the English word lists are no longer installed by
* default.
* Messages for package app-editors/vim-7.3.266:
* The 'X' USE flag enables vim <-> X communication, like
* updating the xterm titlebar. It does not install a GUI.
* To install a GUI version of vim, use the app-editors/gvim
* package.
* Vim 7 includes an integrated spell checker. You need to install
* word list files before you can use it. There are ebuilds for
* some of these named app-vim/vim-spell-*. If your language of
* choice is not included, please consult vim-spell.eclass for
* instructions on how to make a package.
* Note that the English word lists are no longer installed by
* default.
* To see what's new in this release, use :help version7.txt
* Messages for package app-vim/gentoo-syntax-20101212:
*
* This plugin provides documentation via vim's help system. To
* view it, use:
* :help gentoo-syntax
*
* This plugin makes use of filetype settings. To enable these,
* add lines like:
* filetype plugin on
* filetype indent on
* to your ~/.vimrc file.
*
* Note for developers and anyone else who edits ebuilds:
* This release of gentoo-syntax now contains filetype rules to set
* fileencoding for ebuilds and ChangeLogs to utf-8 as per GLEP 31.
* If you find this feature breaks things, please submit a bug and
* assign it to vim@gentoo.org. You can use the 'ignore-glep31' USE
* flag to remove these rules.
>>> Auto-cleaning packages...
>>> No outdated packages were found on your system.
* Regenerating GNU info directory index...
* Processed 74 info files.
* IMPORTANT: 2 news items need reading for repository 'gentoo'.
* Use eselect news to read news items.
表示成功
(chroot)livecd linux # rc-update add sshd default
显示:
* service sshd added to runlevel default
表示成功
(chroot)livecd linux # rc-update add syslog-ng default
显示:
* service syslog-ng added to runlevel default
表示成功
# 配置启动
# 修改新系统的/boot/grub/grub.conf
default 0
timeout 5
title Gentoo Linux 3.1.10-r1
root (hd0,0)
kernel /boot/kernel-3.1.10-gentoo-r1 root=/dev/sda3
title Gentoo Linux 3.1.10-r1(rescue)
root (hd0,0)
kernel /boot/kernel-3.1.10-gentoo-r1 root=/dev/sda3 init=/bin/bb
# 修改新系统的/boot/grub/device.map,去掉fd0
(chroot)livecd ~ grep -v rootfs /proc/mounts > /etc/mtab
(chroot)livecd ~ grub-install --no-floppy /dev/sda
# 重启更新系统
(chroot)livecd linux # exit
livecd gentoo # reboot
# 从硬盘启动系统
# 输入账户,密码
# 配置网卡
livecd ~ # dhcpcd eth0
显示:offered 192.168.100.230 from 192.168.100.1 表示成功 #不同的机子ip不同
# 把配置网络设置为自动启动
livecd ~ # cd /etc/init.d
livecd init.d # ln -s net.lo net.eth0
livecd init.d # rc-update add net.eth0 boot
# 配置tomcat,apache...
livecd ~ # rc-update add apache2 default
livecd ~ # rc-update add tomcat-6 default
# 修改/etc/tomcat-6/tomcat-users.xml
<role rolename="manager"/>
<role rolename="admin"/>
<user username="arlen" password="iloveu" roles="manager,admin"/>
# 进入http://www:8080/manager/html,发布smarthome.war
# 修改/etc/conf.d/apache2
livecd conf.d # grep APACHE2_OPTS /etc/conf.d/apache2
APACHE2_OPTS="-D DEFAULT_VHOST -D INFO -D SSL -D SSL_DEFAULT_VHOST -D LANGUAGE -D PHP5 -D JK"
# 修改/etc/apache2/jk-workers.properties
# 修改/etc/apache2/vhosts.d/00_default_vhost.conf
JkMount /smarthome/* balancer
JkMount /jks jk-status
# 重启tomcat,apache,使用http://www/smarthome/*可以转给tomcat处理了
livecd ~ # dhcpcd eth0
显示:offered 192.168.100.230 from 192.168.100.1 表示成功 #不同的机子ip不同
# 启动ssh服务
livecd ~ # /eth/init.d/sshd start
# 设置密码
livecd ~ # passwd
# 使用putty登录
# ip地址是刚才配置网卡时自动分配的ip地址 本机是192.168.100.230 #不同的机子ip不同
# 磁盘分区
livecd ~ # fdisk /dev/sda
提示:按M查看帮助
用n分好区,然后输入a设置sda1为启动分区,输入t再输入82设置sda2为交换分区
然后w保存退出
显示:
Disk /dev/sda: 4034 MB, 4034838528 bytes
255 heads, 63 sectors/track, 490 cylinders, total 7880544 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
Device Boot Start End Blocks Id System
/dev/sda1 * 2048 133119 65536 83 Linux
/dev/sda2 133120 264191 65536 82 Linux swap / Solaris
/dev/sda3 264192 7880543 3808176 83 Linux
表示成功
# 创建文件系统
livecd ~ # mke2fs -j /dev/sda1
显示:
Writing inode tables: done
Writing superblocks and filesystem accounting information: done
表示成功
livecd ~ # mke2fs -j -N 600000 /dev/sda3
显示:
Writing inode tables: done
Creating journal (16384 blocks): done
Writing superblocks and filesystem accounting information: done
表示成功
livecd ~ # mkswap /dev/sda2
显示:
Setting up swapspace version 1, size = 65532 KiB
no label, UUID=86f7c61e-8104-41a3-ada8-7afdff98a548 #ID号每次都不一样
表示成功
livecd ~ # mount /dev/sda3 /mnt/gentoo
livecd ~ # mkdir /mnt/gentoo/boot
livecd ~ # mount /dev/sda1 /mnt/gentoo/boot
livecd ~ # swapon /dev/sda2
# 使用psftp传输文件
#本地运行cmd进入命令行
C:\Users\Administrator>cd C:\Users\Administrator\Desktop\Linux # C:\Users\Administrator\Desktop\Linux 是我要传输的本地文件所在path
C:\Users\Administrator\Desktop\Linux>psftp 192.168.100.230
login as: root
Using keyboard-interactive authentication.
Password:
Remote working directory is /root
psftp> cd /mnt/gentoo
Remote directory is now /mnt/gentoo
psftp> mput *.bz2
local:portage-20120128.tar.bz2 => remote:/mnt/gentoo/portage-20120128.tar.bz2
local:stage3-i686-20120124.tar.bz2 => remote:/mnt/gentoo/stage3-i686-20120124.tar.bz2
psftp>
表示成功
# 解压stage3和portage
livecd ~ # cd /mnt/gentoo/
livecd gentoo # tar xvjpf stage3-i686-20120124.tar.bz2
# x表示解开(Extract),
# v表示详细信息(Verbose)可以用来查看解压缩时发生了什么(可选参数),
# j表示使用bzip2解压缩,
# p表示保留权限(Preserve permissions),
# 还有f表示我们要解开一个文件,而不是标准输入。
livecd gentoo # tar xvjf portage-20120128.tar.bz2 -C /mnt/gentoo/usr
livecd gentoo # chmod 1777 /mnt/gentoo/tmp
# 挂载/proc和/dev文件系统
livecd gentoo # mount -t proc none /mnt/gentoo/proc
livecd gentoo # mount -o bind /dev /mnt/gentoo/dev
# 进入新的系统环境
livecd gentoo # chroot /mnt/gentoo /bin/bash
livecd / # env-update
提示:>>> Regenerating /etc/ld.so.cache...
表示成功
livecd / # source /etc/profile
livecd / # export PS1="(chroot)$PS1"
# 修改新系统的编译选项/etc/make.conf
# 选项文件/etc/make.conf;
(chroot)livecd ~ # cat /etc/make.conf
CFLAGS="-O2 -march=i686 -pipe"
CXXFLAGS="${CFLAGS}"
CHOST="i686-pc-linux-gnu"
MAKEOPTS="-j4"
GENTOO_MIRRORS="http://192.168.100.10/ http://mirrors.xmu.edu.cn/gentoo/"
USE="-gnome -kde -qt3 -qt4 X tomcat php apache2 mysql java6 java gd hal startup-notification"
# 修改新系统的glibc Locales
# 文件/etc/locale.gen
(chroot)livecd ~ # cat /etc/locale.gen
en_US ISO-8859-1
en_US.UTF-8 UTF-8
zh_CN GBK
zh_CN.UTF-8 UTF-8
# 修改时区
(chroot)livecd ~ cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
# 安装源码编译内核
# 使用putty登录时,某些终端类型如xterm-color会导致man页面乱码,用xterm就可以
(chroot)livecd ~ emerge gentoo-sources
显示
Installing (1 of 1) sys-kernel/gentoo-sources-3.1.10-r1
* If you are upgrading from a previous kernel, you may be interested
* in the following document:
* - General upgrade guide: http://www.gentoo.org/doc/en/kernel-upgrade.xml
* For more info on this patchset, and how to report problems, see:
* http://dev.gentoo.org/~mpagano/genpatches
>>> Recording sys-kernel/gentoo-sources in "world" favorites file...
* Messages for package sys-kernel/gentoo-sources-3.1.10-r1:
* If you are upgrading from a previous kernel, you may be interested
* in the following document:
* - General upgrade guide: http://www.gentoo.org/doc/en/kernel-upgrade.xml
表示成功
(chroot)livecd ~ cd /usr/src/linux
(chroot)livecd linux # make menuconfig
提示:File systems ---> <*> Second extended fs support
[ ] Ext2 Security Labels (NEW)
Device Drivers --->
# 检查以下内核选项
# Processor type and features ---> Processor family
# Device Drivers
# 去掉不需要的驱动;
# 确保开了LVM2,默认有开;
# 确保自己使用的网卡有选上,使用lspci可以查看检测到的硬件;
(chroot)livecd linux # make
显示:
LD arch/x86/boot/setup.elf
OBJCOPY arch/x86/boot/setup.bin
OBJCOPY arch/x86/boot/vmlinux.bin
HOSTCC arch/x86/boot/tools/build
BUILD arch/x86/boot/bzImage
Setup is 12668 bytes (padded to 12800 bytes).
System is 4819 kB
CRC f2082df7
Kernel: arch/x86/boot/bzImage is ready (#1)
Building modules, stage 2.
MODPOST 3 modules
CC arch/x86/kernel/test_nx.mod.o
LD [M] arch/x86/kernel/test_nx.ko
CC drivers/scsi/scsi_wait_scan.mod.o
LD [M] drivers/scsi/scsi_wait_scan.ko
CC net/netfilter/xt_mark.mod.o
LD [M] net/netfilter/xt_mark.ko
表示成功
(chroot)livecd linux # cp arch/x86/boot/bzImage /boot/kernel-3.1.10-gentoo-r1
# "x86"根据CPU的不同可能会不同,注意看编译最后的提示;
(chroot)livecd linux # make modules_install
显示:
INSTALL arch/x86/kernel/test_nx.ko
INSTALL drivers/scsi/scsi_wait_scan.ko
INSTALL net/netfilter/xt_mark.ko
DEPMOD 3.1.10-gentoo-r1
表示成功
(chroot)livecd linux # cat /etc/fstab
/dev/sda1 /boot ext3 noauto,noatime 1 2
/dev/sda3 / ext3 noatime 0 1
/dev/sda2 none swap sw 0 0
# 设置密码
(chroot)livecd linux # passwd
# 安装必要的系统工具
(chroot)livecd linux # emerge distcc
显示:
>>> Installing (12 of 12) sys-devel/distcc-3.1-r5
* Compilation and optimization of Python modules for CPython 2.7 ... [ ok ]
*
* IPv6 has not supported yet by distcc-3.1.
*
* Tips on using distcc with Gentoo can be found at
* http://www.gentoo.org/doc/en/distcc.xml
*
* How to use pump mode with Gentoo:
* # distcc-config --set-hosts "foo,cpp,lzo bar,cpp,lzo baz,cpp,lzo"
* # pump emerge -u world
*
* To use the distccmon programs with Gentoo you should use this command:
* # DISTCC_DIR="" distccmon-text 5
*
* ***SECURITY NOTICE***
* If you are upgrading distcc please make sure to run etc-update to
* update your /etc/conf.d/distccd and /etc/init.d/distccd files with
* added security precautions (the --listen and --allow directives)
*
>>> Recording sys-devel/distcc in "world" favorites file...
* Messages for package sys-devel/distcc-3.1-r5:
*
* IPv6 has not supported yet by distcc-3.1.
*
* Tips on using distcc with Gentoo can be found at
* http://www.gentoo.org/doc/en/distcc.xml
*
* How to use pump mode with Gentoo:
* # distcc-config --set-hosts "foo,cpp,lzo bar,cpp,lzo baz,cpp,lzo"
* # pump emerge -u world
*
* To use the distccmon programs with Gentoo you should use this command:
* # DISTCC_DIR="" distccmon-text 5
*
* ***SECURITY NOTICE***
* If you are upgrading distcc please make sure to run etc-update to
* update your /etc/conf.d/distccd and /etc/init.d/distccd files with
* added security precautions (the --listen and --allow directives)
*
>>> Auto-cleaning packages...
>>> No outdated packages were found on your system.
* Regenerating GNU info directory index...
* Processed 66 info files.
* IMPORTANT: 2 news items need reading for repository 'gentoo'.
* Use eselect news to read news items.
表示成功
(chroot)livecd linux # distcc-config --set-hosts "192.168.100.10"
(chroot)livecd linux # emerge syslog-ng logrotate vim dhcpcd grub gentoolkit pciutils
显示:
>>> Installing (40 of 41) app-editors/vim-7.3.266
* Updating documentation tags in /usr/share/vim/vim73
* The 'X' USE flag enables vim <-> X communication, like
* updating the xterm titlebar. It does not install a GUI.
* To install a GUI version of vim, use the app-editors/gvim
* package.
* Vim 7 includes an integrated spell checker. You need to install
* word list files before you can use it. There are ebuilds for
* some of these named app-vim/vim-spell-*. If your language of
* choice is not included, please consult vim-spell.eclass for
* instructions on how to make a package.
* Note that the English word lists are no longer installed by
* default.
* To see what's new in this release, use :help version7.txt
* Calling eselect vi update...
>>> Recording app-editors/vim in "world" favorites file...
>>> Emerging (41 of 41) app-vim/gentoo-syntax-20101212
* gentoo-syntax-20101212.tar.bz2 RMD160 SHA1 SHA256 size ;-) ... [ ok ]
>>> Unpacking source...
>>> Unpacking gentoo-syntax-20101212.tar.bz2 to /var/tmp/portage/app-vim/gentoo-syntax-20101212/work
>>> Source unpacked in /var/tmp/portage/app-vim/gentoo-syntax-20101212/work
>>> Compiling source in /var/tmp/portage/app-vim/gentoo-syntax-20101212/work/gentoo-syntax-20101212 ...
>>> Source compiled.
>>> Test phase [not enabled]: app-vim/gentoo-syntax-20101212
>>> Install gentoo-syntax-20101212 into /var/tmp/portage/app-vim/gentoo-syntax-20101212/image/ category app-vim
* Fixing file permissions ... [ ok ]
>>> Completed installing gentoo-syntax-20101212 into /var/tmp/portage/app-vim/gentoo-syntax-20101212/image/
>>> Installing (41 of 41) app-vim/gentoo-syntax-20101212
* Updating documentation tags in /usr/share/vim/vim73
*
* This plugin provides documentation via vim's help system. To
* view it, use:
* :help gentoo-syntax
*
* This plugin makes use of filetype settings. To enable these,
* add lines like:
* filetype plugin on
* filetype indent on
* to your ~/.vimrc file.
*
* Note for developers and anyone else who edits ebuilds:
* This release of gentoo-syntax now contains filetype rules to set
* fileencoding for ebuilds and ChangeLogs to utf-8 as per GLEP 31.
* If you find this feature breaks things, please submit a bug and
* assign it to vim@gentoo.org. You can use the 'ignore-glep31' USE
* flag to remove these rules.
* Messages for package net-misc/dhcpcd-5.2.12:
* You have installed dhcpcd with zeroconf support.
* This means that it will always obtain an IP address even if no
* DHCP server can be contacted, which will break any existing
* failover support you may have configured in your net configuration.
* This behaviour can be controlled with the -L flag.
* See the dhcpcd man page for more details.
*
* Users upgrading from 4.0 series should pay attention to removal
* of compat useflag. This changes behavior of dhcp in wide manner:
* dhcpcd no longer sends a default ClientID for ethernet interfaces.
* This is so we can re-use the address the kernel DHCP client found.
* To retain the old behaviour of sending a default ClientID based on the
* hardware address for interface, simply add the keyword clientid
* to dhcpcd.conf or use commandline parameter -I ''
*
* Also, users upgrading from 4.0 series should be aware that
* the -N, -R and -Y command line options no longer exist.
* These are controled now by nohook options in dhcpcd.conf.
* Messages for package sys-boot/grub-0.97-r10:
* Fallback PaX marking -m
* /var/tmp/portage/sys-boot/grub-0.97-r10/image//sbin/grub
*
* To avoid automounting and auto(un)installing with /boot,
* just export the DONT_MOUNT_BOOT variable.
*
*
* To avoid automounting and auto(un)installing with /boot,
* just export the DONT_MOUNT_BOOT variable.
*
* To interactively install grub files to another device such as a USB
* stick, just run the following and specify the directory as prompted:
* emerge --config =grub-0.97-r10
* Alternately, you can export GRUB_ALT_INSTALLDIR=/path/to/use to tell
* grub where to install in a non-interactive way.
* Messages for package sys-apps/pciutils-3.1.7:
* Providing a backwards compatibility non-compressed pci.ids
* The 'pcimodules' program has been replaced by 'lspci -k'
* Messages for package dev-util/ctags-5.8:
* You can set the version to be started by /usr/bin/ctags through
* the ctags eselect module. "man ctags.eselect" for details.
* Messages for package app-admin/syslog-ng-3.2.5:
* It is highly recommended that app-admin/logrotate be emerged to
* manage the log files. syslog-ng installs a file in /etc/logrotate.d
* for logrotate to use.
* Messages for package app-admin/logrotate-3.8.0:
* If you wish to have logrotate e-mail you updates, please
* emerge virtual/mailx and configure logrotate in
* /etc/logrotate.conf appropriately
*
* Additionally, /etc/logrotate.conf may need to be modified
* for your particular needs. See man logrotate for details.
* Messages for package x11-proto/xcb-proto-1.6-r2:
* Deleting byte-compiled Python modules needlessly generated by build system:
* /var/tmp/portage/x11-proto/xcb-proto-1.6-r2/image/usr/lib/python2.7/site-packages/xcbgen/state.pyc
* /var/tmp/portage/x11-proto/xcb-proto-1.6-r2/image/usr/lib/python2.7/site-packages/xcbgen/matcher.pyc
* /var/tmp/portage/x11-proto/xcb-proto-1.6-r2/image/usr/lib/python2.7/site-packages/xcbgen/expr.pyc
* /var/tmp/portage/x11-proto/xcb-proto-1.6-r2/image/usr/lib/python2.7/site-packages/xcbgen/xtypes.pyc
* /var/tmp/portage/x11-proto/xcb-proto-1.6-r2/image/usr/lib/python2.7/site-packages/xcbgen/expr.pyo
* /var/tmp/portage/x11-proto/xcb-proto-1.6-r2/image/usr/lib/python2.7/site-packages/xcbgen/state.pyo
* /var/tmp/portage/x11-proto/xcb-proto-1.6-r2/image/usr/lib/python2.7/site-packages/xcbgen/xtypes.pyo
* /var/tmp/portage/x11-proto/xcb-proto-1.6-r2/image/usr/lib/python2.7/site-packages/xcbgen/__init__.pyo
* /var/tmp/portage/x11-proto/xcb-proto-1.6-r2/image/usr/lib/python2.7/site-packages/xcbgen/error.pyo
* /var/tmp/portage/x11-proto/xcb-proto-1.6-r2/image/usr/lib/python2.7/site-packages/xcbgen/matcher.pyo
* /var/tmp/portage/x11-proto/xcb-proto-1.6-r2/image/usr/lib/python2.7/site-packages/xcbgen/error.pyc
* /var/tmp/portage/x11-proto/xcb-proto-1.6-r2/image/usr/lib/python2.7/site-packages/xcbgen/__init__.pyc
* Please rebuild both libxcb and xcb-util if you are upgrading from version 1.6
* Messages for package app-portage/gentoolkit-0.3.0.4-r5:
*
* glsa-check since gentoolkit 0.3 has modified some output,
* options and default behavior. The list of injected GLSAs
* has moved to /var/lib/portage/glsa_injected, please
* run 'glsa-check -p affected' before copying the existing checkfile.
* Messages for package x11-libs/libxcb-1.7:
* Running elibtoolize in: libxcb-1.7/
* We've already been run in this tree; you should
* avoid this if possible (perhaps by filing a bug)
* Messages for package x11-libs/libX11-1.4.4:
* Running elibtoolize in: libX11-1.4.4/
* We've already been run in this tree; you should
* avoid this if possible (perhaps by filing a bug)
* Messages for package app-editors/vim-core-7.3.266:
* Vim 7 includes an integrated spell checker. You need to install
* word list files before you can use it. There are ebuilds for
* some of these named app-vim/vim-spell-*. If your language of
* choice is not included, please consult vim-spell.eclass for
* instructions on how to make a package.
* Note that the English word lists are no longer installed by
* default.
* Messages for package app-editors/vim-7.3.266:
* The 'X' USE flag enables vim <-> X communication, like
* updating the xterm titlebar. It does not install a GUI.
* To install a GUI version of vim, use the app-editors/gvim
* package.
* Vim 7 includes an integrated spell checker. You need to install
* word list files before you can use it. There are ebuilds for
* some of these named app-vim/vim-spell-*. If your language of
* choice is not included, please consult vim-spell.eclass for
* instructions on how to make a package.
* Note that the English word lists are no longer installed by
* default.
* To see what's new in this release, use :help version7.txt
* Messages for package app-vim/gentoo-syntax-20101212:
*
* This plugin provides documentation via vim's help system. To
* view it, use:
* :help gentoo-syntax
*
* This plugin makes use of filetype settings. To enable these,
* add lines like:
* filetype plugin on
* filetype indent on
* to your ~/.vimrc file.
*
* Note for developers and anyone else who edits ebuilds:
* This release of gentoo-syntax now contains filetype rules to set
* fileencoding for ebuilds and ChangeLogs to utf-8 as per GLEP 31.
* If you find this feature breaks things, please submit a bug and
* assign it to vim@gentoo.org. You can use the 'ignore-glep31' USE
* flag to remove these rules.
>>> Auto-cleaning packages...
>>> No outdated packages were found on your system.
* Regenerating GNU info directory index...
* Processed 74 info files.
* IMPORTANT: 2 news items need reading for repository 'gentoo'.
* Use eselect news to read news items.
表示成功
(chroot)livecd linux # rc-update add sshd default
显示:
* service sshd added to runlevel default
表示成功
(chroot)livecd linux # rc-update add syslog-ng default
显示:
* service syslog-ng added to runlevel default
表示成功
# 配置启动
# 修改新系统的/boot/grub/grub.conf
default 0
timeout 5
title Gentoo Linux 3.1.10-r1
root (hd0,0)
kernel /boot/kernel-3.1.10-gentoo-r1 root=/dev/sda3
title Gentoo Linux 3.1.10-r1(rescue)
root (hd0,0)
kernel /boot/kernel-3.1.10-gentoo-r1 root=/dev/sda3 init=/bin/bb
# 修改新系统的/boot/grub/device.map,去掉fd0
(chroot)livecd ~ grep -v rootfs /proc/mounts > /etc/mtab
(chroot)livecd ~ grub-install --no-floppy /dev/sda
# 重启更新系统
(chroot)livecd linux # exit
livecd gentoo # reboot
# 从硬盘启动系统
# 输入账户,密码
# 配置网卡
livecd ~ # dhcpcd eth0
显示:offered 192.168.100.230 from 192.168.100.1 表示成功 #不同的机子ip不同
# 把配置网络设置为自动启动
livecd ~ # cd /etc/init.d
livecd init.d # ln -s net.lo net.eth0
livecd init.d # rc-update add net.eth0 boot
# 配置tomcat,apache...
livecd ~ # rc-update add apache2 default
livecd ~ # rc-update add tomcat-6 default
# 修改/etc/tomcat-6/tomcat-users.xml
<role rolename="manager"/>
<role rolename="admin"/>
<user username="arlen" password="iloveu" roles="manager,admin"/>
# 进入http://www:8080/manager/html,发布smarthome.war
# 修改/etc/conf.d/apache2
livecd conf.d # grep APACHE2_OPTS /etc/conf.d/apache2
APACHE2_OPTS="-D DEFAULT_VHOST -D INFO -D SSL -D SSL_DEFAULT_VHOST -D LANGUAGE -D PHP5 -D JK"
# 修改/etc/apache2/jk-workers.properties
# 修改/etc/apache2/vhosts.d/00_default_vhost.conf
JkMount /smarthome/* balancer
JkMount /jks jk-status
# 重启tomcat,apache,使用http://www/smarthome/*可以转给tomcat处理了
相关推荐
本文将详细介绍如何在 VMware 上安装 Gentoo Linux,一个高度自定义和面向源码编译的 Linux 发行版。Gentoo 的安装过程相对复杂,但提供了极大的灵活性和性能优化的可能性。 首先,了解一些基本概念。源码编译是 ...
在本文中,我们将深入探讨如何在VMware中安装Gentoo Linux,这是一个高度可定制的Linux发行版,因其独特的Portage包管理系统而受到许多高级用户的青睐。以下是对安装过程的详细解析: 首先,选择Gentoo的原因有多个...
在安装基本系统后,需要配置 Portage 来管理软件包的安装和更新。 - **基本系统**:安装并配置完 Stage3 文件后,用户将获得一个基础的 Gentoo 系统。这个阶段的系统已经具备运行基本功能的能力,但仍需进一步配置。...
在安装Gentoo Linux的过程中,你需要遵循以下步骤: 1. **选择安装方式**:Gentoo提供了多种安装方法,通常推荐使用最小安装光盘开始。 2. **配置网络**:安装前,确保网络设置正确,以便下载最新源代码。 3. **...
在安装 Gentoo Linux 之前,需要满足以下硬件需求: * CPU:i486 或更新、i686 或更新 * 内存:64MB 或 256MB * 硬盘空间:1.5GB(不包括交换分区) * 交换分区:至少 256MB Gentoo 安装光盘 Gentoo 安装光盘是可...
6. **配置网络**: 在安装过程中,你需要联网以获取最新的源代码和软件包。可以通过DHCP自动获取IP地址,或者手动设置静态IP。 7. **编译内核**: Gentoo的kernel-config工具可以帮助你创建一个定制的内核配置,确保...
在安装完X11基础组件后,用户可以选择安装x11-base/xorg-server。这个软件包是X服务器的实现,它负责管理与客户端应用程序的通信以及与硬件的交互。如果用户选择安装xorg-server,应确保更新环境变量,以便系统能够...
《Gentoo安装手册》是针对Gentoo Linux操作系统的一份详尽指南,旨在帮助用户完成从下载到安装,再到配置的全过程。这份手册由Gentoo官方提供,经过整理,适合打印以便线下查阅。 在Gentoo Handbook中,首先介绍了...
gengoo linux硬盘安装的详细文档,安装windows xp和gentoo linux双系统,无需光驱,只要将ISO文件解压到C盘根目录,C可以是NTFS分区
在进行Gentoo Linux的安装之前,需要做好充分的准备工作: 1. **下载安装介质**:通常有两种选择——Minimal CD或Stage 3 Tarball。Minimal CD非常小,仅包含最基本的工具和文档;而Stage 3 Tarball则包含了预构建的...
在VMware下通过字符界面安装Gentoo,脱离图形界面了解linux安装过程
在sun服务器上安装gentoo linux 2007 目前sun服务器只能安装gentoo debian
### 安装 Gentoo Linux 详尽步骤 Gentoo 是一款高度可定制的 Linux 发行版,适合那些希望深入掌握系统运作原理并对系统进行精细调整的用户。本篇文章将根据给定的文档资料,详细介绍如何从零开始安装 Gentoo Linux...
免提安装gentoo. vmware 虚拟机底下免手动快速安装gentoo基础系统_hfig
Gentoo Linux 是一个高度自定制的Linux发行版,它的安装过程相对复杂但灵活,允许用户根据自己的需求选择编译和配置软件包。以下是对Gentoo图解安装手册中涉及的知识点的详细说明: 1. **LiveCD启动**:Gentoo提供...
与其他预编译二进制包的发行版不同,Gentoo 的安装和软件管理过程涉及到编译和配置源代码,这使得用户能够根据自己的需求精确地定制系统。以下是对Gentoo Linux安装和使用的详细讲解。 ### 一、Gentoo Linux的安装 ...
### Gentoo Linux 安装与使用指南 #### 一、安装Gentoo Linux ##### 1.1 关于如何安装Gentoo Linux Gentoo Linux 的安装过程相对较为复杂,但同时也提供了高度的定制性。本节将详细介绍如何通过 gentoo-mini 和 ...
不过,这种定制性使得系统在安装完成后运行速度极快,特别适合对性能有高要求的服务器环境,如Web服务器。Gentoo的Portage系统类似于Red Hat的RPM,允许用户轻松地安装和管理软件包,例如通过`emerge vi`来安装vi...
- 在安装过程中,可能需要了解LVM(逻辑卷管理)、RAID(冗余磁盘阵列)以及UUID(通用唯一标识符)等高级存储技术。 - 对于无网络环境,可以预先下载所需的stage3和软件包到USB设备或另一台电脑,然后通过网络...