]> git.friedersdorff.com Git - max/initramfs.git/blob - build_deps.sh
Initial attempt at automatically building initramfs
[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 if [ -d ${wd} ]; then
21   rm -rf ${wd}
22 fi
23
24 mkdir ${wd}
25 cd ${wd}
26
27 tar xf ${packages}/${busybox}-${busybox_ver}.tar.bz2
28
29 cp ${cur}/busybox_config ${busybox}-${busybox_ver}/.config
30 cd ${busybox}-${busybox_ver}
31
32 make -j8
33 make install
34 mkdir ${wd}/busybox/bin -p
35 cp _install/bin/busybox ${wd}/busybox/bin
36
37 cd ${wd} 
38
39 tar xf ${packages}/${cryptsetup}-${cryptsetup_ver}.tar.xz
40
41 cd ${cryptsetup}-${cryptsetup_ver}
42
43 ./configure --enable-static=yes \
44   --enable-shared=no \
45   --disable-nls \
46   --enable-static-cryptsetup \
47   --disable-verity-setup \
48   --disable-cryptsetup-reencrypt \
49   --disable-integritysetup \
50   --disable-selinux \
51   --disable-udev \
52   --with-crypto_backend=kernel
53
54 make -j8
55 make install DESTDIR=${wd}/cryptsetup
56
57 cd ${wd}
58
59 tar xf ${packages}/${lvm}${lvm_ver}.tgz
60
61 cd ${lvm}${lvm_ver}
62
63
64 CFLAGS="-fPIC" \
65   LIBS="-luuid -lrt -lpthread -lm" \
66   ./configure --prefix=/ \
67   --enable-static_link \
68   --with-mirrors=none \
69   --with-snapshots=none \
70   --with-thin=none \
71   --with-cache=none \
72   --with-lvm1=none \
73   --with-clvmd=none \
74   --with-pool=none \
75   --disable-udev-systemd-background-jobs
76
77 make -j8
78 make install DESTDIR=${wd}/lvm
79
80