Overhaul our boot floppy generation system so that it scales better and
requires minimal care and feeding for future releases. - Consolidate multitude of floppy related constants down to a normal FLOPPY set for 1.44 floppies and on PC98 a SMALLFLOPPY set for 1.2 floppies. Also, cleanup the i386 arch section by not duplicating constants that are the same on both machine types (i386 and pc98). - Update the ZIPNSPLIT macro to generate a file chunks that will actually fit onto 1.44 floppies formatted with UFS1. Unfortunately, split(1) seems to be somewhat buggy, so the files generated are slightly larger than the argument passed to split. - Split the release.10 target into 3 targers: floppies.1, floppies.2 and floppies.3 that are added to EXTRAS only if NOFLOPPIES is defined. floppies.1 builds the install floppies, floppies.2 builds the fixit floppy, and floppies.3 generates the md5 sums and READMEs for the floppies/ directory. - Drop the by now largely obsolete and less useful boot.flp picture. This was more useful when the mfsroot lived inside the kernel rather than being loaded from a separate file by the loader. - Only build a single mfsroot containing no modules that is used for all installation methods. - Use split-file.sh to split up a gzipped GENERIC kernel into however many floppies it takes for the boot kernel. Currently, a stock 5.2 GENERIC kernel including WITNESS, INVARIANTS, DDB, and other assorted bloat fits onto 2 additional floppies besides the boot floppy with some room to spare. - If SPLIT_MFSROOT is defined, the mfsroot.gz file is similar split into however many floppies are needed. Currently it is not defined as the mfsroot.gz fits onto the current boot.flp with room to spare. - Add a 'makeFloppySet' target which builds a floppy set for a file that was split using split-file.sh. - Rename the doMFSKERN target to 'buildBootFloppy' as that more closely matches what it does now. We no longer build a custom BOOTMFS kernel for each boot floppy. - We no longer build a 2.88 boot.flp image to use with emulated CD booting. The non-emulated cdboot works for almost everyone who boots off of CD and if it doesn't work on a particular machine, the user can always boot from the 1.44 floppy images. - We no longer build a driver floppy or stick kernel modules in the mfsroot since we now use a stock kernel when booting from floppy.
This commit is contained in:
parent
18e5e37daa
commit
c0731f81d3
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=125052
356
release/Makefile
356
release/Makefile
@ -165,35 +165,18 @@ MNT= /mnt
|
|||||||
|
|
||||||
.if ${TARGET_ARCH} == "i386"
|
.if ${TARGET_ARCH} == "i386"
|
||||||
.if ${TARGET} == "pc98"
|
.if ${TARGET} == "pc98"
|
||||||
SMALLBOOTSIZE= 1200
|
SMALLFLOPPYSIZE= 1200
|
||||||
BOOTSIZE= 1440
|
SMALLFLOPPYSPLITSIZE= 1152
|
||||||
SMALLFIXITSIZE= 1200
|
SMALLFLOPPYLABEL= fd1200
|
||||||
FIXITSIZE= 1440
|
|
||||||
MFSSIZE= 4320
|
|
||||||
BOOTINODE= 80000
|
|
||||||
FIXITINODE= 40000
|
|
||||||
MFSINODE= 8000
|
|
||||||
SMALLBOOTLABEL= fd1200
|
|
||||||
BOOTLABEL= fd1440
|
|
||||||
SMALLFIXITLABEL= fd1200
|
|
||||||
FIXITLABEL= fd1440
|
|
||||||
MFSLABEL= minimum3
|
|
||||||
.else
|
|
||||||
DRIVERSIZE= 1440
|
|
||||||
BOOTSIZE= 1440
|
|
||||||
FIXITSIZE= 1440
|
|
||||||
MFSSIZE= 4320
|
|
||||||
BIGBOOTSIZE= 2880
|
|
||||||
DRIVERINODE= 40000
|
|
||||||
BOOTINODE= 80000
|
|
||||||
FIXITINODE= 40000
|
|
||||||
MFSINODE= 8000
|
|
||||||
DRIVERLABEL= fd1440
|
|
||||||
BOOTLABEL= fd1440
|
|
||||||
FIXITLABEL= fd1440
|
|
||||||
MFSLABEL= minimum3
|
|
||||||
BIGBOOTLABEL= minimum2
|
|
||||||
.endif
|
.endif
|
||||||
|
FLOPPYSIZE= 1440
|
||||||
|
FLOPPYSPLITSIZE= 1392
|
||||||
|
MFSSIZE= 4320
|
||||||
|
FLOPPYINODE= 40000
|
||||||
|
BOOTINODE= 80000
|
||||||
|
MFSINODE= 8000
|
||||||
|
FLOPPYLABEL= fd1440
|
||||||
|
MFSLABEL= minimum3
|
||||||
.elif ${TARGET_ARCH} == "alpha"
|
.elif ${TARGET_ARCH} == "alpha"
|
||||||
MFSSIZE= 4320
|
MFSSIZE= 4320
|
||||||
MFSINODE= 8000
|
MFSINODE= 8000
|
||||||
@ -224,7 +207,7 @@ DISKLABEL?= bsdlabel
|
|||||||
DISKLABEL?= disklabel
|
DISKLABEL?= disklabel
|
||||||
.endif
|
.endif
|
||||||
|
|
||||||
ZIPNSPLIT= gzip --no-name -9 -c | split -b 1423k -
|
ZIPNSPLIT= gzip --no-name -9 -c | split -b 1392k -
|
||||||
|
|
||||||
# Things that need to be compiled without crypto support in releases
|
# Things that need to be compiled without crypto support in releases
|
||||||
.if !defined(FIXCRYPTO) && !make(release) && !make(rerelease)
|
.if !defined(FIXCRYPTO) && !make(release) && !make(rerelease)
|
||||||
@ -262,7 +245,10 @@ CRUNCH_TARGETS+=fixit-small
|
|||||||
.endif
|
.endif
|
||||||
.endif
|
.endif
|
||||||
|
|
||||||
EXTRAS= ftp.1
|
.if !defined(NOFLOPPIES)
|
||||||
|
EXTRAS= floppies.1 floppies.2 floppies.3
|
||||||
|
.endif
|
||||||
|
EXTRAS+= ftp.1
|
||||||
.if !defined(NOCDROM)
|
.if !defined(NOCDROM)
|
||||||
EXTRAS+= cdrom.1
|
EXTRAS+= cdrom.1
|
||||||
.if defined(MAKE_ISOS)
|
.if defined(MAKE_ISOS)
|
||||||
@ -489,8 +475,7 @@ release rerelease:
|
|||||||
env -i /usr/sbin/chroot `dirname ${_MK}` /`basename ${_MK}`
|
env -i /usr/sbin/chroot `dirname ${_MK}` /`basename ${_MK}`
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -rf ${CRUNCH_TARGETS:S/$/_crunch/} release.[0-9] release.10 \
|
rm -rf ${CRUNCH_TARGETS:S/$/_crunch/} release.[0-9] ${EXTRAS}
|
||||||
${EXTRAS}
|
|
||||||
|
|
||||||
fetch-distfiles:
|
fetch-distfiles:
|
||||||
@for i in ${DOCPORTS}; do \
|
@for i in ${DOCPORTS}; do \
|
||||||
@ -666,19 +651,7 @@ release.8:
|
|||||||
.endif
|
.endif
|
||||||
touch ${.TARGET}
|
touch ${.TARGET}
|
||||||
|
|
||||||
# Complete the bootfd
|
# Build the memory root filesystem.
|
||||||
#
|
|
||||||
# Now, just to get this picture down once and for all:
|
|
||||||
#
|
|
||||||
# +------------------------------------------------------------------------+
|
|
||||||
# |boot.flp |
|
|
||||||
# +-----+-----+------------------------------------------------------------+
|
|
||||||
# |boot1|boot2|floppy filesystem "bootfd" |
|
|
||||||
# +-----+-----+-+----------------------+---------------------------------+-+
|
|
||||||
# |kernel.gz |mfsroot.gz |
|
|
||||||
# +----------------------+---------------------------------+
|
|
||||||
#
|
|
||||||
|
|
||||||
release.9:
|
release.9:
|
||||||
.if exists(${.CURDIR}/../sys/boot/${TARGET}/loader)
|
.if exists(${.CURDIR}/../sys/boot/${TARGET}/loader)
|
||||||
cd ${.CURDIR}/../sys/boot/${TARGET}/loader; \
|
cd ${.CURDIR}/../sys/boot/${TARGET}/loader; \
|
||||||
@ -742,61 +715,69 @@ release.9:
|
|||||||
.endif
|
.endif
|
||||||
@tar --exclude CVS -cf - -C ${.CURDIR}/../usr.sbin/sysinstall help | \
|
@tar --exclude CVS -cf - -C ${.CURDIR}/../usr.sbin/sysinstall help | \
|
||||||
tar xf - -C ${RD}/mfsfd/stand
|
tar xf - -C ${RD}/mfsfd/stand
|
||||||
.if defined(SMALLBOOTSIZE)
|
|
||||||
@mkdir -p ${RD}/mfsroot-small
|
|
||||||
.if exists(${.CURDIR}/${TARGET}/drivers-small.conf)
|
|
||||||
@mkdir -p ${RD}/mfsfd/modules
|
|
||||||
@awk -f ${.CURDIR}/scripts/driver-copy2.awk 2 \
|
|
||||||
${.CURDIR}/${TARGET}/drivers-small.conf \
|
|
||||||
${RD}/trees/base/boot/kernel ${RD}/mfsfd/modules
|
|
||||||
.endif
|
|
||||||
sh -e ${DOFS_SH} ${RD}/mfsroot-small/mfsroot ${RD} ${MNT} \
|
|
||||||
${MFSSIZE} ${RD}/mfsfd ${MFSINODE} ${MFSLABEL}
|
|
||||||
@gzip -9nv ${RD}/mfsroot-small/mfsroot
|
|
||||||
@rm -rf ${RD}/mfsfd/modules
|
|
||||||
.endif
|
|
||||||
.if exists(${.CURDIR}/${TARGET}/drivers.conf)
|
|
||||||
@mkdir -p ${RD}/mfsfd/modules
|
|
||||||
@awk -f ${.CURDIR}/scripts/driver-copy2.awk 2 \
|
|
||||||
${.CURDIR}/${TARGET}/drivers.conf \
|
|
||||||
${RD}/trees/base/boot/kernel ${RD}/mfsfd/modules
|
|
||||||
.endif
|
|
||||||
@mkdir -p ${RD}/mfsroot
|
@mkdir -p ${RD}/mfsroot
|
||||||
sh -e ${DOFS_SH} ${RD}/mfsroot/mfsroot ${RD} ${MNT} \
|
sh -e ${DOFS_SH} ${RD}/mfsroot/mfsroot ${RD} ${MNT} \
|
||||||
${MFSSIZE} ${RD}/mfsfd ${MFSINODE} ${MFSLABEL}
|
${MFSSIZE} ${RD}/mfsfd ${MFSINODE} ${MFSLABEL}
|
||||||
@gzip -9nv ${RD}/mfsroot/mfsroot
|
@gzip -9nv ${RD}/mfsroot/mfsroot
|
||||||
touch ${.TARGET}
|
touch ${.TARGET}
|
||||||
|
|
||||||
release.10:
|
KERNFLOPPYSET= ${RD}/floppyset/kern/kernel.gz
|
||||||
.if !defined(NO_FLOPPIES)
|
.if defined(SMALLFLOPPYSIZE)
|
||||||
.if exists(${.CURDIR}/${TARGET}/drivers.conf)
|
SMALLKERNFLOPPYSET= ${RD}/floppyset/kern-small/kernel.gz
|
||||||
@echo "Making the drivers floppy."
|
|
||||||
@rm -rf ${RD}/driversfd
|
|
||||||
@mkdir ${RD}/driversfd
|
|
||||||
@awk -f ${.CURDIR}/scripts/driver-copy2.awk 3 \
|
|
||||||
${.CURDIR}/${TARGET}/drivers.conf \
|
|
||||||
${RD}/trees/base/boot/kernel ${RD}/driversfd
|
|
||||||
-@rmdir ${RD}/driversfd
|
|
||||||
if [ -d ${RD}/driversfd ]; then \
|
|
||||||
sh -e ${DOFS_SH} ${RD}/floppies/drivers.flp ${RD} ${MNT} \
|
|
||||||
${DRIVERSIZE} ${RD}/driversfd ${DRIVERINODE} ${DRIVERLABEL}; \
|
|
||||||
cd ${RD}/driversfd && awk -f ${.CURDIR}/scripts/driver-desc.awk \
|
|
||||||
*.dsc >> ${RD}/floppies/DRIVERS.TXT; \
|
|
||||||
fi
|
|
||||||
.endif
|
.endif
|
||||||
.if defined(BOOTSIZE)
|
.if defined(SPLIT_MFSROOT)
|
||||||
@echo "Making the regular boot floppy."
|
MFSROOTFLOPPYSET= ${RD}/floppyset/mfsroot/mfsroot.gz
|
||||||
@cd ${.CURDIR} && ${MAKE} doMFSKERN FSIMAGE=kern
|
.if defined(SMALLFLOPPYSIZE)
|
||||||
|
SMALLMFSROOTFLOPPYSET= ${RD}/floppyset/mfsroot-small/mfsroot.gz
|
||||||
.endif
|
.endif
|
||||||
.if defined(SMALLBOOTSIZE)
|
|
||||||
@echo "Making the small boot floppy."
|
|
||||||
@cd ${.CURDIR} && ${MAKE} doMFSKERN FSIMAGE=kern-small FDSIZE=SMALL
|
|
||||||
.endif
|
.endif
|
||||||
.if defined(BIGBOOTSIZE)
|
|
||||||
@echo "Making the big boot floppy."
|
# Build boot and install floppies.
|
||||||
@cd ${.CURDIR} && ${MAKE} doMFSKERN FSIMAGE=boot FDSIZE=BIG
|
floppies.1:
|
||||||
|
@gzip -9nc ${RD}/trees/base/boot/kernel/kernel > ${RD}/kernels/kernel.gz
|
||||||
|
@echo "Making the kernel boot floppies..."
|
||||||
|
@cd ${.CURDIR} && ${MAKE} makeFloppySet FLOPPYBASE=kern \
|
||||||
|
FLOPPYDESC="Kernel" SPLITFILE=${RD}/kernels/kernel.gz
|
||||||
|
.if defined(SMALLFLOPPYSIZE)
|
||||||
|
@echo "Making the small kernel boot floppies..."
|
||||||
|
@cd ${.CURDIR} && ${MAKE} makeFloppySet FLOPPYBASE=kern-small \
|
||||||
|
FLOPPYDESC="Kernel" SPLITFILE=${RD}/kernels/kernel.gz \
|
||||||
|
FDSIZE="SMALL"
|
||||||
.endif
|
.endif
|
||||||
.if defined(FIXITSIZE) || defined(SMALLFIXITSIZE)
|
.if defined(SPLIT_MFSROOT)
|
||||||
|
@echo "Making the mfsroot boot floppies..."
|
||||||
|
@cd ${.CURDIR} && ${MAKE} makeFloppySet FLOPPYBASE=mfsroot \
|
||||||
|
FLOPPYDESC="Memory Filesystem" SPLITFILE=${RD}/mfsroot/mfsroot.gz
|
||||||
|
.if defined(SMALLFLOPPYSIZE)
|
||||||
|
@echo "Making the small mfsroot boot floppies..."
|
||||||
|
@cd ${.CURDIR} && ${MAKE} makeFloppySet FLOPPYBASE=mfsroot-small \
|
||||||
|
FLOPPYDESC="Memory Filesystem" SPLITFILE=${RD}/mfsroot/mfsroot.gz \
|
||||||
|
FDSIZE="SMALL"
|
||||||
|
.endif
|
||||||
|
@cd ${.CURDIR} && ${MAKE} buildBootFloppy FSIMAGE="boot" \
|
||||||
|
KERNFILE="${KERNFLOPPYSET}.split ${KERNFLOPPYSET}.boot" \
|
||||||
|
MFSROOTFILE="${MFSROOTFLOPPYSET}.split ${MFSROOTFLOPPYSET}.boot"
|
||||||
|
.if defined(SMALLFLOPPYSIZE)
|
||||||
|
@cd ${.CURDIR} && ${MAKE} buildBootFloppy FSIMAGE="boot" \
|
||||||
|
KERNFILE="${SMALLKERNFLOPPYSET}.split ${SMALLKERNFLOPPYSET}.boot" \
|
||||||
|
MFSROOTFILE="${SMALLMFSROOTFLOPPYSET}.split ${SMALLMFSROOTFLOPPYSET}.boot" \
|
||||||
|
FDSIZE="SMALL"
|
||||||
|
.endif
|
||||||
|
.else # !SPLIT_MFSROOT
|
||||||
|
@cd ${.CURDIR} && ${MAKE} buildBootFloppy FSIMAGE="boot" \
|
||||||
|
KERNFILE="${KERNFLOPPYSET}.split ${KERNFLOPPYSET}.boot" \
|
||||||
|
MFSROOTFILE=${RD}/mfsroot/mfsroot.gz
|
||||||
|
.if defined(SMALLFLOPPYSIZE)
|
||||||
|
@cd ${.CURDIR} && ${MAKE} buildBootFloppy FSIMAGE="boot" \
|
||||||
|
KERNFILE="${SMALLKERNFLOPPYSET}.split ${SMALLKERNFLOPPYSET}.boot" \
|
||||||
|
MFSROOTFILE=${RD}/mfsroot/mfsroot.gz \
|
||||||
|
FDSIZE="SMALL"
|
||||||
|
.endif
|
||||||
|
.endif # SPLIT_MFSROOT
|
||||||
|
touch ${.TARGET}
|
||||||
|
|
||||||
|
# Build fixit floppy.
|
||||||
|
floppies.2:
|
||||||
@echo "Making fixit floppy."
|
@echo "Making fixit floppy."
|
||||||
@rm -rf ${RD}/fixitfd
|
@rm -rf ${RD}/fixitfd
|
||||||
@mkdir ${RD}/fixitfd
|
@mkdir ${RD}/fixitfd
|
||||||
@ -813,29 +794,28 @@ release.10:
|
|||||||
@cp ${.CURDIR}/fixit.services ${RD}/fixitfd/etc/services
|
@cp ${.CURDIR}/fixit.services ${RD}/fixitfd/etc/services
|
||||||
@cp ${.CURDIR}/scripts/tar.sh ${RD}/fixitfd/stand/tar
|
@cp ${.CURDIR}/scripts/tar.sh ${RD}/fixitfd/stand/tar
|
||||||
@chmod 555 ${RD}/fixitfd/stand/tar
|
@chmod 555 ${RD}/fixitfd/stand/tar
|
||||||
.if defined(SMALLFIXITSIZE)
|
.if defined(SMALLFLOPPYSIZE)
|
||||||
@cd ${.CURDIR} && ${MAKE} installCRUNCH CRUNCH=fixit-small \
|
@cd ${.CURDIR} && ${MAKE} installCRUNCH CRUNCH=fixit-small \
|
||||||
DIR=${RD}/fixitfd/stand ZIP=false
|
DIR=${RD}/fixitfd/stand ZIP=false
|
||||||
@sh -e ${DOFS_SH} ${RD}/floppies/fixit-small.flp ${RD} ${MNT} \
|
@sh -e ${DOFS_SH} ${RD}/floppies/fixit-small.flp ${RD} ${MNT} \
|
||||||
${SMALLFIXITSIZE} ${RD}/fixitfd ${FIXITINODE} ${SMALLFIXITLABEL}
|
${SMALLFLOPPYSIZE} ${RD}/fixitfd ${FLOPPYINODE} ${SMALLFLOPPYLABEL}
|
||||||
@rm -rf ${RD}/fixitfd/stand
|
@rm -rf ${RD}/fixitfd/stand
|
||||||
@mkdir ${RD}/fixitfd/stand
|
@mkdir ${RD}/fixitfd/stand
|
||||||
.endif
|
.endif
|
||||||
.if defined(FIXITSIZE)
|
|
||||||
@cd ${.CURDIR} && ${MAKE} installCRUNCH CRUNCH=fixit \
|
@cd ${.CURDIR} && ${MAKE} installCRUNCH CRUNCH=fixit \
|
||||||
DIR=${RD}/fixitfd/stand ZIP=false
|
DIR=${RD}/fixitfd/stand ZIP=false
|
||||||
@sh -e ${DOFS_SH} ${RD}/floppies/fixit.flp ${RD} ${MNT} \
|
@sh -e ${DOFS_SH} ${RD}/floppies/fixit.flp ${RD} ${MNT} \
|
||||||
${FIXITSIZE} ${RD}/fixitfd ${FIXITINODE} ${FIXITLABEL}
|
${FLOPPYSIZE} ${RD}/fixitfd ${FLOPPYINODE} ${FLOPPYLABEL}
|
||||||
.endif
|
touch ${.TARGET}
|
||||||
.endif
|
|
||||||
# Do our last minute floppies directory setup in a convenient place.
|
# Do our last minute floppies directory setup
|
||||||
|
floppies.3:
|
||||||
.if !defined(NODOC)
|
.if !defined(NODOC)
|
||||||
@cp ${RND}/${RELNOTES_LANG}/installation/${TARGET}/article.txt \
|
@cp ${RND}/${RELNOTES_LANG}/installation/${TARGET}/article.txt \
|
||||||
${RD}/floppies/README.TXT
|
${RD}/floppies/README.TXT
|
||||||
@(cd ${RD}/floppies; md5 README.TXT *.flp > CHECKSUM.MD5)
|
@(cd ${RD}/floppies; md5 README.TXT *.flp > CHECKSUM.MD5)
|
||||||
.else
|
.else
|
||||||
@(cd ${RD}/floppies; md5 *.flp > CHECKSUM.MD5)
|
@(cd ${RD}/floppies; md5 *.flp > CHECKSUM.MD5)
|
||||||
.endif
|
|
||||||
.endif
|
.endif
|
||||||
touch ${.TARGET}
|
touch ${.TARGET}
|
||||||
|
|
||||||
@ -1036,12 +1016,13 @@ doTARBALL:
|
|||||||
)
|
)
|
||||||
|
|
||||||
doRELEASE: release.1 release.2 release.3 ${DOCREL} release.4 release.5 \
|
doRELEASE: release.1 release.2 release.3 ${DOCREL} release.4 release.5 \
|
||||||
release.6 release.7 release.8 release.9 release.10 ${EXTRAS}
|
release.6 release.7 release.8 release.9 ${EXTRAS}
|
||||||
@echo "Release done"
|
@echo "Release done"
|
||||||
|
|
||||||
floppies:
|
floppies:
|
||||||
@rm -f release.5 release.9 release.10
|
@rm -f release.5 release.9 floppies.[123]
|
||||||
@cd ${.CURDIR} && ${MAKE} release.5 release.9 release.10
|
@cd ${.CURDIR} && ${MAKE} release.5 release.9 floppies.1 floppies.2 \
|
||||||
|
floppies.3
|
||||||
@cd ${RD} && find floppies -print | cpio -dumpl ${FD}
|
@cd ${RD} && find floppies -print | cpio -dumpl ${FD}
|
||||||
|
|
||||||
installCRUNCH:
|
installCRUNCH:
|
||||||
@ -1071,94 +1052,109 @@ installCRUNCH:
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
#
|
#
|
||||||
# --==## Put a filesystem into a BOOTMFS kernel ##==--
|
# --==## Build a floppy set for a splitfs file ##==--
|
||||||
#
|
#
|
||||||
doMFSKERN:
|
# FLOPPYBASE - basename of floppy image files
|
||||||
@echo "Running ${.TARGET} for ${FSIMAGE}"
|
# FLOPPYDESC - description of floppy set
|
||||||
@rm -f ${RD}/kernels/BOOTMFS ${RD}/kernels/BOOTMFS.${FSIMAGE}
|
# SPLITFILE - filename of the file to split
|
||||||
@cd ${.CURDIR}/../sys/${TARGET}/conf; \
|
# FDSIZE - if specified and "small", small floppy is created
|
||||||
if [ -r ${.CURDIR}/${TARGET}/dokern.sh ]; then \
|
|
||||||
sh ${.CURDIR}/${TARGET}/dokern.sh ${FDSIZE}; \
|
.if make(makeFloppySet)
|
||||||
else \
|
SPLITDIR= ${RD}/floppyset/${FLOPPYBASE}
|
||||||
sed -e 's/ident.*GENERIC/ident BOOTMFS/g'; \
|
.if defined(FDSIZE) && ${FDSIZE} == "SMALL"
|
||||||
fi < GENERIC > BOOTMFS; \
|
FLPSPLITSIZE= ${SMALLFLOPPYSPLITSIZE}
|
||||||
[ -r GENERIC.hints ] && cp GENERIC.hints BOOTMFS.hints
|
FLPSIZE= ${SMALLFLOPPYSIZE}
|
||||||
.if defined(FDSIZE) && ${FDSIZE} == "SMALL" && \
|
FLPLABEL= ${SMALLFLOPPYLABEL}
|
||||||
exists(${.CURDIR}/${TARGET}/drivers-small.conf)
|
.else
|
||||||
@awk -f ${.CURDIR}/scripts/driver-remove.awk \
|
FLPSPLITSIZE= ${FLOPPYSPLITSIZE}
|
||||||
${.CURDIR}/${TARGET}/drivers-small.conf \
|
FLPSIZE= ${FLOPPYSIZE}
|
||||||
${.CURDIR}/../sys/${TARGET}/conf/BOOTMFS
|
FLPLABEL= ${FLOPPYLABEL}
|
||||||
.elif exists(${.CURDIR}/${TARGET}/drivers.conf)
|
|
||||||
@awk -f ${.CURDIR}/scripts/driver-remove.awk \
|
|
||||||
${.CURDIR}/${TARGET}/drivers.conf \
|
|
||||||
${.CURDIR}/../sys/${TARGET}/conf/BOOTMFS
|
|
||||||
.endif
|
.endif
|
||||||
cd ${.CURDIR}/..; \
|
.endif
|
||||||
KERNEL_KO=BOOTMFS KODIR= \
|
|
||||||
${CROSSMAKE} ${KERNEL_FLAGS} -DNO_MODULES -DNO_KERNELCLEAN \
|
makeFloppySet:
|
||||||
KERNCONF=BOOTMFS COPTFLAGS="-Os -pipe" -DNO_CPU_COPTFLAGS \
|
.if !defined(FLOPPYBASE)
|
||||||
buildkernel reinstallkernel \
|
@echo "FLOPPYBASE undefined in ${.TARGET}" && exit 1
|
||||||
DESTDIR=${RD}/kernels
|
.endif
|
||||||
[ -r ${.CURDIR}/../sys/${TARGET}/conf/BOOTMFS.hints ] && \
|
.if !defined(FLOPPYDESC)
|
||||||
cp ${.CURDIR}/../sys/${TARGET}/conf/BOOTMFS.hints ${RD}/kernels
|
@echo "FLOPPYDESC undefined in ${.TARGET}" && exit 1
|
||||||
@rm -rf ${RD}/image.${FSIMAGE}
|
.endif
|
||||||
@mkdir ${RD}/image.${FSIMAGE}
|
.if !defined(SPLITFILE)
|
||||||
@cd ${RD}/kernels && \
|
@echo "SPLITFILE undefined in ${.TARGET}" && exit 1
|
||||||
(chflags noschg BOOTMFS || true) && \
|
.endif
|
||||||
${WMAKEENV} strip -R .comment BOOTMFS && \
|
${.CURDIR}/scripts/split-file.sh ${SPLITFILE} \
|
||||||
cp BOOTMFS BOOTMFS.${FSIMAGE} && \
|
${RD}/floppyset/${FLOPPYBASE} ${FLPSPLITSIZE} "${FLOPPYDESC}"
|
||||||
[ -r BOOTMFS.hints ] && mv BOOTMFS.hints BOOTMFS.${FSIMAGE}.hints
|
( splitfile=${SPLITDIR}/`basename ${SPLITFILE}`.split ; \
|
||||||
mv ${RD}/kernels/BOOTMFS ${RD}/image.${FSIMAGE}/kernel
|
lines=`cat $${splitfile} | wc -l`; \
|
||||||
|
lines=$$((lines - 1)) ; \
|
||||||
|
for line in `jot $$lines`; do \
|
||||||
|
file=`head -n $$(($${line} + 1)) $${splitfile} | tail -1 | cut -f 1 -d ' '` ; \
|
||||||
|
sh -e ${DOFS_SH} ${RD}/floppies/${FLOPPYBASE}$${line}.flp \
|
||||||
|
${RD} ${MNT} ${FLPSIZE} ${SPLITDIR}/$${file} \
|
||||||
|
${BOOTINODE} ${FLPLABEL}; \
|
||||||
|
done )
|
||||||
|
|
||||||
|
#
|
||||||
|
# --==## Build a boot floppy ##==--
|
||||||
|
#
|
||||||
|
# FSIMAGE - base floppy image name
|
||||||
|
# FDSIZE - if specified and "small", small floppy is created
|
||||||
|
# KERNFILE - path to kernel split file
|
||||||
|
# MFSROOTFILE - path to mfsroot split file
|
||||||
|
|
||||||
|
.if make(buildBootFloppy)
|
||||||
|
IMAGEDIR= ${RD}/image.${FSIMAGE}
|
||||||
|
HINTSFILE= ${.CURDIR}/../sys/${TARGET}/conf/GENERIC.hints
|
||||||
|
IMAGEFILE= ${RD}/floppies/${FSIMAGE}.flp
|
||||||
|
.if defined(FDSIZE) && ${FDSIZE} == "SMALL"
|
||||||
|
FLPSIZE= ${SMALLFLOPPYSIZE}
|
||||||
|
FLPLABEL= ${SMALLFLOPPYLABEL}
|
||||||
|
.else
|
||||||
|
FLPSIZE= ${FLOPPYSIZE}
|
||||||
|
FLPLABEL= ${FLOPPYLABEL}
|
||||||
|
.endif
|
||||||
|
.endif
|
||||||
|
|
||||||
|
buildBootFloppy:
|
||||||
|
.if !defined(FSIMAGE)
|
||||||
|
@echo "FSIMAGE undefined in ${.TARGET}" && exit 1
|
||||||
|
.endif
|
||||||
|
.if !defined(KERNFILE)
|
||||||
|
@echo "KERNFILE undefined in ${.TARGET}" && exit 1
|
||||||
|
.endif
|
||||||
|
.if !defined(MFSROOTFILE)
|
||||||
|
@echo "MFSROOTFILE undefined in ${.TARGET}" && exit 1
|
||||||
|
.endif
|
||||||
|
@echo "Running ${.TARGET} for ${FSIMAGE}"
|
||||||
|
@rm -rf ${IMAGEDIR}
|
||||||
|
@mkdir ${IMAGEDIR}
|
||||||
@echo "Setting up /boot directory for ${FSIMAGE} floppy"
|
@echo "Setting up /boot directory for ${FSIMAGE} floppy"
|
||||||
@mkdir -p ${RD}/image.${FSIMAGE}/boot
|
@mkdir -p ${IMAGEDIR}/boot
|
||||||
.if ${TARGET} == "i386"
|
.if ${TARGET} == "i386"
|
||||||
@${WMAKEENV} kgzip -v -l ${RD}/trees/base/usr/lib/kgzldr.o -o \
|
@${WMAKEENV} kgzip -v -l ${RD}/trees/base/usr/lib/kgzldr.o -o \
|
||||||
${RD}/image.${FSIMAGE}/boot/loader ${RD}/trees/special/boot/loader
|
${IMAGEDIR}/boot/loader ${RD}/trees/special/boot/loader
|
||||||
.else
|
.else
|
||||||
@cp ${RD}/trees/special/boot/loader ${RD}/image.${FSIMAGE}/boot
|
@cp ${RD}/trees/special/boot/loader ${IMAGEDIR}/boot
|
||||||
.endif
|
.endif
|
||||||
@[ -r ${RD}/kernels/BOOTMFS.${FSIMAGE}.hints ] && \
|
@[ -r ${HINTSFILE} ] && \
|
||||||
sed -e '/^hint/s/^/set /' -e '/^#/d' \
|
sed -e '/^hint/s/^/set /' -e '/^#/d' ${HINTSFILE} > \
|
||||||
${RD}/kernels/BOOTMFS.${FSIMAGE}.hints > \
|
${IMAGEDIR}/boot/device.hints && \
|
||||||
${RD}/image.${FSIMAGE}/boot/device.hints && \
|
echo "include /boot/device.hints" > ${IMAGEDIR}/boot/loader.rc
|
||||||
echo "include /boot/device.hints" \
|
@echo "load /kernel" >> ${IMAGEDIR}/boot/loader.rc
|
||||||
> ${RD}/image.${FSIMAGE}/boot/loader.rc
|
@echo "echo \\007\\007" >> ${IMAGEDIR}/boot/loader.rc
|
||||||
@echo "load /kernel" >> ${RD}/image.${FSIMAGE}/boot/loader.rc
|
@echo "echo Please insert boot floppy and press enter:" >> ${IMAGEDIR}/boot/loader.rc
|
||||||
.if !defined(FDSIZE) || ${FDSIZE} != "BIG"
|
@echo "read" >> ${IMAGEDIR}/boot/loader.rc
|
||||||
@echo "echo \\007\\007" >> ${RD}/image.${FSIMAGE}/boot/loader.rc
|
@echo "load -t mfs_root /mfsroot" >> ${IMAGEDIR}/boot/loader.rc
|
||||||
@echo "echo Please insert MFS root floppy and press enter:" >> ${RD}/image.${FSIMAGE}/boot/loader.rc
|
@echo "set hint.acpi.0.disabled=1" >> ${IMAGEDIR}/boot/loader.rc
|
||||||
@echo "read" >> ${RD}/image.${FSIMAGE}/boot/loader.rc
|
@echo "echo \\007\\007" >> ${IMAGEDIR}/boot/loader.rc
|
||||||
.endif
|
@echo "autoboot 10" >> ${IMAGEDIR}/boot/loader.rc
|
||||||
@echo "load -t mfs_root /mfsroot" >> ${RD}/image.${FSIMAGE}/boot/loader.rc
|
|
||||||
@echo "set hint.acpi.0.disabled=1" >> ${RD}/image.${FSIMAGE}/boot/loader.rc
|
|
||||||
@if [ -r ${RD}/floppies/drivers.flp ]; then \
|
|
||||||
echo "set driver_floppy=YES" >> ${RD}/image.${FSIMAGE}/boot/loader.rc; \
|
|
||||||
fi
|
|
||||||
@echo "set module_path=\"/modules;/dist\"" >> ${RD}/image.${FSIMAGE}/boot/loader.rc
|
|
||||||
@echo "echo \\007\\007" >> ${RD}/image.${FSIMAGE}/boot/loader.rc
|
|
||||||
@echo "autoboot 10" >> ${RD}/image.${FSIMAGE}/boot/loader.rc
|
|
||||||
.if ${TARGET_ARCH} == "i386" && ${AUTO_KEYBOARD_DETECT}
|
.if ${TARGET_ARCH} == "i386" && ${AUTO_KEYBOARD_DETECT}
|
||||||
@echo "-P" >> ${RD}/image.${FSIMAGE}/boot.config
|
@echo "-P" >> ${IMAGEDIR}/boot.config
|
||||||
.endif
|
|
||||||
@gzip -9v ${RD}/image.${FSIMAGE}/kernel
|
|
||||||
@rm -f ${RD}/floppies/${FSIMAGE}.flp
|
|
||||||
.if defined(FDSIZE) && ${FDSIZE} == "BIG"
|
|
||||||
@cp ${RD}/mfsroot/mfsroot.gz ${RD}/image.${FSIMAGE}
|
|
||||||
sh -e ${DOFS_SH} ${RD}/floppies/${FSIMAGE}.flp ${RD} ${MNT} \
|
|
||||||
${BIGBOOTSIZE} ${RD}/image.${FSIMAGE} ${BOOTINODE} ${BIGBOOTLABEL}
|
|
||||||
.elif defined(FDSIZE) && ${FDSIZE} == "SMALL"
|
|
||||||
sh -e ${DOFS_SH} ${RD}/floppies/mfsroot-small.flp ${RD} ${MNT} \
|
|
||||||
${SMALLBOOTSIZE} ${RD}/mfsroot-small/mfsroot.gz ${BOOTINODE} \
|
|
||||||
${SMALLBOOTLABEL}
|
|
||||||
sh -e ${DOFS_SH} ${RD}/floppies/${FSIMAGE}.flp ${RD} ${MNT} \
|
|
||||||
${SMALLBOOTSIZE} ${RD}/image.${FSIMAGE} ${BOOTINODE} \
|
|
||||||
${SMALLBOOTLABEL}
|
|
||||||
.else
|
|
||||||
sh -e ${DOFS_SH} ${RD}/floppies/mfsroot.flp ${RD} ${MNT} \
|
|
||||||
${BOOTSIZE} ${RD}/mfsroot/mfsroot.gz ${BOOTINODE} ${BOOTLABEL}
|
|
||||||
sh -e ${DOFS_SH} ${RD}/floppies/${FSIMAGE}.flp ${RD} ${MNT} \
|
|
||||||
${BOOTSIZE} ${RD}/image.${FSIMAGE} ${BOOTINODE} ${BOOTLABEL}
|
|
||||||
.endif
|
.endif
|
||||||
|
@rm -f ${IMAGEFILE}
|
||||||
|
@cp ${KERNFILE} ${MFSROOTFILE} ${IMAGEDIR}
|
||||||
|
sh -e ${DOFS_SH} ${IMAGEFILE} ${RD} ${MNT} ${FLPSIZE} ${IMAGEDIR} \
|
||||||
|
${BOOTINODE} ${FLPLABEL}
|
||||||
@echo "Created ${RD}/floppies/${FSIMAGE}.flp"
|
@echo "Created ${RD}/floppies/${FSIMAGE}.flp"
|
||||||
|
|
||||||
.include <bsd.obj.mk>
|
.include <bsd.obj.mk>
|
||||||
|
Loading…
Reference in New Issue
Block a user