Jan Kundrát | 2f100fc | 2020-11-02 22:10:16 +0100 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | |
| 3 | set -ex |
| 4 | |
Jan Kundrát | 2f100fc | 2020-11-02 22:10:16 +0100 | [diff] [blame] | 5 | YANG_ROADM=0 |
| 6 | YANG_COHERENT=0 |
| 7 | YANG_INLINE=0 |
| 8 | YANG_CALIBRATION=0 |
| 9 | |
Tomáš Pecka | 68366cd | 2022-06-06 09:27:41 +0200 | [diff] [blame] | 10 | CLA_YANG="${CLA_YANG:-/usr/share/cla-sysrepo/yang}" |
| 11 | VELIA_YANG="${VELIA_YANG:-/usr/share/velia/yang}" |
Tomáš Pecka | 742c7ec | 2022-10-03 13:49:57 +0200 | [diff] [blame] | 12 | ALARMS_YANG="${ALARMS_YANG:-/usr/share/sysrepo-ietf-alarms/yang}" |
Jan Kundrát | 9ec14bb | 2023-11-29 17:31:53 +0100 | [diff] [blame^] | 13 | ROUSETTE_YANG="${ROUSETTE_YANG:-/usr/share/rousette/yang}" |
Tomáš Pecka | 68366cd | 2022-06-06 09:27:41 +0200 | [diff] [blame] | 14 | PROC_CMDLINE="${PROC_CMDLINE:-/proc/cmdline}" |
Jan Kundrát | 2f100fc | 2020-11-02 22:10:16 +0100 | [diff] [blame] | 15 | |
Tomáš Pecka | 68366cd | 2022-06-06 09:27:41 +0200 | [diff] [blame] | 16 | for ARG in $(cat "$PROC_CMDLINE"); do |
Jan Kundrát | 2f100fc | 2020-11-02 22:10:16 +0100 | [diff] [blame] | 17 | case "${ARG}" in |
| 18 | czechlight=*) |
| 19 | CZECHLIGHT="${ARG:11}" |
| 20 | ;; |
| 21 | esac |
| 22 | done |
| 23 | |
Jan Kundrát | 811c0b0 | 2021-02-05 19:16:43 +0100 | [diff] [blame] | 24 | INITIAL_DATA=${CZECHLIGHT%%-g2} |
| 25 | |
Jan Kundrát | 2f100fc | 2020-11-02 22:10:16 +0100 | [diff] [blame] | 26 | case "${CZECHLIGHT}" in |
Jan Kundrát | 811c0b0 | 2021-02-05 19:16:43 +0100 | [diff] [blame] | 27 | sdn-roadm-line*) |
Jan Kundrát | 2f100fc | 2020-11-02 22:10:16 +0100 | [diff] [blame] | 28 | YANG_ROADM=1 |
| 29 | WITH_FEATURE=hw-line-9 |
Jan Kundrát | 2f100fc | 2020-11-02 22:10:16 +0100 | [diff] [blame] | 30 | ;; |
Jan Kundrát | 811c0b0 | 2021-02-05 19:16:43 +0100 | [diff] [blame] | 31 | sdn-roadm-add-drop*) |
Jan Kundrát | 2f100fc | 2020-11-02 22:10:16 +0100 | [diff] [blame] | 32 | YANG_ROADM=1 |
| 33 | WITH_FEATURE=hw-add-drop-20 |
Jan Kundrát | 2f100fc | 2020-11-02 22:10:16 +0100 | [diff] [blame] | 34 | ;; |
Jan Kundrát | 811c0b0 | 2021-02-05 19:16:43 +0100 | [diff] [blame] | 35 | sdn-roadm-hires-add-drop*) |
| 36 | YANG_ROADM=1 |
Jan Kundrát | 9cccf70 | 2021-12-03 11:09:07 +0100 | [diff] [blame] | 37 | WITH_FEATURE="hw-add-drop-20 pre-wss-ocm" |
Jan Kundrát | 811c0b0 | 2021-02-05 19:16:43 +0100 | [diff] [blame] | 38 | INITIAL_DATA=sdn-roadm-add-drop |
| 39 | ;; |
| 40 | sdn-roadm-coherent-a-d*) |
Jan Kundrát | 2f100fc | 2020-11-02 22:10:16 +0100 | [diff] [blame] | 41 | YANG_COHERENT=1 |
| 42 | ;; |
Jan Kundrát | 811c0b0 | 2021-02-05 19:16:43 +0100 | [diff] [blame] | 43 | sdn-inline*) |
Jan Kundrát | 2f100fc | 2020-11-02 22:10:16 +0100 | [diff] [blame] | 44 | YANG_INLINE=1 |
| 45 | ;; |
| 46 | calibration-box) |
| 47 | YANG_CALIBRATION=1 |
| 48 | ;; |
| 49 | esac |
| 50 | |
Jan Kundrát | 9b2aab8 | 2021-04-14 01:14:44 +0200 | [diff] [blame] | 51 | sysrepoctl --search-dirs ${CLA_YANG} --install ${CLA_YANG}/iana-hardware@2018-03-13.yang |
| 52 | sysrepoctl --search-dirs ${CLA_YANG} --install ${CLA_YANG}/ietf-hardware@2018-03-13.yang |
Jan Kundrát | 1e72b66 | 2023-05-24 19:30:32 +0200 | [diff] [blame] | 53 | sysrepoctl --change ietf-hardware --permissions 0660 --enable-feature hardware-sensor --enable-feature hardware-state |
Tomáš Pecka | c34a545 | 2020-12-16 21:29:09 +0100 | [diff] [blame] | 54 | |
Jan Kundrát | b41f008 | 2021-03-09 22:20:35 +0100 | [diff] [blame] | 55 | if [[ ${YANG_ROADM} == 1 ]]; then |
Václav Kubernát | 8cd6156 | 2021-12-08 13:27:31 +0100 | [diff] [blame] | 56 | FEATURE_ARGS="" |
Jan Kundrát | 2f100fc | 2020-11-02 22:10:16 +0100 | [diff] [blame] | 57 | if [[ ${WITH_FEATURE} ]]; then |
Jan Kundrát | 9cccf70 | 2021-12-03 11:09:07 +0100 | [diff] [blame] | 58 | for FEATURE in ${WITH_FEATURE}; do |
Václav Kubernát | 8cd6156 | 2021-12-08 13:27:31 +0100 | [diff] [blame] | 59 | FEATURE_ARGS="${FEATURE_ARGS} --enable-feature ${FEATURE}" |
Jan Kundrát | 9cccf70 | 2021-12-03 11:09:07 +0100 | [diff] [blame] | 60 | done |
Jan Kundrát | 2f100fc | 2020-11-02 22:10:16 +0100 | [diff] [blame] | 61 | fi |
Tomáš Pecka | d3861ce | 2022-05-11 11:51:30 +0200 | [diff] [blame] | 62 | sysrepoctl --search-dirs ${CLA_YANG} --install ${CLA_YANG}/czechlight-roadm-device@2021-03-05.yang ${FEATURE_ARGS} --permissions 0660 |
Jan Kundrát | 2f100fc | 2020-11-02 22:10:16 +0100 | [diff] [blame] | 63 | fi |
| 64 | |
Jan Kundrát | b41f008 | 2021-03-09 22:20:35 +0100 | [diff] [blame] | 65 | if [[ ${YANG_COHERENT} == 1 ]]; then |
Tomáš Pecka | d3861ce | 2022-05-11 11:51:30 +0200 | [diff] [blame] | 66 | sysrepoctl --search-dirs ${CLA_YANG} --install ${CLA_YANG}/czechlight-coherent-add-drop@2021-03-05.yang --permissions 0660 |
Tomáš Pecka | d3861ce | 2022-05-11 11:51:30 +0200 | [diff] [blame] | 67 | sysrepoctl --change czechlight-coherent-add-drop --permissions 0660 |
Jan Kundrát | 2f100fc | 2020-11-02 22:10:16 +0100 | [diff] [blame] | 68 | fi |
| 69 | |
Jan Kundrát | b41f008 | 2021-03-09 22:20:35 +0100 | [diff] [blame] | 70 | if [[ ${YANG_INLINE} == 1 ]]; then |
Tomáš Pecka | d3861ce | 2022-05-11 11:51:30 +0200 | [diff] [blame] | 71 | sysrepoctl --search-dirs ${CLA_YANG} --install ${CLA_YANG}/czechlight-inline-amp@2021-03-05.yang --permissions 0660 |
Jan Kundrát | 2f100fc | 2020-11-02 22:10:16 +0100 | [diff] [blame] | 72 | fi |
| 73 | |
Jan Kundrát | b41f008 | 2021-03-09 22:20:35 +0100 | [diff] [blame] | 74 | if [[ ${YANG_CALIBRATION} == 1 ]]; then |
Tomáš Pecka | d3861ce | 2022-05-11 11:51:30 +0200 | [diff] [blame] | 75 | sysrepoctl --search-dirs ${CLA_YANG} --install ${CLA_YANG}/czechlight-calibration-device@2019-06-25.yang --permissions 0660 |
Jan Kundrát | 2f100fc | 2020-11-02 22:10:16 +0100 | [diff] [blame] | 76 | fi |
| 77 | |
Tomáš Pecka | 742c7ec | 2022-10-03 13:49:57 +0200 | [diff] [blame] | 78 | sysrepoctl --search-dirs ${ALARMS_YANG} --install ${ALARMS_YANG}/ietf-alarms@2019-09-11.yang --permissions 0660 --enable-feature alarm-shelving --enable-feature alarm-summary |
| 79 | sysrepoctl --search-dirs ${ALARMS_YANG} --install ${ALARMS_YANG}/sysrepo-ietf-alarms@2022-02-17.yang --permissions 0660 |
| 80 | |
Tomáš Pecka | d3861ce | 2022-05-11 11:51:30 +0200 | [diff] [blame] | 81 | sysrepoctl --search-dirs ${VELIA_YANG} --install ${VELIA_YANG}/ietf-system@2014-08-06.yang --permissions 0660 |
Tomáš Pecka | 01df848 | 2021-01-13 18:04:19 +0100 | [diff] [blame] | 82 | |
Tomáš Pecka | d3861ce | 2022-05-11 11:51:30 +0200 | [diff] [blame] | 83 | sysrepoctl --search-dirs ${VELIA_YANG} --install ${VELIA_YANG}/czechlight-lldp@2020-11-04.yang --permissions 0660 |
Jan Kundrát | 2f100fc | 2020-11-02 22:10:16 +0100 | [diff] [blame] | 84 | |
Jan Kundrát | d2eecf5 | 2022-07-13 18:15:12 +0200 | [diff] [blame] | 85 | sysrepoctl --search-dirs ${VELIA_YANG} --install ${VELIA_YANG}/czechlight-system@2022-07-08.yang --permissions 0660 |
Tomáš Pecka | 25aae68 | 2021-01-27 14:45:57 +0100 | [diff] [blame] | 86 | |
Tomáš Pecka | 5a03009 | 2021-04-14 00:36:40 +0200 | [diff] [blame] | 87 | sysrepoctl --search-dirs ${VELIA_YANG} --install ${VELIA_YANG}/iana-if-type@2017-01-19.yang |
Tomáš Pecka | d3861ce | 2022-05-11 11:51:30 +0200 | [diff] [blame] | 88 | sysrepoctl --search-dirs ${VELIA_YANG} --install ${VELIA_YANG}/ietf-interfaces@2018-02-20.yang --permissions 0660 |
| 89 | sysrepoctl --search-dirs ${VELIA_YANG} --install ${VELIA_YANG}/ietf-ip@2018-02-22.yang --permissions 0660 |
| 90 | sysrepoctl --search-dirs ${VELIA_YANG} --install ${VELIA_YANG}/ietf-routing@2018-03-13.yang --permissions 0660 |
| 91 | sysrepoctl --search-dirs ${VELIA_YANG} --install ${VELIA_YANG}/ietf-ipv4-unicast-routing@2018-03-13.yang --permissions 0660 |
| 92 | sysrepoctl --search-dirs ${VELIA_YANG} --install ${VELIA_YANG}/ietf-ipv6-unicast-routing@2018-03-13.yang --permissions 0660 |
| 93 | sysrepoctl --search-dirs ${VELIA_YANG} --install ${VELIA_YANG}/czechlight-network@2021-02-22.yang --permissions 0660 |
Tomáš Pecka | 5a03009 | 2021-04-14 00:36:40 +0200 | [diff] [blame] | 94 | |
Tomáš Pecka | d3861ce | 2022-05-11 11:51:30 +0200 | [diff] [blame] | 95 | sysrepoctl --search-dirs ${VELIA_YANG} --install ${VELIA_YANG}/czechlight-firewall@2021-01-25.yang --permissions 0600 |
Jan Kundrát | 8ee8b3b | 2022-02-17 19:03:14 +0100 | [diff] [blame] | 96 | sysrepoctl --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áš Pecka | baf3e86 | 2022-10-03 16:59:05 +0200 | [diff] [blame] | 97 | |
| 98 | sysrepoctl --search-dirs ${VELIA_YANG} --install ${VELIA_YANG}/velia-alarms@2022-07-12.yang --permissions 0660 |
Jan Kundrát | 9ec14bb | 2023-11-29 17:31:53 +0100 | [diff] [blame^] | 99 | sysrepoctl --search-dirs ${ROUSETTE_YANG} --install ${ROUSETTE_YANG}/ietf-restconf@2017-01-26.yang |