CVS commit: src/distrib/miniroot

2021-06-18 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat Jun 19 00:54:27 UTC 2021

Modified Files:
src/distrib/miniroot: install.sub

Log Message:
The modules and rescue sets are also required on upgrade.

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


To generate a diff of this commit:
cvs rdiff -u -r1.61 -r1.62 src/distrib/miniroot/install.sub

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

Modified files:

Index: src/distrib/miniroot/install.sub
diff -u src/distrib/miniroot/install.sub:1.61 src/distrib/miniroot/install.sub:1.62
--- src/distrib/miniroot/install.sub:1.61	Sat Jun 19 00:00:26 2021
+++ src/distrib/miniroot/install.sub	Sat Jun 19 00:54:27 2021
@@ -1,5 +1,5 @@
 #!/bin/sh
-#	$NetBSD: install.sub,v 1.61 2021/06/19 00:00:26 tsutsui Exp $
+#	$NetBSD: install.sub,v 1.62 2021/06/19 00:54:27 tsutsui Exp $
 #
 # Copyright (c) 1996 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -40,7 +40,7 @@ RELEASE=10.0# updated by distrib/min
 export RELEASE
 
 ALLSETS="base comp etc games man misc modules rescue text"	# default install sets
-UPGRSETS="base comp games man misc text"		# default upgrade sets
+UPGRSETS="base comp games man misc modules rescue text"		# default upgrade sets
 THESETS=		# one of the above
 
 local_sets_dir=""			# Path searched for sets by install_sets



CVS commit: src/distrib/miniroot

2021-06-18 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat Jun 19 00:00:27 UTC 2021

Modified Files:
src/distrib/miniroot: install.sub

Log Message:
Remove netstat(1) calls to print resolver info on upgrade using miniroot.

netstat(1) was removed from miniroot 25 years ago.
 http://cvsweb.netbsd.org/bsdweb.cgi/src/distrib/miniroot/list#rev1.5


To generate a diff of this commit:
cvs rdiff -u -r1.60 -r1.61 src/distrib/miniroot/install.sub

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

Modified files:

Index: src/distrib/miniroot/install.sub
diff -u src/distrib/miniroot/install.sub:1.60 src/distrib/miniroot/install.sub:1.61
--- src/distrib/miniroot/install.sub:1.60	Sat May 29 23:46:14 2021
+++ src/distrib/miniroot/install.sub	Sat Jun 19 00:00:26 2021
@@ -1,5 +1,5 @@
 #!/bin/sh
-#	$NetBSD: install.sub,v 1.60 2021/05/29 23:46:14 tsutsui Exp $
+#	$NetBSD: install.sub,v 1.61 2021/06/19 00:00:26 tsutsui Exp $
 #
 # Copyright (c) 1996 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -606,12 +606,8 @@ fi
 	echo	""
 
 	if [ "${_resolver_enabled:-FALSE}" = "TRUE" ]; then
-		netstat -r
-		echo	""
 		echo	"Resolver enabled."
 	else
-		netstat -rn
-		echo	""
 		echo	"Resolver not enabled."
 	fi
 



CVS commit: src/distrib/miniroot

2021-05-29 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat May 29 23:46:14 UTC 2021

Modified Files:
src/distrib/miniroot: install.sub

Log Message:
Handle recent ifconfig(8) outputs in the miniroot installation script.

- Remove netmask slash notation for IP addresses,
  which has been changed between NetBSD 7.x and 8.0:
  http://cvsweb.netbsd.org/bsdweb.cgi/src/sbin/ifconfig/af_inet.c#rev1.24
- Ignore inet6 entries, which miniroot scripts don't support

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


To generate a diff of this commit:
cvs rdiff -u -r1.59 -r1.60 src/distrib/miniroot/install.sub

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

Modified files:

Index: src/distrib/miniroot/install.sub
diff -u src/distrib/miniroot/install.sub:1.59 src/distrib/miniroot/install.sub:1.60
--- src/distrib/miniroot/install.sub:1.59	Sat Dec 12 05:23:21 2020
+++ src/distrib/miniroot/install.sub	Sat May 29 23:46:14 2021
@@ -1,5 +1,5 @@
 #!/bin/sh
-#	$NetBSD: install.sub,v 1.59 2020/12/12 05:23:21 tsutsui Exp $
+#	$NetBSD: install.sub,v 1.60 2021/05/29 23:46:14 tsutsui Exp $
 #
 # Copyright (c) 1996 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -403,8 +403,9 @@ configure_ifs() {
 	fi
 
 	set -- $(ifconfig $_interface_name | sed -n '
-		/^[ 	]*inet/{
+		/^[ 	]*inet /{
 		s/inet//
+		s,/[0-9]*,,
 		s/--> [0-9.][0-9.]*//
 		s/netmask//
 		s/broadcast//



CVS commit: src/distrib/miniroot

2020-12-11 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat Dec 12 05:23:21 UTC 2020

Modified Files:
src/distrib/miniroot: install.sub

Log Message:
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.


To generate a diff of this commit:
cvs rdiff -u -r1.58 -r1.59 src/distrib/miniroot/install.sub

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

Modified files:

Index: src/distrib/miniroot/install.sub
diff -u src/distrib/miniroot/install.sub:1.58 src/distrib/miniroot/install.sub:1.59
--- src/distrib/miniroot/install.sub:1.58	Sat Dec  5 18:57:21 2020
+++ src/distrib/miniroot/install.sub	Sat Dec 12 05:23:21 2020
@@ -1,5 +1,5 @@
 #!/bin/sh
-#	$NetBSD: install.sub,v 1.58 2020/12/05 18:57:21 tsutsui Exp $
+#	$NetBSD: install.sub,v 1.59 2020/12/12 05:23:21 tsutsui Exp $
 #
 # Copyright (c) 1996 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -725,6 +725,15 @@ __install_ftp_2
 		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:"
@@ -745,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"
@@ -756,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."
@@ -765,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."
 }
 



CVS commit: src/distrib/miniroot

2020-12-05 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat Dec  5 18:57:21 UTC 2020

Modified Files:
src/distrib/miniroot: install.sub

Log Message:
Inform the default installation directory in the official ftp server.


To generate a diff of this commit:
cvs rdiff -u -r1.57 -r1.58 src/distrib/miniroot/install.sub

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

Modified files:

Index: src/distrib/miniroot/install.sub
diff -u src/distrib/miniroot/install.sub:1.57 src/distrib/miniroot/install.sub:1.58
--- src/distrib/miniroot/install.sub:1.57	Sat Dec  5 18:52:06 2020
+++ src/distrib/miniroot/install.sub	Sat Dec  5 18:57:21 2020
@@ -1,5 +1,5 @@
 #!/bin/sh
-#	$NetBSD: install.sub,v 1.57 2020/12/05 18:52:06 tsutsui Exp $
+#	$NetBSD: install.sub,v 1.58 2020/12/05 18:57:21 tsutsui Exp $
 #
 # Copyright (c) 1996 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -682,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



CVS commit: src/distrib/miniroot

2020-12-05 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat Dec  5 18:33:47 UTC 2020

Modified Files:
src/distrib/miniroot: install.sub

Log Message:
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.


To generate a diff of this commit:
cvs rdiff -u -r1.55 -r1.56 src/distrib/miniroot/install.sub

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

Modified files:

Index: src/distrib/miniroot/install.sub
diff -u src/distrib/miniroot/install.sub:1.55 src/distrib/miniroot/install.sub:1.56
--- src/distrib/miniroot/install.sub:1.55	Sat Dec  5 18:29:50 2020
+++ src/distrib/miniroot/install.sub	Sat Dec  5 18:33:47 2020
@@ -1,5 +1,5 @@
 #!/bin/sh
-#	$NetBSD: install.sub,v 1.55 2020/12/05 18:29:50 tsutsui Exp $
+#	$NetBSD: install.sub,v 1.56 2020/12/05 18:33:47 tsutsui Exp $
 #
 # Copyright (c) 1996 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -713,7 +713,7 @@ __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



CVS commit: src/distrib/miniroot

2020-12-05 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat Dec  5 18:29:50 UTC 2020

Modified Files:
src/distrib/miniroot: install.sub

Log Message:
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.


To generate a diff of this commit:
cvs rdiff -u -r1.54 -r1.55 src/distrib/miniroot/install.sub

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

Modified files:

Index: src/distrib/miniroot/install.sub
diff -u src/distrib/miniroot/install.sub:1.54 src/distrib/miniroot/install.sub:1.55
--- src/distrib/miniroot/install.sub:1.54	Sat Dec  5 18:24:10 2020
+++ src/distrib/miniroot/install.sub	Sat Dec  5 18:29:50 2020
@@ -1,5 +1,5 @@
 #!/bin/sh
-#	$NetBSD: install.sub,v 1.54 2020/12/05 18:24:10 tsutsui Exp $
+#	$NetBSD: install.sub,v 1.55 2020/12/05 18:29:50 tsutsui Exp $
 #
 # Copyright (c) 1996 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -1611,6 +1611,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
 }



CVS commit: src/distrib/miniroot

2020-12-05 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat Dec  5 18:24:10 UTC 2020

Modified Files:
src/distrib/miniroot: install.sub

Log Message:
Add modules set for default sets on miniroot installation.

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


To generate a diff of this commit:
cvs rdiff -u -r1.53 -r1.54 src/distrib/miniroot/install.sub

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

Modified files:

Index: src/distrib/miniroot/install.sub
diff -u src/distrib/miniroot/install.sub:1.53 src/distrib/miniroot/install.sub:1.54
--- src/distrib/miniroot/install.sub:1.53	Sun Jan 19 00:57:00 2020
+++ src/distrib/miniroot/install.sub	Sat Dec  5 18:24:10 2020
@@ -1,5 +1,5 @@
 #!/bin/sh
-#	$NetBSD: install.sub,v 1.53 2020/01/19 00:57:00 kre Exp $
+#	$NetBSD: install.sub,v 1.54 2020/12/05 18:24:10 tsutsui Exp $
 #
 # Copyright (c) 1996 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -35,7 +35,7 @@ ROOTDISK=""# filled in below
 VERSION=89936
 export VERSION
 
-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
 



CVS commit: src/distrib/miniroot

2020-01-18 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Sun Jan 19 00:57:00 UTC 2020

Modified Files:
src/distrib/miniroot: install.sub

Log Message:
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.


To generate a diff of this commit:
cvs rdiff -u -r1.52 -r1.53 src/distrib/miniroot/install.sub

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

Modified files:

Index: src/distrib/miniroot/install.sub
diff -u src/distrib/miniroot/install.sub:1.52 src/distrib/miniroot/install.sub:1.53
--- src/distrib/miniroot/install.sub:1.52	Sun Jan 19 00:50:25 2020
+++ src/distrib/miniroot/install.sub	Sun Jan 19 00:57:00 2020
@@ -1,5 +1,5 @@
 #!/bin/sh
-#	$NetBSD: install.sub,v 1.52 2020/01/19 00:50:25 kre Exp $
+#	$NetBSD: install.sub,v 1.53 2020/01/19 00:57:00 kre Exp $
 #
 # Copyright (c) 1996 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -523,7 +523,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 +555,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
@@ -1047,7 +1047,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_"



CVS commit: src/distrib/miniroot

2020-01-18 Thread Robert Elz
Module Name:src
Committed By:   kre
Date:   Sun Jan 19 00:50:25 UTC 2020

Modified Files:
src/distrib/miniroot: install.sub

Log Message:
The idiom

set $whatever
while [ $# - gt 10 ]; do shift 10; done
eval echo \$$#

fails when $# turns out to be 10 (or any multiple), it would need
to be instead

while [ $# -ge 10 ]; do shift 9; done

but there hasn't been a shell that cannot handle ${10} (etc) correctly
in a very long time, so let's just use that instead (properly quoted,
in case IFS happens to contain a digit for some bizarre reason).

We should also "set -f" / "set +f" (or better, restore the prev setting of -f)
around the "set $whatever" part, but if that was ever going to cause a problem
here, it would have already, so leave that for now.


To generate a diff of this commit:
cvs rdiff -u -r1.51 -r1.52 src/distrib/miniroot/install.sub

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

Modified files:

Index: src/distrib/miniroot/install.sub
diff -u src/distrib/miniroot/install.sub:1.51 src/distrib/miniroot/install.sub:1.52
--- src/distrib/miniroot/install.sub:1.51	Sun Jan 12 03:56:14 2020
+++ src/distrib/miniroot/install.sub	Sun Jan 19 00:50:25 2020
@@ -1,5 +1,5 @@
 #!/bin/sh
-#	$NetBSD: install.sub,v 1.51 2020/01/12 03:56:14 tsutsui Exp $
+#	$NetBSD: install.sub,v 1.52 2020/01/19 00:50:25 kre Exp $
 #
 # Copyright (c) 1996 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -114,8 +114,7 @@ cutlast () {
 	read _a; set -- $_a
 	IFS="$_oifs"
 	if [ "$1" = "" ]; then return; fi
-	while [ "$#" -gt 10 ]; do shift 10; done
-	eval echo \$$#
+	eval echo '"${'"$#"'}"'
 }
 
 firstchar () {
@@ -135,8 +134,7 @@ basename () {
 	IFS="/"
 	set -- $1
 	IFS="$_oifs"
-	while [ "$#" -gt 10 ]; do shift 10; done
-	eval echo \$$#
+	eval echo '"${'"$#"'}"'
 }
 
 dir_has_sets() {



CVS commit: src/distrib/miniroot

2020-01-11 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sun Jan 12 03:56:14 UTC 2020

Modified Files:
src/distrib/miniroot: install.sub

Log Message:
Fix "[: SMALL test, no fallback usage" error on miniroot installation.

Avoid and replace use of '-a', '(' and ')' operatos marked obsolescent
by modern POSIX.1-2017:
 
https://pubs.opengroup.org/onlinepubs/9699919799/utilities/test.html#tag_20_128_16
as suggested by kre@ in PR/54835.

Should be pulled up to netbsd-9.


To generate a diff of this commit:
cvs rdiff -u -r1.50 -r1.51 src/distrib/miniroot/install.sub

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

Modified files:

Index: src/distrib/miniroot/install.sub
diff -u src/distrib/miniroot/install.sub:1.50 src/distrib/miniroot/install.sub:1.51
--- src/distrib/miniroot/install.sub:1.50	Sun Jan 12 03:37:10 2020
+++ src/distrib/miniroot/install.sub	Sun Jan 12 03:56:14 2020
@@ -1,5 +1,5 @@
 #!/bin/sh
-#	$NetBSD: install.sub,v 1.50 2020/01/12 03:37:10 tsutsui Exp $
+#	$NetBSD: install.sub,v 1.51 2020/01/12 03:56:14 tsutsui Exp $
 #
 # Copyright (c) 1996 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -1531,7 +1531,7 @@ unmount_fs()
 		_fstab=$1
 	fi
 
-	if [ ! \( -f $_fstab -a -s $_fstab \) ]; then
+	if ! [ -f "${_fstab}" ] || ! [ -s "${_fstab}" ]; then
 		echo "fstab empty" > /dev/tty
 		return
 	fi



CVS commit: src/distrib/miniroot

2020-01-11 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sun Jan 12 03:37:10 UTC 2020

Modified Files:
src/distrib/miniroot: install.sub

Log Message:
Fix miniroot installation failure on network configuration.  PR/54833

No particular comment in the PR.
Should be pulled up to netbsd-9.


To generate a diff of this commit:
cvs rdiff -u -r1.49 -r1.50 src/distrib/miniroot/install.sub

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

Modified files:

Index: src/distrib/miniroot/install.sub
diff -u src/distrib/miniroot/install.sub:1.49 src/distrib/miniroot/install.sub:1.50
--- src/distrib/miniroot/install.sub:1.49	Wed Oct  2 11:15:59 2019
+++ src/distrib/miniroot/install.sub	Sun Jan 12 03:37:10 2020
@@ -1,5 +1,5 @@
 #!/bin/sh
-#	$NetBSD: install.sub,v 1.49 2019/10/02 11:15:59 maya Exp $
+#	$NetBSD: install.sub,v 1.50 2020/01/12 03:37:10 tsutsui Exp $
 #
 # Copyright (c) 1996 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -429,7 +429,7 @@ configure_ifs() {
 
 	# Get netmask
 	resp=""		# force one iteration
-	while [ -n "${resp}" ]; do
+	while [ -z "${resp}" ]; do
 		echo -n "Netmask? [$_interface_mask] "
 		getresp "$_interface_mask"
 		_interface_mask=$resp



CVS commit: src/distrib/miniroot

2019-04-04 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Apr  4 20:51:35 UTC 2019

Modified Files:
src/distrib/miniroot: install.sh install.sub upgrade.sh

Log Message:
eXorcize and `` -> $()


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/distrib/miniroot/install.sh
cvs rdiff -u -r1.46 -r1.47 src/distrib/miniroot/install.sub
cvs rdiff -u -r1.23 -r1.24 src/distrib/miniroot/upgrade.sh

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

Modified files:

Index: src/distrib/miniroot/install.sh
diff -u src/distrib/miniroot/install.sh:1.26 src/distrib/miniroot/install.sh:1.27
--- src/distrib/miniroot/install.sh:1.26	Sun Sep 16 17:32:29 2018
+++ src/distrib/miniroot/install.sh	Thu Apr  4 16:51:35 2019
@@ -1,5 +1,5 @@
 #!/bin/sh
-#	$NetBSD: install.sh,v 1.26 2018/09/16 21:32:29 kre Exp $
+#	$NetBSD: install.sh,v 1.27 2019/04/04 20:51:35 christos Exp $
 #
 # Copyright (c) 1996,1997,1999,2000,2006 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -64,8 +64,8 @@ MODE="install"
 
 # we need to make sure .'s below work if this directory is not in $PATH
 # dirname may not be available but expr is
-Mydir=`expr $0 : '^\(.*\)/[^/]*$'`
-Mydir=`cd ${Mydir:-.}; pwd`
+Mydir=$(expr $0 : '^\(.*\)/[^/]*$')
+Mydir=$(cd ${Mydir:-.}; pwd)
 
 # this is the most likely place to find the binary sets
 # so save them having to type it in
@@ -114,7 +114,7 @@ echo "# disktab" > /tmp/disktab.shadow
 
 test "$md_view_labels_possible" && md_view_labels
 
-while [ "X${ROOTDISK}" = "X" ]; do
+while [ -z "${ROOTDISK}" ]; do
 	getrootdisk
 done
 
@@ -144,8 +144,8 @@ echo	"	${ROOTDISK}a	/"
 
 echo	"${ROOTDISK}a	/" > ${FILESYSTEMS}
 
-resp="X"	# force at least one iteration
-while [ "X$resp" != X"done" ]; do
+resp="not-done"	# force at least one iteration
+while [ "$resp" != "done" ]; do
 	echo	""
 	echo -n	"Device name? [RETURN if you already entered all devices] "
 	getresp "done"
@@ -154,19 +154,19 @@ while [ "X$resp" != X"done" ]; do
 		;;
 
 	*)
-		_device_name=`basename $resp`
+		_device_name=$(basename $resp)
 
 		# force at least one iteration
 		_first_char="X"
-		while [ "X${_first_char}" != X"/" ]; do
+		while [ "${_first_char}" != "/" ]; do
 			echo -n "Mount point? "
 			getresp ""
 			_mount_point=$resp
-			if [ "X${_mount_point}" = X"/" ]; then
+			if [ "${_mount_point}" = "/" ]; then
 # Invalid response; no multiple roots
 _first_char="X"
 			else
-_first_char=`firstchar ${_mount_point}`
+_first_char=$(firstchar ${_mount_point})
 			fi
 		done
 		echo "${_device_name}	${_mount_point}" >> ${FILESYSTEMS}
@@ -177,7 +177,7 @@ done
 
 # configure swap
 resp=""		# force at least one iteration
-while [ "X${resp}" = X"" ]; do
+while [ -z "${resp}" ]; do
 	echo -n	"Ok to configure ${ROOTDISK}b as a swap device? [] "
 	getresp ""
 	case "$resp" in
@@ -236,10 +236,10 @@ case "$resp" in
 	y*|Y*)
 		resp=""		# force at least one iteration
 		if [ -f /etc/myname ]; then
-			resp=`cat /etc/myname`
+			resp=$(cat /etc/myname)
 		fi
 		echo -n "Enter system hostname: [$resp] "
-		while [ "X${resp}" = X"" ]; do
+		while [ -z "${resp}" ]; do
 			getresp "$resp"
 		done
 		hostname $resp
@@ -247,7 +247,7 @@ case "$resp" in
 
 		echo -n "Enter DNS domain name: "
 		getresp "none"
-		if [ "X${resp}" != X"none" ]; then
+		if [ "${resp:-none}" != "none" ]; then
 			FQDN=$resp
 		fi
 
@@ -255,7 +255,7 @@ case "$resp" in
 
 		echo -n "Enter IP address of default route: [none] "
 		getresp "none"
-		if [ "X${resp}" != X"none" ]; then
+		if [ "${resp:-none}" != "none" ]; then
 			route delete default > /dev/null 2>&1
 			if route add default $resp > /dev/null ; then
 echo $resp > /tmp/mygate
@@ -263,11 +263,11 @@ case "$resp" in
 		fi
 
 		resp="none"
-		if [ X${FQDN} != X ]; then
+		if [ -n "${FQDN}" ]; then
 			echo -n	"Enter IP address of primary nameserver: [none] "
 			getresp "none"
 		fi
-		if [ "X${resp}" != X"none" ]; then
+		if [ "${resp:-none}" != "none" ]; then
 			echo "domain $FQDN" > /tmp/resolv.conf
 			echo "nameserver $resp" >> /tmp/resolv.conf
 			echo "search $FQDN" >> /tmp/resolv.conf
@@ -427,7 +427,7 @@ install_sets
 		echo "No /dev/MAKEDEV installed, something is wrong here..."
 	else
 		echo -n "Making devices..."
-		pid=`twiddle`
+		pid=$(twiddle)
 		cd /mnt/dev
 		sh MAKEDEV all
 		kill $pid

Index: src/distrib/miniroot/install.sub
diff -u src/distrib/miniroot/install.sub:1.46 src/distrib/miniroot/install.sub:1.47
--- src/distrib/miniroot/install.sub:1.46	Tue Aug 15 05:49:38 2017
+++ src/distrib/miniroot/install.sub	Thu Apr  4 16:51:35 2019
@@ -1,5 +1,5 @@
 #!/bin/sh
-#	$NetBSD: install.sub,v 1.46 2017/08/15 09:49:38 mlelstv Exp $
+#	$NetBSD: install.sub,v 1.47 2019/04/04 20:51:35 christos Exp $
 #
 # Copyright (c) 1996 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -53,7 +53,7 @@ fi
 
 getresp() {
 	read resp
-	if [ "X$resp" = "X" ]; then
+	if [ -z "$resp" ]; then
 		resp=$1
 	fi
 }
@@ -243,7 +243,7 @@ pro

CVS commit: src/distrib/miniroot

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

Modified Files:
src/distrib/miniroot: install.sh upgrade.sh

Log Message:
Remove uses of test ... -a ... and test ... -o ...


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/distrib/miniroot/install.sh
cvs rdiff -u -r1.22 -r1.23 src/distrib/miniroot/upgrade.sh

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

Modified files:

Index: src/distrib/miniroot/install.sh
diff -u src/distrib/miniroot/install.sh:1.25 src/distrib/miniroot/install.sh:1.26
--- src/distrib/miniroot/install.sh:1.25	Sun Sep 20 22:44:06 2009
+++ src/distrib/miniroot/install.sh	Sun Sep 16 21:32:29 2018
@@ -1,5 +1,5 @@
 #!/bin/sh
-#	$NetBSD: install.sh,v 1.25 2009/09/20 22:44:06 abs Exp $
+#	$NetBSD: install.sh,v 1.26 2018/09/16 21:32:29 kre Exp $
 #
 # Copyright (c) 1996,1997,1999,2000,2006 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -377,7 +377,7 @@ mount_fs /tmp/fstab.shadow
 
 mount | while read line; do
 	set -- $line
-	if [ "$2" = "/" -a "$3" = "nfs" ]; then
+	if [ "$2" = "/" ] && [ "$3" = "nfs" ]; then
 		echo "You appear to be running diskless."
 		echo -n	"Are the install sets on one of your currently mounted filesystems? [n] "
 		getresp "n"

Index: src/distrib/miniroot/upgrade.sh
diff -u src/distrib/miniroot/upgrade.sh:1.22 src/distrib/miniroot/upgrade.sh:1.23
--- src/distrib/miniroot/upgrade.sh:1.22	Wed Apr 30 13:10:48 2008
+++ src/distrib/miniroot/upgrade.sh	Sun Sep 16 21:32:29 2018
@@ -1,5 +1,5 @@
 #!/bin/sh
-#	$NetBSD: upgrade.sh,v 1.22 2008/04/30 13:10:48 martin Exp $
+#	$NetBSD: upgrade.sh,v 1.23 2018/09/16 21:32:29 kre Exp $
 #
 # Copyright (c) 1996-2000,2006 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -238,8 +238,8 @@ esac
 (
 	> /tmp/fstab
 	while read _dev _mp _fstype _rest ; do
-		if [ "X${_fstype}" = X"ufs" -o \
-		 "X${_fstype}" = X"ffs" ]; then
+		if [ "X${_fstype}" = X"ufs" ] ||
+		   [ "X${_fstype}" = X"ffs" ]; then
 			if [ "X${_fstype}" = X"ufs" ]; then
 # Convert ufs to ffs.
 _fstype=ffs



CVS commit: src/distrib/miniroot

2017-08-15 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Tue Aug 15 09:49:38 UTC 2017

Modified Files:
src/distrib/miniroot: install.sub

Log Message:
Support installing from a CD9660 formatted disk partition.


To generate a diff of this commit:
cvs rdiff -u -r1.45 -r1.46 src/distrib/miniroot/install.sub

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

Modified files:

Index: src/distrib/miniroot/install.sub
diff -u src/distrib/miniroot/install.sub:1.45 src/distrib/miniroot/install.sub:1.46
--- src/distrib/miniroot/install.sub:1.45	Wed Apr 30 13:10:48 2008
+++ src/distrib/miniroot/install.sub	Tue Aug 15 09:49:38 2017
@@ -1,5 +1,5 @@
 #!/bin/sh
-#	$NetBSD: install.sub,v 1.45 2008/04/30 13:10:48 martin Exp $
+#	$NetBSD: install.sub,v 1.46 2017/08/15 09:49:38 mlelstv Exp $
 #
 # Copyright (c) 1996 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -1045,11 +1045,12 @@ mount_a_disk() {
 
 The following filesystem types are supported:
 	1) ffs
+	2) cd9660
 __mount_a_disk_2
 	_md_fstype=`md_native_fstype`
 	_md_fsopts=`md_native_fsopts`
 	if [ ! -z "$_md_fstype" ]; then
-		echo "	2) $_md_fstype"
+		echo "	3) $_md_fstype"
 	else
 		_md_fstype="_undefined_"
 	fi
@@ -1058,7 +1059,7 @@ __mount_a_disk_2
 		echo -n "Which filesystem type? [ffs] "
 		getresp "ffs"
 		case "$resp" in
-			ffs)
+			ffs|cd9660)
 _fstype=$resp
 _fsopts="ro"
 ;;



CVS commit: src/distrib/miniroot

2010-01-01 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat Jan  2 06:37:28 UTC 2010

Modified Files:
src/distrib/miniroot: list

Log Message:
Remove -ledit and -lmagic from LIBS.

No program requires -ledit in crunched SMALLPROG case, and
miniroot doesn't have /usr/bin/file which requires -lmagic.
(sparc had it but it was removed in distrib/sparc/miniroot/list rev 1.29)


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/distrib/miniroot/list

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

Modified files:

Index: src/distrib/miniroot/list
diff -u src/distrib/miniroot/list:1.29 src/distrib/miniroot/list:1.30
--- src/distrib/miniroot/list:1.29	Sun Sep 20 19:49:09 2009
+++ src/distrib/miniroot/list	Sat Jan  2 06:37:28 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: list,v 1.29 2009/09/20 19:49:09 abs Exp $
+#	$NetBSD: list,v 1.30 2010/01/02 06:37:28 tsutsui Exp $
 
 SRCDIRS bin sbin usr.bin usr.sbin gnu/usr.bin
 
@@ -58,7 +58,7 @@
 SPECIAL	route		srcdir	distrib/utils/x_route
 
 LIBS	libhack.o
-LIBS	-lrmt -ledit -lutil -lcurses -ltermcap -lbz2 -lcrypt -lintl -ll -lm -lkvm -lmagic -lz -lprop
+LIBS	-lrmt -lutil -lcurses -ltermcap -lbz2 -lcrypt -lintl -ll -lm -lkvm -lz -lprop
 
 # various files that we need in /etc for the install
 COPY	${NETBSDSRCDIR}/etc/group		etc/group