README
1 Welcome to the Enhanced SMF Profiles project.
2
3 To use it:
4 You can boot a zone with it, but it's missing things like permission
5 checking and service & instance deletion. See below for how to install it
6 in a zone.
7
8 To contribute code:
9 - Clone the gate with something like
10
11 hg clone ssh://anon (a] hg.opensolaris.org//hg/smf-profiles/gate profiles-wip
12
13 Inside SWAN, building will be easier with the closed tree, which you
14 can get with
15
16 cd profiles-wip/usr
17 hg clone ssh://anonhg (a] onnv.sfbay//export/onnv-clone/usr/closed closed
18
19 - I don't like building the entire gate, so I just build what's necessary to
20 test the parts we've changed. The "build_profiles" script in the root
21 does this. The script runs make and uses $SRC, so it's easiest to run it
22 from a ws shell.
23
24 If you're compiling on a small machine (like a laptop), export
25 CW_NO_SHADOW=1 in the environment to avoid gcc shadow compilation. If
26 you don't have access to /ws/onnv-tools, export BUILD_TOOLS set to where
27 your SUNWspro and onbld directories are, such as /opt.
28
29 - With libscf and svc.configd built & installed in the proto area, you
30 can run the ex-situ test suite for them, in $SRC/lib/libscf/test.
31 Build the tests with "make", and run them with "./dotests". Run
32 individual tests with "./dotests <test names>".
33
34 If svc.configd consistently fails a libscf test, you can debug it by
35 attaching mdb to it while running the test. Start svc.configd with
36
37 $SRC/common/svc/test/configdctl start $SRC/cmd/svc/seed/global.db
38
39 (currently some tests assume that svc.configd is run on the global
40 zone's seed repository). If successful, configdctl will print three
41 words on a line: a cookie, svc.configd's pid, and svc.configd's door
42 path. Such as
43
44 2145 2148 /tmp/configd_test_2145.door
45
46 Then in another shell attach mdb to svc.configd:
47
48 mdb -p 2148
49
50 Finally run the test, instructing it to connect to svc.configd at the
51 given door path. The libscf tests accept the door path as the only
52 argument. You'll probably need the gate's version of libscf, in which
53 case you need to set LD_LIBRARY_PATH, such as to $ROOT/lib. Since
54 I usually do this from the lib/libscf/test directory, I run
55
56 LD_LIBRARY_PATH=$ROOT/lib ./svc_get_propval /tmp/configd_test_2145.door
57
58 When you're done debugging, clean up with
59 "configdctl stop <cookie> <pid>", like
60
61 $SRC/common/svc/test/configdctl stop 2145 2148
62
63 - The source also contains ex-situ tests for svccfg in
64 cmd/svc/svccfg/test . Just change to that directory and run
65 "./dotests".
66
67 - To test in a nonglobal zone, run the "init_test_zone" script in the
68 root of the workspace, as the root user. It requires the name of the zone
69 as an argument. It copies the files we've changed into the zone,
70 including the seed repository.
71
72 Repository upgrade:
73 For the time being, the extended profiles project is being put on hold.
74 Because of this, the code to upgrade the repository is only partially
75 complete. The profiles_repository_upgrade directory contains the design
76 notes for upgrading the repository. This directory contains an asciidoc
77 (http://www.methods.co.nz/asciidoc/) source file and a Makefile. To use
78 the Makefile you must have asciidoc and lynx in your path. Then you can
79 type "make html" or "make text". There also is a clobber target in the
80 Makefile.
81