作者: 閒魂 時間: 2005-8-12 02:40 標題: gentoo diskless installation notes
Hostname: Dwarf
Machine config:
K6-2 450Mhz
P5M3A+
SD 320MB (not too enough)
TNT2 M64 32M
eth0: RTL8139 (plug nothing)
eth1: RTL8139
hdd: 50X CDROM
Floppy boot (etherboot)
Installation disc: gentoo min 2005.0
Server prepare: nfs, folder for dwarf's root
server # emerge -av nfs-utils
server # vi /etc/exportfs
add
/home/tftpd/dwarf 192.168.0.0/24(async,rw,no_root_squash,no_all_squash)
server # /etc/init.d/nfs start
暫不提供 dhcp config
Step 1: Boot and start ssh
boot the live cd
livecd # net-setup eth1 # (dhcp)
livecd # passwd
livecd # /etc/init.d/sshd start
Step 2: Mount nfs
livecd # mount 192.168.0.1:/home/tftpd/dwarf /mnt/gentoo/ -o nolock
livecd # mkdir /mnt/gentoo/home
livecd # mount 192.168.0.1:/home /mnt/gentoo/home -o nolock
Step 3: Install very basic file
mkdir boot usr opt var tmp
chmod 1777 /mnt/gentoo/tmp
cd /mnt/gentoo/tmp
wget http://mirror.gentoo.gr.jp/releases/x86/2005.0/stages/x86/stage1-x86-2005.0.tar.bz2
cd ..
tar jxvfp tmp/stage1-x86-2005.0.tar.bz2
wget http://mirror.gentoo.gr.jp/snapshots/portage-latest.tar.bz2
cd usr
tar jxvf ../portage-latest.tar.bz2
cd ../etc
cp make.conf.example make.conf (overwrite)
vi make.conf
- USE="X gtk gnome -alsa qt kde mmx 3dnow"
- CHOST="i586-pc-linux-gnu"
- CFLAGS="-march=k6-2 -O3 -pipe" #(need test)
- CXXFLAGS="${CFLAGS}"
- ACCEPT_KEYWORDS="~x86"
- PORT_LOGDIR=/var/log/portage
- PORTDIR_OVERLAY=/usr/local/portage
- GENTOO_MIRRORS="http://mirror.gentoo.gr.jp http://distfiles.gentoo.org http://www.ibiblio.org/pub/Linux/distributions/gentoo"
- SYNC="rsync://rsync.asia.gentoo.org/gentoo-portage"
- MAKEOPTS="-j2"
- FEATURES="sandbox ccache distcc distlocks autoaddcvs"
- CCACHE_SIZE="512M"
作者: 閒魂 時間: 2005-8-12 02:44
Step 4: chroot and compile
cp -L /etc/resolv.conf /mnt/gentoo/etc/resolv.conf
mount -t proc none /mnt/gentoo/proc
chroot /mnt/gentoo /bin/bash
mkdir /usr/local/portage
env-update
source /etc/profile
emerge sync
* An update to portage is available. It is _highly_ recommended
* that you update portage now, before any other packages are updated.
* Please do so and then update ALL of your configuration files.
emerge portage
>>> Stage 1 to stage 2 <<<
cd /usr/portage
scripts/bootstrap.sh -f # (-f = fetch-only mode)
scripts/bootstrap.sh
(~20 hours)
>>> Stage 2 to stage 3 <<<
Add USE "nptl nptlonly" (nptl only optional, I havn't use)
emerge -eavtuD system
(~ over 2 days)
作者: 閒魂 時間: 2005-8-12 02:44
Step 5: Then ... kernel
ln -sf /usr/share/zoneinfo/Asia/Hong_Kong /etc/localtime
emerge gentoo-sources
cd /usr/src/linux
make menuconfig
- Device Drivers --->
- [*] Networking support
- Networking options --->
- <*> Packet socket
- <*> Unix domain sockets
- [*] TCP/IP networking
- [*] IP: multicasting
- [*] IP: kernel level autoconfiguration
- [*] IP: DHCP support (NEW)
- 100M NIC --->
- <*> 8139
- File systems --->
- Network File Systems --->
- <*> file system support
- [*] Provide NFSv3 client support
- [*] Root file system on NFS
--- remove all unused modules ---
make
make modules_install
!!! make install will tell you the system cannot be boot
--- for next compile stage ---
USE="-gnome -gtk -ipv6" emerge -av ccache distcc
Step 6: Prepare for network boot 精彩!
server # emerge tftp-hpa syslinux mknbi (dhcp)
server # vi /etc/dhcp/dhcpd.conf
- host dwarf {
- ddns-hostname "dwarf";
- ddns-domainname "idlerlan.local";
- filename "tftp:///vmlinuz_dwarf";
- option time-servers stdtime.gov.hk;
- option root-path "/home/tftpd/dwarf";
- option domain-name-servers 192.168.0.1;
- option domain-name "idlerlan.local";
- option routers 192.168.0.1;
- option host-name "dwarf";
- ddns-updates off;
- hardware ethernet 00:50:FC:2B:34:07;
- fixed-address 192.168.0.11;
- }
server # vi /home/tftpd/dwarf/etc/fstab
- 192.168.0.1:/home/tftpd/dwarf / nfs async,hard,intr,rw,nolock,rsize=8192,wsize=8192 0 0
- 192.168.0.1:/home/ /home nfs async,hard,intr,rw,nolock,rsize=8192,wsize=8192 0 0
- /dev/fd0 /mnt/floppy auto noauto 0 0
- none /proc proc defaults 0 0
- none /dev/shm tmpfs defaults 0 0
server # vi /etc/conf.d/in.tftpd
- INTFTPD_PATH="/home/tftpd"
- INTFTPD_OPTS="-l -s ${INTFTPD_PATH}"
--- put the compiled kernel to /home/tftpd/bzImage
server # mkelf-linux -ip=dhcp /home/tftpd/bzImage > /home/tftpd/vmlinuz_dwarf
server # mv /home/tftpd/bzImage /home/tftpd/bzImage_dwarf
--- create boot disk from this page !!! Very Good toy
http://rom-o-matic.net/5.4.0/build.php?ver...%29&A=Configure
作者: 閒魂 時間: 2005-8-12 02:50
Step 7 reboot and install X-window
compile x11-xorg 估計要 200 hours, so use binary
download package cd
mount /tmp/package-x86-2005.0.iso /usr/portage/package -o loop
dwarf # PKGDIR=/usr/portage/package emerge -avK x11-xorg
dwarf # emerge -av icewm mozilla-firefox-bin scim
[ 本帖最後由 閒魂 於 2005-8-12 02:53 編輯 ]
作者: 閒魂 時間: 2005-8-12 03:02
暫時諗唔到計 cap 圖…
(不過 icewm 又唔係靚,部機又唔係快,cap 唔 cap 都冇關係…)
作者: Mr.Ben 時間: 2005-8-12 03:14
多謝分享, 繼續努力
作者: baronseng 時間: 2005-8-12 07:28
試試 fluxbox 會唔會快D :-)
作者: volospin 時間: 2005-8-12 07:35
謝謝分享
作者: 閒魂 時間: 2006-9-14 02:21
呢篇好似冇需要置頂…放在精華讓它可以 search 到就 ok 吧!
始終好小人會咁玩,而且 d hdd 又咁平…甚至 ide->cf + cf 卡都平(除非真係想玩一塊底板 + Network cable/wireless = 一個 linux)
呢個 case 係用 pxe on floppy,很多 onboard lan card 有 pxe boot rom 的,可以 floppy 都不用!如 asus p4p800 我也試過 diskless 了…
順道一提,ram 一定要多,swapping via nfs 絕不是一件好玩的事!
作者: howdy 時間: 2007-1-3 21:02
thank you.... now 放返落去... the only problem is post here get deleted every now and then.... :(
