blob: 8fd3976c2ff36212ec72d6da0c45fdbcf5698211 [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"|' \
6 $(@D)/src/common.h.in
7endef
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 \
21 cla-sdn-roadm-line.service \
22 lldp-systemd-networkd-sysrepo.service \
23 netopeer2.service \
24 sysrepo-persistent-cfg.service \
Tomáš Pecka25aae682021-01-27 14:45:57 +010025 velia-system.service \
26 velia-hardware.service \
Jan Kundráted3c5ff2021-01-23 02:05:52 +010027 ; do \
28 echo "Adding systemd drop-ins $${UNIT} <-> /run/sysrepo"; \
29 $(INSTALL) -d -m 0755 $(TARGET_DIR)/usr/lib/systemd/system/$${UNIT}.d/ ; \
30 echo -e "[Unit]\nBindsTo=run-sysrepo.mount\nAfter=run-sysrepo.mount\nPartOf=run-sysrepo.mount" \
31 > $(TARGET_DIR)/usr/lib/systemd/system/$${UNIT}.d/reset-sysrepo.conf ; \
32 echo -e "[Unit]\nPartOf=$${UNIT}" \
33 > $(TARGET_DIR)/usr/lib/systemd/system/run-sysrepo.mount.d/$${UNIT}.conf ; \
34 done
35endef
36
37$(eval $(generic-package))