Source-Changes-HG archive

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

[src/trunk]: src/etc/etc.sun2 Added support for the __ramdisk pseudo-argument...



details:   https://anonhg.NetBSD.org/src/rev/7a4d5f9f8ff8
branches:  trunk
changeset: 525979:7a4d5f9f8ff8
user:      fredette <fredette%NetBSD.org@localhost>
date:      Mon Apr 22 21:09:14 2002 +0000

description:
Added support for the __ramdisk pseudo-argument.  When given,
we make fewer devices to conserve inodes on the ramdisk.

diffstat:

 etc/etc.sun2/MAKEDEV |  20 +++++++++++++++++---
 1 files changed, 17 insertions(+), 3 deletions(-)

diffs (56 lines):

diff -r 369b98cf1ab5 -r 7a4d5f9f8ff8 etc/etc.sun2/MAKEDEV
--- a/etc/etc.sun2/MAKEDEV      Mon Apr 22 21:07:47 2002 +0000
+++ b/etc/etc.sun2/MAKEDEV      Mon Apr 22 21:09:14 2002 +0000
@@ -1,6 +1,6 @@
 #!/bin/sh -
 #
-#      $NetBSD: MAKEDEV,v 1.11 2002/03/13 01:27:03 simonb Exp $
+#      $NetBSD: MAKEDEV,v 1.12 2002/04/22 21:09:14 fredette Exp $
 #
 # Copyright (c) 1990 The Regents of the University of California.
 # All rights reserved.
@@ -74,6 +74,11 @@
 # set this to echo for Echo-Only debugging
 eo=
 
+# when we're making devices for the ramdisk, we conserve
+# inodes by not making block devices or devices for 
+# partitions greater than d:
+__ramdisk=false
+
 # mk name b/c major minor [mode] [group]
 mk() {
        $eo rm -f $1
@@ -213,14 +218,18 @@
          [0-7]) offset=$(($unit * 8));;
          *) echo bad unit for $name in: $arg;;
        esac
-       for part in a.0 b.1 c.2 d.3 e.4 f.5 g.6 h.7
+       parts="a.0 b.1 c.2 d.3"
+       if ! $__ramdisk; then parts="$parts e.4 f.5 g.6 h.7"; fi
+       for part in $parts
        do
        (
                tmp="$IFS" ; IFS="$IFS."
                set -- $part
                IFS="$tmp" ; unset tmp
                minor=$(($offset + $2))
-               mk  $name$unit$1 b $blk $minor 640 operator
+               if ! $__ramdisk; then 
+                       mk  $name$unit$1 b $blk $minor 640 operator
+               fi
                mk r$name$unit$1 c $chr $minor 640 operator
        )
        done
@@ -275,6 +284,11 @@
        sh $0.local all
        umask 77
        ;;
+
+__ramdisk)
+       __ramdisk=true
+       ;;
+
 *)
        echo $arg: unknown device
        ;;



Home | Main Index | Thread Index | Old Index