summaryrefslogtreecommitdiffstats
path: root/release/floppies
diff options
context:
space:
mode:
authorjulian <julian@FreeBSD.org>1996-05-21 01:12:48 +0000
committerjulian <julian@FreeBSD.org>1996-05-21 01:12:48 +0000
commit57f684b7bcf43e96e30345e8dd8437b9722daa89 (patch)
tree4e0299859bca8dbeb00101cbcd071e48e508f44f /release/floppies
parentdaaf2e922f028b52c7654d7ffacd86a5f39dd69f (diff)
downloadFreeBSD-src-57f684b7bcf43e96e30345e8dd8437b9722daa89.zip
FreeBSD-src-57f684b7bcf43e96e30345e8dd8437b9722daa89.tar.gz
stand alone (kinda) floppy generation..
you still need tohave done a make world and have made 'sysinstall' this should not interfere with existing code as it's standalone. write_mfs_in_kernel.c is duplicated alsewhere.. one will go ..
Diffstat (limited to 'release/floppies')
-rw-r--r--release/floppies/Makefile13
-rw-r--r--release/floppies/boot/Makefile4
-rw-r--r--release/floppies/boot/crunch/Makefile2
-rw-r--r--release/floppies/boot/crunch/crunch.conf20
-rw-r--r--release/floppies/boot/floppy/Makefile95
-rw-r--r--release/floppies/boot/mfs/Makefile25
-rw-r--r--release/floppies/boot/verbatim/etc/services4
-rw-r--r--release/floppies/crunch_fs.mk107
-rw-r--r--release/floppies/doFS.sh120
-rw-r--r--release/floppies/fixit/Makefile6
-rw-r--r--release/floppies/fixit/crunch/Makefile2
-rw-r--r--release/floppies/fixit/crunch/crunch.conf45
-rw-r--r--release/floppies/fixit/image/Makefile16
-rw-r--r--release/floppies/fixit/verbatim/.profile15
-rw-r--r--release/floppies/makecrunch.mk28
-rw-r--r--release/floppies/root/Makefile6
-rw-r--r--release/floppies/root/crunch/Makefile2
-rw-r--r--release/floppies/root/crunch/crunch.conf38
-rw-r--r--release/floppies/root/image/Makefile16
-rw-r--r--release/floppies/write_mfs_in_kernel.c70
20 files changed, 634 insertions, 0 deletions
diff --git a/release/floppies/Makefile b/release/floppies/Makefile
new file mode 100644
index 0000000..f3f3433
--- /dev/null
+++ b/release/floppies/Makefile
@@ -0,0 +1,13 @@
+# $Id: Makefile,v 1.214 1996/05/02 08:18:28 jkh Exp $
+#
+SUBDIR= boot root fixit
+PROG=write_mfs_in_kernel
+NOMAN=yes
+
+#write_mfs_in_kernel: ${.CURDIR}/write_mfs_in_kernel.c
+# ${CC} ${CFLAGS} -o write_mfs_in_kernel ${.CURDIR}/write_mfs_in_kernel.c
+
+
+.include <bsd.prog.mk>
+
+
diff --git a/release/floppies/boot/Makefile b/release/floppies/boot/Makefile
new file mode 100644
index 0000000..2dd894d
--- /dev/null
+++ b/release/floppies/boot/Makefile
@@ -0,0 +1,4 @@
+# $Id: Makefile,v 1.214 1996/05/02 08:18:28 jkh Exp $
+SUBDIR= crunch mfs floppy
+
+.include <bsd.subdir.mk>
diff --git a/release/floppies/boot/crunch/Makefile b/release/floppies/boot/crunch/Makefile
new file mode 100644
index 0000000..b48f9b7
--- /dev/null
+++ b/release/floppies/boot/crunch/Makefile
@@ -0,0 +1,2 @@
+.include "../../makecrunch.mk"
+
diff --git a/release/floppies/boot/crunch/crunch.conf b/release/floppies/boot/crunch/crunch.conf
new file mode 100644
index 0000000..b9d6f14
--- /dev/null
+++ b/release/floppies/boot/crunch/crunch.conf
@@ -0,0 +1,20 @@
+# $Id: boot_crunch.conf,v 1.23 1996/02/08 18:02:51 phk Exp $
+
+srcdirs /usr/src/bin
+srcdirs /usr/src/release
+srcdirs /usr/src/sbin/i386
+srcdirs /usr/src/sbin
+srcdirs /usr/src/usr.bin
+srcdirs /usr/src/gnu/usr.bin
+srcdirs /usr/src/usr.sbin
+
+progs sh find
+progs pwd ft ppp
+progs sysinstall newfs gzip cpio bad144 fsck ifconfig route slattach
+progs mount_nfs
+ln gzip gunzip
+ln gzip zcat
+ln sh -sh
+
+libs -ll -ledit -lutil -lkvm -lmd
+libs -ldialog -lncurses -lmytinfo -L/usr/src/release/libdisk/obj -ldisk -lipx
diff --git a/release/floppies/boot/floppy/Makefile b/release/floppies/boot/floppy/Makefile
new file mode 100644
index 0000000..ffbc3e0
--- /dev/null
+++ b/release/floppies/boot/floppy/Makefile
@@ -0,0 +1,95 @@
+
+# $Id: Makefile,v 1.214 1996/05/02 08:18:28 jkh Exp $
+# If this is a RELEASE, then set
+
+# Things which without too much trouble can be considered variables
+
+# mountpoint for filesystems.
+TOP=${.CURDIR}/../../../..
+FS_BIN=${.CURDIR}/../..
+
+MNT= /mnt
+
+# other floppy parameters.
+FSSIZE= 1200
+FSLABEL= fd1200
+FSINODE= 4300
+
+NEWFSARGS= -c 80 -b 4096 -f 512 -i 4000 -m 0 -t 0 -u 0 \
+ -o space -T ${FSLABEL}
+
+
+# Upper size for the mfs in the boot.flp kernel.
+# These are adjusted down to the minimum needed by doFS.sh.
+BOOTMFSSIZE= 1200
+MFSINODE= 40000
+
+# Things which will get you into trouble if you change them
+MTREEFILES= ${.CURDIR}/../etc/mtree
+
+
+# Complete the bootfd
+#
+# Now, just to get this picture down once and for all:
+#
+# +------------------------------------------------------------------------+
+# |boot.flp |
+# +-----+-----+------------------------------------------------------------+
+# |boot1|boot2|floppy filesystem "bootfd" |
+# +-----+-----+-+--------------------------------------------------------+-+
+# |kernel |
+# +------------+-----------------------------------------+-+
+# |mfs filesystem "mfsfd" |
+# +-----------------------------------------+
+#
+
+all: ${FS_BIN}/write_mfs_in_kernel
+ cd ${.CURDIR} && ${MAKE} doMFSKERN
+
+
+
+#
+# --==## Compile a kernel by name ${KERNEL} ##==--
+#
+# We don't erase the sys/compile/${KERNEL} directory, since somebody
+# may want to reuse it (release.8 presently)
+#
+doKERNEL:
+ cd ${TOP}/sys/i386/conf && config -n ${KERNEL}
+ cd ${TOP}/sys/compile/${KERNEL} && \
+ make depend && \
+ make kernel && \
+
+#
+# --==## Put a filesystem into a BOOTMFS kernel ##==--
+#
+LABELDIR=${TOP}/sys/i386/boot/biosboot/obj
+CONF=${TOP}/sys/i386/conf
+COMPILE=${TOP}/sys/compile
+doMFSKERN:
+ rm -f ${TOP}/sys/compile/BOOTMFS/mfs_vfsops.o
+ cd ${CONF} && \
+ fgrep -v SYSV GENERIC | \
+ fgrep -v pty | \
+ fgrep -v PROCFS | \
+ sed 's/GENERIC/BOOTMFS/g' | \
+ sed '/maxusers/s/10/4/' > BOOTMFS && \
+ echo "options MFS" >> BOOTMFS && \
+ echo "options NFS_NOSERVER" >> BOOTMFS && \
+ echo 'options "MAXCONS=4"' >> BOOTMFS
+ echo "options \"MFS_ROOT=`cat ../mfs/fs-image.size`\"" >> \
+ ${CONF}/BOOTMFS
+ cd ${.CURDIR} && ${MAKE} doKERNEL KERNEL=BOOTMFS
+ -mkdir tree
+ cp ${COMPILE}/BOOTMFS/kernel tree
+ ${FS_BIN}/write_mfs_in_kernel tree/kernel ../mfs/fs-image
+ kzip tree/kernel
+ mv tree/kernel.kz tree/kernel
+ ls -l tree/kernel
+ sh -e ${FS_BIN}/doFS.sh ${LABELDIR} ${MNT} ${FSSIZE} tree \
+ 10000 ${FSLABEL}
+
+clean:
+ rm -rf tree fs-image fs-image.size
+
+.include <bsd.prog.mk>
diff --git a/release/floppies/boot/mfs/Makefile b/release/floppies/boot/mfs/Makefile
new file mode 100644
index 0000000..2329d98
--- /dev/null
+++ b/release/floppies/boot/mfs/Makefile
@@ -0,0 +1,25 @@
+###
+# $Id: Makefile,v 1.214 1996/05/02 08:18:28 jkh Exp $
+#
+# What are we if we weren't told..
+CRUNCH?= mfs
+CRUNCHDIRS= ../crunch
+TOP=${.CURDIR}/../../../..
+FS_BIN=${.CURDIR}/../..
+FSLABEL=minimum
+ZIP=false
+
+# the directories you want on the fs
+STANDLINKS= bin sbin
+FS_DIRS= dev stand etc mnt mnt1 mnt2 tmp
+FS_DEVICES= std wd0 wd1 wd2 sd0 sd1 sd2 cuaa0 cuaa1 cuaa2 cuaa3 \
+ fd0 fd1 cd0 mcd0 scd0 matcd0 wcd0 st0 ft0 wt0 vty4
+# a subdir that contains a verbatim image to be copied to the fs
+VERBATIM= ../verbatim
+
+.include "../../crunch_fs.mk"
+all: fs_image
+
+# tar --exclude CVS -cf - -C ${.CURDIR}/sysinstall help | \
+# tar xvf - -C ${RD}/mfsfd/stand
+
diff --git a/release/floppies/boot/verbatim/etc/services b/release/floppies/boot/verbatim/etc/services
new file mode 100644
index 0000000..bd1beff
--- /dev/null
+++ b/release/floppies/boot/verbatim/etc/services
@@ -0,0 +1,4 @@
+nameserver 42/tcp name
+ftp 21/tcp
+domain 53/tcp nameserver
+domain 53/udp nameserver
diff --git a/release/floppies/crunch_fs.mk b/release/floppies/crunch_fs.mk
new file mode 100644
index 0000000..ab11d5a
--- /dev/null
+++ b/release/floppies/crunch_fs.mk
@@ -0,0 +1,107 @@
+###
+# $Id: Makefile,v 1.214 1996/05/02 08:18:28 jkh Exp $
+#
+# This is included to make a floppy that includes a crunch file
+#
+# Variables that control this mk include file.
+# TOP specifies where the top of the FreeBSD source tree is.. (*)
+# FS_DIRS directories to make on the fs (*)
+# STANDLINKS added symlinks to /stand on the fs
+# VERBATIM a directory that contains tree to be copied to the fs
+# FSSIZE defaults to 1200
+# FSLABEL defaults to fd1200
+# FSINODE defaults to 4300
+# FS_DEVICES devices to make on the fs (using MAKEDEV) (default = all)
+# ZIP decides if the installed cruch will also be gzip'd(def=true)
+# (*) = Mandatory
+###
+
+# If we weren't told, default to nothing
+.if ! defined( TOP )
+# define TOP!
+xxx
+.endif
+
+# mountpoint for filesystems.
+MNT= /mnt
+
+# other floppy parameters.
+FSSIZE?= 1200
+FSLABEL?= fd1200
+FSINODE?= 4300
+FS_DEVICES?= all
+ZIP?=true
+
+# Things which will get you into trouble if you change them
+TREE= tree
+LABELDIR= ${TOP}/sys/i386/boot/biosboot/obj
+
+clean:
+ rm -rf tree fs-image fs-image.size step[0-9]
+
+.include <bsd.prog.mk>
+
+
+#
+# --==## Create a filesystem image ##==--
+#
+
+fs_image: ${TREE} step2 step3 step4 fs-image
+
+${TREE}: ${.CURDIR}/Makefile
+ rm -rf ${TREE}
+ mkdir -p ${TREE}
+ cd ${TREE} && mkdir ${FS_DIRS}
+ cd ${TREE} ; for i in ${STANDLINKS} ;\
+ do ; \
+ ln -s /stand $${i} ; \
+ done
+
+step2: ${CRUNCHDIRS} ${.CURDIR}/Makefile
+.if defined(CRUNCHDIRS)
+ @cd ${.CURDIR} && $(MAKE) installCRUNCH DIR=${TREE}/stand ZIP=${ZIP}
+.endif
+ touch step2
+
+step3: step2
+.if defined (FS_DEVICES)
+ ( cd tree/dev && \
+ cp ${TOP}/etc/etc.i386/MAKEDEV . && sh MAKEDEV ${FS_DEVICES} )
+.endif
+ touch step3
+
+step4: step3
+.if defined(VERBATIM)
+ A=`pwd`;cd ${.CURDIR}/${VERBATIM}; \
+ find . -print |cpio -pdmuv $$A/tree
+.endif
+ true || cp ${TOP}/etc/spwd.db tree/etc
+ touch step4
+
+fs-image: step4
+ sh -e ${FS_BIN}/doFS.sh ${LABELDIR} ${MNT} ${FSSIZE} tree \
+ 10000 ${FSLABEL}
+
+
+.if defined(CRUNCHDIRS)
+installCRUNCH:
+.if !defined(DIR)
+ @echo "DIR undefined in installCRUNCH" && exit 1
+.endif
+.if !defined(ZIP)
+ @echo "ZIP undefined in installCRUNCH" && exit 1
+.endif
+.for CRUNCHDIR in ${CRUNCHDIRS}
+ if ${ZIP} ; then \
+ gzip -9 < ${CRUNCHDIR}/crunch > ${DIR}/.crunch ; \
+ else \
+ ln -f ${CRUNCHDIR}/crunch ${DIR}/.crunch ; \
+ fi
+ chmod 555 ${DIR}/.crunch
+ for i in `crunchgen -l ${.CURDIR}/${CRUNCHDIR}/crunch.conf` ; do \
+ ln -f ${DIR}/.crunch ${DIR}/$$i ; \
+ done
+ rm -f ${DIR}/.crunch
+.endfor
+.endif
+
diff --git a/release/floppies/doFS.sh b/release/floppies/doFS.sh
new file mode 100644
index 0000000..1693226
--- /dev/null
+++ b/release/floppies/doFS.sh
@@ -0,0 +1,120 @@
+:
+#set -ex
+
+VNDEVICE=vn0
+export BLOCKSIZE=512
+
+LABELDIR=$1 ; shift
+MNT=$1 ; shift
+FSSIZE=$1 ; shift
+FSPROTO=$1 ; shift
+FSINODE=$1 ; shift
+FSLABEL=$1 ; shift
+OLDFSSIZE=${FSSIZE}
+OLDFSINODE=${FSINODE}
+
+deadlock=40
+
+while true
+do
+ rm -f fs-image
+
+ if [ ! -b /dev/${VNDEVICE} -o ! -c /dev/r${VNDEVICE} ] ; then
+ ( cd /dev && sh MAKEDEV ${VNDEVICE} )
+ fi
+
+ umount /dev/${VNDEVICE} 2>/dev/null || true
+
+ umount ${MNT} 2>/dev/null || true
+
+ vnconfig -u /dev/r${VNDEVICE} 2>/dev/null || true
+
+ dd of=fs-image if=/dev/zero count=${FSSIZE} bs=1k 2>/dev/null
+ # this suppresses the `invalid primary partition table: no magic'
+ awk 'BEGIN {printf "%c%c", 85, 170}' |\
+ dd of=fs-image obs=1 seek=510 conv=notrunc 2>/dev/null
+
+ vnconfig -s labels -c /dev/r${VNDEVICE} fs-image
+
+ sed '/^minimum:/,$d' /etc/disktab > /etc/disktab.tmp
+ cat /etc/disktab.tmp > /etc/disktab
+ rm -f /etc/disktab.tmp
+ (
+ a=`expr ${FSSIZE} \* 2`
+ echo
+ echo "minimum:ty=mfs:se#512:nt#1:rm#300:\\"
+ echo " :ns#$a:nc#1:\\"
+ echo " :pa#$a:oa#0:ba#4096:fa#512:\\"
+ echo " :pc#$a:oc#0:bc#4096:fc#512:"
+ echo
+ ) >> /etc/disktab
+
+ disklabel -w -r -B \
+ -b ${LABELDIR}/boot1 \
+ -s ${LABELDIR}/boot2 \
+ /dev/r${VNDEVICE} minimum
+
+ newfs -u 0 -t 0 -i ${FSINODE} -m 0 -T minimum /dev/r${VNDEVICE}a
+
+ mount /dev/${VNDEVICE}a ${MNT}
+
+ if ( set -e && cd ${FSPROTO} && find . -print | cpio -dump ${MNT} )
+ then
+ ;
+ else
+ echo " $FSINODE and $FSSIZE failed, reverting.."
+ FSSIZE=`expr ${FSSIZE} + 10`
+ #FSSIZE=${OLDFSSIZE}
+ FSINODE=${FSINODE}
+ continue
+ fi
+
+ set `df -i /mnt | tail -1`
+#/dev/vn0a 937 932 5 99% 342 328 51% /mnt
+
+ umount ${MNT}
+
+ fsck -p /dev/r${VNDEVICE}a < /dev/null
+
+ vnconfig -u /dev/r${VNDEVICE} 2>/dev/null || true
+
+ if [ $FSLABEL != "minimum" ] ; then
+ echo ${FSSIZE} > fs-image.size
+ break
+ fi
+
+ OLDFSSIZE=${FSSIZE}
+ OLDFSINODE=${FSINODE}
+ echo ">>> Filesystem is ${FSSIZE} K, $4 left"
+ echo ">>> ${FSINODE} bytes/inode, $7 left"
+ echo ">>> `expr ${FSSIZE} \* 1024 / ${FSINODE}`"
+ if [ $4 -gt 128 ] ; then
+ echo "Reducing size"
+ FSSIZE=`expr ${FSSIZE} - $4 / 2`
+ continue
+ fi
+ if [ $7 -gt 128 ] ; then
+ echo "Increasing bytes per inode"
+ FSINODE=`expr ${FSINODE} + 8192`
+ continue
+ fi
+ if [ $4 -gt 32 ] ; then
+ echo "Reducing size"
+ FSSIZE=`expr ${FSSIZE} - 4`
+ FSINODE=`expr ${FSINODE} - 1024`
+ continue
+ fi
+ if [ $7 -gt 64 ] ; then
+ echo "Increasing bytes per inode"
+ FSINODE=`expr ${FSINODE} + 8192`
+ continue
+ fi
+ if [ $deadlock -eq 0 ] ; then
+ echo "Avoiding deadlock, giving up"
+ echo ${FSSIZE} > fs-image.size
+ break
+ fi
+ deadlock=`expr $deadlock - 1`
+ echo ${FSSIZE} > fs-image.size
+ break;
+done
diff --git a/release/floppies/fixit/Makefile b/release/floppies/fixit/Makefile
new file mode 100644
index 0000000..ee278f7
--- /dev/null
+++ b/release/floppies/fixit/Makefile
@@ -0,0 +1,6 @@
+###
+# $Id: Makefile,v 1.214 1996/05/02 08:18:28 jkh Exp $
+#
+SUBDIR= crunch image
+
+.include <bsd.subdir.mk>
diff --git a/release/floppies/fixit/crunch/Makefile b/release/floppies/fixit/crunch/Makefile
new file mode 100644
index 0000000..b48f9b7
--- /dev/null
+++ b/release/floppies/fixit/crunch/Makefile
@@ -0,0 +1,2 @@
+.include "../../makecrunch.mk"
+
diff --git a/release/floppies/fixit/crunch/crunch.conf b/release/floppies/fixit/crunch/crunch.conf
new file mode 100644
index 0000000..f31652e
--- /dev/null
+++ b/release/floppies/fixit/crunch/crunch.conf
@@ -0,0 +1,45 @@
+# $Id: fixit_crunch.conf,v 1.6 1996/01/03 23:41:03 joerg Exp $
+
+# first, we list the source dirs that our programs reside in. These are
+# searched in order listed to find the dir containing each program.
+
+srcdirs /usr/src/bin
+srcdirs /usr/src/sbin/i386
+srcdirs /usr/src/sbin
+srcdirs /usr/src/gnu/usr.bin
+srcdirs /usr/src/usr.bin
+srcdirs /usr/src/usr.sbin
+srcdirs /usr/src/usr.bin/vi
+
+# second, we list all the programs we want to include in our crunched binary.
+# The order doesn't matter. Any program that needs hard links to it gets an
+# `ln' directive.
+
+# /bin stuff
+
+progs cat chmod chroot cp date dd df echo ed expr hostname kill ln ls mkdir
+progs mt mv pwd rcp rm rmdir sleep stty sync test
+
+ln test [
+
+# /sbin stuff
+
+progs badsect chown clri disklabel dump dmesg fdisk
+progs mknod mount newfs ping reboot restore scsi swapon umount
+
+progs mount_msdos mount_cd9660 mount_nfs
+ln dump rdump
+ln restore rrestore
+ln newfs mount_mfs
+
+# /usr/bin stuff
+
+progs ftp rsh sed telnet rlogin common find grep
+ln common vi
+ln common view
+ln common ex
+
+# finally, we specify the libraries to link in with our binary
+
+libs -lcrypt -ltelnet -lutil -ll
+libs -lcurses -ltermcap -ledit -lgnuregex -lkvm -lscsi
diff --git a/release/floppies/fixit/image/Makefile b/release/floppies/fixit/image/Makefile
new file mode 100644
index 0000000..a8a80c4
--- /dev/null
+++ b/release/floppies/fixit/image/Makefile
@@ -0,0 +1,16 @@
+###
+# $Id: Makefile,v 1.214 1996/05/02 08:18:28 jkh Exp $
+#
+# What are we if we weren't told..
+CRUNCH?= fixit
+CRUNCHDIRS= ../crunch
+TOP=${.CURDIR}/../../../..
+FS_BIN=${.CURDIR}/../..
+
+# the directories you want on the fs
+FS_DIRS= dev stand bin sbin etc mnt mnt1 mnt2 mnt3 mnt4 tmp
+# a subdir that contains a verbatim image to be copied to the fs
+VERBATIM= ../verbatim
+
+.include "../../crunch_fs.mk"
+all: fs_image
diff --git a/release/floppies/fixit/verbatim/.profile b/release/floppies/fixit/verbatim/.profile
new file mode 100644
index 0000000..f5664e8
--- /dev/null
+++ b/release/floppies/fixit/verbatim/.profile
@@ -0,0 +1,15 @@
+:
+# $Id: fixit.profile,v 1.1 1995/03/15 06:14:19 phk Exp $
+PATH=/stand
+BLOCKSIZE=K
+PS1="Fixit# "
+
+echo '+---------------------------------------------------+'
+echo '| You are now running from a FreeBSD "fixit" floppy |'
+echo '+---------------------------------------------------+'
+echo
+echo 'Good Luck!'
+echo
+
+export PATH BLOCKSIZE PS1
+
diff --git a/release/floppies/makecrunch.mk b/release/floppies/makecrunch.mk
new file mode 100644
index 0000000..ed2be2a
--- /dev/null
+++ b/release/floppies/makecrunch.mk
@@ -0,0 +1,28 @@
+
+
+SYSINSTALL=../../../../release/sysinstall/sysinstall
+NOCRYPT?=yes
+
+all: ${SYSINSTALL} crunch
+
+${SYSINSTALL}:
+ @echo "you need to make sysinstall first"
+ false
+
+crunch:
+ -crunchgen ${.CURDIR}/crunch.conf
+ ${MAKE} -f crunch.mk all NOCRYP=${NOCRYPT} \
+ "CFLAGS=${CFLAGS} -DCRUNCHED_BINARY"
+
+clean:
+ rm -f *.o *.stub *.lo *_stub.c *.mk \
+ crunch.cache \
+ crunch.mk \
+ crunch.c \
+ crunch \
+ .tmp_*
+
+install:
+ @echo " No idea what to do to install yet"
+
+.include <bsd.prog.mk>
diff --git a/release/floppies/root/Makefile b/release/floppies/root/Makefile
new file mode 100644
index 0000000..ee278f7
--- /dev/null
+++ b/release/floppies/root/Makefile
@@ -0,0 +1,6 @@
+###
+# $Id: Makefile,v 1.214 1996/05/02 08:18:28 jkh Exp $
+#
+SUBDIR= crunch image
+
+.include <bsd.subdir.mk>
diff --git a/release/floppies/root/crunch/Makefile b/release/floppies/root/crunch/Makefile
new file mode 100644
index 0000000..b48f9b7
--- /dev/null
+++ b/release/floppies/root/crunch/Makefile
@@ -0,0 +1,2 @@
+.include "../../makecrunch.mk"
+
diff --git a/release/floppies/root/crunch/crunch.conf b/release/floppies/root/crunch/crunch.conf
new file mode 100644
index 0000000..a67fbaf
--- /dev/null
+++ b/release/floppies/root/crunch/crunch.conf
@@ -0,0 +1,38 @@
+# $Id: root_crunch.conf,v 1.6 1995/12/07 10:33:15 peter Exp $
+
+# first, we list the source dirs that our programs reside in. These are
+# searched in order listed to find the dir containing each program.
+
+srcdirs /usr/src/gnu/usr.bin
+srcdirs /usr/src/bin
+srcdirs /usr/src/sbin/i386
+srcdirs /usr/src/sbin
+srcdirs /usr/src/usr.bin
+srcdirs /usr/src/usr.sbin
+
+# second, we list all the programs we want to include in our crunched binary.
+# The order doesn't matter. Any program that needs hard links to it gets an
+# `ln' directive.
+
+# /bin stuff
+
+progs ls cat df ee chmod cksum cp date dd echo ed expr grep hostname kill ln
+progs mkdir mt mv rcp rm rmdir sleep stty sync test ft
+ln test [
+
+# /sbin stuff
+
+progs badsect basename chown clri disklabel dmesg dump dmesg fdisk ft
+progs getopt init mknod mount mount_cd9660 mount_msdos mount_nfs
+progs ping reboot restore swapon umount
+ln dump rdump
+ln restore rrestore
+ln reboot halt
+
+# /usr/bin stuff
+
+progs tar ftp rsh sed telnet rlogin
+
+# finally, we specify the libraries to link in with our binary
+libs -lcrypt -ltelnet -lutil -ll -ledit
+libs -lgnuregex -lreadline -lncurses -lmytinfo -lkvm
diff --git a/release/floppies/root/image/Makefile b/release/floppies/root/image/Makefile
new file mode 100644
index 0000000..a29709c
--- /dev/null
+++ b/release/floppies/root/image/Makefile
@@ -0,0 +1,16 @@
+###
+# $Id: Makefile,v 1.214 1996/05/02 08:18:28 jkh Exp $
+#
+# What are we if we weren't told..
+CRUNCH?= root
+CRUNCHDIRS= ../crunch
+TOP=${.CURDIR}/../../../..
+FS_BIN=${.CURDIR}/../..
+
+# the directories you want on the fs
+FS_DIRS= dev stand bin sbin etc mnt mnt1 mnt2 mnt3 mnt4 tmp
+# a subdir that contains a verbatim image to be copied to the fs
+#VERBATIM= ../verbatim
+
+.include "../../crunch_fs.mk"
+all: fs_image
diff --git a/release/floppies/write_mfs_in_kernel.c b/release/floppies/write_mfs_in_kernel.c
new file mode 100644
index 0000000..886bdd2
--- /dev/null
+++ b/release/floppies/write_mfs_in_kernel.c
@@ -0,0 +1,70 @@
+/*
+ * ----------------------------------------------------------------------------
+ * "THE BEER-WARE LICENSE" (Revision 42):
+ * <phk@login.dknet.dk> wrote this file. As long as you retain this notice you
+ * can do whatever you want with this stuff. If we meet some day, and you think
+ * this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp
+ * ----------------------------------------------------------------------------
+ *
+ * $Id: write_mfs_in_kernel.c,v 1.1 1995/04/25 03:45:18 phk Exp $
+ *
+ * This program patches a filesystem into a kernel made with MFS_ROOT
+ * option.
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <sys/types.h>
+#include <sys/param.h>
+#include <sys/stat.h>
+#include <ufs/ffs/fs.h>
+
+main(int argc, char **argv)
+{
+ unsigned char *buf_kernel, *buf_fs, *p,*q;
+ int fd_kernel, fd_fs;
+ struct stat st_kernel, st_fs;
+ u_long l;
+
+ if (argc < 3) {
+ fprintf(stderr,"Usage:\n\t%s kernel fs\n");
+ exit(2);
+ }
+ fd_kernel = open(argv[1],O_RDWR);
+ if (fd_kernel < 0) { perror(argv[1]); exit(2); }
+ fstat(fd_kernel,&st_kernel);
+ fd_fs = open(argv[2],O_RDONLY);
+ if (fd_fs < 0) { perror(argv[2]); exit(2); }
+ fstat(fd_fs,&st_fs);
+ buf_kernel = malloc(st_kernel.st_size);
+ if (!buf_kernel) { perror("malloc"); exit(2); }
+ buf_fs = malloc(st_fs.st_size);
+ if (!buf_fs) { perror("malloc"); exit(2); }
+ if (st_kernel.st_size != read(fd_kernel,buf_kernel,st_kernel.st_size))
+ { perror(argv[1]); exit(2); }
+ if (st_fs.st_size != read(fd_fs,buf_fs,st_fs.st_size))
+ { perror(argv[2]); exit(2); }
+ for(l=0,p=buf_kernel; l < st_kernel.st_size - st_fs.st_size ; l++,p++ )
+ if(*p == 'M' && !strcmp(p,"MFS Filesystem goes here"))
+ goto found;
+ fprintf(stderr,"MFS filesystem signature not found in %s\n",argv[1]);
+ exit(1);
+ found:
+ for(l=0,q= p + SBOFF; l < st_fs.st_size - SBOFF ; l++,q++ )
+ if (*q)
+ goto fail;
+ memcpy(p+SBOFF,buf_fs+SBOFF,st_fs.st_size-SBOFF);
+ lseek(fd_kernel,0L,SEEK_SET);
+ if (st_kernel.st_size != write(fd_kernel,buf_kernel,st_kernel.st_size))
+ { perror(argv[1]); exit(2); }
+ exit(0);
+ fail:
+ l += SBOFF;
+ fprintf(stderr,"Obstruction in kernel after %ld bytes (%ld Kbyte)\n",
+ l, l/1024);
+ fprintf(stderr,"Filesystem is %ld bytes (%ld Kbyte)\n",
+ (u_long)st_fs.st_size, (u_long)st_fs.st_size/1024);
+ exit(1);
+}
OpenPOWER on IntegriCloud