Source-Changes-HG archive

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

[src/trunk]: src/etc fix handling of ARM ports' majors file



details:   https://anonhg.NetBSD.org/src/rev/3eaf40febd3a
branches:  trunk
changeset: 554012:3eaf40febd3a
user:      jdolecek <jdolecek%NetBSD.org@localhost>
date:      Fri Oct 24 08:27:26 2003 +0000

description:
fix handling of ARM ports' majors file
fix handling of sbmips majors - it uses the evbmips majors

fetch information about platform RAW_PART, and make it available
to MAKEDEV.tmpl

diffstat:

 etc/MAKEDEV.awk |  33 +++++++++++++++++++--------------
 1 files changed, 19 insertions(+), 14 deletions(-)

diffs (76 lines):

diff -r 7845e0964b05 -r 3eaf40febd3a etc/MAKEDEV.awk
--- a/etc/MAKEDEV.awk   Fri Oct 24 08:20:26 2003 +0000
+++ b/etc/MAKEDEV.awk   Fri Oct 24 08:27:26 2003 +0000
@@ -1,6 +1,6 @@
 #!/usr/bin/awk -
 #
-#      $NetBSD: MAKEDEV.awk,v 1.5 2003/10/19 19:07:26 jdolecek Exp $
+#      $NetBSD: MAKEDEV.awk,v 1.6 2003/10/24 08:27:26 jdolecek Exp $
 #
 # Copyright (c) 2003 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -64,12 +64,14 @@
 
        # file with major definitions
        majors[0] = "conf/majors"
-       if (maarch == "arm32")
+       if (maarch == "arm" && system("test -f '" top "arch/" machine "/conf/majors." machine "'") != 0)
                majors[1] = "arch/arm/conf/majors.arm32";
        else if (machine == "evbsh5") {
                majors[1] = "arch/evbsh5/conf/majors.evbsh5";
                majors[2] = "arch/sh5/conf/majors.sh5";
-       } else
+       } else if (machine == "sbmips")
+               majors[1] = "arch/evbmips/conf/majors.evbmips";
+       else
                majors[1] = "arch/" machine "/conf/majors." machine;
 
        # process all files with majors and fill the chr[] and blk[]
@@ -132,17 +134,13 @@
                }
                incdir = 0
                while (getline < inc) {
-                       if ($2 == "MAXPARTITIONS") {
-                               # if 8, we are done; otherwise have
-                               # to check if it's 16 partitions with
-                               # back compat mapping
+                       if ($1 == "#define" && $2 == "MAXPARTITIONS")
                                diskpartitions = $3
-                               if (diskpartitions == 8)
-                                       break;
-                       } else if ($2 == "OLDMAXPARTITIONS") {
-                               diskbackcompat = 1
-                               break
-                       } else if ($1 == "#include" && $2 ~ "<.*/disklabel.h>"){
+                       else if ($1 == "#define" && $2 == "OLDMAXPARTITIONS")
+                               diskbackcompat = $3
+                       else if ($1 == "#define" && $2 == "RAW_PART")
+                               RAWDISK_OFF = $3
+                       else if ($1 == "#include" && $2 ~ "<.*/disklabel.h>") {
                                # wrapper, switch to the right file
                                incdir = substr($2, 2)
                                sub("/.*", "", incdir)
@@ -159,8 +157,12 @@
                }
        }
        MKDISK = "makedisk_p" diskpartitions    # routine to create disk devs
-       if (diskbackcompat)
+       DISKMINOROFFSET = diskpartitions
+       if (diskbackcompat) {
                MKDISK = MKDISK "high"
+               DISKMINOROFFSET = diskbackcompat
+       }
+       RAWDISK_NAME = sprintf("%c", 97 + RAWDISK_OFF)          # a+offset
 
        # initially no substitutions
        devsubst = 0
@@ -196,6 +198,9 @@
 {
        sub("^%MD_DEVICES%", MDDEV)
        sub("%MKDISK%", MKDISK)
+       sub("%DISKMINOROFFSET%", DISKMINOROFFSET)
+       sub("%RAWDISK_OFF%", RAWDISK_OFF)
+       sub("%RAWDISK_NAME%", RAWDISK_NAME)
 
        # if device substitutions are not active, do nothing more
        if (!devsubst) {



Home | Main Index | Thread Index | Old Index