CVS commit: src/distrib/utils/embedded/files

2021-07-20 Thread Olaf Seibert
Module Name:src
Committed By:   rhialto
Date:   Tue Jul 20 19:31:23 UTC 2021

Modified Files:
src/distrib/utils/embedded/files: ec2_init

Log Message:
Extract just the random bits to feed to /dev/urandom.

This makes no difference in the randomness of the pool, but it improves
on the estimation (if any) of how many random bits were obtained.
Also make the ftp -q time out a bit longer since I got some time outs.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/distrib/utils/embedded/files/ec2_init

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

Modified files:

Index: src/distrib/utils/embedded/files/ec2_init
diff -u src/distrib/utils/embedded/files/ec2_init:1.3 src/distrib/utils/embedded/files/ec2_init:1.4
--- src/distrib/utils/embedded/files/ec2_init:1.3	Thu Jul 15 19:03:17 2021
+++ src/distrib/utils/embedded/files/ec2_init	Tue Jul 20 19:31:23 2021
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# $NetBSD: ec2_init,v 1.3 2021/07/15 19:03:17 rhialto Exp $
+# $NetBSD: ec2_init,v 1.4 2021/07/20 19:31:23 rhialto Exp $
 #
 # PROVIDE: ec2_init
 # REQUIRE: NETWORKING
@@ -28,6 +28,11 @@ ec2_newuser()
 	useradd -g users -G wheel,operator -m "${EC2_USER}"
 }
 
+extract_random_seed()
+{
+	sed -n -e '/random_seed/s/.*"random_seed": *"\([A-Za-z0-9+/=]*\)".*/\1/p'
+}
+
 ec2_init()
 {
 	(
@@ -38,7 +43,7 @@ ec2_init()
 	try=0
 	while [ $((try++)) -lt 20 ]
 	do
-		HOSTNAME=$(ftp -o - -q 1 "${METADATA_URL}${HOSTNAME_URL}")
+		HOSTNAME=$(ftp -o - -q 2 "${METADATA_URL}${HOSTNAME_URL}")
 		if [ -n "$HOSTNAME" ]; then
 			echo "Setting EC2 hostname: ${HOSTNAME}"
 			echo "$HOSTNAME" > /etc/myname
@@ -53,7 +58,7 @@ ec2_init()
 	id "${EC2_USER}" >/dev/null 2>&1 || ec2_newuser
 
 	# fetch the public key from Amazon Web Services
-	EC2_SSH_KEY=$(ftp -o - -q 1 "${METADATA_URL}${SSH_KEY_URL}")
+	EC2_SSH_KEY=$(ftp -o - -q 2 "${METADATA_URL}${SSH_KEY_URL}")
 
 	if [ -n "$EC2_SSH_KEY" ]; then
 		# A key pair is associated with this instance, add it
@@ -71,10 +76,11 @@ ec2_init()
 		fi
 	fi
 
-	# May contain a "random_seed". Everything else doesn't matter.
-	OS_METADATA="$(ftp -o - -q 1 ${OS_METADATA_URL})"
+	# May contain a "random_seed".
+	OS_METADATA="$(ftp -o - -q 2 ${OS_METADATA_URL})"
 	if echo "$OS_METADATA" | grep -q random_seed; then
-		echo "$OS_METADATA" >> /dev/urandom
+		echo "$OS_METADATA" | extract_random_seed |
+		base64 -di >> /dev/urandom
 	fi
 	)
 }



CVS commit: src/distrib/utils/embedded/files

2021-07-15 Thread Olaf Seibert
Module Name:src
Committed By:   rhialto
Date:   Thu Jul 15 19:03:17 UTC 2021

Modified Files:
src/distrib/utils/embedded/files: ec2_init

Log Message:
Add some OpenStack support.

I found that in the cloud I tried, by the time this script runs, there
is no default route in effect yet. That takes some 5 to 10 seconds
longer. So I added a retry loop, and to make that easier, changed the
order of queries.  To make sure it doesn't wait ~forever for a
non-existent service I added the -q 1 option to ftp invocations.

I also added OpenStack-specific metadata which contains a different
random_seed of 512 bytes every time it is requested.  See
https://github.com/openstack/nova/blob/master/nova/api/metadata/base.py#L355
It may not be trusted data but only in the strictest sense of the word.
The data can only be observed by people with access to the cloud's
overlay network for the particular VM.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/distrib/utils/embedded/files/ec2_init

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

Modified files:

Index: src/distrib/utils/embedded/files/ec2_init
diff -u src/distrib/utils/embedded/files/ec2_init:1.2 src/distrib/utils/embedded/files/ec2_init:1.3
--- src/distrib/utils/embedded/files/ec2_init:1.2	Thu Jul  1 18:05:45 2021
+++ src/distrib/utils/embedded/files/ec2_init	Thu Jul 15 19:03:17 2021
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# $NetBSD: ec2_init,v 1.2 2021/07/01 18:05:45 jmcneill Exp $
+# $NetBSD: ec2_init,v 1.3 2021/07/15 19:03:17 rhialto Exp $
 #
 # PROVIDE: ec2_init
 # REQUIRE: NETWORKING
@@ -20,6 +20,8 @@ HOSTNAME_URL="hostname"
 
 SSH_KEY_FILE="/home/${EC2_USER}/.ssh/authorized_keys"
 
+OS_METADATA_URL="http://169.254.169.254/openstack/latest/meta_data.json";
+
 ec2_newuser()
 {
 	echo "Creating EC2 user account ${EC2_USER}"
@@ -31,11 +33,27 @@ ec2_init()
 	(
 	umask 022
 
+	# set hostname; it may be 5-10 seconds for the metadata service
+	# to  become reachable.
+	try=0
+	while [ $((try++)) -lt 20 ]
+	do
+		HOSTNAME=$(ftp -o - -q 1 "${METADATA_URL}${HOSTNAME_URL}")
+		if [ -n "$HOSTNAME" ]; then
+			echo "Setting EC2 hostname: ${HOSTNAME}"
+			echo "$HOSTNAME" > /etc/myname
+			hostname "$HOSTNAME"
+			break
+		fi
+		echo "EC2 hostname not available yet (try $try)"
+		sleep 1
+	done
+
 	# create EC2 user
 	id "${EC2_USER}" >/dev/null 2>&1 || ec2_newuser
 
-	# fetch the key pair from Amazon Web Services
-	EC2_SSH_KEY=$(ftp -o - "${METADATA_URL}${SSH_KEY_URL}")
+	# fetch the public key from Amazon Web Services
+	EC2_SSH_KEY=$(ftp -o - -q 1 "${METADATA_URL}${SSH_KEY_URL}")
 
 	if [ -n "$EC2_SSH_KEY" ]; then
 		# A key pair is associated with this instance, add it
@@ -48,16 +66,16 @@ ec2_init()
 
 		grep -q "$EC2_SSH_KEY" "$SSH_KEY_FILE"
 		if [ $? -ne 0 ]; then
-			echo "Setting EC2 SSH key pair: ${EC2_SSH_KEY##* }"
+			echo "Setting EC2 SSH public key for user ${EC2_USER}: ${EC2_SSH_KEY##* }"
 			echo "$EC2_SSH_KEY" >> "$SSH_KEY_FILE"
 		fi
 	fi
 
-	# set hostname
-	HOSTNAME=$(ftp -o - "${METADATA_URL}${HOSTNAME_URL}")
-	echo "Setting EC2 hostname: ${HOSTNAME}"
-	echo "$HOSTNAME" > /etc/myname
-	hostname "$HOSTNAME"
+	# May contain a "random_seed". Everything else doesn't matter.
+	OS_METADATA="$(ftp -o - -q 1 ${OS_METADATA_URL})"
+	if echo "$OS_METADATA" | grep -q random_seed; then
+		echo "$OS_METADATA" >> /dev/urandom
+	fi
 	)
 }
 



CVS commit: src/distrib/utils/embedded/conf

2021-07-06 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Tue Jul  6 11:49:36 UTC 2021

Modified Files:
src/distrib/utils/embedded/conf: evbarm.conf evbmips.conf rpi_inst.conf
usermode.conf x86.conf

Log Message:
Disable kernfs on live images -- it is not required.


To generate a diff of this commit:
cvs rdiff -u -r1.38 -r1.39 src/distrib/utils/embedded/conf/evbarm.conf
cvs rdiff -u -r1.2 -r1.3 src/distrib/utils/embedded/conf/evbmips.conf
cvs rdiff -u -r1.17 -r1.18 src/distrib/utils/embedded/conf/rpi_inst.conf
cvs rdiff -u -r1.5 -r1.6 src/distrib/utils/embedded/conf/usermode.conf
cvs rdiff -u -r1.9 -r1.10 src/distrib/utils/embedded/conf/x86.conf

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

Modified files:

Index: src/distrib/utils/embedded/conf/evbarm.conf
diff -u src/distrib/utils/embedded/conf/evbarm.conf:1.38 src/distrib/utils/embedded/conf/evbarm.conf:1.39
--- src/distrib/utils/embedded/conf/evbarm.conf:1.38	Wed Dec 23 10:35:18 2020
+++ src/distrib/utils/embedded/conf/evbarm.conf	Tue Jul  6 11:49:36 2021
@@ -1,4 +1,4 @@
-# $NetBSD: evbarm.conf,v 1.38 2020/12/23 10:35:18 rin Exp $
+# $NetBSD: evbarm.conf,v 1.39 2021/07/06 11:49:36 jmcneill Exp $
 # evbarm shared config
 #
 image=$HOME/${board}.img
@@ -71,7 +71,6 @@ make_fstab_evbarm_gpt() {
 # See /usr/share/examples/fstab/ for more examples.
 NAME=${gpt_label_ffs:-netbsd-root}	/		ffs	rw,noatime	1 1
 NAME=${gpt_label_boot:-EFI}		/boot		msdos	rw	1 1
-kernfs		/kern		kernfs	rw
 ptyfs		/dev/pts	ptyfs	rw
 procfs		/proc		procfs	rw
 tmpfs		/var/shm	tmpfs	rw,-m1777,-sram%25
@@ -84,7 +83,6 @@ make_fstab_evbarm_normal() {
 # See /usr/share/examples/fstab/ for more examples.
 ROOT.a		/		ffs	rw,noatime	1 1
 ROOT.e		/boot		msdos	rw	1 1
-kernfs		/kern		kernfs	rw
 ptyfs		/dev/pts	ptyfs	rw
 procfs		/proc		procfs	rw
 tmpfs		/var/shm	tmpfs	rw,-m1777,-sram%25
@@ -100,7 +98,6 @@ make_fstab_evbarm_minwrites() {
 # See /usr/share/examples/fstab/ for more examples.
 ROOT.a		/			ffs	rw,log,noatime,nodevmtime 1 1
 ROOT.e		/boot			msdos	rw			  1 1
-kernfs		/kern			kernfs	rw
 ptyfs		/dev/pts		ptyfs	rw
 procfs		/proc			procfs	rw
 tmpfs		/tmp			tmpfs	rw,-s32M
@@ -128,8 +125,6 @@ make_fstab_evbarm() {
 	# Missing mount points from fstab
 	echo "./proc type=dir uname=root gname=wheel mode=0755" \
 	>> "$tmp/selected_sets"
-	echo "./kern type=dir uname=root gname=wheel mode=0755" \
-	>> "$tmp/selected_sets"
 }
 
 customize_evbarm() {

Index: src/distrib/utils/embedded/conf/evbmips.conf
diff -u src/distrib/utils/embedded/conf/evbmips.conf:1.2 src/distrib/utils/embedded/conf/evbmips.conf:1.3
--- src/distrib/utils/embedded/conf/evbmips.conf:1.2	Wed Dec 23 10:35:18 2020
+++ src/distrib/utils/embedded/conf/evbmips.conf	Tue Jul  6 11:49:36 2021
@@ -1,4 +1,4 @@
-# $NetBSD: evbmips.conf,v 1.2 2020/12/23 10:35:18 rin Exp $
+# $NetBSD: evbmips.conf,v 1.3 2021/07/06 11:49:36 jmcneill Exp $
 # evbmips shared config
 #
 image=$HOME/${board}.img
@@ -71,7 +71,6 @@ make_fstab_evbmips_gpt() {
 # See /usr/share/examples/fstab/ for more examples.
 NAME=${gpt_label_ffs:-netbsd-root}	/		ffs	rw,noatime	1 1
 NAME=${gpt_label_boot:-boot}		/boot		msdos	rw	1 1
-kernfs		/kern		kernfs	rw
 ptyfs		/dev/pts	ptyfs	rw
 procfs		/proc		procfs	rw
 tmpfs		/var/shm	tmpfs	rw,-m1777,-sram%25
@@ -84,7 +83,6 @@ make_fstab_evbmips_normal() {
 # See /usr/share/examples/fstab/ for more examples.
 ROOT.a		/		ffs	rw,noatime	1 1
 ROOT.e		/boot		msdos	rw	1 1
-kernfs		/kern		kernfs	rw
 ptyfs		/dev/pts	ptyfs	rw
 procfs		/proc		procfs	rw
 tmpfs		/var/shm	tmpfs	rw,-m1777,-sram%25
@@ -100,7 +98,6 @@ make_fstab_evbmips_minwrites() {
 # See /usr/share/examples/fstab/ for more examples.
 ROOT.a		/			ffs	rw,log,noatime,nodevmtime 1 1
 ROOT.e		/boot			msdos	rw			  1 1
-kernfs		/kern			kernfs	rw
 ptyfs		/dev/pts		ptyfs	rw
 procfs		/proc			procfs	rw
 tmpfs		/tmp			tmpfs	rw,-s32M
@@ -128,8 +125,6 @@ make_fstab_evbmips() {
 	# Missing mount points from fstab
 	echo "./proc type=dir uname=root gname=wheel mode=0755" \
 	>> "$tmp/selected_sets"
-	echo "./kern type=dir uname=root gname=wheel mode=0755" \
-	>> "$tmp/selected_sets"
 }
 
 customize_evbmips() {

Index: src/distrib/utils/embedded/conf/rpi_inst.conf
diff -u src/distrib/utils/embedded/conf/rpi_inst.conf:1.17 src/distrib/utils/embedded/conf/rpi_inst.conf:1.18
--- src/distrib/utils/embedded/conf/rpi_inst.conf:1.17	Tue Dec  1 04:21:10 2020
+++ src/distrib/utils/embedded/conf/rpi_inst.conf	Tue Jul  6 11:49:36 2021
@@ -1,4 +1,4 @@
-# $NetBSD: rpi_inst.conf,v 1.17 2020/12/01 04:21:10 rin Exp $
+# $NetBSD: rpi_inst.conf,v 1.18 2021/07/06 11:49:36 jmcneill Exp $
 # Raspberry Pi customization script used by mkimage
 #
 
@@ -24,7 +24,7 @@ make_label() {
 
 customize() {
 	echo "${bar} creating directories ${bar}"
-	mkdir ${mnt}/proc ${mnt}/kern
+	mkdir ${mnt}/proc
 }
 
 make_fstab() {

Index: src/distrib/utils/embedded/conf/usermode.conf
diff -u src/distrib/utils/embedded/conf/usermode.conf:1.

CVS commit: src/distrib/utils/embedded/files

2021-07-01 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Thu Jul  1 18:05:45 UTC 2021

Modified Files:
src/distrib/utils/embedded/files: ec2_init

Log Message:
AWS marketplace does not allow root ssh logins. Create an ec2-user account
and install the ssh key in that user's home directory instead.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/distrib/utils/embedded/files/ec2_init

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

Modified files:

Index: src/distrib/utils/embedded/files/ec2_init
diff -u src/distrib/utils/embedded/files/ec2_init:1.1 src/distrib/utils/embedded/files/ec2_init:1.2
--- src/distrib/utils/embedded/files/ec2_init:1.1	Fri Nov 30 20:53:02 2018
+++ src/distrib/utils/embedded/files/ec2_init	Thu Jul  1 18:05:45 2021
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# $NetBSD: ec2_init,v 1.1 2018/11/30 20:53:02 jmcneill Exp $
+# $NetBSD: ec2_init,v 1.2 2021/07/01 18:05:45 jmcneill Exp $
 #
 # PROVIDE: ec2_init
 # REQUIRE: NETWORKING
@@ -13,24 +13,37 @@ rcvar=${name}
 start_cmd="ec2_init"
 stop_cmd=":"
 
+EC2_USER="ec2-user"
 METADATA_URL="http://169.254.169.254/latest/meta-data/";
 SSH_KEY_URL="public-keys/0/openssh-key"
 HOSTNAME_URL="hostname"
 
-SSH_KEY_FILE="/root/.ssh/authorized_keys"
+SSH_KEY_FILE="/home/${EC2_USER}/.ssh/authorized_keys"
+
+ec2_newuser()
+{
+	echo "Creating EC2 user account ${EC2_USER}"
+	useradd -g users -G wheel,operator -m "${EC2_USER}"
+}
 
 ec2_init()
 {
 	(
 	umask 022
+
+	# create EC2 user
+	id "${EC2_USER}" >/dev/null 2>&1 || ec2_newuser
+
 	# fetch the key pair from Amazon Web Services
 	EC2_SSH_KEY=$(ftp -o - "${METADATA_URL}${SSH_KEY_URL}")
 
 	if [ -n "$EC2_SSH_KEY" ]; then
 		# A key pair is associated with this instance, add it
-		# to root 'authorized_keys' file
+		# to EC2_USER's 'authorized_keys' file
 		mkdir -p $(dirname "$SSH_KEY_FILE")
+		chown "${EC2_USER}:users" $(dirname "$SSH_KEY_FILE")
 		touch "$SSH_KEY_FILE"
+		chown "${EC2_USER}:users" "$SSH_KEY_FILE"
 		cd $(dirname "$SSH_KEY_FILE")
 
 		grep -q "$EC2_SSH_KEY" "$SSH_KEY_FILE"



CVS commit: src/distrib/utils/embedded/conf

2021-07-01 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Thu Jul  1 17:31:21 UTC 2021

Modified Files:
src/distrib/utils/embedded/conf: arm64mbr.conf

Log Message:
No need for ec2_init on arm64mbr


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/distrib/utils/embedded/conf/arm64mbr.conf

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

Modified files:

Index: src/distrib/utils/embedded/conf/arm64mbr.conf
diff -u src/distrib/utils/embedded/conf/arm64mbr.conf:1.1 src/distrib/utils/embedded/conf/arm64mbr.conf:1.2
--- src/distrib/utils/embedded/conf/arm64mbr.conf:1.1	Thu May 28 10:22:49 2020
+++ src/distrib/utils/embedded/conf/arm64mbr.conf	Thu Jul  1 17:31:21 2021
@@ -1,4 +1,4 @@
-# $NetBSD: arm64mbr.conf,v 1.1 2020/05/28 10:22:49 jmcneill Exp $
+# $NetBSD: arm64mbr.conf,v 1.2 2021/07/01 17:31:21 jmcneill Exp $
 # ARM64 (MBR partitioning) customization script used by mkimage
 #
 board=arm64mbr
@@ -24,16 +24,10 @@ customize() {
 mdnsd=YES
 devpubd=YES
 wscons=\$(dev_exists wsdisplay0)
-ec2_init=\$(dev_exists ena0)
 EOF
 }
 
 populate_common() {
-	# Add EC2 init script
-	cp ${DIR}/files/ec2_init ${mnt}/etc/rc.d/ec2_init
-	echo "./etc/rc.d/ec2_init type=file uname=root gname=wheel mode=0555" \
-	>> "$tmp/selected_sets"
-
 	# Rename kernel to netbsd.img
 	mv "${mnt}/boot/netbsd-${kernel_GENERIC64}.img" "${mnt}/boot/netbsd.img"
 



CVS commit: src/distrib/utils/embedded/conf

2021-07-01 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Thu Jul  1 17:32:07 UTC 2021

Modified Files:
src/distrib/utils/embedded/conf: arm64.conf

Log Message:
port-evbarm/56274: no network on ec2 arm64 9.99.85

Add -w to dhcpcd_flags when running on EC2, since we need to wait for the
network to come up before contacting the metadata service.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/distrib/utils/embedded/conf/arm64.conf

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

Modified files:

Index: src/distrib/utils/embedded/conf/arm64.conf
diff -u src/distrib/utils/embedded/conf/arm64.conf:1.12 src/distrib/utils/embedded/conf/arm64.conf:1.13
--- src/distrib/utils/embedded/conf/arm64.conf:1.12	Fri Jul 17 15:16:34 2020
+++ src/distrib/utils/embedded/conf/arm64.conf	Thu Jul  1 17:32:07 2021
@@ -1,4 +1,4 @@
-# $NetBSD: arm64.conf,v 1.12 2020/07/17 15:16:34 jmcneill Exp $
+# $NetBSD: arm64.conf,v 1.13 2021/07/01 17:32:07 jmcneill Exp $
 # ARM64 customization script used by mkimage
 #
 board=arm64
@@ -29,6 +29,9 @@ mdnsd=YES
 devpubd=YES
 wscons=\$(dev_exists wsdisplay0)
 ec2_init=\$(dev_exists ena0)
+if checkyesno ec2_init ; then
+	dhcpcd_flags="\$dhcpcd_flags -w"
+fi
 EOF
 }
 



CVS commit: src/distrib/utils/embedded

2020-12-23 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Wed Dec 23 10:35:18 UTC 2020

Modified Files:
src/distrib/utils/embedded: mkimage
src/distrib/utils/embedded/conf: evbarm.conf evbmips.conf x86.conf

Log Message:
Fix fallout from mkimage rev 1.76.

For mkimage:

- Update "size" if auto-calculated.
- Use "dd bs=1" instead of non-portable "head -c".
- Some style nits.

For MD make_label() functions:

- Stop using "newsize" as image size in MB, use "size" instead.


To generate a diff of this commit:
cvs rdiff -u -r1.76 -r1.77 src/distrib/utils/embedded/mkimage
cvs rdiff -u -r1.37 -r1.38 src/distrib/utils/embedded/conf/evbarm.conf
cvs rdiff -u -r1.1 -r1.2 src/distrib/utils/embedded/conf/evbmips.conf
cvs rdiff -u -r1.8 -r1.9 src/distrib/utils/embedded/conf/x86.conf

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

Modified files:

Index: src/distrib/utils/embedded/mkimage
diff -u src/distrib/utils/embedded/mkimage:1.76 src/distrib/utils/embedded/mkimage:1.77
--- src/distrib/utils/embedded/mkimage:1.76	Mon Dec 21 16:38:02 2020
+++ src/distrib/utils/embedded/mkimage	Wed Dec 23 10:35:18 2020
@@ -1,5 +1,5 @@
 #!/bin/sh
-# $NetBSD: mkimage,v 1.76 2020/12/21 16:38:02 riastradh Exp $
+# $NetBSD: mkimage,v 1.77 2020/12/23 10:35:18 rin Exp $
 #
 # Copyright (c) 2013, 2014 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -259,15 +259,16 @@ if [ -z "${bootonly}" ]; then
 	-F "$tmp/selected_sets" ${image} "${release}" "${mnt}"
 fi
 
-cursize="$(getsize "${image}")"
 if [ "${size}" = 0 ]; then
-	size="${cursize}"
+	size="$(getsize "${image}")"
 	# Round up to a multiple of 4m and add 1m of slop.
 	alignunit=$((4*1024*1024))
-	alignsize=$((alignunit*((cursize + alignunit - 1)/alignunit)))
+	alignsize=$((alignunit*((size + alignunit - 1)/alignunit)))
 	alignsize=$((alignsize + 1024*1024))
-	if [ $cursize -lt $alignsize ]; then
-		head -c "$((alignsize - cursize))" < /dev/zero >> "${image}"
+	if [ "${size}" -lt "${alignsize}" ]; then
+		dd bs=1 count="$((alignsize - size))" if=/dev/zero \
+			>> "${image}" 2> /dev/null
+		size="${alignsize}"
 	fi
 fi
 

Index: src/distrib/utils/embedded/conf/evbarm.conf
diff -u src/distrib/utils/embedded/conf/evbarm.conf:1.37 src/distrib/utils/embedded/conf/evbarm.conf:1.38
--- src/distrib/utils/embedded/conf/evbarm.conf:1.37	Fri Jul 17 15:16:34 2020
+++ src/distrib/utils/embedded/conf/evbarm.conf	Wed Dec 23 10:35:18 2020
@@ -1,4 +1,4 @@
-# $NetBSD: evbarm.conf,v 1.37 2020/07/17 15:16:34 jmcneill Exp $
+# $NetBSD: evbarm.conf,v 1.38 2020/12/23 10:35:18 rin Exp $
 # evbarm shared config
 #
 image=$HOME/${board}.img
@@ -23,7 +23,7 @@ mkdir -p ${mnt}/boot
 
 make_label_evbarm() {
 	# compute all sizes in terms of sectors
-	local totalsize=$(( ${newsize} * 1024 * 2 / 512 ))
+	local totalsize=$(( ${size} / 512 ))
 
 	local bootsize=$(( ${boot} * 1024 ))
 

Index: src/distrib/utils/embedded/conf/evbmips.conf
diff -u src/distrib/utils/embedded/conf/evbmips.conf:1.1 src/distrib/utils/embedded/conf/evbmips.conf:1.2
--- src/distrib/utils/embedded/conf/evbmips.conf:1.1	Fri Jul 17 15:16:34 2020
+++ src/distrib/utils/embedded/conf/evbmips.conf	Wed Dec 23 10:35:18 2020
@@ -1,4 +1,4 @@
-# $NetBSD: evbmips.conf,v 1.1 2020/07/17 15:16:34 jmcneill Exp $
+# $NetBSD: evbmips.conf,v 1.2 2020/12/23 10:35:18 rin Exp $
 # evbmips shared config
 #
 image=$HOME/${board}.img
@@ -23,7 +23,7 @@ mkdir -p ${mnt}/boot
 
 make_label_evbmips() {
 	# compute all sizes in terms of sectors
-	local totalsize=$(( ${newsize} * 1024 * 2 / 512 ))
+	local totalsize=$(( ${size} / 512 ))
 
 	local bootsize=$(( ${boot} * 1024 ))
 

Index: src/distrib/utils/embedded/conf/x86.conf
diff -u src/distrib/utils/embedded/conf/x86.conf:1.8 src/distrib/utils/embedded/conf/x86.conf:1.9
--- src/distrib/utils/embedded/conf/x86.conf:1.8	Tue Nov 28 02:56:44 2017
+++ src/distrib/utils/embedded/conf/x86.conf	Wed Dec 23 10:35:18 2020
@@ -1,4 +1,4 @@
-# $NetBSD: x86.conf,v 1.8 2017/11/28 02:56:44 kre Exp $
+# $NetBSD: x86.conf,v 1.9 2020/12/23 10:35:18 rin Exp $
 # x86 shared config
 #
 
@@ -15,7 +15,7 @@ ffsoffset=${init}b
 
 make_label() {
 	# compute all sizes in terms of sectors
-	local totalsize=$(( ${newsize} * 1024 * 2 / 512 ))
+	local totalsize=$(( ${size} / 512 ))
 
 	local aoffset=${init}
 	local asize=$(( ${totalsize} - ${aoffset} ))



CVS commit: src/distrib/utils/embedded

2020-12-21 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Mon Dec 21 16:38:02 UTC 2020

Modified Files:
src/distrib/utils/embedded: mkimage

Log Message:
embedded/mkimage: Pad image with zeros to multiple of 4 MB plus 1 MB.

Otherwise, there may not be enough space after the ffs partition for a
gpt, leading to very confusing results.


To generate a diff of this commit:
cvs rdiff -u -r1.75 -r1.76 src/distrib/utils/embedded/mkimage

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

Modified files:

Index: src/distrib/utils/embedded/mkimage
diff -u src/distrib/utils/embedded/mkimage:1.75 src/distrib/utils/embedded/mkimage:1.76
--- src/distrib/utils/embedded/mkimage:1.75	Fri Jul 17 15:16:34 2020
+++ src/distrib/utils/embedded/mkimage	Mon Dec 21 16:38:02 2020
@@ -1,5 +1,5 @@
 #!/bin/sh
-# $NetBSD: mkimage,v 1.75 2020/07/17 15:16:34 jmcneill Exp $
+# $NetBSD: mkimage,v 1.76 2020/12/21 16:38:02 riastradh Exp $
 #
 # Copyright (c) 2013, 2014 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -259,17 +259,17 @@ if [ -z "${bootonly}" ]; then
 	-F "$tmp/selected_sets" ${image} "${release}" "${mnt}"
 fi
 
+cursize="$(getsize "${image}")"
 if [ "${size}" = 0 ]; then
-	size="$(getsize "${image}")"
+	size="${cursize}"
+	# Round up to a multiple of 4m and add 1m of slop.
+	alignunit=$((4*1024*1024))
+	alignsize=$((alignunit*((cursize + alignunit - 1)/alignunit)))
+	alignsize=$((alignsize + 1024*1024))
+	if [ $cursize -lt $alignsize ]; then
+		head -c "$((alignsize - cursize))" < /dev/zero >> "${image}"
+	fi
 fi
-newsize=$((${size} / 2 / 1024))
-compare=$((${newsize} * 2 * 1024))
-while [ "${compare}" != "${size}" ]
-do
-	size="$((size + size - compare))"  
-	newsize="$((${size} / 2 / 1024))"
-	compare="$((${newsize} * 2 * 1024))"
-done  
 
 if $gpt; then
 	if $gpt_hybrid; then



CVS commit: src/distrib/utils/embedded/conf

2020-11-30 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Tue Dec  1 04:21:26 UTC 2020

Modified Files:
src/distrib/utils/embedded/conf: rpi.conf

Log Message:
G/C unused.


To generate a diff of this commit:
cvs rdiff -u -r1.38 -r1.39 src/distrib/utils/embedded/conf/rpi.conf

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

Modified files:

Index: src/distrib/utils/embedded/conf/rpi.conf
diff -u src/distrib/utils/embedded/conf/rpi.conf:1.38 src/distrib/utils/embedded/conf/rpi.conf:1.39
--- src/distrib/utils/embedded/conf/rpi.conf:1.38	Wed May 27 11:02:52 2020
+++ src/distrib/utils/embedded/conf/rpi.conf	Tue Dec  1 04:21:26 2020
@@ -1,11 +1,10 @@
-# $NetBSD: rpi.conf,v 1.38 2020/05/27 11:02:52 jmcneill Exp $
+# $NetBSD: rpi.conf,v 1.39 2020/12/01 04:21:26 rin Exp $
 # Raspberry Pi customization script used by mkimage
 #
 
 board=rpi
 kerneldir=$src/sys/arch/evbarm/compile/RPI/
 kernel=$kerneldir/netbsd-RPI.bin
-kernels_rpi="RPI RPI2"
 resize=true
 
 . ${DIR}/conf/evbarm.conf



CVS commit: src/distrib/utils/embedded/conf

2020-11-30 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Tue Dec  1 04:21:10 UTC 2020

Modified Files:
src/distrib/utils/embedded/conf: rpi_inst.conf

Log Message:
rpi.img: Bump boot partition in a similar manner to other images.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/distrib/utils/embedded/conf/rpi_inst.conf

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

Modified files:

Index: src/distrib/utils/embedded/conf/rpi_inst.conf
diff -u src/distrib/utils/embedded/conf/rpi_inst.conf:1.16 src/distrib/utils/embedded/conf/rpi_inst.conf:1.17
--- src/distrib/utils/embedded/conf/rpi_inst.conf:1.16	Mon May 18 21:19:34 2020
+++ src/distrib/utils/embedded/conf/rpi_inst.conf	Tue Dec  1 04:21:10 2020
@@ -1,4 +1,4 @@
-# $NetBSD: rpi_inst.conf,v 1.16 2020/05/18 21:19:34 jmcneill Exp $
+# $NetBSD: rpi_inst.conf,v 1.17 2020/12/01 04:21:10 rin Exp $
 # Raspberry Pi customization script used by mkimage
 #
 
@@ -12,8 +12,8 @@ image=$HOME/${board}.img
 
 swap=8
 extra=8		# spare space
-boot=112
 init=8
+boot=$(( 192 - ${init} ))
 
 size=$(( 10485760 + ${swap} * 1024 * 512 + ${boot} * 1024 * 512 + ${init} * 1024 * 512 ))
 msdosid=14



CVS commit: src/distrib/utils/embedded/conf

2020-05-28 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Thu May 28 10:19:02 UTC 2020

Modified Files:
src/distrib/utils/embedded/conf: evbarm.conf

Log Message:
Allow config file to override hostname


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/distrib/utils/embedded/conf/evbarm.conf

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

Modified files:

Index: src/distrib/utils/embedded/conf/evbarm.conf
diff -u src/distrib/utils/embedded/conf/evbarm.conf:1.35 src/distrib/utils/embedded/conf/evbarm.conf:1.36
--- src/distrib/utils/embedded/conf/evbarm.conf:1.35	Sun May 24 14:45:49 2020
+++ src/distrib/utils/embedded/conf/evbarm.conf	Thu May 28 10:19:02 2020
@@ -1,4 +1,4 @@
-# $NetBSD: evbarm.conf,v 1.35 2020/05/24 14:45:49 jmcneill Exp $
+# $NetBSD: evbarm.conf,v 1.36 2020/05/28 10:19:02 jmcneill Exp $
 # evbarm shared config
 #
 image=$HOME/${board}.img
@@ -151,7 +151,7 @@ dev_exists() {
 }
 
 rc_configured=YES
-hostname=${board}
+hostname=${hostname:-${board}}
 no_swap=YES
 savecore=NO
 sshd=YES



CVS commit: src/distrib/utils/embedded/conf

2020-05-27 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Wed May 27 21:53:04 UTC 2020

Modified Files:
src/distrib/utils/embedded/conf: armv7.conf

Log Message:
Move back to MBR based images for armv7 because Amlogic's bootloader (for
Amlogic S805 based boards) needs to be installed to sector 1, which
conflicts with the GPT header.


To generate a diff of this commit:
cvs rdiff -u -r1.43 -r1.44 src/distrib/utils/embedded/conf/armv7.conf

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

Modified files:

Index: src/distrib/utils/embedded/conf/armv7.conf
diff -u src/distrib/utils/embedded/conf/armv7.conf:1.43 src/distrib/utils/embedded/conf/armv7.conf:1.44
--- src/distrib/utils/embedded/conf/armv7.conf:1.43	Mon May 25 11:11:52 2020
+++ src/distrib/utils/embedded/conf/armv7.conf	Wed May 27 21:53:04 2020
@@ -1,14 +1,9 @@
-# $NetBSD: armv7.conf,v 1.43 2020/05/25 11:11:52 jmcneill Exp $
+# $NetBSD: armv7.conf,v 1.44 2020/05/27 21:53:04 jmcneill Exp $
 # ARMv7 customization script used by mkimage
 #
 board=armv7
 console=fb
 resize=true
-gpt=true
-gpt_hybrid=true
-gpt_create_flags="-p 16"
-gpt_label_efi="EFI"
-gpt_label_ffs="netbsd-root"
 
 . ${DIR}/conf/evbarm.conf
 
@@ -59,7 +54,7 @@ populate_rpi() {
 	# The GENERIC .img kernel img is used for RPI2
 	if [ -f "${mnt}/boot/netbsd-GENERIC.img" ]; then
 		cat > "${mnt}/boot/cmdline.txt" << EOF
-root=NAME=${gpt_label_ffs} console=${console}
+root=ld0a console=${console}
 #fb=1280x1024		# to select a mode, otherwise try EDID
 #fb=disable		# to disable fb completely
 EOF



CVS commit: src/distrib/utils/embedded/conf

2020-05-27 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Wed May 27 11:02:52 UTC 2020

Modified Files:
src/distrib/utils/embedded/conf: rpi.conf

Log Message:
Fix kernel= order, add pi0w conditional and comments


To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.38 src/distrib/utils/embedded/conf/rpi.conf

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

Modified files:

Index: src/distrib/utils/embedded/conf/rpi.conf
diff -u src/distrib/utils/embedded/conf/rpi.conf:1.37 src/distrib/utils/embedded/conf/rpi.conf:1.38
--- src/distrib/utils/embedded/conf/rpi.conf:1.37	Wed May 27 10:56:59 2020
+++ src/distrib/utils/embedded/conf/rpi.conf	Wed May 27 11:02:52 2020
@@ -1,4 +1,4 @@
-# $NetBSD: rpi.conf,v 1.37 2020/05/27 10:56:59 jmcneill Exp $
+# $NetBSD: rpi.conf,v 1.38 2020/05/27 11:02:52 jmcneill Exp $
 # Raspberry Pi customization script used by mkimage
 #
 
@@ -63,12 +63,17 @@ cmdline=../cmdline.txt
 # UART settings, see https://www.raspberrypi.org/documentation/configuration/uart.md
 enable_uart=1
 force_turbo=0
+# Default kernel for BCM2836 and later
+kernel=/kernel7.img
+# Override kernel for BCM2835 based boards
 [pi0]
 kernel=/kernel.img
+[pi0w]
+kernel=/kernel.img
 [pi1]
 kernel=/kernel.img
 [all]
-kernel=/kernel7.img
+#
 EOF
 
 	echo "${bar} kernel ${kernel} ${bar}"



CVS commit: src/distrib/utils/embedded/conf

2020-05-27 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Wed May 27 10:56:59 UTC 2020

Modified Files:
src/distrib/utils/embedded/conf: rpi.conf

Log Message:
Conditionally boot kernel.img or kernel7.img depending on board


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 src/distrib/utils/embedded/conf/rpi.conf

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

Modified files:

Index: src/distrib/utils/embedded/conf/rpi.conf
diff -u src/distrib/utils/embedded/conf/rpi.conf:1.36 src/distrib/utils/embedded/conf/rpi.conf:1.37
--- src/distrib/utils/embedded/conf/rpi.conf:1.36	Mon May 18 21:19:34 2020
+++ src/distrib/utils/embedded/conf/rpi.conf	Wed May 27 10:56:59 2020
@@ -1,4 +1,4 @@
-# $NetBSD: rpi.conf,v 1.36 2020/05/18 21:19:34 jmcneill Exp $
+# $NetBSD: rpi.conf,v 1.37 2020/05/27 10:56:59 jmcneill Exp $
 # Raspberry Pi customization script used by mkimage
 #
 
@@ -60,10 +60,15 @@ EOF
 upstream_kernel=1
 os_prefix=dtb/
 cmdline=../cmdline.txt
-kernel=/kernel.img
 # UART settings, see https://www.raspberrypi.org/documentation/configuration/uart.md
 enable_uart=1
 force_turbo=0
+[pi0]
+kernel=/kernel.img
+[pi1]
+kernel=/kernel.img
+[all]
+kernel=/kernel7.img
 EOF
 
 	echo "${bar} kernel ${kernel} ${bar}"



CVS commit: src/distrib/utils/embedded/conf

2020-05-25 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Mon May 25 11:11:52 UTC 2020

Modified Files:
src/distrib/utils/embedded/conf: armv7.conf

Log Message:
No need to rename netbsd-GENERIC.img to kernel7.img


To generate a diff of this commit:
cvs rdiff -u -r1.42 -r1.43 src/distrib/utils/embedded/conf/armv7.conf

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

Modified files:

Index: src/distrib/utils/embedded/conf/armv7.conf
diff -u src/distrib/utils/embedded/conf/armv7.conf:1.42 src/distrib/utils/embedded/conf/armv7.conf:1.43
--- src/distrib/utils/embedded/conf/armv7.conf:1.42	Mon May 25 11:06:49 2020
+++ src/distrib/utils/embedded/conf/armv7.conf	Mon May 25 11:11:52 2020
@@ -1,4 +1,4 @@
-# $NetBSD: armv7.conf,v 1.42 2020/05/25 11:06:49 jmcneill Exp $
+# $NetBSD: armv7.conf,v 1.43 2020/05/25 11:11:52 jmcneill Exp $
 # ARMv7 customization script used by mkimage
 #
 board=armv7
@@ -56,11 +56,8 @@ populate_rpi() {
 	firmwaredir="${src}/external/broadcom/rpi-firmware/dist"
 	firmwarefiles="LICENCE.broadcom bootcode.bin fixup.dat fixup_cd.dat start.elf start_cd.elf"
 
-	# The GENERIC .img kernel needs to be installed as kernel7.img for RPI2
+	# The GENERIC .img kernel img is used for RPI2
 	if [ -f "${mnt}/boot/netbsd-GENERIC.img" ]; then
-		echo "${bar} renaming netbsd-GENERIC.img to kernel7.img ${bar}"
-		mv "${mnt}/boot/netbsd-GENERIC.img" "${mnt}/boot/kernel7.img"
-
 		cat > "${mnt}/boot/cmdline.txt" << EOF
 root=NAME=${gpt_label_ffs} console=${console}
 #fb=1280x1024		# to select a mode, otherwise try EDID
@@ -72,7 +69,7 @@ EOF
 upstream_kernel=1
 os_prefix=dtb/
 cmdline=../cmdline.txt
-kernel=/kernel7.img
+kernel=/netbsd-GENERIC.img
 # Boot options, see https://www.raspberrypi.org/documentation/configuration/config-txt/boot.md
 kernel_address=0x0140
 # UART settings, see https://www.raspberrypi.org/documentation/configuration/uart.md



CVS commit: src/distrib/utils/embedded/conf

2020-05-25 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Mon May 25 11:06:49 UTC 2020

Modified Files:
src/distrib/utils/embedded/conf: armv7.conf

Log Message:
Switch to GPT w/ hybrid MBR for armv7 images


To generate a diff of this commit:
cvs rdiff -u -r1.41 -r1.42 src/distrib/utils/embedded/conf/armv7.conf

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

Modified files:

Index: src/distrib/utils/embedded/conf/armv7.conf
diff -u src/distrib/utils/embedded/conf/armv7.conf:1.41 src/distrib/utils/embedded/conf/armv7.conf:1.42
--- src/distrib/utils/embedded/conf/armv7.conf:1.41	Mon May 18 21:19:34 2020
+++ src/distrib/utils/embedded/conf/armv7.conf	Mon May 25 11:06:49 2020
@@ -1,9 +1,14 @@
-# $NetBSD: armv7.conf,v 1.41 2020/05/18 21:19:34 jmcneill Exp $
+# $NetBSD: armv7.conf,v 1.42 2020/05/25 11:06:49 jmcneill Exp $
 # ARMv7 customization script used by mkimage
 #
 board=armv7
 console=fb
 resize=true
+gpt=true
+gpt_hybrid=true
+gpt_create_flags="-p 16"
+gpt_label_efi="EFI"
+gpt_label_ffs="netbsd-root"
 
 . ${DIR}/conf/evbarm.conf
 
@@ -57,7 +62,7 @@ populate_rpi() {
 		mv "${mnt}/boot/netbsd-GENERIC.img" "${mnt}/boot/kernel7.img"
 
 		cat > "${mnt}/boot/cmdline.txt" << EOF
-root=ld0a console=${console}
+root=NAME=${gpt_label_ffs} console=${console}
 #fb=1280x1024		# to select a mode, otherwise try EDID
 #fb=disable		# to disable fb completely
 EOF



CVS commit: src/distrib/utils/embedded/conf

2020-05-24 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun May 24 18:44:47 UTC 2020

Modified Files:
src/distrib/utils/embedded/conf: arm64.conf

Log Message:
Enable GPT support w/ hybrid MBR for Raspberry Pi compatibility.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/distrib/utils/embedded/conf/arm64.conf

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

Modified files:

Index: src/distrib/utils/embedded/conf/arm64.conf
diff -u src/distrib/utils/embedded/conf/arm64.conf:1.10 src/distrib/utils/embedded/conf/arm64.conf:1.11
--- src/distrib/utils/embedded/conf/arm64.conf:1.10	Mon May 18 21:19:34 2020
+++ src/distrib/utils/embedded/conf/arm64.conf	Sun May 24 18:44:46 2020
@@ -1,9 +1,14 @@
-# $NetBSD: arm64.conf,v 1.10 2020/05/18 21:19:34 jmcneill Exp $
+# $NetBSD: arm64.conf,v 1.11 2020/05/24 18:44:46 jmcneill Exp $
 # ARM64 customization script used by mkimage
 #
 board=arm64
 console=fb
 resize=true
+gpt=true
+gpt_hybrid=true
+gpt_create_flags="-p 16"
+gpt_label_efi="EFI"
+gpt_label_ffs="netbsd-root"
 
 . ${DIR}/conf/evbarm.conf
 
@@ -52,11 +57,7 @@ populate_rpi() {
 	firmwarefiles="LICENCE.broadcom bootcode.bin fixup4cd.dat fixup4.dat fixup_cd.dat fixup.dat start4cd.elf start4.elf start_cd.elf start.elf"
 
 	cat > "${mnt}/boot/cmdline.txt" << EOF
-root=ld0a console=${console}
-EOF
-
-	cat > "${mnt}/boot/cmdline-pi4.txt" << EOF
-root=ld1a console=${console}
+root=NAME=${gpt_label_ffs} console=${console}
 EOF
 
 	cat > "${mnt}/boot/config.txt" << EOF
@@ -70,11 +71,6 @@ kernel=/netbsd.img
 kernel_address=0x20
 enable_uart=1
 force_turbo=0
-#
-[pi4]
-cmdline=../../cmdline-pi4.txt
-#
-[all]
 EOF
 
 	echo "${bar} installing firmware files ${bar}"



CVS commit: src/distrib/utils/embedded

2020-05-24 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun May 24 18:43:40 UTC 2020

Modified Files:
src/distrib/utils/embedded: mkimage
src/distrib/utils/embedded/files: resize_gpt

Log Message:
Add support for hybrid MBR/GPT images.


To generate a diff of this commit:
cvs rdiff -u -r1.73 -r1.74 src/distrib/utils/embedded/mkimage
cvs rdiff -u -r1.1 -r1.2 src/distrib/utils/embedded/files/resize_gpt

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

Modified files:

Index: src/distrib/utils/embedded/mkimage
diff -u src/distrib/utils/embedded/mkimage:1.73 src/distrib/utils/embedded/mkimage:1.74
--- src/distrib/utils/embedded/mkimage:1.73	Sun May 24 14:45:49 2020
+++ src/distrib/utils/embedded/mkimage	Sun May 24 18:43:39 2020
@@ -1,5 +1,5 @@
 #!/bin/sh
-# $NetBSD: mkimage,v 1.73 2020/05/24 14:45:49 jmcneill Exp $
+# $NetBSD: mkimage,v 1.74 2020/05/24 18:43:39 jmcneill Exp $
 #
 # Copyright (c) 2013, 2014 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -149,6 +149,7 @@ fi
 
 resize=false
 gpt=false
+gpt_hybrid=false
 
 . "${DIR}/conf/${h}.conf"
 release="/usr/obj/${MACHINE}/release"
@@ -271,19 +272,28 @@ do
 done  
 
 if $gpt; then
+	if $gpt_hybrid; then
+		gpt_flags="-H"
+	fi
 	initsecs=$((${init} * 1024))
 	bootsecs=$((${boot} * 1024))
 	ffsstart="$(getsectors ${ffsoffset})"
 
 	echo ${bar} Clearing existing partitions ${bar}
-	${GPT} ${image} destroy || true
+	${GPT} ${gpt_flags} ${image} destroy || true
 
 	echo ${bar} Creating partitions ${bar}
-	${GPT} ${image} create ${gpt_create_flags}
-	${GPT} ${image} add -b ${initsecs} -s ${bootsecs} -l ${gpt_label_efi:-EFI} -t efi
-	${GPT} ${image} set -a required -i 1
-	${GPT} ${image} add -a 4m -b ${ffsstart} -l ${gpt_label_ffs:-netbsd-root} -t ffs
-	${GPT} ${image} show
+	${GPT} ${gpt_flags} ${image} create ${gpt_create_flags}
+	${GPT} ${gpt_flags} ${image} add -b ${initsecs} -s ${bootsecs} -l ${gpt_label_efi:-EFI} -t efi
+	${GPT} ${gpt_flags} ${image} set -a required -i 1
+	${GPT} ${gpt_flags} ${image} add -a 4m -b ${ffsstart} -l ${gpt_label_ffs:-netbsd-root} -t ffs
+	${GPT} ${gpt_flags} ${image} show
+	if $gpt_hybrid; then
+		echo ${bar} Creating hybrid MBR ${bar}
+		${FDISK} -f -g -u -0 -a -s ${msdosid}/${initsecs}/${bootsecs} -F ${image}
+		${FDISK} -f -g -u -3 -s 238/1/$((${initsecs} - 1)) -F ${image}
+		${FDISK} -F ${image}
+	fi
 else
 	if [ -n "${msdosid}" ]; then
 		echo ${bar} Running fdisk ${bar}

Index: src/distrib/utils/embedded/files/resize_gpt
diff -u src/distrib/utils/embedded/files/resize_gpt:1.1 src/distrib/utils/embedded/files/resize_gpt:1.2
--- src/distrib/utils/embedded/files/resize_gpt:1.1	Sun May 24 14:45:49 2020
+++ src/distrib/utils/embedded/files/resize_gpt	Sun May 24 18:43:39 2020
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# $NetBSD: resize_gpt,v 1.1 2020/05/24 14:45:49 jmcneill Exp $
+# $NetBSD: resize_gpt,v 1.2 2020/05/24 18:43:39 jmcneill Exp $
 #
 
 # PROVIDE: resize_gpt
@@ -28,8 +28,8 @@ resize_gpt_start()
 
 	BLOCK_DEVICE=$(dkctl ${ROOT_DEVICE} getwedgeinfo | head -1 | sed 's/://' | awk '{ print $3; }')
 
-	gpt resizedisk -q ${BLOCK_DEVICE}
-	gpt resize -a 4m -i 2 -q ${BLOCK_DEVICE}
+	gpt -H resizedisk -q ${BLOCK_DEVICE}
+	gpt -H resize -a 4m -i 2 -q ${BLOCK_DEVICE}
 	return
 }
 



CVS commit: src/distrib/utils/embedded

2020-05-24 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun May 24 14:45:49 UTC 2020

Modified Files:
src/distrib/utils/embedded: mkimage
src/distrib/utils/embedded/conf: evbarm.conf
Added Files:
src/distrib/utils/embedded/files: resize_gpt

Log Message:
Add GPT support to mkimage.


To generate a diff of this commit:
cvs rdiff -u -r1.72 -r1.73 src/distrib/utils/embedded/mkimage
cvs rdiff -u -r1.34 -r1.35 src/distrib/utils/embedded/conf/evbarm.conf
cvs rdiff -u -r0 -r1.1 src/distrib/utils/embedded/files/resize_gpt

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

Modified files:

Index: src/distrib/utils/embedded/mkimage
diff -u src/distrib/utils/embedded/mkimage:1.72 src/distrib/utils/embedded/mkimage:1.73
--- src/distrib/utils/embedded/mkimage:1.72	Mon May 18 21:19:34 2020
+++ src/distrib/utils/embedded/mkimage	Sun May 24 14:45:49 2020
@@ -1,5 +1,5 @@
 #!/bin/sh
-# $NetBSD: mkimage,v 1.72 2020/05/18 21:19:34 jmcneill Exp $
+# $NetBSD: mkimage,v 1.73 2020/05/24 14:45:49 jmcneill Exp $
 #
 # Copyright (c) 2013, 2014 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -54,6 +54,7 @@ PROG="$(basename "$0")"
 MAKE=${TOOL_MAKE:-make}
 DISKLABEL=${TOOL_DISKLABEL:-disklabel}
 FDISK=${TOOL_FDISK:-fdisk}
+GPT=${TOOL_GPT:-gpt}
 MAKEFS=${TOOL_MAKEFS:-makefs}
 MTREE=${TOOL_MTREE:-mtree}
 INSTALLBOOT=${TOOL_INSTALLBOOT:-installboot}
@@ -147,6 +148,7 @@ then
 fi
 
 resize=false
+gpt=false
 
 . "${DIR}/conf/${h}.conf"
 release="/usr/obj/${MACHINE}/release"
@@ -268,32 +270,48 @@ do
 	compare="$((${newsize} * 2 * 1024))"
 done  
 
-if [ -n "${msdosid}" ]; then
-	echo ${bar} Running fdisk ${bar}
+if $gpt; then
 	initsecs=$((${init} * 1024))
 	bootsecs=$((${boot} * 1024))
-	${FDISK} -f -i ${image}
-	${FDISK} -f -a -u -0 -s ${msdosid}/${initsecs}/${bootsecs} -F ${image}
-	if [ -z "${bootonly}" ]; then
-		ffsstart="$(getsectors ${ffsoffset})"
-		imagesize="$(getsize "${image}")"
-		imagesecs="$(getsectors ${imagesize})"
-		ffssize="$(expr ${imagesecs} - ${ffsstart})"
-		${FDISK} -f -u -1 -s 169/${ffsstart}/${ffssize} -F ${image}
-	fi
+	ffsstart="$(getsectors ${ffsoffset})"
+
+	echo ${bar} Clearing existing partitions ${bar}
+	${GPT} ${image} destroy || true
 
-	echo ${bar} Adding label ${bar}
-	make_label > ${tmp}/label
-	${DISKLABEL} -R -F ${image} ${tmp}/label
-elif [ -n "${netbsdid}" ]; then
-	echo ${bar} Adding label ${bar}
-	make_label > ${tmp}/label
-	${DISKLABEL} -R -F ${image} ${tmp}/label
-
-	echo ${bar} Running fdisk ${bar}
-	${FDISK} -f -i ${image}
-	${FDISK} -f -a -u -0 -s 169/${init} ${image}
-	${INSTALLBOOT} -f -v ${image} ${release}/usr/mdec/bootxx_ffsv1
+	echo ${bar} Creating partitions ${bar}
+	${GPT} ${image} create ${gpt_create_flags}
+	${GPT} ${image} add -b ${initsecs} -s ${bootsecs} -l ${gpt_label_efi:-EFI} -t efi
+	${GPT} ${image} set -a required -i 1
+	${GPT} ${image} add -a 4m -b ${ffsstart} -l ${gpt_label_ffs:-netbsd-root} -t ffs
+	${GPT} ${image} show
+else
+	if [ -n "${msdosid}" ]; then
+		echo ${bar} Running fdisk ${bar}
+		initsecs=$((${init} * 1024))
+		bootsecs=$((${boot} * 1024))
+		${FDISK} -f -i ${image}
+		${FDISK} -f -a -u -0 -s ${msdosid}/${initsecs}/${bootsecs} -F ${image}
+		if [ -z "${bootonly}" ]; then
+			ffsstart="$(getsectors ${ffsoffset})"
+			imagesize="$(getsize "${image}")"
+			imagesecs="$(getsectors ${imagesize})"
+			ffssize="$(expr ${imagesecs} - ${ffsstart})"
+			${FDISK} -f -u -1 -s 169/${ffsstart}/${ffssize} -F ${image}
+		fi
+
+		echo ${bar} Adding label ${bar}
+		make_label > ${tmp}/label
+		${DISKLABEL} -R -F ${image} ${tmp}/label
+	elif [ -n "${netbsdid}" ]; then
+		echo ${bar} Adding label ${bar}
+		make_label > ${tmp}/label
+		${DISKLABEL} -R -F ${image} ${tmp}/label
+
+		echo ${bar} Running fdisk ${bar}
+		${FDISK} -f -i ${image}
+		${FDISK} -f -a -u -0 -s 169/${init} ${image}
+		${INSTALLBOOT} -f -v ${image} ${release}/usr/mdec/bootxx_ffsv1
+	fi
 fi
 
 if $compress; then

Index: src/distrib/utils/embedded/conf/evbarm.conf
diff -u src/distrib/utils/embedded/conf/evbarm.conf:1.34 src/distrib/utils/embedded/conf/evbarm.conf:1.35
--- src/distrib/utils/embedded/conf/evbarm.conf:1.34	Sun Dec  1 15:07:04 2019
+++ src/distrib/utils/embedded/conf/evbarm.conf	Sun May 24 14:45:49 2020
@@ -1,4 +1,4 @@
-# $NetBSD: evbarm.conf,v 1.34 2019/12/01 15:07:04 jmcneill Exp $
+# $NetBSD: evbarm.conf,v 1.35 2020/05/24 14:45:49 jmcneill Exp $
 # evbarm shared config
 #
 image=$HOME/${board}.img
@@ -13,6 +13,12 @@ ffsoffset=$(( (${init} + ${boot}) / 2 ))
 size=0		# autocompute
 msdosid=12
 
+if $gpt; then
+	partition_type="gpt"
+else
+	partition_type="disklabel"
+fi
+
 mkdir -p ${mnt}/boot
 
 make_label_evbarm() {
@@ -59,6 +65,19 @@ drivedata: 0 
 EOF
 }
 
+make_fstab_evbarm_gpt() {
+	cat > ${mnt}/etc/fstab << EOF
+# NetBSD /etc/fstab
+# See /usr/share/examples/fstab/ for more examples.
+NAME=${gpt_label_ffs:-netbsd-root}	/		ffs	rw,noatime	1 1
+NAME=${gpt_label_efi:-EFI}

CVS commit: src/distrib/utils/embedded/conf

2020-02-23 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Feb 23 10:56:03 UTC 2020

Modified Files:
src/distrib/utils/embedded/conf: arm64.conf

Log Message:
RPi4 has a different root device, so use config.txt conditionals to load
an alternate cmdline txt file (cmdline-pi4.txt) on these boards.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/distrib/utils/embedded/conf/arm64.conf

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

Modified files:

Index: src/distrib/utils/embedded/conf/arm64.conf
diff -u src/distrib/utils/embedded/conf/arm64.conf:1.8 src/distrib/utils/embedded/conf/arm64.conf:1.9
--- src/distrib/utils/embedded/conf/arm64.conf:1.8	Mon Dec 16 11:00:30 2019
+++ src/distrib/utils/embedded/conf/arm64.conf	Sun Feb 23 10:56:03 2020
@@ -1,4 +1,4 @@
-# $NetBSD: arm64.conf,v 1.8 2019/12/16 11:00:30 skrll Exp $
+# $NetBSD: arm64.conf,v 1.9 2020/02/23 10:56:03 jmcneill Exp $
 # ARM64 customization script used by mkimage
 #
 board=arm64
@@ -73,6 +73,10 @@ populate_rpi() {
 root=ld0a console=${console}
 EOF
 
+	cat > "${mnt}/boot/cmdline-pi4.txt" << EOF
+root=ld1a console=${console}
+EOF
+
 	cat > "${mnt}/boot/config.txt" << EOF
 #
 upstream_kernel=1
@@ -82,6 +86,11 @@ kernel=netbsd.img
 kernel_address=0x20
 enable_uart=1
 force_turbo=0
+#
+[pi4]
+cmdline=cmdline-pi4.txt
+#
+[all]
 EOF
 
 	echo "${bar} installing firmware files ${bar}"



CVS commit: src/distrib/utils/embedded/conf

2020-01-08 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Wed Jan  8 20:49:22 UTC 2020

Modified Files:
src/distrib/utils/embedded/conf: rpi_inst.conf

Log Message:
Use fat16 as the partition is too small for fat32.  from Harold Gutch


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/distrib/utils/embedded/conf/rpi_inst.conf

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

Modified files:

Index: src/distrib/utils/embedded/conf/rpi_inst.conf
diff -u src/distrib/utils/embedded/conf/rpi_inst.conf:1.14 src/distrib/utils/embedded/conf/rpi_inst.conf:1.15
--- src/distrib/utils/embedded/conf/rpi_inst.conf:1.14	Sun Jan  5 16:41:07 2020
+++ src/distrib/utils/embedded/conf/rpi_inst.conf	Wed Jan  8 20:49:22 2020
@@ -1,4 +1,4 @@
-# $NetBSD: rpi_inst.conf,v 1.14 2020/01/05 16:41:07 skrll Exp $
+# $NetBSD: rpi_inst.conf,v 1.15 2020/01/08 20:49:22 skrll Exp $
 # Raspberry Pi customization script used by mkimage
 #
 
@@ -16,7 +16,7 @@ boot=112
 init=8
 
 size=$(( 10485760 + ${swap} * 1024 * 512 + ${boot} * 1024 * 512 + ${init} * 1024 * 512 ))
-msdosid=12
+msdosid=14
 
 make_label() {
 	make_label_evbarm



CVS commit: src/distrib/utils/embedded/conf

2020-01-05 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Jan  5 16:41:08 UTC 2020

Modified Files:
src/distrib/utils/embedded/conf: rpi_inst.conf

Log Message:
Use make_label_evbarm instead of home grown


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/distrib/utils/embedded/conf/rpi_inst.conf

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

Modified files:

Index: src/distrib/utils/embedded/conf/rpi_inst.conf
diff -u src/distrib/utils/embedded/conf/rpi_inst.conf:1.13 src/distrib/utils/embedded/conf/rpi_inst.conf:1.14
--- src/distrib/utils/embedded/conf/rpi_inst.conf:1.13	Wed Jan  1 14:16:51 2020
+++ src/distrib/utils/embedded/conf/rpi_inst.conf	Sun Jan  5 16:41:07 2020
@@ -1,4 +1,4 @@
-# $NetBSD: rpi_inst.conf,v 1.13 2020/01/01 14:16:51 skrll Exp $
+# $NetBSD: rpi_inst.conf,v 1.14 2020/01/05 16:41:07 skrll Exp $
 # Raspberry Pi customization script used by mkimage
 #
 
@@ -19,50 +19,7 @@ size=$(( 10485760 + ${swap} * 1024 * 512
 msdosid=12
 
 make_label() {
-	# compute all sizes in terms of sectors
-	local totalsize=$(( ${newsize} * 1024 * 2 / 512 ))
-
-	local swapsize=$(( ${swap} * 1024 ))
-	local bootsize=$(( ${boot} * 1024 ))
-
-	local bootoffset=$(( ${init} * 1024 ))
-	local swapoffset=$(( ${bootoffset} + ${bootsize} ))
-
-	local asize=$(( ${totalsize} - ${swapsize} - ${bootsize} - ${bootoffset} ))
-	local aoffset=$(( ${swapoffset} + ${swapsize} ))
-
-	local bps=512
-	local spt=32
-	local tpc=64
-	local spc=2048
-	local cylinders=$(( ${totalsize} / ${spc} ))
-
-	cat << EOF
-type: SCSI
-disk: STORAGE DEVICE
-label: fictitious
-flags: removable
-bytes/sector: ${bps}
-sectors/track: ${spt}
-tracks/cylinder: ${tpc}
-sectors/cylinder: ${spc}
-cylinders: ${cylinders}
-total sectors: ${totalsize}
-rpm: 3600
-interleave: 1
-trackskew: 0
-cylinderskew: 0
-headswitch: 0   # microseconds
-track-to-track seek: 0  # microseconds
-drivedata: 0 
-
-8 partitions:
-# size offsetfstype [fsize bsize cpg/sgs]
- a:   ${asize} ${aoffset}4.2BSD  ${fsize} ${bsize} 0  # 
- b:   ${swapsize}  ${swapoffset} swap #
- d:   ${totalsize} 0 unused  0 0  #
- e:   ${bootsize}  ${bootoffset} MSDOS#
-EOF
+	make_label_evbarm
 }
 
 customize() {



CVS commit: src/distrib/utils/embedded/conf

2020-01-01 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Wed Jan  1 14:16:51 UTC 2020

Modified Files:
src/distrib/utils/embedded/conf: rpi_inst.conf

Log Message:
upstream_kernel=1 is required with new firmware/kernel.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/distrib/utils/embedded/conf/rpi_inst.conf

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

Modified files:

Index: src/distrib/utils/embedded/conf/rpi_inst.conf
diff -u src/distrib/utils/embedded/conf/rpi_inst.conf:1.12 src/distrib/utils/embedded/conf/rpi_inst.conf:1.13
--- src/distrib/utils/embedded/conf/rpi_inst.conf:1.12	Mon Dec 16 11:00:30 2019
+++ src/distrib/utils/embedded/conf/rpi_inst.conf	Wed Jan  1 14:16:51 2020
@@ -1,4 +1,4 @@
-# $NetBSD: rpi_inst.conf,v 1.12 2019/12/16 11:00:30 skrll Exp $
+# $NetBSD: rpi_inst.conf,v 1.13 2020/01/01 14:16:51 skrll Exp $
 # Raspberry Pi customization script used by mkimage
 #
 
@@ -86,6 +86,8 @@ root=ld0a console=fb
 EOF
 
 	cat > ${mnt}/boot/config.txt << EOF
+#
+upstream_kernel=1
 # UART settings, see https://www.raspberrypi.org/documentation/configuration/uart.md
 enable_uart=1
 force_turbo=0



CVS commit: src/distrib/utils/embedded/conf

2019-12-16 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Mon Dec 16 08:01:20 UTC 2019

Modified Files:
src/distrib/utils/embedded/conf: arm64.conf

Log Message:
Fix whitespace in a comment


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/distrib/utils/embedded/conf/arm64.conf

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

Modified files:

Index: src/distrib/utils/embedded/conf/arm64.conf
diff -u src/distrib/utils/embedded/conf/arm64.conf:1.6 src/distrib/utils/embedded/conf/arm64.conf:1.7
--- src/distrib/utils/embedded/conf/arm64.conf:1.6	Sun Mar  3 11:44:18 2019
+++ src/distrib/utils/embedded/conf/arm64.conf	Mon Dec 16 08:01:20 2019
@@ -1,4 +1,4 @@
-# $NetBSD: arm64.conf,v 1.6 2019/03/03 11:44:18 jmcneill Exp $
+# $NetBSD: arm64.conf,v 1.7 2019/12/16 08:01:20 skrll Exp $
 # ARM64 customization script used by mkimage
 #
 board=arm64
@@ -101,7 +101,7 @@ populate() {
 	kernels=""
 	k="$kernel_GENERIC64"
 
-	# .imgkernel
+	# .img kernel
 	f="${kernel}/netbsd-${k}.img.gz"
 	test -f "${f}" && kernels="${kernels} ${f}"
 



CVS commit: src/distrib/utils/embedded/conf

2019-12-01 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Dec  1 15:07:04 UTC 2019

Modified Files:
src/distrib/utils/embedded/conf: evbarm.conf

Log Message:
Remove the pretty much useless 128MB swap partition from the arm images.


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/distrib/utils/embedded/conf/evbarm.conf

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

Modified files:

Index: src/distrib/utils/embedded/conf/evbarm.conf
diff -u src/distrib/utils/embedded/conf/evbarm.conf:1.33 src/distrib/utils/embedded/conf/evbarm.conf:1.34
--- src/distrib/utils/embedded/conf/evbarm.conf:1.33	Tue Jun 11 10:50:57 2019
+++ src/distrib/utils/embedded/conf/evbarm.conf	Sun Dec  1 15:07:04 2019
@@ -1,15 +1,14 @@
-# $NetBSD: evbarm.conf,v 1.33 2019/06/11 10:50:57 mrg Exp $
+# $NetBSD: evbarm.conf,v 1.34 2019/12/01 15:07:04 jmcneill Exp $
 # evbarm shared config
 #
 image=$HOME/${board}.img
 
 MACHINE=evbarm
 
-swap=256
 extra=48		# spare space
 init=32
 boot=$((192 - ${init}))
-ffsoffset=$(( (${init} + ${boot} + ${swap}) / 2 ))m
+ffsoffset=$(( (${init} + ${boot}) / 2 ))m
 
 size=0		# autocompute
 msdosid=12
@@ -20,14 +19,12 @@ make_label_evbarm() {
 	# compute all sizes in terms of sectors
 	local totalsize=$(( ${newsize} * 1024 * 2 / 512 ))
 
-	local swapsize=$(( ${swap} * 1024 ))
 	local bootsize=$(( ${boot} * 1024 ))
 
 	local bootoffset=$(( ${init} * 1024 ))
-	local swapoffset=$(( ${bootoffset} + ${bootsize} ))
 
-	local asize=$(( ${totalsize} - ${swapsize} - ${bootsize} - ${bootoffset} ))
-	local aoffset=$(( ${swapoffset} + ${swapsize} ))
+	local asize=$(( ${totalsize} - ${bootsize} - ${bootoffset} ))
+	local aoffset=$(( ${bootoffset} + ${bootsize} ))
 
 	local bps=512
 	local spt=32
@@ -57,7 +54,6 @@ drivedata: 0 
 8 partitions:
 # size offsetfstype [fsize bsize cpg/sgs]
  a:   ${asize} ${aoffset}4.2BSD  ${fsize} ${bsize} 0  # 
- b:   ${swapsize}  ${swapoffset} swap #
  c:   ${totalsize} 0 unused  0 0  #
  e:   ${bootsize}  ${bootoffset} MSDOS#
 EOF
@@ -68,7 +64,6 @@ make_fstab_evbarm_normal() {
 # NetBSD /etc/fstab
 # See /usr/share/examples/fstab/ for more examples.
 ROOT.a		/		ffs	rw,noatime	1 1
-ROOT.b		none		swap	sw	0 0
 ROOT.e		/boot		msdos	rw	1 1
 kernfs		/kern		kernfs	rw
 ptyfs		/dev/pts	ptyfs	rw
@@ -85,7 +80,6 @@ make_fstab_evbarm_minwrites() {
 # NetBSD /etc/fstab
 # See /usr/share/examples/fstab/ for more examples.
 ROOT.a		/			ffs	rw,log,noatime,nodevmtime 1 1
-ROOT.b		none			swap	sw			  0 0
 ROOT.e		/boot			msdos	rw			  1 1
 kernfs		/kern			kernfs	rw
 ptyfs		/dev/pts		ptyfs	rw
@@ -137,6 +131,8 @@ dev_exists() {
 
 rc_configured=YES
 hostname=${board}
+no_swap=YES
+savecore=NO
 sshd=YES
 dhcpcd=YES
 ntpd=YES



CVS commit: src/distrib/utils/embedded/files

2019-04-04 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Thu Apr  4 14:26:40 UTC 2019

Modified Files:
src/distrib/utils/embedded/files: armv7_boot.cmd

Log Message:
Re-enable efiboot for armv7 (thanks skrll@)


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/distrib/utils/embedded/files/armv7_boot.cmd

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

Modified files:

Index: src/distrib/utils/embedded/files/armv7_boot.cmd
diff -u src/distrib/utils/embedded/files/armv7_boot.cmd:1.13 src/distrib/utils/embedded/files/armv7_boot.cmd:1.14
--- src/distrib/utils/embedded/files/armv7_boot.cmd:1.13	Tue Apr  2 10:00:32 2019
+++ src/distrib/utils/embedded/files/armv7_boot.cmd	Thu Apr  4 14:26:39 2019
@@ -2,59 +2,19 @@ if test "${board}" = "am335x" ; then
 	setenv kernel netbsd-BEAGLEBONE.ub
 	setenv mmcpart 0:1
 	setenv bootargs root=ld0a
+else
+	setenv use_efi 1
 fi
-if test "${board}" = "de0-nano-soc" ; then
-	setenv kernel netbsd-GENERIC.ub
-	setenv bootargs 'root=ld0a'
-	setenv mmcpart 0:1
-	setenv use_fdt 1
-fi
-if test "${soc}" = "exynos" ; then
-	setenv kernel netbsd-GENERIC.ub
-	setenv bootargs 'root=ld1a'
-	setenv mmcpart 2:1
-	setenv use_fdt 1
-fi
-if test "${soc}" = "sunxi" ; then
-	setenv kernel netbsd-GENERIC.ub
-	setenv bootargs 'root=ld0a'
-	setenv mmcpart 0:1
-	setenv use_fdt 1
-fi
-if test "${soc}" = "tegra" ; then
-	setenv kernel netbsd-GENERIC.ub
-	setenv bootargs root=ld1a
-	setenv mmcpart 1:1
-	setenv use_fdt 1
-fi
-if test "${soc}" = "tegra124" ; then
-	setenv kernel netbsd-GENERIC.ub
-	setenv bootargs root=ld0a
-	setenv mmcpart 1:1
-	setenv use_fdt 1
-fi
+
 if test "${soc}" = "tegra210" ; then
-	setenv kernel netbsd-GENERIC.ub
-	setenv bootargs root=ld0a
-	setenv mmcpart 1:1
-	setenv use_fdt 1
-	setenv fdtfile ${soc}-${board}.dtb
 	# enable PCIe
 	pci enum
 fi
 
-if test "${kernel}" = "" ; then
-	echo '>>>'
-	echo '>>> Target device is not supported by this script.'
-	echo '>>>'
-	exit
-fi
-
-if test "${use_fdt}" = "1" ; then
-	fatload mmc ${mmcpart} ${kernel_addr_r} ${kernel}
-	fatload mmc ${mmcpart} ${fdt_addr_r} ${fdtfile}
-	fdt addr ${fdt_addr_r}
-	bootm ${kernel_addr_r} - ${fdt_addr_r}
+if test "${use_efi}" = "1" ; then
+	setenv boot_scripts
+	setenv boot_script_dhcp
+	run distro_bootcmd
 else
 	fatload mmc ${mmcpart} ${kernel_addr_r} ${kernel}
 	bootm ${kernel_addr_r} ${bootargs}



CVS commit: src/distrib/utils/embedded/files

2019-04-02 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Tue Apr  2 10:00:32 UTC 2019

Modified Files:
src/distrib/utils/embedded/files: armv7_boot.cmd

Log Message:
Turn off efiboot until we figure out why it fails on some boards.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/distrib/utils/embedded/files/armv7_boot.cmd

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

Modified files:

Index: src/distrib/utils/embedded/files/armv7_boot.cmd
diff -u src/distrib/utils/embedded/files/armv7_boot.cmd:1.12 src/distrib/utils/embedded/files/armv7_boot.cmd:1.13
--- src/distrib/utils/embedded/files/armv7_boot.cmd:1.12	Sat Mar 30 13:37:45 2019
+++ src/distrib/utils/embedded/files/armv7_boot.cmd	Tue Apr  2 10:00:32 2019
@@ -2,19 +2,59 @@ if test "${board}" = "am335x" ; then
 	setenv kernel netbsd-BEAGLEBONE.ub
 	setenv mmcpart 0:1
 	setenv bootargs root=ld0a
-else
-	setenv use_efi 1
 fi
-
+if test "${board}" = "de0-nano-soc" ; then
+	setenv kernel netbsd-GENERIC.ub
+	setenv bootargs 'root=ld0a'
+	setenv mmcpart 0:1
+	setenv use_fdt 1
+fi
+if test "${soc}" = "exynos" ; then
+	setenv kernel netbsd-GENERIC.ub
+	setenv bootargs 'root=ld1a'
+	setenv mmcpart 2:1
+	setenv use_fdt 1
+fi
+if test "${soc}" = "sunxi" ; then
+	setenv kernel netbsd-GENERIC.ub
+	setenv bootargs 'root=ld0a'
+	setenv mmcpart 0:1
+	setenv use_fdt 1
+fi
+if test "${soc}" = "tegra" ; then
+	setenv kernel netbsd-GENERIC.ub
+	setenv bootargs root=ld1a
+	setenv mmcpart 1:1
+	setenv use_fdt 1
+fi
+if test "${soc}" = "tegra124" ; then
+	setenv kernel netbsd-GENERIC.ub
+	setenv bootargs root=ld0a
+	setenv mmcpart 1:1
+	setenv use_fdt 1
+fi
 if test "${soc}" = "tegra210" ; then
+	setenv kernel netbsd-GENERIC.ub
+	setenv bootargs root=ld0a
+	setenv mmcpart 1:1
+	setenv use_fdt 1
+	setenv fdtfile ${soc}-${board}.dtb
 	# enable PCIe
 	pci enum
 fi
 
-if test "${use_efi}" = "1" ; then
-	setenv boot_scripts
-	setenv boot_script_dhcp
-	run distro_bootcmd
+if test "${kernel}" = "" ; then
+	echo '>>>'
+	echo '>>> Target device is not supported by this script.'
+	echo '>>>'
+	exit
+fi
+
+if test "${use_fdt}" = "1" ; then
+	fatload mmc ${mmcpart} ${kernel_addr_r} ${kernel}
+	fatload mmc ${mmcpart} ${fdt_addr_r} ${fdtfile}
+	fdt addr ${fdt_addr_r}
+	bootm ${kernel_addr_r} - ${fdt_addr_r}
 else
 	fatload mmc ${mmcpart} ${kernel_addr_r} ${kernel}
 	bootm ${kernel_addr_r} ${bootargs}



CVS commit: src/distrib/utils/embedded/conf

2019-03-30 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Mar 30 13:43:53 UTC 2019

Modified Files:
src/distrib/utils/embedded/conf: armv7.conf

Log Message:
Install GENERIC ELF kernel as /netbsd for EFI booting


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/distrib/utils/embedded/conf/armv7.conf

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

Modified files:

Index: src/distrib/utils/embedded/conf/armv7.conf
diff -u src/distrib/utils/embedded/conf/armv7.conf:1.31 src/distrib/utils/embedded/conf/armv7.conf:1.32
--- src/distrib/utils/embedded/conf/armv7.conf:1.31	Sat Mar 30 13:07:57 2019
+++ src/distrib/utils/embedded/conf/armv7.conf	Sat Mar 30 13:43:52 2019
@@ -1,4 +1,4 @@
-# $NetBSD: armv7.conf,v 1.31 2019/03/30 13:07:57 jmcneill Exp $
+# $NetBSD: armv7.conf,v 1.32 2019/03/30 13:43:52 jmcneill Exp $
 # ARMv7 customization script used by mkimage
 #
 board=armv7
@@ -35,6 +35,11 @@ populate_common() {
 	if [ -f "${release}/usr/mdec/bootarm.efi" ]; then
 		mkdir -p "${mnt}/boot/EFI/BOOT"
 		cp "${release}/usr/mdec/bootarm.efi" "${mnt}/boot/EFI/BOOT/bootarm.efi"
+
+		# Install GENERIC kernel to root of the FFS partition
+		${GZIP_CMD} -dc ${kernel}/netbsd-${kernels_generic}.gz > "${mnt}/netbsd"
+		echo "./netbsd type=file uname=root gname=wheel mode=0755" \
+		>> "$tmp/selected_sets"
 	fi
 
 	# Install boot script



CVS commit: src/distrib/utils/embedded/files

2019-03-30 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Mar 30 13:37:45 UTC 2019

Modified Files:
src/distrib/utils/embedded/files: armv7_boot.cmd

Log Message:
Switch to efiboot


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/distrib/utils/embedded/files/armv7_boot.cmd

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

Modified files:

Index: src/distrib/utils/embedded/files/armv7_boot.cmd
diff -u src/distrib/utils/embedded/files/armv7_boot.cmd:1.11 src/distrib/utils/embedded/files/armv7_boot.cmd:1.12
--- src/distrib/utils/embedded/files/armv7_boot.cmd:1.11	Sat Jan  5 13:55:46 2019
+++ src/distrib/utils/embedded/files/armv7_boot.cmd	Sat Mar 30 13:37:45 2019
@@ -2,59 +2,19 @@ if test "${board}" = "am335x" ; then
 	setenv kernel netbsd-BEAGLEBONE.ub
 	setenv mmcpart 0:1
 	setenv bootargs root=ld0a
+else
+	setenv use_efi 1
 fi
-if test "${board}" = "de0-nano-soc" ; then
-	setenv kernel netbsd-GENERIC.ub
-	setenv bootargs 'root=ld0a'
-	setenv mmcpart 0:1
-	setenv use_fdt 1
-fi
-if test "${soc}" = "exynos" ; then
-	setenv kernel netbsd-GENERIC.ub
-	setenv bootargs 'root=ld1a'
-	setenv mmcpart 2:1
-	setenv use_fdt 1
-fi
-if test "${soc}" = "sunxi" ; then
-	setenv kernel netbsd-GENERIC.ub
-	setenv bootargs 'root=ld0a'
-	setenv mmcpart 0:1
-	setenv use_fdt 1
-fi
-if test "${soc}" = "tegra" ; then
-	setenv kernel netbsd-GENERIC.ub
-	setenv bootargs root=ld1a
-	setenv mmcpart 1:1
-	setenv use_fdt 1
-fi
-if test "${soc}" = "tegra124" ; then
-	setenv kernel netbsd-GENERIC.ub
-	setenv bootargs root=ld0a
-	setenv mmcpart 1:1
-	setenv use_fdt 1
-fi
+
 if test "${soc}" = "tegra210" ; then
-	setenv kernel netbsd-GENERIC.ub
-	setenv bootargs root=ld0a
-	setenv mmcpart 1:1
-	setenv use_fdt 1
-	setenv fdtfile ${soc}-${board}.dtb
 	# enable PCIe
 	pci enum
 fi
 
-if test "${kernel}" = "" ; then
-	echo '>>>'
-	echo '>>> Target device is not supported by this script.'
-	echo '>>>'
-	exit
-fi
-
-if test "${use_fdt}" = "1" ; then
-	fatload mmc ${mmcpart} ${kernel_addr_r} ${kernel}
-	fatload mmc ${mmcpart} ${fdt_addr_r} ${fdtfile}
-	fdt addr ${fdt_addr_r}
-	bootm ${kernel_addr_r} - ${fdt_addr_r}
+if test "${use_efi}" = "1" ; then
+	setenv boot_scripts
+	setenv boot_script_dhcp
+	run distro_bootcmd
 else
 	fatload mmc ${mmcpart} ${kernel_addr_r} ${kernel}
 	bootm ${kernel_addr_r} ${bootargs}



CVS commit: src/distrib/utils/embedded/conf

2019-03-30 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Mar 30 13:07:57 UTC 2019

Modified Files:
src/distrib/utils/embedded/conf: armv7.conf

Log Message:
Install bootarm.efi to boot partition


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/distrib/utils/embedded/conf/armv7.conf

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

Modified files:

Index: src/distrib/utils/embedded/conf/armv7.conf
diff -u src/distrib/utils/embedded/conf/armv7.conf:1.30 src/distrib/utils/embedded/conf/armv7.conf:1.31
--- src/distrib/utils/embedded/conf/armv7.conf:1.30	Mon Jan 21 16:28:39 2019
+++ src/distrib/utils/embedded/conf/armv7.conf	Sat Mar 30 13:07:57 2019
@@ -1,4 +1,4 @@
-# $NetBSD: armv7.conf,v 1.30 2019/01/21 16:28:39 jmcneill Exp $
+# $NetBSD: armv7.conf,v 1.31 2019/03/30 13:07:57 jmcneill Exp $
 # ARMv7 customization script used by mkimage
 #
 board=armv7
@@ -31,6 +31,12 @@ EOF
 }
 
 populate_common() {
+	# Install EFI bootloader
+	if [ -f "${release}/usr/mdec/bootarm.efi" ]; then
+		mkdir -p "${mnt}/boot/EFI/BOOT"
+		cp "${release}/usr/mdec/bootarm.efi" "${mnt}/boot/EFI/BOOT/bootarm.efi"
+	fi
+
 	# Install boot script
 	cp ${DIR}/files/armv7_boot.cmd ${mnt}/boot/boot.cmd
 	"${MKUBOOTIMAGE}" -A arm -C none -O netbsd -T script -a 0 -n "NetBSD/armv7 boot" "${mnt}/boot/boot.cmd" "${mnt}/boot/boot.scr"



CVS commit: src/distrib/utils/embedded/conf

2019-03-03 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Mar  3 11:44:18 UTC 2019

Modified Files:
src/distrib/utils/embedded/conf: arm64.conf

Log Message:
Add Amlogic dtb files to arm64.img


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/distrib/utils/embedded/conf/arm64.conf

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

Modified files:

Index: src/distrib/utils/embedded/conf/arm64.conf
diff -u src/distrib/utils/embedded/conf/arm64.conf:1.5 src/distrib/utils/embedded/conf/arm64.conf:1.6
--- src/distrib/utils/embedded/conf/arm64.conf:1.5	Fri Nov 30 20:53:02 2018
+++ src/distrib/utils/embedded/conf/arm64.conf	Sun Mar  3 11:44:18 2019
@@ -1,4 +1,4 @@
-# $NetBSD: arm64.conf,v 1.5 2018/11/30 20:53:02 jmcneill Exp $
+# $NetBSD: arm64.conf,v 1.6 2019/03/03 11:44:18 jmcneill Exp $
 # ARM64 customization script used by mkimage
 #
 board=arm64
@@ -52,6 +52,12 @@ populate_allwinner() {
 	mv "${mnt}"/boot/sun50i-*.dtb "${mnt}/boot/dtb/allwinner/"
 }
 
+populate_amlogic() {
+	# U-Boot expects 64-bit DTB files to live in an amlogic/ subdirectory
+	mkdir -p "${mnt}/boot/dtb/amlogic"
+	mv "${mnt}"/boot/meson-*.dtb "${mnt}/boot/dtb/amlogic/"
+}
+
 populate_rockchip() {
 	# U-Boot expects 64-bit DTB files to live in a rockchip/ subdirectory
 	mkdir -p "${mnt}/boot/dtb/rockchip"
@@ -125,6 +131,7 @@ populate() {
 
 	# SoC specific configuration
 	populate_allwinner
+	populate_amlogic
 	populate_nvidia
 	populate_rockchip
 



CVS commit: src/distrib/utils/embedded/conf

2019-01-21 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Mon Jan 21 16:28:39 UTC 2019

Modified Files:
src/distrib/utils/embedded/conf: armv7.conf

Log Message:
No need to specify root and console bootargs on amlogic


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/distrib/utils/embedded/conf/armv7.conf

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

Modified files:

Index: src/distrib/utils/embedded/conf/armv7.conf
diff -u src/distrib/utils/embedded/conf/armv7.conf:1.29 src/distrib/utils/embedded/conf/armv7.conf:1.30
--- src/distrib/utils/embedded/conf/armv7.conf:1.29	Sun Jan 20 10:18:03 2019
+++ src/distrib/utils/embedded/conf/armv7.conf	Mon Jan 21 16:28:39 2019
@@ -1,4 +1,4 @@
-# $NetBSD: armv7.conf,v 1.29 2019/01/20 10:18:03 skrll Exp $
+# $NetBSD: armv7.conf,v 1.30 2019/01/21 16:28:39 jmcneill Exp $
 # ARMv7 customization script used by mkimage
 #
 board=armv7
@@ -100,7 +100,7 @@ populate_amlogic() {
 	cat >> "${mnt}/boot/boot.ini" << EOF
 ODROIDC-UBOOT-CONFIG
 
-setenv bootargs "root=ld0a awge0.mac-address=\${ethaddr} console=${console}"
+setenv bootargs "awge0.mac-address=\${ethaddr}"
 setenv bootcmd "fatload mmc 0:1 0x2100 ${odroidc1_kernelimg}; fatload mmc 0:1 0x2000 meson8b-odroidc1.dtb; bootm 0x2100 - 0x2000"
 run bootcmd
 EOF



CVS commit: src/distrib/utils/embedded/files

2019-01-03 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Thu Jan  3 18:21:55 UTC 2019

Modified Files:
src/distrib/utils/embedded/files: armv7_boot.cmd

Log Message:
Fix mmcpart for exynos SD card


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/distrib/utils/embedded/files/armv7_boot.cmd

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

Modified files:

Index: src/distrib/utils/embedded/files/armv7_boot.cmd
diff -u src/distrib/utils/embedded/files/armv7_boot.cmd:1.9 src/distrib/utils/embedded/files/armv7_boot.cmd:1.10
--- src/distrib/utils/embedded/files/armv7_boot.cmd:1.9	Thu Nov 22 21:11:37 2018
+++ src/distrib/utils/embedded/files/armv7_boot.cmd	Thu Jan  3 18:21:55 2019
@@ -13,7 +13,7 @@ fi
 if test "${soc}" = "exynos" ; then
 	setenv kernel netbsd-GENERIC.ub
 	setenv bootargs 'root=ld1a'
-	setenv mmcpart 0:1
+	setenv mmcpart 2:1
 	setenv use_fdt 1
 fi
 if test "${soc}" = "sunxi" ; then



CVS commit: src/distrib/utils/embedded/conf

2018-12-02 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Dec  2 15:43:05 UTC 2018

Modified Files:
src/distrib/utils/embedded/conf: evbarm.conf

Log Message:
Fix variable escaping in dev_exists()


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/distrib/utils/embedded/conf/evbarm.conf

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

Modified files:

Index: src/distrib/utils/embedded/conf/evbarm.conf
diff -u src/distrib/utils/embedded/conf/evbarm.conf:1.31 src/distrib/utils/embedded/conf/evbarm.conf:1.32
--- src/distrib/utils/embedded/conf/evbarm.conf:1.31	Fri Nov 30 20:53:02 2018
+++ src/distrib/utils/embedded/conf/evbarm.conf	Sun Dec  2 15:43:04 2018
@@ -1,4 +1,4 @@
-# $NetBSD: evbarm.conf,v 1.31 2018/11/30 20:53:02 jmcneill Exp $
+# $NetBSD: evbarm.conf,v 1.32 2018/12/02 15:43:04 jmcneill Exp $
 # evbarm shared config
 #
 image=$HOME/${board}.img
@@ -128,7 +128,7 @@ customize_evbarm() {
 	cp ${release}/etc/rc.conf ${mnt}/etc/rc.conf
 	cat >> ${mnt}/etc/rc.conf << EOF
 dev_exists() {
-	if /sbin/drvctl -l $1 >/dev/null 2>&1 ; then
+	if /sbin/drvctl -l \$1 >/dev/null 2>&1 ; then
 		printf YES
 	else
 		printf NO



CVS commit: src/distrib/utils/embedded

2018-11-30 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Fri Nov 30 20:53:02 UTC 2018

Modified Files:
src/distrib/utils/embedded/conf: arm64.conf armv7.conf evbarm.conf
Added Files:
src/distrib/utils/embedded/files: ec2_init

Log Message:
Add support for configuring Amazon.com EC2 SSH keys and hostnames. While
here, only set wscons=YES if a wsdisplay0 device is present.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/distrib/utils/embedded/conf/arm64.conf
cvs rdiff -u -r1.27 -r1.28 src/distrib/utils/embedded/conf/armv7.conf
cvs rdiff -u -r1.30 -r1.31 src/distrib/utils/embedded/conf/evbarm.conf
cvs rdiff -u -r0 -r1.1 src/distrib/utils/embedded/files/ec2_init

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

Modified files:

Index: src/distrib/utils/embedded/conf/arm64.conf
diff -u src/distrib/utils/embedded/conf/arm64.conf:1.4 src/distrib/utils/embedded/conf/arm64.conf:1.5
--- src/distrib/utils/embedded/conf/arm64.conf:1.4	Mon Aug 27 22:36:49 2018
+++ src/distrib/utils/embedded/conf/arm64.conf	Fri Nov 30 20:53:02 2018
@@ -1,4 +1,4 @@
-# $NetBSD: arm64.conf,v 1.4 2018/08/27 22:36:49 jmcneill Exp $
+# $NetBSD: arm64.conf,v 1.5 2018/11/30 20:53:02 jmcneill Exp $
 # ARM64 customization script used by mkimage
 #
 board=arm64
@@ -21,12 +21,18 @@ customize() {
 	customize_evbarm
 	cat >> "${mnt}/etc/rc.conf" << EOF
 mdnsd=YES
-wscons=YES
 devpubd=YES
+wscons=\$(dev_exists wsdisplay0)
+ec2_init=\$(dev_exists ena0)
 EOF
 }
 
 populate_common() {
+	# Add EC2 init script
+	cp ${DIR}/files/ec2_init ${mnt}/etc/rc.d/ec2_init
+	echo "./etc/rc.d/ec2_init type=file uname=root gname=wheel mode=0555" \
+	>> "$tmp/selected_sets"
+
 	# Rename kernel to netbsd.img
 	mv "${mnt}/boot/netbsd-${kernel_GENERIC64}.img" "${mnt}/boot/netbsd.img"
 

Index: src/distrib/utils/embedded/conf/armv7.conf
diff -u src/distrib/utils/embedded/conf/armv7.conf:1.27 src/distrib/utils/embedded/conf/armv7.conf:1.28
--- src/distrib/utils/embedded/conf/armv7.conf:1.27	Thu Nov 22 21:11:37 2018
+++ src/distrib/utils/embedded/conf/armv7.conf	Fri Nov 30 20:53:02 2018
@@ -1,4 +1,4 @@
-# $NetBSD: armv7.conf,v 1.27 2018/11/22 21:11:37 aymeric Exp $
+# $NetBSD: armv7.conf,v 1.28 2018/11/30 20:53:02 jmcneill Exp $
 # ARMv7 customization script used by mkimage
 #
 board=armv7
@@ -26,8 +26,8 @@ customize() {
 	customize_evbarm
 	cat >> "${mnt}/etc/rc.conf" << EOF
 mdnsd=YES
-wscons=YES
 devpubd=YES
+wscons=\$(dev_exists wsdisplay0)
 EOF
 }
 

Index: src/distrib/utils/embedded/conf/evbarm.conf
diff -u src/distrib/utils/embedded/conf/evbarm.conf:1.30 src/distrib/utils/embedded/conf/evbarm.conf:1.31
--- src/distrib/utils/embedded/conf/evbarm.conf:1.30	Sat Oct  6 13:11:22 2018
+++ src/distrib/utils/embedded/conf/evbarm.conf	Fri Nov 30 20:53:02 2018
@@ -1,4 +1,4 @@
-# $NetBSD: evbarm.conf,v 1.30 2018/10/06 13:11:22 jmcneill Exp $
+# $NetBSD: evbarm.conf,v 1.31 2018/11/30 20:53:02 jmcneill Exp $
 # evbarm shared config
 #
 image=$HOME/${board}.img
@@ -127,6 +127,14 @@ customize_evbarm() {
 	
 	cp ${release}/etc/rc.conf ${mnt}/etc/rc.conf
 	cat >> ${mnt}/etc/rc.conf << EOF
+dev_exists() {
+	if /sbin/drvctl -l $1 >/dev/null 2>&1 ; then
+		printf YES
+	else
+		printf NO
+	fi
+}
+
 rc_configured=YES
 hostname=${board}
 sshd=YES

Added files:

Index: src/distrib/utils/embedded/files/ec2_init
diff -u /dev/null src/distrib/utils/embedded/files/ec2_init:1.1
--- /dev/null	Fri Nov 30 20:53:02 2018
+++ src/distrib/utils/embedded/files/ec2_init	Fri Nov 30 20:53:02 2018
@@ -0,0 +1,52 @@
+#!/bin/sh
+#
+# $NetBSD: ec2_init,v 1.1 2018/11/30 20:53:02 jmcneill Exp $
+#
+# PROVIDE: ec2_init
+# REQUIRE: NETWORKING
+# BEFORE:  LOGIN
+
+$_rc_subr_loaded . /etc/rc.subr
+
+name="ec2_init"
+rcvar=${name}
+start_cmd="ec2_init"
+stop_cmd=":"
+
+METADATA_URL="http://169.254.169.254/latest/meta-data/";
+SSH_KEY_URL="public-keys/0/openssh-key"
+HOSTNAME_URL="hostname"
+
+SSH_KEY_FILE="/root/.ssh/authorized_keys"
+
+ec2_init()
+{
+	(
+	umask 022
+	# fetch the key pair from Amazon Web Services
+	EC2_SSH_KEY=$(ftp -o - "${METADATA_URL}${SSH_KEY_URL}")
+
+	if [ -n "$EC2_SSH_KEY" ]; then
+		# A key pair is associated with this instance, add it
+		# to root 'authorized_keys' file
+		mkdir -p $(dirname "$SSH_KEY_FILE")
+		touch "$SSH_KEY_FILE"
+		cd $(dirname "$SSH_KEY_FILE")
+
+		grep -q "$EC2_SSH_KEY" "$SSH_KEY_FILE"
+		if [ $? -ne 0 ]; then
+			echo "Setting EC2 SSH key pair: ${EC2_SSH_KEY##* }"
+			echo "$EC2_SSH_KEY" >> "$SSH_KEY_FILE"
+		fi
+	fi
+
+	# set hostname
+	HOSTNAME=$(ftp -o - "${METADATA_URL}${HOSTNAME_URL}")
+	echo "Setting EC2 hostname: ${HOSTNAME}"
+	echo "$HOSTNAME" > /etc/myname
+	hostname "$HOSTNAME"
+	)
+}
+
+load_rc_config $name
+run_rc_command "$1"



CVS commit: src/distrib/utils/embedded

2018-11-22 Thread Aymeric Vincent
Module Name:src
Committed By:   aymeric
Date:   Thu Nov 22 21:11:37 UTC 2018

Modified Files:
src/distrib/utils/embedded/conf: armv7.conf
src/distrib/utils/embedded/files: armv7_boot.cmd

Log Message:
Make armv7.img boot on the DE0 Nano SoC. Requires u-boot from -current pkgsrc.


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/distrib/utils/embedded/conf/armv7.conf
cvs rdiff -u -r1.8 -r1.9 src/distrib/utils/embedded/files/armv7_boot.cmd

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

Modified files:

Index: src/distrib/utils/embedded/conf/armv7.conf
diff -u src/distrib/utils/embedded/conf/armv7.conf:1.26 src/distrib/utils/embedded/conf/armv7.conf:1.27
--- src/distrib/utils/embedded/conf/armv7.conf:1.26	Thu Nov  1 11:05:24 2018
+++ src/distrib/utils/embedded/conf/armv7.conf	Thu Nov 22 21:11:37 2018
@@ -1,4 +1,4 @@
-# $NetBSD: armv7.conf,v 1.26 2018/11/01 11:05:24 skrll Exp $
+# $NetBSD: armv7.conf,v 1.27 2018/11/22 21:11:37 aymeric Exp $
 # ARMv7 customization script used by mkimage
 #
 board=armv7
@@ -7,7 +7,7 @@ resize=true
 
 . ${DIR}/conf/evbarm.conf
 
-# exynos, sunxi, tegra
+# altera, exynos, sunxi, tegra
 kernels_generic="GENERIC"
 # non-FDTised / special kernels
 kernels_amlogic="ODROID-C1"
@@ -90,6 +90,10 @@ EOF
 	>> "$tmp/selected_sets"
 }
 
+populate_altera() {
+	:
+}
+
 populate_amlogic() {
 	odroidc1_kernelimg=netbsd-ODROID-C1.ub
 
@@ -153,6 +157,7 @@ populate() {
 	done
 
 	# board specific configuration
+	populate_altera
 	populate_amlogic
 	populate_beagle
 	populate_rpi

Index: src/distrib/utils/embedded/files/armv7_boot.cmd
diff -u src/distrib/utils/embedded/files/armv7_boot.cmd:1.8 src/distrib/utils/embedded/files/armv7_boot.cmd:1.9
--- src/distrib/utils/embedded/files/armv7_boot.cmd:1.8	Thu Nov  1 11:05:24 2018
+++ src/distrib/utils/embedded/files/armv7_boot.cmd	Thu Nov 22 21:11:37 2018
@@ -3,6 +3,13 @@ if test "${board}" = "am335x" ; then
 	setenv mmcpart 0:1
 	setenv bootargs root=ld0a
 fi
+if test "${board}" = "de0-nano-soc" ; then
+	setenv kernel netbsd-GENERIC.ub
+	setenv bootargs 'root=ld0a'
+	setenv mmcpart 0:1
+	setenv use_fdt 1
+	setenv fdtfile socfpga_cyclone5_de0_sockit.dtb
+fi
 if test "${soc}" = "exynos" ; then
 	setenv kernel netbsd-GENERIC.ub
 	setenv bootargs 'root=ld1a'



CVS commit: src/distrib/utils/embedded/files

2018-10-20 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Oct 20 08:29:11 UTC 2018

Modified Files:
src/distrib/utils/embedded/files: armv7_boot.cmd

Log Message:
Sort


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/distrib/utils/embedded/files/armv7_boot.cmd

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

Modified files:

Index: src/distrib/utils/embedded/files/armv7_boot.cmd
diff -u src/distrib/utils/embedded/files/armv7_boot.cmd:1.6 src/distrib/utils/embedded/files/armv7_boot.cmd:1.7
--- src/distrib/utils/embedded/files/armv7_boot.cmd:1.6	Wed Jul  4 23:10:06 2018
+++ src/distrib/utils/embedded/files/armv7_boot.cmd	Sat Oct 20 08:29:11 2018
@@ -1,3 +1,8 @@
+if test "${board}" = "am335x" ; then
+	setenv kernel netbsd-BEAGLEBONE.ub
+	setenv mmcpart 0:1
+	setenv bootargs root=ld0a
+fi
 if test "${soc}" = "exynos" ; then
 	setenv kernel netbsd-EXYNOS.ub
 	setenv bootargs 'root=ld1a'
@@ -25,11 +30,6 @@ if test "${soc}" = "tegra210" ; then
 	# enable PCIe
 	pci enum
 fi
-if test "${board}" = "am335x" ; then
-	setenv kernel netbsd-BEAGLEBONE.ub
-	setenv mmcpart 0:1
-	setenv bootargs root=ld0a
-fi
 
 if test "${kernel}" = "" ; then
 	echo '>>>'



CVS commit: src/distrib/utils/embedded/conf

2018-10-20 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Oct 20 08:26:10 UTC 2018

Modified Files:
src/distrib/utils/embedded/conf: armv7.conf

Log Message:
Whitespace


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/distrib/utils/embedded/conf/armv7.conf

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

Modified files:

Index: src/distrib/utils/embedded/conf/armv7.conf
diff -u src/distrib/utils/embedded/conf/armv7.conf:1.24 src/distrib/utils/embedded/conf/armv7.conf:1.25
--- src/distrib/utils/embedded/conf/armv7.conf:1.24	Sat Oct 20 08:24:11 2018
+++ src/distrib/utils/embedded/conf/armv7.conf	Sat Oct 20 08:26:10 2018
@@ -1,4 +1,4 @@
-# $NetBSD: armv7.conf,v 1.24 2018/10/20 08:24:11 skrll Exp $
+# $NetBSD: armv7.conf,v 1.25 2018/10/20 08:26:10 skrll Exp $
 # ARMv7 customization script used by mkimage
 #
 board=armv7
@@ -67,7 +67,7 @@ EOF
 echo " $f"
 cp "${firmwaredir}/${f}" .
 			done
-	)
+		)
 
 	fi
 



CVS commit: src/distrib/utils/embedded/conf

2018-10-20 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Oct 20 08:24:11 UTC 2018

Modified Files:
src/distrib/utils/embedded/conf: armv7.conf

Log Message:
a bit of sorting


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/distrib/utils/embedded/conf/armv7.conf

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

Modified files:

Index: src/distrib/utils/embedded/conf/armv7.conf
diff -u src/distrib/utils/embedded/conf/armv7.conf:1.23 src/distrib/utils/embedded/conf/armv7.conf:1.24
--- src/distrib/utils/embedded/conf/armv7.conf:1.23	Mon Dec 11 11:38:14 2017
+++ src/distrib/utils/embedded/conf/armv7.conf	Sat Oct 20 08:24:11 2018
@@ -1,4 +1,4 @@
-# $NetBSD: armv7.conf,v 1.23 2017/12/11 11:38:14 jmcneill Exp $
+# $NetBSD: armv7.conf,v 1.24 2018/10/20 08:24:11 skrll Exp $
 # ARMv7 customization script used by mkimage
 #
 board=armv7
@@ -7,11 +7,11 @@ resize=true
 
 . ${DIR}/conf/evbarm.conf
 
+kernels_amlogic="ODROID-C1"
 kernels_beagle="BEAGLEBOARD BEAGLEBONE"
 kernels_rpi="RPI2"
-kernels_amlogic="ODROID-C1"
-kernels_tegra="TEGRA"
 kernels_sunxi="SUNXI"
+kernels_tegra="TEGRA"
 
 make_label() {
 	make_label_evbarm
@@ -152,11 +152,11 @@ populate() {
 	done
 
 	# board specific configuration
+	populate_amlogic
 	populate_beagle
 	populate_rpi
-	populate_amlogic
-	populate_tegra
 	populate_sunxi
+	populate_tegra
 
 	# common configuration
 	populate_common



CVS commit: src/distrib/utils/embedded/conf

2018-10-06 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Oct  6 13:11:22 UTC 2018

Modified Files:
src/distrib/utils/embedded/conf: evbarm.conf

Log Message:
Use special ROOT. prefix in fstab entries instead of assuming ld0


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/distrib/utils/embedded/conf/evbarm.conf

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

Modified files:

Index: src/distrib/utils/embedded/conf/evbarm.conf
diff -u src/distrib/utils/embedded/conf/evbarm.conf:1.29 src/distrib/utils/embedded/conf/evbarm.conf:1.30
--- src/distrib/utils/embedded/conf/evbarm.conf:1.29	Sat Oct  6 09:58:55 2018
+++ src/distrib/utils/embedded/conf/evbarm.conf	Sat Oct  6 13:11:22 2018
@@ -1,4 +1,4 @@
-# $NetBSD: evbarm.conf,v 1.29 2018/10/06 09:58:55 jmcneill Exp $
+# $NetBSD: evbarm.conf,v 1.30 2018/10/06 13:11:22 jmcneill Exp $
 # evbarm shared config
 #
 image=$HOME/${board}.img
@@ -67,9 +67,9 @@ make_fstab_evbarm_normal() {
 	cat > ${mnt}/etc/fstab << EOF
 # NetBSD /etc/fstab
 # See /usr/share/examples/fstab/ for more examples.
-/dev/ld0a	/		ffs	rw,noatime	1 1
-/dev/ld0b	none		swap	sw	0 0
-/dev/ld0e	/boot		msdos	rw	1 1
+ROOT.a		/		ffs	rw,noatime	1 1
+ROOT.b		none		swap	sw	0 0
+ROOT.e		/boot		msdos	rw	1 1
 kernfs		/kern		kernfs	rw
 ptyfs		/dev/pts	ptyfs	rw
 procfs		/proc		procfs	rw
@@ -84,9 +84,9 @@ make_fstab_evbarm_minwrites() {
 	cat > ${mnt}/etc/fstab << EOF
 # NetBSD /etc/fstab
 # See /usr/share/examples/fstab/ for more examples.
-/dev/ld0a	/			ffs	rw,log,noatime,nodevmtime 1 1
-/dev/ld0b	none			swap	sw			  0 0
-/dev/ld0e	/boot			msdos	rw			  1 1
+ROOT.a		/			ffs	rw,log,noatime,nodevmtime 1 1
+ROOT.b		none			swap	sw			  0 0
+ROOT.e		/boot			msdos	rw			  1 1
 kernfs		/kern			kernfs	rw
 ptyfs		/dev/pts		ptyfs	rw
 procfs		/proc			procfs	rw



CVS commit: src/distrib/utils/embedded

2018-10-06 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Oct  6 09:58:55 UTC 2018

Modified Files:
src/distrib/utils/embedded/conf: evbarm.conf
src/distrib/utils/embedded/files: resize_disklabel

Log Message:
resize_disklabel: if disk and partition is not specified, use 
kern.root_device/kern.root_partition sysctls


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/distrib/utils/embedded/conf/evbarm.conf
cvs rdiff -u -r1.2 -r1.3 src/distrib/utils/embedded/files/resize_disklabel

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

Modified files:

Index: src/distrib/utils/embedded/conf/evbarm.conf
diff -u src/distrib/utils/embedded/conf/evbarm.conf:1.28 src/distrib/utils/embedded/conf/evbarm.conf:1.29
--- src/distrib/utils/embedded/conf/evbarm.conf:1.28	Tue Jun 19 15:12:05 2018
+++ src/distrib/utils/embedded/conf/evbarm.conf	Sat Oct  6 09:58:55 2018
@@ -1,4 +1,4 @@
-# $NetBSD: evbarm.conf,v 1.28 2018/06/19 15:12:05 jmcneill Exp $
+# $NetBSD: evbarm.conf,v 1.29 2018/10/06 09:58:55 jmcneill Exp $
 # evbarm shared config
 #
 image=$HOME/${board}.img
@@ -138,8 +138,6 @@ EOF
 	if $resize; then
 		cat >> ${mnt}/etc/rc.conf << EOF
 resize_disklabel=YES
-resize_disklabel_disk=ld0
-resize_disklabel_part=a
 resize_root=YES
 resize_root_flags="-p"
 resize_root_postcmd="/sbin/reboot -n"

Index: src/distrib/utils/embedded/files/resize_disklabel
diff -u src/distrib/utils/embedded/files/resize_disklabel:1.2 src/distrib/utils/embedded/files/resize_disklabel:1.3
--- src/distrib/utils/embedded/files/resize_disklabel:1.2	Fri Apr 14 13:47:21 2017
+++ src/distrib/utils/embedded/files/resize_disklabel	Sat Oct  6 09:58:55 2018
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# $NetBSD: resize_disklabel,v 1.2 2017/04/14 13:47:21 jmcneill Exp $
+# $NetBSD: resize_disklabel,v 1.3 2018/10/06 09:58:55 jmcneill Exp $
 #
 
 # PROVIDE: resize_disklabel
@@ -80,12 +80,10 @@ grow_disklabel()
 resize_disklabel_start()
 {
 	if [ x"${resize_disklabel_disk}" = "x" ]; then
-		warn "\${resize_disklabel_disk} is not set, not resizing disklabel"
-		return
+		resize_disklabel_disk="$(/sbin/sysctl -n kern.root_device)"
 	fi
 	if [ x"${resize_disklabel_part}" = "x" ]; then
-		warn "\${resize_disklabel_part} is not set, not resizing disklabel"
-		return
+		resize_disklabel_part=$(printf \\$(printf '%03o' $(( 97 + $(sysctl -n kern.root_partition) 
 	fi
 
 	grow_mbrpart "${resize_disklabel_disk}"



CVS commit: src/distrib/utils/embedded

2018-08-27 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Mon Aug 27 22:36:49 UTC 2018

Modified Files:
src/distrib/utils/embedded/conf: arm64.conf
Removed Files:
src/distrib/utils/embedded/files: arm64_extlinux.conf

Log Message:
Install ELF kernel to the FFS partition and boot it with bootaa64.efi
instead of loading kernel.img from the MSDOS partition with extlinux.conf


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/distrib/utils/embedded/conf/arm64.conf
cvs rdiff -u -r1.1 -r0 src/distrib/utils/embedded/files/arm64_extlinux.conf

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

Modified files:

Index: src/distrib/utils/embedded/conf/arm64.conf
diff -u src/distrib/utils/embedded/conf/arm64.conf:1.3 src/distrib/utils/embedded/conf/arm64.conf:1.4
--- src/distrib/utils/embedded/conf/arm64.conf:1.3	Sun Aug 12 17:15:56 2018
+++ src/distrib/utils/embedded/conf/arm64.conf	Mon Aug 27 22:36:49 2018
@@ -1,4 +1,4 @@
-# $NetBSD: arm64.conf,v 1.3 2018/08/12 17:15:56 jmcneill Exp $
+# $NetBSD: arm64.conf,v 1.4 2018/08/27 22:36:49 jmcneill Exp $
 # ARM64 customization script used by mkimage
 #
 board=arm64
@@ -29,9 +29,15 @@ EOF
 populate_common() {
 	# Rename kernel to netbsd.img
 	mv "${mnt}/boot/netbsd-${kernel_GENERIC64}.img" "${mnt}/boot/netbsd.img"
-	# Install boot configuration file
-	mkdir -p "${mnt}/boot/extlinux"
-	cp ${DIR}/files/arm64_extlinux.conf "${mnt}/boot/extlinux/extlinux.conf"
+
+	# Install EFI bootloader
+	mkdir -p "${mnt}/boot/EFI/BOOT"
+	cp "${release}/usr/mdec/bootaa64.efi" "${mnt}/boot/EFI/BOOT/bootaa64.efi"
+
+	# Install kernel to root of the FFS partition
+	${GZIP_CMD} -dc ${kernel}/netbsd-${kernel_GENERIC64}.gz > "${mnt}/netbsd"
+	echo "./netbsd type=file uname=root gname=wheel mode=0755" \
+	>> "$tmp/selected_sets"
 }
 
 populate_allwinner() {



CVS commit: src/distrib/utils/embedded/conf

2018-08-12 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Aug 12 17:15:56 UTC 2018

Modified Files:
src/distrib/utils/embedded/conf: arm64.conf

Log Message:
Move rk3399 dtb files to the correct location


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/distrib/utils/embedded/conf/arm64.conf

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

Modified files:

Index: src/distrib/utils/embedded/conf/arm64.conf
diff -u src/distrib/utils/embedded/conf/arm64.conf:1.2 src/distrib/utils/embedded/conf/arm64.conf:1.3
--- src/distrib/utils/embedded/conf/arm64.conf:1.2	Tue Jun 19 15:13:51 2018
+++ src/distrib/utils/embedded/conf/arm64.conf	Sun Aug 12 17:15:56 2018
@@ -1,4 +1,4 @@
-# $NetBSD: arm64.conf,v 1.2 2018/06/19 15:13:51 jmcneill Exp $
+# $NetBSD: arm64.conf,v 1.3 2018/08/12 17:15:56 jmcneill Exp $
 # ARM64 customization script used by mkimage
 #
 board=arm64
@@ -44,6 +44,7 @@ populate_rockchip() {
 	# U-Boot expects 64-bit DTB files to live in a rockchip/ subdirectory
 	mkdir -p "${mnt}/boot/dtb/rockchip"
 	mv "${mnt}"/boot/rk3328-*.dtb "${mnt}/boot/dtb/rockchip/"
+	mv "${mnt}"/boot/rk3399-*.dtb "${mnt}/boot/dtb/rockchip/"
 }
 
 populate_rpi() {



CVS commit: src/distrib/utils/embedded/files

2018-07-04 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Wed Jul  4 23:10:06 UTC 2018

Modified Files:
src/distrib/utils/embedded/files: armv7_boot.cmd

Log Message:
Enable booting of netbsd-EXYNOS kernel


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/distrib/utils/embedded/files/armv7_boot.cmd

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

Modified files:

Index: src/distrib/utils/embedded/files/armv7_boot.cmd
diff -u src/distrib/utils/embedded/files/armv7_boot.cmd:1.5 src/distrib/utils/embedded/files/armv7_boot.cmd:1.6
--- src/distrib/utils/embedded/files/armv7_boot.cmd:1.5	Sat Jan  6 20:27:31 2018
+++ src/distrib/utils/embedded/files/armv7_boot.cmd	Wed Jul  4 23:10:06 2018
@@ -1,3 +1,9 @@
+if test "${soc}" = "exynos" ; then
+	setenv kernel netbsd-EXYNOS.ub
+	setenv bootargs 'root=ld1a'
+	setenv mmcpart 0:1
+	setenv use_fdt 1
+fi
 if test "${soc}" = "sunxi" ; then
 	setenv kernel netbsd-SUNXI.ub
 	setenv bootargs 'root=ld0a'



CVS commit: src/distrib/utils/embedded/conf

2018-06-19 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Tue Jun 19 15:13:51 UTC 2018

Modified Files:
src/distrib/utils/embedded/conf: arm64.conf

Log Message:
Install RK3328 .dtb files to the correct location


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/distrib/utils/embedded/conf/arm64.conf

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

Modified files:

Index: src/distrib/utils/embedded/conf/arm64.conf
diff -u src/distrib/utils/embedded/conf/arm64.conf:1.1 src/distrib/utils/embedded/conf/arm64.conf:1.2
--- src/distrib/utils/embedded/conf/arm64.conf:1.1	Sun Apr  1 04:35:02 2018
+++ src/distrib/utils/embedded/conf/arm64.conf	Tue Jun 19 15:13:51 2018
@@ -1,4 +1,4 @@
-# $NetBSD: arm64.conf,v 1.1 2018/04/01 04:35:02 ryo Exp $
+# $NetBSD: arm64.conf,v 1.2 2018/06/19 15:13:51 jmcneill Exp $
 # ARM64 customization script used by mkimage
 #
 board=arm64
@@ -40,6 +40,12 @@ populate_allwinner() {
 	mv "${mnt}"/boot/sun50i-*.dtb "${mnt}/boot/dtb/allwinner/"
 }
 
+populate_rockchip() {
+	# U-Boot expects 64-bit DTB files to live in a rockchip/ subdirectory
+	mkdir -p "${mnt}/boot/dtb/rockchip"
+	mv "${mnt}"/boot/rk3328-*.dtb "${mnt}/boot/dtb/rockchip/"
+}
+
 populate_rpi() {
 	firmwaredir="${src}/external/broadcom/rpi-firmware/dist"
 	firmwarefiles="LICENCE.broadcom bootcode.bin fixup.dat fixup_cd.dat start.elf start_cd.elf"
@@ -107,6 +113,7 @@ populate() {
 	# SoC specific configuration
 	populate_allwinner
 	populate_nvidia
+	populate_rockchip
 
 	# Board specific configuration
 	populate_rpi



CVS commit: src/distrib/utils/embedded/conf

2018-06-19 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Tue Jun 19 15:12:05 UTC 2018

Modified Files:
src/distrib/utils/embedded/conf: evbarm.conf

Log Message:
Increase reserved space at start of image from 4MB to 16MB to make room
for Rockchip bootloaders.


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/distrib/utils/embedded/conf/evbarm.conf

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

Modified files:

Index: src/distrib/utils/embedded/conf/evbarm.conf
diff -u src/distrib/utils/embedded/conf/evbarm.conf:1.27 src/distrib/utils/embedded/conf/evbarm.conf:1.28
--- src/distrib/utils/embedded/conf/evbarm.conf:1.27	Sat May 13 10:44:58 2017
+++ src/distrib/utils/embedded/conf/evbarm.conf	Tue Jun 19 15:12:05 2018
@@ -1,4 +1,4 @@
-# $NetBSD: evbarm.conf,v 1.27 2017/05/13 10:44:58 hubertf Exp $
+# $NetBSD: evbarm.conf,v 1.28 2018/06/19 15:12:05 jmcneill Exp $
 # evbarm shared config
 #
 image=$HOME/${board}.img
@@ -7,7 +7,7 @@ MACHINE=evbarm
 
 swap=256
 extra=48		# spare space
-init=8
+init=32
 boot=$((192 - ${init}))
 ffsoffset=$(( (${init} + ${boot} + ${swap}) / 2 ))m
 



CVS commit: src/distrib/utils/embedded/files

2018-01-06 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Jan  6 20:27:31 UTC 2018

Modified Files:
src/distrib/utils/embedded/files: armv7_boot.cmd

Log Message:
Enable automatic booting on tegra210


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/distrib/utils/embedded/files/armv7_boot.cmd

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

Modified files:

Index: src/distrib/utils/embedded/files/armv7_boot.cmd
diff -u src/distrib/utils/embedded/files/armv7_boot.cmd:1.4 src/distrib/utils/embedded/files/armv7_boot.cmd:1.5
--- src/distrib/utils/embedded/files/armv7_boot.cmd:1.4	Mon Dec 18 19:08:16 2017
+++ src/distrib/utils/embedded/files/armv7_boot.cmd	Sat Jan  6 20:27:31 2018
@@ -10,6 +10,15 @@ if test "${soc}" = "tegra" ; then
 	setenv mmcpart 1:1
 	setenv use_fdt 1
 fi
+if test "${soc}" = "tegra210" ; then
+	setenv kernel netbsd-TEGRA.ub
+	setenv bootargs root=ld0a
+	setenv mmcpart 1:1
+	setenv use_fdt 1
+	setenv fdtfile ${soc}-${board}.dtb
+	# enable PCIe
+	pci enum
+fi
 if test "${board}" = "am335x" ; then
 	setenv kernel netbsd-BEAGLEBONE.ub
 	setenv mmcpart 0:1



CVS commit: src/distrib/utils/embedded/files

2017-12-18 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Mon Dec 18 19:08:16 UTC 2017

Modified Files:
src/distrib/utils/embedded/files: armv7_boot.cmd

Log Message:
No need to specify console=fb for pinebook anymore as WSDISPLAY_MULTICONS will 
give us a framebuffer console


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/distrib/utils/embedded/files/armv7_boot.cmd

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

Modified files:

Index: src/distrib/utils/embedded/files/armv7_boot.cmd
diff -u src/distrib/utils/embedded/files/armv7_boot.cmd:1.3 src/distrib/utils/embedded/files/armv7_boot.cmd:1.4
--- src/distrib/utils/embedded/files/armv7_boot.cmd:1.3	Sat Dec 16 21:28:19 2017
+++ src/distrib/utils/embedded/files/armv7_boot.cmd	Mon Dec 18 19:08:16 2017
@@ -1,10 +1,6 @@
 if test "${soc}" = "sunxi" ; then
 	setenv kernel netbsd-SUNXI.ub
-	if test "${fdtfile}" = "allwinner/sun50i-a64-pinebook.dtb" ; ten
-		setenv bootargs 'root=ld0a console=fb'
-	else
-		setenv bootargs 'root=ld0a'
-	fi
+	setenv bootargs 'root=ld0a'
 	setenv mmcpart 0:1
 	setenv use_fdt 1
 fi



CVS commit: src/distrib/utils/embedded/files

2017-12-16 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Dec 16 21:28:19 UTC 2017

Modified Files:
src/distrib/utils/embedded/files: armv7_boot.cmd

Log Message:
Use fb console by default on Pinebook


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/distrib/utils/embedded/files/armv7_boot.cmd

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

Modified files:

Index: src/distrib/utils/embedded/files/armv7_boot.cmd
diff -u src/distrib/utils/embedded/files/armv7_boot.cmd:1.2 src/distrib/utils/embedded/files/armv7_boot.cmd:1.3
--- src/distrib/utils/embedded/files/armv7_boot.cmd:1.2	Sun Oct  8 00:35:26 2017
+++ src/distrib/utils/embedded/files/armv7_boot.cmd	Sat Dec 16 21:28:19 2017
@@ -1,6 +1,10 @@
 if test "${soc}" = "sunxi" ; then
 	setenv kernel netbsd-SUNXI.ub
-	setenv bootargs root=ld0a
+	if test "${fdtfile}" = "allwinner/sun50i-a64-pinebook.dtb" ; ten
+		setenv bootargs 'root=ld0a console=fb'
+	else
+		setenv bootargs 'root=ld0a'
+	fi
 	setenv mmcpart 0:1
 	setenv use_fdt 1
 fi



CVS commit: src/distrib/utils/embedded/conf

2017-12-12 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Tue Dec 12 21:00:28 UTC 2017

Modified Files:
src/distrib/utils/embedded/conf: rpi.conf

Log Message:
Fix spelling in error message


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/distrib/utils/embedded/conf/rpi.conf

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

Modified files:

Index: src/distrib/utils/embedded/conf/rpi.conf
diff -u src/distrib/utils/embedded/conf/rpi.conf:1.33 src/distrib/utils/embedded/conf/rpi.conf:1.34
--- src/distrib/utils/embedded/conf/rpi.conf:1.33	Mon Dec 11 11:38:14 2017
+++ src/distrib/utils/embedded/conf/rpi.conf	Tue Dec 12 21:00:28 2017
@@ -1,4 +1,4 @@
-# $NetBSD: rpi.conf,v 1.33 2017/12/11 11:38:14 jmcneill Exp $
+# $NetBSD: rpi.conf,v 1.34 2017/12/12 21:00:28 jmcneill Exp $
 # Raspberry Pi customization script used by mkimage
 #
 
@@ -121,6 +121,6 @@ EOF
 			echo " $f"
 			cp ${firmwaredir}/${f} . || exit 1
 		done
-	) || fail "Copy of firmeware into ${mnt}/boot failed"
+	) || fail "Copy of firmware into ${mnt}/boot failed"
 
 }



CVS commit: src/distrib/utils/embedded/conf

2017-12-03 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Dec  3 13:31:45 UTC 2017

Modified Files:
src/distrib/utils/embedded/conf: armv7.conf

Log Message:
On 64-bit boards, U-Boot expects to find .dtb files in an allwinner/ 
subdirectory


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/distrib/utils/embedded/conf/armv7.conf

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

Modified files:

Index: src/distrib/utils/embedded/conf/armv7.conf
diff -u src/distrib/utils/embedded/conf/armv7.conf:1.21 src/distrib/utils/embedded/conf/armv7.conf:1.22
--- src/distrib/utils/embedded/conf/armv7.conf:1.21	Thu Nov 30 19:55:47 2017
+++ src/distrib/utils/embedded/conf/armv7.conf	Sun Dec  3 13:31:45 2017
@@ -1,4 +1,4 @@
-# $NetBSD: armv7.conf,v 1.21 2017/11/30 19:55:47 jmcneill Exp $
+# $NetBSD: armv7.conf,v 1.22 2017/12/03 13:31:45 jmcneill Exp $
 # ARMv7 customization script used by mkimage
 #
 board=armv7
@@ -103,7 +103,9 @@ EOF
 }
 
 populate_sunxi() {
-	:
+	# U-Boot expects 64-bit DTB files to live in an allwinner/ subdirectory
+	mkdir -p "${mnt}/boot/allwinner"
+	mv "${mnt}"/boot/sun50i-* "${mnt}/boot/allwinner/"
 }
 
 populate_tegra() {



CVS commit: src/distrib/utils/embedded/conf

2017-11-30 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Thu Nov 30 19:55:47 UTC 2017

Modified Files:
src/distrib/utils/embedded/conf: armv7.conf

Log Message:
Remove legacy awin kernels from image


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/distrib/utils/embedded/conf/armv7.conf

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

Modified files:

Index: src/distrib/utils/embedded/conf/armv7.conf
diff -u src/distrib/utils/embedded/conf/armv7.conf:1.20 src/distrib/utils/embedded/conf/armv7.conf:1.21
--- src/distrib/utils/embedded/conf/armv7.conf:1.20	Tue Nov 28 02:56:44 2017
+++ src/distrib/utils/embedded/conf/armv7.conf	Thu Nov 30 19:55:47 2017
@@ -1,4 +1,4 @@
-# $NetBSD: armv7.conf,v 1.20 2017/11/28 02:56:44 kre Exp $
+# $NetBSD: armv7.conf,v 1.21 2017/11/30 19:55:47 jmcneill Exp $
 # ARMv7 customization script used by mkimage
 #
 board=armv7
@@ -8,7 +8,6 @@ resize=true
 . ${DIR}/conf/evbarm.conf
 
 kernels_beagle="BEAGLEBOARD BEAGLEBONE"
-kernels_awin="BPI CUBIEBOARD CUBIETRUCK"
 kernels_rpi="RPI2"
 kernels_amlogic="ODROID-C1"
 kernels_tegra="TEGRA"
@@ -41,10 +40,6 @@ populate_beagle() {
 	:
 }
 
-populate_awin() {
-	:
-}
-
 populate_rpi() {
 	firmwaredir="${src}/external/broadcom/rpi-firmware/dist"
 	firmwarefiles="LICENCE.broadcom bootcode.bin fixup.dat fixup_cd.dat start.elf start_cd.elf"
@@ -119,7 +114,7 @@ populate() {
 	echo "${bar} looking for kernels in ${kernel} ${bar}"
 	kernels=""
 	# .ub kernels
-	for k in $kernels_beagle $kernels_awin $kernels_sunxi $kernels_amlogic $kernels_tegra; do
+	for k in $kernels_beagle $kernels_sunxi $kernels_amlogic $kernels_tegra; do
 		f="${kernel}/netbsd-${k}.ub.gz"
 		test -f "${f}" && kernels="${kernels} ${f}"
 	done
@@ -156,7 +151,6 @@ populate() {
 
 	# board specific configuration
 	populate_beagle
-	populate_awin
 	populate_rpi
 	populate_amlogic
 	populate_tegra



CVS commit: src/distrib/utils/embedded

2017-11-27 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Tue Nov 28 02:56:44 UTC 2017

Modified Files:
src/distrib/utils/embedded: mkimage
src/distrib/utils/embedded/conf: armv7.conf rpi.conf rpi_inst.conf
x86.conf

Log Message:
Be more precise about exactly what fails when something does.

Relying upon set -e to abort things is sort of OK (it is not
a recommended option to use in general - too many odd special cases),
but only if user can work out from the "build failed" what actually
went wrong.

Tested only on amd64 build (for this, i386 is the same) - if anyone
has problems on builds for other systems, please let me know.  However
the changes affect only failure paths, the most likely problem would
be for a build to fail to halt on an error, and I hope I have avoided
that.  There should be no difference at all to error-free builds.


To generate a diff of this commit:
cvs rdiff -u -r1.68 -r1.69 src/distrib/utils/embedded/mkimage
cvs rdiff -u -r1.19 -r1.20 src/distrib/utils/embedded/conf/armv7.conf
cvs rdiff -u -r1.31 -r1.32 src/distrib/utils/embedded/conf/rpi.conf
cvs rdiff -u -r1.9 -r1.10 src/distrib/utils/embedded/conf/rpi_inst.conf
cvs rdiff -u -r1.7 -r1.8 src/distrib/utils/embedded/conf/x86.conf

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

Modified files:

Index: src/distrib/utils/embedded/mkimage
diff -u src/distrib/utils/embedded/mkimage:1.68 src/distrib/utils/embedded/mkimage:1.69
--- src/distrib/utils/embedded/mkimage:1.68	Tue Nov 28 00:24:08 2017
+++ src/distrib/utils/embedded/mkimage	Tue Nov 28 02:56:44 2017
@@ -1,5 +1,5 @@
 #!/bin/sh
-# $NetBSD: mkimage,v 1.68 2017/11/28 00:24:08 kre Exp $
+# $NetBSD: mkimage,v 1.69 2017/11/28 02:56:44 kre Exp $
 #
 # Copyright (c) 2013, 2014 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -78,6 +78,12 @@ cleanup() {
 	esac
 }
 
+fail() {
+	IFS=' '
+	echo >&2 "${PROG}: $*"
+	exit 1
+}
+
 getsize() {
 	set -- $(ls -l $1)
 	echo $5

Index: src/distrib/utils/embedded/conf/armv7.conf
diff -u src/distrib/utils/embedded/conf/armv7.conf:1.19 src/distrib/utils/embedded/conf/armv7.conf:1.20
--- src/distrib/utils/embedded/conf/armv7.conf:1.19	Thu Nov  9 21:36:46 2017
+++ src/distrib/utils/embedded/conf/armv7.conf	Tue Nov 28 02:56:44 2017
@@ -1,4 +1,4 @@
-# $NetBSD: armv7.conf,v 1.19 2017/11/09 21:36:46 skrll Exp $
+# $NetBSD: armv7.conf,v 1.20 2017/11/28 02:56:44 kre Exp $
 # ARMv7 customization script used by mkimage
 #
 board=armv7
@@ -150,7 +150,8 @@ populate() {
 		*)
 			cp "${k}" "${mnt}/boot/${tgt}"
 			;;
-		esac
+		esac ||
+			fail "Copy of ${k} to ${mnt}/boot/${tgt} failed"
 	done
 
 	# board specific configuration

Index: src/distrib/utils/embedded/conf/rpi.conf
diff -u src/distrib/utils/embedded/conf/rpi.conf:1.31 src/distrib/utils/embedded/conf/rpi.conf:1.32
--- src/distrib/utils/embedded/conf/rpi.conf:1.31	Thu Nov  9 21:36:46 2017
+++ src/distrib/utils/embedded/conf/rpi.conf	Tue Nov 28 02:56:44 2017
@@ -1,4 +1,4 @@
-# $NetBSD: rpi.conf,v 1.31 2017/11/09 21:36:46 skrll Exp $
+# $NetBSD: rpi.conf,v 1.32 2017/11/28 02:56:44 kre Exp $
 # Raspberry Pi customization script used by mkimage
 #
 
@@ -72,7 +72,7 @@ EOF
 	*)
 		cp ${kernel} ${mnt}/boot/kernel.img
 		;;
-	esac
+	esac || fail "copy of ${kernel} to ${mnt}/boot/kernel.img failed"
 
 	echo "${bar} installing RPI2 kernel ${bar}"
 	case ${rpi2_kernel} in
@@ -80,16 +80,16 @@ EOF
 		gzip -dc ${rpi2_kernel} > ${mnt}/boot/kernel7.img
 		;;
 	*)
-		cp ${rpi_kernel} ${mnt}/boot/kernel7.img
+		cp ${rpi2_kernel} ${mnt}/boot/kernel7.img
 		;;
-	esac
+	esac || fail "Copy of ${rpi2_kernel} to ${mnt}/boot/kernel7.img failed"
 
 	echo "${bar} installing firmware files ${bar}"
 	(cd ${mnt}/boot &&
 		for f in ${firmwarefiles}; do
 			echo " $f"
-			cp ${firmwaredir}/${f} .
+			cp ${firmwaredir}/${f} . || exit 1
 		done
-	)
+	) || fail "Copy of firmeware into ${mnt}/boot failed"
 
 }

Index: src/distrib/utils/embedded/conf/rpi_inst.conf
diff -u src/distrib/utils/embedded/conf/rpi_inst.conf:1.9 src/distrib/utils/embedded/conf/rpi_inst.conf:1.10
--- src/distrib/utils/embedded/conf/rpi_inst.conf:1.9	Mon Jul 31 16:34:22 2017
+++ src/distrib/utils/embedded/conf/rpi_inst.conf	Tue Nov 28 02:56:44 2017
@@ -1,4 +1,4 @@
-# $NetBSD: rpi_inst.conf,v 1.9 2017/07/31 16:34:22 jmcneill Exp $
+# $NetBSD: rpi_inst.conf,v 1.10 2017/11/28 02:56:44 kre Exp $
 # Raspberry Pi customization script used by mkimage
 #
 
@@ -102,14 +102,14 @@ EOF
 	*)
 		cp ${kernel} ${mnt}/boot/kernel.img
 		;;
-	esac
+	esac || fail "copy of ${kernel} to  ${mnt}/boot/kernel.img failed"
 
 	echo "${bar} installing firmware files ${bar}"
 	(cd ${mnt}/boot &&
 		for f in ${firmwarefiles}; do
 			echo " $f"
-			cp ${firmwaredir}/${f} .
+			cp ${firmwaredir}/${f} . || exit 1
 		done
-	)
+	) || fail "Copy of firmware to ${mnt}/boot failed"
 
 }

Index: src/distrib/utils/embedded/conf/x86.conf
diff -u src/distrib/utils/embedded/conf/x86.conf:1.7 src/distrib/utils/embed

CVS commit: src/distrib/utils/embedded

2017-11-27 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Tue Nov 28 00:24:08 UTC 2017

Modified Files:
src/distrib/utils/embedded: mkimage

Log Message:
Handle use of TMPDIR in cleanup as well.


To generate a diff of this commit:
cvs rdiff -u -r1.67 -r1.68 src/distrib/utils/embedded/mkimage

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

Modified files:

Index: src/distrib/utils/embedded/mkimage
diff -u src/distrib/utils/embedded/mkimage:1.67 src/distrib/utils/embedded/mkimage:1.68
--- src/distrib/utils/embedded/mkimage:1.67	Tue Nov 28 00:14:30 2017
+++ src/distrib/utils/embedded/mkimage	Tue Nov 28 00:24:08 2017
@@ -1,5 +1,5 @@
 #!/bin/sh
-# $NetBSD: mkimage,v 1.67 2017/11/28 00:14:30 kre Exp $
+# $NetBSD: mkimage,v 1.68 2017/11/28 00:24:08 kre Exp $
 #
 # Copyright (c) 2013, 2014 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -74,7 +74,7 @@ trap "cleanup" 0 1 2 3 15
 
 cleanup() {
 	case "$tmp" in
-	/tmp/$PROG.*)	rm -fr "$tmp";;
+	"${TMPDIR:-/tmp}/$PROG."*)	rm -fr "$tmp";;
 	esac
 }
 



CVS commit: src/distrib/utils/embedded

2017-11-27 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Tue Nov 28 00:14:30 UTC 2017

Modified Files:
src/distrib/utils/embedded: mkimage

Log Message:
Honour ${TMPDIR} if set for location of image, rather than always
simply using /tmp


To generate a diff of this commit:
cvs rdiff -u -r1.66 -r1.67 src/distrib/utils/embedded/mkimage

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

Modified files:

Index: src/distrib/utils/embedded/mkimage
diff -u src/distrib/utils/embedded/mkimage:1.66 src/distrib/utils/embedded/mkimage:1.67
--- src/distrib/utils/embedded/mkimage:1.66	Thu Jul  6 00:17:04 2017
+++ src/distrib/utils/embedded/mkimage	Tue Nov 28 00:14:30 2017
@@ -1,5 +1,5 @@
 #!/bin/sh
-# $NetBSD: mkimage,v 1.66 2017/07/06 00:17:04 jmcneill Exp $
+# $NetBSD: mkimage,v 1.67 2017/11/28 00:14:30 kre Exp $
 #
 # Copyright (c) 2013, 2014 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -66,7 +66,7 @@ xsets="xbase xcomp xetc xfont xserver" 
 minfree="10%"
 bar="==="
 
-tmp="$(mktemp -d "/tmp/$PROG.XX")"
+tmp="$(mktemp -d "${TMPDIR:-/tmp}/$PROG.XX")"
 mnt="${tmp}/mnt"
 mkdir -p "${mnt}/etc" "${mnt}/dev"
 



CVS commit: src/distrib/utils/embedded/conf

2017-11-09 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Thu Nov  9 21:36:46 UTC 2017

Modified Files:
src/distrib/utils/embedded/conf: armv7.conf rpi.conf

Log Message:
Trailing whitespace


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/distrib/utils/embedded/conf/armv7.conf
cvs rdiff -u -r1.30 -r1.31 src/distrib/utils/embedded/conf/rpi.conf

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

Modified files:

Index: src/distrib/utils/embedded/conf/armv7.conf
diff -u src/distrib/utils/embedded/conf/armv7.conf:1.18 src/distrib/utils/embedded/conf/armv7.conf:1.19
--- src/distrib/utils/embedded/conf/armv7.conf:1.18	Sun Oct  8 00:15:13 2017
+++ src/distrib/utils/embedded/conf/armv7.conf	Thu Nov  9 21:36:46 2017
@@ -1,4 +1,4 @@
-# $NetBSD: armv7.conf,v 1.18 2017/10/08 00:15:13 jmcneill Exp $
+# $NetBSD: armv7.conf,v 1.19 2017/11/09 21:36:46 skrll Exp $
 # ARMv7 customization script used by mkimage
 #
 board=armv7
@@ -62,7 +62,7 @@ EOF
 
 		cat > ${mnt}/boot/config.txt << EOF
 # UART settings, see https://www.raspberrypi.org/documentation/configuration/uart.md
-enable_uart=1
+enable_uart=1
 force_turbo=0
 EOF
 

Index: src/distrib/utils/embedded/conf/rpi.conf
diff -u src/distrib/utils/embedded/conf/rpi.conf:1.30 src/distrib/utils/embedded/conf/rpi.conf:1.31
--- src/distrib/utils/embedded/conf/rpi.conf:1.30	Mon Jul 31 16:34:22 2017
+++ src/distrib/utils/embedded/conf/rpi.conf	Thu Nov  9 21:36:46 2017
@@ -1,4 +1,4 @@
-# $NetBSD: rpi.conf,v 1.30 2017/07/31 16:34:22 jmcneill Exp $
+# $NetBSD: rpi.conf,v 1.31 2017/11/09 21:36:46 skrll Exp $
 # Raspberry Pi customization script used by mkimage
 #
 
@@ -49,7 +49,7 @@ populate() {
 
 	cat > ${mnt}/boot/cmdline.txt << EOF
 root=ld0a console=fb
-#fb=1280x1024		# to select a mode, otherwise try EDID 
+#fb=1280x1024		# to select a mode, otherwise try EDID
 #fb=disable		# to disable fb completely
 EOF
 



CVS commit: src/distrib/utils/embedded/files

2017-10-07 Thread Sevan Janiyan
Module Name:src
Committed By:   sevan
Date:   Sun Oct  8 00:35:26 UTC 2017

Modified Files:
src/distrib/utils/embedded/files: armv7_boot.cmd

Log Message:
Fix test otherwise we try to load a fdtfile for boards which do not have 
use_fdt set.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/distrib/utils/embedded/files/armv7_boot.cmd

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

Modified files:

Index: src/distrib/utils/embedded/files/armv7_boot.cmd
diff -u src/distrib/utils/embedded/files/armv7_boot.cmd:1.1 src/distrib/utils/embedded/files/armv7_boot.cmd:1.2
--- src/distrib/utils/embedded/files/armv7_boot.cmd:1.1	Sat Oct  7 23:40:00 2017
+++ src/distrib/utils/embedded/files/armv7_boot.cmd	Sun Oct  8 00:35:26 2017
@@ -23,7 +23,7 @@ if test "${kernel}" = "" ; then
 	exit
 fi
 
-if test "1" -eq ${use_fdt} ; then
+if test "${use_fdt}" = "1" ; then
 	fatload mmc ${mmcpart} ${kernel_addr_r} ${kernel}
 	fatload mmc ${mmcpart} ${fdt_addr_r} ${fdtfile}
 	fdt addr ${fdt_addr_r}



CVS commit: src/distrib/utils/embedded/conf

2017-10-07 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Oct  8 00:15:13 UTC 2017

Modified Files:
src/distrib/utils/embedded/conf: armv7.conf

Log Message:
Don't install uEnv.txt for beagle; boot.scr handles this now.


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/distrib/utils/embedded/conf/armv7.conf

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

Modified files:

Index: src/distrib/utils/embedded/conf/armv7.conf
diff -u src/distrib/utils/embedded/conf/armv7.conf:1.17 src/distrib/utils/embedded/conf/armv7.conf:1.18
--- src/distrib/utils/embedded/conf/armv7.conf:1.17	Sat Oct  7 23:40:00 2017
+++ src/distrib/utils/embedded/conf/armv7.conf	Sun Oct  8 00:15:13 2017
@@ -1,4 +1,4 @@
-# $NetBSD: armv7.conf,v 1.17 2017/10/07 23:40:00 jmcneill Exp $
+# $NetBSD: armv7.conf,v 1.18 2017/10/08 00:15:13 jmcneill Exp $
 # ARMv7 customization script used by mkimage
 #
 board=armv7
@@ -38,15 +38,7 @@ populate_common() {
 }
 
 populate_beagle() {
-	bboard_kernelimg=netbsd-BEAGLEBOARD.ub
-	bboard_loadaddr=8100
-	bbone_kernelimg=netbsd-BEAGLEBONE.ub
-	bbone_loadaddr=8200
-
-	# Create a uEnv.txt to auto boot the correct kernel
-	cat >> "${mnt}/boot/uEnv.txt" << EOF
-loaduimage=if test \$board = am335x; then fatload mmc 0 ${bbone_loadaddr} ${bbone_kernelimg}; bootm ${bbone_loadaddr} root=ld0a; else fatload mmc 0 ${bboard_loadaddr} ${bboard_kernelimg}; bootm ${bboard_loadaddr} root=ld0a; fi
-EOF
+	:
 }
 
 populate_awin() {



CVS commit: src/distrib/utils/embedded

2017-10-07 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Oct  7 23:40:00 UTC 2017

Modified Files:
src/distrib/utils/embedded/conf: armv7.conf
Added Files:
src/distrib/utils/embedded/files: armv7_boot.cmd

Log Message:
Install a boot.scr on armv7.img that detects the running board and selects
the correct kernel and boot protocol. Should work on tegra, sunxi, and
am335x boards for now.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/distrib/utils/embedded/conf/armv7.conf
cvs rdiff -u -r0 -r1.1 src/distrib/utils/embedded/files/armv7_boot.cmd

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

Modified files:

Index: src/distrib/utils/embedded/conf/armv7.conf
diff -u src/distrib/utils/embedded/conf/armv7.conf:1.16 src/distrib/utils/embedded/conf/armv7.conf:1.17
--- src/distrib/utils/embedded/conf/armv7.conf:1.16	Mon Jul 31 16:34:22 2017
+++ src/distrib/utils/embedded/conf/armv7.conf	Sat Oct  7 23:40:00 2017
@@ -1,4 +1,4 @@
-# $NetBSD: armv7.conf,v 1.16 2017/07/31 16:34:22 jmcneill Exp $
+# $NetBSD: armv7.conf,v 1.17 2017/10/07 23:40:00 jmcneill Exp $
 # ARMv7 customization script used by mkimage
 #
 board=armv7
@@ -31,6 +31,12 @@ devpubd=YES
 EOF
 }
 
+populate_common() {
+	# Install boot script
+	cp ${DIR}/files/armv7_boot.cmd ${mnt}/boot/boot.cmd
+	"${MKUBOOTIMAGE}" -A arm -C none -O netbsd -T script -a 0 -n "NetBSD/armv7 boot" "${mnt}/boot/boot.cmd" "${mnt}/boot/boot.scr"
+}
+
 populate_beagle() {
 	bboard_kernelimg=netbsd-BEAGLEBOARD.ub
 	bboard_loadaddr=8100
@@ -44,10 +50,7 @@ EOF
 }
 
 populate_awin() {
-	cat >> "${mnt}/boot/uEnv.txt" << EOF
-bootargs=root=ld0a console=${console}
-uenvcmd=mmc dev 0; mmc rescan; if test \$fdtfile = sun7i-a20-cubieboard2.dtb; then setenv kernel netbsd-CUBIEBOARD.ub; elif test \$fdtfile = sun7i-a20-cubietruck.dtb; then setenv kernel netbsd-CUBIETRUCK.ub; elif test \$fdtfile = sun6i-a31-hummingbird.dtb; then setenv kernel netbsd-HUMMINGBIRD_A31.ub; elif test \$fdtfile = sun7i-a20-bananapi.dtb; then setenv kernel netbsd-BPI.ub; fi; fatload mmc 0:1 8200 \$kernel; bootm 8200
-EOF
+	:
 }
 
 populate_rpi() {
@@ -117,18 +120,7 @@ populate_sunxi() {
 }
 
 populate_tegra() {
-	tegra_kernelimg=netbsd-TEGRA.ub
-	tegra_loadaddr=0x9000
-
-	# Create a boot.scr for Tegra U-Boot
-	cat > "${mnt}/boot/boot-TEGRA.txt" << EOF
-setenv bootargs root=ld0a
-fatload mmc 1:1 ${tegra_loadaddr} ${tegra_kernelimg}
-fatload mmc 1:1 \${fdt_addr_r} tegra124-\${board}.dtb
-fdt addr \${fdt_addr_r}
-bootm ${tegra_loadaddr} - \${fdt_addr_r}
-EOF
-	"${MKUBOOTIMAGE}" -A arm -C none -O netbsd -T script -a 0 -n "NetBSD/tegra boot" "${mnt}/boot/boot-TEGRA.txt" "${mnt}/boot/boot.scr"
+	:
 }
 
 populate() {
@@ -176,4 +168,7 @@ populate() {
 	populate_amlogic
 	populate_tegra
 	populate_sunxi
+
+	# common configuration
+	populate_common
 }

Added files:

Index: src/distrib/utils/embedded/files/armv7_boot.cmd
diff -u /dev/null src/distrib/utils/embedded/files/armv7_boot.cmd:1.1
--- /dev/null	Sat Oct  7 23:40:00 2017
+++ src/distrib/utils/embedded/files/armv7_boot.cmd	Sat Oct  7 23:40:00 2017
@@ -0,0 +1,34 @@
+if test "${soc}" = "sunxi" ; then
+	setenv kernel netbsd-SUNXI.ub
+	setenv bootargs root=ld0a
+	setenv mmcpart 0:1
+	setenv use_fdt 1
+fi
+if test "${soc}" = "tegra" ; then
+	setenv kernel netbsd-TEGRA.ub
+	setenv bootargs root=ld1a
+	setenv mmcpart 1:1
+	setenv use_fdt 1
+fi
+if test "${board}" = "am335x" ; then
+	setenv kernel netbsd-BEAGLEBONE.ub
+	setenv mmcpart 0:1
+	setenv bootargs root=ld0a
+fi
+
+if test "${kernel}" = "" ; then
+	echo '>>>'
+	echo '>>> Target device is not supported by this script.'
+	echo '>>>'
+	exit
+fi
+
+if test "1" -eq ${use_fdt} ; then
+	fatload mmc ${mmcpart} ${kernel_addr_r} ${kernel}
+	fatload mmc ${mmcpart} ${fdt_addr_r} ${fdtfile}
+	fdt addr ${fdt_addr_r}
+	bootm ${kernel_addr_r} - ${fdt_addr_r}
+else
+	fatload mmc ${mmcpart} ${kernel_addr_r} ${kernel}
+	bootm ${kernel_addr_r} ${bootargs}
+fi



CVS commit: src/distrib/utils/embedded/conf

2017-07-31 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Mon Jul 31 16:34:23 UTC 2017

Modified Files:
src/distrib/utils/embedded/conf: armv7.conf rpi.conf rpi_inst.conf

Log Message:
Create a config.txt for RPI and set 'enable_uart=1' and 'force_turbo=0'.
This config gives us a stable core_freq clock that is used to drive the
SD HOST and AUX UART devices.

More information on config.txt settings for the UART can be found here:

https://www.raspberrypi.org/documentation/configuration/uart.md


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/distrib/utils/embedded/conf/armv7.conf
cvs rdiff -u -r1.29 -r1.30 src/distrib/utils/embedded/conf/rpi.conf
cvs rdiff -u -r1.8 -r1.9 src/distrib/utils/embedded/conf/rpi_inst.conf

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

Modified files:

Index: src/distrib/utils/embedded/conf/armv7.conf
diff -u src/distrib/utils/embedded/conf/armv7.conf:1.15 src/distrib/utils/embedded/conf/armv7.conf:1.16
--- src/distrib/utils/embedded/conf/armv7.conf:1.15	Sun Jul  9 10:41:40 2017
+++ src/distrib/utils/embedded/conf/armv7.conf	Mon Jul 31 16:34:22 2017
@@ -1,4 +1,4 @@
-# $NetBSD: armv7.conf,v 1.15 2017/07/09 10:41:40 jmcneill Exp $
+# $NetBSD: armv7.conf,v 1.16 2017/07/31 16:34:22 jmcneill Exp $
 # ARMv7 customization script used by mkimage
 #
 board=armv7
@@ -65,6 +65,12 @@ root=ld0a console=${console}
 #fb=disable		# to disable fb completely
 EOF
 
+		cat > ${mnt}/boot/config.txt << EOF
+# UART settings, see https://www.raspberrypi.org/documentation/configuration/uart.md
+enable_uart=1
+force_turbo=0
+EOF
+
 	echo "${bar} installing firmware files ${bar}"
 		(cd "${mnt}/boot" &&
 			for f in ${firmwarefiles}; do

Index: src/distrib/utils/embedded/conf/rpi.conf
diff -u src/distrib/utils/embedded/conf/rpi.conf:1.29 src/distrib/utils/embedded/conf/rpi.conf:1.30
--- src/distrib/utils/embedded/conf/rpi.conf:1.29	Sun Apr 19 18:28:31 2015
+++ src/distrib/utils/embedded/conf/rpi.conf	Mon Jul 31 16:34:22 2017
@@ -1,4 +1,4 @@
-# $NetBSD: rpi.conf,v 1.29 2015/04/19 18:28:31 hubertf Exp $
+# $NetBSD: rpi.conf,v 1.30 2017/07/31 16:34:22 jmcneill Exp $
 # Raspberry Pi customization script used by mkimage
 #
 
@@ -52,6 +52,13 @@ root=ld0a console=fb
 #fb=1280x1024		# to select a mode, otherwise try EDID 
 #fb=disable		# to disable fb completely
 EOF
+
+	cat > ${mnt}/boot/config.txt << EOF
+# UART settings, see https://www.raspberrypi.org/documentation/configuration/uart.md
+enable_uart=1
+force_turbo=0
+EOF
+
 	if [ ! -f ${kernel} ]; then
 		echo ${PROG}: Missing ${kernel} 1>&2
 		exit 1

Index: src/distrib/utils/embedded/conf/rpi_inst.conf
diff -u src/distrib/utils/embedded/conf/rpi_inst.conf:1.8 src/distrib/utils/embedded/conf/rpi_inst.conf:1.9
--- src/distrib/utils/embedded/conf/rpi_inst.conf:1.8	Sun Apr 19 18:53:33 2015
+++ src/distrib/utils/embedded/conf/rpi_inst.conf	Mon Jul 31 16:34:22 2017
@@ -1,4 +1,4 @@
-# $NetBSD: rpi_inst.conf,v 1.8 2015/04/19 18:53:33 hubertf Exp $
+# $NetBSD: rpi_inst.conf,v 1.9 2017/07/31 16:34:22 jmcneill Exp $
 # Raspberry Pi customization script used by mkimage
 #
 
@@ -82,6 +82,13 @@ root=ld0a console=fb
 #fb=1280x1024		# to select a mode, otherwise try EDID 
 #fb=disable		# to disable fb completely
 EOF
+
+	cat > ${mnt}/boot/config.txt << EOF
+# UART settings, see https://www.raspberrypi.org/documentation/configuration/uart.md
+enable_uart=1
+force_turbo=0
+EOF
+
 	if [ ! -f ${kernel} ]; then
 		echo ${PROG}: Missing ${kernel} 1>&2
 		exit 1



CVS commit: src/distrib/utils/embedded/conf

2017-07-09 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Jul  9 10:41:40 UTC 2017

Modified Files:
src/distrib/utils/embedded/conf: armv7.conf

Log Message:
Add : to body of populate_sunxi to appease bash.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/distrib/utils/embedded/conf/armv7.conf

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

Modified files:

Index: src/distrib/utils/embedded/conf/armv7.conf
diff -u src/distrib/utils/embedded/conf/armv7.conf:1.14 src/distrib/utils/embedded/conf/armv7.conf:1.15
--- src/distrib/utils/embedded/conf/armv7.conf:1.14	Thu Jul  6 21:07:09 2017
+++ src/distrib/utils/embedded/conf/armv7.conf	Sun Jul  9 10:41:40 2017
@@ -1,4 +1,4 @@
-# $NetBSD: armv7.conf,v 1.14 2017/07/06 21:07:09 jmcneill Exp $
+# $NetBSD: armv7.conf,v 1.15 2017/07/09 10:41:40 jmcneill Exp $
 # ARMv7 customization script used by mkimage
 #
 board=armv7
@@ -107,6 +107,7 @@ EOF
 }
 
 populate_sunxi() {
+	:
 }
 
 populate_tegra() {



CVS commit: src/distrib/utils/embedded/conf

2017-07-06 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Thu Jul  6 21:07:09 UTC 2017

Modified Files:
src/distrib/utils/embedded/conf: armv7.conf

Log Message:
Test for kernel build directory before reading DTB list


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/distrib/utils/embedded/conf/armv7.conf

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

Modified files:

Index: src/distrib/utils/embedded/conf/armv7.conf
diff -u src/distrib/utils/embedded/conf/armv7.conf:1.13 src/distrib/utils/embedded/conf/armv7.conf:1.14
--- src/distrib/utils/embedded/conf/armv7.conf:1.13	Thu Jul  6 00:17:04 2017
+++ src/distrib/utils/embedded/conf/armv7.conf	Thu Jul  6 21:07:09 2017
@@ -1,4 +1,4 @@
-# $NetBSD: armv7.conf,v 1.13 2017/07/06 00:17:04 jmcneill Exp $
+# $NetBSD: armv7.conf,v 1.14 2017/07/06 21:07:09 jmcneill Exp $
 # ARMv7 customization script used by mkimage
 #
 board=armv7
@@ -139,7 +139,9 @@ populate() {
 	done
 	# .dtb files
 	for k in $kernels_sunxi $kernels_tegra; do
-		dtbs="$(${MAKE} -C ${KERNOBJDIR}/${k} -v DTB)"
+		test -d "${KERNOBJDIR}/${k}" && \
+		dtbs="$(${MAKE} -C ${KERNOBJDIR}/${k} -v DTB)" || \
+		dtbs=
 		for dtb in $dtbs; do
 			f="${kernel}/${dtb}.gz"
 			test -f "${f}" && kernels="${kernels} ${f}"



CVS commit: src/distrib/utils/embedded

2017-06-10 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Jun 10 23:26:32 UTC 2017

Modified Files:
src/distrib/utils/embedded: mkimage

Log Message:
add the tests set.


To generate a diff of this commit:
cvs rdiff -u -r1.64 -r1.65 src/distrib/utils/embedded/mkimage

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

Modified files:

Index: src/distrib/utils/embedded/mkimage
diff -u src/distrib/utils/embedded/mkimage:1.64 src/distrib/utils/embedded/mkimage:1.65
--- src/distrib/utils/embedded/mkimage:1.64	Tue Apr 11 17:06:30 2017
+++ src/distrib/utils/embedded/mkimage	Sat Jun 10 19:26:32 2017
@@ -1,5 +1,5 @@
 #!/bin/sh
-# $NetBSD: mkimage,v 1.64 2017/04/11 21:06:30 jmcneill Exp $
+# $NetBSD: mkimage,v 1.65 2017/06/10 23:26:32 christos Exp $
 #
 # Copyright (c) 2013, 2014 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -60,7 +60,7 @@ MKUBOOTIMAGE=${TOOL_MKUBOOTIMAGE:-mkuboo
 GZIP_CMD=${TOOL_GZIP:-gzip} # ${GZIP} is special to gzip(1)
 
 src="/usr/src"
-sets="base comp etc games man misc modules text"
+sets="base comp etc games man misc modules tests text"
 xsets="xbase xcomp xetc xfont xserver" 
 minfree="10%"
 bar="==="



CVS commit: src/distrib/utils/embedded/conf

2017-05-13 Thread Hubert Feyrer
Module Name:src
Committed By:   hubertf
Date:   Sat May 13 10:44:58 UTC 2017

Modified Files:
src/distrib/utils/embedded/conf: evbarm.conf

Log Message:
minor cleanup in customize_evbarm():
keep handling of /etc/rc.conf in one place


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/distrib/utils/embedded/conf/evbarm.conf

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

Modified files:

Index: src/distrib/utils/embedded/conf/evbarm.conf
diff -u src/distrib/utils/embedded/conf/evbarm.conf:1.26 src/distrib/utils/embedded/conf/evbarm.conf:1.27
--- src/distrib/utils/embedded/conf/evbarm.conf:1.26	Wed Apr 12 23:32:11 2017
+++ src/distrib/utils/embedded/conf/evbarm.conf	Sat May 13 10:44:58 2017
@@ -1,4 +1,4 @@
-# $NetBSD: evbarm.conf,v 1.26 2017/04/12 23:32:11 jmcneill Exp $
+# $NetBSD: evbarm.conf,v 1.27 2017/05/13 10:44:58 hubertf Exp $
 # evbarm shared config
 #
 image=$HOME/${board}.img
@@ -118,13 +118,14 @@ make_fstab_evbarm() {
 }
 
 customize_evbarm() {
-	cp ${release}/etc/rc.conf ${mnt}/etc/rc.conf
 	if $minwrites; then
 		mkdir ${mnt}/etc/postfix
 		(umask 022
 		sed -e 's/fifo/unix/' < ${release}/etc/postfix/master.cf > \
 		${mnt}/etc/postfix/master.cf)
 	fi
+	
+	cp ${release}/etc/rc.conf ${mnt}/etc/rc.conf
 	cat >> ${mnt}/etc/rc.conf << EOF
 rc_configured=YES
 hostname=${board}



CVS commit: src/distrib/utils/embedded/files

2017-04-14 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Fri Apr 14 13:47:22 UTC 2017

Modified Files:
src/distrib/utils/embedded/files: resize_disklabel

Log Message:
Grow the MBR partition table entry for the BSD partition before
growing the disklabel.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/distrib/utils/embedded/files/resize_disklabel

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

Modified files:

Index: src/distrib/utils/embedded/files/resize_disklabel
diff -u src/distrib/utils/embedded/files/resize_disklabel:1.1 src/distrib/utils/embedded/files/resize_disklabel:1.2
--- src/distrib/utils/embedded/files/resize_disklabel:1.1	Mon Apr  6 20:19:28 2015
+++ src/distrib/utils/embedded/files/resize_disklabel	Fri Apr 14 13:47:21 2017
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# $NetBSD: resize_disklabel,v 1.1 2015/04/06 20:19:28 jmcneill Exp $
+# $NetBSD: resize_disklabel,v 1.2 2017/04/14 13:47:21 jmcneill Exp $
 #
 
 # PROVIDE: resize_disklabel
@@ -33,6 +33,30 @@ get_rawpart_sectors()
 	/sbin/disklabel $disk | grep "^ $rawpart:" | awk '{ print $2; }'
 }
 
+grow_mbrpart()
+{
+	disk=$1
+	rawpart=$(get_rawpart)
+
+	eval $(/sbin/fdisk -S $disk)
+	if [ ! "$PART1ID" = "169" ]; then
+		warn "No NetBSD partition found in MBR partition #1"
+		return
+	fi
+
+	ts=$(($(get_total_sectors $disk) - ${PART1START}))
+	rs=${PART1SIZE}
+
+	if [ "$ts" = "$rs" ]; then
+		return
+	fi
+
+	oldsize=$(($rs * 512 / 1024 / 1024))
+	newsize=$(($ts * 512 / 1024 / 1024))
+	echo "Growing $disk MBR partition #1 (${oldsize}MB -> ${newsize}MB)"
+	/sbin/fdisk -f -u -1 -s 169/${PART1START}/${ts} ${disk}
+}
+
 grow_disklabel()
 {
 	disk=$1
@@ -64,6 +88,7 @@ resize_disklabel_start()
 		return
 	fi
 
+	grow_mbrpart "${resize_disklabel_disk}"
 	grow_disklabel "${resize_disklabel_disk}" "${resize_disklabel_part}"
 }
 



CVS commit: src/distrib/utils/embedded/conf

2017-04-12 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Wed Apr 12 23:35:29 UTC 2017

Modified Files:
src/distrib/utils/embedded/conf: armv7.conf

Log Message:
ODROID-C1: Now that the MBR partition table contains an entry for the BSD
partition, the disklabel no longer conflicts with the ODROID-C1 bootloader.
Root partition changes from ld0e to ld0a.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/distrib/utils/embedded/conf/armv7.conf

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

Modified files:

Index: src/distrib/utils/embedded/conf/armv7.conf
diff -u src/distrib/utils/embedded/conf/armv7.conf:1.11 src/distrib/utils/embedded/conf/armv7.conf:1.12
--- src/distrib/utils/embedded/conf/armv7.conf:1.11	Mon Apr 10 22:25:36 2017
+++ src/distrib/utils/embedded/conf/armv7.conf	Wed Apr 12 23:35:29 2017
@@ -1,4 +1,4 @@
-# $NetBSD: armv7.conf,v 1.11 2017/04/10 22:25:36 jmcneill Exp $
+# $NetBSD: armv7.conf,v 1.12 2017/04/12 23:35:29 jmcneill Exp $
 # ARMv7 customization script used by mkimage
 #
 board=armv7
@@ -99,7 +99,7 @@ populate_amlogic() {
 	cat >> "${mnt}/boot/boot.ini" << EOF
 ODROIDC-UBOOT-CONFIG
 
-setenv bootargs "root=ld0f awge0.mac-address=\${ethaddr} console=${console}"
+setenv bootargs "root=ld0a awge0.mac-address=\${ethaddr} console=${console}"
 setenv bootcmd "fatload mmc 0:1 0x2100 ${odroidc1_kernelimg}; bootm 0x2100"
 run bootcmd
 EOF



CVS commit: src/distrib/utils/embedded/conf

2017-04-12 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Wed Apr 12 23:32:11 UTC 2017

Modified Files:
src/distrib/utils/embedded/conf: evbarm.conf

Log Message:
Slightly reduce the size of the MSDOS partition from 124M to 92M. With
the larger size, installing the ODROID-C1 bootloader causes the fs to
become unreadable. Not sure why..


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/distrib/utils/embedded/conf/evbarm.conf

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

Modified files:

Index: src/distrib/utils/embedded/conf/evbarm.conf
diff -u src/distrib/utils/embedded/conf/evbarm.conf:1.25 src/distrib/utils/embedded/conf/evbarm.conf:1.26
--- src/distrib/utils/embedded/conf/evbarm.conf:1.25	Tue Apr 11 17:30:17 2017
+++ src/distrib/utils/embedded/conf/evbarm.conf	Wed Apr 12 23:32:11 2017
@@ -1,4 +1,4 @@
-# $NetBSD: evbarm.conf,v 1.25 2017/04/11 17:30:17 jmcneill Exp $
+# $NetBSD: evbarm.conf,v 1.26 2017/04/12 23:32:11 jmcneill Exp $
 # evbarm shared config
 #
 image=$HOME/${board}.img
@@ -8,7 +8,7 @@ MACHINE=evbarm
 swap=256
 extra=48		# spare space
 init=8
-boot=$((256 - ${init}))
+boot=$((192 - ${init}))
 ffsoffset=$(( (${init} + ${boot} + ${swap}) / 2 ))m
 
 size=0		# autocompute



CVS commit: src/distrib/utils/embedded

2017-04-11 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Tue Apr 11 21:06:30 UTC 2017

Modified Files:
src/distrib/utils/embedded: mkimage

Log Message:
Now that FAT+FFS images include the BSD partition in the MBR partition
table, install the disklabel after setting up MBR partitions. This moves
the disklabel to the BSD partition from the start of the disk, avoiding
a conflict with the ODROID-C1 bootloader.


To generate a diff of this commit:
cvs rdiff -u -r1.63 -r1.64 src/distrib/utils/embedded/mkimage

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

Modified files:

Index: src/distrib/utils/embedded/mkimage
diff -u src/distrib/utils/embedded/mkimage:1.63 src/distrib/utils/embedded/mkimage:1.64
--- src/distrib/utils/embedded/mkimage:1.63	Tue Apr 11 18:04:08 2017
+++ src/distrib/utils/embedded/mkimage	Tue Apr 11 21:06:30 2017
@@ -1,5 +1,5 @@
 #!/bin/sh
-# $NetBSD: mkimage,v 1.63 2017/04/11 18:04:08 jmcneill Exp $
+# $NetBSD: mkimage,v 1.64 2017/04/11 21:06:30 jmcneill Exp $
 #
 # Copyright (c) 2013, 2014 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -235,9 +235,6 @@ do
 	compare="$((${newsize} * 2 * 1024))"
 done  
 
-echo ${bar} Adding label ${bar}
-make_label > ${tmp}/label
-${DISKLABEL} -R -F ${image} ${tmp}/label
 if [ -n "${msdosid}" ]; then
 	echo ${bar} Running fdisk ${bar}
 	initsecs=$((${init} * 1024))
@@ -251,7 +248,15 @@ if [ -n "${msdosid}" ]; then
 		ffssize="$(expr ${imagesecs} - ${ffsstart})"
 		${FDISK} -f -u -1 -s 169/${ffsstart}/${ffssize} -F ${image}
 	fi
+
+	echo ${bar} Adding label ${bar}
+	make_label > ${tmp}/label
+	${DISKLABEL} -R -F ${image} ${tmp}/label
 elif [ -n "${netbsdid}" ]; then
+	echo ${bar} Adding label ${bar}
+	make_label > ${tmp}/label
+	${DISKLABEL} -R -F ${image} ${tmp}/label
+
 	echo ${bar} Running fdisk ${bar}
 	${FDISK} -f -i ${image}
 	${FDISK} -f -a -u -0 -s 169/${init} ${image}



CVS commit: src/distrib/utils/embedded

2017-04-11 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Tue Apr 11 18:04:08 UTC 2017

Modified Files:
src/distrib/utils/embedded: mkimage

Log Message:
Improvements and fixes for FAT+FFS images:
 - Add a "NETBSD" volume label to the MSDOS file-system.
 - Explicitly initialize boot sector.
 - Correct an issue where the MSDOS file-system was larger than the
   partition table entry.
 - Add NetBSD partition to the MBR partition table.


To generate a diff of this commit:
cvs rdiff -u -r1.62 -r1.63 src/distrib/utils/embedded/mkimage

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

Modified files:

Index: src/distrib/utils/embedded/mkimage
diff -u src/distrib/utils/embedded/mkimage:1.62 src/distrib/utils/embedded/mkimage:1.63
--- src/distrib/utils/embedded/mkimage:1.62	Tue Mar 14 06:37:39 2017
+++ src/distrib/utils/embedded/mkimage	Tue Apr 11 18:04:08 2017
@@ -1,5 +1,5 @@
 #!/bin/sh
-# $NetBSD: mkimage,v 1.62 2017/03/14 06:37:39 skrll Exp $
+# $NetBSD: mkimage,v 1.63 2017/04/11 18:04:08 jmcneill Exp $
 #
 # Copyright (c) 2013, 2014 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -82,6 +82,28 @@ getsize() {
 	echo $5
 }
 
+getsectors() {
+	case "$1" in
+	*g)
+		m=1073741824
+		v=${1%g}
+		;;
+	*m)
+		m=1048576
+		v=${1%m}
+		;;
+	*k)
+		m=1024
+		v=${1%k}
+		;;
+	*[0-9b])
+		m=1
+		v=${1%b}
+		;;
+	esac
+	echo $((m * v / 512))
+}
+
 usage() {
 	cat << EOF 1>&2
 Usage: $PROG -h  [-bdmx] [-B ] [-K ] [-S ] [-D ] [-c ] [-s ] []
@@ -188,8 +210,8 @@ populate
 
 if [ -n "${msdosid}" ]; then
 	echo ${bar} Populating msdos filesystem ${bar}
-	${MAKEFS} -N ${release}/etc -t msdos \
-	-O $((${init} / 2))m -s $((${boot} / 2 + ${init} / 2))m \
+	${MAKEFS} -N ${release}/etc -t msdos -o volume_label=NETBSD \
+	-O $((${init} / 2))m -s $((${boot} / 2))m \
 	${image} ${mnt}/boot
 fi
 
@@ -220,7 +242,15 @@ if [ -n "${msdosid}" ]; then
 	echo ${bar} Running fdisk ${bar}
 	initsecs=$((${init} * 1024))
 	bootsecs=$((${boot} * 1024))
+	${FDISK} -f -i ${image}
 	${FDISK} -f -a -u -0 -s ${msdosid}/${initsecs}/${bootsecs} -F ${image}
+	if [ -z "${bootonly}" ]; then
+		ffsstart="$(getsectors ${ffsoffset})"
+		imagesize="$(getsize "${image}")"
+		imagesecs="$(getsectors ${imagesize})"
+		ffssize="$(expr ${imagesecs} - ${ffsstart})"
+		${FDISK} -f -u -1 -s 169/${ffsstart}/${ffssize} -F ${image}
+	fi
 elif [ -n "${netbsdid}" ]; then
 	echo ${bar} Running fdisk ${bar}
 	${FDISK} -f -i ${image}



CVS commit: src/distrib/utils/embedded/conf

2017-04-11 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Tue Apr 11 17:30:17 UTC 2017

Modified Files:
src/distrib/utils/embedded/conf: evbarm.conf

Log Message:
Increase the size of the boot partition and remove the 'd' part from the
disklabel.


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/distrib/utils/embedded/conf/evbarm.conf

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

Modified files:

Index: src/distrib/utils/embedded/conf/evbarm.conf
diff -u src/distrib/utils/embedded/conf/evbarm.conf:1.24 src/distrib/utils/embedded/conf/evbarm.conf:1.25
--- src/distrib/utils/embedded/conf/evbarm.conf:1.24	Sat Aug  1 10:04:50 2015
+++ src/distrib/utils/embedded/conf/evbarm.conf	Tue Apr 11 17:30:17 2017
@@ -1,4 +1,4 @@
-# $NetBSD: evbarm.conf,v 1.24 2015/08/01 10:04:50 jmcneill Exp $
+# $NetBSD: evbarm.conf,v 1.25 2017/04/11 17:30:17 jmcneill Exp $
 # evbarm shared config
 #
 image=$HOME/${board}.img
@@ -7,8 +7,8 @@ MACHINE=evbarm
 
 swap=256
 extra=48		# spare space
-boot=120
 init=8
+boot=$((256 - ${init}))
 ffsoffset=$(( (${init} + ${boot} + ${swap}) / 2 ))m
 
 size=0		# autocompute
@@ -59,7 +59,6 @@ drivedata: 0 
  a:   ${asize} ${aoffset}4.2BSD  ${fsize} ${bsize} 0  # 
  b:   ${swapsize}  ${swapoffset} swap #
  c:   ${totalsize} 0 unused  0 0  #
- d:   ${totalsize} 0 unused  0 0  #
  e:   ${bootsize}  ${bootoffset} MSDOS#
 EOF
 }



CVS commit: src/distrib/utils/embedded/conf

2017-04-10 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Mon Apr 10 22:25:36 UTC 2017

Modified Files:
src/distrib/utils/embedded/conf: armv7.conf

Log Message:
tegra: set loadaddr to 0x9000 (the default kernel_addr_r overlaps
fdt_addr_r on TK1 + L4T 21.x), and set default root device to ld0a to
match new device probe order.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/distrib/utils/embedded/conf/armv7.conf

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

Modified files:

Index: src/distrib/utils/embedded/conf/armv7.conf
diff -u src/distrib/utils/embedded/conf/armv7.conf:1.10 src/distrib/utils/embedded/conf/armv7.conf:1.11
--- src/distrib/utils/embedded/conf/armv7.conf:1.10	Sat Dec 19 14:57:49 2015
+++ src/distrib/utils/embedded/conf/armv7.conf	Mon Apr 10 22:25:36 2017
@@ -1,4 +1,4 @@
-# $NetBSD: armv7.conf,v 1.10 2015/12/19 14:57:49 skrll Exp $
+# $NetBSD: armv7.conf,v 1.11 2017/04/10 22:25:36 jmcneill Exp $
 # ARMv7 customization script used by mkimage
 #
 board=armv7
@@ -107,14 +107,15 @@ EOF
 
 populate_tegra() {
 	tegra_kernelimg=netbsd-TEGRA.ub
+	tegra_loadaddr=0x9000
 
 	# Create a boot.scr for Tegra U-Boot
 	cat > "${mnt}/boot/boot-TEGRA.txt" << EOF
-setenv bootargs root=ld1a
-fatload mmc 1:1 \${kernel_addr_r} ${tegra_kernelimg}
+setenv bootargs root=ld0a
+fatload mmc 1:1 ${tegra_loadaddr} ${tegra_kernelimg}
 fatload mmc 1:1 \${fdt_addr_r} tegra124-\${board}.dtb
 fdt addr \${fdt_addr_r}
-bootm \${kernel_addr_r} - \${fdt_addr_r}
+bootm ${tegra_loadaddr} - \${fdt_addr_r}
 EOF
 	"${MKUBOOTIMAGE}" -A arm -C none -O netbsd -T script -a 0 -n "NetBSD/tegra boot" "${mnt}/boot/boot-TEGRA.txt" "${mnt}/boot/boot.scr"
 }



CVS commit: src/distrib/utils/embedded

2017-03-13 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Mar 14 06:37:39 UTC 2017

Modified Files:
src/distrib/utils/embedded: mkimage

Log Message:
Mark the msdos parition active for boards like the BeagleBone Black


To generate a diff of this commit:
cvs rdiff -u -r1.61 -r1.62 src/distrib/utils/embedded/mkimage

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

Modified files:

Index: src/distrib/utils/embedded/mkimage
diff -u src/distrib/utils/embedded/mkimage:1.61 src/distrib/utils/embedded/mkimage:1.62
--- src/distrib/utils/embedded/mkimage:1.61	Sat Aug  1 10:05:51 2015
+++ src/distrib/utils/embedded/mkimage	Tue Mar 14 06:37:39 2017
@@ -1,5 +1,5 @@
 #!/bin/sh
-# $NetBSD: mkimage,v 1.61 2015/08/01 10:05:51 jmcneill Exp $
+# $NetBSD: mkimage,v 1.62 2017/03/14 06:37:39 skrll Exp $
 #
 # Copyright (c) 2013, 2014 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -220,7 +220,7 @@ if [ -n "${msdosid}" ]; then
 	echo ${bar} Running fdisk ${bar}
 	initsecs=$((${init} * 1024))
 	bootsecs=$((${boot} * 1024))
-	${FDISK} -f -u -0 -s ${msdosid}/${initsecs}/${bootsecs} -F ${image}
+	${FDISK} -f -a -u -0 -s ${msdosid}/${initsecs}/${bootsecs} -F ${image}
 elif [ -n "${netbsdid}" ]; then
 	echo ${bar} Running fdisk ${bar}
 	${FDISK} -f -i ${image}



CVS commit: src/distrib/utils/embedded/conf

2015-12-19 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sat Dec 19 14:57:49 UTC 2015

Modified Files:
src/distrib/utils/embedded/conf: armv7.conf

Log Message:
C&P of change in rpi.conf (maybe factor out)

By default, RPI firmware sets the max CPU frequency to 600MHz. This can be
overridden by setting arm_freq in config.txt, but the default freq at boot
is still 600MHz.

Add logic to rc.local to compare the current vs. max CPU frequency; if they
differ, set the target frequency to the maximum.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/distrib/utils/embedded/conf/armv7.conf

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

Modified files:

Index: src/distrib/utils/embedded/conf/armv7.conf
diff -u src/distrib/utils/embedded/conf/armv7.conf:1.9 src/distrib/utils/embedded/conf/armv7.conf:1.10
--- src/distrib/utils/embedded/conf/armv7.conf:1.9	Sun Dec 13 23:02:56 2015
+++ src/distrib/utils/embedded/conf/armv7.conf	Sat Dec 19 14:57:49 2015
@@ -1,4 +1,4 @@
-# $NetBSD: armv7.conf,v 1.9 2015/12/13 23:02:56 jmcneill Exp $
+# $NetBSD: armv7.conf,v 1.10 2015/12/19 14:57:49 skrll Exp $
 # ARMv7 customization script used by mkimage
 #
 board=armv7
@@ -73,6 +73,23 @@ EOF
 	)
 
 	fi
+
+	#
+	# If arm_freq is specified in config.txt, set CPU frequency
+	# to match at boot time.
+	#
+	cp ${release}/etc/rc.local ${mnt}/etc/rc.local
+	cat >> ${mnt}/etc/rc.local << EOF
+if /sbin/sysctl -q machdep.cpu.frequency.max; then
+	cpufreq_max=\$(/sbin/sysctl -n machdep.cpu.frequency.max)
+	cpufreq_cur=\$(/sbin/sysctl -n machdep.cpu.frequency.current)
+	if [ ! "\$cpufreq_max" = "\$cpufreq_cur" ]; then
+		/sbin/sysctl -w machdep.cpu.frequency.target=\$cpufreq_max
+	fi
+fi
+EOF
+	echo "./etc/rc.local type=file uname=root gname=wheel mode=0644" \
+	>> "$tmp/selected_sets"
 }
 
 populate_amlogic() {



CVS commit: src/distrib/utils/embedded/conf

2015-08-21 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Fri Aug 21 17:08:11 UTC 2015

Modified Files:
src/distrib/utils/embedded/conf: armv7.conf

Log Message:
Cubieboard2 kernel is named netbsd-CUBIEBOARD.ub not netbsd-CUBIEBOARD2.ub


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/distrib/utils/embedded/conf/armv7.conf

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

Modified files:

Index: src/distrib/utils/embedded/conf/armv7.conf
diff -u src/distrib/utils/embedded/conf/armv7.conf:1.7 src/distrib/utils/embedded/conf/armv7.conf:1.8
--- src/distrib/utils/embedded/conf/armv7.conf:1.7	Sun Aug  2 11:11:32 2015
+++ src/distrib/utils/embedded/conf/armv7.conf	Fri Aug 21 17:08:11 2015
@@ -1,4 +1,4 @@
-# $NetBSD: armv7.conf,v 1.7 2015/08/02 11:11:32 jmcneill Exp $
+# $NetBSD: armv7.conf,v 1.8 2015/08/21 17:08:11 jmcneill Exp $
 # ARMv7 customization script used by mkimage
 #
 board=armv7
@@ -45,7 +45,7 @@ EOF
 populate_awin() {
 	cat >> "${mnt}/boot/uEnv.txt" << EOF
 bootargs=root=ld0a console=${console}
-uenvcmd=mmc dev 0; mmc rescan; if test \$fdtfile = sun7i-a20-cubieboard2.dtb; then setenv kernel netbsd-CUBIEBOARD2.ub; elif test \$fdtfile = sun7i-a20-cubietruck.dtb; then setenv kernel netbsd-CUBIETRUCK.ub; elif test \$fdtfile = sun6i-a31-hummingbird.dtb; then setenv kernel netbsd-HUMMINGBIRD_A31.ub; elif test \$fdtfile = sun7i-a20-bananapi.dtb; then setenv kernel netbsd-BPI.ub; fi; fatload mmc 0:1 8200 \$kernel; bootm 8200
+uenvcmd=mmc dev 0; mmc rescan; if test \$fdtfile = sun7i-a20-cubieboard2.dtb; then setenv kernel netbsd-CUBIEBOARD.ub; elif test \$fdtfile = sun7i-a20-cubietruck.dtb; then setenv kernel netbsd-CUBIETRUCK.ub; elif test \$fdtfile = sun6i-a31-hummingbird.dtb; then setenv kernel netbsd-HUMMINGBIRD_A31.ub; elif test \$fdtfile = sun7i-a20-bananapi.dtb; then setenv kernel netbsd-BPI.ub; fi; fatload mmc 0:1 8200 \$kernel; bootm 8200
 EOF
 }
 



CVS commit: src/distrib/utils/embedded/conf

2015-08-02 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Aug  2 11:11:32 UTC 2015

Modified Files:
src/distrib/utils/embedded/conf: armv7.conf

Log Message:
install jetsontk1 boot script as boot.scr


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/distrib/utils/embedded/conf/armv7.conf

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

Modified files:

Index: src/distrib/utils/embedded/conf/armv7.conf
diff -u src/distrib/utils/embedded/conf/armv7.conf:1.6 src/distrib/utils/embedded/conf/armv7.conf:1.7
--- src/distrib/utils/embedded/conf/armv7.conf:1.6	Wed Jul 15 11:29:16 2015
+++ src/distrib/utils/embedded/conf/armv7.conf	Sun Aug  2 11:11:32 2015
@@ -1,4 +1,4 @@
-# $NetBSD: armv7.conf,v 1.6 2015/07/15 11:29:16 martin Exp $
+# $NetBSD: armv7.conf,v 1.7 2015/08/02 11:11:32 jmcneill Exp $
 # ARMv7 customization script used by mkimage
 #
 board=armv7
@@ -97,7 +97,7 @@ setenv bootargs root=ld1a
 fatload mmc 1:1 0x9000 ${jetsontk1_kernelimg}
 bootm 0x9000
 EOF
-	"${MKUBOOTIMAGE}" -A arm -C none -O netbsd -T script -a 0 -n "NetBSD/tegra boot" "${mnt}/boot/boot-JETSONTK1.txt" "${mnt}/boot/boot-JETSONTK1.scr"
+	"${MKUBOOTIMAGE}" -A arm -C none -O netbsd -T script -a 0 -n "NetBSD/tegra boot" "${mnt}/boot/boot-JETSONTK1.txt" "${mnt}/boot/boot.scr"
 }
 
 populate() {



CVS commit: src/distrib/utils/embedded

2015-08-01 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Aug  1 10:05:51 UTC 2015

Modified Files:
src/distrib/utils/embedded: mkimage

Log Message:
use a larger (64KB) block size, this helps SD card performance


To generate a diff of this commit:
cvs rdiff -u -r1.60 -r1.61 src/distrib/utils/embedded/mkimage

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

Modified files:

Index: src/distrib/utils/embedded/mkimage
diff -u src/distrib/utils/embedded/mkimage:1.60 src/distrib/utils/embedded/mkimage:1.61
--- src/distrib/utils/embedded/mkimage:1.60	Wed Jul 15 11:27:13 2015
+++ src/distrib/utils/embedded/mkimage	Sat Aug  1 10:05:51 2015
@@ -1,5 +1,5 @@
 #!/bin/sh
-# $NetBSD: mkimage,v 1.60 2015/07/15 11:27:13 martin Exp $
+# $NetBSD: mkimage,v 1.61 2015/08/01 10:05:51 jmcneill Exp $
 #
 # Copyright (c) 2013, 2014 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -197,7 +197,7 @@ if [ -z "${bootonly}" ]; then
 	echo ${bar} Populating ffs filesystem ${bar}
 	${MAKEFS} -rx ${endian} -N ${release}/etc -t ffs \
 	-O ${ffsoffset} \
-	-o d=4096,f=2048,b=16384 -b $((${extra}))m \
+	-o d=4096,f=8192,b=65536 -b $((${extra}))m \
 	-F "$tmp/selected_sets" ${image} "${release}" "${mnt}"
 fi
 



CVS commit: src/distrib/utils/embedded/conf

2015-08-01 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Aug  1 10:04:50 UTC 2015

Modified Files:
src/distrib/utils/embedded/conf: evbarm.conf

Log Message:
mount root partition with noatime


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/distrib/utils/embedded/conf/evbarm.conf

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

Modified files:

Index: src/distrib/utils/embedded/conf/evbarm.conf
diff -u src/distrib/utils/embedded/conf/evbarm.conf:1.23 src/distrib/utils/embedded/conf/evbarm.conf:1.24
--- src/distrib/utils/embedded/conf/evbarm.conf:1.23	Sat Aug  1 10:04:06 2015
+++ src/distrib/utils/embedded/conf/evbarm.conf	Sat Aug  1 10:04:50 2015
@@ -1,4 +1,4 @@
-# $NetBSD: evbarm.conf,v 1.23 2015/08/01 10:04:06 jmcneill Exp $
+# $NetBSD: evbarm.conf,v 1.24 2015/08/01 10:04:50 jmcneill Exp $
 # evbarm shared config
 #
 image=$HOME/${board}.img
@@ -68,7 +68,7 @@ make_fstab_evbarm_normal() {
 	cat > ${mnt}/etc/fstab << EOF
 # NetBSD /etc/fstab
 # See /usr/share/examples/fstab/ for more examples.
-/dev/ld0a	/		ffs	rw	1 1
+/dev/ld0a	/		ffs	rw,noatime	1 1
 /dev/ld0b	none		swap	sw	0 0
 /dev/ld0e	/boot		msdos	rw	1 1
 kernfs		/kern		kernfs	rw



CVS commit: src/distrib/utils/embedded/conf

2015-08-01 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sat Aug  1 10:04:06 UTC 2015

Modified Files:
src/distrib/utils/embedded/conf: evbarm.conf

Log Message:
Align partitions to 64MB for the benefit of SD cards > 32GB


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/distrib/utils/embedded/conf/evbarm.conf

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

Modified files:

Index: src/distrib/utils/embedded/conf/evbarm.conf
diff -u src/distrib/utils/embedded/conf/evbarm.conf:1.22 src/distrib/utils/embedded/conf/evbarm.conf:1.23
--- src/distrib/utils/embedded/conf/evbarm.conf:1.22	Mon Apr  6 22:44:46 2015
+++ src/distrib/utils/embedded/conf/evbarm.conf	Sat Aug  1 10:04:06 2015
@@ -1,4 +1,4 @@
-# $NetBSD: evbarm.conf,v 1.22 2015/04/06 22:44:46 jmcneill Exp $
+# $NetBSD: evbarm.conf,v 1.23 2015/08/01 10:04:06 jmcneill Exp $
 # evbarm shared config
 #
 image=$HOME/${board}.img
@@ -7,7 +7,7 @@ MACHINE=evbarm
 
 swap=256
 extra=48		# spare space
-boot=112
+boot=120
 init=8
 ffsoffset=$(( (${init} + ${boot} + ${swap}) / 2 ))m
 



CVS commit: src/distrib/utils/embedded/conf

2015-07-15 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Jul 15 11:29:16 UTC 2015

Modified Files:
src/distrib/utils/embedded/conf: armv7.conf

Log Message:
Properly escape the $ when trying to pass the u-boot env var $kernel.
>From Rin Okuyama.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/distrib/utils/embedded/conf/armv7.conf

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

Modified files:

Index: src/distrib/utils/embedded/conf/armv7.conf
diff -u src/distrib/utils/embedded/conf/armv7.conf:1.5 src/distrib/utils/embedded/conf/armv7.conf:1.6
--- src/distrib/utils/embedded/conf/armv7.conf:1.5	Wed Jul  8 10:57:46 2015
+++ src/distrib/utils/embedded/conf/armv7.conf	Wed Jul 15 11:29:16 2015
@@ -1,4 +1,4 @@
-# $NetBSD: armv7.conf,v 1.5 2015/07/08 10:57:46 skrll Exp $
+# $NetBSD: armv7.conf,v 1.6 2015/07/15 11:29:16 martin Exp $
 # ARMv7 customization script used by mkimage
 #
 board=armv7
@@ -45,7 +45,7 @@ EOF
 populate_awin() {
 	cat >> "${mnt}/boot/uEnv.txt" << EOF
 bootargs=root=ld0a console=${console}
-uenvcmd=mmc dev 0; mmc rescan; if test \$fdtfile = sun7i-a20-cubieboard2.dtb; then setenv kernel netbsd-CUBIEBOARD2.ub; elif test \$fdtfile = sun7i-a20-cubietruck.dtb; then setenv kernel netbsd-CUBIETRUCK.ub; elif test \$fdtfile = sun6i-a31-hummingbird.dtb; then setenv kernel netbsd-HUMMINGBIRD_A31.ub; elif test \$fdtfile = sun7i-a20-bananapi.dtb; then setenv kernel netbsd-BPI.ub; fi; fatload mmc 0:1 8200 ${kernel}; bootm 8200
+uenvcmd=mmc dev 0; mmc rescan; if test \$fdtfile = sun7i-a20-cubieboard2.dtb; then setenv kernel netbsd-CUBIEBOARD2.ub; elif test \$fdtfile = sun7i-a20-cubietruck.dtb; then setenv kernel netbsd-CUBIETRUCK.ub; elif test \$fdtfile = sun6i-a31-hummingbird.dtb; then setenv kernel netbsd-HUMMINGBIRD_A31.ub; elif test \$fdtfile = sun7i-a20-bananapi.dtb; then setenv kernel netbsd-BPI.ub; fi; fatload mmc 0:1 8200 \$kernel; bootm 8200
 EOF
 }
 



CVS commit: src/distrib/utils/embedded/conf

2015-07-08 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Wed Jul  8 10:57:46 UTC 2015

Modified Files:
src/distrib/utils/embedded/conf: armv7.conf

Log Message:
Turn resize on


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/distrib/utils/embedded/conf/armv7.conf

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

Modified files:

Index: src/distrib/utils/embedded/conf/armv7.conf
diff -u src/distrib/utils/embedded/conf/armv7.conf:1.4 src/distrib/utils/embedded/conf/armv7.conf:1.5
--- src/distrib/utils/embedded/conf/armv7.conf:1.4	Sun May 24 17:11:18 2015
+++ src/distrib/utils/embedded/conf/armv7.conf	Wed Jul  8 10:57:46 2015
@@ -1,8 +1,9 @@
-# $NetBSD: armv7.conf,v 1.4 2015/05/24 17:11:18 christos Exp $
+# $NetBSD: armv7.conf,v 1.5 2015/07/08 10:57:46 skrll Exp $
 # ARMv7 customization script used by mkimage
 #
 board=armv7
 console=fb
+resize=true
 
 . ${DIR}/conf/evbarm.conf
 



CVS commit: src/distrib/utils/embedded/conf

2015-05-24 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun May 24 17:11:18 UTC 2015

Modified Files:
src/distrib/utils/embedded/conf: armv7.conf

Log Message:
double quote police


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/distrib/utils/embedded/conf/armv7.conf

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

Modified files:

Index: src/distrib/utils/embedded/conf/armv7.conf
diff -u src/distrib/utils/embedded/conf/armv7.conf:1.3 src/distrib/utils/embedded/conf/armv7.conf:1.4
--- src/distrib/utils/embedded/conf/armv7.conf:1.3	Thu May 21 21:18:22 2015
+++ src/distrib/utils/embedded/conf/armv7.conf	Sun May 24 13:11:18 2015
@@ -1,4 +1,4 @@
-# $NetBSD: armv7.conf,v 1.3 2015/05/22 01:18:22 jmcneill Exp $
+# $NetBSD: armv7.conf,v 1.4 2015/05/24 17:11:18 christos Exp $
 # ARMv7 customization script used by mkimage
 #
 board=armv7
@@ -22,7 +22,7 @@ make_fstab() {
 
 customize() {
 	customize_evbarm
-	cat >> ${mnt}/etc/rc.conf << EOF
+	cat >> "${mnt}/etc/rc.conf" << EOF
 mdnsd=YES
 wscons=YES
 devpubd=YES
@@ -36,20 +36,20 @@ populate_beagle() {
 	bbone_loadaddr=8200
 
 	# Create a uEnv.txt to auto boot the correct kernel
-	cat >> ${mnt}/boot/uEnv.txt << EOF
+	cat >> "${mnt}/boot/uEnv.txt" << EOF
 loaduimage=if test \$board = am335x; then fatload mmc 0 ${bbone_loadaddr} ${bbone_kernelimg}; bootm ${bbone_loadaddr} root=ld0a; else fatload mmc 0 ${bboard_loadaddr} ${bboard_kernelimg}; bootm ${bboard_loadaddr} root=ld0a; fi
 EOF
 }
 
 populate_awin() {
-	cat >> ${mnt}/boot/uEnv.txt << EOF
+	cat >> "${mnt}/boot/uEnv.txt" << EOF
 bootargs=root=ld0a console=${console}
 uenvcmd=mmc dev 0; mmc rescan; if test \$fdtfile = sun7i-a20-cubieboard2.dtb; then setenv kernel netbsd-CUBIEBOARD2.ub; elif test \$fdtfile = sun7i-a20-cubietruck.dtb; then setenv kernel netbsd-CUBIETRUCK.ub; elif test \$fdtfile = sun6i-a31-hummingbird.dtb; then setenv kernel netbsd-HUMMINGBIRD_A31.ub; elif test \$fdtfile = sun7i-a20-bananapi.dtb; then setenv kernel netbsd-BPI.ub; fi; fatload mmc 0:1 8200 ${kernel}; bootm 8200
 EOF
 }
 
 populate_rpi() {
-	firmwaredir=${src}/external/broadcom/rpi-firmware/dist
+	firmwaredir="${src}/external/broadcom/rpi-firmware/dist"
 	firmwarefiles="LICENCE.broadcom bootcode.bin fixup.dat fixup_cd.dat start.elf start_cd.elf"
 
 	# RPI2 kernel needs to be installed as kernel7.img
@@ -57,17 +57,17 @@ populate_rpi() {
 		echo "${bar} renaming netbsd-RPI2.bin to kernel7.img ${bar}"
 		mv "${mnt}/boot/netbsd-RPI2.bin" "${mnt}/boot/kernel7.img"
 
-		cat > ${mnt}/boot/cmdline.txt << EOF
+		cat > "${mnt}/boot/cmdline.txt" << EOF
 root=ld0a console=${console}
 #fb=1280x1024		# to select a mode, otherwise try EDID
 #fb=disable		# to disable fb completely
 EOF
 
 	echo "${bar} installing firmware files ${bar}"
-		(cd ${mnt}/boot &&
+		(cd "${mnt}/boot" &&
 			for f in ${firmwarefiles}; do
 echo " $f"
-cp ${firmwaredir}/${f} .
+cp "${firmwaredir}/${f}" .
 			done
 	)
 
@@ -78,7 +78,7 @@ populate_amlogic() {
 	odroidc1_kernelimg=netbsd-ODROID-C1.ub
 
 	# Create a boot.ini for Amlogic U-Boot
-	cat >> ${mnt}/boot/boot.ini << EOF
+	cat >> "${mnt}/boot/boot.ini" << EOF
 ODROIDC-UBOOT-CONFIG
 
 setenv bootargs "root=ld0f awge0.mac-address=\${ethaddr} console=${console}"
@@ -91,12 +91,12 @@ populate_tegra() {
 	jetsontk1_kernelimg=netbsd-JETSONTK1.ub
 
 	# Create a boot.scr for Jetson TK1 U-Boot
-	cat > ${mnt}/boot/boot-JETSONTK1.txt << EOF
+	cat > "${mnt}/boot/boot-JETSONTK1.txt" << EOF
 setenv bootargs root=ld1a
 fatload mmc 1:1 0x9000 ${jetsontk1_kernelimg}
 bootm 0x9000
 EOF
-	${MKUBOOTIMAGE} -A arm -C none -O netbsd -T script -a 0 -n "NetBSD/tegra boot" ${mnt}/boot/boot-JETSONTK1.txt ${mnt}/boot/boot-JETSONTK1.scr
+	"${MKUBOOTIMAGE}" -A arm -C none -O netbsd -T script -a 0 -n "NetBSD/tegra boot" "${mnt}/boot/boot-JETSONTK1.txt" "${mnt}/boot/boot-JETSONTK1.scr"
 }
 
 populate() {



CVS commit: src/distrib/utils/embedded

2015-05-24 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun May 24 17:08:21 UTC 2015

Modified Files:
src/distrib/utils/embedded: mkimage

Log Message:
fix mkubootimage


To generate a diff of this commit:
cvs rdiff -u -r1.58 -r1.59 src/distrib/utils/embedded/mkimage

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

Modified files:

Index: src/distrib/utils/embedded/mkimage
diff -u src/distrib/utils/embedded/mkimage:1.58 src/distrib/utils/embedded/mkimage:1.59
--- src/distrib/utils/embedded/mkimage:1.58	Sun Apr 19 13:56:57 2015
+++ src/distrib/utils/embedded/mkimage	Sun May 24 13:08:21 2015
@@ -1,5 +1,5 @@
 #!/bin/sh
-# $NetBSD: mkimage,v 1.58 2015/04/19 17:56:57 hubertf Exp $
+# $NetBSD: mkimage,v 1.59 2015/05/24 17:08:21 christos Exp $
 #
 # Copyright (c) 2013, 2014 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -56,6 +56,7 @@ FDISK=${TOOL_FDISK:-fdisk}
 MAKEFS=${TOOL_MAKEFS:-makefs}
 MTREE=${TOOL_MTREE:-mtree}
 INSTALLBOOT=${TOOL_INSTALLBOOT:-installboot}
+MKUBOOTIMAGE=${TOOL_MKUBOOTIMAGE:-mkubootimage}
 GZIP_CMD=${TOOL_GZIP:-gzip} # ${GZIP} is special to gzip(1)
 
 src="/usr/src"



CVS commit: src/distrib/utils/embedded/conf

2015-05-21 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Fri May 22 01:18:22 UTC 2015

Modified Files:
src/distrib/utils/embedded/conf: armv7.conf

Log Message:
add JETSONTK1 to armv7.img


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/distrib/utils/embedded/conf/armv7.conf

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

Modified files:

Index: src/distrib/utils/embedded/conf/armv7.conf
diff -u src/distrib/utils/embedded/conf/armv7.conf:1.2 src/distrib/utils/embedded/conf/armv7.conf:1.3
--- src/distrib/utils/embedded/conf/armv7.conf:1.2	Sun Apr 19 18:28:31 2015
+++ src/distrib/utils/embedded/conf/armv7.conf	Fri May 22 01:18:22 2015
@@ -1,4 +1,4 @@
-# $NetBSD: armv7.conf,v 1.2 2015/04/19 18:28:31 hubertf Exp $
+# $NetBSD: armv7.conf,v 1.3 2015/05/22 01:18:22 jmcneill Exp $
 # ARMv7 customization script used by mkimage
 #
 board=armv7
@@ -10,6 +10,7 @@ kernels_beagle="BEAGLEBOARD BEAGLEBONE"
 kernels_awin="BPI CUBIEBOARD CUBIETRUCK HUMMINGBIRD_A31"
 kernels_rpi="RPI2"
 kernels_amlogic="ODROID-C1"
+kernels_tegra="JETSONTK1"
 
 make_label() {
 	make_label_evbarm
@@ -86,11 +87,23 @@ run bootcmd
 EOF
 }
 
+populate_tegra() {
+	jetsontk1_kernelimg=netbsd-JETSONTK1.ub
+
+	# Create a boot.scr for Jetson TK1 U-Boot
+	cat > ${mnt}/boot/boot-JETSONTK1.txt << EOF
+setenv bootargs root=ld1a
+fatload mmc 1:1 0x9000 ${jetsontk1_kernelimg}
+bootm 0x9000
+EOF
+	${MKUBOOTIMAGE} -A arm -C none -O netbsd -T script -a 0 -n "NetBSD/tegra boot" ${mnt}/boot/boot-JETSONTK1.txt ${mnt}/boot/boot-JETSONTK1.scr
+}
+
 populate() {
 	echo "${bar} looking for kernels in ${kernel} ${bar}"
 	kernels=""
 	# .ub kernels
-	for k in $kernels_beagle $kernels_awin $kernels_amlogic; do
+	for k in $kernels_beagle $kernels_awin $kernels_amlogic $kernels_tegra; do
 		f="${kernel}/netbsd-${k}.ub.gz"
 		test -f "${f}" && kernels="${kernels} ${f}"
 	done
@@ -119,4 +132,5 @@ populate() {
 	populate_awin
 	populate_rpi
 	populate_amlogic
+	populate_tegra
 }



CVS commit: src/distrib/utils/embedded/conf

2015-04-19 Thread Hubert Feyrer
Module Name:src
Committed By:   hubertf
Date:   Sun Apr 19 18:53:33 UTC 2015

Modified Files:
src/distrib/utils/embedded/conf: rpi_inst.conf

Log Message:
More cleanup:
Instead of first overwriting the *_evbarm functions with own code,
and then calling them from the regular functions, directly put the
code into the regular functions.

No more functions from evbarm.conf are used now.
Some variables are still used!


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/distrib/utils/embedded/conf/rpi_inst.conf

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

Modified files:

Index: src/distrib/utils/embedded/conf/rpi_inst.conf
diff -u src/distrib/utils/embedded/conf/rpi_inst.conf:1.7 src/distrib/utils/embedded/conf/rpi_inst.conf:1.8
--- src/distrib/utils/embedded/conf/rpi_inst.conf:1.7	Sun Apr 19 18:28:31 2015
+++ src/distrib/utils/embedded/conf/rpi_inst.conf	Sun Apr 19 18:53:33 2015
@@ -1,4 +1,4 @@
-# $NetBSD: rpi_inst.conf,v 1.7 2015/04/19 18:28:31 hubertf Exp $
+# $NetBSD: rpi_inst.conf,v 1.8 2015/04/19 18:53:33 hubertf Exp $
 # Raspberry Pi customization script used by mkimage
 #
 
@@ -17,7 +17,7 @@ init=8
 size=$(( 10485760 + ${swap} * 1024 * 512 + ${boot} * 1024 * 512 + ${init} * 1024 * 512 ))
 msdosid=12
 
-make_label_evbarm() {
+make_label() {
 	# compute all sizes in terms of sectors
 	local totalsize=$(( ${newsize} * 1024 * 2 / 512 ))
 
@@ -64,28 +64,17 @@ drivedata: 0 
 EOF
 }
 
-make_fstab_evbarm() {
-:
-}
-
-customize_evbarm() {
+customize() {
 	echo "${bar} creating directories ${bar}"
 	mkdir ${mnt}/proc ${mnt}/kern
 }
-firmwaredir=$src/external/broadcom/rpi-firmware/dist
-firmwarefiles="LICENCE.broadcom bootcode.bin fixup.dat fixup_cd.dat start.elf start_cd.elf"
 
 make_fstab() {
-	make_fstab_evbarm
+	:
 }
 
-make_label() {
-	make_label_evbarm
-}
-
-customize() {
-	customize_evbarm
-}
+firmwaredir=$src/external/broadcom/rpi-firmware/dist
+firmwarefiles="LICENCE.broadcom bootcode.bin fixup.dat fixup_cd.dat start.elf start_cd.elf"
 
 populate() {
 	cat > ${mnt}/boot/cmdline.txt << EOF



CVS commit: src/distrib/utils/embedded/conf

2015-04-19 Thread Hubert Feyrer
Module Name:src
Committed By:   hubertf
Date:   Sun Apr 19 18:28:31 UTC 2015

Modified Files:
src/distrib/utils/embedded/conf: armv7.conf rpi.conf rpi_inst.conf
usermode.conf

Log Message:
Cleanup: make_filesystems is not used any longer, purge remains


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/distrib/utils/embedded/conf/armv7.conf
cvs rdiff -u -r1.28 -r1.29 src/distrib/utils/embedded/conf/rpi.conf
cvs rdiff -u -r1.6 -r1.7 src/distrib/utils/embedded/conf/rpi_inst.conf
cvs rdiff -u -r1.4 -r1.5 src/distrib/utils/embedded/conf/usermode.conf

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

Modified files:

Index: src/distrib/utils/embedded/conf/armv7.conf
diff -u src/distrib/utils/embedded/conf/armv7.conf:1.1 src/distrib/utils/embedded/conf/armv7.conf:1.2
--- src/distrib/utils/embedded/conf/armv7.conf:1.1	Thu Apr  9 10:55:23 2015
+++ src/distrib/utils/embedded/conf/armv7.conf	Sun Apr 19 18:28:31 2015
@@ -1,4 +1,4 @@
-# $NetBSD: armv7.conf,v 1.1 2015/04/09 10:55:23 jmcneill Exp $
+# $NetBSD: armv7.conf,v 1.2 2015/04/19 18:28:31 hubertf Exp $
 # ARMv7 customization script used by mkimage
 #
 board=armv7
@@ -11,10 +11,6 @@ kernels_awin="BPI CUBIEBOARD CUBIETRUCK 
 kernels_rpi="RPI2"
 kernels_amlogic="ODROID-C1"
 
-make_filesystems() {
-	make_filesystems_evbarm
-}
-
 make_label() {
 	make_label_evbarm
 }

Index: src/distrib/utils/embedded/conf/rpi.conf
diff -u src/distrib/utils/embedded/conf/rpi.conf:1.28 src/distrib/utils/embedded/conf/rpi.conf:1.29
--- src/distrib/utils/embedded/conf/rpi.conf:1.28	Mon Apr  6 20:19:28 2015
+++ src/distrib/utils/embedded/conf/rpi.conf	Sun Apr 19 18:28:31 2015
@@ -1,4 +1,4 @@
-# $NetBSD: rpi.conf,v 1.28 2015/04/06 20:19:28 jmcneill Exp $
+# $NetBSD: rpi.conf,v 1.29 2015/04/19 18:28:31 hubertf Exp $
 # Raspberry Pi customization script used by mkimage
 #
 
@@ -11,10 +11,6 @@ resize=true
 firmwaredir=$src/external/broadcom/rpi-firmware/dist
 firmwarefiles="LICENCE.broadcom bootcode.bin fixup.dat fixup_cd.dat start.elf start_cd.elf"
 
-make_filesystems() {
-	make_filesystems_evbarm
-}
-
 make_fstab() {
 	make_fstab_evbarm
 }

Index: src/distrib/utils/embedded/conf/rpi_inst.conf
diff -u src/distrib/utils/embedded/conf/rpi_inst.conf:1.6 src/distrib/utils/embedded/conf/rpi_inst.conf:1.7
--- src/distrib/utils/embedded/conf/rpi_inst.conf:1.6	Fri Jan 23 15:17:58 2015
+++ src/distrib/utils/embedded/conf/rpi_inst.conf	Sun Apr 19 18:28:31 2015
@@ -1,4 +1,4 @@
-# $NetBSD: rpi_inst.conf,v 1.6 2015/01/23 15:17:58 skrll Exp $
+# $NetBSD: rpi_inst.conf,v 1.7 2015/04/19 18:28:31 hubertf Exp $
 # Raspberry Pi customization script used by mkimage
 #
 
@@ -75,10 +75,6 @@ customize_evbarm() {
 firmwaredir=$src/external/broadcom/rpi-firmware/dist
 firmwarefiles="LICENCE.broadcom bootcode.bin fixup.dat fixup_cd.dat start.elf start_cd.elf"
 
-make_filesystems() {
-	make_filesystems_evbarm
-}
-
 make_fstab() {
 	make_fstab_evbarm
 }

Index: src/distrib/utils/embedded/conf/usermode.conf
diff -u src/distrib/utils/embedded/conf/usermode.conf:1.4 src/distrib/utils/embedded/conf/usermode.conf:1.5
--- src/distrib/utils/embedded/conf/usermode.conf:1.4	Fri Jan 23 15:17:58 2015
+++ src/distrib/utils/embedded/conf/usermode.conf	Sun Apr 19 18:28:31 2015
@@ -1,4 +1,4 @@
-# $NetBSD: usermode.conf,v 1.4 2015/01/23 15:17:58 skrll Exp $
+# $NetBSD: usermode.conf,v 1.5 2015/04/19 18:28:31 hubertf Exp $
 # NetBSD/usermode customization script used by mkimage
 
 # XXX: BROKEN, needs to be converted to makefs
@@ -10,11 +10,6 @@ setsdir=/usr/build/release/$(uname -m)/b
 size=0	# in MB
 usermodedirs="/var.cow /etc.cow /root.cow /pkgs"
 
-make_filesystems() {
-	newfs /dev/r${vnddev}a
-	mount /dev/${vnddev}a ${mnt}
-}
-
 make_fstab() {
 cat > ${mnt}/etc/fstab << EOF
 # NetBSD/usermode /etc/fstab



CVS commit: src/distrib/utils/embedded

2015-04-19 Thread Hubert Feyrer
Module Name:src
Committed By:   hubertf
Date:   Sun Apr 19 17:56:57 UTC 2015

Modified Files:
src/distrib/utils/embedded: mkimage

Log Message:
Add some documentation:
Tell what this does, and what it expects from conf files


To generate a diff of this commit:
cvs rdiff -u -r1.57 -r1.58 src/distrib/utils/embedded/mkimage

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

Modified files:

Index: src/distrib/utils/embedded/mkimage
diff -u src/distrib/utils/embedded/mkimage:1.57 src/distrib/utils/embedded/mkimage:1.58
--- src/distrib/utils/embedded/mkimage:1.57	Sat Apr 18 22:06:48 2015
+++ src/distrib/utils/embedded/mkimage	Sun Apr 19 17:56:57 2015
@@ -1,5 +1,5 @@
 #!/bin/sh
-# $NetBSD: mkimage,v 1.57 2015/04/18 22:06:48 hubertf Exp $
+# $NetBSD: mkimage,v 1.58 2015/04/19 17:56:57 hubertf Exp $
 #
 # Copyright (c) 2013, 2014 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -32,6 +32,20 @@
 # POSSIBILITY OF SUCH DAMAGE.
 #
 
+#
+# Makes a bootable image for the host architecture given.
+# The host specific functions are pulled in from a /bin/sh script in the
+# "conf" directory, and is expected to provide the following shell
+# functions, which are called in the following order:
+#
+#  - make_fstab: Creates the host's /etc/fstab with / on ${rootdev}.
+#If -m is given, a number of directories are put on a tmpfs RAM disk
+#  - customize: After unpacking the sets, this gets the system to
+#a working state, e. g. by setting up /etc/rc.conf and /dev
+#  - populate: Add common goods like kernel and bootloader
+#  - make_label: Prints disklabel to stdout
+#
+
 set -e
 
 DIR="$(cd "$(dirname "$0")" && pwd)"



CVS commit: src/distrib/utils/embedded

2015-04-18 Thread Hubert Feyrer
Module Name:src
Committed By:   hubertf
Date:   Sat Apr 18 22:06:48 UTC 2015

Modified Files:
src/distrib/utils/embedded: mkimage

Log Message:
Properly spell X' name. From X(7):

   The  X.Org  Foundation  requests  that the following names be used when
   referring to this software:

  X
   X Window System
X Version 11
 X Window System, Version 11
 X11


To generate a diff of this commit:
cvs rdiff -u -r1.56 -r1.57 src/distrib/utils/embedded/mkimage

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

Modified files:

Index: src/distrib/utils/embedded/mkimage
diff -u src/distrib/utils/embedded/mkimage:1.56 src/distrib/utils/embedded/mkimage:1.57
--- src/distrib/utils/embedded/mkimage:1.56	Mon Apr  6 22:20:52 2015
+++ src/distrib/utils/embedded/mkimage	Sat Apr 18 22:06:48 2015
@@ -1,5 +1,5 @@
 #!/bin/sh
-# $NetBSD: mkimage,v 1.56 2015/04/06 22:20:52 jmcneill Exp $
+# $NetBSD: mkimage,v 1.57 2015/04/18 22:06:48 hubertf Exp $
 #
 # Copyright (c) 2013, 2014 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -75,7 +75,7 @@ Usage: $PROG -h  [-bdmx] [-K 
 -r	root device kind (sd, wd, ld)
 -d	Add the debug sets
 -m	Optimize the OS installation to mimimize disk writes for SSDs
--x	Load the x sets too, not just the base ones
+-x	Load the X sets too, not just the base ones
 EOF
 	exit 1
 }



CVS commit: src/distrib/utils/embedded/conf

2015-04-06 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Mon Apr  6 22:44:46 UTC 2015

Modified Files:
src/distrib/utils/embedded/conf: evbarm.conf

Log Message:
show resize_ffs progress bar when resizing root partition


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/distrib/utils/embedded/conf/evbarm.conf

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

Modified files:

Index: src/distrib/utils/embedded/conf/evbarm.conf
diff -u src/distrib/utils/embedded/conf/evbarm.conf:1.21 src/distrib/utils/embedded/conf/evbarm.conf:1.22
--- src/distrib/utils/embedded/conf/evbarm.conf:1.21	Mon Apr  6 20:19:28 2015
+++ src/distrib/utils/embedded/conf/evbarm.conf	Mon Apr  6 22:44:46 2015
@@ -1,4 +1,4 @@
-# $NetBSD: evbarm.conf,v 1.21 2015/04/06 20:19:28 jmcneill Exp $
+# $NetBSD: evbarm.conf,v 1.22 2015/04/06 22:44:46 jmcneill Exp $
 # evbarm shared config
 #
 image=$HOME/${board}.img
@@ -141,6 +141,7 @@ resize_disklabel=YES
 resize_disklabel_disk=ld0
 resize_disklabel_part=a
 resize_root=YES
+resize_root_flags="-p"
 resize_root_postcmd="/sbin/reboot -n"
 EOF
 	fi



CVS commit: src/distrib/utils/embedded

2015-04-06 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Mon Apr  6 22:20:52 UTC 2015

Modified Files:
src/distrib/utils/embedded: mkimage

Log Message:
initialize resize before pulling in board config


To generate a diff of this commit:
cvs rdiff -u -r1.55 -r1.56 src/distrib/utils/embedded/mkimage

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

Modified files:

Index: src/distrib/utils/embedded/mkimage
diff -u src/distrib/utils/embedded/mkimage:1.55 src/distrib/utils/embedded/mkimage:1.56
--- src/distrib/utils/embedded/mkimage:1.55	Mon Apr  6 20:19:28 2015
+++ src/distrib/utils/embedded/mkimage	Mon Apr  6 22:20:52 2015
@@ -1,5 +1,5 @@
 #!/bin/sh
-# $NetBSD: mkimage,v 1.55 2015/04/06 20:19:28 jmcneill Exp $
+# $NetBSD: mkimage,v 1.56 2015/04/06 22:20:52 jmcneill Exp $
 #
 # Copyright (c) 2013, 2014 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -102,6 +102,8 @@ then
 	exit 1
 fi
 
+resize=false
+
 . "${DIR}/conf/${h}.conf"
 release="/usr/obj/${MACHINE}/release"
 
@@ -109,7 +111,6 @@ selected_sets="$sets"
 dsets_p=false
 xsets_p=false
 minwrites=false
-resize=false
 rootdev=ld
 
 OPTIND=1



CVS commit: src/distrib/utils/embedded

2015-04-06 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Mon Apr  6 20:19:28 UTC 2015

Modified Files:
src/distrib/utils/embedded: mkimage
src/distrib/utils/embedded/conf: evbarm.conf rpi.conf
Added Files:
src/distrib/utils/embedded/files: resize_disklabel

Log Message:
Add support for auto-growing the root partition. Enable it for rpi.img.


To generate a diff of this commit:
cvs rdiff -u -r1.54 -r1.55 src/distrib/utils/embedded/mkimage
cvs rdiff -u -r1.20 -r1.21 src/distrib/utils/embedded/conf/evbarm.conf
cvs rdiff -u -r1.27 -r1.28 src/distrib/utils/embedded/conf/rpi.conf
cvs rdiff -u -r0 -r1.1 src/distrib/utils/embedded/files/resize_disklabel

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

Modified files:

Index: src/distrib/utils/embedded/mkimage
diff -u src/distrib/utils/embedded/mkimage:1.54 src/distrib/utils/embedded/mkimage:1.55
--- src/distrib/utils/embedded/mkimage:1.54	Mon Apr  6 17:59:36 2015
+++ src/distrib/utils/embedded/mkimage	Mon Apr  6 20:19:28 2015
@@ -1,5 +1,5 @@
 #!/bin/sh
-# $NetBSD: mkimage,v 1.54 2015/04/06 17:59:36 jmcneill Exp $
+# $NetBSD: mkimage,v 1.55 2015/04/06 20:19:28 jmcneill Exp $
 #
 # Copyright (c) 2013, 2014 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -109,6 +109,7 @@ selected_sets="$sets"
 dsets_p=false
 xsets_p=false
 minwrites=false
+resize=false
 rootdev=ld
 
 OPTIND=1

Index: src/distrib/utils/embedded/conf/evbarm.conf
diff -u src/distrib/utils/embedded/conf/evbarm.conf:1.20 src/distrib/utils/embedded/conf/evbarm.conf:1.21
--- src/distrib/utils/embedded/conf/evbarm.conf:1.20	Thu Jan 29 14:54:06 2015
+++ src/distrib/utils/embedded/conf/evbarm.conf	Mon Apr  6 20:19:28 2015
@@ -1,4 +1,4 @@
-# $NetBSD: evbarm.conf,v 1.20 2015/01/29 14:54:06 skrll Exp $
+# $NetBSD: evbarm.conf,v 1.21 2015/04/06 20:19:28 jmcneill Exp $
 # evbarm shared config
 #
 image=$HOME/${board}.img
@@ -134,9 +134,25 @@ dhcpcd=YES
 ntpd=YES
 ntpd_flags="-g"
 EOF
+
+	if $resize; then
+		cat >> ${mnt}/etc/rc.conf << EOF
+resize_disklabel=YES
+resize_disklabel_disk=ld0
+resize_disklabel_part=a
+resize_root=YES
+resize_root_postcmd="/sbin/reboot -n"
+EOF
+	fi
+
 	echo "./etc/rc.conf type=file uname=root gname=wheel mode=0644" \
 	>> "$tmp/selected_sets"
 
+	mkdir ${mnt}/etc/rc.d
+	cp ${DIR}/files/resize_disklabel ${mnt}/etc/rc.d/resize_disklabel
+	echo "./etc/rc.d/resize_disklabel type=file uname=root gname=wheel mode=0555" \
+	>> "$tmp/selected_sets"
+
 	if [ ! -f ${release}/dev/MAKEDEV ]; then
 		echo ${PROG}: Missing ${release}/dev/MAKEDEV 1>&2
 		exit 1

Index: src/distrib/utils/embedded/conf/rpi.conf
diff -u src/distrib/utils/embedded/conf/rpi.conf:1.27 src/distrib/utils/embedded/conf/rpi.conf:1.28
--- src/distrib/utils/embedded/conf/rpi.conf:1.27	Fri Mar  6 11:11:55 2015
+++ src/distrib/utils/embedded/conf/rpi.conf	Mon Apr  6 20:19:28 2015
@@ -1,9 +1,10 @@
-# $NetBSD: rpi.conf,v 1.27 2015/03/06 11:11:55 skrll Exp $
+# $NetBSD: rpi.conf,v 1.28 2015/04/06 20:19:28 jmcneill Exp $
 # Raspberry Pi customization script used by mkimage
 #
 
 board=rpi
 kernel=$src/sys/arch/evbarm/compile/RPI/netbsd-RPI.bin
+resize=true
 
 . ${DIR}/conf/evbarm.conf
 

Added files:

Index: src/distrib/utils/embedded/files/resize_disklabel
diff -u /dev/null src/distrib/utils/embedded/files/resize_disklabel:1.1
--- /dev/null	Mon Apr  6 20:19:28 2015
+++ src/distrib/utils/embedded/files/resize_disklabel	Mon Apr  6 20:19:28 2015
@@ -0,0 +1,71 @@
+#!/bin/sh
+#
+# $NetBSD: resize_disklabel,v 1.1 2015/04/06 20:19:28 jmcneill Exp $
+#
+
+# PROVIDE: resize_disklabel
+# REQUIRE: fsck_root
+# BEFORE: resize_root
+
+$_rc_subr_loaded . /etc/rc.subr
+
+name="resize_disklabel"
+rcvar=$name
+start_cmd="resize_disklabel_start"
+stop_cmd=":"
+
+get_rawpart()
+{
+	partno=$(/sbin/sysctl -n kern.rawpartition)
+	test $partno = 2 && echo c || echo d
+}
+
+get_total_sectors()
+{
+	disk=$1
+	/sbin/drvctl -p $disk disk-info/geometry/sectors-per-unit
+}
+
+get_rawpart_sectors()
+{
+	disk=$1
+	rawpart=$2
+	/sbin/disklabel $disk | grep "^ $rawpart:" | awk '{ print $2; }'
+}
+
+grow_disklabel()
+{
+	disk=$1
+	part=$2
+	rawpart=$(get_rawpart)
+
+	ts=$(get_total_sectors $disk)
+	rs=$(get_rawpart_sectors $disk $rawpart)
+
+	if [ "$ts" = "$rs" ]; then
+		return
+	fi
+
+	oldsize=$(($rs * 512 / 1024 / 1024))
+	newsize=$(($ts * 512 / 1024 / 1024))
+	echo "Growing $disk disklabel (${oldsize}MB -> ${newsize}MB)"
+	printf "A\ny\n$part\n\n\n\$\nc\n\n\n\$\nd\n\n\n\$\nW\ny\nQ\n" | \
+	disklabel -i $disk >/dev/null
+}
+
+resize_disklabel_start()
+{
+	if [ x"${resize_disklabel_disk}" = "x" ]; then
+		warn "\${resize_disklabel_disk} is not set, not resizing disklabel"
+		return
+	fi
+	if [ x"${resize_disklabel_part}" = "x" ]; then
+		warn "\${resize_disklabel_part} is not set, not resizing disklabel"
+		return
+	fi
+
+	grow_disklabel "${resize_disklabel_disk}" "${resize_disklabel_part}"
+}
+
+load_rc_config $name
+run_rc_command "$1"



CVS commit: src/distrib/utils/embedded

2015-04-06 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Mon Apr  6 17:59:36 UTC 2015

Modified Files:
src/distrib/utils/embedded: mkimage

Log Message:
resizing of ffsv2 still doesn't work well, so revert previous, and instead
explicitly set fsize=2048/bsize=16384, which gives a pretty decent boost
to resize_ffs performance on its own


To generate a diff of this commit:
cvs rdiff -u -r1.53 -r1.54 src/distrib/utils/embedded/mkimage

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

Modified files:

Index: src/distrib/utils/embedded/mkimage
diff -u src/distrib/utils/embedded/mkimage:1.53 src/distrib/utils/embedded/mkimage:1.54
--- src/distrib/utils/embedded/mkimage:1.53	Sun Apr  5 17:05:45 2015
+++ src/distrib/utils/embedded/mkimage	Mon Apr  6 17:59:36 2015
@@ -1,5 +1,5 @@
 #!/bin/sh
-# $NetBSD: mkimage,v 1.53 2015/04/05 17:05:45 jmcneill Exp $
+# $NetBSD: mkimage,v 1.54 2015/04/06 17:59:36 jmcneill Exp $
 #
 # Copyright (c) 2013, 2014 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -178,7 +178,7 @@ if [ -z "${bootonly}" ]; then
 	echo ${bar} Populating ffs filesystem ${bar}
 	${MAKEFS} -r -N ${release}/etc -t ffs -rx \
 	-O ${ffsoffset} \
-	-o v=2,d=4096 -b $((${extra}))m \
+	-o d=4096,f=2048,b=16384 -b $((${extra}))m \
 	-F "$tmp/selected_sets" ${image} "${release}" "${mnt}"
 fi
 



CVS commit: src/distrib/utils/embedded

2015-04-05 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Apr  5 17:05:45 UTC 2015

Modified Files:
src/distrib/utils/embedded: mkimage

Log Message:
Use FFSv2 instead of FFSv1 for the root file-system. This should fix the
"resize_ffs takes forever" issues with evbarm images -- growing a v2
file-system is much faster than v1.


To generate a diff of this commit:
cvs rdiff -u -r1.52 -r1.53 src/distrib/utils/embedded/mkimage

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

Modified files:

Index: src/distrib/utils/embedded/mkimage
diff -u src/distrib/utils/embedded/mkimage:1.52 src/distrib/utils/embedded/mkimage:1.53
--- src/distrib/utils/embedded/mkimage:1.52	Thu Jan 29 14:54:06 2015
+++ src/distrib/utils/embedded/mkimage	Sun Apr  5 17:05:45 2015
@@ -1,5 +1,5 @@
 #!/bin/sh
-# $NetBSD: mkimage,v 1.52 2015/01/29 14:54:06 skrll Exp $
+# $NetBSD: mkimage,v 1.53 2015/04/05 17:05:45 jmcneill Exp $
 #
 # Copyright (c) 2013, 2014 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -178,7 +178,7 @@ if [ -z "${bootonly}" ]; then
 	echo ${bar} Populating ffs filesystem ${bar}
 	${MAKEFS} -r -N ${release}/etc -t ffs -rx \
 	-O ${ffsoffset} \
-	-o d=4096 -b $((${extra}))m \
+	-o v=2,d=4096 -b $((${extra}))m \
 	-F "$tmp/selected_sets" ${image} "${release}" "${mnt}"
 fi
 



CVS commit: src/distrib/utils/embedded/conf

2015-02-12 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Thu Feb 12 10:59:44 UTC 2015

Modified Files:
src/distrib/utils/embedded/conf: rpi.conf

Log Message:
actually write cpufreq changes to ${mnt}/etc/rc.local instead of /tmp/a


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/distrib/utils/embedded/conf/rpi.conf

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

Modified files:

Index: src/distrib/utils/embedded/conf/rpi.conf
diff -u src/distrib/utils/embedded/conf/rpi.conf:1.25 src/distrib/utils/embedded/conf/rpi.conf:1.26
--- src/distrib/utils/embedded/conf/rpi.conf:1.25	Fri Feb  6 15:15:01 2015
+++ src/distrib/utils/embedded/conf/rpi.conf	Thu Feb 12 10:59:44 2015
@@ -1,4 +1,4 @@
-# $NetBSD: rpi.conf,v 1.25 2015/02/06 15:15:01 jmcneill Exp $
+# $NetBSD: rpi.conf,v 1.26 2015/02/12 10:59:44 jmcneill Exp $
 # Raspberry Pi customization script used by mkimage
 #
 
@@ -34,7 +34,7 @@ EOF
 	# to match at boot time.
 	#
 	cp ${release}/etc/rc.local ${mnt}/etc/rc.local
-	cat > /tmp/a << EOF
+	cat >> ${mnt}/etc/rc.local << EOF
 if /sbin/sysctl -q machdep.cpu.frequency.max; then
 	cpufreq_max=\$(/sbin/sysctl -n machdep.cpu.frequency.max)
 	cpufreq_cur=\$(/sbin/sysctl -n machdep.cpu.frequency.current)



CVS commit: src/distrib/utils/embedded/conf

2015-02-06 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Fri Feb  6 15:15:02 UTC 2015

Modified Files:
src/distrib/utils/embedded/conf: rpi.conf

Log Message:
By default, RPI firmware sets the max CPU frequency to 600MHz. This can be
overridden by setting arm_freq in config.txt, but the default freq at boot
is still 600MHz.

Add logic to rc.local to compare the current vs. max CPU frequency; if they
differ, set the target frequency to the maximum.


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/distrib/utils/embedded/conf/rpi.conf

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

Modified files:

Index: src/distrib/utils/embedded/conf/rpi.conf
diff -u src/distrib/utils/embedded/conf/rpi.conf:1.24 src/distrib/utils/embedded/conf/rpi.conf:1.25
--- src/distrib/utils/embedded/conf/rpi.conf:1.24	Thu Nov 28 13:39:18 2013
+++ src/distrib/utils/embedded/conf/rpi.conf	Fri Feb  6 15:15:01 2015
@@ -1,4 +1,4 @@
-# $NetBSD: rpi.conf,v 1.24 2013/11/28 13:39:18 skrll Exp $
+# $NetBSD: rpi.conf,v 1.25 2015/02/06 15:15:01 jmcneill Exp $
 # Raspberry Pi customization script used by mkimage
 #
 
@@ -29,6 +29,22 @@ wscons=YES
 devpubd=YES
 EOF
 
+	#
+	# If arm_freq is specified in config.txt, set CPU frequency
+	# to match at boot time.
+	#
+	cp ${release}/etc/rc.local ${mnt}/etc/rc.local
+	cat > /tmp/a << EOF
+if /sbin/sysctl -q machdep.cpu.frequency.max; then
+	cpufreq_max=\$(/sbin/sysctl -n machdep.cpu.frequency.max)
+	cpufreq_cur=\$(/sbin/sysctl -n machdep.cpu.frequency.current)
+	if [ ! "\$cpufreq_max" = "\$cpufreq_cur" ]; then
+		/sbin/sysctl -w machdep.cpu.frequency.target=\$cpufreq_max
+	fi
+fi
+EOF
+	echo "./etc/rc.local type=file uname=root gname=wheel mode=0644" \
+	>> "$tmp/selected_sets"
 }
 
 populate() {



CVS commit: src/distrib/utils/embedded

2015-01-29 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Thu Jan 29 14:54:06 UTC 2015

Modified Files:
src/distrib/utils/embedded: mkimage
src/distrib/utils/embedded/conf: evbarm.conf x86.conf

Log Message:
Fix previous so that the new generated rc.conf is picked up and that
any new new mount points (e.g. /proc and /kern) are generated.

While here increate the fs size so that postfix can actually build
/etc/mail/aliases.db


To generate a diff of this commit:
cvs rdiff -u -r1.51 -r1.52 src/distrib/utils/embedded/mkimage
cvs rdiff -u -r1.19 -r1.20 src/distrib/utils/embedded/conf/evbarm.conf
cvs rdiff -u -r1.6 -r1.7 src/distrib/utils/embedded/conf/x86.conf

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

Modified files:

Index: src/distrib/utils/embedded/mkimage
diff -u src/distrib/utils/embedded/mkimage:1.51 src/distrib/utils/embedded/mkimage:1.52
--- src/distrib/utils/embedded/mkimage:1.51	Fri Jan 23 15:17:58 2015
+++ src/distrib/utils/embedded/mkimage	Thu Jan 29 14:54:06 2015
@@ -1,5 +1,5 @@
 #!/bin/sh
-# $NetBSD: mkimage,v 1.51 2015/01/23 15:17:58 skrll Exp $
+# $NetBSD: mkimage,v 1.52 2015/01/29 14:54:06 skrll Exp $
 #
 # Copyright (c) 2013, 2014 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -176,7 +176,7 @@ fi
 
 if [ -z "${bootonly}" ]; then
 	echo ${bar} Populating ffs filesystem ${bar}
-	${MAKEFS} -N ${release}/etc -t ffs -rx \
+	${MAKEFS} -r -N ${release}/etc -t ffs -rx \
 	-O ${ffsoffset} \
 	-o d=4096 -b $((${extra}))m \
 	-F "$tmp/selected_sets" ${image} "${release}" "${mnt}"

Index: src/distrib/utils/embedded/conf/evbarm.conf
diff -u src/distrib/utils/embedded/conf/evbarm.conf:1.19 src/distrib/utils/embedded/conf/evbarm.conf:1.20
--- src/distrib/utils/embedded/conf/evbarm.conf:1.19	Wed Jan 28 12:08:00 2015
+++ src/distrib/utils/embedded/conf/evbarm.conf	Thu Jan 29 14:54:06 2015
@@ -1,4 +1,4 @@
-# $NetBSD: evbarm.conf,v 1.19 2015/01/28 12:08:00 jmcneill Exp $
+# $NetBSD: evbarm.conf,v 1.20 2015/01/29 14:54:06 skrll Exp $
 # evbarm shared config
 #
 image=$HOME/${board}.img
@@ -6,7 +6,7 @@ image=$HOME/${board}.img
 MACHINE=evbarm
 
 swap=256
-extra=8		# spare space
+extra=48		# spare space
 boot=112
 init=8
 ffsoffset=$(( (${init} + ${boot} + ${swap}) / 2 ))m
@@ -110,6 +110,12 @@ make_fstab_evbarm() {
 	fi
 	echo "./etc/fstab type=file uname=root gname=wheel mode=0644" \
 	>> "$tmp/selected_sets"
+
+	# Missing mount points from fstab
+	echo "./proc type=dir uname=root gname=wheel mode=0755" \
+	>> "$tmp/selected_sets"
+	echo "./kern type=dir uname=root gname=wheel mode=0755" \
+	>> "$tmp/selected_sets"
 }
 
 customize_evbarm() {
@@ -128,6 +134,9 @@ dhcpcd=YES
 ntpd=YES
 ntpd_flags="-g"
 EOF
+	echo "./etc/rc.conf type=file uname=root gname=wheel mode=0644" \
+	>> "$tmp/selected_sets"
+
 	if [ ! -f ${release}/dev/MAKEDEV ]; then
 		echo ${PROG}: Missing ${release}/dev/MAKEDEV 1>&2
 		exit 1

Index: src/distrib/utils/embedded/conf/x86.conf
diff -u src/distrib/utils/embedded/conf/x86.conf:1.6 src/distrib/utils/embedded/conf/x86.conf:1.7
--- src/distrib/utils/embedded/conf/x86.conf:1.6	Fri Jan 23 15:17:58 2015
+++ src/distrib/utils/embedded/conf/x86.conf	Thu Jan 29 14:54:06 2015
@@ -1,4 +1,4 @@
-# $NetBSD: x86.conf,v 1.6 2015/01/23 15:17:58 skrll Exp $
+# $NetBSD: x86.conf,v 1.7 2015/01/29 14:54:06 skrll Exp $
 # x86 shared config
 #
 
@@ -93,6 +93,11 @@ make_fstab() {
 	fi
 	echo "./etc/fstab type=file uname=root gname=wheel mode=0755" \
 	>> "$tmp/selected_sets"
+
+	echo "./proc type=dir uname=root gname=wheel mode=0755" \
+	>> "$tmp/selected_sets"
+	echo "./kern type=dir uname=root gname=wheel mode=0755" \
+	>> "$tmp/selected_sets"
 }
 
 customize() {
@@ -111,6 +116,9 @@ dhcpcd=YES
 wscons=YES
 devpubd=YES
 EOF
+	echo "./etc/rc.conf type=file uname=root gname=wheel mode=0644" \
+	>> "$tmp/selected_sets"
+
 	if [ ! -f ${release}/dev/MAKEDEV ]; then
 		echo ${PROG}: Missing ${release}/dev/MAKEDEV 1>&2
 		exit 1
@@ -118,9 +126,6 @@ EOF
 	echo "${bar} running MAKEDEV ${bar}"
 	${HOST_SH} ${release}/dev/MAKEDEV -s all | sed -e 's:^\./:\./dev/:' \
 	>> "$tmp/selected_sets"
-
-	echo "${bar} creating directories ${bar}"
-	mkdir ${mnt}/proc ${mnt}/kern
 }
 
 populate() {



CVS commit: src/distrib/utils/embedded/conf

2015-01-28 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Wed Jan 28 12:08:00 UTC 2015

Modified Files:
src/distrib/utils/embedded/conf: evbarm.conf

Log Message:
add /var/shm tmpfs to fstab


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/distrib/utils/embedded/conf/evbarm.conf

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

Modified files:

Index: src/distrib/utils/embedded/conf/evbarm.conf
diff -u src/distrib/utils/embedded/conf/evbarm.conf:1.18 src/distrib/utils/embedded/conf/evbarm.conf:1.19
--- src/distrib/utils/embedded/conf/evbarm.conf:1.18	Fri Jan 23 15:17:58 2015
+++ src/distrib/utils/embedded/conf/evbarm.conf	Wed Jan 28 12:08:00 2015
@@ -1,4 +1,4 @@
-# $NetBSD: evbarm.conf,v 1.18 2015/01/23 15:17:58 skrll Exp $
+# $NetBSD: evbarm.conf,v 1.19 2015/01/28 12:08:00 jmcneill Exp $
 # evbarm shared config
 #
 image=$HOME/${board}.img
@@ -74,6 +74,7 @@ make_fstab_evbarm_normal() {
 kernfs		/kern		kernfs	rw
 ptyfs		/dev/pts	ptyfs	rw
 procfs		/proc		procfs	rw
+tmpfs		/var/shm	tmpfs	rw,-m1777,-sram%25
 EOF
 }
 
@@ -97,6 +98,7 @@ tmpfs		/var/mail		tmpfs	rw,union,-s10M
 tmpfs		/var/spool/postfix	tmpfs	rw,union,-s20M
 tmpfs		/var/db/postfix		tmpfs	rw,union,-s1M
 tmpfs		/var/chroot		tmpfs	rw,union,-s10M
+tmpfs		/var/shm		tmpfs	rw,-m1777,-sram%25
 EOF
 }
 



CVS commit: src/distrib/utils/embedded

2015-01-23 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Fri Jan 23 15:17:58 UTC 2015

Modified Files:
src/distrib/utils/embedded: mkimage
src/distrib/utils/embedded/conf: evbarm.conf rpi_inst.conf
usermode.conf x86.conf

Log Message:
PR/49596: mkimage: incorrect permissions on evbarm images

Use NetBSD.dist in our mtree specification to populate the top level
directories, etc.

For each generated file hand craft an mtree entry.

Remove specialdirs as NetBSD.dist creates /proc and /kern.


To generate a diff of this commit:
cvs rdiff -u -r1.50 -r1.51 src/distrib/utils/embedded/mkimage
cvs rdiff -u -r1.17 -r1.18 src/distrib/utils/embedded/conf/evbarm.conf
cvs rdiff -u -r1.5 -r1.6 src/distrib/utils/embedded/conf/rpi_inst.conf \
src/distrib/utils/embedded/conf/x86.conf
cvs rdiff -u -r1.3 -r1.4 src/distrib/utils/embedded/conf/usermode.conf

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

Modified files:

Index: src/distrib/utils/embedded/mkimage
diff -u src/distrib/utils/embedded/mkimage:1.50 src/distrib/utils/embedded/mkimage:1.51
--- src/distrib/utils/embedded/mkimage:1.50	Sun Jan 18 17:37:54 2015
+++ src/distrib/utils/embedded/mkimage	Fri Jan 23 15:17:58 2015
@@ -1,5 +1,5 @@
 #!/bin/sh
-# $NetBSD: mkimage,v 1.50 2015/01/18 17:37:54 skrll Exp $
+# $NetBSD: mkimage,v 1.51 2015/01/23 15:17:58 skrll Exp $
 #
 # Copyright (c) 2013, 2014 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -154,7 +154,7 @@ esac
 
 if [ -z "${bootonly}" ]; then
 	echo ${bar} configuring sets ${bar}
-	(echo '/set type=dir uname=root gname=wheel mode=0755'
+	(cat "${release}/etc/mtree/NetBSD.dist"
 	for i in $selected_sets; do
 		s="${release}/etc/mtree/set.$i"
 		if [ -f "$s" ]; then
@@ -167,10 +167,6 @@ make_fstab
 customize
 populate
 
-if [ -z "${bootonly}" ]; then
-	(cd ${mnt}; ${MTREE} -N ${release}/etc -c -k all | 
-	${MTREE} -N ${release}/etc -C -k all) >> "$tmp/selected_sets"
-fi
 if [ -n "${msdosid}" ]; then
 	echo ${bar} Populating msdos filesystem ${bar}
 	${MAKEFS} -N ${release}/etc -t msdos \

Index: src/distrib/utils/embedded/conf/evbarm.conf
diff -u src/distrib/utils/embedded/conf/evbarm.conf:1.17 src/distrib/utils/embedded/conf/evbarm.conf:1.18
--- src/distrib/utils/embedded/conf/evbarm.conf:1.17	Tue Nov 25 13:42:31 2014
+++ src/distrib/utils/embedded/conf/evbarm.conf	Fri Jan 23 15:17:58 2015
@@ -1,9 +1,8 @@
-# $NetBSD: evbarm.conf,v 1.17 2014/11/25 13:42:31 jmcneill Exp $
+# $NetBSD: evbarm.conf,v 1.18 2015/01/23 15:17:58 skrll Exp $
 # evbarm shared config
 #
 image=$HOME/${board}.img
 
-specialdirs="/kern /proc"
 MACHINE=evbarm
 
 swap=256
@@ -107,6 +106,8 @@ make_fstab_evbarm() {
 	else
 		make_fstab_evbarm_normal
 	fi
+	echo "./etc/fstab type=file uname=root gname=wheel mode=0644" \
+	>> "$tmp/selected_sets"
 }
 
 customize_evbarm() {
@@ -133,6 +134,7 @@ EOF
 	${HOST_SH} ${release}/dev/MAKEDEV -s all | sed -e 's:^\./:\./dev/:' \
 	>> "$tmp/selected_sets"
 
-	echo "${bar} creating directories ${bar}"
-	mkdir ${mnt}/proc ${mnt}/kern
+	echo "${bar} fixing up permissions"
+	echo "./boot type=dir uname=root gname=wheel mode=0755" \
+	>> "$tmp/selected_sets"
 }

Index: src/distrib/utils/embedded/conf/rpi_inst.conf
diff -u src/distrib/utils/embedded/conf/rpi_inst.conf:1.5 src/distrib/utils/embedded/conf/rpi_inst.conf:1.6
--- src/distrib/utils/embedded/conf/rpi_inst.conf:1.5	Thu Apr  3 01:36:20 2014
+++ src/distrib/utils/embedded/conf/rpi_inst.conf	Fri Jan 23 15:17:58 2015
@@ -1,4 +1,4 @@
-# $NetBSD: rpi_inst.conf,v 1.5 2014/04/03 01:36:20 ozaki-r Exp $
+# $NetBSD: rpi_inst.conf,v 1.6 2015/01/23 15:17:58 skrll Exp $
 # Raspberry Pi customization script used by mkimage
 #
 
@@ -9,8 +9,6 @@ kernel=$src/sys/arch/evbarm/compile/RPI/
 
 image=$HOME/${board}.img
 
-specialdirs="/kern /proc"
-
 swap=8
 extra=8		# spare space
 boot=112
Index: src/distrib/utils/embedded/conf/x86.conf
diff -u src/distrib/utils/embedded/conf/x86.conf:1.5 src/distrib/utils/embedded/conf/x86.conf:1.6
--- src/distrib/utils/embedded/conf/x86.conf:1.5	Sun Dec 14 00:28:46 2014
+++ src/distrib/utils/embedded/conf/x86.conf	Fri Jan 23 15:17:58 2015
@@ -1,4 +1,4 @@
-# $NetBSD: x86.conf,v 1.5 2014/12/14 00:28:46 christos Exp $
+# $NetBSD: x86.conf,v 1.6 2015/01/23 15:17:58 skrll Exp $
 # x86 shared config
 #
 
@@ -7,8 +7,6 @@ MACHINE=${board}
 kernel=$src/sys/arch/${board}/compile/GENERIC/netbsd
 bootfile=$release/usr/mdec/boot
 
-specialdirs="/kern /proc"
-
 extra=8		# spare space
 size=0		# autocompute
 netbsdid=169
@@ -93,6 +91,8 @@ make_fstab() {
 	else
 		make_fstab_normal
 	fi
+	echo "./etc/fstab type=file uname=root gname=wheel mode=0755" \
+	>> "$tmp/selected_sets"
 }
 
 customize() {
@@ -136,4 +136,9 @@ populate() {
 		exit 1
 	fi
 	cp ${bootfile} ${mnt}/boot
+
+	echo "./netbsd type=file uname=root gname=wheel mode=0755" \
+	>> "$tmp/selected_sets"
+	echo "./boot type=file uname=root gname=wheel mode=0444" \
+	>> "$tmp/sele

CVS commit: src/distrib/utils/embedded

2015-01-18 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Jan 18 17:37:54 UTC 2015

Modified Files:
src/distrib/utils/embedded: mkimage

Log Message:
Use [dx]sets_p as flag for debug/X sets inclusion. xsets is the list of
sets.


To generate a diff of this commit:
cvs rdiff -u -r1.49 -r1.50 src/distrib/utils/embedded/mkimage

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

Modified files:

Index: src/distrib/utils/embedded/mkimage
diff -u src/distrib/utils/embedded/mkimage:1.49 src/distrib/utils/embedded/mkimage:1.50
--- src/distrib/utils/embedded/mkimage:1.49	Sun Dec 14 00:28:46 2014
+++ src/distrib/utils/embedded/mkimage	Sun Jan 18 17:37:54 2015
@@ -1,5 +1,5 @@
 #!/bin/sh
-# $NetBSD: mkimage,v 1.49 2014/12/14 00:28:46 christos Exp $
+# $NetBSD: mkimage,v 1.50 2015/01/18 17:37:54 skrll Exp $
 #
 # Copyright (c) 2013, 2014 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -106,8 +106,8 @@ fi
 release="/usr/obj/${MACHINE}/release"
 
 selected_sets="$sets"
-dsets=false
-xsets=false
+dsets_p=false
+xsets_p=false
 minwrites=false
 rootdev=ld
 
@@ -119,9 +119,9 @@ do
 	K)	kernel="$OPTARG";;
 	S)	;;
 	b)	bootonly=true;;
-	d)	dsets=true
+	d)	dsets_p=true
 		selected_sets="$selected_sets debug"
-		if $xsets; then
+		if $xsets_p; then
 			selected_sets="$selected_sets xdebug"
 		fi
 		;;
@@ -130,9 +130,9 @@ do
 	m)	minwrites=true;;
 	r)	rootdev="$OPTARG";;
 	s)	size="$OPTARG";;
-	x)	xsets=true
+	x)	xsets_p=true
 		selected_sets="$selected_sets $xsets"
-		if $dsets; then
+		if $dsets_p; then
 		selected_sets="$selected_sets xdebug"
 		fi
 		;;



CVS commit: src/distrib/utils/embedded

2014-12-13 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Dec 14 00:28:46 UTC 2014

Modified Files:
src/distrib/utils/embedded: mkimage
src/distrib/utils/embedded/conf: x86.conf

Log Message:
fix image building:
- round up the total size of the disk image
- fix fdisk offset for netbsd ffs images


To generate a diff of this commit:
cvs rdiff -u -r1.48 -r1.49 src/distrib/utils/embedded/mkimage
cvs rdiff -u -r1.4 -r1.5 src/distrib/utils/embedded/conf/x86.conf

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

Modified files:

Index: src/distrib/utils/embedded/mkimage
diff -u src/distrib/utils/embedded/mkimage:1.48 src/distrib/utils/embedded/mkimage:1.49
--- src/distrib/utils/embedded/mkimage:1.48	Thu Apr  3 18:51:38 2014
+++ src/distrib/utils/embedded/mkimage	Sat Dec 13 19:28:46 2014
@@ -1,5 +1,5 @@
 #!/bin/sh
-# $NetBSD: mkimage,v 1.48 2014/04/03 22:51:38 christos Exp $
+# $NetBSD: mkimage,v 1.49 2014/12/14 00:28:46 christos Exp $
 #
 # Copyright (c) 2013, 2014 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -190,6 +190,13 @@ if [ "${size}" = 0 ]; then
 	size="$(getsize "${image}")"
 fi
 newsize=$((${size} / 2 / 1024))
+compare=$((${newsize} * 2 * 1024))
+while [ "${compare}" != "${size}" ]
+do
+	size="$((size + size - compare))"  
+	newsize="$((${size} / 2 / 1024))"
+	compare="$((${newsize} * 2 * 1024))"
+done  
 
 echo ${bar} Adding label ${bar}
 make_label > ${tmp}/label
@@ -202,7 +209,7 @@ if [ -n "${msdosid}" ]; then
 elif [ -n "${netbsdid}" ]; then
 	echo ${bar} Running fdisk ${bar}
 	${FDISK} -f -i ${image}
-	${FDISK} -f -a -u -0 -s 169 ${image}
+	${FDISK} -f -a -u -0 -s 169/${init} ${image}
 	${INSTALLBOOT} -f -v ${image} ${release}/usr/mdec/bootxx_ffsv1
 fi
 

Index: src/distrib/utils/embedded/conf/x86.conf
diff -u src/distrib/utils/embedded/conf/x86.conf:1.4 src/distrib/utils/embedded/conf/x86.conf:1.5
--- src/distrib/utils/embedded/conf/x86.conf:1.4	Fri Apr  4 12:45:51 2014
+++ src/distrib/utils/embedded/conf/x86.conf	Sat Dec 13 19:28:46 2014
@@ -1,4 +1,4 @@
-# $NetBSD: x86.conf,v 1.4 2014/04/04 16:45:51 christos Exp $
+# $NetBSD: x86.conf,v 1.5 2014/12/14 00:28:46 christos Exp $
 # x86 shared config
 #
 
@@ -12,13 +12,14 @@ specialdirs="/kern /proc"
 extra=8		# spare space
 size=0		# autocompute
 netbsdid=169
-ffsoffset=63b
+init=63
+ffsoffset=${init}b
 
 make_label() {
 	# compute all sizes in terms of sectors
 	local totalsize=$(( ${newsize} * 1024 * 2 / 512 ))
 
-	local aoffset=63
+	local aoffset=${init}
 	local asize=$(( ${totalsize} - ${aoffset} ))
 
 	local bps=512



CVS commit: src/distrib/utils/embedded/conf

2014-11-25 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Tue Nov 25 13:42:31 UTC 2014

Modified Files:
src/distrib/utils/embedded/conf: evbarm.conf

Log Message:
disable wapbl for evbarm images until stability issues are sorted out


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/distrib/utils/embedded/conf/evbarm.conf

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

Modified files:

Index: src/distrib/utils/embedded/conf/evbarm.conf
diff -u src/distrib/utils/embedded/conf/evbarm.conf:1.16 src/distrib/utils/embedded/conf/evbarm.conf:1.17
--- src/distrib/utils/embedded/conf/evbarm.conf:1.16	Tue Sep  9 13:02:25 2014
+++ src/distrib/utils/embedded/conf/evbarm.conf	Tue Nov 25 13:42:31 2014
@@ -1,4 +1,4 @@
-# $NetBSD: evbarm.conf,v 1.16 2014/09/09 13:02:25 jmcneill Exp $
+# $NetBSD: evbarm.conf,v 1.17 2014/11/25 13:42:31 jmcneill Exp $
 # evbarm shared config
 #
 image=$HOME/${board}.img
@@ -69,7 +69,7 @@ make_fstab_evbarm_normal() {
 	cat > ${mnt}/etc/fstab << EOF
 # NetBSD /etc/fstab
 # See /usr/share/examples/fstab/ for more examples.
-/dev/ld0a	/		ffs	rw,log	1 1
+/dev/ld0a	/		ffs	rw	1 1
 /dev/ld0b	none		swap	sw	0 0
 /dev/ld0e	/boot		msdos	rw	1 1
 kernfs		/kern		kernfs	rw



  1   2   >