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 5. get dmsetup/dmsetup as the binary file