]> glassweightruler.freedombox.rocks Git - Ventoy.git/blob - DMSETUP/build.txt
github ai version 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 Environment ========
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 1. extract device mapper source code
40 2. ./configure --disable-nls --disable-selinux --disable-shared --enable-static_link CC='gcc -specs /usr/local/musl/lib/musl-gcc.specs'
41 3. touch include/linux/limits.h include/linux/types.h
42 echo '#include <sys/mount.h>' > include/linux/fs.h
43 4. make
44 5. strip --strip-all dmsetup/dmsetup.static
45 6. get dmsetup/dmsetup.static as the dmsetup64 binary file
46
47
48 ======================== Build for arm64 dmsetup =========================
49 1. extract device mapper source code
50 2. ./configure CC=aarch64-linux-gcc --target=arm --host=x86_64-linux-gnu --disable-nls --disable-selinux --disable-shared --enable-static_link
51 3. modify include/configure.h file
52 --- delete the line with "#define malloc rpl_malloc"
53 4. make
54 5. aarch64-linux-strip dmsetup/dmsetup.static
55 6. get dmsetup/dmsetup.static as the dmsetupaa64 binary file
56
57
58 ======================== Build for mips64 dmsetup =========================
59 1. extract device mapper source code
60 2. ./configure CC="mips64el-linux-musl-gcc -mips64r2 -mabi=64" --target=mips --host=x86_64-linux-gnu --disable-nls --disable-selinux --disable-shared --enable-static_link
61 3. modify include/configure.h file
62 --- delete the line with "#define malloc rpl_malloc"
63 4. make
64 5. mips64el-linux-musl-strip dmsetup/dmsetup.static
65 6. get dmsetup/dmsetup.static as the dmsetupm64e binary file
66
67
68
69
70