[LEDE-DEV] [PATCH]fstools: added xfs and f2fs to block-mount

Alberto Bursi alberto.bursi at outlook.it
Sun Oct 16 07:23:29 PDT 2016


Damn, while this patch adds only partial xfs support to fstools (it 
allows to mount xfs by block mount).

Most of fstools have code to use f2fs too already so the fact that block 
mount couldn't mount f2fs is 100% a bug and this patch fixes that.

I'm going to add xfs support to other fstools components in a following 
patch.

-Alberto

On 10/15/2016 07:25 PM, Alberto Bursi wrote:
> added the code to recognize the filesystem checkers for xfs and f2fs
> added xfs and f2fs to the filesystem whitelist of block.
>
> Signed-off-by: Alberto Bursi <alberto.bursi at outlook.it>
> -----
>
> --- fstools/block.c	2016-10-15 19:15:31.916714011 +0200
> +++ fstools/block.c	2016-10-15 19:22:44.164702448 +0200
> @@ -702,6 +702,8 @@ static void check_filesystem(struct blki
>   {
>   	pid_t pid;
>   	struct stat statbuf;
> +    	const char *xfsck = "/sbin/xfs_repair";
> +    	const char *f2fsck = "/usr/sbin/fsck.f2fs";
>   	const char *e2fsck = "/usr/sbin/e2fsck";
>   	const char *dosfsck = "/usr/sbin/dosfsck";
>   	const char *ckfs;
> @@ -712,6 +714,10 @@ static void check_filesystem(struct blki
>
>   	if (!strncmp(pr->id->name, "vfat", 4)) {
>   		ckfs = dosfsck;
> +    	} else if (!strncmp(pr->id->name, "f2fs", 4)) {
> +        	ckfs = f2fsck;
> +    	} else if (!strncmp(pr->id->name, "xfs", 3)) {
> +        	ckfs = xfsck;
>   	} else if (!strncmp(pr->id->name, "ext", 3)) {
>   		ckfs = e2fsck;
>   	} else {
> @@ -1170,8 +1176,10 @@ static int mount_extroot(char *cfg)
>   	}
>   	if (pr) {
>   		if (strncmp(pr->id->name, "ext", 3) &&
> -		    strncmp(pr->id->name, "ubifs", 5)) {
> -			ULOG_ERR("extroot: unsupported filesystem %s, try ext4\n",
> pr->id->name);
> +            strncmp(pr->id->name, "xfs", 3) &&
> +            strncmp(pr->id->name, "f2fs", 4) &&
> +            strncmp(pr->id->name, "ubifs", 5)) {
> +            ULOG_ERR("extroot: unsupported filesystem %s, try ext4,
> xfs, f2fs, ubifs\n", pr->id->name);
>   			return -1;
>   		}
>
> _______________________________________________
> Lede-dev mailing list
> Lede-dev at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/lede-dev
>



More information about the Lede-dev mailing list