finalize.sh 2.64 KB
Newer Older
Mark Janes's avatar
Mark Janes committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
# Copyright (C) Intel Corp.  2014.  All Rights Reserved.

# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to
# the following conditions:

# The above copyright notice and this permission notice (including the
# next paragraph) shall be included in all copies or substantial
# portions of the Software.

# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
# IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

#  **********************************************************************/
#  * Authors:
Dylan Baker's avatar
Dylan Baker committed
25
#  *   Dylan Baker <dylanx.c.baker@intel.com>
Mark Janes's avatar
Mark Janes committed
26 27
#  **********************************************************************/

28
mkdir -p /etc/salt/minion.d/
29

30 31 32 33
# Add the master to point at to the machine
cat > /etc/salt/minion.d/master.conf << EOF
master: 192.168.1.1
master_finger: ba:42:e5:d8:e6:3f:ec:ff:a4:7b:c3:cd:24:74:2a:8b
34
hash_type: md5
35 36 37
EOF

echo 'startup_states: highstate' > /etc/salt/minion.d/startup.conf
38

39
# Add our nfs mount to fstab
Mark Janes's avatar
Mark Janes committed
40
echo 'otc-mesa-ci.local:/srv/jenkins       /mnt/jenkins    nfs     _netdev,auto,async,comment=systemd.automount        0       0' >> /etc/fstab
41

42
# Create a systemd .network file for the network interfac
43 44
name=$(ip addr show scope link up | grep -v DOWN | grep UP | awk '{print $2}' | sed 's@:@@')

45
mkdir -p /etc/systemd/network
46

47
cat > "/etc/systemd/network/${name}.network" << EOF
48
[Match]
49
Name=${name}
50 51 52 53 54

[Network]
DHCP=yes
EOF

55
# setup resolve for systemd-resolved
56 57 58
rm /etc/resolv.conf
ln -s /run/systemd/resolve/resolv.conf /etc/resolv.conf

59
# Remove interfaces to keep debian's interfaces from coming up as well as systemd
60 61
rm /etc/network/interfaces

62 63 64 65 66
# Copy the loader from ${EFI}/debian/grubx64.efi to ${EFI}/boot/bootx64.efi
# This is a work-around for broken EFI implementations.
mkdir -p /boot/efi/EFI/boot/
cp /boot/efi/EFI/debian/grubx64.efi /boot/efi/EFI/boot/bootx64.efi

67
# Enable and disable some services
68
systemctl enable systemd-networkd systemd-resolved avahi-daemon salt-minion
69
systemctl disable networking