#!/bin/sh
# Device nodes that load their module on first open (kmod static-nodes), and
# the /dev entries of tmpfiles.d, like kmod-static-nodes.service and
# systemd-tmpfiles-setup-dev.service.
f=/lib/modules/$(uname -r)/modules.devname
if [ -s "$f" ]; then
	mkdir -p /run/tmpfiles.d
	kmod static-nodes --format=tmpfiles --output=/run/tmpfiles.d/static-nodes.conf || exit 1
fi
systemd-tmpfiles --prefix=/dev --create --boot
rc=$?
# DATAERR and CANTCREAT count as success, as in systemd's unit
case $rc in 0 | 65 | 73) exit 0 ;; esac
exit "$rc"
