CVS commit: src/distrib/common/bootimage
Module Name:src Committed By: jmcneill Date: Sat Jul 24 13:59:29 UTC 2021 Modified Files: src/distrib/common/bootimage: Makefile.bootimage Log Message: bootimage: allow appending additional rc.conf options If RC_CONF_EXTRA is defined, append the contents of this file to the target file-system's rc.conf To generate a diff of this commit: cvs rdiff -u -r1.27 -r1.28 src/distrib/common/bootimage/Makefile.bootimage Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/distrib/common/bootimage/Makefile.bootimage diff -u src/distrib/common/bootimage/Makefile.bootimage:1.27 src/distrib/common/bootimage/Makefile.bootimage:1.28 --- src/distrib/common/bootimage/Makefile.bootimage:1.27 Fri Jun 4 17:09:36 2021 +++ src/distrib/common/bootimage/Makefile.bootimage Sat Jul 24 13:59:28 2021 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.bootimage,v 1.27 2021/06/04 17:09:36 tsutsui Exp $ +# $NetBSD: Makefile.bootimage,v 1.28 2021/07/24 13:59:28 jmcneill Exp $ # # Copyright (c) 2009, 2010, 2011 Izumi Tsutsui. All rights reserved. # @@ -366,6 +366,10 @@ ${TARGETFS}: prepare_md_post ${WORKFSTAB @echo Setting savecore=NO in /etc/rc.conf ... echo "savecore=NO" >> ${WORKRCCONF} .endif +.if defined(RC_CONF_EXTRA) + @echo Adding contents of ${RC_CONF_EXTRA} to /etc/rc.conf ... + cat ${RC_CONF_EXTRA} >> ${WORKRCCONF} +.endif ${INSTALL} ${COPY} -m 0644 ${WORKRCCONF} ${WORKDIR}/etc/rc.conf .if defined(IMGDIR_EXTRA) @echo Copying extra dirs...
CVS commit: src/distrib/common/bootimage
Module Name:src Committed By: tsutsui Date: Fri Jun 4 17:09:36 UTC 2021 Modified Files: src/distrib/common/bootimage: Makefile.bootimage Log Message: Check and remove a stale work file for UEFI images with incorrect size. Fixes PR/56132 (build.sh target install-image fails in update-mode). To generate a diff of this commit: cvs rdiff -u -r1.26 -r1.27 src/distrib/common/bootimage/Makefile.bootimage Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/distrib/common/bootimage/Makefile.bootimage diff -u src/distrib/common/bootimage/Makefile.bootimage:1.26 src/distrib/common/bootimage/Makefile.bootimage:1.27 --- src/distrib/common/bootimage/Makefile.bootimage:1.26 Wed Aug 5 01:35:18 2020 +++ src/distrib/common/bootimage/Makefile.bootimage Fri Jun 4 17:09:36 2021 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.bootimage,v 1.26 2020/08/05 01:35:18 jmcneill Exp $ +# $NetBSD: Makefile.bootimage,v 1.27 2021/06/04 17:09:36 tsutsui Exp $ # # Copyright (c) 2009, 2010, 2011 Izumi Tsutsui. All rights reserved. # @@ -294,6 +294,15 @@ WORKFATDIR?= work.fatdir .if ${USE_GPT} != "no" ${WORKFSTAB}: ${WORKMBR} + +.BEGIN: + @if [ -f ${WORKMBR} ]; then \ + st_size=`${TOOL_STAT} -f %z ${WORKMBR}`; \ + if [ "$$st_size" -ne "$$((${IMAGESECTORS} * 512))" ]; then \ + echo Removing stale ${WORKMBR} ...; \ + rm -f ${WORKMBR};\ + fi \ + fi .endif ${WORKFSTAB}:
CVS commit: src/distrib/common/bootimage
Module Name:src Committed By: jmcneill Date: Thu May 28 15:12:03 UTC 2020 Modified Files: src/distrib/common/bootimage: Makefile.installimage Log Message: Default USE_MBR to no To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/distrib/common/bootimage/Makefile.installimage Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/distrib/common/bootimage/Makefile.installimage diff -u src/distrib/common/bootimage/Makefile.installimage:1.6 src/distrib/common/bootimage/Makefile.installimage:1.7 --- src/distrib/common/bootimage/Makefile.installimage:1.6 Thu Nov 21 22:29:03 2019 +++ src/distrib/common/bootimage/Makefile.installimage Thu May 28 15:12:03 2020 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.installimage,v 1.6 2019/11/21 22:29:03 joerg Exp $ +# $NetBSD: Makefile.installimage,v 1.7 2020/05/28 15:12:03 jmcneill Exp $ # # Common Makefile to create a bootable installation image for USB flash etc. # @@ -36,6 +36,8 @@ SETS?= modules base etc FSTAB_IN?= ${NETBSDSRCDIR}/distrib/common/bootimage/fstab.install.in +USE_MBR?= no + .if ${USE_MBR} != "no" DISKPROTO_IN?= ${NETBSDSRCDIR}/distrib/common/bootimage/diskproto.noswap.mbr.in .else
CVS commit: src/distrib/common/bootimage
Module Name:src Committed By: tsutsui Date: Sat Mar 21 14:19:27 UTC 2020 Modified Files: src/distrib/common/bootimage: Makefile.bootimage Added Files: src/distrib/common/bootimage: diskproto.mbrfat.in Log Message: Add "live-image with a FAT partition for bootstrap files" support. See PR/55075 for more details. To generate a diff of this commit: cvs rdiff -u -r1.23 -r1.24 src/distrib/common/bootimage/Makefile.bootimage cvs rdiff -u -r0 -r1.1 src/distrib/common/bootimage/diskproto.mbrfat.in Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/distrib/common/bootimage/Makefile.bootimage diff -u src/distrib/common/bootimage/Makefile.bootimage:1.23 src/distrib/common/bootimage/Makefile.bootimage:1.24 --- src/distrib/common/bootimage/Makefile.bootimage:1.23 Thu Nov 21 22:29:03 2019 +++ src/distrib/common/bootimage/Makefile.bootimage Sat Mar 21 14:19:26 2020 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.bootimage,v 1.23 2019/11/21 22:29:03 joerg Exp $ +# $NetBSD: Makefile.bootimage,v 1.24 2020/03/21 14:19:26 tsutsui Exp $ # # Copyright (c) 2009, 2010, 2011 Izumi Tsutsui. All rights reserved. # @@ -63,6 +63,9 @@ # EFIMB # EFI partition size in target image in MB # (default: 128) +# FATMB +# FAT partition size in target image in MB +# (default: 0) # KERN_SET # kernel set name which should be extracted into image # (default: kern-GENERIC) @@ -123,6 +126,15 @@ # EFIBOOT # EFI bootloader # (default: empty) +# MBRFAT +# MBR partition type value for FAT +# (default: 6 ("16-bit FAT, more than 32M")) +# FATMAKEFSOPTIONS +# options passed to makefs(8) to create a FAT partition +# (default: -o fat_type=16) +# FATFILES +# list of additional files to be copied into FAT partition +# (default: empty) # .include # @@ -169,11 +181,13 @@ GPTSECTORS= 0 EFIMB?= 128 # 128MB GPTSECTORS= 2048 .endif +FATMB?= 0 # XXX: SWAPMB could be zero and expr(1) returns exit status 1 in that case IMAGESECTORS!= expr ${IMAGEMB} \* 1024 \* 1024 / 512 SWAPSECTORS!= expr ${SWAPMB} \* 1024 \* 1024 / 512 || true EFISECTORS!= expr ${EFIMB} \* 1024 \* 1024 / 512 || true +FATSECTORS!= expr ${FATMB} \* 1024 \* 1024 / 512 || true .if ${USE_MBR} == "no" && ${USE_GPT} == "no" LABELSECTORS?= 0 @@ -184,7 +198,7 @@ LABELSECTORS?= 2048 # 1MB aligned for mo .endif FSSECTORS!= expr ${IMAGESECTORS} - ${SWAPSECTORS} - ${LABELSECTORS} \ - - ${EFISECTORS} - ${GPTSECTORS} + - ${EFISECTORS} - ${GPTSECTORS} - ${FATSECTORS} FSSIZE!= expr ${FSSECTORS} \* 512 # parameters for disklabel and MBR @@ -196,10 +210,14 @@ MBRHEADS= 255 MBRSECTORS= 63 MBRCYLINDERS!= expr ${IMAGESECTORS} / \( ${MBRHEADS} \* ${MBRSECTORS} \) MBRNETBSD= 169 +MBRFAT?= 6 # 16-bit FAT, more than 32M -BSDPARTSECTORS!= expr ${IMAGESECTORS} - ${LABELSECTORS} - ${EFISECTORS} - ${GPTSECTORS} -FSOFFSET!= expr ${LABELSECTORS} + ${EFISECTORS} -SWAPOFFSET!= expr ${LABELSECTORS} + ${FSSECTORS} + ${EFISECTORS} +BSDPARTSECTORS!= expr ${IMAGESECTORS} - ${LABELSECTORS} \ + - ${EFISECTORS} - ${GPTSECTORS} - ${FATSECTORS} +FSOFFSET!= expr ${LABELSECTORS} + ${EFISECTORS} + ${FATSECTORS} +SWAPOFFSET!= expr ${LABELSECTORS} + ${FSSECTORS} \ + + ${EFISECTORS} + ${FATSECTORS} +FATOFFSET= ${LABELSECTORS} # parameters for sunlabel FSCYLINDERS!= expr ${FSSECTORS} / \( ${HEADS} \* ${SECTORS} \) @@ -227,6 +245,7 @@ FSTAB_IN?= ${DISTRIBDIR}/common/bootimag SPEC_IN?= ${DISTRIBDIR}/common/bootimage/spec.in IMGMAKEFSOPTIONS?= -o bsize=16384,fsize=2048,density=8192 +FATMAKEFSOPTIONS?= -o fat_type=16 WORKDIR?= work WORKSPEC?= work.spec @@ -267,6 +286,8 @@ WORKGPT?= work.gpt WORKLABEL?= work.diskproto WORKIMG?= work.img EFIWORKDIR?= work.efidir +WORKFAT?= work.fat +WORKFATDIR?= work.fatdir .if ${USE_GPT} != "no" ${WORKFSTAB}: ${WORKMBR} @@ -388,6 +409,9 @@ TARGET_BLOCKS+= ${WORKMBRTRUNC} .if ${USE_GPT} != "no" TARGET_BLOCKS+= ${WORKEFI} .endif +.if ${FATSECTORS} != 0 +TARGET_BLOCKS+= ${WORKFAT} +.endif TARGET_BLOCKS+= ${TARGETFS} .if ${SWAPSECTORS} != 0 TARGET_BLOCKS+= ${WORKSWAP} @@ -398,6 +422,7 @@ TARGET_BLOCKS+= ${WORKGPT} CLEANFILES+= ${WORKMBR} ${WORKMBRTRUNC} ${WORKSWAP} CLEANFILES+= ${WORKEFI} ${WORKGPT} +CLEANFILES+= ${WORKFAT} CLEANFILES+= ${WORKLABEL}.tmp ${WORKLABEL} CLEANFILES+= ${WORKIMG} ${IMGBASE}.img @@ -423,6 +448,8 @@ ${WORKLABEL}: -e "s/@@SWAPSECTORS@@/${SWAPSECTORS}/" \ -e "s/@@SWAPOFFSET@@/${SWAPOFFSET}/" \ -e "s/@@BSDPARTSECTORS@@/${BSDPARTSECTORS}/" \ + -e "s/@@FATSECTORS@@/${FATSECTORS}/" \ + -e "s/@@FATOFFSET@@/${FATOFFSET}/"\ < ${DISKPROTO_IN} > ${WORKLABEL}.tmp mv ${WORKLABEL}.tmp ${WORKLABEL} @@ -439,6 +466,26 @@ ${WORKEFI}: ${TARGETFS} -t msdos -o F=32,c=1 \ ${WORKEFI} ${EFIWORKDIR} +${WORKFAT}: ${TARGETFS} ${FATFILES} + @echo create FAT partition for bootstrap files... + @${MKDIR} ${MKDIRPERM}
CVS commit: src/distrib/common/bootimage
Module Name:src Committed By: martin Date: Sun Oct 7 18:07:00 UTC 2018 Modified Files: src/distrib/common/bootimage: Makefile.bootimage Log Message: Support .tar.xz sets To generate a diff of this commit: cvs rdiff -u -r1.17 -r1.18 src/distrib/common/bootimage/Makefile.bootimage Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/distrib/common/bootimage/Makefile.bootimage diff -u src/distrib/common/bootimage/Makefile.bootimage:1.17 src/distrib/common/bootimage/Makefile.bootimage:1.18 --- src/distrib/common/bootimage/Makefile.bootimage:1.17 Sat Feb 11 08:08:00 2017 +++ src/distrib/common/bootimage/Makefile.bootimage Sun Oct 7 18:07:00 2018 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.bootimage,v 1.17 2017/02/11 08:08:00 pgoyette Exp $ +# $NetBSD: Makefile.bootimage,v 1.18 2018/10/07 18:07:00 martin Exp $ # # Copyright (c) 2009, 2010, 2011 Izumi Tsutsui. All rights reserved. # @@ -217,6 +217,7 @@ WORKFSTAB?= work.fstab WORKRCCONF?= work.rc.conf WORKFS?=work.rootfs TARGETFS?= imgroot.fs +TAR_SUFF= ${"${USE_XZ_SETS:Uno}"!="no":?tar.xz:tgz} CLEANFILES+= ${WORKSPEC} ${WORKFSTAB} ${WORKRCCONF} ${WORKFS} CLEANFILES+= ${TARGETFS} @@ -231,12 +232,12 @@ ${TARGETFS}: prepare_md_post fi; @${MKDIR} ${MKDIRPERM} ${WORKDIR} .for set in ${IMG_SETS} - @if [ ! -f ${SETS_DIR}/${set}.tgz ]; then \ - echo "Missing ${SETS_DIR}/${set}.tgz, aborting"; \ + @if [ ! -f ${SETS_DIR}/${set}.${TAR_SUFF} ]; then \ + echo "Missing ${SETS_DIR}/${set}.${TAR_SUFF}, aborting";\ false; \ fi - @echo Extracting ${set}.tgz ... - @(cd ${WORKDIR}; ${TOOL_PAX} ${PAX_TIMESTAMP} -rnz -f ${SETS_DIR}/${set}.tgz .) + @echo Extracting ${set}.${TAR_SUFF} ... + @(cd ${WORKDIR}; ${TOOL_PAX} ${PAX_TIMESTAMP} -rnz -f ${SETS_DIR}/${set}.${TAR_SUFF} .) .endfor .if defined(SECONDARY_BOOT) @echo Copying secondary boot...
CVS commit: src/distrib/common/bootimage
Module Name:src Committed By: pgoyette Date: Sat Feb 11 08:08:00 UTC 2017 Modified Files: src/distrib/common/bootimage: Makefile.bootimage Log Message: Remove leftover "-f" from when this used to be a cp command. Unbreak the build for install-image target. To generate a diff of this commit: cvs rdiff -u -r1.16 -r1.17 src/distrib/common/bootimage/Makefile.bootimage Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/distrib/common/bootimage/Makefile.bootimage diff -u src/distrib/common/bootimage/Makefile.bootimage:1.16 src/distrib/common/bootimage/Makefile.bootimage:1.17 --- src/distrib/common/bootimage/Makefile.bootimage:1.16 Sat Feb 11 04:19:25 2017 +++ src/distrib/common/bootimage/Makefile.bootimage Sat Feb 11 08:08:00 2017 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.bootimage,v 1.16 2017/02/11 04:19:25 christos Exp $ +# $NetBSD: Makefile.bootimage,v 1.17 2017/02/11 08:08:00 pgoyette Exp $ # # Copyright (c) 2009, 2010, 2011 Izumi Tsutsui. All rights reserved. # @@ -240,7 +240,7 @@ ${TARGETFS}: prepare_md_post .endfor .if defined(SECONDARY_BOOT) @echo Copying secondary boot... - ${INSTALL} ${COPY} -m 0644 -f ${WORKDIR}/usr/mdec/${SECONDARY_BOOT} ${WORKDIR} + ${INSTALL} ${COPY} -m 0644 ${WORKDIR}/usr/mdec/${SECONDARY_BOOT} ${WORKDIR} .endif @echo Preparing /etc/fstab ... ${TOOL_SED} "s/@@BOOTDISK@@/${BOOTDISK}/" < ${FSTAB_IN} > ${WORKFSTAB}
CVS commit: src/distrib/common/bootimage
Module Name:src Committed By: christos Date: Sat Feb 11 04:19:25 UTC 2017 Modified Files: src/distrib/common/bootimage: Makefile.bootimage Log Message: remove extra endif To generate a diff of this commit: cvs rdiff -u -r1.15 -r1.16 src/distrib/common/bootimage/Makefile.bootimage Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/distrib/common/bootimage/Makefile.bootimage diff -u src/distrib/common/bootimage/Makefile.bootimage:1.15 src/distrib/common/bootimage/Makefile.bootimage:1.16 --- src/distrib/common/bootimage/Makefile.bootimage:1.15 Fri Feb 10 22:07:06 2017 +++ src/distrib/common/bootimage/Makefile.bootimage Fri Feb 10 23:19:25 2017 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.bootimage,v 1.15 2017/02/11 03:07:06 christos Exp $ +# $NetBSD: Makefile.bootimage,v 1.16 2017/02/11 04:19:25 christos Exp $ # # Copyright (c) 2009, 2010, 2011 Izumi Tsutsui. All rights reserved. # @@ -131,7 +131,6 @@ MAKEFS_TIMESTAMP=-T "${MKREPRO_TIMESTAMP}" PAX_TIMESTAMP=--timestamp "${MKREPRO_TIMESTAMP}" .endif -.endif .if empty(IMGBASE) .BEGIN:
CVS commit: src/distrib/common/bootimage
Module Name:src Committed By: christos Date: Tue Jan 24 18:01:07 UTC 2017 Modified Files: src/distrib/common/bootimage: Makefile.bootimage Log Message: use the same logic to compute the timestamp like the other files To generate a diff of this commit: cvs rdiff -u -r1.12 -r1.13 src/distrib/common/bootimage/Makefile.bootimage Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/distrib/common/bootimage/Makefile.bootimage diff -u src/distrib/common/bootimage/Makefile.bootimage:1.12 src/distrib/common/bootimage/Makefile.bootimage:1.13 --- src/distrib/common/bootimage/Makefile.bootimage:1.12 Tue Nov 24 19:50:57 2015 +++ src/distrib/common/bootimage/Makefile.bootimage Tue Jan 24 13:01:07 2017 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.bootimage,v 1.12 2015/11/25 00:50:57 christos Exp $ +# $NetBSD: Makefile.bootimage,v 1.13 2017/01/24 18:01:07 christos Exp $ # # Copyright (c) 2009, 2010, 2011 Izumi Tsutsui. All rights reserved. # @@ -127,8 +127,8 @@ .include "${NETBSDSRCDIR}/distrib/common/Makefile.distrib" -.if ${MKREPRO:Uno} == "yes" -TIMESTAMP=-T ${NETBSDSRCDIR}/sys/sys/param.h +.if ${MKREPRO_TIMESTAMP:Uno} != "no" +MAKEFS_TIMESTAMP=-T "${MKREPRO_TIMESTAMP}" .endif .if empty(IMGBASE) @@ -296,7 +296,7 @@ ${TARGETFS}: prepare_md_post ${TOOL_MAKEFS} -M ${FSSIZE} -m ${FSSIZE} \ -B ${TARGET_ENDIANNESS} \ -F ${WORKSPEC} -N ${WORKDIR}/etc\ - ${TIMESTAMP} \ + ${MAKEFS_TIMESTAMP} \ ${IMGMAKEFSOPTIONS} \ ${WORKFS} ${WORKDIR} .if !empty(PRIMARY_BOOT) && ${INSTALLBOOT_AFTER_DISKLABEL} == "no"
CVS commit: src/distrib/common/bootimage
Module Name:src Committed By: riastradh Date: Fri May 8 17:46:03 UTC 2015 Modified Files: src/distrib/common/bootimage: Makefile.bootimage Log Message: Fix ytpo: INSTALLBOOTOPTIONS, not INSTALLBOOTOPTOINS. From qjsgkem on Freenode. To generate a diff of this commit: cvs rdiff -u -r1.10 -r1.11 src/distrib/common/bootimage/Makefile.bootimage Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/distrib/common/bootimage/Makefile.bootimage diff -u src/distrib/common/bootimage/Makefile.bootimage:1.10 src/distrib/common/bootimage/Makefile.bootimage:1.11 --- src/distrib/common/bootimage/Makefile.bootimage:1.10 Thu Mar 12 04:41:23 2015 +++ src/distrib/common/bootimage/Makefile.bootimage Fri May 8 17:46:03 2015 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.bootimage,v 1.10 2015/03/12 04:41:23 snj Exp $ +# $NetBSD: Makefile.bootimage,v 1.11 2015/05/08 17:46:03 riastradh Exp $ # # Copyright (c) 2009, 2010, 2011 Izumi Tsutsui. All rights reserved. # @@ -381,7 +381,7 @@ ${IMGBASE}.img: ${TARGETFS} ${WORKLABEL} .endif ${TOOL_DISKLABEL} -R -F ${WORKIMG} ${WORKLABEL} .if !empty(PRIMARY_BOOT) ${INSTALLBOOT_AFTER_DISKLABEL} != no - ${TOOL_INSTALLBOOT} -v -m ${MACHINE} ${INSTALLBOOTOPTOINS} ${WORKIMG} \ + ${TOOL_INSTALLBOOT} -v -m ${MACHINE} ${INSTALLBOOTOPTIONS} ${WORKIMG} \ ${WORKDIR}/usr/mdec/${PRIMARY_BOOT} .endif mv ${WORKIMG} ${.TARGET}
CVS commit: src/distrib/common/bootimage
Module Name:src Committed By: snj Date: Thu Mar 12 04:41:23 UTC 2015 Modified Files: src/distrib/common/bootimage: Makefile.bootimage Log Message: unbreak amd64 install images by passing ipty to MAKEDEV. revision 1.21 of etc/etc.amd64/MAKEDEV.conf removed them from 'all'. (hi christos!) To generate a diff of this commit: cvs rdiff -u -r1.9 -r1.10 src/distrib/common/bootimage/Makefile.bootimage Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/distrib/common/bootimage/Makefile.bootimage diff -u src/distrib/common/bootimage/Makefile.bootimage:1.9 src/distrib/common/bootimage/Makefile.bootimage:1.10 --- src/distrib/common/bootimage/Makefile.bootimage:1.9 Tue Aug 5 15:40:58 2014 +++ src/distrib/common/bootimage/Makefile.bootimage Thu Mar 12 04:41:23 2015 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.bootimage,v 1.9 2014/08/05 15:40:58 apb Exp $ +# $NetBSD: Makefile.bootimage,v 1.10 2015/03/12 04:41:23 snj Exp $ # # Copyright (c) 2009, 2010, 2011 Izumi Tsutsui. All rights reserved. # @@ -276,7 +276,7 @@ ${TARGETFS}: prepare_md_post ${RM} -f ${WORKSPEC} cat ${WORKDIR}/etc/mtree/* | \ ${TOOL_SED} -e 's/ size=[0-9]*//' ${WORKSPEC} - ${HOST_SH} ${WORKDIR}/dev/MAKEDEV -s all | \ + ${HOST_SH} ${WORKDIR}/dev/MAKEDEV -s all ipty | \ ${TOOL_SED} -e '/^\. type=dir/d' -e 's,^\.,./dev,' ${WORKSPEC} cat ${SPEC_IN} ${WORKSPEC} .if defined(SECONDARY_BOOT)
CVS commit: src/distrib/common/bootimage
Module Name:src Committed By: jakllsch Date: Tue Nov 20 20:16:04 UTC 2012 Modified Files: src/distrib/common/bootimage: fstab.in fstab.install.in Log Message: Don't enable WAPBL in images. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/distrib/common/bootimage/fstab.in \ src/distrib/common/bootimage/fstab.install.in Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/distrib/common/bootimage/fstab.in diff -u src/distrib/common/bootimage/fstab.in:1.1 src/distrib/common/bootimage/fstab.in:1.2 --- src/distrib/common/bootimage/fstab.in:1.1 Sun Jan 22 03:53:30 2012 +++ src/distrib/common/bootimage/fstab.in Tue Nov 20 20:16:03 2012 @@ -1,4 +1,4 @@ -/dev/@@BOOTDISK@@a / ffs rw,log 1 1 +/dev/@@BOOTDISK@@a / ffs rw 1 1 /dev/@@BOOTDISK@@b none none sw 0 0 ptyfs /dev/pts ptyfs rw 0 0 kernfs /kern kernfs rw,noauto 0 0 Index: src/distrib/common/bootimage/fstab.install.in diff -u src/distrib/common/bootimage/fstab.install.in:1.1 src/distrib/common/bootimage/fstab.install.in:1.2 --- src/distrib/common/bootimage/fstab.install.in:1.1 Sun Jan 22 03:53:30 2012 +++ src/distrib/common/bootimage/fstab.install.in Tue Nov 20 20:16:03 2012 @@ -1,2 +1,2 @@ -/dev/@@BOOTDISK@@a / ffs rw,log 1 1 +/dev/@@BOOTDISK@@a / ffs rw 1 1 tmpfs /tmp tmpfs rw 0 0
CVS commit: src/distrib/common/bootimage
Module Name:src Committed By: tsutsui Date: Sun Apr 22 07:23:43 UTC 2012 Modified Files: src/distrib/common/bootimage: Makefile.bootimage Makefile.installimage Log Message: Fix typo in comments. To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/distrib/common/bootimage/Makefile.bootimage cvs rdiff -u -r1.2 -r1.3 src/distrib/common/bootimage/Makefile.installimage Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/distrib/common/bootimage/Makefile.bootimage diff -u src/distrib/common/bootimage/Makefile.bootimage:1.5 src/distrib/common/bootimage/Makefile.bootimage:1.6 --- src/distrib/common/bootimage/Makefile.bootimage:1.5 Sun Apr 22 05:24:39 2012 +++ src/distrib/common/bootimage/Makefile.bootimage Sun Apr 22 07:23:42 2012 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.bootimage,v 1.5 2012/04/22 05:24:39 tsutsui Exp $ +# $NetBSD: Makefile.bootimage,v 1.6 2012/04/22 07:23:42 tsutsui Exp $ # # Copyright (c) 2009, 2010, 2011 Izumi Tsutsui. All rights reserved. # @@ -39,7 +39,7 @@ # (default: sd0) # USE_MBR # set yes if target disk image requires MBR partition -# (defautl: no) +# (default: no) # MBR_BOOTCODE # optional MBR bootcode which should be installed by fdisk(8) # (default: empty) @@ -82,7 +82,7 @@ # DIR TARGETPATH # for installation image etc. # (default: empty) -# XXX: currently permittions in IMGDIR_EXTRA are not handled +# XXX: currently permissions in IMGDIR_EXTRA are not handled # IMGDIR_EXCLUDE # pax(1) options to exclude files which should not copied # into TARGETPATH in IMGDIR_EXTRA Index: src/distrib/common/bootimage/Makefile.installimage diff -u src/distrib/common/bootimage/Makefile.installimage:1.2 src/distrib/common/bootimage/Makefile.installimage:1.3 --- src/distrib/common/bootimage/Makefile.installimage:1.2 Sun Jan 22 16:50:00 2012 +++ src/distrib/common/bootimage/Makefile.installimage Sun Apr 22 07:23:42 2012 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.installimage,v 1.2 2012/01/22 16:50:00 tsutsui Exp $ +# $NetBSD: Makefile.installimage,v 1.3 2012/04/22 07:23:42 tsutsui Exp $ # # Common Makefile to create a bootable installation image for USB flash etc. # @@ -35,7 +35,7 @@ DISKPROTO_IN?= ${NETBSDSRCDIR}/distrib/c DISKPROTO_IN?= ${NETBSDSRCDIR}/distrib/common/bootimage/diskproto.noswap.in .endif -# XXX: no permittion info for makefs(8) +# XXX: no permission info for makefs(8) IMGDIR_EXTRA= ${RELEASEDIR}/${RELEASEMACHINEDIR} ${RELEASEMACHINEDIR} IMGDIR_EXCLUDE= -s ',./installation/cdrom.*,,gp' IMGDIR_EXCLUDE+= -s ',./installation/liveimage.*,,gp'
CVS commit: src/distrib/common/bootimage
Module Name:src Committed By: tsutsui Date: Sun Apr 22 05:24:39 UTC 2012 Modified Files: src/distrib/common/bootimage: Makefile.bootimage Log Message: Add two optional variables for liveimage/installimage builds: --- MBR_BOOTCODE optional MBR bootcode which should be installed by fdisk(8) (default: empty) - specified MBR_BOOTCODE must exist in ${DESTDIR}/usr/mdec - if MBR_BOOTCODE is not specified, MBR_DEFAULT_BOOTCODE (default: mbr) will be used if the target ${MACHINE} has the one in /usr/mdec INSTALLBOOTOPTIONS options passed to installboot(8), e.g., -o console=com0 (default: empty) --- Proposed by Brook Milligan on current-users@: http://mail-index.NetBSD.org/current-users/2012/04/16/msg019892.html Also make USE_MBR work on ${MACHINE}s which don't have the default /usr/mdec/mbr bootcode. (no such port has the liveimage target yet though) XXX: tools fdisk(8) implicitly uses host's /usr/mdec/mbr for the default XXX: bootcode even for non-x86 targets if host is x86 To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/distrib/common/bootimage/Makefile.bootimage Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/distrib/common/bootimage/Makefile.bootimage diff -u src/distrib/common/bootimage/Makefile.bootimage:1.4 src/distrib/common/bootimage/Makefile.bootimage:1.5 --- src/distrib/common/bootimage/Makefile.bootimage:1.4 Mon Apr 9 19:22:49 2012 +++ src/distrib/common/bootimage/Makefile.bootimage Sun Apr 22 05:24:39 2012 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.bootimage,v 1.4 2012/04/09 19:22:49 riz Exp $ +# $NetBSD: Makefile.bootimage,v 1.5 2012/04/22 05:24:39 tsutsui Exp $ # # Copyright (c) 2009, 2010, 2011 Izumi Tsutsui. All rights reserved. # @@ -40,6 +40,13 @@ # USE_MBR # set yes if target disk image requires MBR partition # (defautl: no) +# MBR_BOOTCODE +# optional MBR bootcode which should be installed by fdisk(8) +# (default: empty) +# - specified MBR_BOOTCODE must exist in ${DESTDIR}/usr/mdec +# - if MBR_BOOTCODE is not specified, +# MBR_DEFAULT_BOOTCODE (default: mbr) will be used +# if the target ${MACHINE} has the one in /usr/mdec # USE_SUNLABEL # set yes if target disk image requires Sun's label # (default: no) @@ -92,6 +99,9 @@ # IMGMAKEFSOPTIONS # options passed to makefs(8) to create root file system # (default: -o bsize=16384,fsize=2048,density=8192) +# INSTALLBOOTOPTIONS +# options passed to installboot(8), e.g., -o console=com0 +# (default: empty) # PRIMARY_BOOT # primary boot loader that should be installed into # the target image via installboot(8) @@ -286,7 +296,7 @@ ${TARGETFS}: prepare_md_post ${IMGMAKEFSOPTIONS} \ ${WORKFS} ${WORKDIR} .if !empty(PRIMARY_BOOT) ${INSTALLBOOT_AFTER_DISKLABEL} == no - ${TOOL_INSTALLBOOT} -vm ${MACHINE} ${WORKFS} \ + ${TOOL_INSTALLBOOT} -v -m ${MACHINE} ${INSTALLBOOTOPTIONS} ${WORKFS} \ ${WORKDIR}/usr/mdec/${PRIMARY_BOOT} ${SECONDARY_BOOT_ARG} .endif @echo done. @@ -301,6 +311,8 @@ DISKPROTO_IN?= ${DISTRIBDIR}/common/boot DISKPROTO_IN?= ${DISTRIBDIR}/common/bootimage/diskproto.in .endif +MBR_DEFAULT_BOOTCODE?= mbr + OMIT_SWAPIMG?= no WORKMBR?= work.mbr @@ -328,14 +340,30 @@ ${WORKLABEL}: mv ${WORKLABEL}.tmp ${WORKLABEL} ${IMGBASE}.img: ${TARGETFS} ${WORKLABEL} -.if ${LABELSECTORS} != 0 +.if ${USE_MBR} != no @echo creating MBR labels... ${DD} if=/dev/zero of=${WORKMBR} seek=$$((${IMAGESECTORS} - 1)) count=1 - ${TOOL_FDISK} -f -u \ + ${TOOL_FDISK} -f -i -u \ -b ${MBRCYLINDERS}/${MBRHEADS}/${MBRSECTORS} \ -0 -a -s ${MBRNETBSD}/${FSOFFSET}/${BSDPARTSECTORS} \ - -i -c ${WORKDIR}/usr/mdec/mbr\ -F ${WORKMBR} +.if empty(MBR_BOOTCODE) + @if [ -f ${WORKDIR}/usr/mdec/${MBR_DEFAULT_BOOTCODE} ]; then \ + echo ${TOOL_FDISK} -f \ + -i -c ${WORKDIR}/usr/mdec/${MBR_DEFAULT_BOOTCODE} \ + -F ${WORKMBR}; \ + ${TOOL_FDISK} -f \ + -i -c ${WORKDIR}/usr/mdec/${MBR_DEFAULT_BOOTCODE} \ + -F ${WORKMBR}; \ + fi +.else + @if [ ! -f ${WORKDIR}/usr/mdec/${MBR_BOOTCODE} ]; then \ + echo ${MBR_BOOTCODE} is not found in DESTDIR/usr/mdec, aborting; \ + false; \ + fi + ${TOOL_FDISK} -f -i -c ${WORKDIR}/usr/mdec/${MBR_BOOTCODE} \ + -F ${WORKMBR} +.endif ${DD} if=${WORKMBR} count=${LABELSECTORS} | \ ${CAT} - ${TARGETFS} ${WORKIMG} .else @@ -354,7 +382,7 @@ ${IMGBASE}.img: ${TARGETFS} ${WORKLABEL} .endif ${TOOL_DISKLABEL} -R -F ${WORKIMG} ${WORKLABEL} .if !empty(PRIMARY_BOOT) ${INSTALLBOOT_AFTER_DISKLABEL} != no - ${TOOL_INSTALLBOOT} -vm ${MACHINE} ${WORKIMG} \ + ${TOOL_INSTALLBOOT} -v -m ${MACHINE} ${INSTALLBOOTOPTOINS} ${WORKIMG} \ ${WORKDIR}/usr/mdec/${PRIMARY_BOOT} .endif mv ${WORKIMG} ${.TARGET}
CVS commit: src/distrib/common/bootimage
Module Name:src Committed By: riz Date: Mon Apr 9 19:22:49 UTC 2012 Modified Files: src/distrib/common/bootimage: Makefile.bootimage Log Message: s/Createing/Creating/ To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/distrib/common/bootimage/Makefile.bootimage Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/distrib/common/bootimage/Makefile.bootimage diff -u src/distrib/common/bootimage/Makefile.bootimage:1.3 src/distrib/common/bootimage/Makefile.bootimage:1.4 --- src/distrib/common/bootimage/Makefile.bootimage:1.3 Sun Jan 22 16:56:22 2012 +++ src/distrib/common/bootimage/Makefile.bootimage Mon Apr 9 19:22:49 2012 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.bootimage,v 1.3 2012/01/22 16:56:22 tsutsui Exp $ +# $NetBSD: Makefile.bootimage,v 1.4 2012/04/09 19:22:49 riz Exp $ # # Copyright (c) 2009, 2010, 2011 Izumi Tsutsui. All rights reserved. # @@ -277,7 +277,7 @@ ${TARGETFS}: prepare_md_post .if defined(SPEC_EXTRA) cat ${SPEC_EXTRA} ${WORKSPEC} .endif - @echo Createing rootfs... + @echo Creating rootfs... # XXX /var/spool/ftp/hidden is unreadable ${CHMOD} +r ${WORKDIR}/var/spool/ftp/hidden ${TOOL_MAKEFS} -M ${FSSIZE} -m ${FSSIZE} \
CVS commit: src/distrib/common/bootimage
Module Name:src Committed By: tsutsui Date: Sun Jan 22 16:50:00 UTC 2012 Modified Files: src/distrib/common/bootimage: Makefile.bootimage Makefile.installimage Makefile.liveimage Log Message: Fix checks for RELEASEDIR (and IMGBASE) variables to perform it only on live_image or install_image targets. PR toolchain/45864 To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/distrib/common/bootimage/Makefile.bootimage \ src/distrib/common/bootimage/Makefile.installimage \ src/distrib/common/bootimage/Makefile.liveimage Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/distrib/common/bootimage/Makefile.bootimage diff -u src/distrib/common/bootimage/Makefile.bootimage:1.1 src/distrib/common/bootimage/Makefile.bootimage:1.2 --- src/distrib/common/bootimage/Makefile.bootimage:1.1 Sun Jan 22 03:53:30 2012 +++ src/distrib/common/bootimage/Makefile.bootimage Sun Jan 22 16:50:00 2012 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.bootimage,v 1.1 2012/01/22 03:53:30 tsutsui Exp $ +# $NetBSD: Makefile.bootimage,v 1.2 2012/01/22 16:50:00 tsutsui Exp $ # # Copyright (c) 2009, 2010, 2011 Izumi Tsutsui. All rights reserved. # @@ -123,11 +123,6 @@ @echo Error: IMGBASE is not set @false .endif -.if empty(RELEASEDIR) -.BEGIN: - @echo Error: RELEASEDIR is not set - @false -.endif # should be defined elsewhere? CAT?= cat Index: src/distrib/common/bootimage/Makefile.installimage diff -u src/distrib/common/bootimage/Makefile.installimage:1.1 src/distrib/common/bootimage/Makefile.installimage:1.2 --- src/distrib/common/bootimage/Makefile.installimage:1.1 Sun Jan 22 03:53:30 2012 +++ src/distrib/common/bootimage/Makefile.installimage Sun Jan 22 16:50:00 2012 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.installimage,v 1.1 2012/01/22 03:53:30 tsutsui Exp $ +# $NetBSD: Makefile.installimage,v 1.2 2012/01/22 16:50:00 tsutsui Exp $ # # Common Makefile to create a bootable installation image for USB flash etc. # @@ -11,15 +11,14 @@ # See Makefile.bootimage for other variables. # -.if empty(INSTIMGBASE) -.BEGIN: +.if !target(check_INSTIMGBASE) +check_INSTIMGBASE: .PHONY .NOTMAIN +.if !defined(INSTIMGBASE) @echo Error: INSTIMGBASE is not set @false +.else + @true .endif -.if empty(RELEASEDIR) -.BEGIN: - @echo Error: RELEASEDIR is not set - @false .endif SWAPMB= 0 # no swap @@ -54,7 +53,7 @@ INSTIMG_RELEASEDIR?= ${RELEASEMACHINEDIR # should be defined elsewhere? MKDIR?= mkdir -p -install_image: ${IMGBASE}.img.gz +install_image: check_INSTIMGBASE check_RELEASEDIR ${IMGBASE}.img.gz ${MKDIR} ${INSTIMG_RELEASEDIR} ${RELEASE_INSTALL} ${IMGBASE}.img.gz ${INSTIMG_RELEASEDIR} # note ${MAKESUM} will be calculated in src/etc/Makefile Index: src/distrib/common/bootimage/Makefile.liveimage diff -u src/distrib/common/bootimage/Makefile.liveimage:1.1 src/distrib/common/bootimage/Makefile.liveimage:1.2 --- src/distrib/common/bootimage/Makefile.liveimage:1.1 Sun Jan 22 03:53:30 2012 +++ src/distrib/common/bootimage/Makefile.liveimage Sun Jan 22 16:50:00 2012 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.liveimage,v 1.1 2012/01/22 03:53:30 tsutsui Exp $ +# $NetBSD: Makefile.liveimage,v 1.2 2012/01/22 16:50:00 tsutsui Exp $ # # Common Makefile to create a bootable FS image for USB flash or emulators # @@ -11,15 +11,14 @@ # See Makefile.bootimage for other variables. # -.if empty(LIVEIMGBASE) -.BEGIN: +.if !target(check_LIVEIMGBASE) +check_LIVEIMGBASE: .PHONY .NOTMAIN +.if !defined(LIVEIMGBASE) @echo Error: LIVEIMGBASE is not set @false +.else + @true .endif -.if empty(RELEASEDIR) -.BEGIN: - @echo Error: RELEASEDIR is not set - @false .endif IMGBASE= ${LIVEIMGBASE} @@ -34,7 +33,7 @@ LIVEIMG_RELEASEDIR?= ${RELEASEMACHINEDIR # should be defined elsewhere? MKDIR?= mkdir -p -live_image: ${IMGBASE}.img.gz +live_image: check_LIVEIMGBASE check_RELEASEDIR ${IMGBASE}.img.gz ${MKDIR} ${LIVEIMG_RELEASEDIR} ${RELEASE_INSTALL} ${IMGBASE}.img.gz ${LIVEIMG_RELEASEDIR} # note ${MAKESUM} will be calculated in src/etc/Makefile
CVS commit: src/distrib/common/bootimage
Module Name:src Committed By: tsutsui Date: Sun Jan 22 16:56:22 UTC 2012 Modified Files: src/distrib/common/bootimage: Makefile.bootimage Log Message: Appease warnings `expr 0 \* 1024 \* 1024 / 512 returned non-zero status.' SWAPMB could be zero (in install-image case) and expr(1) returns exit status 1 in that case. Umm. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/distrib/common/bootimage/Makefile.bootimage Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/distrib/common/bootimage/Makefile.bootimage diff -u src/distrib/common/bootimage/Makefile.bootimage:1.2 src/distrib/common/bootimage/Makefile.bootimage:1.3 --- src/distrib/common/bootimage/Makefile.bootimage:1.2 Sun Jan 22 16:50:00 2012 +++ src/distrib/common/bootimage/Makefile.bootimage Sun Jan 22 16:56:22 2012 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.bootimage,v 1.2 2012/01/22 16:50:00 tsutsui Exp $ +# $NetBSD: Makefile.bootimage,v 1.3 2012/01/22 16:56:22 tsutsui Exp $ # # Copyright (c) 2009, 2010, 2011 Izumi Tsutsui. All rights reserved. # @@ -146,8 +146,9 @@ INSTALLBOOT_AFTER_DISKLABEL?= no IMAGEMB?= 2048 # 2048MB SWAPMB?= 128 # 128MB +# XXX: SWAPMB could be zero and expr(1) returns exit status 1 in that case IMAGESECTORS!= expr ${IMAGEMB} \* 1024 \* 1024 / 512 -SWAPSECTORS!= expr ${SWAPMB} \* 1024 \* 1024 / 512 +SWAPSECTORS!= expr ${SWAPMB} \* 1024 \* 1024 / 512 || true .if ${USE_MBR} == no LABELSECTORS?= 0 @@ -176,7 +177,7 @@ SWAPOFFSET!= expr ${LABELSECTORS} + ${FS # parameters for sunlabel FSCYLINDERS!= expr ${FSSECTORS} / \( ${HEADS} \* ${SECTORS} \) -SWAPCYLINDERS!= expr ${SWAPSECTORS} / \( ${HEADS} \* ${SECTORS} \) +SWAPCYLINDERS!= expr ${SWAPSECTORS} / \( ${HEADS} \* ${SECTORS} \) || true #