summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuo Ruijing <ruijing.guo@intel.com>2016-08-08 08:54:30 +0800
committerGuo Ruijing <ruijing.guo@intel.com>2016-08-08 13:45:24 +0800
commita18cd2628a389e0ccf065b13a7030b6ad4bdbec9 (patch)
treef6bbe4de2c4e0f04a2dcf26b87564c9aed5b3419
parentaf3fbac7561ac20c13299764edeabb6b3163e4ef (diff)
Use local debian spec & fix ovs post installation failure
Change-Id: I6a8865a90e989f55ea0fd3888a0953c2c728722c Signed-off-by: Guo Ruijing <ruijing.guo@intel.com>
Notes
Notes (review): Code-Review+2: Ruijing <ruijing.guo@intel.com> Workflow+1: Ruijing <ruijing.guo@intel.com> Verified+2: Jenkins Submitted-by: Jenkins Submitted-at: Tue, 09 Aug 2016 00:17:09 +0000 Reviewed-on: https://review.openstack.org/352174 Project: openstack/fuel-plugin-ovs Branch: refs/heads/master
-rwxr-xr-xovs_build/build-ovs-dpdk.sh63
-rw-r--r--ovs_build/openvswitch-dpdk_2.5.90/debian/openvswitch-switch-dpdk.postinst1
-rwxr-xr-xovs_build/rules150
3 files changed, 21 insertions, 193 deletions
diff --git a/ovs_build/build-ovs-dpdk.sh b/ovs_build/build-ovs-dpdk.sh
index 66334f2..a940113 100755
--- a/ovs_build/build-ovs-dpdk.sh
+++ b/ovs_build/build-ovs-dpdk.sh
@@ -4,24 +4,21 @@ set -eux
4 4
5OVS_COMMIT=7d8eadce4df70f563a0c0123c612f6117c8ff864 5OVS_COMMIT=7d8eadce4df70f563a0c0123c612f6117c8ff864
6URL_OVS=https://github.com/openvswitch/ovs.git 6URL_OVS=https://github.com/openvswitch/ovs.git
7OVS_VER=${OVS_VER:-2.5.90} 7BUILD_DEB=${BUILD_DEB:-/deb}
8BUILD_HOME=$HOME/dpdk 8BUILD_SRC="$(dirname `readlink -f $0`)"
9BUILD_DEST=${BUILD_DEST:-/deb} 9BUILD_DEST=${BUILD_DEST:-/tmp/ovs-dpdk}
10 10
11export DEB_BUILD_OPTIONS='parallel=8 nocheck' 11export DEB_BUILD_OPTIONS='parallel=8 nocheck'
12 12
13sudo apt-get build-dep openvswitch -y
14sudo apt-get -y install devscripts dpkg-dev git wget 13sudo apt-get -y install devscripts dpkg-dev git wget
15 14
16rm -rf ${BUILD_HOME}; mkdir -p ${BUILD_HOME} 15rm -rf ${BUILD_DEST}; mkdir -p ${BUILD_DEST}
17cp `dirname $0`/rules ${BUILD_HOME}
18 16
19cd ${BUILD_HOME} 17cd ${BUILD_DEST}
20wget -c https://launchpad.net/ubuntu/+archive/primary/+files/dpdk_2.2.0-0ubuntu8.dsc
21wget -c https://launchpad.net/ubuntu/+archive/primary/+files/dpdk_2.2.0.orig.tar.gz
22wget -c https://launchpad.net/ubuntu/+archive/primary/+files/dpdk_2.2.0-0ubuntu8.debian.tar.xz
23dpkg-source -x dpdk_2.2.0-0ubuntu8.dsc
24wget -c http://fast.dpdk.org/rel/dpdk-16.04.tar.xz 18wget -c http://fast.dpdk.org/rel/dpdk-16.04.tar.xz
19xz -d dpdk-16.04.tar.xz; tar xvf dpdk-16.04.tar
20cd dpdk-16.04
21cp -r ${BUILD_SRC}/dpdk_16.04/debian .
25 22
26# copy from debian/control 23# copy from debian/control
27sudo apt-get install -y debhelper \ 24sudo apt-get install -y debhelper \
@@ -38,26 +35,13 @@ sudo apt-get install -y debhelper \
38 python-sphinx \ 35 python-sphinx \
39 texlive-fonts-recommended \ 36 texlive-fonts-recommended \
40 texlive-latex-extra 37 texlive-latex-extra
41
42cd dpdk-2.2.0; rm -rf debian/patches/; uupdate -v 16.04 ../dpdk-16.04.tar.xz
43cd ${BUILD_HOME}/dpdk-16.04
44cat << EOF > debian/changelog
45dpdk (16.04-1) unstable; urgency=low
46 * DPDK 16.04
47 -- DPDK team <dev@dpdk.org>
48EOF
49mv debian/rules debian/rules.orig
50cp ${BUILD_HOME}/rules debian/rules
51debian/rules build; fakeroot debian/rules binary 38debian/rules build; fakeroot debian/rules binary
52cd ${BUILD_HOME}; sudo dpkg -i *.deb
53apt-get download libxenstore3.0
54 39
55cd ${BUILD_HOME} 40cd ${BUILD_DEST}
56wget -c https://launchpad.net/ubuntu/+archive/primary/+files/openvswitch-dpdk_2.4.0.orig.tar.gz 41sudo dpkg -i *.deb
57wget -c https://launchpad.net/ubuntu/+archive/primary/+files/openvswitch-dpdk_2.4.0-0ubuntu1.dsc 42apt-get download libxenstore3.0
58wget -c https://launchpad.net/ubuntu/+archive/primary/+files/openvswitch-dpdk_2.4.0-0ubuntu1.debian.tar.xz
59dpkg-source -x openvswitch-dpdk_2.4.0-0ubuntu1.dsc
60 43
44sudo apt-get build-dep openvswitch -y
61# copy from debian/control 45# copy from debian/control
62sudo apt-get install -y autoconf \ 46sudo apt-get install -y autoconf \
63 automake \ 47 automake \
@@ -79,22 +63,15 @@ sudo apt-get install -y autoconf \
79 python-six 63 python-six
80 64
81git clone https://github.com/openvswitch/ovs.git 65git clone https://github.com/openvswitch/ovs.git
82cd ovs; git checkout ${OVS_COMMIT} 66cd ovs; git checkout ${OVS_COMMIT}; rm -rf .git
83cd ${BUILD_HOME}; tar czvf ovs.tar.gz ovs 67cd ${BUILD_DEST}; cp -r ovs ovs-dpdk
84rm -rf openvswitch-dpdk-${OVS_VER}* 68
85cd openvswitch-dpdk-2.4.0; uupdate -v ${OVS_VER} ../ovs.tar.gz 69cd ovs-dpdk
86cd ../openvswitch-dpdk-${OVS_VER} 70cp -r ${BUILD_SRC}/openvswitch-dpdk_2.5.90/debian .
87#sed -i 's~DPDK_LIB_DIR=.*~DPDK_LIB_DIR="$with_dpdk/x86_64-linux-gnu/lib"~' acinclude.m4
88autoreconf --install
89rm -rf debian/patches/ .git;
90cat << EOF > debian/changelog
91openvswitch-dpdk (${OVS_VER}-1) unstable; urgency=low
92 * New upstream version
93 -- Open vSwitch team <dev@openvswitch.org>
94EOF
95debian/rules build; fakeroot debian/rules binary 71debian/rules build; fakeroot debian/rules binary
96 72
97cd ${BUILD_HOME}/ovs 73cd ${BUILD_DEST}/ovs
98debian/rules build; fakeroot debian/rules binary 74debian/rules build; fakeroot debian/rules binary
99 75
100cp ${BUILD_HOME}/*.deb ${BUILD_DEST} 76cp -r ${BUILD_DEST}/*.deb ${BUILD_DEB}
77rm -rf ${BUILD_DEST}
diff --git a/ovs_build/openvswitch-dpdk_2.5.90/debian/openvswitch-switch-dpdk.postinst b/ovs_build/openvswitch-dpdk_2.5.90/debian/openvswitch-switch-dpdk.postinst
index ff5a725..cafae09 100644
--- a/ovs_build/openvswitch-dpdk_2.5.90/debian/openvswitch-switch-dpdk.postinst
+++ b/ovs_build/openvswitch-dpdk_2.5.90/debian/openvswitch-switch-dpdk.postinst
@@ -2,6 +2,7 @@
2 2
3set -e 3set -e
4 4
5rm -rf /usr/sbin/ovs-vswitchd
5update-alternatives --install /usr/sbin/ovs-vswitchd ovs-vswitchd \ 6update-alternatives --install /usr/sbin/ovs-vswitchd ovs-vswitchd \
6 /usr/lib/openvswitch-switch-dpdk/ovs-vswitchd-dpdk 50 7 /usr/lib/openvswitch-switch-dpdk/ovs-vswitchd-dpdk 50
7 8
diff --git a/ovs_build/rules b/ovs_build/rules
deleted file mode 100755
index f2f5a17..0000000
--- a/ovs_build/rules
+++ /dev/null
@@ -1,150 +0,0 @@
1#!/usr/bin/make -f
2# See debhelper(7) (uncomment to enable)
3# output every command that modifies files on the build system.
4#export DH_VERBOSE = 1
5
6# see EXAMPLES in dpkg-buildflags(1) and read /usr/share/dpkg/*
7DPKG_EXPORT_BUILDFLAGS = 1
8include /usr/share/dpkg/default.mk
9
10DEB_HOST_GNU_CPU := $(shell dpkg-architecture -qDEB_HOST_GNU_CPU)
11
12# see FEATURE AREAS in dpkg-buildflags(1)
13export DEB_BUILD_MAINT_OPTIONS = hardening=+all
14
15# build with debug symbols, dh_strip will create -dgbsyms packages by that
16export EXTRA_CFLAGS = -g
17
18# see ENVIRONMENT in dpkg-buildflags(1)
19# package maintainers to append CFLAGS
20#export DEB_CFLAGS_MAINT_APPEND = -Wall -pedantic
21# package maintainers to append LDFLAGS
22#export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed
23
24DPDK_CONFIG = "$(DEB_HOST_GNU_CPU)-native-linuxapp-gcc"
25DPDK_STATIC_DIR = "debian/build/static-root"
26DPDK_SHARED_DIR = "debian/build/shared-root"
27
28clean:
29 dh_testdir
30 rm -rf debian/build debian/tmp
31 dh_clean
32
33build-config:
34 dh_testdir
35 $(MAKE) O=$(DPDK_STATIC_DIR) T=$(DPDK_CONFIG) config
36
37build-indep: build-config
38 dh_testdir
39 $(MAKE) O=$(DPDK_STATIC_DIR) doc-api-html doc-guides-html
40
41build-arch: build-config
42 dh_testdir
43 $(MAKE) O=$(DPDK_STATIC_DIR) build
44 # Unfortunately the decision about having static or shared libraries is
45 # made for the whole build, which then produces only .a or .so files
46 # (but not both).
47 # And the target layout for target selection has no field for the
48 # type of library.
49 # Right now I hack this by doing a second build which only differs in
50 # the selection of shared libs.
51 # Shared libs should be default, so the previous static build is only
52 # used to get static libraries.
53 cp -a $(DPDK_STATIC_DIR) $(DPDK_SHARED_DIR)
54 sed -ri 's,(RTE_BUILD_SHARED_LIB=).*,\1y,' \
55 $(DPDK_SHARED_DIR)/.config
56 $(MAKE) O=$(DPDK_SHARED_DIR) build
57
58build: build-arch build-indep
59
60binary-indep: PACKAGE_NAME=dpdk-doc
61binary-indep: DOCDIR=usr/share/doc/dpdk
62binary-indep: export DH_OPTIONS=--indep
63binary-indep:
64 dh_testroot
65 dh_prep
66 dh_testdir
67 dh_installdirs
68 dh_install
69 dh_installdocs
70 dh_installchangelogs
71 dh_lintian
72 # Package: dpdk-doc
73 # All files based on the install-doc rule (includes examples)
74 $(MAKE) O=$(DPDK_SHARED_DIR) prefix=/usr \
75 DESTDIR=debian/dpdk-doc install-doc
76 dh_link
77 dh_compress
78 dh_fixperms
79 dh_installdeb
80 dh_gencontrol
81 dh_md5sums
82 dh_builddeb
83
84binary-arch: LIBDIR=usr/lib/$(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
85binary-arch: export DH_OPTIONS=--arch
86binary-arch:
87 dh_testroot
88 dh_prep
89 dh_testdir
90 dh_installdirs
91 dh_install
92 dh_installdocs
93 dh_installchangelogs
94 dh_lintian
95 dh_systemd_enable
96 dh_installinit --no-start --no-restart-on-upgrade
97 dh_systemd_start --no-start --no-restart-on-upgrade
98 # Package: dpdk (runtime)
99 $(MAKE) O=$(DPDK_STATIC_DIR) prefix=/usr \
100 DESTDIR=debian/dpdk install-runtime
101 $(MAKE) O=$(DPDK_SHARED_DIR) prefix=/usr \
102 DESTDIR=debian/dpdk install-runtime
103 cp debian/dpdk.interfaces debian/dpdk/etc/dpdk/interfaces
104 rm debian/dpdk/usr/sbin/dpdk_nic_bind
105 ln -s /usr/share/dpdk/tools/dpdk_nic_bind.py \
106 debian/dpdk/sbin/dpdk_nic_bind
107 # Package: libdpdk0 (bare runtime libs)
108 mkdir -p debian/libdpdk0/$(LIBDIR)
109 # NOTE so far upstream dpdk has not settled on really versioning the
110 # combined lib. There are discussions ongoing and various alternative
111 # approaches.
112 # We have to wait until that is clarified upstream (in a follow on dpdk
113 # version).
114 # One likely solution will make us ship the non combined .so and a
115 # linker script which replaces the combined lib.
116 # To easen package management a few notes how this will change if that
117 # happens:
118 # NOTE: linker script - this becomes a nop (linker skript has no sover
119 # on its own)
120 rm debian/dpdk/usr/lib/libdpdk.so
121 cp -a $(DPDK_SHARED_DIR)/lib/* debian/libdpdk0/$(LIBDIR)/
122 # NOTE: linker script - insert basenames loop for all .so's
123 # NOTE: linker script - we also will need multiple symbol files then
124 # Package: dpdk-dev (build environment)
125 $(MAKE) O=$(DPDK_SHARED_DIR) prefix=/usr \
126 DESTDIR=debian/dpdk-dev install-sdk
127 cp $(DPDK_SHARED_DIR)/.config debian/dpdk-dev/usr/share/dpdk/config
128 # Package: libdpdk-dev (bare headers and static devel libs)
129 mkdir -p debian/libdpdk-dev/usr/lib/
130 # NOTE: linker script - insert basenames loop for all .a's
131 #ln -s /$(LIBDIR)/libdpdk.so \
132 # debian/libdpdk-dev/$(LIBDIR)/libdpdk.so.0
133 cp -a $(DPDK_STATIC_DIR)/lib/* debian/libdpdk-dev/usr/lib/
134 mv debian/dpdk-dev/usr/include/dpdk debian/libdpdk-dev/usr/include/
135 # NOTE: linker script - package instead of removing all sublibs
136 rm -rf debian/dpdk/usr/lib*
137 dh_python2
138 dh_perl
139 dh_link
140 dh_compress
141 dh_fixperms
142 dh_strip
143 dh_makeshlibs
144 dh_shlibdeps
145 dh_installdeb
146 dh_gencontrol
147 dh_md5sums
148 dh_builddeb
149
150binary: binary-arch binary-indep