···333 set -eu
334 # if the pstore module is builtin it will have mounted the persistent store automatically. it may also be already mounted for other reasons.
335 ${pkgs.util-linux}/bin/mountpoint -q /sys/fs/pstore || ${pkgs.util-linux}/bin/mount -t pstore -o nosuid,noexec,nodev pstore /sys/fs/pstore
336- # wait up to five seconds (arbitrary, happened within one in testing) for the backend to be registered and the files to appear. a systemd path unit cannot detect this happening; and succeeding after a restart would not start dependent units.
337- TRIES=50
338 while [ "$(cat /sys/module/pstore/parameters/backend)" = "(null)" ]; do
339 if (( $TRIES )); then
340 sleep 0.1
341 TRIES=$((TRIES-1))
342 else
343 echo "Persistent Storage backend was not registered in time." >&2
344- exit 1
345 fi
346 done
347 '';
···333 set -eu
334 # if the pstore module is builtin it will have mounted the persistent store automatically. it may also be already mounted for other reasons.
335 ${pkgs.util-linux}/bin/mountpoint -q /sys/fs/pstore || ${pkgs.util-linux}/bin/mount -t pstore -o nosuid,noexec,nodev pstore /sys/fs/pstore
336+ # wait up to 1.5 seconds for the backend to be registered and the files to appear. a systemd path unit cannot detect this happening; and succeeding after a restart would not start dependent units.
337+ TRIES=15
338 while [ "$(cat /sys/module/pstore/parameters/backend)" = "(null)" ]; do
339 if (( $TRIES )); then
340 sleep 0.1
341 TRIES=$((TRIES-1))
342 else
343 echo "Persistent Storage backend was not registered in time." >&2
344+ break
345 fi
346 done
347 '';