CVS commit: src/distrib/common/bootimage

2024-05-17 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat May 18 02:03:17 UTC 2024

Modified Files:
src/distrib/common/bootimage: Makefile.bootimage

Log Message:
include all extra flavors of the kernel and use the proper variable for
the machine dependent installation directory.


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 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.



CVS commit: src/distrib/common/bootimage

2024-05-17 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat May 18 02:03:17 UTC 2024

Modified Files:
src/distrib/common/bootimage: Makefile.bootimage

Log Message:
include all extra flavors of the kernel and use the proper variable for
the machine dependent installation directory.


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 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.36 src/distrib/common/bootimage/Makefile.bootimage:1.37
--- src/distrib/common/bootimage/Makefile.bootimage:1.36	Thu May 16 11:46:42 2024
+++ src/distrib/common/bootimage/Makefile.bootimage	Fri May 17 22:03:17 2024
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.bootimage,v 1.36 2024/05/16 15:46:42 christos Exp $
+#	$NetBSD: Makefile.bootimage,v 1.37 2024/05/18 02:03:17 christos Exp $
 #
 # Copyright (c) 2009, 2010, 2011 Izumi Tsutsui.  All rights reserved.
 #
@@ -433,12 +433,13 @@ ${TARGETFS}: prepare_md_post ${WORKFSTAB
 .if defined(SPEC_EXTRA)
 	cat ${SPEC_EXTRA} >> ${WORKSPEC}
 .endif
-	if [ -f ${WORKDIR}/netbsd.gdb ]; then \
-	echo "./netbsd.gdb type=file uname=root gname=wheel mode=0444" \
-	>> ${WORKSPEC}; \
-	fi
-	if [ -d ${WORKDIR}/${MACHINE} ]; then \
-	${MAKESPEC} -d ${WORKDIR} ${MACHINE} >> ${WORKSPEC}; \
+	for i in ${WORKDIR}/netbsd.*; do \
+	if [ -e $$i ]; then \
+		echo "./$$(basename $$i) type=file uname=root gname=wheel mode=0444" >> ${WORKSPEC}; \
+	fi; \
+	done
+	if [ -d ${WORKDIR}/${RELEASEMACHINEDIR} ]; then \
+	${MAKESPEC} -d ${WORKDIR} ${RELEASEMACHINEDIR} >> ${WORKSPEC}; \
 	fi
 	@echo Creating rootfs...
 	# XXX /var/spool/ftp/hidden is unreadable



CVS commit: src/distrib/common

2024-05-17 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri May 17 19:54:28 UTC 2024

Modified Files:
src/distrib/common: Makefile.image

Log Message:
Add IMAGERUNTIME and IMAGESPECEXTRA variables


To generate a diff of this commit:
cvs rdiff -u -r1.42 -r1.43 src/distrib/common/Makefile.image

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/Makefile.image
diff -u src/distrib/common/Makefile.image:1.42 src/distrib/common/Makefile.image:1.43
--- src/distrib/common/Makefile.image:1.42	Thu May 16 11:46:42 2024
+++ src/distrib/common/Makefile.image	Fri May 17 15:54:28 2024
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.image,v 1.42 2024/05/16 15:46:42 christos Exp $
+#	$NetBSD: Makefile.image,v 1.43 2024/05/17 19:54:28 christos Exp $
 #
 # Makefile snippet to build a tree from the provided lists,
 # and make an ffs file system image from that tree
@@ -16,6 +16,8 @@
 #	IMAGEPREBUILD	additional operations to run pre image creation
 #	IMAGEPOSTBUILD	operation to run on ${IMAGE} ${.TARGET} after its built
 #			(if this returns non zero, ${.TARGET} is removed)
+#	IMAGERUNTIME	files/directories to copy from $DESTDIR onto the image
+#	IMAGESPECEXTRA	files/directories to add to the spec
 #	CRUNCHBIN	name of crunchgen(1)ed binary
 #	DESTDIR		destination directory
 #	MAKEFS_FLAGS	extra options to ${TOOL_MAKEFS}
@@ -34,6 +36,7 @@ _MAKEFILE_IMAGE_=1
 WORKDIR?=	work
 WORKSPEC?=	work.spec
 WORKBUILT?=	work.built
+CUROBJDIR!= cd ${.CURDIR} && ${PRINTOBJDIR}
 
 .include "${DISTRIBDIR}/common/Makefile.parselist"
 
@@ -44,6 +47,14 @@ MAKEFS_TIMESTAMP=-T "${MKREPRO_TIMESTAMP
 PAX_TIMESTAMP=--timestamp "${MKREPRO_TIMESTAMP}"
 GZIP_N_FLAG=-n
 .endif
+MAKESPEC=	${HOST_SH} ${NETBSDSRCDIR}/etc/makespec
+
+.if ${MAKEVERBOSE} >= 2 
+PAX_v?= -v
+.else   
+PAX_v?= 
+.endif  
+
 
 GZIP_FLAGS= -9 ${GZIP_N_FLAG}
 
@@ -95,6 +106,22 @@ ${IMAGE}: ${WORKBUILT}
 .if defined(IMAGEPREBUILD)
 	${IMAGEPREBUILD}
 .endif
+	if [ "X${IMAGERUNTIME}" != "X" ]; then\
+		release_destdir=${WORKDIR};\
+		cd $$release_destdir;	\
+		cd ${DESTDIR};		\
+		for imge in ${IMAGERUNTIME};\
+		do			\
+			${TOOL_PAX} ${PAX_TIMESTAMP} -rw -pp ${PAX_v}	\
+$${imge} $$release_destdir;		\
+		done;			\
+		cd "${CUROBJDIR}";	\
+	fi
+	for i in ${IMAGERUNTIME} ${IMAGESPECEXTRA}; do 			\
+		if [ -n "$$i" ] && [ -e ${WORKDIR}/$$i ]; then 		\
+		${MAKESPEC} -d ${WORKDIR} $$i >> ${WORKSPEC}; 	\
+		fi; 			\
+	done
 	[ "${.OODATE}" = ${WORKBUILT} -a -f ${IMAGE} -a ! ${IMAGE} -ot ${WORKBUILT} ]  || { \
 	${_MKSHMSG_CREATE} ${.CURDIR:T}/${.TARGET}; \
 	rm -f ${.TARGET} ${.TARGET}.tmp; \



CVS commit: src/distrib/common

2024-05-17 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri May 17 19:54:28 UTC 2024

Modified Files:
src/distrib/common: Makefile.image

Log Message:
Add IMAGERUNTIME and IMAGESPECEXTRA variables


To generate a diff of this commit:
cvs rdiff -u -r1.42 -r1.43 src/distrib/common/Makefile.image

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/distrib/common

2024-05-16 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu May 16 17:55:48 UTC 2024

Modified Files:
src/distrib/common: Makefile.bootcd

Log Message:
Add more extra stuff on the cds


To generate a diff of this commit:
cvs rdiff -u -r1.54 -r1.55 src/distrib/common/Makefile.bootcd

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/Makefile.bootcd
diff -u src/distrib/common/Makefile.bootcd:1.54 src/distrib/common/Makefile.bootcd:1.55
--- src/distrib/common/Makefile.bootcd:1.54	Tue May 14 13:17:13 2024
+++ src/distrib/common/Makefile.bootcd	Thu May 16 13:55:48 2024
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.bootcd,v 1.54 2024/05/14 17:17:13 christos Exp $
+#	$NetBSD: Makefile.bootcd,v 1.55 2024/05/16 17:55:48 christos Exp $
 #
 # Makefile snipped to create a CD/DVD ISO
 #
@@ -324,8 +324,12 @@ image:
 .endif
 	if [ ! -s ${WORKSPEC} ]; then \
 	${MAKESPEC} -d cdrom . > ${WORKSPEC}; \
-	elif [ -d cdrom/${MACHINE} ]; then \
-	${MAKESPEC} -d cdrom ${MACHINE} >> ${WORKSPEC}; \
+	else \
+	for i in ${RELEASEMACHINEDIR} source ${CDEXTRA} ${CDBUILDEXTRA}; do\
+		if [ -n "$$i" ] && [ -e cdrom/$$i ]; then \
+		${MAKESPEC} -d cdrom $$i >> ${WORKSPEC}; \
+		fi; \
+	done; \
 	fi
 	${TOOL_MAKEFS} -N ${NETBSDSRCDIR}/etc -t cd9660 -F ${WORKSPEC} -xx \
 	${MAKEFS_TIMESTAMP} ${CDMAKEFSEXTRAOPTS} -o ${_CDMAKEFSOPTIONS:Q} \



CVS commit: src/distrib/common

2024-05-16 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu May 16 17:55:48 UTC 2024

Modified Files:
src/distrib/common: Makefile.bootcd

Log Message:
Add more extra stuff on the cds


To generate a diff of this commit:
cvs rdiff -u -r1.54 -r1.55 src/distrib/common/Makefile.bootcd

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/distrib/common

2024-05-16 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu May 16 15:46:42 UTC 2024

Modified Files:
src/distrib/common: Makefile.image
src/distrib/common/bootimage: Makefile.bootimage

Log Message:
Apply the -xx treatment to the rest of the ffs makefs invocations.


To generate a diff of this commit:
cvs rdiff -u -r1.41 -r1.42 src/distrib/common/Makefile.image
cvs rdiff -u -r1.35 -r1.36 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/Makefile.image
diff -u src/distrib/common/Makefile.image:1.41 src/distrib/common/Makefile.image:1.42
--- src/distrib/common/Makefile.image:1.41	Tue Mar 19 20:31:54 2024
+++ src/distrib/common/Makefile.image	Thu May 16 11:46:42 2024
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.image,v 1.41 2024/03/20 00:31:54 christos Exp $
+#	$NetBSD: Makefile.image,v 1.42 2024/05/16 15:46:42 christos Exp $
 #
 # Makefile snippet to build a tree from the provided lists,
 # and make an ffs file system image from that tree
@@ -99,7 +99,7 @@ ${IMAGE}: ${WORKBUILT}
 	${_MKSHMSG_CREATE} ${.CURDIR:T}/${.TARGET}; \
 	rm -f ${.TARGET} ${.TARGET}.tmp; \
 	${TOOL_MAKEFS} -t ffs -B ${IMAGEENDIAN} -s ${IMAGESIZE} -F ${WORKSPEC} \
-	${MAKEFS_TIMESTAMP} -N ${NETBSDSRCDIR}/etc ${IMGMAKEFSOPTIONS} \
+	-xx ${MAKEFS_TIMESTAMP} -N ${NETBSDSRCDIR}/etc ${IMGMAKEFSOPTIONS} \
 	-o optimization=space,minfree=0 \
 	${MAKEFS_FLAGS} ${.TARGET}.tmp ${WORKDIR} \
 	&& mv -f ${.TARGET}.tmp ${.TARGET}; \

Index: src/distrib/common/bootimage/Makefile.bootimage
diff -u src/distrib/common/bootimage/Makefile.bootimage:1.35 src/distrib/common/bootimage/Makefile.bootimage:1.36
--- src/distrib/common/bootimage/Makefile.bootimage:1.35	Mon Apr 22 10:41:24 2024
+++ src/distrib/common/bootimage/Makefile.bootimage	Thu May 16 11:46:42 2024
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.bootimage,v 1.35 2024/04/22 14:41:24 nia Exp $
+#	$NetBSD: Makefile.bootimage,v 1.36 2024/05/16 15:46:42 christos Exp $
 #
 # Copyright (c) 2009, 2010, 2011 Izumi Tsutsui.  All rights reserved.
 #
@@ -171,6 +171,8 @@ DD?=		dd
 MKDIR?=		mkdir -p
 RM?=		rm
 
+MAKESPEC=	${HOST_SH} ${NETBSDSRCDIR}/etc/makespec
+
 #
 # common definitions for image
 #
@@ -351,6 +353,7 @@ ${WORKFSTAB}:
 # create root file system for the image
 #
 ${TARGETFS}: prepare_md_post ${WORKFSTAB}
+	@${RM} -f ${WORKSPEC}
 	@if [ ! -d ${RELEASEDIR}/${RELEASEMACHINEDIR} ]; then 		\
 		echo "Missing ${RELEASEDIR}/${RELEASEMACHINEDIR}, aborting"; \
 		false; 			\
@@ -413,11 +416,11 @@ ${TARGETFS}: prepare_md_post ${WORKFSTAB
 	@if [ -f ${_SRC} ]; then 	\
 		echo ${INSTALL} ${COPY} -m 0644 ${_SRC} ${WORKDIR}/${_TARGET}; \
 		${INSTALL} ${COPY} -m 0644 ${_SRC} ${WORKDIR}/${_TARGET}; \
+		echo "./${_TARGET} type=file uname=root gname=wheel mode=0555" >> ${WORKSPEC}; \
 	fi
 .endfor
 .endif
 	@echo Preparing spec files for makefs...
-	${RM} -f ${WORKSPEC}
 	cat ${WORKDIR}/etc/mtree/* |	\
 	${TOOL_SED} -e 's/ size=[0-9]*//' > ${WORKSPEC}
 	${HOST_SH} ${WORKDIR}/dev/MAKEDEV -s all ipty |			\
@@ -430,12 +433,19 @@ ${TARGETFS}: prepare_md_post ${WORKFSTAB
 .if defined(SPEC_EXTRA)
 	cat ${SPEC_EXTRA} >> ${WORKSPEC}
 .endif
+	if [ -f ${WORKDIR}/netbsd.gdb ]; then \
+	echo "./netbsd.gdb type=file uname=root gname=wheel mode=0444" \
+	>> ${WORKSPEC}; \
+	fi
+	if [ -d ${WORKDIR}/${MACHINE} ]; then \
+	${MAKESPEC} -d ${WORKDIR} ${MACHINE} >> ${WORKSPEC}; \
+	fi
 	@echo Creating rootfs...
 	# XXX /var/spool/ftp/hidden is unreadable
 	${CHMOD} +r ${WORKDIR}/var/spool/ftp/hidden
 	${TOOL_MAKEFS} -M ${FSSIZE} -m ${FSSIZE}			\
 	-B ${TARGET_ENDIANNESS}	\
-	-F ${WORKSPEC} -N ${WORKDIR}/etc\
+	-xx -F ${WORKSPEC} -N ${WORKDIR}/etc			\
 	${MAKEFS_TIMESTAMP}		\
 	${IMGMAKEFSOPTIONS}		\
 	${WORKFS} ${WORKDIR}



CVS commit: src/distrib/common

2024-05-16 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu May 16 15:46:42 UTC 2024

Modified Files:
src/distrib/common: Makefile.image
src/distrib/common/bootimage: Makefile.bootimage

Log Message:
Apply the -xx treatment to the rest of the ffs makefs invocations.


To generate a diff of this commit:
cvs rdiff -u -r1.41 -r1.42 src/distrib/common/Makefile.image
cvs rdiff -u -r1.35 -r1.36 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.



CVS commit: src/distrib/common

2024-05-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue May 14 17:17:13 UTC 2024

Modified Files:
src/distrib/common: Makefile.bootcd

Log Message:
check if the ${MACHINE} directory exists


To generate a diff of this commit:
cvs rdiff -u -r1.53 -r1.54 src/distrib/common/Makefile.bootcd

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/Makefile.bootcd
diff -u src/distrib/common/Makefile.bootcd:1.53 src/distrib/common/Makefile.bootcd:1.54
--- src/distrib/common/Makefile.bootcd:1.53	Tue May 14 10:58:05 2024
+++ src/distrib/common/Makefile.bootcd	Tue May 14 13:17:13 2024
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.bootcd,v 1.53 2024/05/14 14:58:05 christos Exp $
+#	$NetBSD: Makefile.bootcd,v 1.54 2024/05/14 17:17:13 christos Exp $
 #
 # Makefile snipped to create a CD/DVD ISO
 #
@@ -324,7 +324,7 @@ image:
 .endif
 	if [ ! -s ${WORKSPEC} ]; then \
 	${MAKESPEC} -d cdrom . > ${WORKSPEC}; \
-	else \
+	elif [ -d cdrom/${MACHINE} ]; then \
 	${MAKESPEC} -d cdrom ${MACHINE} >> ${WORKSPEC}; \
 	fi
 	${TOOL_MAKEFS} -N ${NETBSDSRCDIR}/etc -t cd9660 -F ${WORKSPEC} -xx \



CVS commit: src/distrib/common

2024-05-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue May 14 17:17:13 UTC 2024

Modified Files:
src/distrib/common: Makefile.bootcd

Log Message:
check if the ${MACHINE} directory exists


To generate a diff of this commit:
cvs rdiff -u -r1.53 -r1.54 src/distrib/common/Makefile.bootcd

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/distrib/common

2024-05-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue May 14 14:58:05 UTC 2024

Modified Files:
src/distrib/common: Makefile.bootcd

Log Message:
Put back -xx (this will break some archs but we'll fix them) and automatically
generate the spec for the machine-specific portions of the cdrom.


To generate a diff of this commit:
cvs rdiff -u -r1.52 -r1.53 src/distrib/common/Makefile.bootcd

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/distrib/common

2024-05-14 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue May 14 14:58:05 UTC 2024

Modified Files:
src/distrib/common: Makefile.bootcd

Log Message:
Put back -xx (this will break some archs but we'll fix them) and automatically
generate the spec for the machine-specific portions of the cdrom.


To generate a diff of this commit:
cvs rdiff -u -r1.52 -r1.53 src/distrib/common/Makefile.bootcd

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/Makefile.bootcd
diff -u src/distrib/common/Makefile.bootcd:1.52 src/distrib/common/Makefile.bootcd:1.53
--- src/distrib/common/Makefile.bootcd:1.52	Thu May  9 12:09:03 2024
+++ src/distrib/common/Makefile.bootcd	Tue May 14 10:58:05 2024
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.bootcd,v 1.52 2024/05/09 16:09:03 christos Exp $
+#	$NetBSD: Makefile.bootcd,v 1.53 2024/05/14 14:58:05 christos Exp $
 #
 # Makefile snipped to create a CD/DVD ISO
 #
@@ -285,7 +285,7 @@ copy-releasedir:
 	fi;\
 	${CDSETSCMD} ./maketars -i "${CUROBJDIR}/cdrom"			\
 	${CD_METALOG.unpriv} ${mtunpriv} -N ${NETBSDSRCDIR}/etc	\
-	-F "${CUROBJDIR}/cdrom/etc/mtree" \
+	-xx -F "${CUROBJDIR}/cdrom/etc/mtree" 			\
 	-d "${DESTDIR:S,^$,/,}" ${set}
 .endfor
 	if [ -d "${CUROBJDIR}/cdrom/var/spool/ftp/hidden" ]; then	\
@@ -322,8 +322,12 @@ image:
 .if defined(SPEC_EXTRA)
 	cat ${SPEC_EXTRA} >> ${WORKSPEC}
 .endif
-	if [ ! -s ${WORKSPEC} ]; then ${MAKESPEC} cdrom > ${WORKSPEC}; fi
-	${TOOL_MAKEFS} -N ${NETBSDSRCDIR}/etc -t cd9660 -F ${WORKSPEC} \
+	if [ ! -s ${WORKSPEC} ]; then \
+	${MAKESPEC} -d cdrom . > ${WORKSPEC}; \
+	else \
+	${MAKESPEC} -d cdrom ${MACHINE} >> ${WORKSPEC}; \
+	fi
+	${TOOL_MAKEFS} -N ${NETBSDSRCDIR}/etc -t cd9660 -F ${WORKSPEC} -xx \
 	${MAKEFS_TIMESTAMP} ${CDMAKEFSEXTRAOPTS} -o ${_CDMAKEFSOPTIONS:Q} \
 	${CDIMAGE} cdrom
 



Re: CVS commit: src/distrib/common

2024-05-09 Thread Robert Elz
Date:Thu, 9 May 2024 17:44:16 -0400
From:Christos Zoulas 
Message-ID:  <9c618434-9d7b-4f1c-97ed-3260b7f36...@zoulas.com>

  | I am not sure either but the resulting cd does not boot anymore.

Which version?   It has been a long time since I needed to boot
from an optical drive, but I could try it.

Its a little hard to believe that the uid/gid settings could make
any difference, though the m9de settings might.

kre


Re: CVS commit: src/distrib/common

2024-05-09 Thread Christos Zoulas



> On May 9, 2024, at 5:37 PM, Robert Elz  wrote:
> 
> Date:Thu, 9 May 2024 12:09:03 -0400
>From:"Christos Zoulas" 
>Message-ID:  <20240509160903.6e41bf...@cvs.netbsd.org>
> 
>  | Instead of augmenting the platform spec with an autogenerated one,
>  | we should understand why we have missing entries in the first place.
> 
> Is it really important?   Everything was fine without it previously,
> except that reproducible builds, weren't (as local info was being
> used in the CD images).
> 
> As long as the "augmenting" is just providing info for files that
> weren't otherwise specified (an issue I admit to not checking in the
> change I made) - that is, as long as makefs takes the first entry in
> the spec file it is given, should there be more than one for a file
> (if it prefers to use the last, then that would just change the order
> in which the augmentation file is included, no need to change makefs)
> then I'm not really sure what the problem is.

I am not sure either but the resulting cd does not boot anymore. I am trying to 
understand why. If augmenting works as you describe, there is more problem...

christos
> 
> That is, I don't see we need to add yet another manual maintenance step
> that we need to make in order to add or remove a file from a CD image
> (or whatever the image is destined for) when the information being added
> isn't really important - but just needs to be consistent.
> 
> kre



Re: CVS commit: src/distrib/common

2024-05-09 Thread Robert Elz
Date:Thu, 9 May 2024 12:09:03 -0400
From:"Christos Zoulas" 
Message-ID:  <20240509160903.6e41bf...@cvs.netbsd.org>

  | Instead of augmenting the platform spec with an autogenerated one,
  | we should understand why we have missing entries in the first place.

Is it really important?   Everything was fine without it previously,
except that reproducible builds, weren't (as local info was being
used in the CD images).

As long as the "augmenting" is just providing info for files that
weren't otherwise specified (an issue I admit to not checking in the
change I made) - that is, as long as makefs takes the first entry in
the spec file it is given, should there be more than one for a file
(if it prefers to use the last, then that would just change the order
in which the augmentation file is included, no need to change makefs)
then I'm not really sure what the problem is.

That is, I don't see we need to add yet another manual maintenance step
that we need to make in order to add or remove a file from a CD image
(or whatever the image is destined for) when the information being added
isn't really important - but just needs to be consistent.

kre



CVS commit: src/distrib/common

2024-05-09 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu May  9 16:09:03 UTC 2024

Modified Files:
src/distrib/common: Makefile.bootcd

Log Message:
Remove the -xx, now we have the list of 20 platforms that have incomplete
fspecs. Instead of augmenting the platform spec with an autogenerated one,
we should understand why we have missing entries in the first place.


To generate a diff of this commit:
cvs rdiff -u -r1.51 -r1.52 src/distrib/common/Makefile.bootcd

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/distrib/common

2024-05-09 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu May  9 16:09:03 UTC 2024

Modified Files:
src/distrib/common: Makefile.bootcd

Log Message:
Remove the -xx, now we have the list of 20 platforms that have incomplete
fspecs. Instead of augmenting the platform spec with an autogenerated one,
we should understand why we have missing entries in the first place.


To generate a diff of this commit:
cvs rdiff -u -r1.51 -r1.52 src/distrib/common/Makefile.bootcd

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/Makefile.bootcd
diff -u src/distrib/common/Makefile.bootcd:1.51 src/distrib/common/Makefile.bootcd:1.52
--- src/distrib/common/Makefile.bootcd:1.51	Wed May  8 23:41:05 2024
+++ src/distrib/common/Makefile.bootcd	Thu May  9 12:09:03 2024
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.bootcd,v 1.51 2024/05/09 03:41:05 kre Exp $
+#	$NetBSD: Makefile.bootcd,v 1.52 2024/05/09 16:09:03 christos Exp $
 #
 # Makefile snipped to create a CD/DVD ISO
 #
@@ -285,7 +285,7 @@ copy-releasedir:
 	fi;\
 	${CDSETSCMD} ./maketars -i "${CUROBJDIR}/cdrom"			\
 	${CD_METALOG.unpriv} ${mtunpriv} -N ${NETBSDSRCDIR}/etc	\
-	-F "${CUROBJDIR}/cdrom/etc/mtree" -xx			\
+	-F "${CUROBJDIR}/cdrom/etc/mtree" \
 	-d "${DESTDIR:S,^$,/,}" ${set}
 .endfor
 	if [ -d "${CUROBJDIR}/cdrom/var/spool/ftp/hidden" ]; then	\
@@ -322,8 +322,8 @@ image:
 .if defined(SPEC_EXTRA)
 	cat ${SPEC_EXTRA} >> ${WORKSPEC}
 .endif
-	${MAKESPEC} cdrom >> ${WORKSPEC}
-	${TOOL_MAKEFS} -N ${NETBSDSRCDIR}/etc -t cd9660 -F ${WORKSPEC} -xx \
+	if [ ! -s ${WORKSPEC} ]; then ${MAKESPEC} cdrom > ${WORKSPEC}; fi
+	${TOOL_MAKEFS} -N ${NETBSDSRCDIR}/etc -t cd9660 -F ${WORKSPEC} \
 	${MAKEFS_TIMESTAMP} ${CDMAKEFSEXTRAOPTS} -o ${_CDMAKEFSOPTIONS:Q} \
 	${CDIMAGE} cdrom
 



CVS commit: src/distrib/common

2024-05-08 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Thu May  9 03:41:05 UTC 2024

Modified Files:
src/distrib/common: Makefile.bootcd

Log Message:
No point testing if the spec file is empty before running makespec,
the previous commands guarantee that cannot be the case, so makespec
was never being run.   Just run it unconditionally.

Seems to fix the build for me.


To generate a diff of this commit:
cvs rdiff -u -r1.50 -r1.51 src/distrib/common/Makefile.bootcd

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/distrib/common

2024-05-08 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Thu May  9 03:41:05 UTC 2024

Modified Files:
src/distrib/common: Makefile.bootcd

Log Message:
No point testing if the spec file is empty before running makespec,
the previous commands guarantee that cannot be the case, so makespec
was never being run.   Just run it unconditionally.

Seems to fix the build for me.


To generate a diff of this commit:
cvs rdiff -u -r1.50 -r1.51 src/distrib/common/Makefile.bootcd

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/Makefile.bootcd
diff -u src/distrib/common/Makefile.bootcd:1.50 src/distrib/common/Makefile.bootcd:1.51
--- src/distrib/common/Makefile.bootcd:1.50	Wed May  8 16:08:08 2024
+++ src/distrib/common/Makefile.bootcd	Thu May  9 03:41:05 2024
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.bootcd,v 1.50 2024/05/08 16:08:08 christos Exp $
+#	$NetBSD: Makefile.bootcd,v 1.51 2024/05/09 03:41:05 kre Exp $
 #
 # Makefile snipped to create a CD/DVD ISO
 #
@@ -322,7 +322,7 @@ image:
 .if defined(SPEC_EXTRA)
 	cat ${SPEC_EXTRA} >> ${WORKSPEC}
 .endif
-	if [ ! -s ${WORKSPEC} ]; then ${MAKESPEC} cdrom > ${WORKSPEC}; fi
+	${MAKESPEC} cdrom >> ${WORKSPEC}
 	${TOOL_MAKEFS} -N ${NETBSDSRCDIR}/etc -t cd9660 -F ${WORKSPEC} -xx \
 	${MAKEFS_TIMESTAMP} ${CDMAKEFSEXTRAOPTS} -o ${_CDMAKEFSOPTIONS:Q} \
 	${CDIMAGE} cdrom



CVS commit: src/distrib/common

2024-05-08 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed May  8 16:08:08 UTC 2024

Modified Files:
src/distrib/common: Makefile.bootcd

Log Message:
Fail on incomplete mtree specs


To generate a diff of this commit:
cvs rdiff -u -r1.49 -r1.50 src/distrib/common/Makefile.bootcd

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/Makefile.bootcd
diff -u src/distrib/common/Makefile.bootcd:1.49 src/distrib/common/Makefile.bootcd:1.50
--- src/distrib/common/Makefile.bootcd:1.49	Tue May  7 16:33:20 2024
+++ src/distrib/common/Makefile.bootcd	Wed May  8 12:08:08 2024
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.bootcd,v 1.49 2024/05/07 20:33:20 christos Exp $
+#	$NetBSD: Makefile.bootcd,v 1.50 2024/05/08 16:08:08 christos Exp $
 #
 # Makefile snipped to create a CD/DVD ISO
 #
@@ -285,7 +285,7 @@ copy-releasedir:
 	fi;\
 	${CDSETSCMD} ./maketars -i "${CUROBJDIR}/cdrom"			\
 	${CD_METALOG.unpriv} ${mtunpriv} -N ${NETBSDSRCDIR}/etc	\
-	-F "${CUROBJDIR}/cdrom/etc/mtree"\
+	-F "${CUROBJDIR}/cdrom/etc/mtree" -xx			\
 	-d "${DESTDIR:S,^$,/,}" ${set}
 .endfor
 	if [ -d "${CUROBJDIR}/cdrom/var/spool/ftp/hidden" ]; then	\
@@ -323,8 +323,9 @@ image:
 	cat ${SPEC_EXTRA} >> ${WORKSPEC}
 .endif
 	if [ ! -s ${WORKSPEC} ]; then ${MAKESPEC} cdrom > ${WORKSPEC}; fi
-	${TOOL_MAKEFS} -N ${NETBSDSRCDIR}/etc -t cd9660 -F ${WORKSPEC} 	\
-		${MAKEFS_TIMESTAMP} ${CDMAKEFSEXTRAOPTS} -o ${_CDMAKEFSOPTIONS:Q} ${CDIMAGE} cdrom
+	${TOOL_MAKEFS} -N ${NETBSDSRCDIR}/etc -t cd9660 -F ${WORKSPEC} -xx \
+	${MAKEFS_TIMESTAMP} ${CDMAKEFSEXTRAOPTS} -o ${_CDMAKEFSOPTIONS:Q} \
+	${CDIMAGE} cdrom
 
 .if ${CDRELEASE} == false
 release: prepare .WAIT prepare_md_post .WAIT copy-releasedir .WAIT image_md_pre .WAIT image .WAIT image_md_post



CVS commit: src/distrib/common

2024-05-08 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed May  8 16:08:08 UTC 2024

Modified Files:
src/distrib/common: Makefile.bootcd

Log Message:
Fail on incomplete mtree specs


To generate a diff of this commit:
cvs rdiff -u -r1.49 -r1.50 src/distrib/common/Makefile.bootcd

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/distrib/common

2024-05-07 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue May  7 20:33:20 UTC 2024

Modified Files:
src/distrib/common: Makefile.bootcd

Log Message:
PR/58196: Jan-Benedict Glaw: If there was no spec file specified, generate
one on the fly. Should fix reproducible builds where the mode and the
ownership/group is not fixed and picked up from the filesystem.


To generate a diff of this commit:
cvs rdiff -u -r1.48 -r1.49 src/distrib/common/Makefile.bootcd

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/distrib/common

2024-05-07 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue May  7 20:33:20 UTC 2024

Modified Files:
src/distrib/common: Makefile.bootcd

Log Message:
PR/58196: Jan-Benedict Glaw: If there was no spec file specified, generate
one on the fly. Should fix reproducible builds where the mode and the
ownership/group is not fixed and picked up from the filesystem.


To generate a diff of this commit:
cvs rdiff -u -r1.48 -r1.49 src/distrib/common/Makefile.bootcd

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/Makefile.bootcd
diff -u src/distrib/common/Makefile.bootcd:1.48 src/distrib/common/Makefile.bootcd:1.49
--- src/distrib/common/Makefile.bootcd:1.48	Thu Apr 25 07:56:51 2024
+++ src/distrib/common/Makefile.bootcd	Tue May  7 16:33:20 2024
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.bootcd,v 1.48 2024/04/25 11:56:51 nia Exp $
+#	$NetBSD: Makefile.bootcd,v 1.49 2024/05/07 20:33:20 christos Exp $
 #
 # Makefile snipped to create a CD/DVD ISO
 #
@@ -106,6 +106,7 @@ _CDMAKEFSOPTIONS=	rockridge,label=${ISO_
 MAKEFS_TIMESTAMP=-T "${MKREPRO_TIMESTAMP}"
 PAX_TIMESTAMP=--timestamp "${MKREPRO_TIMESTAMP}"
 .endif
+MAKESPEC=	${HOST_SH} ${NETBSDSRCDIR}/etc/makespec
 
 .if ${MKUNPRIVED} == "no"
 CD_METALOG.unpriv=
@@ -321,8 +322,8 @@ image:
 .if defined(SPEC_EXTRA)
 	cat ${SPEC_EXTRA} >> ${WORKSPEC}
 .endif
-	if [ -s ${WORKSPEC} ]; then specarg="-F ${WORKSPEC}"; fi;	\
-	${TOOL_MAKEFS} -N ${NETBSDSRCDIR}/etc -t cd9660 $${specarg} 	\
+	if [ ! -s ${WORKSPEC} ]; then ${MAKESPEC} cdrom > ${WORKSPEC}; fi
+	${TOOL_MAKEFS} -N ${NETBSDSRCDIR}/etc -t cd9660 -F ${WORKSPEC} 	\
 		${MAKEFS_TIMESTAMP} ${CDMAKEFSEXTRAOPTS} -o ${_CDMAKEFSOPTIONS:Q} ${CDIMAGE} cdrom
 
 .if ${CDRELEASE} == false



CVS commit: src/distrib/common

2024-04-23 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Apr 23 21:58:57 UTC 2024

Modified Files:
src/distrib/common: Makefile.mdset

Log Message:
`nm`: Generate a stable symbol table (Jan-Benedict Glaw)

Release artifacts may contain symbol lists. Binutils's `nm` sorts them by
symbol name, locale based. Inserting a plain `sort` (with `LC_ALL=C`) here
sorts them by address, and (with several symbols pointing to the same address)
sorting by name is also stable (think of embedded '_'.)


To generate a diff of this commit:
cvs rdiff -u -r1.46 -r1.47 src/distrib/common/Makefile.mdset

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/Makefile.mdset
diff -u src/distrib/common/Makefile.mdset:1.46 src/distrib/common/Makefile.mdset:1.47
--- src/distrib/common/Makefile.mdset:1.46	Mon Aug 12 04:04:28 2019
+++ src/distrib/common/Makefile.mdset	Tue Apr 23 17:58:57 2024
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.mdset,v 1.46 2019/08/12 08:04:28 martin Exp $
+#	$NetBSD: Makefile.mdset,v 1.47 2024/04/23 21:58:57 christos Exp $
 #
 # Makefile snippet to ${TOOL_MDSETIMAGE} file system images into kernels
 #
@@ -149,7 +149,7 @@ ${_KERNEL.${_K}.${_F}}: .NOTMAIN ${_KERN
 	${TOOL_MDSETIMAGE} ${MDSETIMAGEFLAGS} ${.TARGET}.tmp ${_I}
 .endif
 .if !defined(MDSET_NOSYMBOLS.${_FILENAME}) && !defined(MDSET_NOSYMBOLS)
-	${NM} ${.TARGET}.tmp | ${TOOL_GZIP_N} -9 > ${.TARGET}.symbols.gz
+	${NM} ${.TARGET}.tmp | LC_ALL=C sort | ${TOOL_GZIP_N} -9 > ${.TARGET}.symbols.gz
 .endif
 .if !defined(MDSET_NOSTRIP.${_FILENAME}) && !defined(MDSET_NOSTRIP)
 	${STRIP} -R .eh_frame -R .eh_frame_hdr -R .comment -R .ident ${MDSET_STRIPSECTIONS} ${.TARGET}.tmp



CVS commit: src/distrib/common

2024-04-23 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Apr 23 21:58:57 UTC 2024

Modified Files:
src/distrib/common: Makefile.mdset

Log Message:
`nm`: Generate a stable symbol table (Jan-Benedict Glaw)

Release artifacts may contain symbol lists. Binutils's `nm` sorts them by
symbol name, locale based. Inserting a plain `sort` (with `LC_ALL=C`) here
sorts them by address, and (with several symbols pointing to the same address)
sorting by name is also stable (think of embedded '_'.)


To generate a diff of this commit:
cvs rdiff -u -r1.46 -r1.47 src/distrib/common/Makefile.mdset

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/distrib/common

2024-04-16 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Apr 16 23:40:36 UTC 2024

Modified Files:
src/distrib/common: parselist.awk

Log Message:
Set LC_ALL=C before calling sort so that it works consistently. Unfortunately
ENVIRON["LC_ALL"] = "C"; does not work like in gawk (Jan-Benedict Glaw)


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/distrib/common/parselist.awk

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/distrib/common

2024-04-16 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Apr 16 23:40:36 UTC 2024

Modified Files:
src/distrib/common: parselist.awk

Log Message:
Set LC_ALL=C before calling sort so that it works consistently. Unfortunately
ENVIRON["LC_ALL"] = "C"; does not work like in gawk (Jan-Benedict Glaw)


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/distrib/common/parselist.awk

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/parselist.awk
diff -u src/distrib/common/parselist.awk:1.16 src/distrib/common/parselist.awk:1.17
--- src/distrib/common/parselist.awk:1.16	Fri Apr 10 12:16:12 2009
+++ src/distrib/common/parselist.awk	Tue Apr 16 19:40:36 2024
@@ -1,4 +1,4 @@
-#	$NetBSD: parselist.awk,v 1.16 2009/04/10 16:16:12 apb Exp $
+#	$NetBSD: parselist.awk,v 1.17 2024/04/16 23:40:36 christos Exp $
 #
 # Copyright (c) 2002 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -177,7 +177,7 @@ $1 == "COPYDIR" \
 	destdir=$3;
 	if (mode == "mtree") {
 		printf("./%s type=dir mode=755\n", destdir);
-		command="cd " srcdir " && find . -type d -print"
+		command="cd " srcdir " && find . -type d -print | LC_ALL=C sort"
 		while (command | getline dir) {
 			gsub(/^\.\//, "", dir);
 			if (dir == ".")
@@ -187,7 +187,7 @@ $1 == "COPYDIR" \
 		close(command);
 	}
 	if (mode == "install" || mode == "mtree" || mode == "populate") {
-		command="cd " srcdir " && find . -type f -print"
+		command="cd " srcdir " && find . -type f -print | LC_ALL=C sort"
 		while (command | getline srcfile) {
 			gsub(/^\.\//, "", srcfile);
 			copy(srcdir "/" srcfile, destdir "/" srcfile, "");



CVS commit: src/distrib/common

2024-03-19 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Mar 20 00:31:54 UTC 2024

Modified Files:
src/distrib/common: Makefile.image

Log Message:
Fix reproducible builds (Jan-Benedict Glaw)


To generate a diff of this commit:
cvs rdiff -u -r1.40 -r1.41 src/distrib/common/Makefile.image

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/distrib/common

2024-03-19 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Mar 20 00:31:54 UTC 2024

Modified Files:
src/distrib/common: Makefile.image

Log Message:
Fix reproducible builds (Jan-Benedict Glaw)


To generate a diff of this commit:
cvs rdiff -u -r1.40 -r1.41 src/distrib/common/Makefile.image

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/Makefile.image
diff -u src/distrib/common/Makefile.image:1.40 src/distrib/common/Makefile.image:1.41
--- src/distrib/common/Makefile.image:1.40	Fri Feb 10 22:07:06 2017
+++ src/distrib/common/Makefile.image	Tue Mar 19 20:31:54 2024
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.image,v 1.40 2017/02/11 03:07:06 christos Exp $
+#	$NetBSD: Makefile.image,v 1.41 2024/03/20 00:31:54 christos Exp $
 #
 # Makefile snippet to build a tree from the provided lists,
 # and make an ffs file system image from that tree
@@ -39,13 +39,14 @@ WORKBUILT?=	work.built
 
 PARSELISTENV+=	TARGETDIR=${.OBJDIR}/${WORKDIR:Q}
 
-GZIP_FLAGS= -9 ${GZIP_N_FLAG}
-
 .if ${MKREPRO_TIMESTAMP:Uno} != "no"
 MAKEFS_TIMESTAMP=-T "${MKREPRO_TIMESTAMP}"
 PAX_TIMESTAMP=--timestamp "${MKREPRO_TIMESTAMP}"
+GZIP_N_FLAG=-n
 .endif
 
+GZIP_FLAGS= -9 ${GZIP_N_FLAG}
+
 .if !target(${WORKBUILT})	# {
 ${WORKBUILT}: ${IMAGEDEPENDS} ${WORKSPEC} ${PARSELISTDEP} ${LISTS}
 #	There is a .PHONY ${CRUNCHBIN}, so check if out of date by hand



CVS commit: src/distrib/common/bootimage

2024-02-08 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Feb  8 18:14:02 UTC 2024

Modified Files:
src/distrib/common/bootimage: Makefile.bootimage

Log Message:
PR/57910: Jan-Benedict Glaw: Fix typo preventing reproducible builds


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 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.32 src/distrib/common/bootimage/Makefile.bootimage:1.33
--- src/distrib/common/bootimage/Makefile.bootimage:1.32	Sun Dec  3 02:20:23 2023
+++ src/distrib/common/bootimage/Makefile.bootimage	Thu Feb  8 13:14:02 2024
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.bootimage,v 1.32 2023/12/03 07:20:23 tsutsui Exp $
+#	$NetBSD: Makefile.bootimage,v 1.33 2024/02/08 18:14:02 christos Exp $
 #
 # Copyright (c) 2009, 2010, 2011 Izumi Tsutsui.  All rights reserved.
 #
@@ -235,8 +235,8 @@ FSCYLINDERS!=	expr ${FSSECTORS} / \( ${H
 SWAPCYLINDERS!=	expr ${SWAPSECTORS} / \( ${HEADS} \* ${SECTORS} \) || true
 
 .if ${USE_GPT} != "no"
-BOOTDISK_UUID=`${TOOL_GPT} ${GPT_TIMESSTAMP} ${WORKMBR} show -i 2 | ${TOOL_AWK} '/^GUID/ {print $$2}'`
-SWAPDISK_UUID=`${TOOL_GPT} ${GPT_TIMESSTAMP} ${WORKMBR} show -i 3 | ${TOOL_AWK} '/^GUID/ {print $$2}'`
+BOOTDISK_UUID=`${TOOL_GPT} ${GPT_TIMESTAMP} ${WORKMBR} show -i 2 | ${TOOL_AWK} '/^GUID/ {print $$2}'`
+SWAPDISK_UUID=`${TOOL_GPT} ${GPT_TIMESTAMP} ${WORKMBR} show -i 3 | ${TOOL_AWK} '/^GUID/ {print $$2}'`
 .endif
 
 #
@@ -525,11 +525,11 @@ ${WORKMBR}:
 	@echo creating GPT header and partition entries...
 	${RM} -f ${WORKMBR}
 	${DD} if=/dev/zero of=${WORKMBR} seek=$$((${IMAGESECTORS} - 1)) count=1
-	${TOOL_GPT} ${GPT_TIMESSTAMP} ${WORKMBR} create
-	${TOOL_GPT} ${GPT_TIMESSTAMP} ${WORKMBR} add -a 1m -s ${EFISECTORS} -t efi -l "EFI system"
-	${TOOL_GPT} ${GPT_TIMESSTAMP} ${WORKMBR} add -a 1m -s ${FSSECTORS} -t ffs
+	${TOOL_GPT} ${GPT_TIMESTAMP} ${WORKMBR} create
+	${TOOL_GPT} ${GPT_TIMESTAMP} ${WORKMBR} add -a 1m -s ${EFISECTORS} -t efi -l "EFI system"
+	${TOOL_GPT} ${GPT_TIMESTAMP} ${WORKMBR} add -a 1m -s ${FSSECTORS} -t ffs
 .  if ${SWAPSECTORS} != 0
-	${TOOL_GPT} ${GPT_TIMESSTAMP} ${WORKMBR} add -a 1m -s ${SWAPSECTORS} -t swap
+	${TOOL_GPT} ${GPT_TIMESTAMP} ${WORKMBR} add -a 1m -s ${SWAPSECTORS} -t swap
 .  endif
 .elif ${USE_MBR} != "no"
 	@echo creating MBR labels...
@@ -584,10 +584,10 @@ ${IMGBASE}.img:	${TARGET_BLOCKS}
 	${CAT} ${TARGET_BLOCKS} > ${WORKIMG}
 .if ${USE_GPT} != "no"
 .if ${USE_GPTMBR} != "no"
-	${TOOL_GPT} ${GPT_TIMESSTAMP} ${WORKIMG} biosboot -i 2		\
+	${TOOL_GPT} ${GPT_TIMESTAMP} ${WORKIMG} biosboot -i 2		\
 	-c ${.OBJDIR}/${WORKDIR}/usr/mdec/gptmbr.bin
 .endif
-	${TOOL_GPT} ${GPT_TIMESSTAMP} ${WORKIMG} set -a bootme -i 2
+	${TOOL_GPT} ${GPT_TIMESTAMP} ${WORKIMG} set -a bootme -i 2
 .endif	# USE_GPT != "no"
 .if ${USE_SUNLABEL} != "no"
 	@echo Creating sun disklabel...



CVS commit: src/distrib/common/bootimage

2024-02-08 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Feb  8 18:14:02 UTC 2024

Modified Files:
src/distrib/common/bootimage: Makefile.bootimage

Log Message:
PR/57910: Jan-Benedict Glaw: Fix typo preventing reproducible builds


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 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.



CVS commit: src/distrib/common/bootimage

2023-12-02 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sun Dec  3 07:20:23 UTC 2023

Modified Files:
src/distrib/common/bootimage: Makefile.bootimage

Log Message:
Use defined ${GPTSECTORS} rather than hardcoded 2048.


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 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.31 src/distrib/common/bootimage/Makefile.bootimage:1.32
--- src/distrib/common/bootimage/Makefile.bootimage:1.31	Sun Dec  3 07:17:11 2023
+++ src/distrib/common/bootimage/Makefile.bootimage	Sun Dec  3 07:20:23 2023
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.bootimage,v 1.31 2023/12/03 07:17:11 tsutsui Exp $
+#	$NetBSD: Makefile.bootimage,v 1.32 2023/12/03 07:20:23 tsutsui Exp $
 #
 # Copyright (c) 2009, 2010, 2011 Izumi Tsutsui.  All rights reserved.
 #
@@ -573,8 +573,8 @@ ${WORKMBR}:
 
 ${WORKGPT}: ${WORKMBR}
 	@echo create GPT image...
-	${DD} if=${WORKMBR} of=${WORKGPT} skip=$$((${IMAGESECTORS} - 2048)) \
-	count=2048
+	${DD} if=${WORKMBR} of=${WORKGPT} \
+	skip=$$((${IMAGESECTORS} - ${GPTSECTORS})) count=${GPTSECTORS}
 
 .if ${USE_GPT} == "no"
 ${IMGBASE}.img:	${WORKLABEL}



CVS commit: src/distrib/common/bootimage

2023-12-02 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sun Dec  3 07:20:23 UTC 2023

Modified Files:
src/distrib/common/bootimage: Makefile.bootimage

Log Message:
Use defined ${GPTSECTORS} rather than hardcoded 2048.


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 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.



CVS commit: src/distrib/common/bootimage

2023-12-02 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sun Dec  3 07:17:11 UTC 2023

Modified Files:
src/distrib/common/bootimage: Makefile.bootimage

Log Message:
Document USE_GPTMBR and GPTSECTORS.


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 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.30 src/distrib/common/bootimage/Makefile.bootimage:1.31
--- src/distrib/common/bootimage/Makefile.bootimage:1.30	Sun May 15 00:05:24 2022
+++ src/distrib/common/bootimage/Makefile.bootimage	Sun Dec  3 07:17:11 2023
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.bootimage,v 1.30 2022/05/15 00:05:24 mrg Exp $
+#	$NetBSD: Makefile.bootimage,v 1.31 2023/12/03 07:17:11 tsutsui Exp $
 #
 # Copyright (c) 2009, 2010, 2011 Izumi Tsutsui.  All rights reserved.
 #
@@ -40,6 +40,10 @@
 #	USE_GPT
 #		set yes if target disk image requires GPT partition
 #		(default: no)
+#	USE_GPTMBR
+#		set yes if target disk image requires GPT partition
+#		with hybrid MBR boot code
+#		(default: no; valid only if USE_GPT=yes)
 #	MBR_BOOTCODE
 #		optional MBR bootcode which should be installed by fdisk(8)
 #		(default: empty)
@@ -66,6 +70,10 @@
 #	FATMB
 #		FAT partition size in target image in MB
 #		(default: 0)
+#	GPTSECTORS
+#		Size of a region reserved for the secondary GPT table/entry
+#		at the end of the target image in sectors
+#		(default: 2048 if USE_GPT=yes, otherwise 0)
 #	KERN_SET
 #		kernel set name which should be extracted into image
 #		(default: kern-GENERIC)



CVS commit: src/distrib/common/bootimage

2023-12-02 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sun Dec  3 07:17:11 UTC 2023

Modified Files:
src/distrib/common/bootimage: Makefile.bootimage

Log Message:
Document USE_GPTMBR and GPTSECTORS.


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 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.



CVS commit: src/distrib/common/bootimage

2023-01-29 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Sun Jan 29 22:12:25 UTC 2023

Modified Files:
src/distrib/common/bootimage: fstab.in

Log Message:
Make sure to mount /var/shm

Programs such as firefox seem to require it,
and this file is used by the live image as well.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/distrib/common/bootimage/fstab.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.3 src/distrib/common/bootimage/fstab.in:1.4
--- src/distrib/common/bootimage/fstab.in:1.3	Sat Dec 15 18:03:17 2018
+++ src/distrib/common/bootimage/fstab.in	Sun Jan 29 22:12:25 2023
@@ -1,5 +1,6 @@
-ROOT.a		/		ffs	rw		1 1
-ROOT.b		none		none	sw		0 0
-ptyfs		/dev/pts	ptyfs	rw		0 0
-kernfs		/kern		kernfs	rw,noauto	0 0
-procfs		/proc		procfs	rw,noauto	0 0
+ROOT.a		/		ffs	rw			1 1
+ROOT.b		none		none	sw			0 0
+ptyfs		/dev/pts	ptyfs	rw			0 0
+kernfs		/kern		kernfs	rw,noauto		0 0
+procfs		/proc		procfs	rw,noauto		0 0
+tmpfs		/var/shm	tmpfs	rw,-m1777,-sram%25	0 0



CVS commit: src/distrib/common/bootimage

2023-01-29 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Sun Jan 29 22:12:25 UTC 2023

Modified Files:
src/distrib/common/bootimage: fstab.in

Log Message:
Make sure to mount /var/shm

Programs such as firefox seem to require it,
and this file is used by the live image as well.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/distrib/common/bootimage/fstab.in

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



re: CVS commit: src/distrib/common/bootimage

2022-05-15 Thread matthew green
> > Module Name:src
> > Committed By:   mrg
> > Date:   Sun May 15 00:05:24 UTC 2022
> > 
> > Modified Files:
> > src/distrib/common/bootimage: Makefile.bootimage
> > 
> > Log Message:
> > allow some invocations of expr(1) to "fail" - expr(1) returns "1" is
> > the expression expands to "0" or empty, and sometimes these values end
> > up correctly being 0.
>
> Several values (SWAPSECTORS, EFISECTORS, FATSECTORS, and SWAPCYLINDERS)
> that couldbe zero already have '|| true'.  Should they be consistent?
> (I'm not sure if all should use strict '|| test $$? -eq 1 || exit 1')

i use the test -eq 1 method to only match the case expr(1)
exists due to "0" or "".  manual says:

The expr utility exits with one of the following values:
0   the expression is neither an empty string nor 0.
1   the expression is an empty string or 0.
2   the expression is invalid.
>2  an error occurred (such as memory allocation failure).

i kind of meant to fix the other uses too, thanks for
reminding me i wasn't done here :)


.mrg.


Re: CVS commit: src/distrib/common/bootimage

2022-05-15 Thread Izumi Tsutsui
mrg@ wrote:

> Module Name:  src
> Committed By: mrg
> Date: Sun May 15 00:05:24 UTC 2022
> 
> Modified Files:
>   src/distrib/common/bootimage: Makefile.bootimage
> 
> Log Message:
> allow some invocations of expr(1) to "fail" - expr(1) returns "1" is
> the expression expands to "0" or empty, and sometimes these values end
> up correctly being 0.

Several values (SWAPSECTORS, EFISECTORS, FATSECTORS, and SWAPCYLINDERS)
that couldbe zero already have '|| true'.  Should they be consistent?
(I'm not sure if all should use strict '|| test $$? -eq 1 || exit 1')

---
Izumi Tsutsui


CVS commit: src/distrib/common/bootimage

2022-05-14 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun May 15 00:05:24 UTC 2022

Modified Files:
src/distrib/common/bootimage: Makefile.bootimage

Log Message:
allow some invocations of expr(1) to "fail" - expr(1) returns "1" is
the expression expands to "0" or empty, and sometimes these values end
up correctly being 0.


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 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.29 src/distrib/common/bootimage/Makefile.bootimage:1.30
--- src/distrib/common/bootimage/Makefile.bootimage:1.29	Sat Sep 25 08:54:29 2021
+++ src/distrib/common/bootimage/Makefile.bootimage	Sun May 15 00:05:24 2022
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.bootimage,v 1.29 2021/09/25 08:54:29 maya Exp $
+#	$NetBSD: Makefile.bootimage,v 1.30 2022/05/15 00:05:24 mrg Exp $
 #
 # Copyright (c) 2009, 2010, 2011 Izumi Tsutsui.  All rights reserved.
 #
@@ -201,8 +201,8 @@ LABELSECTORS?=	2048	# 1MB aligned for mo
 .endif
 
 FSSECTORS!=	expr ${IMAGESECTORS} - ${SWAPSECTORS} - ${LABELSECTORS} \
-		- ${EFISECTORS} - ${GPTSECTORS} - ${FATSECTORS}
-FSSIZE!=	expr ${FSSECTORS} \* 512
+		- ${EFISECTORS} - ${GPTSECTORS} - ${FATSECTORS} || test $$? -eq 1 || exit 1
+FSSIZE!=	expr ${FSSECTORS} \* 512 || test $$? -eq 1 || exit 1
 
 # parameters for disklabel and MBR
 HEADS=		64
@@ -217,9 +217,9 @@ MBRFAT?=	6	# 16-bit FAT, more than 32M
 
 BSDPARTSECTORS!= expr ${IMAGESECTORS} - ${LABELSECTORS} \
 		- ${EFISECTORS} - ${GPTSECTORS} - ${FATSECTORS}
-FSOFFSET!=	expr ${LABELSECTORS} + ${EFISECTORS} + ${FATSECTORS}
+FSOFFSET!=	expr ${LABELSECTORS} + ${EFISECTORS} + ${FATSECTORS} || test $$? -eq 1 || exit 1
 SWAPOFFSET!=	expr ${LABELSECTORS} + ${FSSECTORS} \
-		+ ${EFISECTORS} + ${FATSECTORS}
+		+ ${EFISECTORS} + ${FATSECTORS} || test $$? -eq 1 || exit 1
 FATOFFSET=	${LABELSECTORS}
 
 # parameters for sunlabel



CVS commit: src/distrib/common/bootimage

2022-05-14 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun May 15 00:05:24 UTC 2022

Modified Files:
src/distrib/common/bootimage: Makefile.bootimage

Log Message:
allow some invocations of expr(1) to "fail" - expr(1) returns "1" is
the expression expands to "0" or empty, and sometimes these values end
up correctly being 0.


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 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.



Re: CVS commit: src/distrib/common/bootimage

2020-05-29 Thread Izumi Tsutsui
> Makefile.installimage refers to it before including Makefile.bootimage and 
> this test was causing make to throw an error:
> 
>
> https://nxr.netbsd.org/xref/src/distrib/common/bootimage/Makefile.installimage#41
> 
> All other users (i386, amd64) of Makefile.installimage explicitly set 
> USE_MBR=yes. That's why it wasn't an issue before now.

Ah, I see.  Sorry for a stupid question.

---
Izumi Tsutsui


Re: CVS commit: src/distrib/common/bootimage

2020-05-29 Thread Jared McNeill

On Fri, 29 May 2020, Izumi Tsutsui wrote:


src/distrib/common/bootimage/Makefile.bootimage (included from
Makefile.installimage) already has "USE_MBR?= no" line.


Makefile.installimage refers to it before including Makefile.bootimage and 
this test was causing make to throw an error:


  
https://nxr.netbsd.org/xref/src/distrib/common/bootimage/Makefile.installimage#41

All other users (i386, amd64) of Makefile.installimage explicitly set 
USE_MBR=yes. That's why it wasn't an issue before now.


Cheers,
Jared


Re: CVS commit: src/distrib/common/bootimage

2020-05-28 Thread Izumi Tsutsui
> Modified Files:
>   src/distrib/common/bootimage: Makefile.installimage
> 
> Log Message:
> Default USE_MBR to no

Is this necessary?

src/distrib/common/bootimage/Makefile.bootimage (included from
Makefile.installimage) already has "USE_MBR?= no" line.

---
Izumi Tsutsui


CVS commit: src/distrib/common

2019-11-21 Thread Alexander Nasonov
Module Name:src
Committed By:   alnsn
Date:   Fri Nov 22 00:27:30 UTC 2019

Modified Files:
src/distrib/common: cgdroot.rc

Log Message:
If gpt label "cgd.conf" contains a valid /etc/cgd file system,
try mounting gpt label "cgdroot" as a root filesystem first and
only mount /dev/cgd0a if that gpt label doesn't exist or fails
to mount.

XXX pullup to 8 and 9.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/distrib/common/cgdroot.rc

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/cgdroot.rc
diff -u src/distrib/common/cgdroot.rc:1.4 src/distrib/common/cgdroot.rc:1.5
--- src/distrib/common/cgdroot.rc:1.4	Sat Dec 29 13:09:35 2018
+++ src/distrib/common/cgdroot.rc	Fri Nov 22 00:27:30 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: cgdroot.rc,v 1.4 2018/12/29 13:09:35 alnsn Exp $
+#	$NetBSD: cgdroot.rc,v 1.5 2019/11/22 00:27:30 alnsn Exp $
 #
 # Copyright (c) 2013 Pierre Pronchery 
 # All rights reserved.
@@ -36,17 +36,20 @@ export EDITOR
 
 umask 022
 
-mounted=
+# Mount /etc/cgd.
+etc_cgd_mount=
 for dev in NAME=cgd.conf /dev/wd0a /dev/ld0a ; do
 	if mount -o ro $dev /etc/cgd 2>/dev/null ; then
-		mounted=$dev
+		etc_cgd_mount=$dev
 		break
 	fi
 done
-if [ -z "$mounted" ]; then
+if [ -z "${etc_cgd_mount}" ]; then
 	echo "Could not mount the boot partition" 1>&2
 	exit 2
 fi
+
+# Configure cgd device(s).
 /sbin/wsconsctl -d -w splash.enable=0 > /dev/null 2>&1
 cgdconfig -C
 if [ $? -ne 0 ]; then
@@ -54,13 +57,32 @@ if [ $? -ne 0 ]; then
 	umount /etc/cgd
 	exit 2
 fi
-mount -o ro /dev/cgd0a /altroot
-if [ $? -ne 0 ]; then
+
+# Select candidates for a root mount.
+root_mounts=
+if [ -z "${etc_cgd_mount##NAME=*}" ]; then
+	root_mounts="NAME=cgdroot /dev/cgd0a"
+else
+	root_mounts=/dev/cgd0a
+fi
+
+# Mount the root filesystem.
+mounted=
+for dev in ${root_mounts} ; do
+	if mount -o ro $dev /altroot 2>/dev/null ; then
+		mounted=$dev
+		break
+	fi
+done
+
+if [ -z "$mounted" ]; then
 	echo "Could not mount the root partition" 1>&2
 	cgdconfig -U
 	umount /etc/cgd
 	exit 2
 fi
+
+# Boot into /altroot.
 umount /etc/cgd
 /sbin/wsconsctl -d -w splash.enable=1 > /dev/null 2>&1
 sysctl -w init.root=/altroot



CVS commit: src/distrib/common

2019-11-21 Thread Alexander Nasonov
Module Name:src
Committed By:   alnsn
Date:   Fri Nov 22 00:27:30 UTC 2019

Modified Files:
src/distrib/common: cgdroot.rc

Log Message:
If gpt label "cgd.conf" contains a valid /etc/cgd file system,
try mounting gpt label "cgdroot" as a root filesystem first and
only mount /dev/cgd0a if that gpt label doesn't exist or fails
to mount.

XXX pullup to 8 and 9.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/distrib/common/cgdroot.rc

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/distrib/common

2019-08-11 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Aug 11 17:50:26 UTC 2019

Modified Files:
src/distrib/common: Makefile.mdset

Log Message:
Back out previous, it causes build fallout like:
release ===> etc/dreamcast/cdroms/installcd
shle--netbsdelf-install: .WAIT: stat: No such file or directory


To generate a diff of this commit:
cvs rdiff -u -r1.44 -r1.45 src/distrib/common/Makefile.mdset

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/distrib/common

2019-08-11 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Aug 11 17:50:26 UTC 2019

Modified Files:
src/distrib/common: Makefile.mdset

Log Message:
Back out previous, it causes build fallout like:
release ===> etc/dreamcast/cdroms/installcd
shle--netbsdelf-install: .WAIT: stat: No such file or directory


To generate a diff of this commit:
cvs rdiff -u -r1.44 -r1.45 src/distrib/common/Makefile.mdset

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/Makefile.mdset
diff -u src/distrib/common/Makefile.mdset:1.44 src/distrib/common/Makefile.mdset:1.45
--- src/distrib/common/Makefile.mdset:1.44	Sun Aug 11 13:55:18 2019
+++ src/distrib/common/Makefile.mdset	Sun Aug 11 17:50:26 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.mdset,v 1.44 2019/08/11 13:55:18 martin Exp $
+#	$NetBSD: Makefile.mdset,v 1.45 2019/08/11 17:50:26 martin Exp $
 #
 # Makefile snippet to ${TOOL_MDSETIMAGE} file system images into kernels
 #
@@ -103,9 +103,9 @@ ${_KERNEL.${_K}.${_F}}.${_S}: ${_KERNEL.
 .endif
 
 .if defined(MDSET_NOGZIP.${_FILENAME}) || defined(MDSET_NOGZIP)
-KERNELS+=	${_KERNEL.${_K}.${_F}}.${_S} .WAIT
+KERNELS+=	${_KERNEL.${_K}.${_F}}.${_S}
 .else			# {
-KERNELS+=	${_KERNEL.${_K}.${_F}}.${_S}.gz .WAIT
+KERNELS+=	${_KERNEL.${_K}.${_F}}.${_S}.gz
 
 ${_KERNEL.${_K}.${_F}}.${_S}.gz: ${_KERNEL.${_K}.${_F}}.${_S}
 	${_MKTARGET_CREATE}



CVS commit: src/distrib/common

2019-08-11 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Aug 11 13:55:18 UTC 2019

Modified Files:
src/distrib/common: Makefile.mdset

Log Message:
Various suffixes for the same kernel image may depend on each
other, so .WAIT after creating one before moving on to the next.
Case at hand: evbarm/installation/instkernel:
netbsd-RPI_INSTALL.bin needs to be complete before netbsd-RPI_INSTALL.img
can be created.
Better solutions welcome...


To generate a diff of this commit:
cvs rdiff -u -r1.43 -r1.44 src/distrib/common/Makefile.mdset

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/distrib/common

2019-08-11 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Aug 11 13:55:18 UTC 2019

Modified Files:
src/distrib/common: Makefile.mdset

Log Message:
Various suffixes for the same kernel image may depend on each
other, so .WAIT after creating one before moving on to the next.
Case at hand: evbarm/installation/instkernel:
netbsd-RPI_INSTALL.bin needs to be complete before netbsd-RPI_INSTALL.img
can be created.
Better solutions welcome...


To generate a diff of this commit:
cvs rdiff -u -r1.43 -r1.44 src/distrib/common/Makefile.mdset

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/Makefile.mdset
diff -u src/distrib/common/Makefile.mdset:1.43 src/distrib/common/Makefile.mdset:1.44
--- src/distrib/common/Makefile.mdset:1.43	Wed Feb  6 07:33:08 2019
+++ src/distrib/common/Makefile.mdset	Sun Aug 11 13:55:18 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.mdset,v 1.43 2019/02/06 07:33:08 mrg Exp $
+#	$NetBSD: Makefile.mdset,v 1.44 2019/08/11 13:55:18 martin Exp $
 #
 # Makefile snippet to ${TOOL_MDSETIMAGE} file system images into kernels
 #
@@ -103,9 +103,9 @@ ${_KERNEL.${_K}.${_F}}.${_S}: ${_KERNEL.
 .endif
 
 .if defined(MDSET_NOGZIP.${_FILENAME}) || defined(MDSET_NOGZIP)
-KERNELS+=	${_KERNEL.${_K}.${_F}}.${_S}
+KERNELS+=	${_KERNEL.${_K}.${_F}}.${_S} .WAIT
 .else			# {
-KERNELS+=	${_KERNEL.${_K}.${_F}}.${_S}.gz
+KERNELS+=	${_KERNEL.${_K}.${_F}}.${_S}.gz .WAIT
 
 ${_KERNEL.${_K}.${_F}}.${_S}.gz: ${_KERNEL.${_K}.${_F}}.${_S}
 	${_MKTARGET_CREATE}



Re: CVS commit: src/distrib/common

2019-01-02 Thread maya
On Wed, Jan 02, 2019 at 09:08:50PM +, Alexander Nasonov wrote:
> m...@netbsd.org wrote:
> > On Wed, Jan 02, 2019 at 08:42:33PM +, Alexander Nasonov wrote:
> > > https://wiki.netbsd.org/projects/project/transparent-cgd/
> > > 
> > > This page describes limitations of cgdroot.kmod.
> > > 
> > > In my opinion, aes-xts should be added to efi bootloader and paramsfile
> > > should be merged into boot.cfg.
> > 
> > If you aren't doing this, it's a *really* good beginner project.
> > Perhaps adjust the wiki page to be less exploratory and more with do
> > X,Y,Z and add it to the GSoC-able list?
> 
> Adding a cgd layer on top of ffs code in libsa isn't straightforward
> but it should be doable. It's also not clear to me how to pass a
> raw encryption key from the bootloader to the kernel but I'm not very
> familiar with that code. Overall it would be a good GCoC project.


We are passing things around with BI_ADD in the bootloader, and
lookup_btinfo in the kernel.


Re: CVS commit: src/distrib/common

2019-01-02 Thread Alexander Nasonov
m...@netbsd.org wrote:
> On Wed, Jan 02, 2019 at 08:42:33PM +, Alexander Nasonov wrote:
> > https://wiki.netbsd.org/projects/project/transparent-cgd/
> > 
> > This page describes limitations of cgdroot.kmod.
> > 
> > In my opinion, aes-xts should be added to efi bootloader and paramsfile
> > should be merged into boot.cfg.
> 
> If you aren't doing this, it's a *really* good beginner project.
> Perhaps adjust the wiki page to be less exploratory and more with do
> X,Y,Z and add it to the GSoC-able list?

Adding a cgd layer on top of ffs code in libsa isn't straightforward
but it should be doable. It's also not clear to me how to pass a
raw encryption key from the bootloader to the kernel but I'm not very
familiar with that code. Overall it would be a good GCoC project.

-- 
Alex


Re: CVS commit: src/distrib/common

2019-01-02 Thread maya
On Wed, Jan 02, 2019 at 08:42:33PM +, Alexander Nasonov wrote:
> Alexander Nasonov wrote:
> > m...@netbsd.org wrote:
> > > Why are we using a memory disk for full disk encryption? I am under the
> > > impression that it shouldn't be required.
> > 
> > We use a memory disk because cgdconfig functionality isn't available in
> > the bootloader.
> 
> https://wiki.netbsd.org/projects/project/transparent-cgd/
> 
> This page describes limitations of cgdroot.kmod.
> 
> In my opinion, aes-xts should be added to efi bootloader and paramsfile
> should be merged into boot.cfg.

If you aren't doing this, it's a *really* good beginner project.
Perhaps adjust the wiki page to be less exploratory and more with do
X,Y,Z and add it to the GSoC-able list?


Re: CVS commit: src/distrib/common

2019-01-02 Thread Alexander Nasonov
Alexander Nasonov wrote:
> m...@netbsd.org wrote:
> > Why are we using a memory disk for full disk encryption? I am under the
> > impression that it shouldn't be required.
> 
> We use a memory disk because cgdconfig functionality isn't available in
> the bootloader.

https://wiki.netbsd.org/projects/project/transparent-cgd/

This page describes limitations of cgdroot.kmod.

In my opinion, aes-xts should be added to efi bootloader and paramsfile
should be merged into boot.cfg.

-- 
Alex


Re: CVS commit: src/distrib/common

2018-12-29 Thread Alexander Nasonov
m...@netbsd.org wrote:
> Why are we using a memory disk for full disk encryption? I am under the
> impression that it shouldn't be required.

We use a memory disk because cgdconfig functionality isn't available in
the bootloader.

-- 
Alex


Re: CVS commit: src/distrib/common

2018-12-29 Thread maya
On Sat, Dec 29, 2018 at 11:28:38AM +, Alexander Nasonov wrote:
> Alexander Nasonov wrote:
> > Module Name:src
> > Committed By:   alnsn
> > Date:   Sat Dec 29 00:52:11 UTC 2018
> > 
> > Modified Files:
> > src/distrib/common: cgdroot.rc
> > 
> > Log Message:
> > Don't hardcode wd0a in cgdroot.kmod, try NAME=cgd.conf and ROOT.a.
> > 
> > +mounted=
> > +for dev in NAME=cgd.conf ROOT.a ; do
> > +   if mount -o ro $dev /etc/cgd 2>/dev/null ; then
> > +   mounted=$dev
> > +   fi
> > +done
> 
> I was a bit too fast to add the second probe. ROOT.a is always /dev/md0a
> when booted with 'load cgdroot.kmod'. I can't think of anything other
> than putting back /dev/wd0a and perhaps adding few more common disks
> like /dev/ld0a.
> 
> -- 
> Alex

Why are we using a memory disk for full disk encryption? I am under the
impression that it shouldn't be required.


Re: CVS commit: src/distrib/common

2018-12-29 Thread Alexander Nasonov
Alexander Nasonov wrote:
> Module Name:  src
> Committed By: alnsn
> Date: Sat Dec 29 00:52:11 UTC 2018
> 
> Modified Files:
>   src/distrib/common: cgdroot.rc
> 
> Log Message:
> Don't hardcode wd0a in cgdroot.kmod, try NAME=cgd.conf and ROOT.a.
> 
> +mounted=
> +for dev in NAME=cgd.conf ROOT.a ; do
> +   if mount -o ro $dev /etc/cgd 2>/dev/null ; then
> +   mounted=$dev
> +   fi
> +done

I was a bit too fast to add the second probe. ROOT.a is always /dev/md0a
when booted with 'load cgdroot.kmod'. I can't think of anything other
than putting back /dev/wd0a and perhaps adding few more common disks
like /dev/ld0a.

-- 
Alex


Re: CVS commit: src/distrib/common

2015-11-26 Thread Masao Uebayashi
With tarballs the latest timestamp of them, with source tree I don't know.
:)

I'm only pointing out an interesting, reasonable idea, not asking you to
implement it right now.

On Wednesday, 25 November 2015, Christos Zoulas  wrote:

> In article <
> cadbf7ee9mruyyct+97v1bjh_0nh9tqltr-rm5bprgl+knb2...@mail.gmail.com
> >,
> Masao Uebayashi  > wrote:
> >bapt@freebsd taught me that FreeBSD uses ((the newest timestamp in the
> >source files) + 1sec) in places where appropriate for reproducible
> >build.  It might have been about Ports, but idea is it.
>
> That's a nice way to do it. How do they compute that?
>
> christos
>
>


Re: CVS commit: src/distrib/common

2015-11-25 Thread Pierre Pronchery
On 11/25/15 08:54, Martin Husemann wrote:
> On Wed, Nov 25, 2015 at 01:30:37AM +, Christos Zoulas wrote:
>> In article 
>> ,
>> Masao Uebayashi   wrote:
>>> bapt@freebsd taught me that FreeBSD uses ((the newest timestamp in the
>>> source files) + 1sec) in places where appropriate for reproducible
>>> build.  It might have been about Ports, but idea is it.
>>
>> That's a nice way to do it. How do they compute that?
> 
> I disagree - it needs to be set manually (and documented in the release
> notes). The above could be the rule how releng manually sets it though.

The automatic approach is great because we don't want reproducible
builds only for releases. It can be documented for releases regardless.

-- 
khorben



Re: CVS commit: src/distrib/common

2015-11-25 Thread Martin Husemann
On Wed, Nov 25, 2015 at 11:17:27AM +0100, Pierre Pronchery wrote:
> The automatic approach is great because we don't want reproducible
> builds only for releases. It can be documented for releases regardless.

The automatic aproach relies on local file times in your source tree.
I don't see how that can usefully work if you want to reproduce a build
on a different machine later.

Having a tool to calculate the timestamp and invoking

 ./build.sh -V MKREPROTIME=$( $tooldir/bin/latest-plus-one-sec . )

is fine, of course (even better if $MKREPROTIME goes into BUILDINFO).
Then when trying to reproduce that build you grep the timestamp from
/etc/release and do

 ./build.sh -V MKREPROTIME=1448447287

and you don't have to play games with your filetimes.

The easiest way for freebsd (using subversion) is to check for
the timestamp of the latest subversion change on the current branch and use
that. However, that is not good for folks doing local MKREPRO builds.

Anyway, my point is: the information needs to be explicitly passed on
the build.sh command line. Calculating it automatically internaly is not
good.

Generating it (sensibly) for the command line optionally automatically of
course is fine.

Martin


Re: CVS commit: src/distrib/common

2015-11-25 Thread Joerg Sonnenberger
On Wed, Nov 25, 2015 at 11:32:58AM +0100, Martin Husemann wrote:
> On Wed, Nov 25, 2015 at 11:17:27AM +0100, Pierre Pronchery wrote:
> > The automatic approach is great because we don't want reproducible
> > builds only for releases. It can be documented for releases regardless.
> 
> The automatic aproach relies on local file times in your source tree.
> I don't see how that can usefully work if you want to reproduce a build
> on a different machine later.

Especially since the time stamps will be different for "cvs up" vs
"fresh cvs co".

Joerg


Re: CVS commit: src/distrib/common

2015-11-25 Thread Pierre Pronchery
On 11/25/15 12:00, Joerg Sonnenberger wrote:
> On Wed, Nov 25, 2015 at 11:32:58AM +0100, Martin Husemann wrote:
>> On Wed, Nov 25, 2015 at 11:17:27AM +0100, Pierre Pronchery wrote:
>>> The automatic approach is great because we don't want reproducible
>>> builds only for releases. It can be documented for releases regardless.
>>
>> The automatic aproach relies on local file times in your source tree.
>> I don't see how that can usefully work if you want to reproduce a build
>> on a different machine later.
> 
> Especially since the time stamps will be different for "cvs up" vs
> "fresh cvs co".

Yes that's right; and same thing with Git.

-- 
khorben



Re: CVS commit: src/distrib/common

2015-11-24 Thread Masao Uebayashi
bapt@freebsd taught me that FreeBSD uses ((the newest timestamp in the
source files) + 1sec) in places where appropriate for reproducible
build.  It might have been about Ports, but idea is it.

On Wed, Nov 25, 2015 at 9:50 AM, Christos Zoulas  wrote:
> Module Name:src
> Committed By:   christos
> Date:   Wed Nov 25 00:50:57 UTC 2015
>
> Modified Files:
> src/distrib/common: Makefile.bootcd
> src/distrib/common/bootimage: Makefile.bootimage
>
> Log Message:
> PR/50360: Thomas Klausner: if MKREPRO is set, provide a consistent timestamp
> for the files in the cdroms to be built. For now we copy the timestamp of
> . We could set an absolute timestamp too like -T 0 for the epoch.
>
>
> To generate a diff of this commit:
> cvs rdiff -u -r1.32 -r1.33 src/distrib/common/Makefile.bootcd
> cvs rdiff -u -r1.11 -r1.12 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.
>


Re: CVS commit: src/distrib/common

2015-11-24 Thread Christos Zoulas
In article ,
Masao Uebayashi   wrote:
>bapt@freebsd taught me that FreeBSD uses ((the newest timestamp in the
>source files) + 1sec) in places where appropriate for reproducible
>build.  It might have been about Ports, but idea is it.

That's a nice way to do it. How do they compute that?

christos



Re: CVS commit: src/distrib/common

2015-11-24 Thread Martin Husemann
On Wed, Nov 25, 2015 at 01:30:37AM +, Christos Zoulas wrote:
> In article 
> ,
> Masao Uebayashi   wrote:
> >bapt@freebsd taught me that FreeBSD uses ((the newest timestamp in the
> >source files) + 1sec) in places where appropriate for reproducible
> >build.  It might have been about Ports, but idea is it.
> 
> That's a nice way to do it. How do they compute that?

I disagree - it needs to be set manually (and documented in the release
notes). The above could be the rule how releng manually sets it though.

Martin


Re: CVS commit: src/distrib/common/bootimage

2015-03-12 Thread Christos Zoulas
In article 20150312044123.ee11...@cvs.netbsd.org,
Soren Jacobsen source-changes-d@NetBSD.org wrote:
-=-=-=-=-=-

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!)

Why are they broken? The INSTALL kernel has ptyfs now? This is the
wrong fix in the long run...

christos



Re: CVS commit: src/distrib/common

2014-02-01 Thread Izumi Tsutsui
matt@ wrote:

 Module Name:  src
 Committed By: matt
 Date: Sat Feb  1 21:05:54 UTC 2014
 
 Modified Files:
   src/distrib/common: Makefile.crunch
 
 Log Message:
 Pass DBG to crunchgen so it can get into the created mk file.

I think it should be set by each Makefile via CRUNCHGEN_FLAGS
(several mips ports already have it), not in the common Makefile.

---
Izumi Tsutsui


Re: CVS commit: src/distrib/common

2014-02-01 Thread Matt Thomas

On Feb 1, 2014, at 2:16 PM, Izumi Tsutsui tsut...@ceres.dti.ne.jp wrote:

 matt@ wrote:
 
 Module Name: src
 Committed By:matt
 Date:Sat Feb  1 21:05:54 UTC 2014
 
 Modified Files:
  src/distrib/common: Makefile.crunch
 
 Log Message:
 Pass DBG to crunchgen so it can get into the created mk file.
 
 I think it should be set by each Makefile via CRUNCHGEN_FLAGS
 (several mips ports already have it), not in the common Makefile.

Most ramdisk Makefiles have a DBG=value which is ignored.
CRUNCHGEN_FLAGS is unobvious.


Re: CVS commit: src/distrib/common

2014-02-01 Thread Izumi Tsutsui
matt@ wrote:

  matt@ wrote:
  
  Module Name:   src
  Committed By:  matt
  Date:  Sat Feb  1 21:05:54 UTC 2014
  
  Modified Files:
 src/distrib/common: Makefile.crunch
  
  Log Message:
  Pass DBG to crunchgen so it can get into the created mk file.
  
  I think it should be set by each Makefile via CRUNCHGEN_FLAGS
  (several mips ports already have it), not in the common Makefile.
 
 Most ramdisk Makefiles have a DBG=value which is ignored.
 CRUNCHGEN_FLAGS is unobvious.

Most, but not all.

The point is that your changes disallow each Makefile overwriting
default settings.  At least it should be set via
CRUNCHGEN_FLAGS?= -d ${DBG}
in the common Makefile.crunch.

Or properly remove all redundant CRUNCHGEN_FLAGS which specify -d
from existing Makefiles if you really don't like it.

---
Izumi Tsutsui