Print this page
Support for PREBUILT_ILLUMOS, and optional /tmp/debug.$$ output.
| Split |
Close |
| Expand all |
| Collapse all |
--- old/build/illumos-kvm/build.sh
+++ new/build/illumos-kvm/build.sh
1 1 #!/usr/bin/bash
2 2 #
3 3 # CDDL HEADER START
4 4 #
5 5 # The contents of this file are subject to the terms of the
6 6 # Common Development and Distribution License, Version 1.0 only
7 7 # (the "License"). You may not use this file except in compliance
8 8 # with the License.
9 9 #
10 10 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
11 11 # or http://www.opensolaris.org/os/licensing.
12 12 # See the License for the specific language governing permissions
13 13 # and limitations under the License.
14 14 #
15 15 # When distributing Covered Code, include this CDDL HEADER in each
16 16 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
17 17 # If applicable, add the following below this CDDL HEADER, with the
18 18 # fields enclosed by brackets "[]" replaced with your own identifying
19 19 # information: Portions Copyright [yyyy] [name of copyright owner]
20 20 #
21 21 # CDDL HEADER END
22 22 #
23 23 #
24 24 # Copyright 2011-2012 OmniTI Computer Consulting, Inc. All rights reserved.
25 25 # Use is subject to license terms.
26 26 #
27 27 # Load support functions
28 28 . ../../lib/functions.sh
|
↓ open down ↓ |
28 lines elided |
↑ open up ↑ |
29 29
30 30 # First we build the kernel module
31 31 PROG=illumos-kvm
32 32 # This is pretty meaningless, and should be "0.5.11" but we messed that up
33 33 # by starting with "1.0.x" so this'll do. There should be no need to change
34 34 # this going forward.
35 35 VER=1.0.5.11
36 36 # Default to building tip, but site.sh can force a specific commit checkout.
37 37 COMMIT=$KVM_ROLLBACK
38 38 SRC_REPO=https://github.com/joyent/illumos-kvm.git
39 -KERNEL_SOURCE=/code/omnios-$RELVER/illumos-omnios
39 +if [ -d ${PREBUILT_ILLUMOS:-/dev/null} ]; then
40 + logmsg "Using pre-built Illumos at $PREBUILT_ILLUMOS (may need to wait...)"
41 + wait_for_prebuilt
42 + KERNEL_SOURCE=$PREBUILT_ILLUMOS
43 +else
44 + KERNEL_SOURCE=/code/omnios-$RELVER/illumos-omnios
45 +fi
40 46 PROTO_AREA=$KERNEL_SOURCE/proto/root_i386
41 47 PATCHDIR=patches.$PROG
42 48 PKG=driver/virtualization/kvm
43 49 SUMMARY="placeholder; reset below"
44 50 DESC="$SUMMARY"
45 51
46 52 # These are the dependencies for both the module and the cmds
47 53 BUILD_DEPENDS_IPS="archiver/gnu-tar developer/gcc47 developer/versioning/git file/gnu-coreutils"
48 54
49 55 # Only 64-bit matters
50 56 BUILDARCH=64
51 57
52 58 # Unset the prefix because we actually DO want things in kernel etc
53 59 PREFIX=""
54 60
55 61 download_source() {
56 62 logmsg "Obtaining source files"
57 63 if [[ -d $TMPDIR/$BUILDDIR ]]; then
58 64 logmsg "--- Removing existing directory for a fresh start"
59 65 logcmd rm -rf $TMPDIR/$BUILDDIR
60 66 fi
61 67 logcmd /bin/git clone $SRC_REPO $TMPDIR/$BUILDDIR || \
62 68 logerr "--- Failed to clone from $SRC_REPO"
63 69 if [[ -n "$COMMIT" ]]; then
64 70 logmsg "--- Setting revision to $COMMIT"
65 71 pushd $TMPDIR/$BUILDDIR > /dev/null
66 72 logcmd /bin/git checkout $COMMIT
67 73 popd > /dev/null
68 74 fi
69 75 if [[ -z "$COMMIT" ]]; then
70 76 pushd $TMPDIR/$BUILDDIR > /dev/null
71 77 COMMIT=$(git log -1 --format=format:%H)
72 78 popd > /dev/null
73 79 fi
74 80 }
75 81
76 82 configure64() {
77 83 true
78 84 }
79 85
80 86 make_prog() {
81 87 logmsg "--- make"
82 88 logcmd $MAKE \
83 89 KERNEL_SOURCE=$KERNEL_SOURCE \
84 90 PROTO_AREA=$PROTO_AREA \
85 91 CC=/opt/gcc-4.4.4/bin/gcc || \
86 92 logerr "--- Make failed"
87 93 logcmd cp $KERNEL_SOURCE/usr/src/OPENSOLARIS.LICENSE $SRCDIR/OPENSOLARIS.LICENSE || \
88 94 logerr "--- failed to copy CDDL from kernel sources"
89 95 }
90 96 fix_drivers() {
91 97 logcmd mv $DESTDIR/usr/kernel $DESTDIR/ || \
92 98 logerr "--- couldn't move kernel bits into /"
93 99 }
94 100
95 101 init
96 102 download_source
97 103 patch_source
98 104 prep_build
99 105 build
100 106 fix_drivers
|
↓ open down ↓ |
51 lines elided |
↑ open up ↑ |
101 107 SUMMARY="Illumos KVM kernel driver ($PROG ${COMMIT:0:10})"
102 108 DESC="KVM is the kernel virtual machine, a framework for the in-kernel acceleration of QEMU."
103 109 make_package kvm.mog
104 110 clean_up
105 111
106 112 # Next, the utilities (they follow the kernel module version)
107 113 PROG=illumos-kvm-cmd
108 114 # Default to building tip, but site.sh can force a specific commit checkout.
109 115 COMMIT=$KVM_CMD_ROLLBACK
110 116 SRC_REPO=https://github.com/joyent/illumos-kvm-cmd.git
111 -KERNEL_SOURCE=/code/omnios-$RELVER/illumos-omnios
117 +if [ -d $PREBUILT_ILLUMOS:-/dev/null ]; then
118 + logmsg "Using pre-built Illumos at $PREBUILT_ILLUMOS (may need to wait...)"
119 + wait_for_prebuilt
120 + KERNEL_SOURCE=$PREBUILT_ILLUMOS
121 +else
122 + KERNEL_SOURCE=/code/omnios-$RELVER/illumos-omnios
123 +fi
112 124 KVM_DIR=$TMPDIR/illumos-kvm-$VER
113 125 PATCHDIR=patches.$PROG
114 126 PKG=system/kvm
115 127
116 128 # Reset a couple of important things
117 129 BUILDDIR=$PROG-$VER # This must be explicitly reset from the run above
118 130 PREFIX=/usr
119 131
120 132 # Only 64-bit matters
121 133 BUILDARCH=64
122 134
123 135 # Borrowed from Joyent's build.sh within the source
124 136 # so we can find ctfconvert during 'make install'
125 137 CTFBINDIR="$KERNEL_SOURCE"/usr/src/tools/proto/root_i386-nd/opt/onbld/bin/i386
126 138 export CTFBINDIR
127 139 export PATH="$PATH:$CTFBINDIR"
128 140
129 141 make_prog() {
130 142 CC=/opt/gcc-4.4.4/bin/gcc
131 143 export KERNEL_SOURCE KVM_DIR PREFIX CC
132 144 logmsg "--- build.sh"
133 145 logcmd ./build.sh || \
134 146 logerr "--- build.sh failed"
135 147 }
136 148
137 149 make_install() {
138 150 logmsg "--- make install"
139 151 logcmd $MAKE DESTDIR=${DESTDIR} V=1 install || \
140 152 logerr "--- Make install failed"
141 153 }
142 154
143 155 download_source
144 156 patch_source
145 157 prep_build
146 158 build
147 159 SUMMARY="Illumos KVM utilities ($PROG ${COMMIT:0:10})"
148 160 DESC="KVM is the kernel virtual machine, a framework for the in-kernel acceleration of QEMU."
149 161 make_package kvm-cmd.mog
150 162 clean_up
151 163
152 164 # Vim hints
153 165 # vim:ts=4:sw=4:et:
|
↓ open down ↓ |
32 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX