|
发表于 2004-10-31 12:55:20
|
显示全部楼层
[quote:3006c7525f="HOUSCOUS"] 我偏要用stage1安装, 直到成功为止. [/quote]
建议试试这两个script,按自己的情况修改一下,script 1:
[code:1] #!/bin/bash
###################################################
# autoo - a script that automates many of the #
# commands required to install a gentoo system. #
# This script does require editing by the user #
# before execution. Stage 1 NPTL installs only. #
###################################################
###################################################
cd /
##################################
# PRE INSTALLATION CONFIGURATION #
##################################
# All of these settings should be altered to
# reflect the state of your system (except STAGE, no other stage is supported).
STAGE="1"
ARCH="athlon-xp"
RELEASE="2004.2"
PRIMARY_MIRROR="ftp://mirror.pacific.net.au/linux/Gentoo"
GENTOO_MIRRORS="ftp://mirror.pacific.net.au/linux/Gentoo"
TIMEZONE="Australia/Sydney"
DEVGENTOO="/dev/hda"
DEVGENTOOROOT="/dev/hda3"
MNTGENTOOROOT="/mnt/gentoo"
DEVGENTOOBOOT="/dev/hda1"
MNTGENTOOBOOT="/mnt/gentoo/boot"
DEVGENTOOSWAP="/dev/hda2"
ROOTBOOTFS="ext3"
CHOST="i686-pc-linux-gnu"
CFLAGS="-O3 -march=athlon-xp -pipe -fomit-frame-pointer"
CXXFLAGS='${CFLAGS}'
MAKEOPTS="-j2"
#######################
# PREPARING THE DISKS #
#######################
#use sfdisk for a more unattended install, otherwise use cfdisk or fdisk (safer when there is another OS already installed - ie dual boot systems)
#cfdisk $DEVGENTOO &&
sfdisk $DEVGENTOO -uM << EOF
,64,L
,512,S
,,L
;
EOF
mkfs.$ROOTBOOTFS $DEVGENTOOBOOT &&
mkfs.$ROOTBOOTFS $DEVGENTOOROOT &&
mkswap $DEVGENTOOSWAP &&
swapon $DEVGENTOOSWAP &&
mount $DEVGENTOOROOT $MNTGENTOOROOT &&
mkdir $MNTGENTOOBOOT &&
mount $DEVGENTOOBOOT $MNTGENTOOBOOT &&
########################################
# INSTALLING GENTOO INSTALLATION FILES #
########################################
cd $MNTGENTOOROOT
cp /mnt/floppy/chrooted ./
wget "$PRIMARY_MIRROR/releases/x86/$RELEASE/stages/$ARCH/stage$STAGE-$ARCH-$RELEASE.tar.bz2" &&
wget "$PRIMARY_MIRROR/releases/x86/$RELEASE/stages/$ARCH/stage$STAGE-$ARCH-$RELEASE.tar.bz2.md5" &&
md5sum -c "stage$STAGE-$ARCH-$RELEASE.tar.bz2.md5" &&
tar -xvjpf "stage$STAGE-$ARCH-$RELEASE.tar.bz2" &&
sed '/CHOST="/d; /CFLAGS="/d; /CXXFLAGS="/d; /MAKEOPTS="/d' $MNTGENTOOROOT/etc/make.conf > $MNTGENTOOROOT/etc/make.conf.dan
cat >> $MNTGENTOOROOT/etc/make.conf.dan << EOF
## Added By Dan's autoo script ##
CHOST="$CHOST"
CFLAGS="$CFLAGS"
CXXFLAGS="$CXXFLAGS"
MAKEOPTS="$MAKEOPTS"
GENTOO_MIRRORS="$GENTOO_MIRRORS"
## End autoo ##
EOF
mv /etc/make.conf.dan /etc/make.conf
####################################
# INSTALLING GENTOO BASE SYSTEM #
####################################
cp -L /etc/resolv.conf $MNTGENTOOROOT/etc/resolv.conf &&
mount -t proc none $MNTGENTOOROOT/proc &&
chroot $MNTGENTOOROOT /chrooted
#See what happens in "chrooted" script
#Optional: Rebooting after install
#cd
#umount $MNTGENTOOBOOT $MNTGENTOOROOT/proc $MNTGENTOOROOT
#reboot [/code:1]
chroot后执行script 2:
[code:1]#!/bin/bash
env-uptdate &&
source /etc/profile &&
TIMEZONE="Australia/Sydney"
HOSTNAME="tux"
DNSDOMAINNAME="homenetwork"
DEVGENTOO="/dev/hda"
DEVGENTOOROOT="/dev/hda4"
MNTGENTOOROOT="/mnt/gentoo"
DEVGENTOOBOOT="/dev/hda2"
MNTGENTOOBOOT="/mnt/gentoo/boot"
DEVGENTOOSWAP="/dev/hda3"
USE="3dnow X acpi alsa arts cdr cups dvb dvd dvdr gif gpm gtk2 jack java jpeg kde mmx mpeg nptl oggvorbis opengl pam png python qt quicktime sdl slang spell sse ssl svga tcltk tcpd tiff truetype xml2 xmms xv zlib"
SOURCES="gentoo-dev-sources"
emerge sync &&
sed '/USE="/d' /etc/make.conf > /etc/make.conf.dan &&
echo "USE=$USE" >> /etc/make.conf.dan &&
mv /etc/make.conf.dan /etc/make.conf &&
#Courtesy of ali3nx and a very helpful forum howto/thread. UPDATED 30/10/04 for unified bootstrap.
env-update &&
source /etc/profile &&
emerge -C linux-headers &&
USE="-* build bootstrap" emerge linux26-headers &&
cd /usr/portage &&
scripts/bootstrap.sh &&
emerge system &&
emerge syslog-ng xinetd grub hotplug coldplug vixie-cron reiserfsprogs reiser4progs sysfsutils udev &&
emerge --nodeps acpid ntp &&
rc-update add syslog-ng default &&
rc-update add net.eth0 default &&
rc-update add vixie-cron default &&
rc-update add xinetd default &&
rc-update add sshd default &&
rc-update add hotplug default &&
rc-update add coldplug default &&
rc-update add acpid default &&
##########################
# CONFIGURING THE KERNEL #
##########################
rc-update add ntp-client default &&
ntpdate -Q -b pool.ntp.org &&
rm /etc/localtime &&
ln -sf /usr/share/zoneinfo/$TIMEZONE /etc/localtime &&
emerge $SOURCES
cd /usr/src/linux &&
make menuconfig && make && make modules_install &&
cp arch/i386/boot/bzImage /boot/kernel-autoo &&
cp System.map /boot/System.map-autoo &&
cp .config /boot/config-autoo &&
# put additional modules here
emerge nvidia-kernel &&
echo nvidia >> /etc/modules.autoload.d/kernel-2.6 &&
#end additional modules
modules-update &&
###########################
# CONFIGURING YOUR SYSTEM #
###########################
cat > /etc/fstab << EOF &&
# /etc/fstab: static file system information.
#
# noatime turns off atimes for increased performance (atimes normally aren't
# needed; notail increases performance of ReiserFS (at the expense of storage
# efficiency). It's safe to drop the noatime options if you want and to
# switch between notail and tail freely.
# <fs> <mountpoint> <type> <opts> <dump/pass>
# NOTE: If your BOOT partition is ReiserFS, add the notail option to opts.
$DEVGENTOOBOOT /boot ext3 noauto,noatime 1 2
$DEVGENTOOROOT / ext3 noatime 0 1
$DEVGENTOOSWAP none swap sw 0 0
/dev/cdroms/cdrom0 /mnt/cdrom iso9660 noauto,ro,users 0 0
/dev/fd0 /mnt/floppy auto noauto 0 0
# Compact Flash Reader
/dev/sdb1 /mnt/cf vfat noauto,users 0 0
# NOTE: The next line is critical for boot!
none /proc proc defaults 0 0
# glibc 2.2 and above expects tmpfs to be mounted at /dev/shm for
# POSIX shared memory (shm_open, shm_unlink).
# (tmpfs is a dynamically expandable/shrinkable ramdisk, and will
# use almost no memory if not populated with files)
# Adding the following line to /etc/fstab should take care of this:
none /dev/shm tmpfs defaults 0 0
EOF
echo $HOSTNAME > /etc/hostname &&
echo $DNSDOMAINNAME > /etc/dnsdomainname &&
rc-update add domainname default &&
# Configuring Your Network
# Point of user intervention. I think there would be too many problems if this part were automatic. Eg. The layout of this file is different for x86 and ~x86 systems.
echo "Editing /etc/conf.d/net (press enter)"
read ok
nano -w /etc/conf.d/net &&
rc-update add net.eth0 default
cat > /etc/hosts << EOF
127.0.0.1 localhost
192.168.0.5 jenny.homenetwork jenny
192.168.0.6 benny.homenetwork benny
192.168.0.7 tux.homenetwork tux
EOF
# System Information
passwd
#echo "tts/0" >> /etc/securetty
echo "Editing /etc/rc.conf (press enter)"
read ok
nano -w /etc/rc.conf
#####################################
# INSTALLING NECESSARY SYSTEM TOOLS #
#####################################
# Most tools are already installed
emerge slocate &&
# Filesystem Tools
#emerge xfsprogs
#emerge reiserfsprogs
#emerge jfsutils
emerge dhcpcd &&
#USE="-X" emerge rp-pppoe
##############################
# CONFIGURING THE BOOTLOADER #
##############################
emerge grub &&
cat > /boot/grub/grub.conf << EOF
default 0
timeout 30
# Comment out if you don't have a graphics card installed
splashimage=(hd0,0)/grub/splash.xpm.gz
title=Gentoo Linux Autoo
root (hd0,1)
kernel /kernel-autoo root=$DEVGENTOOROOT
# The next four lines are only if you dualboot with a Windows system.
# In this case, Windows is hosted on /dev/hda1.
title=Windows XP
rootnoverify (hd0,0)
makeactive
chainloader +1
EOF
cp /proc/mounts /etc/mtab &&
grub-install --root-directory=/boot $DEVGENTOO
# Rebooting the System: You may not want to at this point, hence it is commented out.
#exit
#Look at rest of "autoo" script for what happens next
[/code:1] |
|