Commit 8c4fbf96 authored by Andreas Schmidt's avatar Andreas Schmidt
Browse files

Add a setup.sh script to simplify first-time setup.

parent 8af70749
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -24,6 +24,7 @@ echo 'nameserver 9.9.9.9' >> $DIR/etc/resolv.conf

cp $(which qemu-arm-static) $DIR/usr/bin
cp provision.sh $DIR/root
cp setup.sh $DIR/root
chroot $DIR qemu-arm-static /bin/bash /root/provision.sh

rm $DIR/root/provision.sh

setup.sh

0 → 100644
+28 −0
Original line number Diff line number Diff line
if [ $# -lt 1 ]; then
  echo 1>&2 "$0: not enough arguments"
  exit 2
elif [ $# -gt 1 ]; then
  echo 1>&2 "$0: too many arguments"
  exit 2
fi

RNA_NAME=$1

apt update && apt upgrade -y && apt autoremove -y

apt install -y \
    salt-minion

echo "$RNA_NAME" > /etc/salt/minion_id
echo "master: 10.8.0.1" > /etc/salt/minion.d/master.conf
service salt-minion restart

sed -i -e "s/odroid/$RNA_NAME/g"  /etc/hostname
sed -i -e "s/odroid/$RNA_NAME/g"  /etc/hosts
salt-call test.ping
echo "Press any key to continue."
read -n 1 -s
salt-call test.ping

salt-call state.highstate
salt-call state.sls tools