forked from Eelis/geordi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
prep-image
executable file
·37 lines (26 loc) · 1.89 KB
/
prep-image
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/bin/bash
set -euv
cd /geordi/run
for n in 0 1 2 3 4 5 6 7 8 9
do
touch $n $n.s $n.o
chmod 666 $n $n.s $n.o
done
touch t
chmod 777 t
gcc -fPIC -shared -Wall -o /lib/libdiagnose_sigsys.so /geordi/src/diagnose_sigsys.c
/geordi/src/lockdown/compile.sh
cd /geordi/src/prelude
patch /usr/local/include/c++/6.0.0/typeinfo demangle_typeinfo_name.patch -o patched_typeinfo.hpp
# TODO: don't hard-code version
chmod a+r patched_typeinfo.hpp
/geordi/src/prelude/compile.sh
cp /usr/bin/gold /usr/bin/ld
. /geordi/compile-config
rm -f `g++ -print-prog-name=collect2` `$GCC -print-prog-name=collect2`
# If collect2 is present, it is called by the gcc driver and
# starts making temporaries. GCC functions just fine without it.
export SUDO_FORCE_REMOVE=yes
apt-get remove -y vim-common vim-tiny python3 upstart perl less iputils-ping logrotate net-tools python3.4 keyboard-configuration sudo > /dev/null 2>&1
dpkg --force-all -r apt gnupg ntpdate python3-minimal python3.4-minimal whiptail iproute2 diffutils cron bzip2 bsdutils adduser apt-utils passwd libuuid1 isc-dhcp-client perl-base ubuntu-keyring sed netcat-openbsd login mawk gpgv cpio libtext-charwidth-perl libtext-wrapi18n-perl debconf-i18n liblocale-gettext-perl libtext-iconv-perl netbase libsemanage1 libpython3-stdlib libpython3.4-stdlib mount module-init-tools libgnutls-openssl27 libgcrypt11 libgnutls26 libgpg-error0 makedev tzdata e2fsprogs insserv patch xml-core make lockfile-progs manpages manpages-dev sgml-base ncurses-base ncurses-bin shared-mime-info libxml2 libplymouth2 libpng12-0 libss2 libprocps3 libgdbm3 libncursesw5 gzip fakeroot libfakeroot libjson0 busybox-initramfs hostname libexpat1 pkg-config libpopt0 e2fslibs libestr0 libmount1 klibc-utils libklibc xkb-data ucf isc-dhcp-common file libsqlite3-0 libusb-0.1-4 libp11-kit0 initramfs-tools-bin kmod > /dev/null 2>&1
rm -rf /home /mnt /opt /var /sbin /srv /boot /media /root /usr/sbin /bin /tmp