-
-
Notifications
You must be signed in to change notification settings - Fork 13
/
init
executable file
·31 lines (24 loc) · 958 Bytes
/
init
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
#!/bin/bash -ex
BOXNAME=peru/ubuntu-18.04-server-amd64
# get base image
if ! vagrant box list | grep -q "$BOXNAME (libvirt, " ; then
vagrant box add $BOXNAME --provider libvirt || :
fi
# prepare for login as root to guest
pushd elkdat
vagrant up --provider libvirt
ln -sf $(vagrant ssh-config | grep IdentityFile | awk '{print $2}' | sed -e 's/^"\(.*\)"/\1/') ../
HOST=$(vagrant ssh-config | grep HostName | awk '{print $2}')
popd
test -e ~/.ssh/known_hosts && ssh-keygen -R ${HOST}
ssh -i private_key -oStrictHostKeyChecking=no vagrant@${HOST} :
# ktest setting (host)
CONCURRENCY=$(grep -c processor /proc/cpuinfo)
DOMAIN_ID=$(cat elkdat/.vagrant/machines/ktest/libvirt/id)
sed -e "s/@MACHINE@/$HOST/" \
-e "s+@BASEPATH@+$PWD+" \
-e "s/@CONCURRENCY@/$CONCURRENCY/" \
-e "s/@DOMAIN_ID@/$DOMAIN_ID/" \
ktest/ktest.conf.template >ktest/ktest.conf
# get kernel source
test -d linux || git clone https://github.com/torvalds/linux.git