]> git.friedersdorff.com Git - max/initramfs.git/blob - build_deps.sh
2223340ee0cb08b40916aaf9a66ebf1ae467b661
[max/initramfs.git] / build_deps.sh
1 #!/bin/bash
2
3 version () {
4   equery list $1 | tail -n 1 | sed 's/.*-//'
5 }
6
7 packages="/usr/portage/distfiles"
8 wd="/usr/src/initramfs/builds"
9 cur=$(pwd)
10
11 busybox="busybox"
12 busybox_ver="$(version ${busybox})"
13
14 cryptsetup="cryptsetup"
15 cryptsetup_ver="$(version ${cryptsetup})"
16
17 lvm="LVM"
18 lvm_ver="2.2.02.166"
19
20 busybox="busybox"
21 busybox_ver="$(version ${dropbear})"
22
23 if [ -d ${wd} ]; then
24   rm -rf ${wd}
25 fi
26
27 mkdir ${wd}
28 cd ${wd}
29
30 tar xf ${packages}/${busybox}-${busybox_ver}.tar.bz2
31
32 cp ${cur}/busybox_config ${busybox}-${busybox_ver}/.config
33 cd ${busybox}-${busybox_ver}
34
35 make -j8
36 make install
37 mkdir ${wd}/busybox/bin -p
38 cp _install/bin/busybox ${wd}/busybox/bin
39
40 cd ${wd} 
41
42 tar xf ${packages}/${cryptsetup}-${cryptsetup_ver}.tar.xz
43
44 cd ${cryptsetup}-${cryptsetup_ver}
45
46 ./configure --enable-static=yes \
47   --enable-shared=no \
48   --disable-nls \
49   --enable-static-cryptsetup \
50   --disable-verity-setup \
51   --disable-cryptsetup-reencrypt \
52   --disable-integritysetup \
53   --disable-selinux \
54   --disable-udev \
55   --with-crypto_backend=kernel
56
57 make -j8
58 make install DESTDIR=${wd}/cryptsetup
59
60 cd ${wd}
61
62 tar xf ${packages}/${lvm}${lvm_ver}.tgz
63
64 cd ${lvm}${lvm_ver}
65
66
67 CFLAGS="-fPIC" \
68   LIBS="-luuid -lrt -lpthread -lm" \
69   ./configure --prefix=/ \
70   --enable-static_link \
71   --with-mirrors=none \
72   --with-snapshots=none \
73   --with-thin=none \
74   --with-cache=none \
75   --with-lvm1=none \
76   --with-clvmd=none \
77   --with-pool=none \
78   --disable-udev-systemd-background-jobs
79
80 make -j8
81 make install DESTDIR=${wd}/lvm
82
83 cd ${wd}
84
85 tar xf ${packages}/${dropbear}-${dropbear_ver}.tar.bz2
86
87 cd ${dropbear}-${dropbear}
88
89 ./configure --enable-static \
90   --disable-syslog \
91   --disable-utmp \
92   --disable-utmpx \
93   --disable-wtmp \
94   --disable-wtmpx \
95   --disable-harden \
96   --disable-zlib \
97   --disable-pam \
98   --disable-shadow
99
100 make -j8
101 make install DESTDIR=${wd}/dropbear
102