From 6222779b52fd0e335d5a3e5132b5aa36b9cb3ac0 Mon Sep 17 00:00:00 2001 From: Vitaliy Filippov Date: Sun, 18 Jun 2023 19:21:26 +0300 Subject: [PATCH] Support debian bookworm (12) build --- debian/build-vitastor-bookworm.sh | 7 +++++++ debian/patched-qemu.Dockerfile | 26 +++++++++----------------- debian/vitastor.Dockerfile | 5 +++-- 3 files changed, 19 insertions(+), 19 deletions(-) create mode 100755 debian/build-vitastor-bookworm.sh diff --git a/debian/build-vitastor-bookworm.sh b/debian/build-vitastor-bookworm.sh new file mode 100755 index 00000000..668381dc --- /dev/null +++ b/debian/build-vitastor-bookworm.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +cat < vitastor.Dockerfile > ../Dockerfile +cd .. +mkdir -p packages +sudo podman build --build-arg REL=bookworm -v `pwd`/packages:/root/packages -f Dockerfile . +rm Dockerfile diff --git a/debian/patched-qemu.Dockerfile b/debian/patched-qemu.Dockerfile index faaf7a1d..2aede375 100644 --- a/debian/patched-qemu.Dockerfile +++ b/debian/patched-qemu.Dockerfile @@ -1,4 +1,4 @@ -# Build patched QEMU for Debian Buster or Bullseye/Sid inside a container +# Build patched QEMU for Debian inside a container # cd ..; podman build --build-arg REL=bullseye -v `pwd`/packages:/root/packages -f debian/patched-qemu.Dockerfile . ARG REL= @@ -15,17 +15,19 @@ RUN if [ "$REL" = "buster" -o "$REL" = "bullseye" ]; then \ echo 'Pin-Priority: 500' >> /etc/apt/preferences; \ fi; \ grep '^deb ' /etc/apt/sources.list | perl -pe 's/^deb/deb-src/' >> /etc/apt/sources.list; \ + perl -i -pe 's/Types: deb$/Types: deb deb-src/' /etc/apt/sources.list.d/debian.sources || true; \ echo 'APT::Install-Recommends false;' >> /etc/apt/apt.conf; \ echo 'APT::Install-Suggests false;' >> /etc/apt/apt.conf RUN apt-get update -RUN apt-get -y install qemu fio liburing1 liburing-dev libgoogle-perftools-dev devscripts +RUN apt-get -y install qemu fio liburing-dev libgoogle-perftools-dev devscripts RUN apt-get -y build-dep qemu # To build a custom version #RUN cp /root/packages/qemu-orig/* /root RUN apt-get --download-only source qemu -ADD patches/qemu-5.0-vitastor.patch patches/qemu-5.1-vitastor.patch patches/qemu-6.1-vitastor.patch src/qemu_driver.c /root/vitastor/patches/ +ADD patches /root/vitastor/patches +ADD src/qemu_driver.c /root/vitastor/src/qemu_driver.c RUN set -e; \ apt-get install -y wget; \ wget -q -O /etc/apt/trusted.gpg.d/vitastor.gpg https://vitastor.io/debian/pubkey.gpg; \ @@ -37,23 +39,13 @@ RUN set -e; \ rm -rf /root/packages/qemu-$REL/*; \ cd /root/packages/qemu-$REL; \ dpkg-source -x /root/qemu*.dsc; \ - if ls -d /root/packages/qemu-$REL/qemu-5.0*; then \ - D=$(ls -d /root/packages/qemu-$REL/qemu-5.0*); \ - cp /root/vitastor/patches/qemu-5.0-vitastor.patch $D/debian/patches; \ - echo qemu-5.0-vitastor.patch >> $D/debian/patches/series; \ - elif ls /root/packages/qemu-$REL/qemu-6.1*; then \ - D=$(ls -d /root/packages/qemu-$REL/qemu-6.1*); \ - cp /root/vitastor/patches/qemu-6.1-vitastor.patch $D/debian/patches; \ - echo qemu-6.1-vitastor.patch >> $D/debian/patches/series; \ - else \ - cp /root/vitastor/patches/qemu-5.1-vitastor.patch /root/packages/qemu-$REL/qemu-*/debian/patches; \ - P=`ls -d /root/packages/qemu-$REL/qemu-*/debian/patches`; \ - echo qemu-5.1-vitastor.patch >> $P/series; \ - fi; \ + QEMU_VER=$(ls -d qemu*/ | perl -pe 's!^.*(\d+\.\d+).*!$1!'); \ + cp /root/vitastor/patches/qemu-$QEMU_VER-vitastor.patch qemu-*/debian/patches; \ + echo qemu-$QEMU_VER-vitastor.patch >> qemu-*/debian/patches/series; \ cd /root/packages/qemu-$REL/qemu-*/; \ quilt push -a; \ quilt add block/vitastor.c; \ - cp /root/vitastor/patches/qemu_driver.c block/vitastor.c; \ + cp /root/vitastor/src/qemu_driver.c block/vitastor.c; \ quilt refresh; \ V=$(head -n1 debian/changelog | perl -pe 's/^.*\((.*?)(~bpo[\d\+]*)?\).*$/$1/')+vitastor1; \ DEBEMAIL="Vitaliy Filippov " dch -D $REL -v $V 'Plug Vitastor block driver'; \ diff --git a/debian/vitastor.Dockerfile b/debian/vitastor.Dockerfile index 14d350c5..4163b38f 100644 --- a/debian/vitastor.Dockerfile +++ b/debian/vitastor.Dockerfile @@ -1,4 +1,4 @@ -# Build Vitastor packages for Debian Buster or Bullseye/Sid inside a container +# Build Vitastor packages for Debian inside a container # cd ..; podman build --build-arg REL=bullseye -v `pwd`/packages:/root/packages -f debian/vitastor.Dockerfile . ARG REL= @@ -15,11 +15,12 @@ RUN if [ "$REL" = "buster" -o "$REL" = "bullseye" ]; then \ echo 'Pin-Priority: 500' >> /etc/apt/preferences; \ fi; \ grep '^deb ' /etc/apt/sources.list | perl -pe 's/^deb/deb-src/' >> /etc/apt/sources.list; \ + perl -i -pe 's/Types: deb$/Types: deb deb-src/' /etc/apt/sources.list.d/debian.sources || true; \ echo 'APT::Install-Recommends false;' >> /etc/apt/apt.conf; \ echo 'APT::Install-Suggests false;' >> /etc/apt/apt.conf RUN apt-get update -RUN apt-get -y install fio liburing1 liburing-dev libgoogle-perftools-dev devscripts +RUN apt-get -y install fio liburing-dev libgoogle-perftools-dev devscripts RUN apt-get -y build-dep fio RUN apt-get --download-only source fio RUN apt-get update && apt-get -y install libjerasure-dev cmake libibverbs-dev libisal-dev