Latest update with patches.
I have eliminated the need to load nfs into the base.
I have added two boot options. Ex:
append initrd=../tcl-23/boot/tinycore.gz nfsmount=openvz:/tftpboot/nfs/tc2-music tftplist=openvz:/nfs/tc2-music/tftp/tcz.lst tz=CST+6CDT
tftplist=server:/directory/tczlist
This defines a tftp server and the path to a file that contains a list of tcz to load. My tcz.list is:
/nfs/tc2-music/tftp/nfs-utils.tcz
nfsmount=server:/directory
This defines an NFS share that will be mounted into /mnt/nfs.
This directory works just like /mnt/hda1 or /mnt/sda1 or any other device for the storage of mydata.tgz and a tce directory.
Backup is to 'nfs'.
By combining these two additions, a diskless workstation can PXE boot TC, load the NFS utilities over tftp, and
then loop mount a full compliment of tcz extensions over NFS.
I use this to boot a diskless music player over the network. It is accessed via vnc to play music from an NFS export.
No disk, no SD card, no thumb drive.
Here are the two patches
*** tc-functions.orig 2009-08-29 22:40:18.000000000 -0500
--- tc-functions 2009-08-29 22:40:35.000000000 -0500
***************
*** 80,85 ****
--- 80,90 ----
MOUNTPOINT=""
MOUNTED="no"
D2="$1"
+ if [ "$D2" == "nfs" ]; then
+ MOUNTPOINT=/mnt/nfs
+ MOUNTED="yes"
+ return
+ fi
if [ "${D2:0:5}" == "UUID=" ]; then
D2=`/sbin/blkid -lt $D2 -o device`
if [ "$?" != 0 ]; then
***************
*** 117,123 ****
autoscan(){
FOUND=""
! for DEVICE in `grep "^/dev/" /etc/fstab | grep -vf /etc/init.d/tc_noscan.lst | awk 'FS="/" { print $3}'`; do
find_mountpoint $DEVICE
if [ -n "$MOUNTPOINT" ]; then
if [ "$MOUNTED" == "no" ]; then
--- 122,128 ----
autoscan(){
FOUND=""
! for DEVICE in `grep "/mnt/" /etc/fstab | grep -vf /etc/init.d/tc_noscan.lst | awk 'FS="/" { print $3}'`; do
find_mountpoint $DEVICE
if [ -n "$MOUNTPOINT" ]; then
if [ "$MOUNTED" == "no" ]; then
*** tc-config.orig 2009-08-29 22:40:18.000000000 -0500
--- tc-config 2009-08-29 22:40:35.000000000 -0500
***************
*** 171,176 ****
--- 171,178 ----
settime*) SETTIME=${i#*=} ;;
thm*) THEME=${i#*=} ;;
bkg*) BACKGROUND=${i#*=} ;;
+ nfsmount* ) NFSMOUNT=${i#*=} ;;
+ tftplist* ) TFTPLIST=${i#*=} ;;
esac
;;
*)
***************
*** 251,256 ****
--- 253,300 ----
/sbin/ifconfig lo 127.0.0.1 up
/sbin/route add 127.0.0.1 lo &
+ # dhcp.sh runs udhcpc async, so it exits before network is up
+ waitfor() {
+ [ -z "$DHCP_RAN" ] && /etc/init.d/dhcp.sh
+ CNT=0
+ until ping -c 1 $1 >/dev/null 2>&1
+ do
+ [ $((CNT++)) -gt 30 ] && break || sleep 1
+ done
+ DHCP_RAN=1
+ }
+
+ # First process tftp entries
+ modprobe -q squashfs 2>/dev/null
+ if [ -n "$TFTPLIST" ]; then
+ SERVER=`echo $TFTPLIST | awk -F\: '{ print $1 }'`
+ FILE=`echo $TFTPLIST | awk -F\: '{ print $2 }'`
+ waitfor $SERVER
+ ( mkdir /tmp/tftp ; cd /tmp/tftp
+ NAME=`basename $FILE`
+ tftp -g -r $FILE $SERVER
+ echo -ne "${BLUE}TFTP Loading Extensions ${YELLOW}"
+ while read EXTENSION
+ do
+ tftp -g -r $EXTENSION $SERVER
+ EXTNAME=`basename $EXTENSION`
+ echo -ne "$EXTNAME "
+ tcloop_mount "$EXTNAME" $(getbasefile "$EXTNAME" 1)
+ done < $NAME
+ echo "${GREEN} Done.${NORMAL}"
+ rm $NAME
+ )
+ fi
+
+ if [ -n "$NFSMOUNT" ]; then
+ SERVER=`echo $NFSMOUNT | awk -F\: '{ print $1 }'`
+ waitfor $SERVER
+ echo "$NFSMOUNT /mnt/nfs nfs defaults,nolock 0 0" >> /etc/fstab
+ echo "Mounting $NFSMOUNT"
+ mkdir /mnt/nfs
+ mount /mnt/nfs
+ fi
+
if [ -n "$CHECKFS" ]; then
touch /etc/sysconfig/checkfs
wait $fstab_pid
***************
*** 302,308 ****
tceSetup
#
! modprobe -q squashfs 2>/dev/null
if [ "$(ls -A /opt/tce)" ]; then
echo "${BLUE}Checking for /opt/tce items... ${NORMAL}"
gettceapps "/opt/tce"
--- 346,352 ----
tceSetup
#
! # modprobe -q squashfs 2>/dev/null
if [ "$(ls -A /opt/tce)" ]; then
echo "${BLUE}Checking for /opt/tce items... ${NORMAL}"
gettceapps "/opt/tce"
***************
*** 552,558 ****
if [ -n "$NODHCP" ]; then
echo "${GREEN}Skipping DHCP broadcast/network detection as requested on boot commandline.${NORMAL}"
else
! /etc/init.d/dhcp.sh &
fi
[ -n "$CRON" ] && /etc/init.d/crond start
[ -n "$SSH" ] && /etc/init.d/dropbear start >/dev/null && echo " ${GREEN}ssh started.${NORMAL}"
--- 596,602 ----
if [ -n "$NODHCP" ]; then
echo "${GREEN}Skipping DHCP broadcast/network detection as requested on boot commandline.${NORMAL}"
else
! [ -z "$DHCP_RAN" ] && /etc/init.d/dhcp.sh &
fi
[ -n "$CRON" ] && /etc/init.d/crond start
[ -n "$SSH" ] && /etc/init.d/dropbear start >/dev/null && echo " ${GREEN}ssh started.${NORMAL}"
That is it. Hope someone else finds it useful.