Module Name:    src
Committed By:   martin
Date:           Mon Dec 14 17:26:37 UTC 2020

Modified Files:
        src/distrib/amiga/miniroot [netbsd-9]: install.md
        src/distrib/hp300/miniroot [netbsd-9]: install.md
        src/distrib/mac68k/miniroot [netbsd-9]: install.md
        src/distrib/miniroot [netbsd-9]: install.sub list
        src/distrib/mvme68k/miniroot [netbsd-9]: install.md
        src/distrib/sun2/miniroot [netbsd-9]: install.md
        src/distrib/sun3/miniroot [netbsd-9]: install.md

Log Message:
Pull up following revision(s) (requested by tsutsui in ticket #1151):

        distrib/miniroot/install.sub: revision 1.54
        distrib/miniroot/install.sub: revision 1.55
        distrib/miniroot/install.sub: revision 1.56
        distrib/miniroot/install.sub: revision 1.57
        distrib/miniroot/install.sub: revision 1.58
        distrib/miniroot/install.sub: revision 1.59
        distrib/hp300/miniroot/install.md: revision 1.20
        distrib/miniroot/list: revision 1.36
        distrib/mvme68k/miniroot/install.md: revision 1.9
        distrib/mvme68k/miniroot/install.md: revision 1.10
        distrib/sun3/miniroot/install.md: revision 1.6
        distrib/sun3/miniroot/install.md: revision 1.7
        distrib/sun2/miniroot/install.md: revision 1.6
        distrib/sun2/miniroot/install.md: revision 1.7
        distrib/amiga/miniroot/install.md: revision 1.31
        distrib/mac68k/miniroot/install.md: revision 1.6
        distrib/mac68k/miniroot/install.md: revision 1.7
        distrib/mac68k/miniroot/install.md: revision 1.8
        distrib/hp300/miniroot/install.md: revision 1.18
        distrib/hp300/miniroot/install.md: revision 1.19
        distrib/miniroot/install.sub: revision 1.53

test ! -n "$foo"   is just a quaint way of saying test -z "$foo"
and test ! -z "$foo" is really just test -n "$foo"  so let's just
use the simple (and more obvious) forms.

NFCI.

 -

Add modules set for default sets on miniroot installation.
Should be pulled up to netbsd-9 and netbsd-8.

 -

The kernel and X sets should be specified in MD miniroot scripts.

Otherwise they are not listed at least on ftp installation.

The problem was reported by Martin Trusler on port-hp300@:
 https://mail-index.netbsd.org/port-hp300/2020/11/21/msg000174.html

Should be pulled up to netbsd-9 and netbsd-8.

 -

Appease awk warnings on suppressing dmesg timestamps.
awk: warning: escape sequence `\[' treated as plain `['
source line number 1
context is
{ h=$0; >>>  gsub("^[ <<<
awk: warning: escape sequence `\]' treated as plain `]'
source line number 1

Should be pulled up to netbsd-9.

 -

Explicitly sort set names fetched via ftp nlist.

Several binary sets are stored as symbolic links on releases and
it seems some ftpd doesn't sort nlist outputs by name in such case.

Worth to pullup to netbsd-9 and netbsd-8.

 -

Use proper release version strings ("9.1" rather than "91") in banners.

Also define and use "MACHINE" variable to describe port names
(no uname(1) or sysctl(8) in miniroot binary list by default).

I guess the short format like "91" by ${DISTRIBREV} was used only
for split sets for floppies in 1990's releases.

Worth to pullup to netbsd-9.

 -

Inform the default installation directory in the official ftp server.

 -

Fetch files via ftp using auto-fetching with URL per each binary set.

On slower machines, it takes more than five minutes to get a large
set binary and it could cause timeout of ftp control session, so
getting multiple binary sets in a single ftp session always fails.

Briefly tested on HP 9000/425e with 9.1 tree and ftp.netbsd.org binaries.

No particular comments on tech-install@ and port-hp300@.

Maybe should be pulled up to netbsd-9.

 -

Add missing md_get_partition_range() that causes installation failure.

Also reported by Martin Trusler on testing hp300 miniroot.

Should be pulled up to netbsd-9 and netbsd-8.


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.30.2.1 src/distrib/amiga/miniroot/install.md
cvs rdiff -u -r1.17 -r1.17.2.1 src/distrib/hp300/miniroot/install.md
cvs rdiff -u -r1.5 -r1.5.2.1 src/distrib/mac68k/miniroot/install.md
cvs rdiff -u -r1.48.2.3 -r1.48.2.4 src/distrib/miniroot/install.sub
cvs rdiff -u -r1.35 -r1.35.46.1 src/distrib/miniroot/list
cvs rdiff -u -r1.8 -r1.8.2.1 src/distrib/mvme68k/miniroot/install.md
cvs rdiff -u -r1.5 -r1.5.2.1 src/distrib/sun2/miniroot/install.md
cvs rdiff -u -r1.5 -r1.5.2.1 src/distrib/sun3/miniroot/install.md

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

Modified files:

Index: src/distrib/amiga/miniroot/install.md
diff -u src/distrib/amiga/miniroot/install.md:1.30 src/distrib/amiga/miniroot/install.md:1.30.2.1
--- src/distrib/amiga/miniroot/install.md:1.30	Wed Apr 10 14:52:53 2019
+++ src/distrib/amiga/miniroot/install.md	Mon Dec 14 17:26:37 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: install.md,v 1.30 2019/04/10 14:52:53 christos Exp $
+#	$NetBSD: install.md,v 1.30.2.1 2020/12/14 17:26:37 martin Exp $
 #
 #
 # Copyright (c) 1996,2006 The NetBSD Foundation, Inc.
@@ -140,7 +140,7 @@ md_labeldisk() {
 md_welcome_banner() {
 	if [ "$MODE" = "install" ]; then
 		echo ""
-		echo "Welcome to the NetBSD/amiga ${VERSION} installation program."
+		echo "Welcome to the NetBSD/${MACHINE} ${RELEASE} installation program."
 		cat << \__welcome_banner_1
 
 This program is designed to help you put NetBSD on your disk,
@@ -151,7 +151,7 @@ __welcome_banner_1
 
 	else
 		echo ""
-		echo "Welcome to the NetBSD/amiga ${VERSION} upgrade program."
+		echo "Welcome to the NetBSD/${MACHINE} ${RELEASE} upgrade program."
 		cat << \__welcome_banner_2
 
 This program is designed to help you upgrade your NetBSD system in a

Index: src/distrib/hp300/miniroot/install.md
diff -u src/distrib/hp300/miniroot/install.md:1.17 src/distrib/hp300/miniroot/install.md:1.17.2.1
--- src/distrib/hp300/miniroot/install.md:1.17	Wed Apr 10 14:52:53 2019
+++ src/distrib/hp300/miniroot/install.md	Mon Dec 14 17:26:37 2020
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-#	$NetBSD: install.md,v 1.17 2019/04/10 14:52:53 christos Exp $
+#	$NetBSD: install.md,v 1.17.2.1 2020/12/14 17:26:37 martin Exp $
 #
 # Copyright (c) 1996 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -35,7 +35,7 @@
 #
 
 # Machine-dependent install sets
-MDSETS=""
+MDSETS="kern-GENERIC xbase xcomp xetc xfont xserver"
 
 md_set_term() {
 	if [ ! -z "$TERM" ]; then
@@ -83,6 +83,11 @@ md_get_ifdevs() {
 	mi_filter_dmesg | awk -F : '/^le[0-9]*:/ { print $1; }' | sort -u
 }
 
+md_get_partition_range() {
+	# return an expression describing the valid partition id's
+	echo '[a-h]'
+}
+
 md_installboot() {
 	# $1 is the root disk
 
@@ -470,7 +475,7 @@ __md_copy_kernel_1
 md_welcome_banner() {
 (
 	echo	""
-	echo	"Welcome to the NetBSD/hp300 ${VERSION} installation program."
+	echo	"Welcome to the NetBSD/${MACHINE} ${RELEASE} installation program."
 	cat << \__welcome_banner_1
 
 This program is designed to help you install NetBSD on your system in a

Index: src/distrib/mac68k/miniroot/install.md
diff -u src/distrib/mac68k/miniroot/install.md:1.5 src/distrib/mac68k/miniroot/install.md:1.5.2.1
--- src/distrib/mac68k/miniroot/install.md:1.5	Wed Apr 10 14:52:53 2019
+++ src/distrib/mac68k/miniroot/install.md	Mon Dec 14 17:26:37 2020
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-#	$NetBSD: install.md,v 1.5 2019/04/10 14:52:53 christos Exp $
+#	$NetBSD: install.md,v 1.5.2.1 2020/12/14 17:26:37 martin Exp $
 #
 # Copyright (c) 1996 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -35,7 +35,7 @@
 #
 
 # Machine-dependent install sets
-MDSETS=""
+MDSETS="kern-GENERIC xbase xcomp xetc xfont xserver"
 
 md_set_term() {
 	if [ ! -z "$TERM" ]; then
@@ -83,6 +83,11 @@ md_get_ifdevs() {
 	mi_filter_dmesg | awk -F : '/^sn[0-9]*:/ { print $1; }' | sort -u
 }
 
+md_get_partition_range() {
+	# return an expression describing the valid partition id's
+	echo '[a-h]'
+}
+
 md_installboot() {
 	# $1 is the root disk
 
@@ -122,7 +127,7 @@ md_copy_kernel() {
 md_welcome_banner() {
 (
 	echo	""
-	echo	"Welcome to the NetBSD/mac68k ${VERSION} installation program."
+	echo	"Welcome to the NetBSD/${MACHINE} ${RELEASE} installation program."
 	cat << \__welcome_banner_1
 
 This program is designed to help you install NetBSD on your system in a

Index: src/distrib/miniroot/install.sub
diff -u src/distrib/miniroot/install.sub:1.48.2.3 src/distrib/miniroot/install.sub:1.48.2.4
--- src/distrib/miniroot/install.sub:1.48.2.3	Tue Jan 21 15:26:46 2020
+++ src/distrib/miniroot/install.sub	Mon Dec 14 17:26:36 2020
@@ -1,5 +1,5 @@
 #!/bin/sh
-#	$NetBSD: install.sub,v 1.48.2.3 2020/01/21 15:26:46 martin Exp $
+#	$NetBSD: install.sub,v 1.48.2.4 2020/12/14 17:26:36 martin Exp $
 #
 # Copyright (c) 1996 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -32,10 +32,14 @@
 #	NetBSD installation/upgrade script - common subroutines.
 
 ROOTDISK=""				# filled in below
-VERSION=89936
+MACHINE=				# filled by distrib/miniroot/list
+export MACHINE
+VERSION=100				# updated by distrib/miniroot/list
 export VERSION
+RELEASE=10.0				# updated by distrib/miniroot/list
+export RELEASE
 
-ALLSETS="base comp etc games man misc rescue text"	# default install sets
+ALLSETS="base comp etc games man misc modules rescue text"	# default install sets
 UPGRSETS="base comp games man misc text"		# default upgrade sets
 THESETS=						# one of the above
 
@@ -523,7 +527,7 @@ if [ -f /mnt/etc/rc.conf ]; then
 		echo -n "configuring network interfaces:"
 		for i in $tmp; do
 			eval $(echo 'args=$ifconfig_'$i)
-			if [ ! -z "$args" ]; then
+			if [ -n "$args" ]; then
 				echo -n " $i"
 				ifconfig $i $args
 			elif [ -f /mnt/etc/ifconfig.$i ]; then
@@ -555,7 +559,7 @@ else
 			read af name mask bcaddr extras
 			read dt dtaddr
 
-			if [ ! -n "$name" ]; then
+			if [ -z "$name" ]; then
 		    echo "/etc/hostname.$1: invalid network configuration file"
 				exit
 			fi
@@ -678,6 +682,10 @@ You will be asked to enter the name of t
 installation sets. When you enter a '?' you will see a listing of the
 current directory on the server.
 __install_ftp_2
+	echo ""
+	echo "The default installation directory in the official ftp server is:"
+	echo "/pub/NetBSD/NetBSD-${RELEASE}/${MACHINE}/binary/sets"
+
 	_sets=""
 	while [ -z "$_sets" ]
 	do
@@ -713,10 +721,19 @@ __install_ftp_2
 		if [ $resp = '?' ]; then
 			sh /tmp/ftp-dir.sh
 		else
-			_sets=$(sh /tmp/ftp-dir.sh | sh /tmp/fname_filter.sh)
+			_sets=$(sh /tmp/ftp-dir.sh | sort -u | sh /tmp/fname_filter.sh)
 		fi
 	done
 	rm -f /tmp/ftp-dir.sh /tmp/fname_filter.sh
+	rm -f /tmp/ftp-script.sh
+
+	# Prepare ftp-fetch script to fetch binary sets
+	_download_dir=INSTALL
+	_ftp_opts=""
+	_ftp_url="ftp://$_ftp_server_login:$_ftp_server_password@$_ftp_server_ip$_ftp_server_dir/";
+	echo "#!/bin/sh" > /tmp/ftp-fetch.sh
+	echo "cd /mnt" >> /tmp/ftp-fetch.sh
+	echo "mkdir -p $_download_dir" >> /tmp/ftp-fetch.sh
 
 	while : ; do
 		echo "The following sets are available for extraction:"
@@ -737,7 +754,7 @@ __install_ftp_2
 		echo ""
 
 		# Get name of the file and add extraction command
-		# to the ftp-script.
+		# to the ftp-fetch script.
 		if [ -z "$_next" ]; then resp=n; else resp=y; fi
 		echo -n "Continue to add filenames [$resp]? "
 		getresp "$resp"
@@ -748,8 +765,16 @@ __install_ftp_2
 		echo -n "File name [$_next]? "
 		getresp "$_next"
 		if isin $resp $_sets; then
-			echo "get $resp |\"pax -zr${verbose_flag}pe\"" >> \
-					/tmp/ftp-script.sh
+			echo "echo Fetching $resp:" >> \
+					/tmp/ftp-fetch.sh
+			echo "ftp ${_ftp_opts} -o $_download_dir/$resp ${_ftp_url}$resp" >> \
+					/tmp/ftp-fetch.sh
+			echo "echo Extracting $resp:" >> \
+					/tmp/ftp-fetch.sh
+			echo "pax -zr${verbose_flag}pe -f $_download_dir/$resp" >> \
+					/tmp/ftp-fetch.sh
+			echo "rm -f $_download_dir/$resp" >> \
+					/tmp/ftp-fetch.sh
 			_setsdone="$resp $_setsdone"
 		else
 			echo "You entered an invalid filename."
@@ -757,11 +782,8 @@ __install_ftp_2
 		fi
 	done
 
-	echo "quit" >> /tmp/ftp-script.sh
-	echo "__end_commands" >> /tmp/ftp-script.sh
-
-	sh /tmp/ftp-script.sh
-	rm -f /tmp/ftp-script.sh
+	sh /tmp/ftp-fetch.sh
+	rm -f /tmp/ftp-fetch.sh
 	echo "Extraction complete."
 }
 
@@ -1047,7 +1069,7 @@ The following filesystem types are suppo
 __mount_a_disk_2
 	_md_fstype=$(md_native_fstype)
 	_md_fsopts=$(md_native_fsopts)
-	if [ ! -z "$_md_fstype" ]; then
+	if [ -n "$_md_fstype" ]; then
 		echo "	3) $_md_fstype"
 	else
 		_md_fstype="_undefined_"
@@ -1611,6 +1633,6 @@ mi_filter_msgbuf() {
 
 mi_filter_dmesg() {
 	# Remove timestemps, sort.
-	dmesg | awk '{ h=$0; gsub("^\[[0-9. ]*\] ", "", h); print h; }' \
+	dmesg | awk '{ h=$0; gsub("^[[0-9. ]*] ", "", h); print h; }' \
 	    | sort -u
 }

Index: src/distrib/miniroot/list
diff -u src/distrib/miniroot/list:1.35 src/distrib/miniroot/list:1.35.46.1
--- src/distrib/miniroot/list:1.35	Sun Jun 19 06:48:07 2011
+++ src/distrib/miniroot/list	Mon Dec 14 17:26:37 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: list,v 1.35 2011/06/19 06:48:07 tsutsui Exp $
+#	$NetBSD: list,v 1.35.46.1 2020/12/14 17:26:37 martin Exp $
 
 SRCDIRS bin sbin usr.bin usr.sbin
 
@@ -71,5 +71,5 @@ COPY	${DISTRIBDIR}/common/services		etc/
 # and the installation scripts
 COPY	${CURDIR}/install.sh		install		555
 COPY	${CURDIR}/upgrade.sh		upgrade		555
-CMD	sed "/^VERSION=/s/=.*/=${DISTRIBREV}/" < ${CURDIR}/install.sub > install.sub
+CMD	sed -e "/^VERSION=/s/=.*/=${DISTRIBREV}/" -e "/^RELEASE=/s/=.*/=${DISTRIBVER}/" -e "/^MACHINE=/s/=.*/=${MACHINE}/" < ${CURDIR}/install.sub > install.sub
 MTREE	./install.sub	type=file uname=root gname=wheel mode=0444

Index: src/distrib/mvme68k/miniroot/install.md
diff -u src/distrib/mvme68k/miniroot/install.md:1.8 src/distrib/mvme68k/miniroot/install.md:1.8.2.1
--- src/distrib/mvme68k/miniroot/install.md:1.8	Wed Apr 10 14:52:53 2019
+++ src/distrib/mvme68k/miniroot/install.md	Mon Dec 14 17:26:37 2020
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-#	$NetBSD: install.md,v 1.8 2019/04/10 14:52:53 christos Exp $
+#	$NetBSD: install.md,v 1.8.2.1 2020/12/14 17:26:37 martin Exp $
 #
 # Copyright (c) 1996 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -35,7 +35,7 @@
 #
 
 # Machine-dependent install sets
-MDSETS=""
+MDSETS="kern-GENERIC xbase xcomp xetc xfont xserver"
 
 md_set_term() {
 	if [ ! -z "$TERM" ]; then
@@ -176,7 +176,7 @@ md_copy_kernel() {
 }
 
 md_welcome_banner() {
-	echo	"Welcome to the NetBSD/mvme68k ${VERSION} installation program."
+	echo	"Welcome to the NetBSD/${MACHINE} ${RELEASE} installation program."
 	cat << \__welcome_banner_1
 
 This program is designed to help you install NetBSD on your system in a simple

Index: src/distrib/sun2/miniroot/install.md
diff -u src/distrib/sun2/miniroot/install.md:1.5 src/distrib/sun2/miniroot/install.md:1.5.2.1
--- src/distrib/sun2/miniroot/install.md:1.5	Wed Apr 10 14:52:53 2019
+++ src/distrib/sun2/miniroot/install.md	Mon Dec 14 17:26:37 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: install.md,v 1.5 2019/04/10 14:52:53 christos Exp $
+#	$NetBSD: install.md,v 1.5.2.1 2020/12/14 17:26:37 martin Exp $
 #
 #
 # Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
 
 # Machine-dependent install sets
 # MDSETS="xbin xman xinc xcon" XXX
-MDSETS=""
+MDSETS="kern-GENERIC"
 
 md_set_term() {
 	if [ ! -z "$TERM" ]; then
@@ -146,7 +146,7 @@ md_copy_kernel() {
 md_welcome_banner() {
 	if [ "$MODE" = "install" ]; then
 		echo ""
-		echo "Welcome to the NetBSD/sun2 ${VERSION} installation program."
+		echo "Welcome to the NetBSD/${MACHINE} ${RELEASE} installation program."
 		cat << \__welcome_banner_1
 
 This program is designed to help you put NetBSD on your disk,
@@ -157,7 +157,7 @@ __welcome_banner_1
 
 	else
 		echo ""
-		echo "Welcome to the NetBSD/sun2 ${VERSION} upgrade program."
+		echo "Welcome to the NetBSD/${MACHINE} ${VERSION} upgrade program."
 		cat << \__welcome_banner_2
 
 This program is designed to help you upgrade your NetBSD system in a

Index: src/distrib/sun3/miniroot/install.md
diff -u src/distrib/sun3/miniroot/install.md:1.5 src/distrib/sun3/miniroot/install.md:1.5.2.1
--- src/distrib/sun3/miniroot/install.md:1.5	Wed Apr 10 14:52:53 2019
+++ src/distrib/sun3/miniroot/install.md	Mon Dec 14 17:26:37 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: install.md,v 1.5 2019/04/10 14:52:53 christos Exp $
+#	$NetBSD: install.md,v 1.5.2.1 2020/12/14 17:26:37 martin Exp $
 #
 #
 # Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
 
 # Machine-dependent install sets
 # MDSETS="xbin xman xinc xcon" XXX
-MDSETS=""
+MDSETS="kern-GENERIC kern-GENERIC3X xbase xcomp xetc xfont xserver"
 
 md_set_term() {
 	if [ ! -z "$TERM" ]; then
@@ -146,7 +146,7 @@ md_copy_kernel() {
 md_welcome_banner() {
 	if [ "$MODE" = "install" ]; then
 		echo ""
-		echo "Welcome to the NetBSD/sun3 ${VERSION} installation program."
+		echo "Welcome to the NetBSD/${MACHINE} ${RELEASE} installation program."
 		cat << \__welcome_banner_1
 
 This program is designed to help you put NetBSD on your disk,
@@ -157,7 +157,7 @@ __welcome_banner_1
 
 	else
 		echo ""
-		echo "Welcome to the NetBSD/sun3 ${VERSION} upgrade program."
+		echo "Welcome to the NetBSD/${MACHINE} ${RELEASE} upgrade program."
 		cat << \__welcome_banner_2
 
 This program is designed to help you upgrade your NetBSD system in a

Reply via email to