From owner-svn-src-head@freebsd.org Tue Mar 28 21:35:20 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A8C9BD23943; Tue, 28 Mar 2017 21:35:20 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7310512D; Tue, 28 Mar 2017 21:35:20 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2SLZJg6099657; Tue, 28 Mar 2017 21:35:19 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2SLZJX1099653; Tue, 28 Mar 2017 21:35:19 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201703282135.v2SLZJX1099653@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Tue, 28 Mar 2017 21:35:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316109 - in head/sys/boot: efi/boot1 i386/boot2 i386/zfsboot sparc64/boot1 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Mar 2017 21:35:20 -0000 Author: ngie Date: Tue Mar 28 21:35:18 2017 New Revision: 316109 URL: https://svnweb.freebsd.org/changeset/base/316109 Log: Don't hardcode input files for stage 1/2 bootloaders; use .ALLSRC instead This is a better pattern to follow when creating the bootloaders and doing the relevant space checks to make sure that the sizes aren't exceeded (and thus, copy-pasting is a bit less error prone). MFC after: 3 days Sponsored by: Dell EMC Isilon Modified: head/sys/boot/efi/boot1/Makefile head/sys/boot/i386/boot2/Makefile head/sys/boot/i386/zfsboot/Makefile head/sys/boot/sparc64/boot1/Makefile Modified: head/sys/boot/efi/boot1/Makefile ============================================================================== --- head/sys/boot/efi/boot1/Makefile Tue Mar 28 21:16:11 2017 (r316108) +++ head/sys/boot/efi/boot1/Makefile Tue Mar 28 21:35:18 2017 (r316109) @@ -114,7 +114,7 @@ boot1.o: ${.CURDIR}/../../common/ufsread BOOT1_MAXSIZE?= 131072 boot1.efifat: boot1.efi - @set -- `ls -l boot1.efi`; \ + @set -- `ls -l ${.ALLSRC}`; \ x=$$(($$5-${BOOT1_MAXSIZE})); \ if [ $$x -ge 0 ]; then \ echo "boot1 $$x bytes too large; regenerate FAT templates?" >&2 ;\ @@ -124,7 +124,7 @@ boot1.efifat: boot1.efi uudecode ${.CURDIR}/fat-${MACHINE}.tmpl.bz2.uu mv fat-${MACHINE}.tmpl.bz2 ${.TARGET}.bz2 bzip2 -f -d ${.TARGET}.bz2 - ${DD} if=boot1.efi of=${.TARGET} seek=${BOOT1_OFFSET} conv=notrunc + ${DD} if=${.ALLSRC} of=${.TARGET} seek=${BOOT1_OFFSET} conv=notrunc CLEANFILES= boot1.efi boot1.efifat Modified: head/sys/boot/i386/boot2/Makefile ============================================================================== --- head/sys/boot/i386/boot2/Makefile Tue Mar 28 21:16:11 2017 (r316108) +++ head/sys/boot/i386/boot2/Makefile Tue Mar 28 21:35:18 2017 (r316109) @@ -67,9 +67,9 @@ CLEANFILES+= boot2 boot2.ld boot2.ldr bo boot2.h sio.o boot2: boot2.ld - @set -- `ls -l boot2.ld`; x=$$((7680-$$5)); \ + @set -- `ls -l ${.ALLSRC}`; x=$$((7680-$$5)); \ echo "$$x bytes available"; test $$x -ge 0 - ${DD} if=boot2.ld of=${.TARGET} obs=7680 conv=osync + ${DD} if=${.ALLSRC} of=${.TARGET} obs=7680 conv=osync boot2.ld: boot2.ldr boot2.bin ${BTXKERN} btxld -v -E ${ORG2} -f bin -b ${BTXKERN} -l boot2.ldr \ Modified: head/sys/boot/i386/zfsboot/Makefile ============================================================================== --- head/sys/boot/i386/zfsboot/Makefile Tue Mar 28 21:16:11 2017 (r316108) +++ head/sys/boot/i386/zfsboot/Makefile Tue Mar 28 21:35:18 2017 (r316109) @@ -68,9 +68,9 @@ CLEANFILES+= zfsboot2 zfsboot.ld zfsboot BOOT2SIZE= 131072 zfsboot2: zfsboot.ld - @set -- `ls -l zfsboot.ld`; x=$$((${BOOT2SIZE}-$$5)); \ + @set -- `ls -l ${.ALLSRC}`; x=$$((${BOOT2SIZE}-$$5)); \ echo "$$x bytes available"; test $$x -ge 0 - ${DD} if=zfsboot.ld of=${.TARGET} obs=${BOOT2SIZE} conv=osync + ${DD} if=${.ALLSRC} of=${.TARGET} obs=${BOOT2SIZE} conv=osync zfsboot.ld: zfsboot.ldr zfsboot.bin ${BTXKERN} btxld -v -E ${ORG2} -f bin -b ${BTXKERN} -l zfsboot.ldr \ Modified: head/sys/boot/sparc64/boot1/Makefile ============================================================================== --- head/sys/boot/sparc64/boot1/Makefile Tue Mar 28 21:16:11 2017 (r316108) +++ head/sys/boot/sparc64/boot1/Makefile Tue Mar 28 21:35:18 2017 (r316109) @@ -17,10 +17,10 @@ LDFLAGS=-Ttext ${BOOTBLOCKBASE} -Wl,-N # Construct boot1. sunlabel expects it to contain zeroed-out space for the # label, and to be of the correct size. ${FILES}: boot1.aout - @set -- `ls -l boot1.aout`; x=$$((7680-$$5)); \ + @set -- `ls -l ${.ALLSRC}`; x=$$((7680-$$5)); \ echo "$$x bytes available"; test $$x -ge 0 ${DD} if=/dev/zero of=${.TARGET} bs=512 count=16 - ${DD} if=boot1.aout of=${.TARGET} bs=512 oseek=1 conv=notrunc + ${DD} if=${.ALLSRC} of=${.TARGET} bs=512 oseek=1 conv=notrunc boot1.aout: boot1.elf elf2aout -o ${.TARGET} ${.ALLSRC}