From c1a47858e9ff831c562c22733ba33a0ad0353c4f Mon Sep 17 00:00:00 2001 From: martin Date: Tue, 4 Oct 2005 16:11:15 +0000 Subject: [PATCH] Better size estimation (the previous code counted the compressed kernels, but we only need the constant size volume header) --- etc/etc.sgimips/Makefile.inc | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/etc/etc.sgimips/Makefile.inc b/etc/etc.sgimips/Makefile.inc index 706fe2dca7aa..5dcefc89ccbf 100644 --- a/etc/etc.sgimips/Makefile.inc +++ b/etc/etc.sgimips/Makefile.inc @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.inc,v 1.13 2005/05/10 21:58:03 martin Exp $ +# $NetBSD: Makefile.inc,v 1.14 2005/10/04 16:11:15 martin Exp $ # # etc.sgimips/Makefile.inc -- sgimips-specific etc Makefile targets # @@ -22,21 +22,19 @@ iso-image-md-pre: SGI.image= ${RELEASEDIR}/${MACHINE}/installation/cdrom/netbsd-sgimips.img iso-image-md-post: - EST=`ls -l ${CDROM.image} ${DESTDIR}/usr/mdec/aoutboot \ - ${DESTDIR}/usr/mdec/ip2xboot ${DESTDIR}/usr/mdec/ip3xboot \ - | awk '{ s += $$5} END { print int(s/1024/1024/32+1)*32 }'` ; \ - echo "Estimated image size: $${EST} MB"; \ - dd if=/dev/zero of=${SGI.image} bs=1024k count=$${EST} - ${TOOLDIR}/bin/nbsgivol -f -i ${SGI.image} - ${TOOLDIR}/bin/nbsgivol -f -w aoutboot ${DESTDIR}/usr/mdec/aoutboot \ - ${SGI.image} - ${TOOLDIR}/bin/nbsgivol -f -w ip2xboot ${DESTDIR}/usr/mdec/ip2xboot \ - ${SGI.image} - ${TOOLDIR}/bin/nbsgivol -f -w ip3xboot ${DESTDIR}/usr/mdec/ip3xboot \ - ${SGI.image} -# Don't hardcode this. Pick it up from bootblock.h - SEEK=`awk '/SGI_BOOT_BLOCK_SIZE_VOLHDR/{print $$3}' \ + @SEEK=`awk '/SGI_BOOT_BLOCK_SIZE_VOLHDR/{print $$3}' \ ${DESTDIR}/usr/include/sys/bootblock.h` ; \ - dd if=${CDROM.image} of=${SGI.image} bs=512 seek=$${SEEK} + EST=`ls -l ${CDROM.image} \ + | awk '{ s += $$5} END { print int(('$${SEEK}'*512+s)/1024/1024/32+1)*32 }'` ; \ + echo "Estimated image size: $${EST} MB"; \ + dd if=/dev/zero of=${SGI.image} bs=1024k count=$${EST}; \ + ${TOOLDIR}/bin/nbsgivol -f -i ${SGI.image}; \ + ${TOOLDIR}/bin/nbsgivol -f -w aoutboot ${DESTDIR}/usr/mdec/aoutboot \ + ${SGI.image}; \ + ${TOOLDIR}/bin/nbsgivol -f -w ip2xboot ${DESTDIR}/usr/mdec/ip2xboot \ + ${SGI.image}; \ + ${TOOLDIR}/bin/nbsgivol -f -w ip3xboot ${DESTDIR}/usr/mdec/ip3xboot \ + ${SGI.image}; \ + dd if=${CDROM.image} of=${SGI.image} bs=512 seek=$${SEEK} mv ${SGI.image} ${CDROM.image} rm -f ${RELEASEDIR}/ip2x ${RELEASEDIR}/ip3x