Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/distrib miniroot changes:



details:   https://anonhg.NetBSD.org/src/rev/bed62ecd80af
branches:  trunk
changeset: 474066:bed62ecd80af
user:      mrg <mrg%NetBSD.org@localhost>
date:      Sun Jun 27 12:55:58 1999 +0000

description:
miniroot changes:
    install.sub:
        - fix interface grovelling, ifmedia support, allow ifmedia and link
          to have a "none" (-> "") answer (which lets you give nothing when
          a default answer is given)
        - allow installing more than one set at a time, including "all" as
          a synonym for all remaining sets
        - mount -o async when extracting sets
    makeconf.awk:
        - put default "libs" section at the end rather than the start, so
          you can put other "libs" in before this list
        - minor cleanup

    mtree.conf:
        - create /kern

    sparc install.md:
        - MDSETS are now "kern xbase xcomp xcontrib xfont xserver"
        - use /kern & kernfs (replaces dmesg)
        - replace grep & cut pipe lines with sed
        - replace grep hackery with sed hackery
        - grep and cut are no longer required!  yay!
        - deal with no /usr/bin/vi -- call disklabel -i
        - in md_copy_kern() link the netbsd.GENERIC we got from the kern set,
          rather than the miniroot kernel
    sparc miniroot list:
        - no more dmesg, cut or grep

sparc ramdisk changes:
    Makefile:
        - `ramdiskbin.conf' is now generated by makeconf.awk
        - don't use libhack's opendir, it breaks
    dot.profile:
        - don't assume terminal is `sun'
        - set EDITOR=ed
        -
    list:
        - instbin -> ramdiskbin to make `makeconf.awk' work
        - CRUNCHSPECIAL those special dirs
        - add our LIBS as necessary

libhack changes:
        - if NOLIBHACKOPENDIR is set, don't build opendir.o

diffstat:

 distrib/miniroot/install.sub          |   87 ++++++++++++--------
 distrib/miniroot/makeconf.awk         |   17 +--
 distrib/miniroot/mtree.conf           |    7 +-
 distrib/sparc/install.md              |   40 ++++++---
 distrib/sparc/miniroot/list           |    6 +-
 distrib/sparc/ramdisk/Makefile        |   11 +-
 distrib/sparc/ramdisk/dot.profile     |    6 +-
 distrib/sparc/ramdisk/list            |  141 ++++++++++++++++++---------------
 distrib/sparc/ramdisk/ramdiskbin.conf |   41 ---------
 distrib/utils/libhack/Makefile        |    7 +-
 distrib/utils/libhack/Makefile.inc    |    7 +-
 11 files changed, 193 insertions(+), 177 deletions(-)

diffs (truncated from 661 to 300 lines):

diff -r 75386e68df15 -r bed62ecd80af distrib/miniroot/install.sub
--- a/distrib/miniroot/install.sub      Sun Jun 27 12:47:52 1999 +0000
+++ b/distrib/miniroot/install.sub      Sun Jun 27 12:55:58 1999 +0000
@@ -1,5 +1,5 @@
 #!/bin/sh
-#      $NetBSD: install.sub,v 1.28 1999/05/16 20:42:27 is Exp $
+#      $NetBSD: install.sub,v 1.29 1999/06/27 12:55:58 mrg Exp $
 #
 # Copyright (c) 1996 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -374,6 +374,7 @@
        local _interface_mediumtype
        local _interface_supported_media
        local _m
+       local _t
 
        _interface_name=$1
        _up=DOWN
@@ -382,21 +383,28 @@
        fi
 
        _interface_supported_media=`ifconfig -m $_interface_name | sed -n '
-               3s/supported media: //p'`
+               /^[     ]*media autoselect/d
+               4,$s/[  ]*media //p'`
+
+       # get current "media" "ip" and "netmask" ("broadcast")
+       _t=`ifconfig $_interface_name | sed -n '
+               s/^[    ]*media: [^     ]* \([^ ][^ ]*\).*/\1/p'`
+
+       if [ "$_t" != "manual" -a "$_t" != "media:" -a "$_t" != "autoselect" ];
+       then
+               _interface_mediumtype=$1
+       fi
 
        set -- `ifconfig $_interface_name | sed -n '
-               2s/media: \([^ ][^ ]*\).*/\1/p
-               3s/inet//
-               3s/--> [0-9.][0-9.]*//
-               3s/netmask//
-               3s/broadcast//
-               3p'`
+               /^[     ]*inet/{
+               s/inet//
+               s/--> [0-9.][0-9.]*//
+               s/netmask//
+               s/broadcast//
+               p;}'`
 
-       if [ "$1" != "manual" ]; then
-               _interface_mediumtype=$1
-       fi
-       _interface_ip=$2
-       _interface_mask=$3
+       _interface_ip=$1
+       _interface_mask=$2
 
        # Get IP address
        resp=""         # force one iteration
@@ -424,11 +432,11 @@
 
        echo "Your network interface might require explicit selection"
        echo "of the type of network medium attached. Supported media:"
-       echo " $_interface_supported_media."
-       echo -n "Additional media type arguments? [$_interface_mediumtype] "
+       echo "$_interface_supported_media"
+       echo -n "Additional media type arguments (none)? [$_interface_mediumtype] "
        getresp "$_interface_mediumtype"
        _m=""
-       if [ "X${resp}" != X"" ]; then
+       if [ "X${resp}" != X"" -a "X${resp}" != Xnone ]; then
                _interface_mediumtype=$resp
                _m="media ${resp}"
        fi
@@ -438,9 +446,9 @@
        echo "directives (like \`link0'). If this is the case you can enter"
        echo "these at the next prompt."
        echo ""
-       echo -n "Additional link-layer arguments? [$_interface_extra] "
+       echo -n "Additional link-layer arguments (none)? [$_interface_extra] "
        getresp "$_interface_extra"
-       if [ "X${resp}" != X"" ]; then
+       if [ "X${resp}" != X"" -a "X${resp}" != Xnone ]; then
                _interface_extra=$resp
        fi
 
@@ -749,6 +757,7 @@
        local _filename
        local _sets
        local _next
+       local _all
        local _f
        local _dirname
 
@@ -803,13 +812,17 @@
                echo ""
 
                _next=""
+               _all=""
                for _f in $_sets ; do
                        if isin $_f $_setsdone; then
                                echo -n "[X] "
                                _next=""
                        else
                                echo -n "    "
-                               if [ -z "$_next" ]; then _next=$_f; fi
+                               if [ -z "$_next" ]; then
+                                       _next=$_f;
+                               fi
+                               _all="$_all $_f"
                        fi
                        echo $_f
                done
@@ -823,26 +836,32 @@
                        break
                fi
 
-               echo -n "File name [$_next]? "
+               echo -n "File name(s) (or "all") [$_next]? "
                getresp "$_next"
-               _f=$resp
-               _filename="/${_dirname}/$_f"
+               if [ "x$resp" = xall ]; then
+                       resp="$_all"
+               fi
 
-               # Ensure file exists
-               if [ ! -f $_filename ]; then
-                       if [ -f ${_filename}.aa ]; then
-                               _filename=${_filename}.\?\?
-                       else
+               for _f in $resp; do
+                       _filename="/${_dirname}/$_f"
+
+                       # Ensure file exists
+                       if [ ! -f $_filename ]; then
+                               if [ -f ${_filename}.aa ]; then
+                                       _filename=${_filename}.\?\?
+                               else
                         echo "File $_filename does not exist.  Check to make"
                         echo "sure you entered the information properly."
-                        continue
+                        continue 2
+                               fi
                        fi
-               fi
 
-               # Extract file
-               cat $_filename | (cd /mnt; pax -zrvpe)
-               echo "Extraction complete."
-               _setsdone="$_f $_setsdone"
+                       # Extract file
+                       echo "Extracting the $_f set:"
+                       cat $_filename | (cd /mnt; pax -zrvpe)
+                       echo "Extraction complete."
+                       _setsdone="$_f $_setsdone"
+               done
 
        done
 }
@@ -1389,7 +1408,7 @@
                # Mount the filesystem.  If the mount fails, exit
                # with an error condition to tell the outer
                # later to bail.
-               if ! mount -v -t $_fstype -o $_opt $_dev $_mp ; then
+               if ! mount -v -t $_fstype -o async -o $_opt $_dev $_mp ; then
                        # error message displated by mount
                        exit 1
                fi
diff -r 75386e68df15 -r bed62ecd80af distrib/miniroot/makeconf.awk
--- a/distrib/miniroot/makeconf.awk     Sun Jun 27 12:47:52 1999 +0000
+++ b/distrib/miniroot/makeconf.awk     Sun Jun 27 12:55:58 1999 +0000
@@ -1,21 +1,15 @@
-#      $NetBSD: makeconf.awk,v 1.5 1999/03/23 10:20:01 leo Exp $
+#      $NetBSD: makeconf.awk,v 1.6 1999/06/27 12:55:58 mrg Exp $
 
 #
 # generate crunchgen(1) configuration file from `list' spec.
 #
 
 BEGIN {
-       printf("#\n# This file is automatically generated by `makeconf'\n#\n\n");
-       printf("\nlibs -lrmt -ledit -lutil -lcurses -ltermcap -lcrypt -ll -lm -lkvm\n");
-
+       printf("#\n# This file is automatically generated by `makeconf'\n");
+       printf("#\n\n");
 }
 
-$1 == "SRCDIRS" {
-       $1 = tolower($1);
-       print;
-}
-
-$1 == "LIBS" {
+$1 == "LIBS" || $1 == "SRCDIRS" {
        $1 = tolower($1);
        print;
 }
@@ -48,6 +42,9 @@
 END {
        # write crunchgen configuration
 
+       # default libs
+       printf("\nlibs -lrmt -ledit -lutil -lcurses -ltermcap -lcrypt -ll -lm -lkvm\n");
+
        # `prog' directives; print 8 to a line
        column = 0;
        for (p in progs) {
diff -r 75386e68df15 -r bed62ecd80af distrib/miniroot/mtree.conf
--- a/distrib/miniroot/mtree.conf       Sun Jun 27 12:47:52 1999 +0000
+++ b/distrib/miniroot/mtree.conf       Sun Jun 27 12:55:58 1999 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: mtree.conf,v 1.4 1997/09/09 23:02:06 is Exp $
+#      $NetBSD: mtree.conf,v 1.5 1999/06/27 12:55:58 mrg Exp $
 
 /set type=dir uname=root gname=wheel mode=0755
 # .
@@ -19,6 +19,11 @@
 # ./etc
 ..
 
+# ./kern
+kern
+# ./kern
+..
+
 # ./mnt
 mnt
 # ./mnt
diff -r 75386e68df15 -r bed62ecd80af distrib/sparc/install.md
--- a/distrib/sparc/install.md  Sun Jun 27 12:47:52 1999 +0000
+++ b/distrib/sparc/install.md  Sun Jun 27 12:55:58 1999 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: install.md,v 1.11 1997/10/09 07:25:53 jtc Exp $
+#      $NetBSD: install.md,v 1.12 1999/06/27 12:55:59 mrg Exp $
 #
 #
 # Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -41,12 +41,15 @@
 #
 
 # Machine-dependent install sets
-MDSETS="xbin xman xinc xcon"
+MDSETS="kern xbase xcomp xcontrib xfont xserver"
 
 if [ "$MODE" = upgrade ]; then
        RELOCATED_FILES_13="${RELOCATED_FILES_13} /usr/sbin/installboot /usr/mdec/installboot"
 fi
 
+# Mount /kern to get at /kern/msgbuf
+mount -t kernfs none /kern
+
 md_set_term() {
        if [ ! -z "$TERM" ]; then
                return
@@ -78,17 +81,17 @@
 
 md_get_diskdevs() {
        # return available disk devices
-       dmesg | egrep "(^sd[0-9] |^x[dy][0-9] )" | cut -d" " -f1 | sort -u
+       < /kern/msgbuf sed -n -e 's/^\(sd[0-9]\) .*/\1/p' -e 's/^\(x[dy][0-9]\) .*/\1/p' | sort -u
 }
 
 md_get_cddevs() {
        # return available CDROM devices
-       dmesg | grep "^cd[0-9] " | cut -d" " -f1 | sort -u
+       < /kern/msgbuf sed -n -e 's/^\(cd[0-9]\) .*/\1/p' | sort -u
 }
 
 md_get_ifdevs() {
        # return available network devices
-       dmesg | egrep "(^le[0-9] |^ie[0-9] )" | cut -d" " -f1 | sort -u
+       < /kern/msgbuf sed -n -e 's/^\(le[0-9]\) .*/\1/p' -e 's/^\(ie[0-9]\) .*/\1/p' | sort -u
 }
 
 md_get_partition_range() {
@@ -110,17 +113,20 @@
 md_checkfordisklabel() {
        # $1 is the disk to check
        local rval
+       local cfdl
 
-       disklabel $1 > /dev/null 2> /tmp/checkfordisklabel
-       if grep "no disk label" /tmp/checkfordisklabel; then
+       cfdl=`disklabel $1 2>&1 > /dev/null | \
+           sed -n -e '/no disk label/{s/.*/ndl/p;q;}; \
+                /disk label corrupted/{s/.*/dlc/p;q;}; \
+                $s/.*/no/p'`
+       if [ x$cfdl = xndl ]; then
                rval=1
-       elif grep "disk label corrupted" /tmp/checkfordisklabel; then
+       elif [ x$cfdl = xdlc ]; then
                rval=2
        else
                rval=0
        fi
 
-       rm -f /tmp/checkfordisklabel
        return $rval
 }



Home | Main Index | Thread Index | Old Index