blob: 9baa4a94b1c8913124b9cc6f51fd4ce67bc4fc05 [file] [log] [blame]
Jan Kundrát6bb1adf2017-05-17 17:15:07 +02001#!/bin/bash
2
3set -eux -o pipefail
4shopt -s failglob
5
Jan Kundrát28e61992017-09-07 14:14:26 +02006mount / -o remount,rw
7mv /etc/sysrepo /etc/sysrepo.orig
8mkdir /etc/sysrepo
9chmod 000 /etc/sysrepo
10mke2fs -t ext4 -F -F -q /dev/sda2
11echo '/dev/sda2 /etc/sysrepo ext4 defaults 0 0' >> /etc/fstab
12mount -a
13mv /etc/sysrepo.orig/* /etc/sysrepo/
14rmdir /etc/sysrepo.orig
15
16# some of these need r/w rootfs due to SSH keys
Jan Kundrát6bb1adf2017-05-17 17:15:07 +020017for DIR in /etc/yang-setup/*; do
18 ${DIR}/install-yang.sh
19done
20
Jan Kundrát28e61992017-09-07 14:14:26 +020021mount / -o remount,ro
22
Jan Kundrát6bb1adf2017-05-17 17:15:07 +020023sysrepoctl --install --search-dir /usr/share/cla-sysrepo/yang --yang /usr/share/cla-sysrepo/yang/czechlight-roadm-v2.yang
24sysrepocfg --datastore=startup --import=/usr/share/cla-sysrepo/yang/czechlight-roadm-v2.startup.xml czechlight-roadm-v2
25
Jan Kundrát69580062017-05-23 19:29:29 +020026systemctl start czechlight-roadm-v2
Jan Kundrát69580062017-05-23 19:29:29 +020027systemctl start netopeer2-server
28
Jan Kundrát28e61992017-09-07 14:14:26 +020029mount / -o remount,rw
30systemctl enable czechlight-roadm-v2
31systemctl enable netopeer2-server
Jan Kundrát6bb1adf2017-05-17 17:15:07 +020032echo 'cla-sysrepod --properties-log-level=5 --sr-bridge-log-level=5 --sysrepo-log-level=3 --driver=CL-ROADMv2 --port=/dev/ttyUSB0' >> ~/.ash_history
Jan Kundrát28e61992017-09-07 14:14:26 +020033mount / -o remount,ro