From owner-freebsd-doc Sun Feb 23 12:22:16 1997 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.5/8.8.5) id MAA00622 for doc-outgoing; Sun, 23 Feb 1997 12:22:16 -0800 (PST) Received: from mailhost1.cac.washington.edu (mailhost1.cac.washington.edu [140.142.32.2]) by freefall.freebsd.org (8.8.5/8.8.5) with ESMTP id MAA00617 for ; Sun, 23 Feb 1997 12:22:13 -0800 (PST) Received: from s5-25-199.student.washington.edu (S5-25-199.student.washington.edu [128.95.25.199]) by mailhost1.cac.washington.edu (8.8.4+UW96.12/8.8.4+UW96.12) with SMTP id MAA22795 for ; Sun, 23 Feb 1997 12:22:12 -0800 Message-ID: <33103647.41C67EA6@u.washington.edu> Date: Sun, 23 Feb 1997 04:21:27 -0800 From: Jason Wells Organization: highperformance.net X-Mailer: Mozilla 3.01 (X11; I; FreeBSD 2.2-970215-GAMMA0 i386) MIME-Version: 1.0 To: freebsd-doc@freebsd.org Subject: Bootable floppy script Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-doc@freebsd.org X-Loop: FreeBSD.org Precedence: bulk I liked your bootable floppy script, but I had trouble with running out of space on the floppy even though my kernel was teh bare minumum. I have supplied an edited script. Some changes in order were made. The MAKEDEV section was put in front of other sections so that when rm MAKEDEV is done there is more space left on the disk for other things. I also stripped my kernel to get uneeded compile junk out of there. <--- highly technical jargon :) Though I changed the script to suit my own purpose, I feel the modifications will be benificial to all users and can be applied universally. Look for these command lines. If you decide to use this I highly recommend double checking it as I am a novice UNIX user. Oh yeah, this boot floppy tested satisfactory for me. Your mileage may vary. <--- I'm really starting to get into this :) Search for #CHANGE to find these changes to the code. There are three occurences of #CHANGE in the script I provided. ** strip /sys/compile/MINI/kernel ** rm /mnt/dev/MAKEDEV Thank you, Jason Wells #!/bin/sh # # create a restore floppy # # format the floppy # PATH=/bin:/sbin:/usr/sbin:/usr/bin fdformat -q fd0 if [ $? -ne 0 ] then echo "Bad floppy, please use a new one" exit 1 fi # place boot blocks on the floppy # disklabel -w -B -b /usr/mdec/fdboot -s /usr/mdec/bootfd /dev/rfd0c fd1440 # # newfs the one and only partition # newfs -t 2 -u 18 -l 1 -c 40 -i 5120 -m 5 -o space /dev/rfd0a # # mount the new floppy # mount /dev/fd0a /mnt # # create required directories # mkdir /mnt/dev mkdir /mnt/bin mkdir /mnt/sbin mkdir /mnt/etc mkdir /mnt/root mkdir /mnt/mnt # for the root partition mkdir /mnt/tmp mkdir /mnt/var # # populate the directories # if [ ! -x /sys/compile/MINI/kernel ] then cat << EOM The MINI kernel does not exist, please create one. Here is an example config file: # # MINI -- A kernel to get FreeBSD on onto a disk. # machine "i386" cpu "I486_CPU" ident MINI maxusers 5 options INET # needed for _tcp _icmpstat _ipstat # _udpstat _tcpstat _udb options FFS #Berkeley Fast File System options FAT_CURSOR #block cursor in syscons or pccons options SCSI_DELAY=15 #Be pessimistic about Joe SCSI device options NCONS=2 #1 virtual consoles options USERCONFIG #Allow user configuration with -c XXX config kernel root on sd0 swap on sd0 and sd1 dumps on sd0 controller isa0 controller pci0 controller fdc0 at isa? port "IO_FD1" bio irq 6 drq 2 vector fdintr disk fd0 at fdc0 drive 0 controller ncr0 controller scbus0 device sc0 at isa? port "IO_KBD" tty irq 1 vector scintr device npx0 at isa? port "IO_NPX" irq 13 vector npxintr device sd0 device sd1 device sd2 device st0 pseudo-device loop # required by INET pseudo-device gzip # Exec gzipped a.out's EOM exit 1 fi strip /sys/compile/MINI/kernel #CHANGE save space cp -f /sys/compile/MINI/kernel /mnt # # create the devices nodes # # #CHANGE this was moved up so that it executes prior to other #cp's to the floppies... # cp -f /dev/MAKEDEV /mnt/dev chmod 755 /mnt/dev/MAKEDEV cd /mnt/dev ./MAKEDEV std ./MAKEDEV sd0 ./MAKEDEV sd1 ./MAKEDEV sd2 ./MAKEDEV st0 ./MAKEDEV pty0 cd / #CHANGE ... that way MAKEDEV can be removed to save space. rm /mnt/dev/MAKEDEV gzip -c -best /sbin/init > /mnt/sbin/init gzip -c -best /sbin/fsck > /mnt/sbin/fsck gzip -c -best /sbin/mount > /mnt/sbin/mount gzip -c -best /sbin/halt > /mnt/sbin/halt gzip -c -best /sbin/restore > /mnt/sbin/restore gzip -c -best /bin/sh > /mnt/bin/sh gzip -c -best /bin/sync > /mnt/bin/sync cp /root/.profile /mnt/root chmod 500 /mnt/sbin/init chmod 555 /mnt/sbin/fsck /mnt/sbin/mount /mnt/sbin/halt chmod 555 /mnt/bin/sh /mnt/bin/sync chmod 6555 /mnt/sbin/restore # # create minimum filesystem table # cat > /mnt/etc/fstab < /mnt/etc/passwd < /mnt/etc/master.passwd <