Source-Changes-HG archive

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

[src/trunk]: src/etc update for unified, dynamically generated MAKEDEV - chan...



details:   https://anonhg.NetBSD.org/src/rev/603c2b4c2568
branches:  trunk
changeset: 554306:603c2b4c2568
user:      jdolecek <jdolecek%NetBSD.org@localhost>
date:      Sun Oct 26 21:57:11 2003 +0000

description:
update for unified, dynamically generated MAKEDEV - change 'makedev' item
to generate the MAKEDEV to scratch dir and compare that with the currently
installed /dev/MAKEDEV; also add -a MACHINE_ARCH option to explicitly
set machine architecture for non-native builds

problem with postinstall pointed out by Patrick Welche and Hubert Feyrer
in private e-mails

diffstat:

 etc/postinstall |  24 +++++++++++++++++++-----
 1 files changed, 19 insertions(+), 5 deletions(-)

diffs (69 lines):

diff -r 556915b318ba -r 603c2b4c2568 etc/postinstall
--- a/etc/postinstall   Sun Oct 26 21:46:46 2003 +0000
+++ b/etc/postinstall   Sun Oct 26 21:57:11 2003 +0000
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# $NetBSD: postinstall,v 1.61 2003/05/15 05:25:24 lukem Exp $
+# $NetBSD: postinstall,v 1.62 2003/10/26 21:57:11 jdolecek Exp $
 #
 # Copyright (c) 2002-2003 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -603,11 +603,20 @@
 {
        [ -n "$1" ] || err 2 "USAGE: do_makedev   fix|check"
 
-       find_file_in_dirlist MAKEDEV "MAKEDEV" \
-           ${SRC_DIR}/etc/etc.${MACHINE} ${SRC_DIR}/dev \
-           || return 1
+       # for MAKEDEV.awk, it only matters if MACHINE_ARCH is 'arm' or not
+       if [ "${MACHINE_ARCH}" = "armeb" -o "${MACHINE_ARCH}" = "armel" \
+           -o "${MACHINE_ARCH}" = "arm" ]; then
+               maarch="arm"
+       else
+               maarch="X"
+       fi
 
-       compare_dir $1 ${dir} ${DEST_DIR}/dev 555 MAKEDEV || return 1
+       # generate MAKEDEV to scratchdir
+       MACHINE=${MACHINE} MACHINE_ARCH=${maarch} \
+               awk -v ETCDIR="${SRC_DIR}/etc" -f ${SRC_DIR}/etc/MAKEDEV.awk \
+               ${SRC_DIR}/etc/MAKEDEV.tmpl > ${SCRATCHDIR}/MAKEDEV
+
+       compare_dir $1 ${SCRATCHDIR} ${DEST_DIR}/dev 555 MAKEDEV || return 1
 }
 
 #
@@ -869,6 +878,7 @@
        -s srcdir       Source directory to compare from.  [${SRC_DIR:-/}]
        -d destdir      Destination directory to check.    [${DEST_DIR:-/}]
        -m machine      Machine architecture.              [${MACHINE}]
+       -a arch         Machine architecture.              [${MACHINE_ARCH}]
 
        Operation may be one of:
                help    display this help
@@ -903,6 +913,8 @@
                DEST_DIR=${OPTARG} ;;
        m)
                MACHINE=${OPTARG} ;;
+       a)
+               MACHINE_ARCH=${OPTARG} ;;
        *)
                usage ;;
        esac
@@ -913,6 +925,7 @@
        [ -d "${SRC_DIR}" ]     || err 1 "${SRC_DIR} is not a directory"
        [ -d "${DEST_DIR}" ]    || err 1 "${DEST_DIR} is not a directory"
        [ -n "${MACHINE}" ]     || err 1 "\${MACHINE} is not defined"
+       [ -n "${MACHINE_ARCH}" ] || err 1 "\${MACHINE_ARCH} is not defined"
 
                # If directories are /, clear them, so various messages
                # don't have leading "//".   However, this requires
@@ -1012,6 +1025,7 @@
 SRC_DIR="/usr/src"
 DEST_DIR="/"
 : ${MACHINE:=$( uname -m )}    # assume native build if $MACHINE is not set
+: ${MACHINE_ARCH:=$( uname -p )}# assume native build if not set
 
 NOT_FIXED=" [NOT FIXED]"
 SCRATCHDIR=$( mkdtemp ) || err 1 "Can't create scratch directory"



Home | Main Index | Thread Index | Old Index