Closed shenki closed 3 years ago
I don't have a cbl setup at the moment to fully test., but I did test locally in my buildroot environment.
Actually, it looks like this is because init.d
has two different actions, start
and stop
, which you can see by adding an echo $*
above cat /proc/version
.
This should fix it:
diff --git a/buildroot/overlay-poweroff/etc/init.d/S50yolo b/buildroot/overlay-poweroff/etc/init.d/S50yolo
index 2b06371..0499d71 100755
--- a/buildroot/overlay-poweroff/etc/init.d/S50yolo
+++ b/buildroot/overlay-poweroff/etc/init.d/S50yolo
@@ -1,4 +1,6 @@
#!/bin/sh
-cat /proc/version
-poweroff
+if [ "$1" = "start" ]; then
+ cat /proc/version
+ poweroff
+fi
diff --git a/buildroot/overlay-reboot/etc/init.d/S50yolo b/buildroot/overlay-reboot/etc/init.d/S50yolo
index ed0203b..0bc3e46 100755
--- a/buildroot/overlay-reboot/etc/init.d/S50yolo
+++ b/buildroot/overlay-reboot/etc/init.d/S50yolo
@@ -1,4 +1,6 @@
#!/bin/sh
-cat /proc/version
-reboot
+if [ "$1" = "start" ]; then
+ cat /proc/version
+ reboot
+fi
Even better! Feel free to push your change instead of mine
Ever wondered why the /proc/version output appears in the logs twice?
I discovered that if we exit from the scripts instead of doing nothing, it only appears once! I could speculate what's going on but I don't precisely know.
Signed-off-by: Joel Stanley joel@jms.id.au