clearfog: fancy flashing

There's no need to use emergency.target anymore, the `run usbboot` (or
its longer equivalent if we're in Marvell's factory U-Boot) will perform
the flashing automatically.

It's a bit complex because one has to wait for /dev/sda1 to appear
first. That needs udev to be running. Then one has to mount the image.
In the end I decided to go for a unit generator because it is not clear
whether the actual .device unit is just `dev-sda1.unit` or something
much more interesting like `sys-devices-platform-soc-soc:internal\x2dregs-f10f8000.usb3-usb2-2\x2d1-2\x2d1:1.0-host4-target4:0:0-4:0:0:0-block-sda-sda1.device`.

Change-Id: I1d1bc64e453c94c568cb84bc52f61dafa2a3b15d
diff --git a/package/czechlight-rauc/czechlight-rauc.mk b/package/czechlight-rauc/czechlight-rauc.mk
index 7c9c4cb..08a5b3b 100644
--- a/package/czechlight-rauc/czechlight-rauc.mk
+++ b/package/czechlight-rauc/czechlight-rauc.mk
@@ -77,6 +77,15 @@
 	$(INSTALL) -D -m 0644 $(BR2_EXTERNAL_CZECHLIGHT_PATH)/package/czechlight-rauc/enable-hw-watchdog.service \
 		$(TARGET_DIR)/usr/lib/systemd/system/
 	ln -sf ../enable-hw-watchdog.service $(TARGET_DIR)/usr/lib/systemd/system/multi-user.target.wants/
+
+	# Just for USB flashing
+	mkdir -p $(TARGET_DIR)/usr/lib/systemd/system-generators/
+	$(INSTALL) -D -m 0755 \
+		$(BR2_EXTERNAL_CZECHLIGHT_PATH)/package/czechlight-rauc/czechlight-usb-flash-mount-generator \
+		$(TARGET_DIR)/usr/lib/systemd/system-generators/
+	$(INSTALL) -D -m 0644 \
+		$(BR2_EXTERNAL_CZECHLIGHT_PATH)/package/czechlight-rauc/usb-flash.service \
+		$(TARGET_DIR)/usr/lib/systemd/system/
 endef
 
 $(eval $(generic-package))