From owner-svn-src-stable-10@freebsd.org Sun May 28 01:15:01 2017 Return-Path: Delivered-To: svn-src-stable-10@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 E12B4D858AE; Sun, 28 May 2017 01:15:01 +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 BD10F1135; Sun, 28 May 2017 01:15:01 +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 v4S1F0C4011571; Sun, 28 May 2017 01:15:00 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4S1ExA0011550; Sun, 28 May 2017 01:14:59 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201705280114.v4S1ExA0011550@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sun, 28 May 2017 01:14:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r319025 - in stable/10/sys/boot: . efi/boot1 i386/boot2 i386/pxeldr i386/zfsboot pc98/boot0.5 pc98/boot2 pc98/pc98boot powerpc/boot1.chrp sparc64/boot1 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 May 2017 01:15:02 -0000 Author: ngie Date: Sun May 28 01:14:59 2017 New Revision: 319025 URL: https://svnweb.freebsd.org/changeset/base/319025 Log: MFC r309412,r316109,r316132: r309412 (by imp): dd is currently a bootstrap tool. It really doesn't have any business being a bootstrap tool. However, for reproducible build output, FreeBSD added dd status=none because it was otherwise difficult to suppress the status information, but retain any errors that might happen. There's no real reason that dd has to be a build tool, other than we use status=none unconditional. Remove dd from a bootstrap tool entirely by only using status=none when available. This may also help efforts to build the system on non-FreeBSD hosts as well. r316109: 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). r316132: Parameterize out 7680 (15 * 512) as BOOT2SIZE, similar to sys/boot/i386/zfsboot/... This is being done to make it easier to change in the future--this action might be needed sooner rather than later because of gcc 6.3.0 bailing, stating that there is negative free space left (deficit) in the boot2 bootloader. Modified: stable/10/sys/boot/Makefile.inc stable/10/sys/boot/efi/boot1/Makefile stable/10/sys/boot/i386/boot2/Makefile stable/10/sys/boot/i386/pxeldr/Makefile stable/10/sys/boot/i386/zfsboot/Makefile stable/10/sys/boot/pc98/boot0.5/Makefile stable/10/sys/boot/pc98/boot2/Makefile stable/10/sys/boot/pc98/pc98boot/Makefile stable/10/sys/boot/powerpc/boot1.chrp/Makefile stable/10/sys/boot/sparc64/boot1/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/boot/Makefile.inc ============================================================================== --- stable/10/sys/boot/Makefile.inc Sun May 28 01:08:46 2017 (r319024) +++ stable/10/sys/boot/Makefile.inc Sun May 28 01:14:59 2017 (r319025) @@ -1,3 +1,10 @@ # $FreeBSD$ SSP_CFLAGS= + +# The boot loader build uses dd status=none, where possible, for reproducible +# build output (since performance varies from run to run). Trouble is that +# option was recently (10.3) added to FreeBSD and is non-standard. Only use it +# when this test succeeds rather than require dd to be a bootstrap tool. +DD_NOSTATUS!=(dd status=none count=0 2> /dev/null && echo status=none) || true +DD=dd ${DD_NOSTATUS} Modified: stable/10/sys/boot/efi/boot1/Makefile ============================================================================== --- stable/10/sys/boot/efi/boot1/Makefile Sun May 28 01:08:46 2017 (r319024) +++ stable/10/sys/boot/efi/boot1/Makefile Sun May 28 01:14:59 2017 (r319025) @@ -99,7 +99,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: stable/10/sys/boot/i386/boot2/Makefile ============================================================================== --- stable/10/sys/boot/i386/boot2/Makefile Sun May 28 01:08:46 2017 (r319024) +++ stable/10/sys/boot/i386/boot2/Makefile Sun May 28 01:14:59 2017 (r319025) @@ -68,17 +68,19 @@ boot1.out: boot1.o CLEANFILES+= boot2 boot2.ld boot2.ldr boot2.bin boot2.out boot2.o \ boot2.s boot2.s.tmp boot2.h sio.o +BOOT2SIZE= 7680 + boot2: boot2.ld - @set -- `ls -l boot2.ld`; x=$$((7680-$$5)); \ + @set -- `ls -l ${.ALLSRC}`; x=$$((${BOOT2SIZE}-$$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=${BOOT2SIZE} conv=osync boot2.ld: boot2.ldr boot2.bin ${BTXKERN} btxld -v -E ${ORG2} -f bin -b ${BTXKERN} -l boot2.ldr \ -o ${.TARGET} -P 1 boot2.bin boot2.ldr: - dd if=/dev/zero of=${.TARGET} bs=512 count=1 + ${DD} if=/dev/zero of=${.TARGET} bs=512 count=1 boot2.bin: boot2.out ${OBJCOPY} -S -O binary boot2.out ${.TARGET} Modified: stable/10/sys/boot/i386/pxeldr/Makefile ============================================================================== --- stable/10/sys/boot/i386/pxeldr/Makefile Sun May 28 01:08:46 2017 (r319024) +++ stable/10/sys/boot/i386/pxeldr/Makefile Sun May 28 01:14:59 2017 (r319025) @@ -31,7 +31,7 @@ CLEANFILES+= ${BOOT}.tmp ${BOOT}: ${LDR} ${LOADER} cat ${LDR} ${LOADER} > ${.TARGET}.tmp - dd if=${.TARGET}.tmp of=${.TARGET} obs=2k conv=osync + ${DD} if=${.TARGET}.tmp of=${.TARGET} obs=2k conv=osync rm ${.TARGET}.tmp LDFLAGS+=-e start -Ttext ${ORG} -Wl,-N,-S,--oformat,binary Modified: stable/10/sys/boot/i386/zfsboot/Makefile ============================================================================== --- stable/10/sys/boot/i386/zfsboot/Makefile Sun May 28 01:08:46 2017 (r319024) +++ stable/10/sys/boot/i386/zfsboot/Makefile Sun May 28 01:14:59 2017 (r319025) @@ -63,9 +63,9 @@ CLEANFILES+= zfsboot2 zfsboot.ld zfsboot BOOT2SIZE= 65536 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: stable/10/sys/boot/pc98/boot0.5/Makefile ============================================================================== --- stable/10/sys/boot/pc98/boot0.5/Makefile Sun May 28 01:08:46 2017 (r319024) +++ stable/10/sys/boot/pc98/boot0.5/Makefile Sun May 28 01:14:59 2017 (r319025) @@ -18,7 +18,7 @@ LDFLAGS=-e start -Ttext ${BOOT_BOOT0_ORG # The size of boot0.5 must be 7168 bytes ${BOOT}: ${BOOT}.bin - cat ${BOOT}.bin /dev/zero | dd of=${BOOT} bs=1 count=7168 + cat ${BOOT}.bin /dev/zero | ${DD} of=${BOOT} bs=1 count=7168 ${BOOT}.bin: ${BOOT}.out ${OBJCOPY} -S -O binary ${BOOT}.out ${.TARGET} Modified: stable/10/sys/boot/pc98/boot2/Makefile ============================================================================== --- stable/10/sys/boot/pc98/boot2/Makefile Sun May 28 01:08:46 2017 (r319024) +++ stable/10/sys/boot/pc98/boot2/Makefile Sun May 28 01:14:59 2017 (r319025) @@ -77,14 +77,14 @@ CLEANFILES+= boot2 boot2.ld boot2.ldr bo boot2: boot2.ld @set -- `ls -l boot2.ld`; x=$$((7680-$$5)); \ echo "$$x bytes available"; test $$x -ge 0 - dd if=boot2.ld of=${.TARGET} obs=7680 conv=osync + ${DD} if=boot2.ld of=${.TARGET} obs=7680 conv=osync boot2.ld: boot2.ldr boot2.bin ${BTXKERN} btxld -v -E ${ORG2} -f bin -b ${BTXKERN} -l boot2.ldr \ -o ${.TARGET} -P 1 boot2.bin boot2.ldr: - dd if=/dev/zero of=${.TARGET} bs=276 count=1 + ${DD} if=/dev/zero of=${.TARGET} bs=276 count=1 boot2.bin: boot2.out ${OBJCOPY} -S -O binary boot2.out ${.TARGET} Modified: stable/10/sys/boot/pc98/pc98boot/Makefile ============================================================================== --- stable/10/sys/boot/pc98/pc98boot/Makefile Sun May 28 01:08:46 2017 (r319024) +++ stable/10/sys/boot/pc98/pc98boot/Makefile Sun May 28 01:14:59 2017 (r319025) @@ -20,6 +20,6 @@ ${BOOT}: ${BOOT0} ${BOOT05} ${BOOT}.part cat ${BOOT0} ${BOOT}.part ${BOOT05} > ${.TARGET} ${BOOT}.part: - dd if=/dev/zero of=${.TARGET} bs=512 count=1 + ${DD} if=/dev/zero of=${.TARGET} bs=512 count=1 .include Modified: stable/10/sys/boot/powerpc/boot1.chrp/Makefile ============================================================================== --- stable/10/sys/boot/powerpc/boot1.chrp/Makefile Sun May 28 01:08:46 2017 (r319024) +++ stable/10/sys/boot/powerpc/boot1.chrp/Makefile Sun May 28 01:14:59 2017 (r319025) @@ -30,8 +30,8 @@ boot1.hfs: boot1.elf bootinfo.txt uudecode ${.CURDIR}/hfs.tmpl.bz2.uu mv hfs.tmpl.bz2 ${.TARGET}.bz2 bzip2 -f -d ${.TARGET}.bz2 - dd if=boot1.elf of=${.TARGET} seek=${BOOT1_OFFSET} conv=notrunc - dd if=${.CURDIR}/bootinfo.txt of=${.TARGET} seek=${BOOTINFO_OFFSET} \ + ${DD} if=boot1.elf of=${.TARGET} seek=${BOOT1_OFFSET} conv=notrunc + ${DD} if=${.CURDIR}/bootinfo.txt of=${.TARGET} seek=${BOOTINFO_OFFSET} \ conv=notrunc CLEANFILES= boot1.hfs Modified: stable/10/sys/boot/sparc64/boot1/Makefile ============================================================================== --- stable/10/sys/boot/sparc64/boot1/Makefile Sun May 28 01:08:46 2017 (r319024) +++ stable/10/sys/boot/sparc64/boot1/Makefile Sun May 28 01:14:59 2017 (r319025) @@ -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=/dev/zero of=${.TARGET} bs=512 count=16 + ${DD} if=${.ALLSRC} of=${.TARGET} bs=512 oseek=1 conv=notrunc boot1.aout: boot1.elf elf2aout -o ${.TARGET} ${.ALLSRC}