HOW-TO setup a diskless Debian system on a VIA M10000 motherboard
Basics for my setup:Master Server 192.168.1.10
Dir used on the Server: /export/diskless
DNS server 192.168.1.10
GW: 192.168.1.1
NIS domain name: rio.test
Diskless client the will be added: idefix (192.168.1.102)
Debian GNU/Linux 3.0
atftpd
dhcp3-server
nfs-kernel-server
nis (configuration will not be described)
bind9 (configuration will not be described)
DHCP server config
Check the log file for the DHCP server when you boot the client, get the diskless clients MAC address from the log file. In my case: 00:40:63:d3:41:ba
2. Add the following to dhcp.conf
option domain-name "rio.test";
default-lease-time 600;
max-lease-time 7200;
subnet 192.168.1.0 netmask 255.255.255.0 {
range 192.168.1.110 192.168.1.120;
option broadcast-address 192.168.1.255;
option routers 192.168.1.1;
option domain-name-servers 192.168.1.10;
}
allow booting;
allow bootp;
option space PXE;
option PXE.mtftp-ip code 1 = ip-address;
option PXE.mtftp-cport code 2 = unsigned integer 16;
option PXE.mtftp-sport code 3 = unsigned integer 16;
option PXE.mtftp-tmout code 4 = unsigned integer 8;
option PXE.mtftp-delay code 5 = unsigned integer 8;
group {
option vendor-class-identifier "PXEClient";
next-server 192.168.1.10;
filename "pxelinux.0";
option PXE.mtftp-ip 0.0.0.0;
vendor-option-space PXE;
option root-path "/export/diskless/IDEFIX/default";
host idefix {
hardware ethernet 00:40:63:d3:41:ba;
fixed-address 192.168.1.102;
}
}
Configure tftpd
Install tftpd (you do not have to do any configuration for this to work) # apt-get install atftpd
Edit the tftpd entry in /etc/inetd.conf and change /tftpboot to
/export/diskless/tftpboot,
then reload inetd
# /etc/init.d/inetd reload
Make sure you have syslinux installed, if not
# apt-get install syslinux
Copy pxelinux.0 to the tftpboot directory
# mkdir /export/diskless/tftpboot
# cp /usr/lib/syslinux/pxelinux.0 /export/diskless/tftpboot
Then create the pxelinux.cfg directory
# cp /usr/lib/syslinux/pxelinux.0 /export/diskless/tftpboot
# mkdir /export/diskless/tftpboot/pxelinux.cfg
Get the client IP in hex
$ gethostip 192.168.1.102
Create the configuration for the client
192.168.1.102 192.168.1.102 C0A80166
# cd /export/diskless/tftpboot/pxelinux.cfg
and add the following to a file named as the output from gethostip
cat C0A80166
Create the NFS base directory to export to the client
default idefix
label idefix
kernel idefix-kernel
append root=/dev/nfs ip=dhcp rw debug
label idefix
kernel idefix-kernel
append root=/dev/nfs ip=dhcp rw debug
# cd /export/diskless
# mkdir <client name in uppercase>
Add the following the /etc/exports (export root and /home to the
client)
# mkdir <client name in uppercase>
/export/diskless/IDEFIX/
192.168.1.102(rw,no_root_squash)
/home 192.168.1.102(rw,sync)
/home 192.168.1.102(rw,sync)
Build a kernel for your client
(or use my prebuilt 2.4.22-ac4), you will at least need these features:In Processor type and features
VIA-C3-2
in Networking options: check
[*] IP: kernel level autoconfiguration
[*] IP: DHCP support
[*] IP: BOOTP support
[ ] IP: RARP support <--- not needed
in File systems --> Network File Systems --->, check
<*> NFS file system support
[*] Provide NFSv3 client support
[*] Root file system on NFS
Enable tmpfs
in File systems --->
[*] Virtual memory file system support (former shm fs)
Enable devfs
in Code maturity level options --->
[*] Prompt for development and/or incomplete code/drivers
in File systems --->
[*] /dev file system support (EXPERIMENTAL)
[*] Automatically mount at boot
$ make dep; make-kpkg clean; fakeroot make-kpkg
--revision=diskless.m10000.1.0 kernel_image
Setup the diskless clients initial file system and kernel
First you will have to create a directory for you root files system # mkdir /export/diskless/IDEFIX/default
Bootstrap a Debian Woody system into default:
# debootstrap woody /export/diskless/IDEFIX/default
or with apt-proxy
# debootstrap woody /export/diskless/IDEFIX/default
http://<aptproxy server>:9999/main
Install the kernel (example if you use the kernel from this site)
# wget
http://test.riocities.com/kernels/kernel-image-2.4.22-ac4_diskless.m10000.1.0_i386.deb
# dpkg --root /export/diskless/IDEFIX/default/ -i kernel-image-2.4.22-ac4_diskless.m10000.1.0_i386.deb
Make the kernel available to tftpd
# dpkg --root /export/diskless/IDEFIX/default/ -i kernel-image-2.4.22-ac4_diskless.m10000.1.0_i386.deb
Answer to the create link question: n
# cd /export/diskless/tftpboot
# cp ../IDEFIX/default/boot/vmlinuz-2.4.22-ac4 .
# ln -s vmlinuz-2.4.22-ac4 idefix-kernel
# cp ../IDEFIX/default/boot/vmlinuz-2.4.22-ac4 .
# ln -s vmlinuz-2.4.22-ac4 idefix-kernel
Configure the client for initial boot
Setup APT # cp /etc/apt/sources.list
/export/diskless/IDEFIX/default/etc/apt
Setup devfsd
# chroot /export/diskless/IDEFIX/default/
make sure that /etc/apt/sources.list is ok and then continue.
# apt-get update
# apt-get install devfsd
# vi /etc/default/devfsd
Set: MOUNT=yes in the config file
192.168.1.10:/export/diskless/IDEFIX/default / nfs defaults 0 1
proc /proc proc defaults 0 0
#192.168.1.10:/home /home nfs defaults 0 2
# The loopback interface
auto lo
iface lo inet loopback
# vi /etc/hostname
before you exit check that /etc/resolv.conf is ok. If it is ok you can
now exit from chroot
# exit
Boot the diskless client
Power on the client and enjoy the show (hopefully)Login as root (no password is defined) and define hostname and a root password
# hostname idefix
# passwd root
Then configure the system
# passwd root
# dpkg-reconfigure console-data
# /usr/sbin/base-config
Install SSH
# /usr/sbin/base-config
# apt-get install ssh
Optional: configure the system as a NTP client
# apt-get install ntpdate ntp-simple
If you wish, you can now continue from a REMOTE connection.
Standard Debian configuration follows (as a NIS client)
Setup NIS
configure the NIS domain # vi /etc/defaultdomain
add the localnet
rio.test
# vi /etc/networks
Install NIS
localnet 192.168.1.0
# apt-get install nis
test if it works alight:
# ypcat hosts
# ypcat passwd
if ok, add the following to the end of /etc/passwd
# ypcat passwd
+::::::
and to the end of /etc/group
+:::
If you are using shadow passwords you need to add
+::::::::
to the end of /etc/shadow.Remove the # in front of /home dir in /etc/fstab
192.168.1.10:/export/diskless/IDEFIX/default / nfs defaults 0 1
proc /proc proc defaults 0 0
192.168.1.10:/home /home nfs defaults 0 2
# mount -a
Now try to login as a normal user (that exists on the NIS master)Load security fixes
(probably no packages will be updated) # apt-get update
# apt-get -u upgrade
This is the end of the normal config, now you should have a nice
diskless Debian Woody system.
# apt-get -u upgrade
Optional: Make a backup copy of the "pure" woody system
Shutdown the diskless client: # init 0
Login back in on the NIS master, and issue the following commands
# cd /export/diskless/IDEFIX
# mkdir pureWoody
# cd default
# tar cplf - . | (cd ../pureWoody; tar xfp -)
# vi ../pureWoody/etc/fstab
192.168.1.10:/export/diskless/IDEFIX/pureWoody / nfs defaults 0 1
proc /proc proc defaults 0 0
192.168.1.10:/home /home nfs defaults 0 2
If the system will use X continue from here
Configure X (XFree 4.3 and gnome2.2)
Add the following to /etc/apt/sources.list#deb http://mirror.raw.no/ gnome2.2/
deb http://people.debian.org/~mmagallo/packages/xfree86/i386/ ./
deb http://dc.deb.free.fr/debian/woody/binary-i386 ./
Update and install, during installation choose the VESA server
deb http://people.debian.org/~mmagallo/packages/xfree86/i386/ ./
deb http://dc.deb.free.fr/debian/woody/binary-i386 ./
# apt-get update
# apt-get install xserver-xfree86
Then bring up good old dselect and add more X stuff (you can start with
x-window-system and xbase-clients, please note that you might see some
dependency problems)# apt-get install xserver-xfree86
Remove the # for gnome22 in /etc/apt/source.list, the following is a good start for the "apt-ing" of gnome22
# apt-get install gnome-utils gnome-session gnome-core gdm
# apt-get install abiword
# apt-get install xscreensaver
USB
For USB I use the usb-uhci driver You will also need to install some software # apt-get install usbutils usbview usbmgr
Sound
The card works with via82cxxx_audio from a resent kernel, just add via82cxxx_audio to /etc/modules, then the module will be loaded at next reboot.To start the sound driver now
# modprobe via82cxxx_audio
Fonts
Check http://egads.ertius.org/~rob/font_guide.txtReferences
http://www.carfax.org.uk/docs/Netboot/http://drbl.nchc.org.tw/debian/DIY.html
Trial and Error