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 on Debian 11(.3) #53

Open
tigerblue77 opened this issue Apr 25, 2022 · 1 comment
Open

Installation steps of kvdo on Debian 11(.3) #53

tigerblue77 opened this issue Apr 25, 2022 · 1 comment
Assignees

Comments

@tigerblue77
Copy link

tigerblue77 commented Apr 25, 2022

Hello everyone,

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

DEPENDANCIES="git make linux-headers-$(uname -r)"
WORK_DIRECTORY="/tmp/kvdo/"

apt update && \
apt install -y $DEPENDANCIES && \
#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 $DEPENDANCIES && \
rm -Rf $WORK_DIRECTORY

depmod
#update-initramfs -u
#echo uds >>/etc/modules && \
#echo kvdo >> /etc/modules
modprobe kvdo
modprobe uds
  • Line 6 is commented while waiting for my pull request Restore <5.15 kernels support #52 to be merged
  • Can anyone tell me if lines 17-19 are needed ?
  • Is there a way to make the 13 and 14 lines run in parallel while keeping line 12 "&&" ? (solved in comments)
  • Don't hesitate to suggest any improvment !
  • Once improved, maybe we could add this script to repository's README.md ?
  • This script is part of my full kvdo + vdo installation script, don't hesitate to check the issue I opened on vdo's github repository

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 )) && {
        TEMPDIR=$(mktemp -d "/tmp/${1/*\/}.XXX") && \
        git clone "$1" "${TEMPDIR}" && \
        cd "$TEMPDIR" && \
        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_DIR="$(clone_repo https://github.com/tigerblue77/kvdo.git)"
(
    cd "${WORK_DIR}" && \
    make -j"$(nproc)" -C "/usr/src/linux-headers-$(uname -r)" M="${WORK_DIR}"
) > kvdo_build.log 2>&1

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

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

It now :

  • creates kvdo_build.log file instead of writing full output to console.
  • runs lines 26 and 27 in parallel 26 and 27 run in parallel

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

2 participants