Primeira inicialização falha ao montar partições

0

Estou construindo um sistema usando o buildroot. Usa o systemd.

Quando eu flash e inicio o sistema pela primeira vez, o systemd reporta apenas um erro:

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

Em seguida, o sistema é reiniciado 1 vez. Depois disso, não há mais erros e o sistema é inicializado corretamente.

Então tentei adicionar uma entrada em /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 

Eu então reconstruo a imagem e a reflash. Mas desta vez quando eu inicializo, o systemd reporta muitos erros e falha. Sem reinicialização, sem shell de recuperação, nada.

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'.

Então, se eu reinicializar o sistema manualmente, removendo a fonte de energia, ele inicializará sem nenhum erro e tudo será montado corretamente.

Eu também tentei não usar o fstab e usar um script executado por um serviço para montar a partição, mas o resultado é semelhante. A única diferença que vi foi que, neste caso, não tenho o trabalho de espera para /dev/mmcblk0p5 no final.

É realmente estranho, sem minha entrada no fstab, o sistema é reinicializado rapidamente após a primeira inicialização. Com a minha entrada, parece que começa, ou pelo menos tenta iniciar mais serviços.

Alguma ideia do que poderia estar acontecendo?

    
por Benjamin T 28.06.2018 / 15:48

0 respostas