Print this page
site.sh-configurable KVM rollbacks
| 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.
|
↓ open down ↓ |
25 lines elided |
↑ open up ↑ |
26 26 #
27 27 # Load support functions
28 28 . ../../lib/functions.sh
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 -# Default to building tip, but if needed, specify the desired commit here
37 -COMMIT=
36 +# Default to building tip, but site.sh can force a specific commit checkout.
37 +COMMIT=$KVM_ROLLBACK
38 38 SRC_REPO=https://github.com/joyent/illumos-kvm.git
39 39 KERNEL_SOURCE=/code/omnios-$RELVER/illumos-omnios
40 40 PROTO_AREA=$KERNEL_SOURCE/proto/root_i386
41 41 PATCHDIR=patches.$PROG
42 42 PKG=driver/virtualization/kvm
43 43 SUMMARY="placeholder; reset below"
44 44 DESC="$SUMMARY"
45 45
46 46 # These are the dependencies for both the module and the cmds
47 47 BUILD_DEPENDS_IPS="archiver/gnu-tar developer/gcc47 developer/versioning/git file/gnu-coreutils"
48 48
49 49 # Only 64-bit matters
50 50 BUILDARCH=64
51 51
52 52 # Unset the prefix because we actually DO want things in kernel etc
53 53 PREFIX=""
54 54
55 55 download_source() {
56 56 logmsg "Obtaining source files"
57 57 if [[ -d $TMPDIR/$BUILDDIR ]]; then
58 58 logmsg "--- Removing existing directory for a fresh start"
59 59 logcmd rm -rf $TMPDIR/$BUILDDIR
60 60 fi
61 61 logcmd /bin/git clone $SRC_REPO $TMPDIR/$BUILDDIR || \
62 62 logerr "--- Failed to clone from $SRC_REPO"
63 63 if [[ -n "$COMMIT" ]]; then
64 64 logmsg "--- Setting revision to $COMMIT"
65 65 pushd $TMPDIR/$BUILDDIR > /dev/null
66 66 logcmd /bin/git checkout $COMMIT
67 67 popd > /dev/null
68 68 fi
69 69 if [[ -z "$COMMIT" ]]; then
70 70 pushd $TMPDIR/$BUILDDIR > /dev/null
71 71 COMMIT=$(git log -1 --format=format:%H)
72 72 popd > /dev/null
73 73 fi
74 74 }
75 75
76 76 configure64() {
77 77 true
78 78 }
79 79
80 80 make_prog() {
81 81 logmsg "--- make"
82 82 logcmd $MAKE \
83 83 KERNEL_SOURCE=$KERNEL_SOURCE \
84 84 PROTO_AREA=$PROTO_AREA \
85 85 CC=/opt/gcc-4.4.4/bin/gcc || \
86 86 logerr "--- Make failed"
87 87 logcmd cp $KERNEL_SOURCE/usr/src/OPENSOLARIS.LICENSE $SRCDIR/OPENSOLARIS.LICENSE || \
88 88 logerr "--- failed to copy CDDL from kernel sources"
89 89 }
90 90 fix_drivers() {
91 91 logcmd mv $DESTDIR/usr/kernel $DESTDIR/ || \
92 92 logerr "--- couldn't move kernel bits into /"
93 93 }
94 94
95 95 init
96 96 download_source
97 97 patch_source
|
↓ open down ↓ |
50 lines elided |
↑ open up ↑ |
98 98 prep_build
99 99 build
100 100 fix_drivers
101 101 SUMMARY="Illumos KVM kernel driver ($PROG ${COMMIT:0:10})"
102 102 DESC="KVM is the kernel virtual machine, a framework for the in-kernel acceleration of QEMU."
103 103 make_package kvm.mog
104 104 clean_up
105 105
106 106 # Next, the utilities (they follow the kernel module version)
107 107 PROG=illumos-kvm-cmd
108 -# Default to building tip, but if needed, specify the desired commit here
109 -COMMIT=
108 +# Default to building tip, but site.sh can force a specific commit checkout.
109 +COMMIT=$KVM_CMD_ROLLBACK
110 110 SRC_REPO=https://github.com/joyent/illumos-kvm-cmd.git
111 111 KERNEL_SOURCE=/code/omnios-$RELVER/illumos-omnios
112 112 KVM_DIR=$TMPDIR/illumos-kvm-$VER
113 113 PATCHDIR=patches.$PROG
114 114 PKG=system/kvm
115 115
116 116 # Reset a couple of important things
117 117 BUILDDIR=$PROG-$VER # This must be explicitly reset from the run above
118 118 PREFIX=/usr
119 119
120 120 # Only 64-bit matters
121 121 BUILDARCH=64
122 122
123 123 # Borrowed from Joyent's build.sh within the source
124 124 # so we can find ctfconvert during 'make install'
125 125 CTFBINDIR="$KERNEL_SOURCE"/usr/src/tools/proto/root_i386-nd/opt/onbld/bin/i386
126 126 export CTFBINDIR
127 127 export PATH="$PATH:$CTFBINDIR"
128 128
129 129 make_prog() {
130 130 CC=/opt/gcc-4.4.4/bin/gcc
131 131 export KERNEL_SOURCE KVM_DIR PREFIX CC
132 132 logmsg "--- build.sh"
133 133 logcmd ./build.sh || \
134 134 logerr "--- build.sh failed"
135 135 }
136 136
137 137 make_install() {
138 138 logmsg "--- make install"
139 139 logcmd $MAKE DESTDIR=${DESTDIR} V=1 install || \
140 140 logerr "--- Make install failed"
141 141 }
142 142
143 143 download_source
144 144 patch_source
145 145 prep_build
146 146 build
147 147 SUMMARY="Illumos KVM utilities ($PROG ${COMMIT:0:10})"
148 148 DESC="KVM is the kernel virtual machine, a framework for the in-kernel acceleration of QEMU."
149 149 make_package kvm-cmd.mog
150 150 clean_up
151 151
152 152 # Vim hints
153 153 # vim:ts=4:sw=4:et:
|
↓ open down ↓ |
34 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX