?? diskless-from-nt.txt
字號:
touch1:hn=touch1:tc=t1:ha=00A0F00035CD:ip=192.168.33.127</etc/fstab, change to link>:/dev/ram / ext2 defaults 1 1/proc /proc proc defaults 0 0</etc/rc.d/rc.bootp, change to link later>:#!/bin/sh# Written to simply set the IP stuff up from the# bootpc data.# Last updated : Mon Mar 10 15:17:01 1997## VariablesBOOTPC=/sbin/bootpcIFCONFIG=/sbin/ifconfigROUTE=/sbin/routeBINHOST=/bin/hostnameDEV=eth0ASKSERVER="255.255.255.255"TW="--timeoutwait 320"RIF="--returniffail"RIFMESSAGE="Bootp failed -- disabling network."RCONF=/etc/resolv.confEHOSTS=/etc/hostsLHOSTS=/etc/hosts.localTMPFILE=/tmp/bootp# Functions# Remove the networking by taking down the interfacenetdown() { ${ROUTE} del default ${IFCONFIG} ${DEV} down}## End of the functions## Start of the actual work# Bring up minimal networking use 0.0.0.0 as our address as we don't# know it yet (Means "Me but I don't know my address or network")${IFCONFIG} ${DEV} up 0.0.0.0${ROUTE} add default dev ${DEV}# Perform the bootp -- doesn't return unless it gets an answerif ${BOOTPC} --dev ${DEV} --server ${ASKSERVER} ${RIF} ${TW} > ${TMPFILE}then# Take down networking (use the 0.0.0.0 for as short a time as possible) netdown# Read in the values . ${TMPFILE}# To use in mountsmb script laterSMBSERVER=${T100}# And delete the temporary file# rm ${TMPFILE}else# Take down networking (use the 0.0.0.0 for as short a time as possible) netdown# give message and quit echo ${RIFMESSAGE} exit 1fi# Start the loopback interface and add a route to it# It's already set by standard init?${IFCONFIG} lo 127.0.0.1${ROUTE} add -net 127.0.0.0# Setup of IP stuff needs doing first#if [ -z "${NETMASK}" ] ; then# No netmask info, all this is guessed from the IP number# If this is wrong for your network FIX the bootpd to know# what it should send in the RFC1497 cookie! 11/02/94 JSP# ${IFCONFIG} ${DEV} up ${IPADDR} broadcast ${BROADCAST} ${ROUTE} -n add -net ${NETWORK} dev ${DEV}else# We will have NETMASK, BROADCAST, and NETWORK defined ${IFCONFIG} ${DEV} up ${IPADDR} broadcast ${BROADCAST} netmask ${NETMASK} ${ROUTE} -n add -net ${NETWORK} dev ${DEV}fi# Set the hostname from what we got via bootp or reverse lookupecho "127.0.0.1 loopback localhost">${EHOSTS}${BINHOST} "${HOSTNAME}"echo "${IPADDR} ${HOSTNAME}" >>${EHOSTS}echo "${SERVER} ${SMBSERVER}" >>${EHOSTS}</etc/rc.d/rc.local, change to link>:#!/bin/sh# This script will be executed *after* all the other init scripts.# You can put your own initialization stuff in here if you don't# want to do the full Sys V style init stuff.## 07/02/97 Pavel Tkatchouk#echo "Start networking"insmod /lib/8390.oinsmod /lib/ne.o io=0x300 irq=9echo "Install serial"insmod /lib/serial.oecho "Install touch"insmod /lib/touch.oecho "Install smbfs"insmod /lib/smbfs.oecho "Getting TCP/IP parameters from bootp server"echo "and start networking"/etc/rc.d/rc.bootpif [ -f /etc/squirrel-release ]; then R=$(cat /etc/squirrel-release)else R="release 0.02"fiecho "Mounting remote fs"/sbin/mountsmbecho "XYZ Inc. Diskless Linux $R"echo "Starting X and Java client without login"su -c /sbin/xstart root</usr/sbin/xstart, change to link>:#!/bin/bash## Script to start X and Java client# 08/07/97 Pavel Tkatchouk## Read bootps response first. /tmp/bootp# -s 0 to disable screen-saver/usr/X11R6/bin/X -s 0 &export DISPLAY=:0.0# /usr is share mounted from Windows workstationcd /usr/program/java SomeJavaApp </sbin/mountsmb, change to link>:#!/bin/bash# mountsmb: mounts remote filesystems from NT workstation # using Microsoft's SMB protocol # # Copyright (c) Pavel Tkatchouk 1997. All rights reserved.# Permission is granted for this material to be freely# used and distributed, provided the source is acknowledged.# No warranty of any kind is provided. You use this material# at your own risk.## Last edit June 29 8:30 1997#MOUNTDIR="usr"SHRDIR="usr"BOOTPRES="/tmp/bootp"# Read botpc response. ${BOOTPRES}# Sharename from NT server, uncomment if you want to use # non-hardcoded "usr" but from bootptab#SHRDIR=${T104} SMBSRV="//${T100}"CLIENT="${HOSTNAME}"USER="${T101}"PASSWORD="${T102}"echo -e "\nMounting $SMBSRV/$SHRDIR to /$MOUNTDIR"smbmount $SMBSRV/$SHRDIR $MOUNTDIR -c $CLIENT -U $USER -P $PASSWORDecho -e "\nDone"Gotcha's:Looks like smbmount client from smbfs package used to mount remote Windows shares to local Linux dirs in pre 2.2.x era isn't maintained anymore so you should use one coming with Samba package. Also binary smbmount won't work with 2.2.x, so you have to recompile with 2.2.x headers following Samba's readme. Yet even that won't guarantee reliable work untilsomebody fixes kernel's smbfs module.2.4.1. BOOTP, TFTP.There are number of BOOTP, TFTP servers for Windows on the market. You could find themhere:- www.walusoft.co.uk (Walusoft's tftp);- ftp.coast.net/simtel/nt/internet/tftpds12.zip (Millwood AB's tftp);- ftp.cabletron.com/pub/snmp/bootftp/boottft2.zip (Cabletron's bootp/tftp combo);- www.tellurian.au.com (Tellurian's bootp, tftp, dhcp servers).- www.metainfo.com (Metainfo's DHCP server)- www.nts.com (Network Telesystems's DHCP server in IPserver package)My choice was Tellurian's products - very reliable, simple to install, attractively priced(fully capable evaluation versions are available).2.5. Bootprom.Ken Yap's Etherboot <etherboot.sourceforge.net> will tell you everything about bootprom. Here I just want to mention that normally you would have to put bootprom's code into networkadapter's PROM. But if your hardware like mine has BIOS programmed in flash you could re-program it to add bootprom (some BIOS requires special programmer to do that, others don't)as BIOS extension.This is what I did to add ne.rom (bootprom generated by Etherboot's makerom for NE2000 clone) to AMI BIOS on my flash:- read flash content by programmer into bios.bin binary file;- use one of available binary editors (say www.simtel.net/Win95/editors/hxp3005.zip to add ne.rom to bios.bin (and to edit ne.rom if necessary);- write new bios.bin back to flash.Notes:- makerom generates bootprom for standard EPROM sizes (8k, 16k, 32k, etc.), so if you tight on space use -s flag to adjust size (or cut it manually to multiple of 512 bytes blocks, just don't forget to adjust extension's length which is coded in Byte 2 and checksum to 8 bits of zero;- valid absolute addresses for BIOS extensions are from 0xC8000 to 0xF4000 (check with motherboard's manufacturer how flash is mapped onto system memory space);- Byte 0 must be 0x55, Byte 1 must be 0xAA, Byte 2 must be extension's length in 512 bytes blocks;- extension BIOS has to start at a 2k boundary;3. Resources.FAQ's:- tomsrtbt.FAQ (www.toms.net);HOWTO's:- Paul Moody's miniHOWTO (www.linuxembedded.com/pmhowto.html)- Diskless;- Diskless-HOWTO;- NFS-Root;- NFS-Root-Client;- Bootdisk-HOWTO;- BootPrompt-HOWTO;- NCD-X-Terminal;- Remote-Boot;- Remote-X-Apps;Web:- etherboot.sourceforge.net/- www.waste.org/~zanshin- www.tellurian.com.au.- www.toms.net- www.trinux.org- www.linux.org.uk/ELKS-Home- www.embedded.com- www.linuxembedded.com- www.thinlinux.org- www.linuxrouter.org- linux-mandrake.com- www.disklessworkstations.comNewsgroups:- comp.arch.embeddedLists:- netboot-owner@baghira.han.de- linux-embedded@waste.orgMagazines:- Circuit Cellar #100 - 1054. Copyright.Copyright (c) Pavel Tkatchouk 1999.Permission is granted for this material to be freely used and distributed, provided the source is acknowledged. Copyright policy is GPL as published by the Free Software Foundation.No warranty of any kind is provided. You use this material at your own risk. 5. Feedback and credits.Since I am neither have a lot of Linux experience nor native English speaker, there would be errors in this document. I would accept any help with gratitude whether in form of proof-reading, techical corrections or otherwise. Please send your comments, suggestions and questions to Pavel Tkatchouk (ptkatcho@portal.ca)I wish to thank Pierre Mondie who convinced me to start this document. I'm also very much in debt to all those who's work made this project possible:Ken Yap <ken_yap@users.sourceforge.net> (Etherboot)David Newall <www.tellurian.com.au> (Bootpdnt/Ftpdnt)(to be continued)
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -