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.



CVS commit: src/distrib/common/bootimage

2021-07-24 Thread Jared D. McNeill
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

2021-07-24 Thread Jared D. McNeill
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.



CVS commit: src/distrib/common/bootimage

2021-06-04 Thread Izumi Tsutsui
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

2021-06-04 Thread Izumi Tsutsui
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.



CVS commit: src/distrib/common

2020-10-11 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Oct 11 14:10:04 UTC 2020

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

Log Message:
Copy release to /${RELEASEMACHINEDIR} instead of /${MACHINE} to match
sysinst expectations.


To generate a diff of this commit:
cvs rdiff -u -r1.43 -r1.44 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.43 src/distrib/common/Makefile.bootcd:1.44
--- src/distrib/common/Makefile.bootcd:1.43	Fri Dec 20 19:46:51 2019
+++ src/distrib/common/Makefile.bootcd	Sun Oct 11 14:10:04 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.bootcd,v 1.43 2019/12/20 19:46:51 martin Exp $
+#	$NetBSD: Makefile.bootcd,v 1.44 2020/10/11 14:10:04 jmcneill Exp $
 #
 # Makefile snipped to create a CD/DVD ISO
 #
@@ -188,8 +188,8 @@ copy-releasedir:
 			echo "Missing ${RELEASEDIR}/${RELEASEMACHINEDIR}, aborting"; \
 			exit 1; 	\
 		fi; 			\
-		${MKDIR} ${MKDIRPERM} "${CUROBJDIR}/cdrom/${MACHINE}"; 	\
-		release_destdir="${CUROBJDIR}/cdrom/${MACHINE}";	\
+		${MKDIR} ${MKDIRPERM} "${CUROBJDIR}/cdrom/${RELEASEMACHINEDIR}"; 	\
+		release_destdir="${CUROBJDIR}/cdrom/${RELEASEMACHINEDIR}";	\
 		cd ${RELEASEDIR}/${RELEASEMACHINEDIR}; 			\
 		echo Copying $$(pwd) to $$release_destdir ...; 		\
 		${TOOL_PAX} ${PAX_TIMESTAMP}\



CVS commit: src/distrib/common

2020-10-11 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Oct 11 14:10:04 UTC 2020

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

Log Message:
Copy release to /${RELEASEMACHINEDIR} instead of /${MACHINE} to match
sysinst expectations.


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

2020-07-02 Thread Luke Mewburn
Module Name:src
Committed By:   lukem
Date:   Thu Jul  2 08:48:11 UTC 2020

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

Log Message:
Makefile.minirootkmod don't have SRCS


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

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.minirootkmod
diff -u src/distrib/common/Makefile.minirootkmod:1.4 src/distrib/common/Makefile.minirootkmod:1.5
--- src/distrib/common/Makefile.minirootkmod:1.4	Sat Apr  4 19:50:53 2020
+++ src/distrib/common/Makefile.minirootkmod	Thu Jul  2 08:48:10 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.minirootkmod,v 1.4 2020/04/04 19:50:53 christos Exp $
+#	$NetBSD: Makefile.minirootkmod,v 1.5 2020/07/02 08:48:10 lukem Exp $
 #
 # Makefile snippet to build a miniroot kernel module (e.g. miniroot.kmod)
 #
@@ -25,6 +25,9 @@ RAMDISK?=	ramdisk
 MKMAN=		no
 PROG=		${MINIROOT}.kmod
 
+# Not a real PROG; doesn't actually have source
+SRCS.${PROG}=
+
 # SRCMOD is a skeleton version of miniroot.kmod, without an embedded ramdisk.
 # It should already have been created by "make install" in
 # .../sys/modules/miniroot, and its name includes literal "miniroot",



CVS commit: src/distrib/common

2020-07-02 Thread Luke Mewburn
Module Name:src
Committed By:   lukem
Date:   Thu Jul  2 08:48:11 UTC 2020

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

Log Message:
Makefile.minirootkmod don't have SRCS


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

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/bootimage

2020-05-28 Thread Jared D. McNeill
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.



CVS commit: src/distrib/common/bootimage

2020-05-28 Thread Jared D. McNeill
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

2020-04-14 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Tue Apr 14 12:14:59 UTC 2020

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

Log Message:
We solves the zpool SIGBUS issue by building a threaded libhack.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/distrib/common/zfsroot.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

2020-04-14 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Tue Apr 14 12:14:59 UTC 2020

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

Log Message:
We solves the zpool SIGBUS issue by building a threaded libhack.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/distrib/common/zfsroot.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/zfsroot.rc
diff -u src/distrib/common/zfsroot.rc:1.4 src/distrib/common/zfsroot.rc:1.5
--- src/distrib/common/zfsroot.rc:1.4	Tue Feb 25 20:05:10 2020
+++ src/distrib/common/zfsroot.rc	Tue Apr 14 12:14:59 2020
@@ -1,6 +1,6 @@
 #/bin/sh
 #
-#	$NetBSD: zfsroot.rc,v 1.4 2020/02/25 20:05:10 roy Exp $
+#	$NetBSD: zfsroot.rc,v 1.5 2020/04/14 12:14:59 roy Exp $
 
 # Assumption - boot.cfg loads this ramdisk.
 # Assumption - The needed kernel modules: solaris and zfs; are either on this
@@ -19,11 +19,6 @@ export HOME=/
 export PATH=/sbin:/bin:/usr/sbin:/usr/bin
 umask 022
 
-# FIXME XXX Sometimes zpool import gets SIGBUS
-# Ensure that we are in a writable directory to try and capture a coredump
-# Not that we actually get a coredump 
-cd /tmp
-
 echo "Importing $rpool"
 /sbin/zpool import -f -N "$rpool"
 



CVS commit: src/distrib/common/bootimage

2020-03-21 Thread Izumi Tsutsui
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

2020-03-21 Thread Izumi Tsutsui
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.



CVS commit: src/distrib/common

2020-02-25 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Tue Feb 25 20:05:10 UTC 2020

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

Log Message:
ramdisk-zfsroot: Remove the module loading magic

It's been determined that it's too magical and it's either the job
of the bootloader or you compile it into the kernel yourself.

This entry works in /boot.cfg:

menu=Boot ZFS Root:load solaris;load zfs;fs /ramdisk-zfsroot.fs;boot


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/distrib/common/zfsroot.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/zfsroot.rc
diff -u src/distrib/common/zfsroot.rc:1.3 src/distrib/common/zfsroot.rc:1.4
--- src/distrib/common/zfsroot.rc:1.3	Sun Feb 23 10:51:12 2020
+++ src/distrib/common/zfsroot.rc	Tue Feb 25 20:05:10 2020
@@ -1,40 +1,24 @@
 #/bin/sh
 #
-#	$NetBSD: zfsroot.rc,v 1.3 2020/02/23 10:51:12 roy Exp $
+#	$NetBSD: zfsroot.rc,v 1.4 2020/02/25 20:05:10 roy Exp $
 
-echo "Starting root on ZFS boot strapper"
-
-# Abort on any error
-set -e
+# Assumption - boot.cfg loads this ramdisk.
+# Assumption - The needed kernel modules: solaris and zfs; are either on this
+#  ramdisk OR loaded by boot.cfg.
+#  Finding the correct dev node to mount to get them is too magic.
+#  NetBSD cannot build and distribute a kernel with ZFS builtin.
+# Assumption - the root pool is set to legacy mount.
 
 # Configurable - define the ZFS root pool and ROOT.
 # XXX Can these be set in boot.cfg?
-# Assumption - the root pool is set to legacy mount.
 rpool=rpool
 rroot=ROOT
 
-# Assumption - the boot device is named boot.
-# Could use /dev/dk0, /dev/wd0a, etc instead.
-# XXX Can be exposed by sysctl kern.boot_device?
-bootdev="NAME=boot"
-
 # Setup some stuff incase things go south and we drop to the shell
 export HOME=/
 export PATH=/sbin:/bin:/usr/sbin:/usr/bin
 umask 022
 
-# Avoid having the solaris and zfs modules in ramdisk directly.
-# Means we don't need to update the ramdisk with the kernel modules
-# or load them from boot.cfg so it's less pain for the user.
-#bootdev="$(/sbin/sysctl -n kern.boot_device)"
-modpath="$(/sbin/sysctl -n kern.module.path)"
-echo "Loading needed kernel modules from $bootdev:$modpath"
-/sbin/mount -o ro "$bootdev" /mnt
-for m in solaris zfs; do
-	/sbin/modload "/mnt/$modpath/$m/$m.kmod"
-done
-/sbin/umount /mnt
-
 # FIXME XXX Sometimes zpool import gets SIGBUS
 # Ensure that we are in a writable directory to try and capture a coredump
 # Not that we actually get a coredump 
@@ -46,5 +30,4 @@ echo "Importing $rpool"
 echo "Mounting $rpool/$rroot to /altroot"
 /sbin/mount -t zfs "$rpool/$rroot" /altroot;
 
-echo "Pivoting to /altroot, welcome to root on ZFS"
 /sbin/sysctl -w init.root=/altroot



CVS commit: src/distrib/common

2020-02-25 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Tue Feb 25 20:05:10 UTC 2020

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

Log Message:
ramdisk-zfsroot: Remove the module loading magic

It's been determined that it's too magical and it's either the job
of the bootloader or you compile it into the kernel yourself.

This entry works in /boot.cfg:

menu=Boot ZFS Root:load solaris;load zfs;fs /ramdisk-zfsroot.fs;boot


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/distrib/common/zfsroot.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

2020-02-23 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Sun Feb 23 10:51:12 UTC 2020

Modified Files:
src/distrib/common: mtree.zfsroot zfsroot.rc

Log Message:
ramdisk-zfsroot: We no longer need to have /etc/zfs in mtree

Now that mountall doesn't rely on /etc/zfs/zpool.cache being present.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/distrib/common/mtree.zfsroot \
src/distrib/common/zfsroot.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/mtree.zfsroot
diff -u src/distrib/common/mtree.zfsroot:1.2 src/distrib/common/mtree.zfsroot:1.3
--- src/distrib/common/mtree.zfsroot:1.2	Sun Feb 23 05:15:54 2020
+++ src/distrib/common/mtree.zfsroot	Sun Feb 23 10:51:12 2020
@@ -1,7 +1,5 @@
-#	$NetBSD: mtree.zfsroot,v 1.2 2020/02/23 05:15:54 roy Exp $
+#	$NetBSD: mtree.zfsroot,v 1.3 2020/02/23 10:51:12 roy Exp $
 
 .
 ./altroot
-./etc
-./etc/zfs
 ./rpool
Index: src/distrib/common/zfsroot.rc
diff -u src/distrib/common/zfsroot.rc:1.2 src/distrib/common/zfsroot.rc:1.3
--- src/distrib/common/zfsroot.rc:1.2	Sun Feb 23 05:15:54 2020
+++ src/distrib/common/zfsroot.rc	Sun Feb 23 10:51:12 2020
@@ -1,6 +1,6 @@
 #/bin/sh
 #
-#	$NetBSD: zfsroot.rc,v 1.2 2020/02/23 05:15:54 roy Exp $
+#	$NetBSD: zfsroot.rc,v 1.3 2020/02/23 10:51:12 roy Exp $
 
 echo "Starting root on ZFS boot strapper"
 
@@ -46,10 +46,5 @@ echo "Importing $rpool"
 echo "Mounting $rpool/$rroot to /altroot"
 /sbin/mount -t zfs "$rpool/$rroot" /altroot;
 
-# This ensures that rc.d/mountall mounts all ZFS mounts set to automount.
-if [ ! -e /altroot/etc/zfs/zpool.cache ]; then
-	echo >/altroot/etc/zfs/zpool.cache
-fi
-
 echo "Pivoting to /altroot, welcome to root on ZFS"
 /sbin/sysctl -w init.root=/altroot



CVS commit: src/distrib/common

2020-02-23 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Sun Feb 23 10:51:12 UTC 2020

Modified Files:
src/distrib/common: mtree.zfsroot zfsroot.rc

Log Message:
ramdisk-zfsroot: We no longer need to have /etc/zfs in mtree

Now that mountall doesn't rely on /etc/zfs/zpool.cache being present.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/distrib/common/mtree.zfsroot \
src/distrib/common/zfsroot.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

2020-02-22 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Sun Feb 23 05:15:54 UTC 2020

Modified Files:
src/distrib/common: list.zfsroot mtree.zfsroot zfsroot.rc

Log Message:
zfs: Allow modules to be loaded once in the ZFS chroot

Rather than copying the needed modules from FFS to the ramdisk,
load then directly from FFS instead.

This way, we can symlink ramdisk stand into /altroot and let nature take
it's course like loading firmware.

Set shell exit on error rather than using chained commands.
zpool import seems to SIGBUS randomly on amd64 and if we didn't do the
former then zpool would hang the init. Now at least we exit to the shell.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/distrib/common/list.zfsroot \
src/distrib/common/mtree.zfsroot src/distrib/common/zfsroot.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/list.zfsroot
diff -u src/distrib/common/list.zfsroot:1.1 src/distrib/common/list.zfsroot:1.2
--- src/distrib/common/list.zfsroot:1.1	Sat Feb 22 09:53:47 2020
+++ src/distrib/common/list.zfsroot	Sun Feb 23 05:15:54 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: list.zfsroot,v 1.1 2020/02/22 09:53:47 roy Exp $
+#	$NetBSD: list.zfsroot,v 1.2 2020/02/23 05:15:54 roy Exp $
 #
 # list file (c.f. parselist.awk) for ZFS on root.
 #
@@ -12,6 +12,11 @@ ARGVLN	zfs mount_zfs
 # We need sysctl to set init.root=/altroot
 PROG	sbin/sysctl
 
+# We need modload as we cannot build CDDL modules in the kernel
+PROG	sbin/modload
+PROG	sbin/modunload
+PROG	sbin/modstat
+
 LIBS	-lnvpair
 LIBS	-luutil
 LIBS	-lzfs
@@ -25,5 +30,6 @@ LIBS	-lzfs_core
 
 COPY	${NETBSDSRCDIR}/distrib/common/zfsroot.rc etc/rc
 
-# Make firmware images available.
+# Make modules and firmware images available
+SYMLINK	altroot/stand stand
 SYMLINK	altroot/libdata libdata
Index: src/distrib/common/mtree.zfsroot
diff -u src/distrib/common/mtree.zfsroot:1.1 src/distrib/common/mtree.zfsroot:1.2
--- src/distrib/common/mtree.zfsroot:1.1	Sat Feb 22 09:53:47 2020
+++ src/distrib/common/mtree.zfsroot	Sun Feb 23 05:15:54 2020
@@ -1,8 +1,7 @@
-#	$NetBSD: mtree.zfsroot,v 1.1 2020/02/22 09:53:47 roy Exp $
+#	$NetBSD: mtree.zfsroot,v 1.2 2020/02/23 05:15:54 roy Exp $
 
 .
 ./altroot
 ./etc
 ./etc/zfs
 ./rpool
-./stand
Index: src/distrib/common/zfsroot.rc
diff -u src/distrib/common/zfsroot.rc:1.1 src/distrib/common/zfsroot.rc:1.2
--- src/distrib/common/zfsroot.rc:1.1	Sat Feb 22 09:53:47 2020
+++ src/distrib/common/zfsroot.rc	Sun Feb 23 05:15:54 2020
@@ -1,7 +1,11 @@
 #/bin/sh
 #
-#	$NetBSD: zfsroot.rc,v 1.1 2020/02/22 09:53:47 roy Exp $
-#	ZFS on Root boot strapper
+#	$NetBSD: zfsroot.rc,v 1.2 2020/02/23 05:15:54 roy Exp $
+
+echo "Starting root on ZFS boot strapper"
+
+# Abort on any error
+set -e
 
 # Configurable - define the ZFS root pool and ROOT.
 # XXX Can these be set in boot.cfg?
@@ -10,7 +14,7 @@ rpool=rpool
 rroot=ROOT
 
 # Assumption - the boot device is named boot.
-# Could use dk0, wd0a, etc instead.
+# Could use /dev/dk0, /dev/wd0a, etc instead.
 # XXX Can be exposed by sysctl kern.boot_device?
 bootdev="NAME=boot"
 
@@ -19,46 +23,33 @@ export HOME=/
 export PATH=/sbin:/bin:/usr/sbin:/usr/bin
 umask 022
 
-echo
-echo "Starting ZFS on root boot strapper"
-
 # Avoid having the solaris and zfs modules in ramdisk directly.
 # Means we don't need to update the ramdisk with the kernel modules
 # or load them from boot.cfg so it's less pain for the user.
 #bootdev="$(/sbin/sysctl -n kern.boot_device)"
 modpath="$(/sbin/sysctl -n kern.module.path)"
-modmnt=/mnt
-echo "Copying needed kernel modules from $bootdev:$modpath"
-case "$bootdev" in
-*=*|"/"*)	;;
-*)		bootdev="/dev/$bootdev";;
-esac
-/sbin/mount -o ro "$bootdev" "$modmnt"
-/sbin/mount -t tmpfs none /stand
+echo "Loading needed kernel modules from $bootdev:$modpath"
+/sbin/mount -o ro "$bootdev" /mnt
 for m in solaris zfs; do
-	p="$modpath/$m"
-	if [ ! -e "$modmnt/$p/$m.kmod" ]; then
-		echo "$modmnt/$p/$m.kmod not found!" >&2
-		continue
-	fi
-	echo "	$m.kmod"
-	/bin/mkdir -p "$p"
-	/bin/cp "$modmnt/$p/$m.kmod" "$p"
+	/sbin/modload "/mnt/$modpath/$m/$m.kmod"
 done
-# zpool list will load the needed modules, then we can dispose of the mounts.
-/sbin/zpool list >/dev/null 2>&1
-/sbin/umount /stand
-/sbin/umount "$modmnt"
-echo
-
-echo "Importing $rpool, mounting and pivoting"
-# If we can mount the ZFS root partition to /altroot
-# then chroot to it and start /etc/rc
-if /sbin/zpool import -f -N "$rpool" && \
-   /sbin/mount -t zfs "$rpool/$rroot" /altroot; then
-	# This ensures that mountall mounts all ZFS mounts set to automount.
-	if [ ! -e /altroot/etc/zfs/zpool.cache ]; then
-		echo >/altroot/etc/zfs/zpool.cache
-	fi
-	/sbin/sysctl -w init.root=/altroot
+/sbin/umount /mnt
+
+# FIXME XXX Sometimes zpool import gets SIGBUS
+# Ensure that we are in a writable directory to try and capture a coredump
+# Not that we actually get a coredump 
+cd /tmp
+
+echo 

CVS commit: src/distrib/common

2020-02-22 Thread Roy Marples
Module Name:src
Committed By:   roy
Date:   Sun Feb 23 05:15:54 UTC 2020

Modified Files:
src/distrib/common: list.zfsroot mtree.zfsroot zfsroot.rc

Log Message:
zfs: Allow modules to be loaded once in the ZFS chroot

Rather than copying the needed modules from FFS to the ramdisk,
load then directly from FFS instead.

This way, we can symlink ramdisk stand into /altroot and let nature take
it's course like loading firmware.

Set shell exit on error rather than using chained commands.
zpool import seems to SIGBUS randomly on amd64 and if we didn't do the
former then zpool would hang the init. Now at least we exit to the shell.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/distrib/common/list.zfsroot \
src/distrib/common/mtree.zfsroot src/distrib/common/zfsroot.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-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}



CVS commit: src/distrib/common

2019-02-05 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Wed Feb  6 07:33:09 UTC 2019

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

Log Message:
- clean the .tmp kernel targets as well


To generate a diff of this commit:
cvs rdiff -u -r1.42 -r1.43 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.42 src/distrib/common/Makefile.mdset:1.43
--- src/distrib/common/Makefile.mdset:1.42	Tue Jan 16 09:59:37 2018
+++ src/distrib/common/Makefile.mdset	Wed Feb  6 07:33:08 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.mdset,v 1.42 2018/01/16 09:59:37 maya Exp $
+#	$NetBSD: Makefile.mdset,v 1.43 2019/02/06 07:33:08 mrg Exp $
 #
 # Makefile snippet to ${TOOL_MDSETIMAGE} file system images into kernels
 #
@@ -125,8 +125,7 @@ _POST.${_KERNEL.${_K}.${_F}}:= ${MDSET_P
 _POST.${_KERNEL.${_K}.${_F}}:= ${MDSET_POST}
 .endif
 
-
-CLEANFILES+=	${_KERNEL.${_K}.${_F}}
+CLEANFILES+=	${_KERNEL.${_K}.${_F}} ${_KERNEL.${_K}.${_F}}.tmp
 
 .if defined(MDSET_NOIMAGE.${_FILENAME})
 ${_I}=



CVS commit: src/distrib/common

2019-02-05 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Wed Feb  6 07:33:09 UTC 2019

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

Log Message:
- clean the .tmp kernel targets as well


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

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

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.


CVS commit: src/distrib/common

2018-12-29 Thread Alexander Nasonov
Module Name:src
Committed By:   alnsn
Date:   Sat Dec 29 13:09:35 UTC 2018

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

Log Message:
ROOT.a doesn't resolve to a useful partition, hardcode wd0a and ld0a for now.


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

2018-12-29 Thread Alexander Nasonov
Module Name:src
Committed By:   alnsn
Date:   Sat Dec 29 13:09:35 UTC 2018

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

Log Message:
ROOT.a doesn't resolve to a useful partition, hardcode wd0a and ld0a for now.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 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.3 src/distrib/common/cgdroot.rc:1.4
--- src/distrib/common/cgdroot.rc:1.3	Sat Dec 29 01:04:38 2018
+++ src/distrib/common/cgdroot.rc	Sat Dec 29 13:09:35 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: cgdroot.rc,v 1.3 2018/12/29 01:04:38 alnsn Exp $
+#	$NetBSD: cgdroot.rc,v 1.4 2018/12/29 13:09:35 alnsn Exp $
 #
 # Copyright (c) 2013 Pierre Pronchery 
 # All rights reserved.
@@ -37,7 +37,7 @@ export EDITOR
 umask 022
 
 mounted=
-for dev in NAME=cgd.conf ROOT.a ; do
+for dev in NAME=cgd.conf /dev/wd0a /dev/ld0a ; do
 	if mount -o ro $dev /etc/cgd 2>/dev/null ; then
 		mounted=$dev
 		break



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


CVS commit: src/distrib/common

2018-12-28 Thread Alexander Nasonov
Module Name:src
Committed By:   alnsn
Date:   Sat Dec 29 01:04:39 UTC 2018

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

Log Message:
Break the loop after a successful mount.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 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.2 src/distrib/common/cgdroot.rc:1.3
--- src/distrib/common/cgdroot.rc:1.2	Sat Dec 29 00:52:11 2018
+++ src/distrib/common/cgdroot.rc	Sat Dec 29 01:04:38 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: cgdroot.rc,v 1.2 2018/12/29 00:52:11 alnsn Exp $
+#	$NetBSD: cgdroot.rc,v 1.3 2018/12/29 01:04:38 alnsn Exp $
 #
 # Copyright (c) 2013 Pierre Pronchery 
 # All rights reserved.
@@ -40,6 +40,7 @@ mounted=
 for dev in NAME=cgd.conf ROOT.a ; do
 	if mount -o ro $dev /etc/cgd 2>/dev/null ; then
 		mounted=$dev
+		break
 	fi
 done
 if [ -z "$mounted" ]; then



CVS commit: src/distrib/common

2018-12-28 Thread Alexander Nasonov
Module Name:src
Committed By:   alnsn
Date:   Sat Dec 29 01:04:39 UTC 2018

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

Log Message:
Break the loop after a successful mount.


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

2018-12-28 Thread Alexander Nasonov
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.


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

2018-12-28 Thread Alexander Nasonov
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.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 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.1 src/distrib/common/cgdroot.rc:1.2
--- src/distrib/common/cgdroot.rc:1.1	Mon Jul 15 00:25:38 2013
+++ src/distrib/common/cgdroot.rc	Sat Dec 29 00:52:11 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: cgdroot.rc,v 1.1 2013/07/15 00:25:38 khorben Exp $
+#	$NetBSD: cgdroot.rc,v 1.2 2018/12/29 00:52:11 alnsn Exp $
 #
 # Copyright (c) 2013 Pierre Pronchery 
 # All rights reserved.
@@ -36,8 +36,13 @@ export EDITOR
 
 umask 022
 
-mount -o ro /dev/wd0a /etc/cgd
-if [ $? -ne 0 ]; then
+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
+if [ -z "$mounted" ]; then
 	echo "Could not mount the boot partition" 1>&2
 	exit 2
 fi



CVS commit: src/distrib/common/bootimage

2018-10-07 Thread Martin Husemann
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

2018-10-07 Thread Martin Husemann
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.



CVS commit: src/distrib/common

2018-09-28 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Sep 28 15:03:34 UTC 2018

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

Log Message:
Fix stupid typo (=+ instead of +=).
Remove hard coded debug sets removal, now that the configurable
variant works.
Prepare for .tar.xz sets.


To generate a diff of this commit:
cvs rdiff -u -r1.40 -r1.41 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.40 src/distrib/common/Makefile.bootcd:1.41
--- src/distrib/common/Makefile.bootcd:1.40	Mon Jun 25 12:18:22 2018
+++ src/distrib/common/Makefile.bootcd	Fri Sep 28 15:03:34 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.bootcd,v 1.40 2018/06/25 12:18:22 martin Exp $
+#	$NetBSD: Makefile.bootcd,v 1.41 2018/09/28 15:03:34 martin Exp $
 #
 # Makefile snipped to create a CD/DVD ISO
 #
@@ -53,7 +53,10 @@ CDROMS_RELEASEDIR?=	images
 CDRELEASE_EXCLUDE=	-s ',./installation/cdrom.*,,gp'
 .endif
 .if defined(CDRELEASE_NODEBUG)
-CDRELEASE_EXCLUDE=+	-s ',./binary/sets/debug.tgz,,gp'	-s ',./binary/sets/xdebug.tgz,,gp'
+CDRELEASE_EXCLUDE+=	-s ',./binary/sets/debug.tgz,,gp'
+CDRELEASE_EXCLUDE+=	-s ',./binary/sets/xdebug.tgz,,gp'
+CDRELEASE_EXCLUDE+=	-s ',./binary/sets/debug.tar.xz,,gp'
+CDRELEASE_EXCLUDE+=	-s ',./binary/sets/xdebug.tar.xz,,gp'
 .endif
 .if !defined(CDRELEASE_LIVEIMAGE)
 CDRELEASE_EXCLUDE+=	-s ',./installation/liveimage.*,,gp'
@@ -189,8 +192,6 @@ copy-releasedir:
 		${TOOL_PAX} ${PAX_TIMESTAMP}\
 			-rw -pe ${PAX_v}\
 			${CDRELEASE_EXCLUDE}\
-			-s ',./binary/sets/debug.tgz,,gp'		\
-			-s ',./binary/sets/xdebug.tgz,,gp'		\
 			. $$release_destdir; \
 		cd "${CUROBJDIR}";	\
 	fi



CVS commit: src/distrib/common

2018-09-28 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Sep 28 15:03:34 UTC 2018

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

Log Message:
Fix stupid typo (=+ instead of +=).
Remove hard coded debug sets removal, now that the configurable
variant works.
Prepare for .tar.xz sets.


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

2018-09-16 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Sun Sep 16 21:49:18 UTC 2018

Modified Files:
src/distrib/common: buildfloppies.sh

Log Message:
Remove use of test ([) -o (and a couple of other trivial cleanups).


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/distrib/common/buildfloppies.sh

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/buildfloppies.sh
diff -u src/distrib/common/buildfloppies.sh:1.18 src/distrib/common/buildfloppies.sh:1.19
--- src/distrib/common/buildfloppies.sh:1.18	Sat Feb 11 03:07:06 2017
+++ src/distrib/common/buildfloppies.sh	Sun Sep 16 21:49:18 2018
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# $NetBSD: buildfloppies.sh,v 1.18 2017/02/11 03:07:06 christos Exp $
+# $NetBSD: buildfloppies.sh,v 1.19 2018/09/16 21:49:18 kre Exp $
 #
 # Copyright (c) 2002-2003 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -58,12 +58,12 @@ _USAGE_
 
 plural()
 {
-	[ $1 -ne 1 ] && echo "s"
+	[ "$1" -ne 1 ] && echo "s"
 }
 
 roundup()
 {
-	echo $(( ( $1 + $2 - 1 ) / ( $2 ) ))
+	echo $(( ( ( $1 ) + ( $2 ) - 1 ) / ( $2 ) ))
 }
 
 
@@ -148,8 +148,10 @@ for file in $files; do
 	set -- $(ls -ln $file)
 	file_bytes=$5
 	pad_bytes=$(($(roundup $file_bytes 512) * 512 - $file_bytes))
-	[ "$file_bytes" != 0 -o "$file" = "${file#USTAR.volsize.}" ] &&
+	if [ "$file_bytes" != 0 ] || [ "$file" = "${file#USTAR.volsize.}" ]
+	then
 		msg="$msg $file $pad_bytes,"
+	fi
 	free_space=$(($free_space - 512 - $file_bytes - $pad_bytes))
 done
 echo "Free space in last tar block:$msg"



CVS commit: src/distrib/common

2018-09-16 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Sun Sep 16 21:49:18 UTC 2018

Modified Files:
src/distrib/common: buildfloppies.sh

Log Message:
Remove use of test ([) -o (and a couple of other trivial cleanups).


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/distrib/common/buildfloppies.sh

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



CVS commit: src/distrib/common

2018-09-16 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Sun Sep 16 21:41:34 UTC 2018

Modified Files:
src/distrib/common: sunbootcd.sh

Log Message:
Remove test ([) -o usage, and make a couple of minor cleanups as well.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/distrib/common/sunbootcd.sh

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/sunbootcd.sh
diff -u src/distrib/common/sunbootcd.sh:1.6 src/distrib/common/sunbootcd.sh:1.7
--- src/distrib/common/sunbootcd.sh:1.6	Wed Feb 22 16:12:34 2012
+++ src/distrib/common/sunbootcd.sh	Sun Sep 16 21:41:34 2018
@@ -1,6 +1,6 @@
 #! /bin/sh
 #
-# $NetBSD: sunbootcd.sh,v 1.6 2012/02/22 16:12:34 martin Exp $
+# $NetBSD: sunbootcd.sh,v 1.7 2018/09/16 21:41:34 kre Exp $
 #
 # Copyright (c) 2003 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -59,11 +59,13 @@ _USAGE_
 	exit 1
 }
 
-if [ $# -lt 2 -o $# -gt 6 ]; then
-	usage
-fi
+case "$#" in
+([23456])	;;
+(*)		usage;;
+esac
 
-for curfile in $*; do
+for curfile
+do
 	[ "$curfile" = "-" ] && continue
 	if [ ! -f "$curfile" ]; then
 		echo 1>&2 "${PROGNAME}: ${curfile}: No such file."
@@ -81,7 +83,8 @@ printf "${FORMAT}" "fsimage:" 0 ${ISOCYL
 
 ENDCYL=${ISOCYLS}
 curpart=0
-for curfile in $*; do
+for curfile
+do
 	curpart=$(( ${curpart} + 1 ))
 	[ "$curfile" = "-" ] && continue
 



CVS commit: src/distrib/common

2018-09-16 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Sun Sep 16 21:41:34 UTC 2018

Modified Files:
src/distrib/common: sunbootcd.sh

Log Message:
Remove test ([) -o usage, and make a couple of minor cleanups as well.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/distrib/common/sunbootcd.sh

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



CVS commit: src/distrib/common

2018-06-25 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Jun 25 12:18:22 UTC 2018

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

Log Message:
Do not put debug.tgz and xdebug.tgz onto install CDs (a lot of them
grow out of bounds and for some architectures can not turn into DVDs).


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

2018-06-25 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Mon Jun 25 12:18:22 UTC 2018

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

Log Message:
Do not put debug.tgz and xdebug.tgz onto install CDs (a lot of them
grow out of bounds and for some architectures can not turn into DVDs).


To generate a diff of this commit:
cvs rdiff -u -r1.39 -r1.40 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.39 src/distrib/common/Makefile.bootcd:1.40
--- src/distrib/common/Makefile.bootcd:1.39	Fri Sep  8 09:50:44 2017
+++ src/distrib/common/Makefile.bootcd	Mon Jun 25 12:18:22 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.bootcd,v 1.39 2017/09/08 09:50:44 martin Exp $
+#	$NetBSD: Makefile.bootcd,v 1.40 2018/06/25 12:18:22 martin Exp $
 #
 # Makefile snipped to create a CD/DVD ISO
 #
@@ -189,6 +189,8 @@ copy-releasedir:
 		${TOOL_PAX} ${PAX_TIMESTAMP}\
 			-rw -pe ${PAX_v}\
 			${CDRELEASE_EXCLUDE}\
+			-s ',./binary/sets/debug.tgz,,gp'		\
+			-s ',./binary/sets/xdebug.tgz,,gp'		\
 			. $$release_destdir; \
 		cd "${CUROBJDIR}";	\
 	fi



CVS commit: src/distrib/common

2018-01-16 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Tue Jan 16 09:59:37 UTC 2018

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

Log Message:
Make MDSET_NOGZIP behave as documented also if MDSET_SUFFIX is set

MDSET_NOGZIP is documented as intended to apply for all kernels, even if
MDSET_NOGZIP.filename is not set.

>From Harold Gutch in PR toolchain/52836


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

2018-01-16 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Tue Jan 16 09:59:37 UTC 2018

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

Log Message:
Make MDSET_NOGZIP behave as documented also if MDSET_SUFFIX is set

MDSET_NOGZIP is documented as intended to apply for all kernels, even if
MDSET_NOGZIP.filename is not set.

>From Harold Gutch in PR toolchain/52836


To generate a diff of this commit:
cvs rdiff -u -r1.41 -r1.42 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.41 src/distrib/common/Makefile.mdset:1.42
--- src/distrib/common/Makefile.mdset:1.41	Tue Sep 20 20:55:54 2016
+++ src/distrib/common/Makefile.mdset	Tue Jan 16 09:59:37 2018
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.mdset,v 1.41 2016/09/20 20:55:54 christos Exp $
+#	$NetBSD: Makefile.mdset,v 1.42 2018/01/16 09:59:37 maya Exp $
 #
 # Makefile snippet to ${TOOL_MDSETIMAGE} file system images into kernels
 #
@@ -102,7 +102,7 @@ ${_KERNEL.${_K}.${_F}}.${_S}: ${_KERNEL.
 	false
 .endif
 
-.if defined(MDSET_NOGZIP.${_FILENAME}) && defined(MDSET_NOGZIP)
+.if defined(MDSET_NOGZIP.${_FILENAME}) || defined(MDSET_NOGZIP)
 KERNELS+=	${_KERNEL.${_K}.${_F}}.${_S}
 .else			# {
 KERNELS+=	${_KERNEL.${_K}.${_F}}.${_S}.gz



CVS commit: src/distrib/common

2017-02-15 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Feb 16 02:37:32 UTC 2017

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

Log Message:
there is no -f in install


To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.38 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.37 src/distrib/common/Makefile.bootcd:1.38
--- src/distrib/common/Makefile.bootcd:1.37	Fri Feb 10 22:07:06 2017
+++ src/distrib/common/Makefile.bootcd	Wed Feb 15 21:37:32 2017
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.bootcd,v 1.37 2017/02/11 03:07:06 christos Exp $
+#	$NetBSD: Makefile.bootcd,v 1.38 2017/02/16 02:37:32 christos Exp $
 #
 # Makefile snipped to create a CD/DVD ISO
 #
@@ -231,7 +231,7 @@ copy-releasedir:
 			release_destdir="${CUROBJDIR}/cdrom";		\
 			if [ -f $${cde} ]; then\
 echo Copying $${cde} to $$release_destdir ...;	\
-${INSTALL} ${COPY} -m 0644 -f $${cde} $${release_destdir};	\
+${INSTALL} ${COPY} -m 0644 $${cde} $${release_destdir};	\
 			elif [ -d $${cde} ]; then			\
 cd $${cde};\
 echo Copying $$(pwd) to $$release_destdir ...;	\



CVS commit: src/distrib/common

2017-02-15 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Feb 16 02:37:32 UTC 2017

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

Log Message:
there is no -f in install


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

2017-02-11 Thread Paul Goyette
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

2017-02-11 Thread Paul Goyette
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.



CVS commit: src/distrib/common/bootimage

2017-02-10 Thread Christos Zoulas
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

2017-02-10 Thread Christos Zoulas
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.



CVS commit: src/distrib/common/bootimage

2017-01-24 Thread Christos Zoulas
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

2017-01-24 Thread Christos Zoulas
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.



CVS commit: src/distrib/common

2016-09-20 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Sep 20 20:55:54 UTC 2016

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

Log Message:
Add the ability to specify more sections to strip.


To generate a diff of this commit:
cvs rdiff -u -r1.40 -r1.41 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.40 src/distrib/common/Makefile.mdset:1.41
--- src/distrib/common/Makefile.mdset:1.40	Tue Aug  5 11:40:58 2014
+++ src/distrib/common/Makefile.mdset	Tue Sep 20 16:55:54 2016
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.mdset,v 1.40 2014/08/05 15:40:58 apb Exp $
+#	$NetBSD: Makefile.mdset,v 1.41 2016/09/20 20:55:54 christos Exp $
 #
 # Makefile snippet to ${TOOL_MDSETIMAGE} file system images into kernels
 #
@@ -153,7 +153,7 @@ ${_KERNEL.${_K}.${_F}}: .NOTMAIN ${_KERN
 	${NM} ${.TARGET}.tmp | ${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 ${.TARGET}.tmp
+	${STRIP} -R .eh_frame -R .eh_frame_hdr -R .comment -R .ident ${MDSET_STRIPSECTIONS} ${.TARGET}.tmp
 .endif
 	@mv ${.TARGET}.tmp ${.TARGET}
 .if defined(MDSET_POST.${_FILENAME}) || defined(MDSET_POST)



CVS commit: src/distrib/common

2016-09-20 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Sep 20 20:55:54 UTC 2016

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

Log Message:
Add the ability to specify more sections to strip.


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

2016-06-19 Thread Tetsuya Isaki
Module Name:src
Committed By:   isaki
Date:   Sun Jun 19 08:44:34 UTC 2016

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

Log Message:
Copy with -f.
On x68k, CDEXTRA has /usr/mdec/boot and its permission is 444.
So this copy was failed from second time.


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 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.34 src/distrib/common/Makefile.bootcd:1.35
--- src/distrib/common/Makefile.bootcd:1.34	Sun Dec 20 22:42:04 2015
+++ src/distrib/common/Makefile.bootcd	Sun Jun 19 08:44:34 2016
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.bootcd,v 1.34 2015/12/20 22:42:04 christos Exp $
+#	$NetBSD: Makefile.bootcd,v 1.35 2016/06/19 08:44:34 isaki Exp $
 #
 # Makefile snipped to create a CD/DVD ISO
 #
@@ -230,7 +230,7 @@ copy-releasedir:
 			release_destdir="${CUROBJDIR}/cdrom";		\
 			if [ -f $${cde} ]; then\
 echo Copying $${cde} to $$release_destdir ...;	\
-${CP} $${cde} $${release_destdir};	\
+${CP} -f $${cde} $${release_destdir};	\
 			elif [ -d $${cde} ]; then			\
 cd $${cde};\
 echo Copying $$(pwd) to $$release_destdir ...;	\



CVS commit: src/distrib/common

2016-06-19 Thread Tetsuya Isaki
Module Name:src
Committed By:   isaki
Date:   Sun Jun 19 08:44:34 UTC 2016

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

Log Message:
Copy with -f.
On x68k, CDEXTRA has /usr/mdec/boot and its permission is 444.
So this copy was failed from second time.


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

2016-05-29 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun May 29 16:12:31 UTC 2016

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

Log Message:
Don't build PIE binaries for install media


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/distrib/common/Makefile.distrib

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



CVS commit: src/distrib/common

2016-05-29 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun May 29 16:12:31 UTC 2016

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

Log Message:
Don't build PIE binaries for install media


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/distrib/common/Makefile.distrib

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.distrib
diff -u src/distrib/common/Makefile.distrib:1.11 src/distrib/common/Makefile.distrib:1.12
--- src/distrib/common/Makefile.distrib:1.11	Tue Jan 21 19:52:56 2014
+++ src/distrib/common/Makefile.distrib	Sun May 29 12:12:31 2016
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.distrib,v 1.11 2014/01/22 00:52:56 christos Exp $
+#	$NetBSD: Makefile.distrib,v 1.12 2016/05/29 16:12:31 christos Exp $
 #
 # Makefile snippet to setup various make variables variables used in distrib/:
 #
@@ -17,6 +17,7 @@
 .if !defined(_MAKEFILE_DISTRIB_)
 _MAKEFILE_DISTRIB_=1
 
+NOPIE=
 .include 
 
 DISTRIBDIR=	${NETBSDSRCDIR}/distrib



CVS commit: src/distrib/common

2015-12-20 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Dec 20 22:42:04 UTC 2015

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

Log Message:
Use MKREPRO_TIMESTAMP


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 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.33 src/distrib/common/Makefile.bootcd:1.34
--- src/distrib/common/Makefile.bootcd:1.33	Tue Nov 24 19:50:57 2015
+++ src/distrib/common/Makefile.bootcd	Sun Dec 20 17:42:04 2015
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.bootcd,v 1.33 2015/11/25 00:50:57 christos Exp $
+#	$NetBSD: Makefile.bootcd,v 1.34 2015/12/20 22:42:04 christos Exp $
 #
 # Makefile snipped to create a CD/DVD ISO
 #
@@ -74,8 +74,8 @@ _CDMAKEFSOPTIONS=	rockridge,label=${ISO_
 _CDMAKEFSOPTIONS=	rockridge,label=${ISO_VOLID},publisher=${PUBLISHER}
 .endif
 
-.if ${MKREPRO:Uno} == "yes"
-TIMESTAMP=-T ${NETBSDSRCDIR}/sys/sys/param.h
+.if ${MKREPRO_TIMESTAMP:Uno} != "no"
+MAKEFS_TIMESTAMP=-T "${MKREPRO_TIMESTAMP}"
 .endif
 
 .if ${MKUNPRIVED} == "no"
@@ -285,7 +285,7 @@ image:
 .endif
 	if [ -s ${WORKSPEC} ]; then specarg="-F ${WORKSPEC}"; fi;	\
 	${TOOL_MAKEFS} -N ${NETBSDSRCDIR}/etc -t cd9660 $${specarg} 	\
-		${TIMESTAMP} ${CDMAKEFSEXTRAOPTS} -o ${_CDMAKEFSOPTIONS:Q} ${CDIMAGE} cdrom
+		${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

2015-12-20 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Dec 20 22:42:04 UTC 2015

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

Log Message:
Use MKREPRO_TIMESTAMP


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

2015-12-20 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Dec 20 22:48:00 UTC 2015

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

Log Message:
Add MKREPRO_TIMESTAMP support to the makefs invocation.


To generate a diff of this commit:
cvs rdiff -u -r1.38 -r1.39 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.38 src/distrib/common/Makefile.image:1.39
--- src/distrib/common/Makefile.image:1.38	Tue Aug 12 07:48:22 2014
+++ src/distrib/common/Makefile.image	Sun Dec 20 17:47:59 2015
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.image,v 1.38 2014/08/12 11:48:22 martin Exp $
+#	$NetBSD: Makefile.image,v 1.39 2015/12/20 22:47:59 christos Exp $
 #
 # Makefile snippet to build a tree from the provided lists,
 # and make an ffs file system image from that tree
@@ -41,6 +41,10 @@ PARSELISTENV+=	TARGETDIR=${.OBJDIR}/${WO
 
 GZIP_FLAGS= -9 ${GZIP_N_FLAG}
 
+.if ${MKREPRO_TIMESTAMP:Uno} != "no"
+MAKEFS_TIMESTAMP=-T "${MKREPRO_TIMESTAMP}"
+.endif
+
 .if !target(${WORKBUILT})	# {
 ${WORKBUILT}: ${IMAGEDEPENDS} ${WORKSPEC} ${PARSELISTDEP} ${LISTS}
 #	There is a .PHONY ${CRUNCHBIN}, so check if out of date by hand
@@ -93,7 +97,7 @@ ${IMAGE}: ${WORKBUILT}
 	${_MKSHMSG_CREATE} ${.CURDIR:T}/${.TARGET}; \
 	rm -f ${.TARGET} ${.TARGET}.tmp; \
 	${TOOL_MAKEFS} -t ffs -B ${IMAGEENDIAN} -s ${IMAGESIZE} -F ${WORKSPEC} \
-	-N ${NETBSDSRCDIR}/etc ${IMGMAKEFSOPTIONS} \
+	${MAKEFS_TIMESTAMP} -N ${NETBSDSRCDIR}/etc ${IMGMAKEFSOPTIONS} \
 	-o optimization=space,minfree=0 \
 	${MAKEFS_FLAGS} ${.TARGET}.tmp ${WORKDIR} \
 	&& mv -f ${.TARGET}.tmp ${.TARGET}; \



CVS commit: src/distrib/common

2015-12-20 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Dec 20 22:48:00 UTC 2015

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

Log Message:
Add MKREPRO_TIMESTAMP support to the makefs invocation.


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

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



CVS commit: src/distrib/common

2015-11-24 Thread Christos Zoulas
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.

Modified files:

Index: src/distrib/common/Makefile.bootcd
diff -u src/distrib/common/Makefile.bootcd:1.32 src/distrib/common/Makefile.bootcd:1.33
--- src/distrib/common/Makefile.bootcd:1.32	Fri May 29 02:28:50 2015
+++ src/distrib/common/Makefile.bootcd	Tue Nov 24 19:50:57 2015
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.bootcd,v 1.32 2015/05/29 06:28:50 martin Exp $
+#	$NetBSD: Makefile.bootcd,v 1.33 2015/11/25 00:50:57 christos Exp $
 #
 # Makefile snipped to create a CD/DVD ISO
 #
@@ -74,6 +74,10 @@ _CDMAKEFSOPTIONS=	rockridge,label=${ISO_
 _CDMAKEFSOPTIONS=	rockridge,label=${ISO_VOLID},publisher=${PUBLISHER}
 .endif
 
+.if ${MKREPRO:Uno} == "yes"
+TIMESTAMP=-T ${NETBSDSRCDIR}/sys/sys/param.h
+.endif
+
 .if ${MKUNPRIVED} == "no"
 CD_METALOG.unpriv=
 mtunpriv=
@@ -281,7 +285,7 @@ image:
 .endif
 	if [ -s ${WORKSPEC} ]; then specarg="-F ${WORKSPEC}"; fi;	\
 	${TOOL_MAKEFS} -N ${NETBSDSRCDIR}/etc -t cd9660 $${specarg} 	\
-		${CDMAKEFSEXTRAOPTS} -o ${_CDMAKEFSOPTIONS:Q} ${CDIMAGE} cdrom
+		${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

Index: src/distrib/common/bootimage/Makefile.bootimage
diff -u src/distrib/common/bootimage/Makefile.bootimage:1.11 src/distrib/common/bootimage/Makefile.bootimage:1.12
--- src/distrib/common/bootimage/Makefile.bootimage:1.11	Fri May  8 13:46:03 2015
+++ src/distrib/common/bootimage/Makefile.bootimage	Tue Nov 24 19:50:57 2015
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.bootimage,v 1.11 2015/05/08 17:46:03 riastradh Exp $
+#	$NetBSD: Makefile.bootimage,v 1.12 2015/11/25 00:50:57 christos Exp $
 #
 # Copyright (c) 2009, 2010, 2011 Izumi Tsutsui.  All rights reserved.
 #
@@ -127,6 +127,10 @@
 
 .include "${NETBSDSRCDIR}/distrib/common/Makefile.distrib"
 
+.if ${MKREPRO:Uno} == "yes"
+TIMESTAMP=-T ${NETBSDSRCDIR}/sys/sys/param.h
+.endif
+
 .if empty(IMGBASE)
 .BEGIN:
 	@echo "Error: IMGBASE is not set"
@@ -292,6 +296,7 @@ ${TARGETFS}: prepare_md_post
 	${TOOL_MAKEFS} -M ${FSSIZE} -m ${FSSIZE}			\
 	-B ${TARGET_ENDIANNESS}	\
 	-F ${WORKSPEC} -N ${WORKDIR}/etc\
+	${TIMESTAMP}		\
 	${IMGMAKEFSOPTIONS}		\
 	${WORKFS} ${WORKDIR}
 .if !empty(PRIMARY_BOOT) && ${INSTALLBOOT_AFTER_DISKLABEL} == "no"



CVS commit: src/distrib/common

2015-11-24 Thread Christos Zoulas
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 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.
>


  1   2   >