#!/bin/sh

#bash 2.x too old, hence compiled bash 4.4.18.

tar -xf LVM2.2.02.177.tgz
cd LVM2.2.02.177

./configure --prefix=/usr --localstatedir=/var --sysconfdir=/etc --sbindir=/sbin --libdir=/lib --build=x86_64-pc-linux-gnu --disable-selinux --disable-readline --enable-static_link --disable-udev-systemd-background-jobs  --disable-dbus-service --with-raid=none --with-udev-prefix="" --with-udevdir=/lib/udev/rules.d --with-thin=none --with-lvm1=internal --with-cache=none --with-mirrors=internal --with-snapshots=internal --with-pool=none --with-lvm1=none --disable-nls --disable-pkgconfig

make device-mapper

strip --strip-unneeded tools/dmsetup.static

cp -a -f tools/dmsetup.static /usr/sbin/dmsetup
sync
