forked from rumpkernel-attic/rumprun-xen
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuildxen.sh
executable file
·122 lines (102 loc) · 3.31 KB
/
buildxen.sh
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
#!/bin/sh
# Just a script to run the handful of commands required for a
# bootable domU image. This is mostly to document the commands
# required, and is not pretending to be fancy.
STDJ='-j4'
# the buildxen.sh is not as forgiving as I am
set -e
LIBLIBS="c crypt ipsec m npf pthread prop rmt util pci y z"
MORELIBS="external/bsd/flex/lib
crypto/external/bsd/openssl/lib/libcrypto
crypto/external/bsd/openssl/lib/libdes
crypto/external/bsd/openssl/lib/libssl
external/bsd/libpcap/lib"
LIBS=""
for lib in ${LIBLIBS}; do
LIBS="${LIBS} rumpsrc/lib/lib${lib}"
done
for lib in ${MORELIBS}; do
LIBS="${LIBS} rumpsrc/${lib}"
done
# ok, urgh, we need just one tree due to how build systems work (or
# don't work). So here's what we'll do for now. Checkout rumpsrc,
# checkout nbusersrc, and copy nbusersrc over rumpsrc. Obviously, we cannot
# update rumpsrc except manually after the copy operation, but that's
# a price we're just going to be paying for now.
if [ ! -d rumpsrc ]; then
git submodule update --init --recursive
./buildrump.sh/buildrump.sh -s rumpsrc checkout
cp -Rp nblibs/* rumpsrc/
fi
# build tools
./buildrump.sh/buildrump.sh -${BUILDXEN_QUIET:-q} ${STDJ} -k \
-V MKPIC=no -s rumpsrc -T rumptools -o rumpobj -N \
-V RUMP_CURLWP=hypercall -V RUMP_KERNEL_IS_LIBC=1 tools
./buildrump.sh/buildrump.sh -k -V MKPIC=no -s rumpsrc -T rumptools -o rumpobj setupdest
# FIXME to be able to specify this as part of previous cmdline
echo 'CPPFLAGS+=-DMAXPHYS=32768' >> rumptools/mk.conf
RMAKE=`pwd`/rumptools/rumpmake
RMAKE_INST=`pwd`/rumptools/_buildrumpsh-rumpmake
#
# install full set of headers.
#
# first, "mtree" (TODO: fetch/use nbmtree)
INCSDIRS='adosfs altq arpa crypto dev filecorefs fs i386 isofs miscfs
msdosfs net net80211 netatalk netbt netinet netinet6 netipsec
netisdn netkey netmpls netnatm netsmb nfs ntfs openssl pcap ppath prop
protocols rpc rpcsvc ssp sys ufs uvm x86'
for dir in ${INCSDIRS}; do
mkdir -p rump/include/$dir
done
# XXX
mkdir -p rumpobj/dest.stage/usr/lib/pkgconfig
# then, install
echo '>> Installing headers. please wait (may take a while) ...'
(
# sys/ produces a lot of errors due to missing tools/sources
# "protect" the user from that spew
cd rumpsrc/sys
${RMAKE} -k obj >/dev/null 2>&1
${RMAKE} -k includes >/dev/null 2>&1
)
# rpcgen lossage
( cd rumpsrc/include && ${RMAKE} -k includes > /dev/null 2>&1)
# other lossage
for lib in ${LIBS}; do
( cd ${lib} && ${RMAKE} includes >/dev/null 2>&1)
done
echo '>> done with headers'
# build rump kernel
./buildrump.sh/buildrump.sh -k -V MKPIC=no -s rumpsrc -T rumptools -o rumpobj build install
makekernlib ()
{
lib=$1
OBJS=`pwd`/rumpobj/$lib
mkdir -p ${OBJS}
( cd ${lib}
${RMAKE} MAKEOBJDIRPREFIX=${OBJS} obj
${RMAKE} MAKEOBJDIRPREFIX=${OBJS} dependall
${RMAKE} MAKEOBJDIRPREFIX=${OBJS} install
)
}
makekernlib rumpxenif
makekernlib rumpxenpci
makeuserlib ()
{
( cd $1
${RMAKE} obj
${RMAKE} MKMAN=no MKLINT=no MKPROFILE=no MKYP=no \
NOGCCERROR=1 ${STDJ} dependall
${RMAKE_INST} MKMAN=no MKLINT=no MKPROFILE=no MKYP=no install
)
}
for lib in ${LIBS}; do
makeuserlib ${lib}
done
./buildrump.sh/buildrump.sh ${BUILD_QUIET} $* \
-s rumpsrc -T rumptools -o rumpobj install
[ ! -f img/test.ffs ] && cp img/test_clean.ffs img/test.ffs
# build httpd objects
( cd httpd && make -f Makefile.boot )
# build the domU image
make