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.



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

2015-05-08 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Fri May  8 17:46:03 UTC 2015

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

Log Message:
Fix ytpo: INSTALLBOOTOPTIONS, not INSTALLBOOTOPTOINS.

From qjsgkem on Freenode.


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

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

Modified files:

Index: src/distrib/common/bootimage/Makefile.bootimage
diff -u src/distrib/common/bootimage/Makefile.bootimage:1.10 src/distrib/common/bootimage/Makefile.bootimage:1.11
--- src/distrib/common/bootimage/Makefile.bootimage:1.10	Thu Mar 12 04:41:23 2015
+++ src/distrib/common/bootimage/Makefile.bootimage	Fri May  8 17:46:03 2015
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.bootimage,v 1.10 2015/03/12 04:41:23 snj Exp $
+#	$NetBSD: Makefile.bootimage,v 1.11 2015/05/08 17:46:03 riastradh Exp $
 #
 # Copyright (c) 2009, 2010, 2011 Izumi Tsutsui.  All rights reserved.
 #
@@ -381,7 +381,7 @@ ${IMGBASE}.img:	${TARGETFS} ${WORKLABEL}
 .endif
 	${TOOL_DISKLABEL} -R -F ${WORKIMG} ${WORKLABEL}
 .if !empty(PRIMARY_BOOT)  ${INSTALLBOOT_AFTER_DISKLABEL} != no
-	${TOOL_INSTALLBOOT} -v -m ${MACHINE} ${INSTALLBOOTOPTOINS} ${WORKIMG} \
+	${TOOL_INSTALLBOOT} -v -m ${MACHINE} ${INSTALLBOOTOPTIONS} ${WORKIMG} \
 	${WORKDIR}/usr/mdec/${PRIMARY_BOOT}
 .endif
 	mv ${WORKIMG} ${.TARGET}



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

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

Module Name:   src
Committed By:  snj
Date:  Thu Mar 12 04:41:23 UTC 2015

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

Log Message:
unbreak amd64 install images by passing ipty to MAKEDEV.  revision 1.21
of etc/etc.amd64/MAKEDEV.conf removed them from 'all'.  (hi christos!)

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

christos



CVS commit: src/distrib/common/bootimage

2015-03-11 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Thu Mar 12 04:41:23 UTC 2015

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

Log Message:
unbreak amd64 install images by passing ipty to MAKEDEV.  revision 1.21
of etc/etc.amd64/MAKEDEV.conf removed them from 'all'.  (hi christos!)


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/distrib/common/bootimage/Makefile.bootimage

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

Modified files:

Index: src/distrib/common/bootimage/Makefile.bootimage
diff -u src/distrib/common/bootimage/Makefile.bootimage:1.9 src/distrib/common/bootimage/Makefile.bootimage:1.10
--- src/distrib/common/bootimage/Makefile.bootimage:1.9	Tue Aug  5 15:40:58 2014
+++ src/distrib/common/bootimage/Makefile.bootimage	Thu Mar 12 04:41:23 2015
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.bootimage,v 1.9 2014/08/05 15:40:58 apb Exp $
+#	$NetBSD: Makefile.bootimage,v 1.10 2015/03/12 04:41:23 snj Exp $
 #
 # Copyright (c) 2009, 2010, 2011 Izumi Tsutsui.  All rights reserved.
 #
@@ -276,7 +276,7 @@ ${TARGETFS}: prepare_md_post
 	${RM} -f ${WORKSPEC}
 	cat ${WORKDIR}/etc/mtree/* |	\
 	${TOOL_SED} -e 's/ size=[0-9]*//'  ${WORKSPEC}
-	${HOST_SH} ${WORKDIR}/dev/MAKEDEV -s all |			\
+	${HOST_SH} ${WORKDIR}/dev/MAKEDEV -s all ipty |			\
 	${TOOL_SED} -e '/^\. type=dir/d' -e 's,^\.,./dev,'  ${WORKSPEC}
 	cat ${SPEC_IN}  ${WORKSPEC}
 .if defined(SECONDARY_BOOT)



CVS commit: src/distrib/common/bootimage

2015-03-11 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Thu Mar 12 04:41:23 UTC 2015

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

Log Message:
unbreak amd64 install images by passing ipty to MAKEDEV.  revision 1.21
of etc/etc.amd64/MAKEDEV.conf removed them from 'all'.  (hi christos!)


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/distrib/common/bootimage/Makefile.bootimage

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



CVS commit: src/distrib/common/bootimage

2012-11-20 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Tue Nov 20 20:16:04 UTC 2012

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

Log Message:
Don't enable WAPBL in images.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/distrib/common/bootimage/fstab.in \
src/distrib/common/bootimage/fstab.install.in

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

Modified files:

Index: src/distrib/common/bootimage/fstab.in
diff -u src/distrib/common/bootimage/fstab.in:1.1 src/distrib/common/bootimage/fstab.in:1.2
--- src/distrib/common/bootimage/fstab.in:1.1	Sun Jan 22 03:53:30 2012
+++ src/distrib/common/bootimage/fstab.in	Tue Nov 20 20:16:03 2012
@@ -1,4 +1,4 @@
-/dev/@@BOOTDISK@@a	/		ffs	rw,log		1 1
+/dev/@@BOOTDISK@@a	/		ffs	rw		1 1
 /dev/@@BOOTDISK@@b	none		none	sw		0 0
 ptyfs		/dev/pts	ptyfs	rw		0 0
 kernfs		/kern		kernfs	rw,noauto	0 0
Index: src/distrib/common/bootimage/fstab.install.in
diff -u src/distrib/common/bootimage/fstab.install.in:1.1 src/distrib/common/bootimage/fstab.install.in:1.2
--- src/distrib/common/bootimage/fstab.install.in:1.1	Sun Jan 22 03:53:30 2012
+++ src/distrib/common/bootimage/fstab.install.in	Tue Nov 20 20:16:03 2012
@@ -1,2 +1,2 @@
-/dev/@@BOOTDISK@@a	/		ffs	rw,log		1 1
+/dev/@@BOOTDISK@@a	/		ffs	rw		1 1
 tmpfs			/tmp		tmpfs	rw		0 0



CVS commit: src/distrib/common/bootimage

2012-11-20 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Tue Nov 20 20:16:04 UTC 2012

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

Log Message:
Don't enable WAPBL in images.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/distrib/common/bootimage/fstab.in \
src/distrib/common/bootimage/fstab.install.in

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



CVS commit: src/distrib/common/bootimage

2012-04-22 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sun Apr 22 07:23:43 UTC 2012

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

Log Message:
Fix typo in comments.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/distrib/common/bootimage/Makefile.bootimage
cvs rdiff -u -r1.2 -r1.3 src/distrib/common/bootimage/Makefile.installimage

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

Modified files:

Index: src/distrib/common/bootimage/Makefile.bootimage
diff -u src/distrib/common/bootimage/Makefile.bootimage:1.5 src/distrib/common/bootimage/Makefile.bootimage:1.6
--- src/distrib/common/bootimage/Makefile.bootimage:1.5	Sun Apr 22 05:24:39 2012
+++ src/distrib/common/bootimage/Makefile.bootimage	Sun Apr 22 07:23:42 2012
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.bootimage,v 1.5 2012/04/22 05:24:39 tsutsui Exp $
+#	$NetBSD: Makefile.bootimage,v 1.6 2012/04/22 07:23:42 tsutsui Exp $
 #
 # Copyright (c) 2009, 2010, 2011 Izumi Tsutsui.  All rights reserved.
 #
@@ -39,7 +39,7 @@
 #		(default: sd0)
 #	USE_MBR
 #		set yes if target disk image requires MBR partition
-#		(defautl: no)
+#		(default: no)
 #	MBR_BOOTCODE
 #		optional MBR bootcode which should be installed by fdisk(8)
 #		(default: empty)
@@ -82,7 +82,7 @@
 #			DIR	TARGETPATH
 #		for installation image etc.
 #		(default: empty)
-#		XXX: currently permittions in IMGDIR_EXTRA are not handled
+#		XXX: currently permissions in IMGDIR_EXTRA are not handled
 #	IMGDIR_EXCLUDE
 #		pax(1) options to exclude files which should not copied
 #		into TARGETPATH in IMGDIR_EXTRA

Index: src/distrib/common/bootimage/Makefile.installimage
diff -u src/distrib/common/bootimage/Makefile.installimage:1.2 src/distrib/common/bootimage/Makefile.installimage:1.3
--- src/distrib/common/bootimage/Makefile.installimage:1.2	Sun Jan 22 16:50:00 2012
+++ src/distrib/common/bootimage/Makefile.installimage	Sun Apr 22 07:23:42 2012
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.installimage,v 1.2 2012/01/22 16:50:00 tsutsui Exp $
+#	$NetBSD: Makefile.installimage,v 1.3 2012/04/22 07:23:42 tsutsui Exp $
 #
 # Common Makefile to create a bootable installation image for USB flash etc.
 #
@@ -35,7 +35,7 @@ DISKPROTO_IN?=	${NETBSDSRCDIR}/distrib/c
 DISKPROTO_IN?=	${NETBSDSRCDIR}/distrib/common/bootimage/diskproto.noswap.in
 .endif
 
-# XXX: no permittion info for makefs(8)
+# XXX: no permission info for makefs(8)
 IMGDIR_EXTRA=	${RELEASEDIR}/${RELEASEMACHINEDIR}	${RELEASEMACHINEDIR}
 IMGDIR_EXCLUDE= 	-s ',./installation/cdrom.*,,gp'
 IMGDIR_EXCLUDE+=	-s ',./installation/liveimage.*,,gp'



CVS commit: src/distrib/common/bootimage

2012-04-22 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sun Apr 22 07:23:43 UTC 2012

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

Log Message:
Fix typo in comments.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/distrib/common/bootimage/Makefile.bootimage
cvs rdiff -u -r1.2 -r1.3 src/distrib/common/bootimage/Makefile.installimage

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



CVS commit: src/distrib/common/bootimage

2012-04-21 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sun Apr 22 05:24:39 UTC 2012

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

Log Message:
Add two optional variables for liveimage/installimage builds:
---
MBR_BOOTCODE
optional MBR bootcode which should be installed by fdisk(8)
(default: empty)
- specified MBR_BOOTCODE must exist in ${DESTDIR}/usr/mdec
- if MBR_BOOTCODE is not specified,
  MBR_DEFAULT_BOOTCODE (default: mbr) will be used
  if the target ${MACHINE} has the one in /usr/mdec

INSTALLBOOTOPTIONS
options passed to installboot(8), e.g., -o console=com0
(default: empty)
---
Proposed by Brook Milligan on current-users@:
http://mail-index.NetBSD.org/current-users/2012/04/16/msg019892.html

Also make USE_MBR work on ${MACHINE}s which don't have the default
/usr/mdec/mbr bootcode. (no such port has the liveimage target yet though)

XXX: tools fdisk(8) implicitly uses host's /usr/mdec/mbr for the default
XXX: bootcode even for non-x86 targets if host is x86


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

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

Modified files:

Index: src/distrib/common/bootimage/Makefile.bootimage
diff -u src/distrib/common/bootimage/Makefile.bootimage:1.4 src/distrib/common/bootimage/Makefile.bootimage:1.5
--- src/distrib/common/bootimage/Makefile.bootimage:1.4	Mon Apr  9 19:22:49 2012
+++ src/distrib/common/bootimage/Makefile.bootimage	Sun Apr 22 05:24:39 2012
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.bootimage,v 1.4 2012/04/09 19:22:49 riz Exp $
+#	$NetBSD: Makefile.bootimage,v 1.5 2012/04/22 05:24:39 tsutsui Exp $
 #
 # Copyright (c) 2009, 2010, 2011 Izumi Tsutsui.  All rights reserved.
 #
@@ -40,6 +40,13 @@
 #	USE_MBR
 #		set yes if target disk image requires MBR partition
 #		(defautl: no)
+#	MBR_BOOTCODE
+#		optional MBR bootcode which should be installed by fdisk(8)
+#		(default: empty)
+#		- specified MBR_BOOTCODE must exist in ${DESTDIR}/usr/mdec
+#		- if MBR_BOOTCODE is not specified,
+#		  MBR_DEFAULT_BOOTCODE (default: mbr) will be used
+#		  if the target ${MACHINE} has the one in /usr/mdec
 #	USE_SUNLABEL
 #		set yes if target disk image requires Sun's label
 #		(default: no)
@@ -92,6 +99,9 @@
 #	IMGMAKEFSOPTIONS
 #		options passed to makefs(8) to create root file system
 #		(default: -o bsize=16384,fsize=2048,density=8192)
+#	INSTALLBOOTOPTIONS
+#		options passed to installboot(8), e.g., -o console=com0
+#		(default: empty)
 #	PRIMARY_BOOT
 #		primary boot loader that should be installed into
 #		the target image via installboot(8)
@@ -286,7 +296,7 @@ ${TARGETFS}: prepare_md_post
 	${IMGMAKEFSOPTIONS}		\
 	${WORKFS} ${WORKDIR}
 .if !empty(PRIMARY_BOOT)  ${INSTALLBOOT_AFTER_DISKLABEL} == no
-	${TOOL_INSTALLBOOT} -vm ${MACHINE} ${WORKFS} \
+	${TOOL_INSTALLBOOT} -v -m ${MACHINE} ${INSTALLBOOTOPTIONS} ${WORKFS} \
 	${WORKDIR}/usr/mdec/${PRIMARY_BOOT} ${SECONDARY_BOOT_ARG}
 .endif
 	@echo done.
@@ -301,6 +311,8 @@ DISKPROTO_IN?=	${DISTRIBDIR}/common/boot
 DISKPROTO_IN?=	${DISTRIBDIR}/common/bootimage/diskproto.in
 .endif
 
+MBR_DEFAULT_BOOTCODE?=	mbr
+
 OMIT_SWAPIMG?=	no
 
 WORKMBR?=	work.mbr
@@ -328,14 +340,30 @@ ${WORKLABEL}:
 	mv ${WORKLABEL}.tmp ${WORKLABEL}
 
 ${IMGBASE}.img:	${TARGETFS} ${WORKLABEL}
-.if ${LABELSECTORS} != 0
+.if ${USE_MBR} != no
 	@echo creating MBR labels...
 	${DD} if=/dev/zero of=${WORKMBR} seek=$$((${IMAGESECTORS} - 1)) count=1
-	${TOOL_FDISK} -f -u \
+	${TOOL_FDISK} -f -i -u \
 	-b ${MBRCYLINDERS}/${MBRHEADS}/${MBRSECTORS}		\
 	-0 -a -s ${MBRNETBSD}/${FSOFFSET}/${BSDPARTSECTORS}		\
-	-i -c ${WORKDIR}/usr/mdec/mbr\
 	-F ${WORKMBR}
+.if empty(MBR_BOOTCODE)
+	@if [ -f ${WORKDIR}/usr/mdec/${MBR_DEFAULT_BOOTCODE} ]; then 	\
+		echo ${TOOL_FDISK} -f	\
+		-i -c ${WORKDIR}/usr/mdec/${MBR_DEFAULT_BOOTCODE}	\
+		-F ${WORKMBR};	\
+		${TOOL_FDISK} -f	\
+		-i -c ${WORKDIR}/usr/mdec/${MBR_DEFAULT_BOOTCODE}	\
+		-F ${WORKMBR};	\
+	fi
+.else
+	@if [ ! -f ${WORKDIR}/usr/mdec/${MBR_BOOTCODE} ]; then 		\
+		echo ${MBR_BOOTCODE} is not found in DESTDIR/usr/mdec, aborting; \
+		false; 			\
+	fi
+	${TOOL_FDISK} -f -i -c ${WORKDIR}/usr/mdec/${MBR_BOOTCODE}	\
+	-F ${WORKMBR}
+.endif
 	${DD} if=${WORKMBR} count=${LABELSECTORS} |			\
 	${CAT} - ${TARGETFS}  ${WORKIMG}
 .else
@@ -354,7 +382,7 @@ ${IMGBASE}.img:	${TARGETFS} ${WORKLABEL}
 .endif
 	${TOOL_DISKLABEL} -R -F ${WORKIMG} ${WORKLABEL}
 .if !empty(PRIMARY_BOOT)  ${INSTALLBOOT_AFTER_DISKLABEL} != no
-	${TOOL_INSTALLBOOT}  -vm ${MACHINE} ${WORKIMG}			\
+	${TOOL_INSTALLBOOT} -v -m ${MACHINE} ${INSTALLBOOTOPTOINS} ${WORKIMG} \
 	${WORKDIR}/usr/mdec/${PRIMARY_BOOT}
 .endif
 	mv ${WORKIMG} ${.TARGET}



CVS commit: src/distrib/common/bootimage

2012-04-21 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sun Apr 22 05:24:39 UTC 2012

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

Log Message:
Add two optional variables for liveimage/installimage builds:
---
MBR_BOOTCODE
optional MBR bootcode which should be installed by fdisk(8)
(default: empty)
- specified MBR_BOOTCODE must exist in ${DESTDIR}/usr/mdec
- if MBR_BOOTCODE is not specified,
  MBR_DEFAULT_BOOTCODE (default: mbr) will be used
  if the target ${MACHINE} has the one in /usr/mdec

INSTALLBOOTOPTIONS
options passed to installboot(8), e.g., -o console=com0
(default: empty)
---
Proposed by Brook Milligan on current-users@:
http://mail-index.NetBSD.org/current-users/2012/04/16/msg019892.html

Also make USE_MBR work on ${MACHINE}s which don't have the default
/usr/mdec/mbr bootcode. (no such port has the liveimage target yet though)

XXX: tools fdisk(8) implicitly uses host's /usr/mdec/mbr for the default
XXX: bootcode even for non-x86 targets if host is x86


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

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



CVS commit: src/distrib/common/bootimage

2012-04-09 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Mon Apr  9 19:22:49 UTC 2012

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

Log Message:
s/Createing/Creating/


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

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

Modified files:

Index: src/distrib/common/bootimage/Makefile.bootimage
diff -u src/distrib/common/bootimage/Makefile.bootimage:1.3 src/distrib/common/bootimage/Makefile.bootimage:1.4
--- src/distrib/common/bootimage/Makefile.bootimage:1.3	Sun Jan 22 16:56:22 2012
+++ src/distrib/common/bootimage/Makefile.bootimage	Mon Apr  9 19:22:49 2012
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.bootimage,v 1.3 2012/01/22 16:56:22 tsutsui Exp $
+#	$NetBSD: Makefile.bootimage,v 1.4 2012/04/09 19:22:49 riz Exp $
 #
 # Copyright (c) 2009, 2010, 2011 Izumi Tsutsui.  All rights reserved.
 #
@@ -277,7 +277,7 @@ ${TARGETFS}: prepare_md_post
 .if defined(SPEC_EXTRA)
 	cat ${SPEC_EXTRA}  ${WORKSPEC}
 .endif
-	@echo Createing rootfs...
+	@echo Creating rootfs...
 	# XXX /var/spool/ftp/hidden is unreadable
 	${CHMOD} +r ${WORKDIR}/var/spool/ftp/hidden
 	${TOOL_MAKEFS} -M ${FSSIZE} -m ${FSSIZE}			\



CVS commit: src/distrib/common/bootimage

2012-04-09 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Mon Apr  9 19:22:49 UTC 2012

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

Log Message:
s/Createing/Creating/


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

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



CVS commit: src/distrib/common/bootimage

2012-01-22 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sun Jan 22 16:50:00 UTC 2012

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

Log Message:
Fix checks for RELEASEDIR (and IMGBASE) variables to perform it
only on live_image or install_image targets.  PR toolchain/45864


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/distrib/common/bootimage/Makefile.bootimage \
src/distrib/common/bootimage/Makefile.installimage \
src/distrib/common/bootimage/Makefile.liveimage

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

Modified files:

Index: src/distrib/common/bootimage/Makefile.bootimage
diff -u src/distrib/common/bootimage/Makefile.bootimage:1.1 src/distrib/common/bootimage/Makefile.bootimage:1.2
--- src/distrib/common/bootimage/Makefile.bootimage:1.1	Sun Jan 22 03:53:30 2012
+++ src/distrib/common/bootimage/Makefile.bootimage	Sun Jan 22 16:50:00 2012
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.bootimage,v 1.1 2012/01/22 03:53:30 tsutsui Exp $
+#	$NetBSD: Makefile.bootimage,v 1.2 2012/01/22 16:50:00 tsutsui Exp $
 #
 # Copyright (c) 2009, 2010, 2011 Izumi Tsutsui.  All rights reserved.
 #
@@ -123,11 +123,6 @@
 	@echo Error: IMGBASE is not set
 	@false
 .endif
-.if empty(RELEASEDIR)
-.BEGIN:
-	@echo Error: RELEASEDIR is not set
-	@false
-.endif
 
 # should be defined elsewhere? 
 CAT?=		cat
Index: src/distrib/common/bootimage/Makefile.installimage
diff -u src/distrib/common/bootimage/Makefile.installimage:1.1 src/distrib/common/bootimage/Makefile.installimage:1.2
--- src/distrib/common/bootimage/Makefile.installimage:1.1	Sun Jan 22 03:53:30 2012
+++ src/distrib/common/bootimage/Makefile.installimage	Sun Jan 22 16:50:00 2012
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.installimage,v 1.1 2012/01/22 03:53:30 tsutsui Exp $
+#	$NetBSD: Makefile.installimage,v 1.2 2012/01/22 16:50:00 tsutsui Exp $
 #
 # Common Makefile to create a bootable installation image for USB flash etc.
 #
@@ -11,15 +11,14 @@
 # See Makefile.bootimage for other variables.
 #
 
-.if empty(INSTIMGBASE)
-.BEGIN:
+.if !target(check_INSTIMGBASE)
+check_INSTIMGBASE: .PHONY .NOTMAIN
+.if !defined(INSTIMGBASE)
 	@echo Error: INSTIMGBASE is not set
 	@false
+.else
+	@true
 .endif
-.if empty(RELEASEDIR)
-.BEGIN:
-	@echo Error: RELEASEDIR is not set
-	@false
 .endif
 
 SWAPMB=		0			# no swap
@@ -54,7 +53,7 @@ INSTIMG_RELEASEDIR?=	${RELEASEMACHINEDIR
 # should be defined elsewhere? 
 MKDIR?=		mkdir -p
 
-install_image: ${IMGBASE}.img.gz
+install_image: check_INSTIMGBASE check_RELEASEDIR ${IMGBASE}.img.gz
 	${MKDIR} ${INSTIMG_RELEASEDIR}
 	${RELEASE_INSTALL} ${IMGBASE}.img.gz ${INSTIMG_RELEASEDIR}
 	# note ${MAKESUM} will be calculated in src/etc/Makefile
Index: src/distrib/common/bootimage/Makefile.liveimage
diff -u src/distrib/common/bootimage/Makefile.liveimage:1.1 src/distrib/common/bootimage/Makefile.liveimage:1.2
--- src/distrib/common/bootimage/Makefile.liveimage:1.1	Sun Jan 22 03:53:30 2012
+++ src/distrib/common/bootimage/Makefile.liveimage	Sun Jan 22 16:50:00 2012
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.liveimage,v 1.1 2012/01/22 03:53:30 tsutsui Exp $
+#	$NetBSD: Makefile.liveimage,v 1.2 2012/01/22 16:50:00 tsutsui Exp $
 #
 # Common Makefile to create a bootable FS image for USB flash or emulators
 #
@@ -11,15 +11,14 @@
 # See Makefile.bootimage for other variables.
 #
 
-.if empty(LIVEIMGBASE)
-.BEGIN:
+.if !target(check_LIVEIMGBASE)
+check_LIVEIMGBASE: .PHONY .NOTMAIN
+.if !defined(LIVEIMGBASE)
 	@echo Error: LIVEIMGBASE is not set
 	@false
+.else
+	@true
 .endif
-.if empty(RELEASEDIR)
-.BEGIN:
-	@echo Error: RELEASEDIR is not set
-	@false
 .endif
 
 IMGBASE=	${LIVEIMGBASE}
@@ -34,7 +33,7 @@ LIVEIMG_RELEASEDIR?=	${RELEASEMACHINEDIR
 # should be defined elsewhere? 
 MKDIR?=		mkdir -p
 
-live_image: ${IMGBASE}.img.gz
+live_image: check_LIVEIMGBASE check_RELEASEDIR ${IMGBASE}.img.gz
 	${MKDIR} ${LIVEIMG_RELEASEDIR}
 	${RELEASE_INSTALL} ${IMGBASE}.img.gz ${LIVEIMG_RELEASEDIR}
 	# note ${MAKESUM} will be calculated in src/etc/Makefile



CVS commit: src/distrib/common/bootimage

2012-01-22 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sun Jan 22 16:56:22 UTC 2012

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

Log Message:
Appease warnings `expr 0 \* 1024 \* 1024 / 512 returned non-zero status.'

SWAPMB could be zero (in install-image case) and
expr(1) returns exit status 1 in that case.  Umm.


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

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

Modified files:

Index: src/distrib/common/bootimage/Makefile.bootimage
diff -u src/distrib/common/bootimage/Makefile.bootimage:1.2 src/distrib/common/bootimage/Makefile.bootimage:1.3
--- src/distrib/common/bootimage/Makefile.bootimage:1.2	Sun Jan 22 16:50:00 2012
+++ src/distrib/common/bootimage/Makefile.bootimage	Sun Jan 22 16:56:22 2012
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.bootimage,v 1.2 2012/01/22 16:50:00 tsutsui Exp $
+#	$NetBSD: Makefile.bootimage,v 1.3 2012/01/22 16:56:22 tsutsui Exp $
 #
 # Copyright (c) 2009, 2010, 2011 Izumi Tsutsui.  All rights reserved.
 #
@@ -146,8 +146,9 @@ INSTALLBOOT_AFTER_DISKLABEL?=	no
 IMAGEMB?=	2048		# 2048MB
 SWAPMB?=	128		# 128MB
 
+# XXX: SWAPMB could be zero and expr(1) returns exit status 1 in that case
 IMAGESECTORS!=	expr ${IMAGEMB} \* 1024 \* 1024 / 512
-SWAPSECTORS!=	expr ${SWAPMB} \* 1024 \* 1024 / 512
+SWAPSECTORS!=	expr ${SWAPMB} \* 1024 \* 1024 / 512 || true
 
 .if ${USE_MBR} == no
 LABELSECTORS?=	0
@@ -176,7 +177,7 @@ SWAPOFFSET!=	expr ${LABELSECTORS} + ${FS
 
 # parameters for sunlabel
 FSCYLINDERS!=	expr ${FSSECTORS} / \( ${HEADS} \* ${SECTORS} \)
-SWAPCYLINDERS!=	expr ${SWAPSECTORS} / \( ${HEADS} \* ${SECTORS} \)
+SWAPCYLINDERS!=	expr ${SWAPSECTORS} / \( ${HEADS} \* ${SECTORS} \) || true
 
 
 #



CVS commit: src/distrib/common/bootimage

2012-01-22 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sun Jan 22 16:50:00 UTC 2012

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

Log Message:
Fix checks for RELEASEDIR (and IMGBASE) variables to perform it
only on live_image or install_image targets.  PR toolchain/45864


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/distrib/common/bootimage/Makefile.bootimage \
src/distrib/common/bootimage/Makefile.installimage \
src/distrib/common/bootimage/Makefile.liveimage

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



CVS commit: src/distrib/common/bootimage

2012-01-22 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sun Jan 22 16:56:22 UTC 2012

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

Log Message:
Appease warnings `expr 0 \* 1024 \* 1024 / 512 returned non-zero status.'

SWAPMB could be zero (in install-image case) and
expr(1) returns exit status 1 in that case.  Umm.


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

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