Last change
on this file since 10650 was 10650, checked in by rick, 13 years ago |
The routing syncer done the bad way. Should technically be an (C) daemon which
takes advantage of route monitor to instantly sync the routing changes to
the shadow routing table.
While here: add some descriptive comments for other entries.
Related-To: nodefactory#129
|
-
Property svn:eol-style
set to
LF
-
Property svn:executable
set to
*
|
File size:
1.0 KB
|
Line | |
---|
1 | #!/bin/sh
|
---|
2 | # Chroot into image to edit bits and pieces
|
---|
3 | #
|
---|
4 | # XXX: Error handing
|
---|
5 | . $(dirname $0)/package-build.inc.sh
|
---|
6 |
|
---|
7 | BASEDIR=`dirname $0`
|
---|
8 | if [ -n "$1" ]; then
|
---|
9 | IMG=$1
|
---|
10 | else
|
---|
11 | CFG="${BASEDIR}/../cfg/nanobsd.wleiden"
|
---|
12 |
|
---|
13 | # Find object directory
|
---|
14 | eval `grep '^NANO_NAME=' ${CFG}`
|
---|
15 | OBJDIR="/usr/obj/nanobsd.${NANO_NAME}"
|
---|
16 | IMG=${OBJDIR}/_.disk.full
|
---|
17 | fi
|
---|
18 |
|
---|
19 | if [ ! -r "${IMG}" ]; then
|
---|
20 | p_err Source ${IMG} does not exists
|
---|
21 | fi
|
---|
22 |
|
---|
23 | # Make sure we are root from this point on
|
---|
24 | f_check_root
|
---|
25 |
|
---|
26 |
|
---|
27 | MNT=`mktemp -d -t $(basename $0)`
|
---|
28 |
|
---|
29 | # If target nfs image is mounted somehow, bail out
|
---|
30 | if mdconfig -l -v | grep -q "${IMG}"; then
|
---|
31 | MD=`mdconfig -l -v | grep "${IMG}" | cut -c -4`
|
---|
32 | p_err "'${IMG}' already mounted at '$MD'"
|
---|
33 | exit 1
|
---|
34 | fi
|
---|
35 |
|
---|
36 |
|
---|
37 | MD=`mdconfig -a -t vnode -f ${IMG}`
|
---|
38 | mount /dev/${MD}s1a ${MNT}
|
---|
39 |
|
---|
40 | # Config files lives at /cfg location
|
---|
41 | mount /dev/${MD}s3 ${MNT}/cfg
|
---|
42 |
|
---|
43 | # Try to fetch and store config
|
---|
44 | p_info "Type exit when done"
|
---|
45 | chroot ${MNT}
|
---|
46 | p_info "Any changes are made permanent on image ${IMG}"
|
---|
47 |
|
---|
48 | # Clean up
|
---|
49 | umount ${MNT}/cfg
|
---|
50 | umount ${MNT}
|
---|
51 | mdconfig -d -u ${MD}
|
---|
52 | rm -d ${MNT}
|
---|
53 |
|
---|
54 |
|
---|
Note:
See
TracBrowser
for help on using the repository browser.