1 Build a static linked, small dmsetup tool
3 ======== Source Code ========
4 use an old version of dmsetup
5 http://vault.centos.org/5.3/os/SRPMS/device-mapper-1.02.28-2.el5.src.rpm
6 https://www.fefe.de/dietlibc/dietlibc-0.34.tar.xz
8 ======== Build Envrioment ========
9 build for 32bit, static linked with dietlibc
10 1. install centos 6.10 i386 with CentOS-6.10-i386-bin-DVD1.iso
11 2. yum install gcc kernel-devel package
12 3. install dietc libc (just make && make install)
13 4. export PATH=$PATH:/opt/diet/bin
15 ======== Build Step ========
16 1. extract device mapper source code
17 2. CC="diet gcc" ./configure --disable-nls --disable-selinux --disable-shared
18 3. modify include/configure.h file
19 --- delete the line with "#define malloc rpl_malloc"
20 --- add 2 defines as follow:
22 #define UINT32_MAX (4294967295U)
26 #define UINT64_C(c) c ## ULL
30 5. strip dmsetup/dmsetup
31 6. get dmsetup/dmsetup as the dmsetup32 binary file
38 ======================== Build for 64bit dmsetup =========================
39 https://www.uclibc.org/downloads/binaries/0.9.30.1/mini-native-x86_64.tar.bz2
40 1. extract device mapper source code
41 2. extract mini-native-x86_64.tar.bz2
42 3. chroot to mini-native-x86_64
43 3. ./configure --disable-nls --disable-selinux --disable-shared --enable-static_link
45 5. strip dmsetup/dmsetup.static
46 6. get dmsetup/dmsetup.static as the dmsetup64 binary file