Wednesday Aug 27, 2008

Minimal ON Build for FMA - Update

I've updated the minimal FMA build script from an earlier post. It understands Mercurial now, and accounts for some new pre-requisites FMA has in Nevada 98.

:wq

Tuesday Jul 22, 2008

Debugging topology map XML

I was working on modeling some topology today using straight XML to support the sun4v platform independent FMA project and roughly 2000 lines in, starting to get not-so-good results:

# /usr/lib/fm/fmd/fmtopo /usr/lib/fm/fmd/fmtopo: failed to walk hc topology: empty topology

Knowing that libtopo (as well as enumerators) often have some debug tracing functions, I did a search on OpenSolaris for topo debug environment variables. Two jumped out that looked useful for debugging XML issues, TOPOXML_VALIDATE and TOPOXML_PERROR. Turns out for my problem, the latter is what I wanted. Once set, and using the -d option for fmtopo:

# /usr/lib/fm/fmd/fmtopo //usr/platform/SUNW,FOO/lib/fm/topo/maps/FOO-hc-topology.xml:1821: parser error : Opening and ending tag mismatch: propgroup line 1682 and node </node> \^ //usr/platform/SUNW,FOO/lib/fm/topo/maps/FOO-hc-topology.xml:1822: parser error : Opening and ending tag mismatch: node line 1681 and range </range> \^ //usr/platform/SUNW,FOO/lib/fm/topo/maps/FOO-hc-topology.xml:1823: parser error : Opening and ending tag mismatch: range line 1680 and dependents </dependents> \^ ...

The first error was with a propgroup at line 1682. Looking at that area of the map:

1678 <!-- memory-controller 2 --> 1679 <dependents grouping='children'> 1680 <range name='memory-controller' min='0' max='3'> 1681 <node instance='2'> 1682 <propgroup name='protocol' version='1' 1683 name-stability='Private' data-stability='Private' > 1684 <propval name='FRU' type='fmri' 1685 value='hc:///motherboard=0/cpuboard=2' /> 1686 <propval name='label' type='string' value='MB/CPU2' /> 1687 1688 <!-- memory-controller 2's buffers --> 1689 <dependents grouping='children'> 1690 <range name='memory-buffer' min='4' max='5'>

Sure enough, I'd missed the the </proprgroup> after line 1686.

While it was very handy to have the XML debugging in libtopo, it got me wondering what XML editors are out there that would do this kind of syntactical checking while I'm adding in nodes. Afraid I'm a bit of an old dog using vi. Any favorites out there?

:wq

Wednesday Jul 16, 2008

Minimal ON Build for FMA

There's been times where I've wanted to do some tweaking or experimenting on FMA or its modules, but don't want my sandbox to be in the same workspace that contains my "real" work. While I could maintain a workspace solely for play, I wanted to also know the minimum amount of ON I had to build in order to produce FMA binaries. After some playing, here's the script I cobbled up:

#!/bin/sh # # Script to build minimal set of ON necesary to compile FMD, # agents, diagnosis engines, etc. # # Revision history (reverse chronological order) # # 2008.07.15 Initial draft, based on snv_94/teamware ## Basic sanity check for a proper env if [ "X$SRC" = "X" ]; then /usr/bin/echo "Workspace apparently not setup (\\$SRC is NULL)" exit 1 fi ## Variable setup UNAME_P=`/usr/bin/uname -p` ISA="amd64" if [ "$UNAME_P" = "sparc" ]; then ISA="sparcv9" fi ## Create necessary proto directories PROTO_DIR="usr/lib usr/lib/fm usr/lib/scsi usr/include/scsi usr/include/fm \\ usr/share/lib/xml/dtd usr/lib/$ISA usr/lib/fm/$ISA usr/lib/scsi/$ISA \\ lib/svc/method" for x in $PROTO_DIR; do /usr/bin/mkdir -p $SRC/../../proto/root_$UNAME_P/$x /usr/bin/mkdir -p $SRC/../../proto/root_$UNAME_P-nd/$x done ## SPARC prerequisites if [ "$UNAME_P" = "sparc" ]; then /usr/bin/mkdir -p $SRC/../../proto/root_$UNAME_P/usr/platform/sun4v/include/sys cd $SRC/lib/libpri make install_h make install cd $SRC/lib/fm/libmdesc make install cd $SRC/lib/fm/libldom make install fi ## Common prerequisites cd $SRC/lib/libdscp make install_h make install ## Build usr/src/lib/fm and usr/src/cmd/fm cd $SRC/lib/fm make make install cd $SRC/cmd/fm make

I've done rudimentary tests on both SPARC and x86 and it works well. I'd expect over time as more FMA modules are delivered, the prerequisite proto directories and libraries will change. In the more immediate future, the move to Mercurial will likely trigger a tweak.

08/27/2008 Update: The script as it appears above has been updated. The URL of the script, linked above, has (and will always have) the latest version.

:wq

About

user9148476

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today