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
  1. USE="X gtk gnome -alsa qt kde mmx 3dnow"
  2. CHOST="i586-pc-linux-gnu"
  3. CFLAGS="-march=k6-2 -O3 -pipe" #(need test)
  4. CXXFLAGS="${CFLAGS}"
  5. ACCEPT_KEYWORDS="~x86"
  6. PORT_LOGDIR=/var/log/portage
  7. PORTDIR_OVERLAY=/usr/local/portage
  8. GENTOO_MIRRORS="http://mirror.gentoo.gr.jp http://distfiles.gentoo.org http://www.ibiblio.org/pub/Linux/distributions/gentoo"
  9. SYNC="rsync://rsync.asia.gentoo.org/gentoo-portage"
  10. MAKEOPTS="-j2"
  11. FEATURES="sandbox ccache distcc distlocks autoaddcvs"
  12. CCACHE_SIZE="512M"
複製代碼

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)

TOP

Step 5: Then ... kernel

ln -sf /usr/share/zoneinfo/Asia/Hong_Kong /etc/localtime
emerge gentoo-sources
cd /usr/src/linux
make menuconfig
  1. Device Drivers --->
  2.   [*] Networking support
  3.   Networking options --->
  4.     <*> Packet socket
  5.     <*> Unix domain sockets
  6.     [*] TCP/IP networking
  7.     [*]   IP: multicasting
  8.     [*]   IP: kernel level autoconfiguration
  9.     [*]     IP: DHCP support (NEW)

  10.   100M NIC --->
  11.     <*> 8139

  12. File systems --->
  13.   Network File Systems  --->
  14.     <*> file system support
  15.     [*]   Provide NFSv3 client support
  16.     [*]   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
  1.         host dwarf {
  2.                 ddns-hostname "dwarf";
  3.                 ddns-domainname "idlerlan.local";
  4.                 filename "tftp:///vmlinuz_dwarf";
  5.                 option time-servers stdtime.gov.hk;
  6.                 option root-path "/home/tftpd/dwarf";
  7.                 option domain-name-servers 192.168.0.1;
  8.                 option domain-name "idlerlan.local";
  9.                 option routers 192.168.0.1;
  10.                 option host-name "dwarf";
  11.                 ddns-updates off;
  12.                 hardware ethernet 00:50:FC:2B:34:07;
  13.                 fixed-address 192.168.0.11;
  14.                 }
複製代碼


server # vi /home/tftpd/dwarf/etc/fstab
  1. 192.168.0.1:/home/tftpd/dwarf   /       nfs     async,hard,intr,rw,nolock,rsize=8192,wsize=8192 0 0
  2. 192.168.0.1:/home/              /home   nfs     async,hard,intr,rw,nolock,rsize=8192,wsize=8192 0 0
  3. /dev/fd0                /mnt/floppy     auto            noauto                  0 0
  4. none                    /proc           proc            defaults                0 0
  5. none                    /dev/shm        tmpfs           defaults                0 0
複製代碼


server # vi /etc/conf.d/in.tftpd
  1. INTFTPD_PATH="/home/tftpd"
  2. 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

TOP

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 編輯 ]

TOP

暫時諗唔到計 cap 圖…

(不過 icewm 又唔係靚,部機又唔係快,cap 唔 cap 都冇關係…)

TOP

多謝分享, 繼續努力

TOP

試試 fluxbox 會唔會快D :-)

TOP

謝謝分享

TOP

呢篇好似冇需要置頂…放在精華讓它可以 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 絕不是一件好玩的事!

TOP

thank you.... now 放返落去...  the only problem is post here get deleted every now and then.... :(

TOP