Date: Mon, 28 Jul 1997 14:49:38 -0400 From: Jim Carroll <jim@carroll.com> To: freebsd-hackers@freebsd.org Subject: make boot.flp FIXED! Message-ID: <Pine.BSD.3.91.970728142550.17581F-100000@apollo.carroll.com>
index | next in thread | raw e-mail
Several weeks ago I embarked on what I thought was a simple task; to make a
boot floppy, with a custom version of the operating system. It turns out,
this is not so simple.
I believe I now have a working Makefile that anyone can use to re-create
either the standard boot OS, or to create their own (I needed a version of
the OS with the Iomega parallel Zip drive at boot time).
There were basically 4 changes that needed to be made. I have included a
description of the changes here, and a Makefile diff output below.
1. changed /R to ${RR} macro. This was a consistancy change (consistant
with the ${RD} macro), to permit sending the output somewhere other than to
the root of the filesystem. Without changing this to a macro, the /R
directory (which is quite large upon completion) would go to /.
2. change doMFSKERN target to work the the KERNELS? macro defined at top of
makefile. By forcing doMFSKERN to use the KERNELS macro, you can define
which custom OS to build.
3. change release.8 to get device definitions from /dev instead of
${RD}/trees/bin/dev. I spent alot of time agonizing over this one. Somehow
release.8 expects the target directory ${RD}/trees.bin/dev to get created
with devices from /dev, but I could not figure out where this was supposed
to happen. In any event, since this directory is built from /dev, I saw no
harm in going to the "horeses mouth".
4. added custom.floppy target to handle the details of building a floppy OS
from scratch assuming no other make tages from the /usr/src/release
makefile were first built.
To use the custom.floppy (which defaults to GENERIC), you must first:
cd /usr/src
make world
(go away for about 12-hours)
After that:
cd /usr/src/release
vi Makefile
Be sure to set:
BUILDNAME, CHROOTDIR, RELEASETAG, RR
Here are my settings (to create 2.2.1 generic release)
BUILDNAME=2.2-RELEASE
CHROOTDIR=/var/junk/release
RELEASETAG=RELENG_2_2_1_RELEASE
RR=/var/R
make custom.floppy
On a 486/133-16MB RAM, the make takes about 2 hours.
I have included the output from a diff of the new Makefile from the
distribution Makefile:
diff -e Makefile.old Makefile.new
Yeilds:
56,58c56,59
< RD= /R/stage
< FD= /R/ftp
< CD= /R/cdrom
---
> RR= /var/R
> RD= ${RR}/stage
> FD= ${RR}/ftp
> CD= ${RR}/cdrom
143c144
< echo "export RELEASEDIR=/R" >> ${CHROOTDIR}/mk
---
> echo "export RELEASEDIR=${RR}" >> ${CHROOTDIR}/mk
178c179,196
< # Clean out /R and make the directory structure.
---
> custom.floppy:
> .if !defined(CHROOTDIR) || !defined(BUILDNAME)
> @echo "To make a release you must set CHROOTDIR and BUILDNAME" && false
> .endif
> .if exists(${CHROOTDIR})
> chflags -R noschg ${CHROOTDIR}/.
> -rm -rf ${CHROOTDIR}
> .endif
> -mkdir -p ${CHROOTDIR}
> cd ${.CURDIR}/../etc && ${MAKE} distrib-dirs DESTDIR=${CHROOTDIR}
> cd ${.CURDIR}/../etc && ${MAKE} distribution DESTDIR=${CHROOTDIR}
> cd ${.CURDIR}/.. && ${MAKE} install DESTDIR=${CHROOTDIR} NOMAN=1
> ${MAKE} release.1
> ${MAKE} release.2
> ${MAKE} boot.flp
>
>
> # Clean out ${RR} and make the directory structure.
180,187c198,205
< -mkdir /R
< chflags -R noschg /R/.
< rm -rf /R/*
< mkdir ${RD}
< mkdir ${RD}/floppies
< mkdir ${RD}/trees
< mkdir ${RD}/dists
< mkdir ${RD}/kernels
---
> -mkdir ${RR}
> chflags -R noschg ${RR}/.
> rm -rf ${RR}/*
> mkdir -p ${RD}
> mkdir -p ${RD}/floppies
> mkdir -p ${RD}/trees
> mkdir -p ${RD}/dists
> mkdir -p ${RD}/kernels
401c419
< ( cd ${RD}/trees/bin/dev && \
---
> ( cd /dev && \
627,628c645,646
< -e 's/GENERIC/BOOTMFS/g' \
< -e '/maxusers/s/10/4/' < GENERIC > BOOTMFS && \
---
> -e 's/${KERNELS}/BOOTMFS/g' \
> -e '/maxusers/s/10/4/' < ${KERNELS} > BOOTMFS && \
There was one other change necessary to make the targets compile.
sysinstall needed to libs not listed in the boot floppy crunch.conf file.
Add these to libs to the 'libs' statement in the file:
/usr/src/release/floppies/boot/crunch
-lcrypt -lftpio
I believe this is the core of the changes I had to make to get this all to
work. If anyone needs help, please feel free to email me.
---
Jim C., President | C A R R O L L - N E T, Inc.
201-488-1332 voice | New Jersey's Premier Internet Service Provider
201-487-5717 dialup |
http://www.carroll.com | Ask about our Business Messaging Services
help
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSD.3.91.970728142550.17581F-100000>
