blob: cfca98dbf2ad1d2c2ec631b32ca55ad376b7eb93 [file] [log] [blame]
Jan Kundráted3c5ff2021-01-23 02:05:52 +01001RESET_SYSREPO_INSTALL_TARGET = YES
2
3define RESET_SYSREPO_PATCH_DEV_SHM
4 sed -i \
5 's|^#define SR_SHM_DIR .*|#define SR_SHM_DIR "/run/sysrepo"|' \
Václav Kubernát8cd61562021-12-08 13:27:31 +01006 $(@D)/src/config.h.in
Jan Kundráted3c5ff2021-01-23 02:05:52 +01007endef
8
9SYSREPO_PRE_PATCH_HOOKS += RESET_SYSREPO_PATCH_DEV_SHM
10SYSREPO_POST_RSYNC_HOOKS += RESET_SYSREPO_PATCH_DEV_SHM
11
12define RESET_SYSREPO_INSTALL_TARGET_CMDS
13 $(INSTALL) -D -m 0644 \
14 --target-directory $(TARGET_DIR)/usr/lib/systemd/system/ \
15 $(BR2_EXTERNAL_CZECHLIGHT_PATH)/package/reset-sysrepo/run-sysrepo.mount
16 $(INSTALL) -d -m 0755 $(TARGET_DIR)/usr/lib/systemd/system/run-sysrepo.mount.d/
17 for UNIT in \
18 cla-sdn-inline.service \
19 cla-sdn-roadm-add-drop.service \
20 cla-sdn-roadm-coherent-a-d.service \
Jan Kundrátf25a84f2021-03-21 13:18:47 +010021 cla-sdn-roadm-hires-drop.service \
Jan Kundráted3c5ff2021-01-23 02:05:52 +010022 cla-sdn-roadm-line.service \
Jan Kundráted3c5ff2021-01-23 02:05:52 +010023 netopeer2.service \
24 sysrepo-persistent-cfg.service \
Václav Kubernáte6ecb9b2021-02-09 20:53:44 +010025 nacm-restore.service \
Václav Kubernát22e240c2021-02-04 10:14:19 +010026 velia-firewall.service \
Tomáš Pecka25aae682021-01-27 14:45:57 +010027 velia-system.service \
Jan Kundrát811c0b02021-02-05 19:16:43 +010028 velia-hardware-g1.service \
29 velia-hardware-g2.service \
Jan Kundrátb41f0082021-03-09 22:20:35 +010030 rousette.service \
Jan Kundráted3c5ff2021-01-23 02:05:52 +010031 ; do \
32 echo "Adding systemd drop-ins $${UNIT} <-> /run/sysrepo"; \
33 $(INSTALL) -d -m 0755 $(TARGET_DIR)/usr/lib/systemd/system/$${UNIT}.d/ ; \
34 echo -e "[Unit]\nBindsTo=run-sysrepo.mount\nAfter=run-sysrepo.mount\nPartOf=run-sysrepo.mount" \
35 > $(TARGET_DIR)/usr/lib/systemd/system/$${UNIT}.d/reset-sysrepo.conf ; \
36 echo -e "[Unit]\nPartOf=$${UNIT}" \
37 > $(TARGET_DIR)/usr/lib/systemd/system/run-sysrepo.mount.d/$${UNIT}.conf ; \
38 done
39endef
40
41$(eval $(generic-package))