forked from vitalif/vitastor
Use packages/ subdir instead of build/ for Docker package builds
parent
bf9a175efc
commit
178388ac8c
|
@ -1,5 +1,6 @@
|
||||||
.git
|
.git
|
||||||
build
|
build
|
||||||
|
packages
|
||||||
mon/node_modules
|
mon/node_modules
|
||||||
*.o
|
*.o
|
||||||
*.so
|
*.so
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
gcc -E -o fio_headers.i fio_headers.h
|
gcc -I. -E -o fio_headers.i src/fio_headers.h
|
||||||
|
|
||||||
rm -rf fio-copy
|
rm -rf fio-copy
|
||||||
for i in `grep -Po 'fio/[^"]+' fio_headers.i | sort | uniq`; do
|
for i in `grep -Po 'fio/[^"]+' fio_headers.i | sort | uniq`; do
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
#cd b/qemu; make qapi
|
#cd b/qemu; make qapi
|
||||||
|
|
||||||
gcc -I qemu/b/qemu `pkg-config glib-2.0 --cflags` \
|
gcc -I qemu/b/qemu `pkg-config glib-2.0 --cflags` \
|
||||||
-I qemu/include -E -o qemu_driver.i qemu_driver.c
|
-I qemu/include -E -o qemu_driver.i src/qemu_driver.c
|
||||||
|
|
||||||
rm -rf qemu-copy
|
rm -rf qemu-copy
|
||||||
for i in `grep -Po 'qemu/[^"]+' qemu_driver.i | sort | uniq`; do
|
for i in `grep -Po 'qemu/[^"]+' qemu_driver.i | sort | uniq`; do
|
||||||
|
|
|
@ -0,0 +1,6 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
sed 's/$REL/buster/' < vitastor.Dockerfile > ../Dockerfile
|
||||||
|
cd ..
|
||||||
|
mkdir -p packages
|
||||||
|
sudo podman build -v `pwd`/packages:/root/packages -f Dockerfile .
|
|
@ -1,13 +1,8 @@
|
||||||
# Build patched QEMU for Debian Buster or Bullseye/Sid inside a container
|
# Build patched QEMU for Debian Buster or Bullseye/Sid inside a container
|
||||||
# cd ..; podman build --build-arg REL=bullseye -v `pwd`/build:/root/build -f debian/patched-qemu.Dockerfile .
|
# cd ..; podman build --build-arg REL=bullseye -v `pwd`/packages:/root/packages -f debian/patched-qemu.Dockerfile .
|
||||||
|
|
||||||
ARG REL=bullseye
|
|
||||||
|
|
||||||
FROM debian:$REL
|
FROM debian:$REL
|
||||||
|
|
||||||
# again, it doesn't work otherwise
|
|
||||||
ARG REL=bullseye
|
|
||||||
|
|
||||||
WORKDIR /root
|
WORKDIR /root
|
||||||
|
|
||||||
RUN if [ "$REL" = "buster" ]; then \
|
RUN if [ "$REL" = "buster" ]; then \
|
||||||
|
@ -30,20 +25,20 @@ RUN apt-get --download-only source fio
|
||||||
|
|
||||||
ADD qemu-5.0-vitastor.patch qemu-5.1-vitastor.patch /root/vitastor/
|
ADD qemu-5.0-vitastor.patch qemu-5.1-vitastor.patch /root/vitastor/
|
||||||
RUN set -e; \
|
RUN set -e; \
|
||||||
mkdir -p /root/build/qemu-$REL; \
|
mkdir -p /root/packages/qemu-$REL; \
|
||||||
rm -rf /root/build/qemu-$REL/*; \
|
rm -rf /root/packages/qemu-$REL/*; \
|
||||||
cd /root/build/qemu-$REL; \
|
cd /root/packages/qemu-$REL; \
|
||||||
dpkg-source -x /root/qemu*.dsc; \
|
dpkg-source -x /root/qemu*.dsc; \
|
||||||
if [ -d /root/build/qemu-$REL/qemu-5.0 ]; then \
|
if [ -d /root/packages/qemu-$REL/qemu-5.0 ]; then \
|
||||||
cp /root/vitastor/qemu-5.0-vitastor.patch /root/build/qemu-$REL/qemu-5.0/debian/patches; \
|
cp /root/vitastor/qemu-5.0-vitastor.patch /root/packages/qemu-$REL/qemu-5.0/debian/patches; \
|
||||||
echo qemu-5.0-vitastor.patch >> /root/build/qemu-$REL/qemu-5.0/debian/patches/series; \
|
echo qemu-5.0-vitastor.patch >> /root/packages/qemu-$REL/qemu-5.0/debian/patches/series; \
|
||||||
else \
|
else \
|
||||||
cp /root/vitastor/qemu-5.1-vitastor.patch /root/build/qemu-$REL/qemu-*/debian/patches; \
|
cp /root/vitastor/qemu-5.1-vitastor.patch /root/packages/qemu-$REL/qemu-*/debian/patches; \
|
||||||
P=`ls -d /root/build/qemu-$REL/qemu-*/debian/patches`; \
|
P=`ls -d /root/packages/qemu-$REL/qemu-*/debian/patches`; \
|
||||||
echo qemu-5.1-vitastor.patch >> $P/series; \
|
echo qemu-5.1-vitastor.patch >> $P/series; \
|
||||||
fi; \
|
fi; \
|
||||||
cd /root/build/qemu-$REL/qemu-*/; \
|
cd /root/packages/qemu-$REL/qemu-*/; \
|
||||||
V=$(head -n1 debian/changelog | perl -pe 's/^.*\((.*?)(~bpo[\d\+]*)?\).*$/$1/')+vitastor1; \
|
V=$(head -n1 debian/changelog | perl -pe 's/^.*\((.*?)(~bpo[\d\+]*)?\).*$/$1/')+vitastor1; \
|
||||||
DEBFULLNAME="Vitaliy Filippov <vitalif@yourcmc.ru>" dch -D $REL -v $V 'Plug Vitastor block driver'; \
|
DEBFULLNAME="Vitaliy Filippov <vitalif@yourcmc.ru>" dch -D $REL -v $V 'Plug Vitastor block driver'; \
|
||||||
DEB_BUILD_OPTIONS=nocheck dpkg-buildpackage --jobs=auto -sa; \
|
DEB_BUILD_OPTIONS=nocheck dpkg-buildpackage --jobs=auto -sa; \
|
||||||
rm -rf /root/build/qemu-$REL/qemu-*/
|
rm -rf /root/packages/qemu-$REL/qemu-*/
|
||||||
|
|
|
@ -1,13 +1,8 @@
|
||||||
# Build Vitastor packages for Debian Buster or Bullseye/Sid inside a container
|
# Build Vitastor packages for Debian Buster or Bullseye/Sid inside a container
|
||||||
# cd ..; podman build --build-arg REL=bullseye -v `pwd`/build:/root/build -f debian/vitastor.Dockerfile .
|
# cd ..; podman build --build-arg REL=bullseye -v `pwd`/packages:/root/packages -f debian/vitastor.Dockerfile .
|
||||||
|
|
||||||
ARG REL=bullseye
|
|
||||||
|
|
||||||
FROM debian:$REL
|
FROM debian:$REL
|
||||||
|
|
||||||
# again, it doesn't work otherwise
|
|
||||||
ARG REL=bullseye
|
|
||||||
|
|
||||||
WORKDIR /root
|
WORKDIR /root
|
||||||
|
|
||||||
RUN if [ "$REL" = "buster" ]; then \
|
RUN if [ "$REL" = "buster" ]; then \
|
||||||
|
@ -27,7 +22,7 @@ RUN apt-get -y build-dep qemu
|
||||||
RUN apt-get -y build-dep fio
|
RUN apt-get -y build-dep fio
|
||||||
RUN apt-get --download-only source qemu
|
RUN apt-get --download-only source qemu
|
||||||
RUN apt-get --download-only source fio
|
RUN apt-get --download-only source fio
|
||||||
RUN apt-get -y install libjerasure-dev
|
RUN apt-get -y install libjerasure-dev cmake
|
||||||
|
|
||||||
ADD . /root/vitastor
|
ADD . /root/vitastor
|
||||||
RUN set -e -x; \
|
RUN set -e -x; \
|
||||||
|
@ -35,18 +30,18 @@ RUN set -e -x; \
|
||||||
cd /root/fio-build/; \
|
cd /root/fio-build/; \
|
||||||
rm -rf /root/fio-build/*; \
|
rm -rf /root/fio-build/*; \
|
||||||
dpkg-source -x /root/fio*.dsc; \
|
dpkg-source -x /root/fio*.dsc; \
|
||||||
cd /root/build/qemu-$REL/; \
|
cd /root/packages/qemu-$REL/; \
|
||||||
rm -rf qemu*/; \
|
rm -rf qemu*/; \
|
||||||
dpkg-source -x qemu*.dsc; \
|
dpkg-source -x qemu*.dsc; \
|
||||||
cd /root/build/qemu-$REL/qemu*/; \
|
cd /root/packages/qemu-$REL/qemu*/; \
|
||||||
debian/rules b/configure-stamp; \
|
debian/rules b/configure-stamp; \
|
||||||
cd b/qemu; \
|
cd b/qemu; \
|
||||||
make -j8 qapi; \
|
make -j8 qapi/qapi-builtin-types.h; \
|
||||||
mkdir -p /root/build/vitastor-$REL; \
|
mkdir -p /root/packages/vitastor-$REL; \
|
||||||
rm -rf /root/build/vitastor-$REL/*; \
|
rm -rf /root/packages/vitastor-$REL/*; \
|
||||||
cd /root/build/vitastor-$REL; \
|
cd /root/packages/vitastor-$REL; \
|
||||||
cp -r /root/vitastor vitastor-0.5.4; \
|
cp -r /root/vitastor vitastor-0.5.4; \
|
||||||
ln -s /root/build/qemu-$REL/qemu-*/ vitastor-0.5.4/qemu; \
|
ln -s /root/packages/qemu-$REL/qemu-*/ vitastor-0.5.4/qemu; \
|
||||||
ln -s /root/fio-build/fio-*/ vitastor-0.5.4/fio; \
|
ln -s /root/fio-build/fio-*/ vitastor-0.5.4/fio; \
|
||||||
cd vitastor-0.5.4; \
|
cd vitastor-0.5.4; \
|
||||||
FIO=$(head -n1 fio/debian/changelog | perl -pe 's/^.*\((.*?)\).*$/$1/'); \
|
FIO=$(head -n1 fio/debian/changelog | perl -pe 's/^.*\((.*?)\).*$/$1/'); \
|
||||||
|
@ -60,13 +55,13 @@ RUN set -e -x; \
|
||||||
diff -NaurpbB a b > debian/patches/qemu-fio-headers.patch || true; \
|
diff -NaurpbB a b > debian/patches/qemu-fio-headers.patch || true; \
|
||||||
echo qemu-fio-headers.patch >> debian/patches/series; \
|
echo qemu-fio-headers.patch >> debian/patches/series; \
|
||||||
rm -rf a b; \
|
rm -rf a b; \
|
||||||
rm -rf /root/build/qemu-$REL/qemu*/; \
|
rm -rf /root/packages/qemu-$REL/qemu*/; \
|
||||||
echo "dep:fio=$FIO" > debian/substvars; \
|
echo "dep:fio=$FIO" > debian/substvars; \
|
||||||
echo "dep:qemu=$QEMU" >> debian/substvars; \
|
echo "dep:qemu=$QEMU" >> debian/substvars; \
|
||||||
cd /root/build/vitastor-$REL; \
|
cd /root/packages/vitastor-$REL; \
|
||||||
tar --sort=name --mtime='2020-01-01' --owner=0 --group=0 --exclude=debian -cJf vitastor_0.5.4.orig.tar.xz vitastor-0.5.4; \
|
tar --sort=name --mtime='2020-01-01' --owner=0 --group=0 --exclude=debian -cJf vitastor_0.5.4.orig.tar.xz vitastor-0.5.4; \
|
||||||
cd vitastor-0.5.4; \
|
cd vitastor-0.5.4; \
|
||||||
V=$(head -n1 debian/changelog | perl -pe 's/^.*\((.*?)\).*$/$1/'); \
|
V=$(head -n1 debian/changelog | perl -pe 's/^.*\((.*?)\).*$/$1/'); \
|
||||||
DEBFULLNAME="Vitaliy Filippov <vitalif@yourcmc.ru>" dch -D $REL -v "$V""$REL" "Rebuild for $REL"; \
|
DEBFULLNAME="Vitaliy Filippov <vitalif@yourcmc.ru>" dch -D $REL -v "$V""$REL" "Rebuild for $REL"; \
|
||||||
DEB_BUILD_OPTIONS=nocheck dpkg-buildpackage --jobs=auto -sa; \
|
DEB_BUILD_OPTIONS=nocheck dpkg-buildpackage --jobs=auto -sa; \
|
||||||
rm -rf /root/build/vitastor-$REL/vitastor-*/
|
rm -rf /root/packages/vitastor-$REL/vitastor-*/
|
||||||
|
|
Loading…
Reference in New Issue