Run dmesgd when the device starts to collect boot-time reports

Normally we rely on BootReceiver watching the tracing pipe for KASAN/KFENCE reports and running dmesgd. But if an error is reported before system_server starts, nobody is waiting for it.
To handle this, we set the dmesgd.start property after the device finishes booting, so that dmesgd fires once to collect the early reports.

Bug: 254725406
Test: injected kernel bugs reported at boot time are collected by dmesgd
Change-Id: Iedb66705c77e0d4a08e1bc53fd1dc920aecc4035
diff --git a/dmesgd.rc b/dmesgd.rc
index e5ffdd4..3a1373e 100644
--- a/dmesgd.rc
+++ b/dmesgd.rc
@@ -1,9 +1,14 @@
 # Copyright (C) 2022 The Android Open Source Project
 
+# Fire once at boot time to collect early reports, if there are any.
+on property:sys.boot_completed=1
+    setprop dmesgd.start 1
+
 on property:ro.product.cpu.abilist64=* && property:bootreceiver.enable=1
     mkdir /data/misc/dmesgd 0700 dmesgd system
     rm /data/misc/dmesgd/sent_reports.txt
 
+# Start every time someone sets dmesgd.start=1.
 on property:ro.product.cpu.abilist64=* && property:bootreceiver.enable=1 && property:dmesgd.start=1
     start dmesgd
     setprop dmesgd.start 0