View Single Post
Posts: 18 | Thanked: 23 times | Joined on Jun 2012
#105
Originally Posted by persmule View Post
With further observation, I detect that the content of /run/systemd/boot-status/ (supposed to be filled by /usr/lib/startup/get-initial-bootstate, launched with initial-bootstate.service) will be deleted if a larger SD card is installed during boot time, and autologin@.service will fail due to lack /run/systemd/boot-status/bootstate.
With further observation, I finally and correctly detect that some SD card makes udev units spend more time to initialize. If systemd-udev-settle.service gets launched after initial-bootstate.service because of this, the latter will fail to fill the content of /run/systemd/boot-status/, causing a failed boot.

Currently this race condition can be solved by copying /lib/systemd/system/initial-bootstate.service to /etc/systemd/system/, and making it run after systemd-udev-settle.service, as the diff below shows:
Code:
--- /lib/systemd/system/initial-bootstate.service	2018-12-06 09:45:32.000000000 +0800
+++ /etc/systemd/system/initial-bootstate.service	2019-03-17 00:37:25.421035649 +0800
@@ -6,7 +6,7 @@
 [Unit]
 Description=Get initial bootstate
 DefaultDependencies=no
-After=local-fs.target systemd-tmpfiles-setup.service
+After=local-fs.target systemd-tmpfiles-setup.service systemd-udev-settle.service
 Before=dsme.service
 Conflicts=shutdown.target
 ConditionPathExists=/run/systemd/boot-status
Finally, enable the modified unit by running:
Code:
# systemctl enable initial-bootstate.service
 

The Following 3 Users Say Thank You to persmule For This Useful Post: