blob: 0860749421d994b02db6ba745c8b106cd0a4e06c [file] [log] [blame]
Jan Kundrát2f100fc2020-11-02 22:10:16 +01001#!/bin/bash
2
3set -ex
4
Jan Kundrát2f100fc2020-11-02 22:10:16 +01005YANG_ROADM=0
6YANG_COHERENT=0
7YANG_INLINE=0
8YANG_CALIBRATION=0
9
Tomáš Pecka68366cd2022-06-06 09:27:41 +020010CLA_YANG="${CLA_YANG:-/usr/share/cla-sysrepo/yang}"
11VELIA_YANG="${VELIA_YANG:-/usr/share/velia/yang}"
Tomáš Pecka742c7ec2022-10-03 13:49:57 +020012ALARMS_YANG="${ALARMS_YANG:-/usr/share/sysrepo-ietf-alarms/yang}"
Jan Kundrát9ec14bb2023-11-29 17:31:53 +010013ROUSETTE_YANG="${ROUSETTE_YANG:-/usr/share/rousette/yang}"
Tomáš Pecka68366cd2022-06-06 09:27:41 +020014PROC_CMDLINE="${PROC_CMDLINE:-/proc/cmdline}"
Jan Kundrát2f100fc2020-11-02 22:10:16 +010015
Tomáš Pecka68366cd2022-06-06 09:27:41 +020016for ARG in $(cat "$PROC_CMDLINE"); do
Jan Kundrát2f100fc2020-11-02 22:10:16 +010017 case "${ARG}" in
18 czechlight=*)
19 CZECHLIGHT="${ARG:11}"
20 ;;
21 esac
22done
23
Jan Kundrát811c0b02021-02-05 19:16:43 +010024INITIAL_DATA=${CZECHLIGHT%%-g2}
25
Jan Kundrát2f100fc2020-11-02 22:10:16 +010026case "${CZECHLIGHT}" in
Jan Kundrát811c0b02021-02-05 19:16:43 +010027 sdn-roadm-line*)
Jan Kundrát2f100fc2020-11-02 22:10:16 +010028 YANG_ROADM=1
29 WITH_FEATURE=hw-line-9
Jan Kundrát2f100fc2020-11-02 22:10:16 +010030 ;;
Jan Kundrát811c0b02021-02-05 19:16:43 +010031 sdn-roadm-add-drop*)
Jan Kundrát2f100fc2020-11-02 22:10:16 +010032 YANG_ROADM=1
33 WITH_FEATURE=hw-add-drop-20
Jan Kundrát2f100fc2020-11-02 22:10:16 +010034 ;;
Jan Kundrát811c0b02021-02-05 19:16:43 +010035 sdn-roadm-hires-add-drop*)
36 YANG_ROADM=1
Jan Kundrát9cccf702021-12-03 11:09:07 +010037 WITH_FEATURE="hw-add-drop-20 pre-wss-ocm"
Jan Kundrát811c0b02021-02-05 19:16:43 +010038 INITIAL_DATA=sdn-roadm-add-drop
39 ;;
40 sdn-roadm-coherent-a-d*)
Jan Kundrát2f100fc2020-11-02 22:10:16 +010041 YANG_COHERENT=1
42 ;;
Jan Kundrát811c0b02021-02-05 19:16:43 +010043 sdn-inline*)
Jan Kundrát2f100fc2020-11-02 22:10:16 +010044 YANG_INLINE=1
45 ;;
46 calibration-box)
47 YANG_CALIBRATION=1
48 ;;
49esac
50
Jan Kundrát9b2aab82021-04-14 01:14:44 +020051sysrepoctl --search-dirs ${CLA_YANG} --install ${CLA_YANG}/iana-hardware@2018-03-13.yang
52sysrepoctl --search-dirs ${CLA_YANG} --install ${CLA_YANG}/ietf-hardware@2018-03-13.yang
Jan Kundrát1e72b662023-05-24 19:30:32 +020053sysrepoctl --change ietf-hardware --permissions 0660 --enable-feature hardware-sensor --enable-feature hardware-state
Tomáš Peckac34a5452020-12-16 21:29:09 +010054
Jan Kundrátb41f0082021-03-09 22:20:35 +010055if [[ ${YANG_ROADM} == 1 ]]; then
Václav Kubernát8cd61562021-12-08 13:27:31 +010056 FEATURE_ARGS=""
Jan Kundrát2f100fc2020-11-02 22:10:16 +010057 if [[ ${WITH_FEATURE} ]]; then
Jan Kundrát9cccf702021-12-03 11:09:07 +010058 for FEATURE in ${WITH_FEATURE}; do
Václav Kubernát8cd61562021-12-08 13:27:31 +010059 FEATURE_ARGS="${FEATURE_ARGS} --enable-feature ${FEATURE}"
Jan Kundrát9cccf702021-12-03 11:09:07 +010060 done
Jan Kundrát2f100fc2020-11-02 22:10:16 +010061 fi
Tomáš Peckad3861ce2022-05-11 11:51:30 +020062 sysrepoctl --search-dirs ${CLA_YANG} --install ${CLA_YANG}/czechlight-roadm-device@2021-03-05.yang ${FEATURE_ARGS} --permissions 0660
Jan Kundrát2f100fc2020-11-02 22:10:16 +010063fi
64
Jan Kundrátb41f0082021-03-09 22:20:35 +010065if [[ ${YANG_COHERENT} == 1 ]]; then
Tomáš Peckad3861ce2022-05-11 11:51:30 +020066 sysrepoctl --search-dirs ${CLA_YANG} --install ${CLA_YANG}/czechlight-coherent-add-drop@2021-03-05.yang --permissions 0660
Tomáš Peckad3861ce2022-05-11 11:51:30 +020067 sysrepoctl --change czechlight-coherent-add-drop --permissions 0660
Jan Kundrát2f100fc2020-11-02 22:10:16 +010068fi
69
Jan Kundrátb41f0082021-03-09 22:20:35 +010070if [[ ${YANG_INLINE} == 1 ]]; then
Tomáš Peckad3861ce2022-05-11 11:51:30 +020071 sysrepoctl --search-dirs ${CLA_YANG} --install ${CLA_YANG}/czechlight-inline-amp@2021-03-05.yang --permissions 0660
Jan Kundrát2f100fc2020-11-02 22:10:16 +010072fi
73
Jan Kundrátb41f0082021-03-09 22:20:35 +010074if [[ ${YANG_CALIBRATION} == 1 ]]; then
Tomáš Peckad3861ce2022-05-11 11:51:30 +020075 sysrepoctl --search-dirs ${CLA_YANG} --install ${CLA_YANG}/czechlight-calibration-device@2019-06-25.yang --permissions 0660
Jan Kundrát2f100fc2020-11-02 22:10:16 +010076fi
77
Tomáš Pecka742c7ec2022-10-03 13:49:57 +020078sysrepoctl --search-dirs ${ALARMS_YANG} --install ${ALARMS_YANG}/ietf-alarms@2019-09-11.yang --permissions 0660 --enable-feature alarm-shelving --enable-feature alarm-summary
79sysrepoctl --search-dirs ${ALARMS_YANG} --install ${ALARMS_YANG}/sysrepo-ietf-alarms@2022-02-17.yang --permissions 0660
80
Tomáš Peckad3861ce2022-05-11 11:51:30 +020081sysrepoctl --search-dirs ${VELIA_YANG} --install ${VELIA_YANG}/ietf-system@2014-08-06.yang --permissions 0660
Tomáš Pecka01df8482021-01-13 18:04:19 +010082
Tomáš Peckad3861ce2022-05-11 11:51:30 +020083sysrepoctl --search-dirs ${VELIA_YANG} --install ${VELIA_YANG}/czechlight-lldp@2020-11-04.yang --permissions 0660
Jan Kundrát2f100fc2020-11-02 22:10:16 +010084
Jan Kundrátd2eecf52022-07-13 18:15:12 +020085sysrepoctl --search-dirs ${VELIA_YANG} --install ${VELIA_YANG}/czechlight-system@2022-07-08.yang --permissions 0660
Tomáš Pecka25aae682021-01-27 14:45:57 +010086
Tomáš Pecka5a030092021-04-14 00:36:40 +020087sysrepoctl --search-dirs ${VELIA_YANG} --install ${VELIA_YANG}/iana-if-type@2017-01-19.yang
Tomáš Peckad3861ce2022-05-11 11:51:30 +020088sysrepoctl --search-dirs ${VELIA_YANG} --install ${VELIA_YANG}/ietf-interfaces@2018-02-20.yang --permissions 0660
89sysrepoctl --search-dirs ${VELIA_YANG} --install ${VELIA_YANG}/ietf-ip@2018-02-22.yang --permissions 0660
90sysrepoctl --search-dirs ${VELIA_YANG} --install ${VELIA_YANG}/ietf-routing@2018-03-13.yang --permissions 0660
91sysrepoctl --search-dirs ${VELIA_YANG} --install ${VELIA_YANG}/ietf-ipv4-unicast-routing@2018-03-13.yang --permissions 0660
92sysrepoctl --search-dirs ${VELIA_YANG} --install ${VELIA_YANG}/ietf-ipv6-unicast-routing@2018-03-13.yang --permissions 0660
93sysrepoctl --search-dirs ${VELIA_YANG} --install ${VELIA_YANG}/czechlight-network@2021-02-22.yang --permissions 0660
Tomáš Pecka5a030092021-04-14 00:36:40 +020094
Tomáš Peckad3861ce2022-05-11 11:51:30 +020095sysrepoctl --search-dirs ${VELIA_YANG} --install ${VELIA_YANG}/czechlight-firewall@2021-01-25.yang --permissions 0600
Jan Kundrát8ee8b3b2022-02-17 19:03:14 +010096sysrepoctl --change ietf-access-control-list --enable-feature match-on-eth --enable-feature eth --enable-feature match-on-ipv4 --enable-feature ipv4 --enable-feature match-on-ipv6 --enable-feature ipv6 --enable-feature mixed-eth-ipv4-ipv6
Tomáš Peckabaf3e862022-10-03 16:59:05 +020097
98sysrepoctl --search-dirs ${VELIA_YANG} --install ${VELIA_YANG}/velia-alarms@2022-07-12.yang --permissions 0660
Jan Kundrát9ec14bb2023-11-29 17:31:53 +010099sysrepoctl --search-dirs ${ROUSETTE_YANG} --install ${ROUSETTE_YANG}/ietf-restconf@2017-01-26.yang