]> glassweightruler.freedombox.rocks Git - Ventoy.git/blob - DMSETUP/build.txt
update
[Ventoy.git] / DMSETUP / build.txt
1 Build a static linked, small dmsetup tool
2
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
7
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
14
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:
21 #ifndef UINT32_MAX
22 #define UINT32_MAX (4294967295U)
23 #endif
24
25 #ifndef UINT64_C
26 #define UINT64_C(c) c ## ULL
27 #endif
28
29 4. make
30 5. strip dmsetup/dmsetup
31 6. get dmsetup/dmsetup as the dmsetup32 binary file
32
33
34
35
36
37
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
44 4. make
45 5. strip dmsetup/dmsetup.static
46 6. get dmsetup/dmsetup.static as the dmsetup64 binary file
47
48
49