- Convert to using distrib/common/buildfloppies.sh, which can build both

single and multi-volume floppies in better fashion that the crufty
  shell commands in the various Makefiles.
- Move fdset* -> bootfloppy*, as that's more consistent
This commit is contained in:
lukem 2002-04-16 05:23:33 +00:00
parent bbdbd9ab37
commit 33e7bb62d6
15 changed files with 117 additions and 237 deletions

View File

@ -1,12 +1,12 @@
# $NetBSD: Makefile,v 1.28 2002/04/11 12:17:14 lukem Exp $ # $NetBSD: Makefile,v 1.29 2002/04/16 05:23:33 lukem Exp $
SUBDIR= ramdisk-big ramdisk-small ramdisk-tiny \ SUBDIR= ramdisk-big ramdisk-small ramdisk-tiny \
ramdisk-rescuesmall ramdisk-rescuetiny \ ramdisk-rescuesmall ramdisk-rescuetiny \
.WAIT \ .WAIT \
kernel-ramdisk kernel-rescue \ kernel-ramdisk kernel-rescue \
.WAIT \ .WAIT \
fdset fdset-com fdset-laptop \ bootfloppy bootfloppy-big bootfloppy-com bootfloppy-laptop \
bootfloppy-big bootfloppy-ps2 bootfloppy-small bootfloppy-tiny \ bootfloppy-ps2 bootfloppy-small bootfloppy-tiny \
rescue-small rescue-tiny rescue-small rescue-tiny
TARGETS+= release TARGETS+= release

View File

@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.16 2002/04/11 12:17:14 lukem Exp $ # $NetBSD: Makefile,v 1.17 2002/04/16 05:23:37 lukem Exp $
# This Makefile builds a boot image on a 2.88M-sized image. # This Makefile builds a boot image on a 2.88M-sized image.
# #
@ -14,12 +14,11 @@
# This should place the image in i386-cd.img, which can hopefully # This should place the image in i386-cd.img, which can hopefully
# be used to burn a CD. # be used to burn a CD.
IMAGE= boot-big.fs FLOPPYBASE= boot-big
KERNELDIR= kernel-ramdisk FLOPPYSIZE= 5760
KERNEL= netbsd.INSTALL.gz FLOPPYPAD= 1
DISKSIZE= 5760 FLOPPYKERNDIR= kernel-ramdisk
METAFILE!= printf "USTAR.volsize.%o" ${DISKSIZE} FLOPPYKERNEL= netbsd.INSTALL.gz
BLOCK8K= 359 FLOPPYMETA!= printf "USTAR.volsize.%o" ${FLOPPYSIZE}
PAD= yes
.include "${.CURDIR}/../common/Makefile.bootfloppy" .include "${.CURDIR}/../common/Makefile.bootfloppy"

View File

@ -0,0 +1,9 @@
# $NetBSD: Makefile,v 1.1 2002/04/16 05:23:38 lukem Exp $
FLOPPYBASE= boot-com
FLOPPYMAX= 2
FLOPPYKERNDIR= kernel-ramdisk
FLOPPYKERNEL= netbsd.INSTALL.gz
FLOPPYBOOTCODE= ${DESTDIR}/usr/mdec/biosboot_com0.sym # Serial output
.include "${.CURDIR}/../common/Makefile.bootfloppy"

View File

@ -0,0 +1,8 @@
# $NetBSD: Makefile,v 1.1 2002/04/16 05:23:38 lukem Exp $
FLOPPYBASE= bootlap
FLOPPYMAX= 2
FLOPPYKERNDIR= kernel-ramdisk
FLOPPYKERNEL= netbsd.INSTALL_LAPTOP.gz
.include "${.CURDIR}/../common/Makefile.bootfloppy"

View File

@ -1,8 +1,7 @@
# $NetBSD: Makefile,v 1.6 2002/04/11 12:17:14 lukem Exp $ # $NetBSD: Makefile,v 1.7 2002/04/16 05:23:39 lukem Exp $
IMAGE= boot-ps2.fs FLOPPYBASE= boot-ps2
KERNELDIR= kernel-ramdisk FLOPPYKERNDIR= kernel-ramdisk
KERNEL= netbsd.INSTALL_PS2.gz FLOPPYKERNEL= netbsd.INSTALL_PS2.gz
DISKSIZE= 2880
.include "${.CURDIR}/../common/Makefile.bootfloppy" .include "${.CURDIR}/../common/Makefile.bootfloppy"

View File

@ -1,8 +1,8 @@
# $NetBSD: Makefile,v 1.13 2002/04/11 12:17:15 lukem Exp $ # $NetBSD: Makefile,v 1.14 2002/04/16 05:23:39 lukem Exp $
IMAGE= boot-small.fs FLOPPYBASE= boot-small
KERNELDIR= kernel-ramdisk FLOPPYSIZE= 2400
KERNEL= netbsd.INSTALL_SMALL.gz FLOPPYKERNDIR= kernel-ramdisk
DISKSIZE= 2400 FLOPPYKERNEL= netbsd.INSTALL_SMALL.gz
.include "${.CURDIR}/../common/Makefile.bootfloppy" .include "${.CURDIR}/../common/Makefile.bootfloppy"

View File

@ -1,8 +1,8 @@
# $NetBSD: Makefile,v 1.10 2002/04/11 12:17:15 lukem Exp $ # $NetBSD: Makefile,v 1.11 2002/04/16 05:23:40 lukem Exp $
IMAGE= boot-tiny.fs FLOPPYBASE= boot-tiny
KERNELDIR= kernel-ramdisk FLOPPYSIZE= 2400
KERNEL= netbsd.INSTALL_TINY.gz FLOPPYKERNDIR= kernel-ramdisk
DISKSIZE= 2400 FLOPPYKERNEL= netbsd.INSTALL_TINY.gz
.include "${.CURDIR}/../common/Makefile.bootfloppy" .include "${.CURDIR}/../common/Makefile.bootfloppy"

View File

@ -0,0 +1,8 @@
# $NetBSD: Makefile,v 1.8 2002/04/16 05:23:36 lukem Exp $
FLOPPYBASE= boot
FLOPPYMAX= 2
FLOPPYKERNDIR= kernel-ramdisk
FLOPPYKERNEL= netbsd.INSTALL.gz
.include "${.CURDIR}/../common/Makefile.bootfloppy"

View File

@ -1,95 +1,76 @@
# $NetBSD: Makefile.bootfloppy,v 1.6 2002/04/11 12:22:58 lukem Exp $ # $NetBSD: Makefile.bootfloppy,v 1.7 2002/04/16 05:23:40 lukem Exp $
#
# Makefile snippet to create a set of USTAR floppies
#
.include <bsd.own.mk> .include <bsd.own.mk>
.include "${_SRC_TOP_}/distrib/Makefile.inc" .include "${_SRC_TOP_}/distrib/Makefile.inc"
# needs the following set: #
# IMAGE image name # Required variables:
# KERNELDIR where kernel is grabbed from # _SRC_TOP_ Top level of src tree (set by <bsd.own.mk>)
# KERNEL kernel name # FLOPPYBASE Basename of floppies. Floppy number ${n} will
# DISKSIZE size of image in 0.5K blocks # be generated as ${FLOPPYBASE}${n}.fs
# FLOPPYKERNEL Kernel to copy
# FLOPPYKERNDIR ${FLOPPYKERNEL} is from ${.CURDIR}/../${FLOPPYKERNDIR}
FSTMP= ustar.tmp #
MDEC= ${DESTDIR}/usr/mdec # Optional variables:
BOOTCODE?= ${MDEC}/biosboot.sym # FLOPPYSIZE Size of floppy in 512 byte blocks. [2880]
#BOOTCODE= ${MDEC}/biosboot_com0.sym # Serial output # FLOPPYMAX Maximum number of floppies to build. [1]
# If 1, final image is installed as ${FLOPPYBASE}.fs
# FLOPPYBOOTCODE Boot blocks to use. [${DESTDIR}/usr/mdec/biosboot.sym]
# FLOPPYMETA ustar metafile (written between "boot" & "netbsd")
# FLOPPYPAD If defined, pad the last floppy to ${FLOPPYSIZE}
#
CLEANFILES+= netbsd boot ustar.tmp ${METAFILE} ${IMAGE} ${IMAGE}.tmp FLOPPYSIZE?= 2880
FLOPPYMAX?= 1
FLOPPYBOOTCODE?=${DESTDIR}/usr/mdec/biosboot.sym
FLOPPYFILES= boot ${FLOPPYMETA} netbsd
realall: ${IMAGE} FLOPPYKERNOBJ!= cd ${.CURDIR}/../${FLOPPYKERNDIR} && ${PRINTOBJDIR}
${IMAGE}: netbsd boot boot: ${FLOPPYBOOTCODE}
if test "${METAFILE}" != ""; then \ @echo "Copying ${FLOPPYBOOTCODE} to boot"
touch ${METAFILE}; \ @rm -f boot
fi @cp ${FLOPPYBOOTCODE} boot
${PAX} -wvf ${FSTMP} boot ${METAFILE} netbsd @${STRIP} boot
@echo
@echo Making disk number one
rm -rf empty
mkdir -m 755 empty
${MAKEFS} -s ${DISKSIZE}b ${IMAGE}.tmp empty
dd bs=8k seek=1 count=$$((${DISKSIZE} / 16 - 1)) \
if=${FSTMP} of=${IMAGE}.tmp
@echo "installing new bootblocks"
${MDEC}/installboot -b 17 -v -f ${BOOTCODE} ${IMAGE}.tmp
# XXXDISTRIB
@ls -l ${FSTMP} | (read mode links uid gid size junk; \
dksize=$$((${DISKSIZE} * 512 - 8 * 1024)); \
disks=$$(($$size / $$dksize + 1)); \
if test $$size -gt $$dksize; then \
bytes=$$(($$size - $$dksize)); \
echo "Image is $$bytes ($$(($$bytes / 1024))K) too big\
to fit on one disk."; \
exit 1; \
else \
dd seek=$$(($${size} / 512 + 15)) count=1 \
if=/dev/zero of=${IMAGE}.tmp; \
fi; \
echo; \
bytes=$$(($$dksize * $$disks - $$size)); \
if test "${PAD}" = "yes"; then \
size=$$(($$size + 8 * 1024)); \
echo "Padding image with $$bytes bytes from $$size"; \
sectors=$$(($$bytes / 512)); \
ssize=$$(($$size / 512)); \
dd if=/dev/zero bs=512 seek=$${ssize} of=${IMAGE}.tmp \
count=$${sectors}; \
else \
echo "There are $$bytes ($$(($$bytes / 1024))K) bytes\
free on disk $$disks."; \
fi; \
)
mv -f ${IMAGE}.tmp ${IMAGE}
# Let the kernel on the diskette be called "netbsd" although netbsd: ${FLOPPYKERNOBJ}/${FLOPPYKERNEL}
# it is compressed. This is because the boot code will search @echo "Copying ${FLOPPYKERNOBJ}/${FLOPPYKERNEL} to netbsd"
# for "netbsd" first, and calling it "netbsd" instead of "netbsd.gz" @rm -f netbsd
# we avoid scanning all the diskettes before reading the file. @cp ${FLOPPYKERNOBJ}/${FLOPPYKERNEL} netbsd
KERNELOBJDIR!= cd ${.CURDIR}/../${KERNELDIR} && ${PRINTOBJDIR} .if defined(FLOPPYMETA)
${FLOPPYMETA}:
echo "Creating ${FLOPPYMETA}"
@rm -f ${FLOPPYMETA}
@touch ${FLOPPYMETA}
.endif
netbsd: ${KERNELOBJDIR}/${KERNEL} ${FLOPPYBASE}1.fs: ${FLOPPYFILES}
rm -f netbsd @echo "Creating ${FLOPPYBASE}1.fs from ${FLOPPYFILES}
cp ${KERNELOBJDIR}/${KERNEL} netbsd # XXXDISTRIB; need MI installboot for i386
sh ${DISTRIBDIR}/common/buildfloppies.sh \
-i "${DESTDIR}/usr/mdec/installboot -b 17 -f ${FLOPPYBOOTCODE} @IMAGE@" \
${FLOPPYMAX:D-m "${FLOPPYMAX}"} ${FLOPPYPAD:D-p} \
${FLOPPYBASE} ${FLOPPYSIZE} ${FLOPPYFILES}
# This is "cheating", just so that we have the available CLEANFILES+= ${FLOPPYFILES} ${FLOPPYBASE}?.fs
# space at the start of the tar file. Installboot will overwrite
# the start of the bootcode with the tail end of the "real", aligned
# second-stage boot loader when it is run (which is quite a bit shorter
# than the entire ${BOOTCODE} file, even when symbols are removed.
# (the first 15*512 bytes are put into the first 8K filesystem block,
# around the disklabel)
boot: ${BOOTCODE}
rm -f boot
cp ${BOOTCODE} boot
${STRIP} boot
release: check_RELEASEDIR realall: ${FLOPPYBASE}1.fs
release: check_RELEASEDIR .WAIT ${FLOPPYBASE}1.fs
-mkdir -p ${RELEASEDIR}/installation/floppy -mkdir -p ${RELEASEDIR}/installation/floppy
${RELINSTALL} ${IMAGE} ${RELEASEDIR}/installation/floppy if [ -e ${FLOPPYBASE}2.fs ]; then \
${RELINSTALL} ${FLOPPYBASE}?.fs \
${RELEASEDIR}/installation/floppy; \
else \
${RELINSTALL} ${FLOPPYBASE}1.fs \
${RELEASEDIR}/installation/floppy/${FLOPPYBASE}.fs; \
fi
clean cleandir distclean:
rm -rf empty
.include <bsd.prog.mk> .include <bsd.prog.mk>

View File

@ -1,102 +0,0 @@
# $NetBSD: Makefile.fdset,v 1.6 2002/04/11 12:22:58 lukem Exp $
.include <bsd.own.mk>
.include "${_SRC_TOP_}/distrib/Makefile.inc"
# needs the following set:
# BASENAME basename of floppy
# KERNELDIR where kernel is grabbed from
# KERNEL kernel name
IMAGE1?= ${BASENAME}1.fs
FSTMP= ustar.tmp
MDEC= ${DESTDIR}/usr/mdec
BOOTCODE?= ${MDEC}/biosboot.sym
#BOOTCODE= ${MDEC}/biosboot_com0.sym # Serial output
DISKSIZE?= 2880
CLEANFILES+= netbsd boot ustar.tmp ${IMAGE1} ${IMAGE1}.tmp
realall: ${IMAGE1}
${IMAGE1}: netbsd boot
${PAX} -wvf ${FSTMP} boot netbsd
@echo
@echo Making disk number one
rm -rf empty
mkdir -m 755 empty
${MAKEFS} -s ${DISKSIZE}b ${IMAGE1}.tmp empty
dd bs=8k seek=1 count=$$((${DISKSIZE} / 16 - 1)) \
if=${FSTMP} of=${IMAGE1}.tmp
@echo "installing new bootblocks"
${MDEC}/installboot -b 17 -v -f ${BOOTCODE} ${IMAGE1}.tmp
# XXXDISTRIB
@ls -l ${FSTMP} | (read mode links uid gid size junk; \
dksize=$$((${DISKSIZE} * 512 - 8 * 1024)); \
disks=$$(($$size / $$dksize + 1)); \
if test $$size -gt $$dksize; then \
d=2; \
while test $$d -le $$disks; do \
echo; \
echo Making disk number $$d.; \
IMAGE=${BASENAME}$${d}.fs; \
echo USTARFS $$d > $${IMAGE}; \
skip=$$((($$d - 1) * (${DISKSIZE} / 16 - 1))); \
if test $$d -eq $$disks; then \
dd bs=8k seek=1 skip=$${skip} \
conv=sync \
if=${FSTMP} of=$${IMAGE}; \
else \
dd bs=8k seek=1 skip=$${skip} \
conv=sync \
count=$$((${DISKSIZE} / 16 - 1)) \
if=${FSTMP} of=$${IMAGE}; \
fi; \
d=$$(($$d + 1)); \
done; \
else \
dd seek=$$(($${size} / 512 + 15)) count=1 \
if=/dev/zero of=${IMAGE1}; \
fi; \
echo; \
bytes=$$(($$dksize * $$disks - $$size)); \
echo "There are $$bytes ($$(($$bytes / 1024))K) bytes free\
on disk $$disks."; \
)
mv -f ${IMAGE1}.tmp ${IMAGE1}
# Let the kernel on the diskette be called "netbsd" although
# it is compressed. This is because the boot code will search
# for "netbsd" first, and calling it "netbsd" instead of "netbsd.gz"
# we avoid scanning all the diskettes before reading the file.
KERNELOBJDIR!= cd ${.CURDIR}/../${KERNELDIR} && ${PRINTOBJDIR}
netbsd: ${KERNELOBJDIR}/${KERNEL}
rm -f netbsd
cp ${KERNELOBJDIR}/${KERNEL} netbsd
# This is "cheating", just so that we have the available
# space at the start of the tar file. Installboot will overwrite
# the start of the bootcode with the tail end of the "real", aligned
# second-stage boot loader when it is run (which is quite a bit shorter
# than the entire ${BOOTCODE} file, even when symbols are removed.
# (the first 15*512 bytes are put into the first 8K filesystem block,
# around the disklabel)
boot: ${BOOTCODE}
rm -f boot
cp ${BOOTCODE} boot
${STRIP} boot
release: check_RELEASEDIR
-mkdir -p ${RELEASEDIR}/installation/floppy
${RELINSTALL} ${BASENAME}?.fs ${RELEASEDIR}/installation/floppy
clean cleandir distclean:
rm -f ${BASENAME}?.fs
rm -rf empty
.include <bsd.prog.mk>

View File

@ -1,8 +0,0 @@
# $NetBSD: Makefile,v 1.6 2002/04/11 12:17:16 lukem Exp $
BASENAME= boot-com
BOOTCODE= ${MDEC}/biosboot_com0.sym # Serial output
KERNELDIR= kernel-ramdisk
KERNEL= netbsd.INSTALL.gz
.include "${.CURDIR}/../common/Makefile.fdset"

View File

@ -1,7 +0,0 @@
# $NetBSD: Makefile,v 1.7 2002/04/11 12:17:16 lukem Exp $
BASENAME= bootlap
KERNELDIR= kernel-ramdisk
KERNEL= netbsd.INSTALL_LAPTOP.gz
.include "${.CURDIR}/../common/Makefile.fdset"

View File

@ -1,7 +0,0 @@
# $NetBSD: Makefile,v 1.9 2002/04/11 12:17:15 lukem Exp $
BASENAME= boot
KERNELDIR= kernel-ramdisk
KERNEL= netbsd.INSTALL.gz
.include "${.CURDIR}/../common/Makefile.fdset"

View File

@ -1,8 +1,8 @@
# $NetBSD: Makefile,v 1.8 2002/04/13 00:07:46 lukem Exp $ # $NetBSD: Makefile,v 1.9 2002/04/16 05:23:44 lukem Exp $
IMAGE= rescue-small.fs FLOPPYBASE= rescue-small
KERNELDIR= kernel-rescue FLOPPYKERNDIR= kernel-rescue
KERNEL= netbsd.RESCUE_SMALL.gz FLOPPYKERNEL= netbsd.RESCUE_SMALL.gz
DISKSIZE= 2400 FLOPPYSIZE= 2400
.include "${.CURDIR}/../common/Makefile.bootfloppy" .include "${.CURDIR}/../common/Makefile.bootfloppy"

View File

@ -1,8 +1,8 @@
# $NetBSD: Makefile,v 1.8 2002/04/13 00:07:46 lukem Exp $ # $NetBSD: Makefile,v 1.9 2002/04/16 05:23:44 lukem Exp $
IMAGE= rescue-tiny.fs FLOPPYBASE= rescue-tiny.fs
KERNELDIR= kernel-rescue FLOPPYKERNDIR= kernel-rescue
KERNEL= netbsd.RESCUE_TINY.gz FLOPPYKERNEL= netbsd.RESCUE_TINY.gz
DISKSIZE= 2400 FLOPPYSIZE= 2400
.include "${.CURDIR}/../common/Makefile.bootfloppy" .include "${.CURDIR}/../common/Makefile.bootfloppy"