From owner-freebsd-questions Thu Apr 23 05:15:52 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id FAA22551 for freebsd-questions-outgoing; Thu, 23 Apr 1998 05:15:52 -0700 (PDT) (envelope-from owner-freebsd-questions@FreeBSD.ORG) Received: from horton.iaces.com (horton.iaces.com [204.147.87.98]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id FAA22546 for ; Thu, 23 Apr 1998 05:15:43 -0700 (PDT) (envelope-from proot@horton.iaces.com) Received: (from proot@localhost) by horton.iaces.com (8.8.7/8.8.7) id HAA15929; Thu, 23 Apr 1998 07:15:36 -0500 (CDT) From: "Paul T. Root" Message-Id: <199804231215.HAA15929@horton.iaces.com> Subject: Re: 2 simple questions To: dima@apc.net (Dima Dorfman) Date: Thu, 23 Apr 1998 07:15:35 -0500 (CDT) Cc: dwhite@resnet.uoregon.edu, freebsd-questions@FreeBSD.ORG In-Reply-To: <3.0.5.32.19980422190314.0098c810@mail.apc.net> from Dima Dorfman at "Apr 22, 98 07:03:14 pm" X-Organization: USWEST !nterprise Networking - ACES X-Phone: (612) 664-3385 X-Fax: (612) 664-4779 X-Page: (800) SKY-PAGE PIN: 537-7270 X-Address: 600 Stinson Blvd, Fl 1S X-Address: Minneapolis, MN 55413 X-Mailer: ELM [version 2.4ME+ PL22 (25)] MIME-Version: 1.0 Content-Type: multipart/mixed; boundary=ELM893333735-15900-0_ Content-Transfer-Encoding: 7bit Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG --ELM893333735-15900-0_ Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit In a previous message, Dima Dorfman said: > I need to know how to create a boot disk. Like, how do I create a kernel > small enough to fit it and mount, rm, ls, cp, ... on a 1.44MB disk. Here's the script I use. You'll want to adjust the kernel for your hardware. -- "We are here on earth to do good to others. What the others are here for, I don't know." --W.H. Auden 91907-1973) --ELM893333735-15900-0_ Content-Type: application/x-sh Content-Disposition: attachment; filename=create.sh Content-Description: /home/proot/tmp/create.sh Content-Transfer-Encoding: 7bit #!/bin/sh # # create a restore floppy # # format the floppy # PATH=/bin:/sbin:/usr/sbin:/usr/bin echo "Formatting fd0" fdformat -q fd0 if [ $? -ne 0 ] then echo "Bad floppy, please use a new one" exit 1 fi # place boot blocks on the floppy # echo "Labeling fd0" disklabel -w -B -b /usr/mdec/fdboot -s /usr/mdec/bootfd /dev/rfd0c fd1440 # # newfs the one and only partition # echo "newfs fd0" newfs -t 2 -u 18 -l 1 -c 40 -i 5120 -m 1 -o space /dev/rfd0a # # mount the new floppy # mount /dev/fd0a /mnt # # create required directories # echo "Creating directories" mkdir /mnt/dev mkdir /mnt/bin mkdir /mnt/sbin mkdir /mnt/etc mkdir /mnt/mnt # for the root partition mkdir /mnt/var mkdir /mnt/cdrom mkdir /mnt/usr mkdir /mnt/usr/mdec # # populate the directories # echo "populate the directories" if [ ! -x /sys/compile/MINI/kernel.kz ] then if [ ! -f /sys/i386/conf/MINI ]; then CONFIG=MINI else CONFIG=MINI2 fi echo "The MINI kernel does not exist, creating one." cat >/sys/i386/conf/$CONFIG << EOM # # MINI -- A kernel to get FreeBSD on onto a disk. # machine "i386" cpu "I586_CPU" cpu "I686_CPU" ident MINI maxusers 5 options INET options FFS #Berkeley Fast File System options "CD9660" #ISO 9660 Filesystems options "FAT_CURSOR" #block cursor in syscons or pccons options "SCSI_DELAY=5" #Be pessimistic about Joe SCSI device options "NCONS=2" # virtual consoles options USERCONFIG #Allow user configuration with -c config kernel root 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 wdc0 at isa? port "IO_WD1" bio irq 14 vector wdintr disk wd0 at wdc0 drive 0 disk wd1 at wdc0 drive 1 #controller wdc1 at isa? port "IO_WD2" bio irq 15 vector wdintr #disk wd2 at wdc1 drive 0 #disk wd3 at wdc1 drive 1 options ATAPI #Enable ATAPI support for IDE bus options ATAPI_STATIC #Don't do it as an LKM device wcd0 #IDE CD-ROM controller ahc0 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 st0 device cd0 device fxp0 pseudo-device loop pseudo-device ether pseudo-device gzip EOM cd /sys/i386/conf config $CONFIG cd ../../compile/$CONFIG make kzip kernel else CONFIG=MINI fi echo "Copying kernel" cp -f /sys/compile/${CONFIG}/kernel.kz /mnt echo "copy sbin programs" 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/mount_cd9660 >/mnt/sbin/mount_cd9660 gzip -c -best /sbin/halt > /mnt/sbin/halt gzip -c -best /sbin/restore > /mnt/sbin/restore gzip -c -best /sbin/ifconfig > /mnt/sbin/ifconfig cd /mnt/sbin ln restore rrestore gzip -c -best /sbin/fdisk >/mnt/sbin/fdisk gzip -c -best /sbin/disklabel >/mnt/sbin/disklabel gzip -c -best /sbin/newfs >/mnt/sbin/newfs gzip -c -best /bin/sh > /mnt/bin/sh gzip -c -best /bin/sync > /mnt/bin/sync gzip -c -best /bin/[ >/mnt/bin/[ cp /usr/mdec/boot1 /mnt/usr/mdec/sdboot cp /usr/mdec/boot2 /mnt/usr/mdec/bootsd cp /root/.profile /mnt/root cp -f /dev/MAKEDEV /mnt/dev chmod 755 /mnt/dev/MAKEDEV chmod 500 /mnt/sbin/init chmod 555 /mnt/sbin/fsck /mnt/sbin/mount /mnt/sbin/halt chmod 555 /mnt/bin/sh /mnt/bin/sync /mnt/bin/[ chmod 555 /mnt/sbin/ifconfig /mnt/sbin/mount_cd9660 chmod 555 /mnt/sbin/fdisk /mnt/sbin/newfs /mnt/sbin/disklabel chmod 6555 /mnt/sbin/restore # # create the devices nodes # echo "creating devices" cd /mnt/dev ./MAKEDEV std ./MAKEDEV sd0 ./MAKEDEV st0 ./MAKEDEV pty0 #./MAKEDEV wd0 ./MAKEDEV fd0 ./MAKEDEV wcd0 cd / echo "Create etc files" # # create minimum filesystem table # cat > /mnt/etc/fstab </mnt/etc/fdisk.conf </mnt/etc/disklabel.conf < /mnt/etc/master.passwd </mnt/etc/services </mnt/boot.config <