[OE-core] [PATCH morty] wic: partition: Add fsck to avoid corrupt EXT file systems

Enrico Joerns ejo at pengutronix.de
Thu Mar 30 13:32:11 UTC 2017


Hi Daniel,

On 03/30/2017 02:30 PM, Daniel Schultz wrote:
> This patch avoids the creation of a corrupt EXT file system.
>
> Since there are no checks if a EXT file system was successfully created,
> this should add to prevent possible system failures.
>
> Signed-off-by: Daniel Schultz <d.schultz at phytec.de>
> ---
>  scripts/lib/wic/partition.py | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/scripts/lib/wic/partition.py b/scripts/lib/wic/partition.py
> index 3b3bd2d..152eb7b 100644
> --- a/scripts/lib/wic/partition.py
> +++ b/scripts/lib/wic/partition.py
> @@ -239,6 +239,9 @@ class Partition():
>              (self.fstype, extra_imagecmd, rootfs, label_str, rootfs_dir)
>          exec_native_cmd(mkfs_cmd, native_sysroot, pseudo=pseudo)
>
> +        mkfs_cmd = "fsck.%s -pvfD %s" % (self.fstype, rootfs)
> +        exec_native_cmd(mkfs_cmd, native_sysroot, pseudo=pseudo)
> +
>      def prepare_rootfs_btrfs(self, rootfs, oe_builddir, rootfs_dir,
>                               native_sysroot, pseudo):
>          """
>

maybe it's worth noting this check should not primary target fixing a 
corrupt ext4 (bad if mkfs created on!) but performs some directory 
optimization on the build host that otherwise would be performed on the 
target the next time something triggers an fsck.
Performing those optimizations on the target will also make fsck trigger 
a reboot!

As the options as provided will not fix a real corrupted EXT it might 
also be useful to change the patch description to not confuse about the 
impact of the change.

Regards, Enrico

-- 
Pengutronix e.K.                           | Enrico Jörns                |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-5080 |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |




More information about the Openembedded-core mailing list