-
Notifications
You must be signed in to change notification settings - Fork 1
/
setup.sh
executable file
·72 lines (57 loc) · 1.53 KB
/
setup.sh
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#!/usr/bin/env bash
# SPDX-License-Identifier: BSD-3-Clause
#
# Landlock workshop to sandbox ImageMagick
#
# This will automatically be executed by Vagrant while provisioning the VM.
set -ueo pipefail nounset errexit
if [[ -z "${VAGRANT_PROVISIONING:-}" ]]; then
echo "This script should only be used by Vagrant provisioning." >&2
exit 1
fi
cd "$(dirname -- "$(readlink -f -- "${BASH_SOURCE[0]}")")"
LINUX_VERSION="6.7.12+bpo"
set -x
apt purge --yes \
wget
apt autoremove --yes
apt update
apt upgrade --yes
apt install --yes --no-install-recommends \
cscope \
gcc \
git \
htop \
libpng-dev \
linux-{image,headers}-${LINUX_VERSION}-cloud-amd64 \
make \
manpages-dev \
pkg-config \
silversearcher-ag \
strace \
tmux \
tree \
vim
cp --no-preserve=mode -b /usr/src/linux-headers-${LINUX_VERSION}-common/include/uapi/linux/landlock.h /usr/include/linux/
cp --no-preserve=mode -b /vagrant/home-config/vimrc ~/.vimrc
sudo -u vagrant -s <<--
pushd /home/vagrant/
cat /vagrant/home-config/bashrc >> .bashrc
cp --no-preserve=mode -b /vagrant/home-config/vimrc .vimrc
git config --global user.email "vagrant@workshop-imagemagick"
git config --global user.name "Workshop"
ssh-keygen -t ecdsa -f ~/.ssh/id_ecdsa -N ''
mkdir src
tar -xf /vagrant/artifacts/ImageMagick-6.9.3-8.tar.xz -C src
pushd src/ImageMagick-6.9.3-8
/vagrant/imagemagick-patches/init-repo.sh
git checkout -b solution
git am /vagrant/imagemagick-patches/*.patch
git checkout master
./configure
make -j$(nproc)
popd
popd
-
# Use the newly installed kernel.
reboot