1 1.20 tsutsui # $NetBSD: Makefile,v 1.20 2002/04/14 03:16:13 tsutsui Exp $ 2 1.16 tsutsui 3 1.16 tsutsui .include <bsd.own.mk> 4 1.19 lukem .include "${_SRC_TOP_}/distrib/Makefile.inc" 5 1.19 lukem 6 1.16 tsutsui .include <bsd.kernobj.mk> 7 1.1 tsubai 8 1.18 tsutsui BASENAME= boot 9 1.18 tsutsui IMAGE1= ${BASENAME}1.fs 10 1.16 tsutsui DISKSIZE= 2880 11 1.16 tsutsui FSTMP= ustar.tmp 12 1.1 tsubai MDEC= ${DESTDIR}/usr/mdec 13 1.16 tsutsui BOOT= ofwboot 14 1.1 tsubai 15 1.14 tv KERNDIR!= cd ${.CURDIR}/../md-kernel && ${PRINTOBJDIR} 16 1.16 tsutsui KERN= ${KERNDIR}/netbsd.INSTALL.gz 17 1.16 tsutsui 18 1.16 tsutsui CLEANFILES+= netbsd ${BOOT} ${FSTMP} 19 1.16 tsutsui 20 1.1 tsubai 21 1.16 tsutsui realall: netbsd ${BOOT} 22 1.16 tsutsui ${PAX} -wvf ${FSTMP} ${BOOT} netbsd 23 1.16 tsutsui @echo 24 1.16 tsutsui @echo Making disk number one 25 1.16 tsutsui dd bs=8k seek=1 count=$$((${DISKSIZE} / 16 - 1)) \ 26 1.18 tsutsui if=${FSTMP} of=${IMAGE1}.tmp 27 1.1 tsubai @echo "installing new bootblocks" 28 1.18 tsutsui ${MDEC}/installboot -v -b 17 ${BOOT} ${MDEC}/bootxx ${IMAGE1}.tmp 29 1.19 lukem # XXXDISTRIB 30 1.16 tsutsui @ls -l ${FSTMP} | (read mode links uid gid size junk; \ 31 1.16 tsutsui dksize=$$((${DISKSIZE} * 512 - 8 * 1024)); \ 32 1.16 tsutsui disks=$$(($$size / $$dksize + 1)); \ 33 1.16 tsutsui if test $$size -gt $$dksize; then \ 34 1.18 tsutsui d=2; \ 35 1.18 tsutsui while test $$d -le $$disks; do \ 36 1.18 tsutsui echo; \ 37 1.18 tsutsui echo Making disk number $$d.; \ 38 1.18 tsutsui IMAGE=${BASENAME}$${d}.fs; \ 39 1.18 tsutsui echo USTARFS $$d > $${IMAGE}; \ 40 1.18 tsutsui skip=$$((($$d - 1) * (${DISKSIZE} / 16 - 1))); \ 41 1.18 tsutsui if test $$d -eq $$disks; then \ 42 1.18 tsutsui dd bs=8k seek=1 skip=$${skip} \ 43 1.18 tsutsui conv=sync \ 44 1.18 tsutsui if=${FSTMP} of=$${IMAGE}; \ 45 1.18 tsutsui else \ 46 1.18 tsutsui dd bs=8k seek=1 skip=$${skip} \ 47 1.18 tsutsui conv=sync \ 48 1.18 tsutsui count=$$((${DISKSIZE} / 16 - 1)) \ 49 1.18 tsutsui if=${FSTMP} of=$${IMAGE}; \ 50 1.18 tsutsui fi; \ 51 1.18 tsutsui d=$$(($$d + 1)); \ 52 1.18 tsutsui done; \ 53 1.16 tsutsui else \ 54 1.16 tsutsui dd seek=$$(($${size} / 512 + 15)) count=1 \ 55 1.18 tsutsui if=/dev/zero of=${IMAGE1}.tmp; \ 56 1.16 tsutsui fi; \ 57 1.16 tsutsui echo; \ 58 1.16 tsutsui bytes=$$(($$dksize * $$disks - $$size)); \ 59 1.18 tsutsui echo "There are $$bytes ($$(($$bytes / 1024))K) bytes free\ 60 1.18 tsutsui on disk $$disks."; \ 61 1.16 tsutsui ) 62 1.18 tsutsui mv -f ${IMAGE1}.tmp ${IMAGE1} 63 1.16 tsutsui 64 1.16 tsutsui # Let the kernel on the diskette be called "netbsd" although 65 1.16 tsutsui # it is compressed. This is because the boot code will search 66 1.16 tsutsui # for "netbsd" first, and calling it "netbsd" instead of "netbsd.gz" 67 1.16 tsutsui # we avoid scanning all the diskettes before reading the file. 68 1.16 tsutsui 69 1.16 tsutsui netbsd: ${KERN} 70 1.16 tsutsui rm -f netbsd 71 1.16 tsutsui cp ${KERN} netbsd 72 1.16 tsutsui 73 1.16 tsutsui # This is "cheating", just so that we have the available 74 1.16 tsutsui # space at the start of the tar file. Installboot will overwrite 75 1.16 tsutsui # the start of the bootcode with the tail end of the "real", aligned 76 1.16 tsutsui # second-stage boot loader when it is run (which is quite a bit shorter 77 1.16 tsutsui # than the entire ${BOOTCODE} file, even when symbols are removed. 78 1.16 tsutsui # (the first 15*512 bytes are put into the first 8K filesystem block, 79 1.16 tsutsui # around the disklabel) 80 1.16 tsutsui 81 1.16 tsutsui ${BOOT}: ${MDEC}/${BOOT} 82 1.16 tsutsui rm -f ${BOOT} 83 1.16 tsutsui cp ${MDEC}/${BOOT} ${BOOT} 84 1.16 tsutsui 85 1.16 tsutsui release: check_RELEASEDIR 86 1.16 tsutsui -mkdir -p ${RELEASEDIR}/installation/floppy 87 1.19 lukem ${RELINSTALL} ${BASENAME}?.fs ${RELEASEDIR}/installation/floppy 88 1.1 tsubai 89 1.2 lukem clean cleandir distclean: 90 1.18 tsutsui rm -f *.core ${CLEANFILES} ${BASENAME}?.fs ${IMAGE1}.tmp 91 1.1 tsubai 92 1.1 tsubai .include <bsd.obj.mk> 93 1.16 tsutsui .include <bsd.subdir.mk> 94