Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/distrib/i386/floppies - Convert to using distrib/common/buil...
details: https://anonhg.NetBSD.org/src/rev/c3c46cccf107
branches: trunk
changeset: 525716:c3c46cccf107
user: lukem <lukem%NetBSD.org@localhost>
date: Tue Apr 16 05:23:33 2002 +0000
description:
- 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
diffstat:
distrib/i386/floppies/Makefile | 6 +-
distrib/i386/floppies/bootfloppy-big/Makefile | 15 +-
distrib/i386/floppies/bootfloppy-com/Makefile | 9 +
distrib/i386/floppies/bootfloppy-laptop/Makefile | 8 +
distrib/i386/floppies/bootfloppy-ps2/Makefile | 9 +-
distrib/i386/floppies/bootfloppy-small/Makefile | 10 +-
distrib/i386/floppies/bootfloppy-tiny/Makefile | 10 +-
distrib/i386/floppies/bootfloppy/Makefile | 8 +
distrib/i386/floppies/common/Makefile.bootfloppy | 147 ++++++++++------------
distrib/i386/floppies/common/Makefile.fdset | 102 ---------------
distrib/i386/floppies/fdset-com/Makefile | 8 -
distrib/i386/floppies/fdset-laptop/Makefile | 7 -
distrib/i386/floppies/fdset/Makefile | 7 -
distrib/i386/floppies/rescue-small/Makefile | 10 +-
distrib/i386/floppies/rescue-tiny/Makefile | 10 +-
15 files changed, 123 insertions(+), 243 deletions(-)
diffs (truncated from 471 to 300 lines):
diff -r 51fac08b1112 -r c3c46cccf107 distrib/i386/floppies/Makefile
--- a/distrib/i386/floppies/Makefile Tue Apr 16 04:50:14 2002 +0000
+++ b/distrib/i386/floppies/Makefile Tue Apr 16 05:23:33 2002 +0000
@@ -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 \
ramdisk-rescuesmall ramdisk-rescuetiny \
.WAIT \
kernel-ramdisk kernel-rescue \
.WAIT \
- fdset fdset-com fdset-laptop \
- bootfloppy-big bootfloppy-ps2 bootfloppy-small bootfloppy-tiny \
+ bootfloppy bootfloppy-big bootfloppy-com bootfloppy-laptop \
+ bootfloppy-ps2 bootfloppy-small bootfloppy-tiny \
rescue-small rescue-tiny
TARGETS+= release
diff -r 51fac08b1112 -r c3c46cccf107 distrib/i386/floppies/bootfloppy-big/Makefile
--- a/distrib/i386/floppies/bootfloppy-big/Makefile Tue Apr 16 04:50:14 2002 +0000
+++ b/distrib/i386/floppies/bootfloppy-big/Makefile Tue Apr 16 05:23:33 2002 +0000
@@ -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.
#
@@ -14,12 +14,11 @@
# This should place the image in i386-cd.img, which can hopefully
# be used to burn a CD.
-IMAGE= boot-big.fs
-KERNELDIR= kernel-ramdisk
-KERNEL= netbsd.INSTALL.gz
-DISKSIZE= 5760
-METAFILE!= printf "USTAR.volsize.%o" ${DISKSIZE}
-BLOCK8K= 359
-PAD= yes
+FLOPPYBASE= boot-big
+FLOPPYSIZE= 5760
+FLOPPYPAD= 1
+FLOPPYKERNDIR= kernel-ramdisk
+FLOPPYKERNEL= netbsd.INSTALL.gz
+FLOPPYMETA!= printf "USTAR.volsize.%o" ${FLOPPYSIZE}
.include "${.CURDIR}/../common/Makefile.bootfloppy"
diff -r 51fac08b1112 -r c3c46cccf107 distrib/i386/floppies/bootfloppy-com/Makefile
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/distrib/i386/floppies/bootfloppy-com/Makefile Tue Apr 16 05:23:33 2002 +0000
@@ -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"
diff -r 51fac08b1112 -r c3c46cccf107 distrib/i386/floppies/bootfloppy-laptop/Makefile
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/distrib/i386/floppies/bootfloppy-laptop/Makefile Tue Apr 16 05:23:33 2002 +0000
@@ -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"
diff -r 51fac08b1112 -r c3c46cccf107 distrib/i386/floppies/bootfloppy-ps2/Makefile
--- a/distrib/i386/floppies/bootfloppy-ps2/Makefile Tue Apr 16 04:50:14 2002 +0000
+++ b/distrib/i386/floppies/bootfloppy-ps2/Makefile Tue Apr 16 05:23:33 2002 +0000
@@ -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
-KERNELDIR= kernel-ramdisk
-KERNEL= netbsd.INSTALL_PS2.gz
-DISKSIZE= 2880
+FLOPPYBASE= boot-ps2
+FLOPPYKERNDIR= kernel-ramdisk
+FLOPPYKERNEL= netbsd.INSTALL_PS2.gz
.include "${.CURDIR}/../common/Makefile.bootfloppy"
diff -r 51fac08b1112 -r c3c46cccf107 distrib/i386/floppies/bootfloppy-small/Makefile
--- a/distrib/i386/floppies/bootfloppy-small/Makefile Tue Apr 16 04:50:14 2002 +0000
+++ b/distrib/i386/floppies/bootfloppy-small/Makefile Tue Apr 16 05:23:33 2002 +0000
@@ -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
-KERNELDIR= kernel-ramdisk
-KERNEL= netbsd.INSTALL_SMALL.gz
-DISKSIZE= 2400
+FLOPPYBASE= boot-small
+FLOPPYSIZE= 2400
+FLOPPYKERNDIR= kernel-ramdisk
+FLOPPYKERNEL= netbsd.INSTALL_SMALL.gz
.include "${.CURDIR}/../common/Makefile.bootfloppy"
diff -r 51fac08b1112 -r c3c46cccf107 distrib/i386/floppies/bootfloppy-tiny/Makefile
--- a/distrib/i386/floppies/bootfloppy-tiny/Makefile Tue Apr 16 04:50:14 2002 +0000
+++ b/distrib/i386/floppies/bootfloppy-tiny/Makefile Tue Apr 16 05:23:33 2002 +0000
@@ -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
-KERNELDIR= kernel-ramdisk
-KERNEL= netbsd.INSTALL_TINY.gz
-DISKSIZE= 2400
+FLOPPYBASE= boot-tiny
+FLOPPYSIZE= 2400
+FLOPPYKERNDIR= kernel-ramdisk
+FLOPPYKERNEL= netbsd.INSTALL_TINY.gz
.include "${.CURDIR}/../common/Makefile.bootfloppy"
diff -r 51fac08b1112 -r c3c46cccf107 distrib/i386/floppies/bootfloppy/Makefile
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/distrib/i386/floppies/bootfloppy/Makefile Tue Apr 16 05:23:33 2002 +0000
@@ -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"
diff -r 51fac08b1112 -r c3c46cccf107 distrib/i386/floppies/common/Makefile.bootfloppy
--- a/distrib/i386/floppies/common/Makefile.bootfloppy Tue Apr 16 04:50:14 2002 +0000
+++ b/distrib/i386/floppies/common/Makefile.bootfloppy Tue Apr 16 05:23:33 2002 +0000
@@ -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 "${_SRC_TOP_}/distrib/Makefile.inc"
-# needs the following set:
-# IMAGE image name
-# KERNELDIR where kernel is grabbed from
-# KERNEL kernel name
-# DISKSIZE size of image in 0.5K blocks
+#
+# Required variables:
+# _SRC_TOP_ Top level of src tree (set by <bsd.own.mk>)
+# FLOPPYBASE Basename of floppies. Floppy number ${n} will
+# be generated as ${FLOPPYBASE}${n}.fs
+# FLOPPYKERNEL Kernel to copy
+# FLOPPYKERNDIR ${FLOPPYKERNEL} is from ${.CURDIR}/../${FLOPPYKERNDIR}
+
+#
+# Optional variables:
+# FLOPPYSIZE Size of floppy in 512 byte blocks. [2880]
+# 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}
+#
+
+FLOPPYSIZE?= 2880
+FLOPPYMAX?= 1
+FLOPPYBOOTCODE?=${DESTDIR}/usr/mdec/biosboot.sym
+FLOPPYFILES= boot ${FLOPPYMETA} netbsd
+
+FLOPPYKERNOBJ!= cd ${.CURDIR}/../${FLOPPYKERNDIR} && ${PRINTOBJDIR}
+
+boot: ${FLOPPYBOOTCODE}
+ @echo "Copying ${FLOPPYBOOTCODE} to boot"
+ @rm -f boot
+ @cp ${FLOPPYBOOTCODE} boot
+ @${STRIP} boot
-FSTMP= ustar.tmp
-MDEC= ${DESTDIR}/usr/mdec
-BOOTCODE?= ${MDEC}/biosboot.sym
-#BOOTCODE= ${MDEC}/biosboot_com0.sym # Serial output
+netbsd: ${FLOPPYKERNOBJ}/${FLOPPYKERNEL}
+ @echo "Copying ${FLOPPYKERNOBJ}/${FLOPPYKERNEL} to netbsd"
+ @rm -f netbsd
+ @cp ${FLOPPYKERNOBJ}/${FLOPPYKERNEL} netbsd
+
+.if defined(FLOPPYMETA)
+${FLOPPYMETA}:
+ echo "Creating ${FLOPPYMETA}"
+ @rm -f ${FLOPPYMETA}
+ @touch ${FLOPPYMETA}
+.endif
-CLEANFILES+= netbsd boot ustar.tmp ${METAFILE} ${IMAGE} ${IMAGE}.tmp
+${FLOPPYBASE}1.fs: ${FLOPPYFILES}
+ @echo "Creating ${FLOPPYBASE}1.fs from ${FLOPPYFILES}
+# 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}
-realall: ${IMAGE}
+CLEANFILES+= ${FLOPPYFILES} ${FLOPPYBASE}?.fs
+
-${IMAGE}: netbsd boot
- if test "${METAFILE}" != ""; then \
- touch ${METAFILE}; \
+realall: ${FLOPPYBASE}1.fs
+
+release: check_RELEASEDIR .WAIT ${FLOPPYBASE}1.fs
+ -mkdir -p ${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
- ${PAX} -wvf ${FSTMP} boot ${METAFILE} netbsd
- @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
-# 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} ${IMAGE} ${RELEASEDIR}/installation/floppy
-
-clean cleandir distclean:
- rm -rf empty
.include <bsd.prog.mk>
diff -r 51fac08b1112 -r c3c46cccf107 distrib/i386/floppies/common/Makefile.fdset
--- a/distrib/i386/floppies/common/Makefile.fdset Tue Apr 16 04:50:14 2002 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
Home |
Main Index |
Thread Index |
Old Index