Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installation steps of kvdo + vdo on Debian 11(.3) #47

Closed
tigerblue77 opened this issue Apr 25, 2022 · 11 comments
Closed

Installation steps of kvdo + vdo on Debian 11(.3) #47

tigerblue77 opened this issue Apr 25, 2022 · 11 comments
Assignees

Comments

@tigerblue77
Copy link

tigerblue77 commented Apr 25, 2022

Hello everyone,

I wrote this little script to install kvdo + vdo on Debian 11(.3) (tested with 5.10.0-13 Linux kernel)

# First part : KVDO module
DEPENDENCIES="git make linux-headers-$(uname -r)"
WORK_DIRECTORY="/tmp/kvdo/"

apt update && \
apt install -y $DEPENDENCIES && \
#git clone https://github.com/dm-vdo/kvdo.git $WORK_DIRECTORY && \
git clone https://github.com/tigerblue77/kvdo.git $WORK_DIRECTORY && \
cd $WORK_DIRECTORY && \
make -j $(nproc) -C /usr/src/linux-headers-`uname -r` M=`pwd` && \
cd - && \
cp ${WORK_DIRECTORY}vdo/kvdo.ko /lib/modules/$(uname -r) && \
cp ${WORK_DIRECTORY}uds/uds.ko /lib/modules/$(uname -r) && \
apt autoremove --purge -y $DEPENDENCIES && \
rm -Rf $WORK_DIRECTORY

# Second part : VDO module
DEPENDENCIES="git make gcc uuid-dev libz-dev libdevmapper-dev libblkid-dev"
WORK_DIRECTORY="/tmp/vdo/"

apt update && \
apt install -y $DEPENDENCIES && \
git clone https://github.com/dm-vdo/vdo.git $WORK_DIRECTORY && \
cd $WORK_DIRECTORY && \
make -j $(nproc) && \
make -j $(nproc) install && \
cd - && \
apt autoremove --purge -y $DEPENDENCIES && \
rm -Rf $WORK_DIRECTORY

depmod
#update-initramfs -u
#echo uds >>/etc/modules && \
#echo kvdo >> /etc/modules
modprobe kvdo
modprobe uds

VDO's part questions (second part) :

  • Can anyone tell me if lines 32-34 are needed ?
  • Don't hesitate to suggest any improvment !
  • Once improved, maybe we could add this script to repository's README.md ?

I tested this script with the following LVM volume creation script :

pvcreate /dev/sdb
vgcreate vgdo /dev/sdb
# I set the slab size to 8GB because my server will have between 20 to 60TB of usable space
lvcreate --type vdo --name vdolv --extents 100%VG --virtualsize 200G --config 'allocation/vdo_slab_size_mb=8192' vgdo
mkfs.ext4 -E nodiscard /dev/vgdo/vdolv

I wrote this script with help of those forum topics :

@tigerblue77
Copy link
Author

tigerblue77 commented Apr 26, 2022

Script improved (thanks to this topic) :

install_dependencies() {
    (( ${#} > 1 )) && {
        apt update && \
        apt install -y "$@"
    } || echo "No dependency to install"
}

clean_dependencies() {
    (( ${#} > 1 )) && {
        apt autoremove --purge -y "$@"
    } || echo "No dependency to remove"
}

clone_repo() {
    (( ${#} == 1 )) && {
        local TEMPORARY_DIRECTORY=$(mktemp -d "/tmp/${1/*\/}.XXX") && \
        git clone "$1" "${TEMPORARY_DIRECTORY}" && \
        cd "${TEMPORARY_DIRECTORY}" && \
        pwd -P
    }
}

# Usage: clean $WORK_DIRECTORY $DEPENDENCIES
clean() {
    (( ${#} >= 1 )) && {
        clean_dependencies "${*:2}" > /dev/null 2>&1 &
        rm -Rf "$1" &
        wait
    }
}

# First part : KVDO module
DEPENDENCIES="git make linux-headers-$(uname -r)"
install_dependencies $DEPENDENCIES > /dev/null 2>&1
WORK_DIRECTORY="$(clone_repo https://github.com/tigerblue77/kvdo.git)"
(
    cd "${WORK_DIRECTORY}" && \
    make -j"$(nproc)" -C "/usr/src/linux-headers-$(uname -r)" M="${WORK_DIRECTORY}"
) > kvdo_build.log 2>&1

cp "${WORK_DIRECTORY}/vdo/kvdo.ko" "${WORK_DIRECTORY}/uds/uds.ko" "/lib/modules/$(uname -r)"
clean "${WORK_DIRECTORY}" $DEPENDENCIES

# Second Part: VDO Module
DEPENDENCIES="git make gcc uuid-dev libz-dev libdevmapper-dev libblkid-dev"
install_dependencies $DEPENDENCIES > /dev/null 2>&1
WORK_DIRECTORY="$(clone_repo https://github.com/dm-vdo/vdo.git)"
(
    cd "${WORK_DIRECTORY}" && \
    make -j"$(nproc)" && \
    make -j"$(nproc)" install
) > vdo_build.log 2>&1
clean "${WORK_DIRECTORY}" $DEPENDENCIES

depmod --quick
#update-initramfs -u
#echo uds >>/etc/modules && \
#echo kvdo >> /etc/modules
modprobe kvdo
modprobe uds

It now :

  • creates kvdo_build.log and vdo_build.log files instead of writing full output to console.
  • runs lines 26 and 27 in parallel (as I suggested in this issue)

@rhawalsh
Copy link
Member

rhawalsh commented May 6, 2022

...
#update-initramfs -u
#echo uds >>/etc/modules && \
#echo kvdo >> /etc/modules

These lines are only needed if you intend to load the uds and kvdo modules at early boot time (e.g. if you put VDO underneath the rootfs, somehow, but that's not recommended right now)

...

VDO's part questions (second part) :

  • Can anyone tell me if lines 32-34 are needed ?

Left a comment inline. Only needed if you intend to load the modules at early boot time, like if you were using VDO for a rootfs-like implementation.

Regarding tweaks to the script, I don't have anything over and above what you have shared so far. If I get some spare time I can look a bit closer at it to see if anything stands out to me, but on the surface it looks like it should be fine.

@tigerblue77
Copy link
Author

tigerblue77 commented May 6, 2022

Thanks for taking a look and for explanation!

If it seems fine to you, maybe we could add it to the documentation/wiki, creating a new "Debian VDO Integration Guide" section that would be useful for users of all Debian-based distributions at the same time.

Of course, if you have time to test and improve the script you're welcome !

Also, do you have any idea about upgrading ? Do I just need to run the same script or do I have to delete/uninstall some things before upgrading ? I plan using VDO for my personal server storage so I want to be sure my data is safe 😅 thanks per advance !

@tigerblue77
Copy link
Author

tigerblue77 commented Aug 28, 2022

Hello there !

I updated the script to use DKMS so that the UDS and KVDO kernel modules are kept on kernel upgrade. Don't hesitate to suggest any improvment ! 😁

This one works for kvdo 8.1.1.371 but not for 8.2.0.18 as uds directory was removed/moved

install_dependencies() {
    (( ${#} > 1 )) && {
        apt update && \
        apt install -y "$@"
    } || echo "No dependency to install"
}

clean_dependencies() {
    (( ${#} > 1 )) && {
        apt autoremove --purge -y "$@"
    } || echo "No dependency to remove"
}

clone_repo() {
    (( ${#} == 1 )) && {
        local TEMPORARY_DIRECTORY=$(mktemp -d "/tmp/${1/*\/}.XXX") && \
        git clone "$1" "${TEMPORARY_DIRECTORY}" && \
        cd "${TEMPORARY_DIRECTORY}" && \
        pwd -P
    }
}

# Usage: clean $WORK_DIRECTORY $DEPENDENCIES $OTHERS $...
clean() {
    (( ${#} >= 1 )) && {
        clean_dependencies "${*:2}" > /dev/null 2>&1 &
        rm -Rf "$1" &
        wait
    }
}

# First part : KVDO module
DEPENDENCIES="make linux-headers-$(uname -r)"
install_dependencies $DEPENDENCIES dkms > /dev/null 2>&1
KVDO_module_version_to_install="8.1.1.371.fixed" # "8.2.0.18"
KVDO_ARCHIVE_NAME="kvdo.tar.gz"
KVDO_ARCHIVE_PATH="/tmp/$KVDO_ARCHIVE_NAME"
KVDO_MODULE_PATH="/usr/src"
wget -O $KVDO_ARCHIVE_PATH "https://github.com/tigerblue77/kvdo/archive/refs/tags/$KVDO_module_version_to_install.tar.gz" && \
tar -xf $KVDO_ARCHIVE_PATH -C $KVDO_MODULE_PATH
echo "PACKAGE_NAME=\"kvdo\"
PACKAGE_VERSION=\"$KVDO_module_version_to_install\"
AUTOINSTALL=\"yes\"

BUILT_MODULE_NAME[0]=\"uds\"
BUILT_MODULE_LOCATION[0]=\"uds\"
DEST_MODULE_LOCATION[0]=\"/kernel/drivers/block/\"
STRIP[0]=\"no\"

BUILT_MODULE_NAME[1]=\"kvdo\"
BUILT_MODULE_LOCATION[1]=\"vdo\"
DEST_MODULE_LOCATION[1]=\"/kernel/drivers/block/\"
STRIP[1]=\"no\"" > "$KVDO_MODULE_PATH/kvdo-$KVDO_module_version_to_install/dkms.conf"
dkms add "kvdo/$KVDO_module_version_to_install"
dkms build "kvdo/$KVDO_module_version_to_install"
dkms install "kvdo/$KVDO_module_version_to_install"

#cp "${WORK_DIRECTORY}/vdo/kvdo.ko" "${WORK_DIRECTORY}/uds/uds.ko" "/lib/modules/$(uname -r)"
clean $DEPENDENCIES $KVDO_ARCHIVE_PATH

# Second Part: VDO Module
DEPENDENCIES="git make gcc uuid-dev libz-dev libdevmapper-dev libblkid-dev"
install_dependencies $DEPENDENCIES > /dev/null 2>&1
WORK_DIRECTORY="$(clone_repo https://github.com/dm-vdo/vdo.git)"
(
    cd "${WORK_DIRECTORY}" && \
    make -j"$(nproc)" && \
    make -j"$(nproc)" install
) > vdo_build.log 2>&1
clean "${WORK_DIRECTORY}" $DEPENDENCIES

depmod --quick
#update-initramfs -u
#echo uds >>/etc/modules && \
#echo kvdo >> /etc/modules

# No longer needed thanks to DKMS
#modprobe kvdo
#modprobe uds

Used sources:

@tigerblue77
Copy link
Author

For v8.2.0.18, this should work :

install_dependencies() {
    (( ${#} > 1 )) && {
        apt update && \
        apt install -y "$@"
    } || echo "No dependency to install"
}

clean_dependencies() {
    (( ${#} > 1 )) && {
        apt autoremove --purge -y "$@"
    } || echo "No dependency to remove"
}

clone_repo() {
    (( ${#} == 1 )) && {
        local TEMPORARY_DIRECTORY=$(mktemp -d "/tmp/${1/*\/}.XXX") && \
        git clone "$1" "${TEMPORARY_DIRECTORY}" && \
        cd "${TEMPORARY_DIRECTORY}" && \
        pwd -P
    }
}

# Usage: clean $WORK_DIRECTORY $DEPENDENCIES $OTHERS $...
clean() {
    (( ${#} >= 1 )) && {
        clean_dependencies "${*:2}" > /dev/null 2>&1 &
        rm -Rf "$1" &
        wait
    }
}

# First part : KVDO module
apt update && apt install -y dkms
DEPENDENCIES="make linux-headers-$(uname -r)"
install_dependencies $DEPENDENCIES > /dev/null 2>&1
KVDO_module_version_to_install="8.2.0.18.fixed" # "8.2.0.18"
KVDO_ARCHIVE_NAME="kvdo.tar.gz"
KVDO_ARCHIVE_PATH="/tmp/$KVDO_ARCHIVE_NAME"
KVDO_MODULE_PATH="/usr/src"
wget -O $KVDO_ARCHIVE_PATH "https://github.com/tigerblue77/kvdo/archive/refs/tags/$KVDO_module_version_to_install.tar.gz" && \
tar -xf $KVDO_ARCHIVE_PATH -C $KVDO_MODULE_PATH
echo "PACKAGE_NAME=\"kvdo\"
PACKAGE_VERSION=\"$KVDO_module_version_to_install\"
AUTOINSTALL=\"yes\"

BUILT_MODULE_NAME[0]=\"kvdo\"
BUILT_MODULE_LOCATION[0]=\"vdo\"
DEST_MODULE_LOCATION[0]=\"/kernel/drivers/block/\"
BUILD_DEPENDS[0]=LZ4_COMPRESS
BUILD_DEPENDS[0]=LZ4_DECOMPRESS
STRIP[0]=\"no\"" > "$KVDO_MODULE_PATH/kvdo-$KVDO_module_version_to_install/dkms.conf"
dkms add "kvdo/$KVDO_module_version_to_install"
dkms build "kvdo/$KVDO_module_version_to_install"
dkms install "kvdo/$KVDO_module_version_to_install"

#cp "${WORK_DIRECTORY}/vdo/kvdo.ko" "${WORK_DIRECTORY}/uds/uds.ko" "/lib/modules/$(uname -r)"
clean $DEPENDENCIES $KVDO_ARCHIVE_PATH

# Second Part: VDO Module
DEPENDENCIES="git make gcc uuid-dev libz-dev libdevmapper-dev libblkid-dev"
install_dependencies $DEPENDENCIES > /dev/null 2>&1
WORK_DIRECTORY="$(clone_repo https://github.com/dm-vdo/vdo.git)"
(
    cd "${WORK_DIRECTORY}" && \
    make -j"$(nproc)" && \
    make -j"$(nproc)" install
) > vdo_build.log 2>&1
clean "${WORK_DIRECTORY}" $DEPENDENCIES

depmod --quick
#update-initramfs -u
#echo uds >>/etc/modules && \
#echo kvdo >> /etc/modules

# No longer needed thanks to DKMS
#modprobe kvdo
#modprobe uds

But give me the following errors :

DKMS make.log for kvdo-8.2.0.18.fixed for kernel 5.10.0-14-amd64 (x86_64)
dim. 28 août 2022 22:02:22 CEST
make : on entre dans le répertoire « /usr/src/linux-headers-5.10.0-14-amd64 »
  CC [M]  /var/lib/dkms/kvdo/8.2.0.18.fixed/build/vdo/action-manager.o
  CC [M]  /var/lib/dkms/kvdo/8.2.0.18.fixed/build/vdo/admin-completion.o
  CC [M]  /var/lib/dkms/kvdo/8.2.0.18.fixed/build/vdo/admin-state.o
  CC [M]  /var/lib/dkms/kvdo/8.2.0.18.fixed/build/vdo/allocation-selector.o
  CC [M]  /var/lib/dkms/kvdo/8.2.0.18.fixed/build/vdo/bio.o
  CC [M]  /var/lib/dkms/kvdo/8.2.0.18.fixed/build/vdo/block-allocator.o
  CC [M]  /var/lib/dkms/kvdo/8.2.0.18.fixed/build/vdo/block-map-format.o
  CC [M]  /var/lib/dkms/kvdo/8.2.0.18.fixed/build/vdo/block-map-page.o
  CC [M]  /var/lib/dkms/kvdo/8.2.0.18.fixed/build/vdo/block-map-recovery.o
In file included from /var/lib/dkms/kvdo/8.2.0.18.fixed/build/vdo/block-map-format.c:13:
/var/lib/dkms/kvdo/8.2.0.18.fixed/build/vdo/num-utils.h:16:10: fatal error: linux/math.h: Aucun fichier ou dossier de ce type
   16 | #include <linux/math.h>
      |          ^~~~~~~~~~~~~~
compilation terminated.
make[3]: *** [/usr/src/linux-headers-5.10.0-14-common/scripts/Makefile.build:291 : /var/lib/dkms/kvdo/8.2.0.18.fixed/build/vdo/block-map-format.o] Erreur 1
make[3]: *** Attente des tâches non terminées....
In file included from /var/lib/dkms/kvdo/8.2.0.18.fixed/build/vdo/bio.c:16:
/var/lib/dkms/kvdo/8.2.0.18.fixed/build/vdo/vio.h:21:24: error: ‘BIO_MAX_VECS’ undeclared here (not in a function); did you mean ‘BIO_MAX_PAGES’?
   21 |  MAX_BLOCKS_PER_VIO = (BIO_MAX_VECS << PAGE_SHIFT) / VDO_BLOCK_SIZE,
      |                        ^~~~~~~~~~~~
      |                        BIO_MAX_PAGES
make[3]: *** [/usr/src/linux-headers-5.10.0-14-common/scripts/Makefile.build:291 : /var/lib/dkms/kvdo/8.2.0.18.fixed/build/vdo/bio.o] Erreur 1
In file included from /var/lib/dkms/kvdo/8.2.0.18.fixed/build/vdo/block-allocator.c:17:
/var/lib/dkms/kvdo/8.2.0.18.fixed/build/vdo/num-utils.h:16:10: fatal error: linux/math.h: Aucun fichier ou dossier de ce type
   16 | #include <linux/math.h>
      |          ^~~~~~~~~~~~~~
compilation terminated.
make[3]: *** [/usr/src/linux-headers-5.10.0-14-common/scripts/Makefile.build:291 : /var/lib/dkms/kvdo/8.2.0.18.fixed/build/vdo/block-allocator.o] Erreur 1
In file included from /var/lib/dkms/kvdo/8.2.0.18.fixed/build/vdo/block-map-recovery.c:15:
/var/lib/dkms/kvdo/8.2.0.18.fixed/build/vdo/num-utils.h:16:10: fatal error: linux/math.h: Aucun fichier ou dossier de ce type
   16 | #include <linux/math.h>
      |          ^~~~~~~~~~~~~~
compilation terminated.
make[3]: *** [/usr/src/linux-headers-5.10.0-14-common/scripts/Makefile.build:291 : /var/lib/dkms/kvdo/8.2.0.18.fixed/build/vdo/block-map-recovery.o] Erreur 1
make[2]: *** [/usr/src/linux-headers-5.10.0-14-common/scripts/Makefile.build:508 : /var/lib/dkms/kvdo/8.2.0.18.fixed/build/vdo] Erreur 2
make[1]: *** [/usr/src/linux-headers-5.10.0-14-common/Makefile:1846 : /var/lib/dkms/kvdo/8.2.0.18.fixed/build] Erreur 2
make: *** [/usr/src/linux-headers-5.10.0-14-common/Makefile:185 : __sub-make] Erreur 2
make : on quitte le répertoire « /usr/src/linux-headers-5.10.0-14-amd64 »

@tigerblue77
Copy link
Author

Hello @rhawalsh,
I hope you are doing well.
Did you have time to look at my last message ? I still get the same error with KVDO v8.2.0.21 but not with v8.1.1.371. Thanks in advance :)

@kondas
Copy link

kondas commented Dec 4, 2022

Hello @tigerblue77, thanks for the effort here. I was able to build and install 8.1.1.371 with Your script. According to this BIO_MAX_VECS has been renamed to BIO_MAX_PAGES in the block subsystem. Could You try to apply a renaming patch on the sources, and give a try? Thanks in advance.

@tigerblue77
Copy link
Author

tigerblue77 commented Dec 4, 2022

Hello @kondas, thanks for your answer. I'm very motivated by this project but I don't manage to make it work perfectly on Debian...
So, I just applied the renaming patch you advised. Unfortunately, I still have fatal error: linux/math.h: No such file or directory errors which I didn't have with v8.1.1.371 (just re-tested yet). Here is the command I ran for both versions :

make -j"$(nproc)" -C "/usr/src/linux-headers-$(uname -r)" M=`pwd`

And output for v8.2.0.18 :

M=/var/lib/dkms/kvdo/8.2.0.18.fixed/build
make : on entre dans le répertoire « /usr/src/linux-headers-5.10.0-14-amd64 »
  CC [M]  /var/lib/dkms/kvdo/8.2.0.18.fixed/build/vdo/bio.o
  CC [M]  /var/lib/dkms/kvdo/8.2.0.18.fixed/build/vdo/block-allocator.o
  CC [M]  /var/lib/dkms/kvdo/8.2.0.18.fixed/build/vdo/block-map-format.o
  CC [M]  /var/lib/dkms/kvdo/8.2.0.18.fixed/build/vdo/block-map-recovery.o
  CC [M]  /var/lib/dkms/kvdo/8.2.0.18.fixed/build/vdo/block-map-tree.o
  CC [M]  /var/lib/dkms/kvdo/8.2.0.18.fixed/build/vdo/block-map.o
  CC [M]  /var/lib/dkms/kvdo/8.2.0.18.fixed/build/vdo/buffer.o
  CC [M]  /var/lib/dkms/kvdo/8.2.0.18.fixed/build/vdo/buffered-reader.o
In file included from /var/lib/dkms/kvdo/8.2.0.18.fixed/build/vdo/block-map-format.c:13:
/var/lib/dkms/kvdo/8.2.0.18.fixed/build/vdo/num-utils.h:16:10: fatal error: linux/math.h: Aucun fichier ou dossier de ce type
   16 | #include <linux/math.h>
      |          ^~~~~~~~~~~~~~
compilation terminated.
make[3]: *** [/usr/src/linux-headers-5.10.0-14-common/scripts/Makefile.build:291 : /var/lib/dkms/kvdo/8.2.0.18.fixed/build/vdo/block-map-format.o] Erreur 1
make[3]: *** Attente des tâches non terminées....
In file included from /var/lib/dkms/kvdo/8.2.0.18.fixed/build/vdo/block-map-recovery.c:15:
/var/lib/dkms/kvdo/8.2.0.18.fixed/build/vdo/num-utils.h:16:10: fatal error: linux/math.h: Aucun fichier ou dossier de ce type
   16 | #include <linux/math.h>
      |          ^~~~~~~~~~~~~~
compilation terminated.
make[3]: *** [/usr/src/linux-headers-5.10.0-14-common/scripts/Makefile.build:291 : /var/lib/dkms/kvdo/8.2.0.18.fixed/build/vdo/block-map-recovery.o] Erreur 1
In file included from /var/lib/dkms/kvdo/8.2.0.18.fixed/build/vdo/block-allocator.c:17:
/var/lib/dkms/kvdo/8.2.0.18.fixed/build/vdo/num-utils.h:16:10: fatal error: linux/math.h: Aucun fichier ou dossier de ce type
   16 | #include <linux/math.h>
      |          ^~~~~~~~~~~~~~
compilation terminated.
make[3]: *** [/usr/src/linux-headers-5.10.0-14-common/scripts/Makefile.build:291 : /var/lib/dkms/kvdo/8.2.0.18.fixed/build/vdo/block-allocator.o] Erreur 1
In file included from /var/lib/dkms/kvdo/8.2.0.18.fixed/build/vdo/block-map-tree.c:22:
/var/lib/dkms/kvdo/8.2.0.18.fixed/build/vdo/num-utils.h:16:10: fatal error: linux/math.h: Aucun fichier ou dossier de ce type
   16 | #include <linux/math.h>
      |          ^~~~~~~~~~~~~~
compilation terminated.
make[3]: *** [/usr/src/linux-headers-5.10.0-14-common/scripts/Makefile.build:291 : /var/lib/dkms/kvdo/8.2.0.18.fixed/build/vdo/block-map-tree.o] Erreur 1
In file included from /var/lib/dkms/kvdo/8.2.0.18.fixed/build/vdo/block-map.c:20:
/var/lib/dkms/kvdo/8.2.0.18.fixed/build/vdo/num-utils.h:16:10: fatal error: linux/math.h: Aucun fichier ou dossier de ce type
   16 | #include <linux/math.h>
      |          ^~~~~~~~~~~~~~
compilation terminated.
make[3]: *** [/usr/src/linux-headers-5.10.0-14-common/scripts/Makefile.build:291 : /var/lib/dkms/kvdo/8.2.0.18.fixed/build/vdo/block-map.o] Erreur 1
make[2]: *** [/usr/src/linux-headers-5.10.0-14-common/scripts/Makefile.build:508 : /var/lib/dkms/kvdo/8.2.0.18.fixed/build/vdo] Erreur 2
make[1]: *** [/usr/src/linux-headers-5.10.0-14-common/Makefile:1846 : /var/lib/dkms/kvdo/8.2.0.18.fixed/build] Erreur 2
make: *** [/usr/src/linux-headers-5.10.0-14-common/Makefile:185 : __sub-make] Erreur 2
make : on quitte le répertoire « /usr/src/linux-headers-5.10.0-14-amd64 »

=> I just checked KVDO v8.2.0.18/v8.2.0.21/v8.2.1.2 releases archives and this patch is not applied in any of them. That's why I also have this bug on my fork (which only include a fix for 5.10 kernel which is currently used by Debian 11 stable).
=> Don't hesitate if you have any idea about this linux/math.h library error. I'm using a Debian 11 fresh install for my tests.

@kondas
Copy link

kondas commented Dec 4, 2022

I can compile the module successfully from Your 8.2.1.2.fixed archive, after changing BIO_MAX_VECS to BIO_MAX_PAGES and completely remove the failing include from num-utils.h. Disclaimer: I have no idea what am I doing, but it compiles without warnings.

@tigerblue77
Copy link
Author

Thanks to @kondas, I added some -new- fixes to :

This issue has drifted a bit, I'm reopening it here : #64

@munish259272
Copy link

munish259272 commented Jul 20, 2024

This is what worked for me in debain 12.6

git clone https://github.com/tigerblue77/kvdo.git
cd kvdo/

TO fix : error: ‘BIO_MAX_PAGES’ undeclared here (not in a function); did you mean ‘BIO_MAX_VECS’?

find /home/munish259272/Extrasoftware/test/kvdo/vdo -type f -exec sed -i 's/BIO_MAX_PAGES/BIO_MAX_VECS/g' {} \;

TO fix : Skipping BTF generation for /home/munish259272/Extrasoftware/test/kvdo/vdo/kvdo.ko due to unavailability of vmlinux

sudo ln -s /sys/kernel/btf/vmlinux /usr/src/linux-headers-uname -r/vmlinux

unix.stackexchange.com TO fix : /bin/sh: 1: ./tools/bpf/resolve_btfids/resolve_btfids: not found

sudo apt-get install linux-source
cd /usr/src
tar xvf linux-source-6.1.tar.xz ##extract your specific source file
cd linux-source-6.1/tools/bpf/resolve_btfids
sudo -H make
mkdir -p /usr/src/linux-headers-`uname -r`/tools/bpf/resolve_btfids
sudo ln -s $(realpath resolve_btfids) /usr/src/linux-headers-`uname -r`/tools/bpf/resolve_btfids/resolve_btfids

now we can compile and copy kvdo.ko

cd kvdo/
make -j $(nproc) -C /usr/src/linux-headers-`uname -r` M=`pwd`
sudo cp /home/munish259272/Extrasoftware/test/kvdo/vdo/kvdo.ko  /lib/modules/$(uname -r)

did not face any issue with vdo

git clone https://github.com/dm-vdo/vdo
cd vdo
make -j"$(nproc)"
sudo make -j"$(nproc)" install

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants