Jan Kundrát | 6bb1adf | 2017-05-17 17:15:07 +0200 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | |
| 3 | set -eux -o pipefail |
| 4 | shopt -s failglob |
| 5 | |
Jan Kundrát | 28e6199 | 2017-09-07 14:14:26 +0200 | [diff] [blame] | 6 | mount / -o remount,rw |
| 7 | mv /etc/sysrepo /etc/sysrepo.orig |
| 8 | mkdir /etc/sysrepo |
| 9 | chmod 000 /etc/sysrepo |
| 10 | mke2fs -t ext4 -F -F -q /dev/sda2 |
| 11 | echo '/dev/sda2 /etc/sysrepo ext4 defaults 0 0' >> /etc/fstab |
| 12 | mount -a |
| 13 | mv /etc/sysrepo.orig/* /etc/sysrepo/ |
| 14 | rmdir /etc/sysrepo.orig |
| 15 | |
| 16 | # some of these need r/w rootfs due to SSH keys |
Jan Kundrát | 6bb1adf | 2017-05-17 17:15:07 +0200 | [diff] [blame] | 17 | for DIR in /etc/yang-setup/*; do |
| 18 | ${DIR}/install-yang.sh |
| 19 | done |
| 20 | |
Jan Kundrát | 28e6199 | 2017-09-07 14:14:26 +0200 | [diff] [blame] | 21 | mount / -o remount,ro |
| 22 | |
Jan Kundrát | 6bb1adf | 2017-05-17 17:15:07 +0200 | [diff] [blame] | 23 | sysrepoctl --install --search-dir /usr/share/cla-sysrepo/yang --yang /usr/share/cla-sysrepo/yang/czechlight-roadm-v2.yang |
| 24 | sysrepocfg --datastore=startup --import=/usr/share/cla-sysrepo/yang/czechlight-roadm-v2.startup.xml czechlight-roadm-v2 |
| 25 | |
Jan Kundrát | 6958006 | 2017-05-23 19:29:29 +0200 | [diff] [blame] | 26 | systemctl start czechlight-roadm-v2 |
Jan Kundrát | 6958006 | 2017-05-23 19:29:29 +0200 | [diff] [blame] | 27 | systemctl start netopeer2-server |
| 28 | |
Jan Kundrát | 28e6199 | 2017-09-07 14:14:26 +0200 | [diff] [blame] | 29 | mount / -o remount,rw |
| 30 | systemctl enable czechlight-roadm-v2 |
| 31 | systemctl enable netopeer2-server |
Jan Kundrát | 6bb1adf | 2017-05-17 17:15:07 +0200 | [diff] [blame] | 32 | echo '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át | 28e6199 | 2017-09-07 14:14:26 +0200 | [diff] [blame] | 33 | mount / -o remount,ro |