[FE training-materials-updates] Tinysystem lab: explain why halt works

Thomas Petazzoni thomas.petazzoni at free-electrons.com
Thu Jun 5 00:27:42 CEST 2014


Dear Michael Opdenacker,

On Wed, 04 Jun 2014 19:05:18 +0200, Michael Opdenacker wrote:

> -Note that you can also halt your target in a clean way with the \code{halt}
> -command, thanks to \code{proc} being mounted.
> +Note that you can also now halt your target in a clean way with the \code{halt}
> +command, thanks to \code{proc} being mounted \footnote{\code{halt}
> +can find the list of mounted filesystems in \code{/proc/mounts}, and
> +unmount each of them in a clean way before shutting down.}.

Eeeuh, c'est un peu plus compliqué que ça. halt lui-même ne démonte pas
les systèmes de fichiers. Il envoie un signal à l'init de Busybox, qui
va exécuter les actions marquées 'shutdown' dans le inittab. Et si
parmi celles-ci il y a "umount -a", alors grâce à /proc ça va démonter
les systèmes de fichiers qui sont montés. Ce n'est pas halt qui démonte
les systèmes de fichiers, il suffit de lire init/halt.c dans les
sources de Busybox pour s'en convaincre.

Bonne soirée,

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com


More information about the training-materials-updates mailing list