Use rousette for RESTCONFish info retrieval

In the past we used a hacked-together set of shell scripts which invoked
`sysrepocfg` and some custom sysrepo wrappers in order to quickly get
JSON bits from the operational datastore. Switch from that to a little
more mature implementation of an HTTP server (which is still not really
RESTCONF).

There've been some changes in module revisions, so bump the YANG
revision dates as well. While doing that I discovered that the YANG
module installation is too complex; since 34d2f48 we do not preserve the
*.yang files anymore and we always start from an empty state. And while
I'm at this, always install the ietf-hardware module, that wouldn't hurt
on any box.

Change-Id: Ida87c3869bc538fe6c5fb597cf8624f2467ac0fe
diff --git a/package/rousette/rousette.mk b/package/rousette/rousette.mk
index b51983d..38d26d2 100644
--- a/package/rousette/rousette.mk
+++ b/package/rousette/rousette.mk
@@ -9,4 +9,16 @@
 ROUSETTE_CONF_OPTS = \
 	-DTHREADS_PTHREAD_ARG:STRING=-pthread
 
+define ROUSETTE_INSTALL_INIT_SYSTEMD
+	mkdir -p $(TARGET_DIR)/usr/lib/systemd/system/multi-user.target.wants/
+	$(INSTALL) -D -m 0644 \
+		$(BR2_EXTERNAL_CZECHLIGHT_PATH)/package/rousette/rousette.service \
+		$(TARGET_DIR)/usr/lib/systemd/system/
+	ln -sf ../rousette.service $(TARGET_DIR)/usr/lib/systemd/system/multi-user.target.wants/
+endef
+
+define ROUSETTE_USERS
+	yangnobody 333666 yangnobody 333666 * - - - Unauthenticated operations via RESTCONF
+endef
+
 $(eval $(cmake-package))
diff --git a/package/rousette/rousette.service b/package/rousette/rousette.service
new file mode 100644
index 0000000..1f373e0
--- /dev/null
+++ b/package/rousette/rousette.service
@@ -0,0 +1,23 @@
+[Unit]
+Description=RESTCONFish server
+After=syslog.target network.target czechlight-install-yang.service cfg-restore-sysrepo.service nacm-restore.service
+PartOf=netopeer2.service
+Requires=czechlight-install-yang.service cfg-restore-sysrepo.service nacm-restore.service
+
+[Service]
+Type=simple
+ExecStart=/usr/bin/rousette
+PrivateTmp=yes
+PrivateDevices=yes
+ProtectSystem=yes
+ProtectHome=yes
+Restart=always
+RestartSec=10s
+LogRateLimitIntervalSec=10
+LogRateLimitBurst=30000
+SyslogLevel=alert
+User=yangnobody
+Group=yangnobody
+
+[Install]
+WantedBy=multi-user.target