Le premier démarrage échoue lors du montage des partitions

0

Je construis un système en utilisant buildroot. Il utilise systemd.

Lorsque je clignote et que je démarre le système pour la première fois, systemd signale une seule erreur:

[FAILED] Failed to start File System Check on Root Device.

Ensuite, le système se redémarre 1 fois. Après cela, il n'y a plus d'erreur et le système démarre correctement.

Ensuite, j'ai essayé d'ajouter une entrée dans /etc/fstab:

/dev/root / auto ro 0 1
tmpfs /var tmpfs mode=1777 0 0

# My line:
/dev/mmcblk0p5 /opt/foo ext4      auto,exec,ro,noatime,nodiratime         0      2 

J'ai ensuite reconstruit l'image et la reflasher. Mais cette fois, lorsque je démarre, Systemd signale beaucoup d’erreurs et échoue. Pas de redémarrage, pas de shell de récupération, rien.

systemd-reboot.service: Failed to load configuration: No such file or directory
reboot.target: Trying to enqueue job reboot.target/start/replace-irreversibly
Sent message type=error sender=org.freedesktop.systemd1 destination=n/a path=n/a interface=n/a member=n/a cookie=9 reply_cookie=1 signature=s error-name=org.freedesktop.systemd1.NoSuchUnit error-message=Unit systemd-reboot.service not found.
Failed to process message type=method_call sender=n/a destination=org.freedesktop.systemd1 path=/org/freedesktop/systemd1 interface=org.freedesktop.systemd1.[    6.306396] EXT4-fs (mmcblk0p2): re-mounted. Opts: (null)
Manager member=StartUnitReplace cookie=1 reply_cookie=0 signature=sss error-name=n/a error-message=n/a: Unit systemd-reboot.service not found.
systemd-reboot.service: Collecting.
reboot.target: Collecting.
Bus n/a: changing state RUNNING → CLOSING
systemd-reboot.service: Failed to send unit change signal for systemd-reboot.service: Connection reset by peer
systemd-reboot.service: Failed to send unit remove signal for systemd-reboot.service: Transport endpoint is not connected
reboot.target: Failed to send unit change signal for reboot.target: Transport endpoint is not connected
reboot.target: Failed to send unit remove signal for reboot.target: Transport endpoint is not connected
Received SIGCHLD from PID 115 (systemd-fsck).
Child 115 (systemd-fsck) died (code=exited, status=1/FAILURE)
systemd-fsck-root.service: Child 115 belongs to systemd-fsck-root.service.
systemd-fsck-root.service: Main process exited, code=exited, status=1/FAILURE
systemd-fsck-root.service: Failed with result 'exit-code'.
systemd-fsck-root.service: Changed start -> failed
Failed to send manager change signal: Transport endpoint is not connected
systemd-fsck-root.service: Job systemd-fsck-root.service/start finished, result=failed
[FAILED] Failed to start File System Check on Root Device.
....
var.mount: Executing: /usr/bin/mount tmpfs /var -t tmpfs -o mode=1777
systemd-udevd.service: Failed to execute command: No such file or directory
systemd-udevd.service: Failed at step EXEC spawning /usr/lib/systemd/systemd-udevd: No such file or directory
var.mount: Failed to execute command: No such file or directory
var.mount: Failed at step EXEC spawning /usr/bin/mount: No such file or directory
Received SIGCHLD from PID 134 ((mount)).
Child 134 ((mount)) died (code=exited, status=203/EXEC)
var.mount: Child 134 belongs to var.mount.
var.mount: Mount process exited, code=exited status=203
var.mount: Failed with result 'exit-code'.
var.mount: Changed mounting -> failed
var.mount: Job var.mount/start finished, result=failed
[FAILED] Failed to mount /var.
See 'systemctl status var.mount' for details.
systemd-update-utmp.service: Job systemd-update-utmp.service/start finished, result=dependency
[DEPEND] Dependency failed for Update UTMP about System Boot/Shutdown.   
systemd-update-utmp-runlevel.service: Job systemd-update-utmp-runlevel.service/start finished, result=dependency
[DEPEND] Dependency failed for Update UTMP about System Runlevel Changes.
systemd-update-utmp-runlevel.service: Job systemd-update-utmp-runlevel.service/start failed with result 'dependency'.
systemd-update-utmp.service: Job systemd-update-utmp.service/start failed with result 'dependency'.
systemd-journal-flush.service: Job systemd-journal-flush.service/start finished, result=dependency
[DEPEND] Dependency failed for Flush Journal to Persistent Storage.
systemd-journal-flush.service: Job systemd-journal-flush.service/start failed with result 'dependency'.
basic.target: Job basic.target/start finished, result=dependency
[DEPEND] Dependency failed for Basic System.
multi-user.target: Job multi-user.target/start finished, result=dependency
[DEPEND] Dependency failed for Multi-User System.
multi-user.target: Job multi-user.target/start failed with result 'dependency'.
basic.target: Job basic.target/start failed with result 'dependency'.
systemd-resolved.service: Job systemd-resolved.service/start finished, result=dependency
[DEPEND] Dependency failed for Network Name Resolution.
systemd-resolved.service: Job systemd-resolved.service/start failed with result 'dependency'.
systemd-timesyncd.service: Job systemd-timesyncd.service/start finished, result=dependency
[DEPEND] Dependency failed for Network Time Synchronization.
systemd-timesyncd.service: Job systemd-timesyncd.service/start failed with result 'dependency'.
dbus.socket: Job dbus.socket/start finished, result=dependency
[DEPEND] Dependency failed for D-Bus System Message Bus Socket.
dbus.service: Job dbus.service/start finished, result=dependency
[DEPEND] Dependency failed for D-Bus System Message Bus.
dbus.service: Job dbus.service/start failed with result 'dependency'.
dbus.socket: Job dbus.socket/start failed with result 'dependency'.
local-fs.target: Job local-fs.target/start finished, result=dependency   
[DEPEND] Dependency failed for Local File Systems.
....
[FAILED] Failed to start udev Kernel Device Manager.
....
[  OK  ] Reached target Login Prompts.
BPF firewalling not supported on this systemd, proceeding without.
systemd-udevd.service: Executing: /usr/lib/systemd/systemd-udevd
systemd-tmpfiles-setup.service: Passing 0 fds to service
systemd-tmpfiles-setup.service: About to execute: /usr/bin/systemd-tmpfiles --create --remove --boot --exclude-prefix=/dev
systemd-udevd.service: Failed to execute command: No such file or directory
systemd-udevd.service: Failed at step EXEC spawning /usr/lib/systemd/systemd-udevd: No such file or directory
systemd-tmpfiles-setup.service: Forked /usr/bin/systemd-tmpfiles as 137
systemd-tmpfiles-setup.service: Changed dead -> start
systemd-tmpfiles-setup.service: Executing: /usr/bin/systemd-tmpfiles --create --remove --boot --exclude-prefix=/dev
systemd-tmpfiles-setup.service: Failed to execute command: No such file or directory
systemd-tmpfiles-setup.service: Failed at step EXEC spawning /usr/bin/systemd-tmpfiles: No such file or directory
         Starting Create Volatile Files and Directories...
systemd-journald.service: Got notification message from PID 121 (FDSTORE=1)
systemd-journald.service: Added fd 33 (n/a) to fd store.
systemd-journald.service: Got notification message from PID 121 (FDSTORE=1)
systemd-journald.service: Added fd 34 (n/a) to fd store.
Received SIGCHLD from PID 136 ((md-udevd)).
Child 136 ((md-udevd)) died (code=exited, status=203/EXEC)
systemd-udevd.service: Child 136 belongs to systemd-udevd.service.
systemd-udevd.service: Main process exited, code=exited, status=203/EXEC
systemd-udevd.service: Failed with result 'exit-code'.
systemd-udevd.service: Changed start -> failed
systemd-udevd.service: Job systemd-udevd.service/start finished, result=failed
[FAILED] Failed to start udev Kernel Device Manager.
See 'systemctl status systemd-udevd.service' for details.
systemd-udevd-kernel.socket: Changed running -> listening
systemd-udevd.service: Unit entered failed state.
systemd-udevd.service: Changed failed -> auto-restart
Child 137 ((tmpfiles)) died (code=exited, status=203/EXEC)
systemd-tmpfiles-setup.service: Child 137 belongs to systemd-tmpfiles-setup.service.
systemd-tmpfiles-setup.service: Main process exited, code=exited, status=203/EXEC
systemd-tmpfiles-setup.service: Failed with result 'exit-code'.
systemd-tmpfiles-setup.service: Changed start -> failed
systemd-tmpfiles-setup.service: Job systemd-tmpfiles-setup.service/start finished, result=failed
[FAILED] Failed to start Create Volatile Files and Directories.
....
[FAILED] Failed to start Network Service.
See 'systemctl status systemd-networkd.service' for details.
systemd-networkd.socket: Failed with result 'service-start-limit-hit'.   
systemd-networkd.socket: Changed listening -> failed
systemd-networkd.socket: Unit entered failed state.
systemd-networkd.service: Unit entered failed state.
network.target changed dead -> active
network.target: Job network.target/start finished, result=done
[  OK  ] Reached target Network.
[ ***  ] A start job is running for dev-mmcblk0p5.device (16s / 1min 31s)
dev-mmcblk0p5.device: Job dev-mmcblk0p5.device/start finished, result=timeout
[ TIME ] Timed out waiting for device dev-mmcblk0p5.device.
[email protected]: Job [email protected]/start finished, result=dependency
[DEPEND] Dependency failed for File System Check on /dev/mmcblk0p5.
opt-foo.mount: Job opt-foo.mount/start finished, result=dependency
[DEPEND] Dependency failed for /opt/foo.
opt-foo.mount: Job opt-foo.mount/start failed with result 'dependency'.
Startup finished in 2.520s (kernel) + 1min 32.920s (userspace) = 1min 35.441s.
System is tainted: var-run-bad
[email protected]: Job [email protected]/start failed with result 'dependency'.
dev-mmcblk0p5.device: Job dev-mmcblk0p5.device/start failed with result 'timeout'.

Ensuite, si je redémarre manuellement le système en supprimant la source d'alimentation, il démarre sans erreur et tout est correctement monté.

J'ai également essayé de ne pas utiliser fstab et d'utiliser un script exécuté par un service pour monter la partition, mais le résultat est similaire. La seule différence que j’ai vue c’est que, dans ce cas, je n’ai pas le travail d’attente pour /dev/mmcblk0p5 à la fin.

C'est vraiment bizarre, sans mon entrée dans fstab, le système redémarre rapidement après le premier démarrage. Avec mon entrée, il semble que cela commence, ou du moins tente de démarrer plus de services.

Une idée de ce qui pourrait se passer?

Benjamin T
la source
J'ai essayé de supprimer BusyBox du système. Cela semble fonctionner, j'ai maintenant d'autres problèmes comme celui documenté ici: lists.busybox.net/pipermail/buildroot/2014-October/109716.html
Benjamin T