[OpenWrt-Devel] [PATCH, V2] fstools: mount ntfs with ntfs-3g utility if it exist

Rosysong rosysong at rosinson.com
Mon Oct 1 08:40:32 EDT 2018


       1. Users can decided whether to use ntfs-3g themselves, if so, just slect it at "make menuconfig->utility->filesystem->ntfs-3g-utils";
       2. This sentence "access("/sbin/mount.ntfs-3g", X_OK)"   does the test for its presence or not;
       3. There are 2 way to mount devices of ntfs filesystem, default is readonly while writable with fuseblk(ntfs-3g),  
           so we need to do a special test here that avoid user remount it again and again when system boot.


------------------------------------------------------------------
From:Philip Prindeville <philipp_subx at redfish-solutions.com>
Send Time:2018 Oct 1 (Mon) 12:21
To:Rosy Song <rosysong at rosinson.com>
Cc:openwrt-devel <openwrt-devel at lists.openwrt.org>
Subject:Re: [OpenWrt-Devel] [PATCH, V2] fstools: mount ntfs with ntfs-3g utility if it exist

I’m not seeing where “mount.ntfs-3g” is being set as the program to use...  and should the test for the presence and modes of the program be generic? i.e. regardless of what type of FS or which program you use to mount it, you’ll want to test for its presence.

So these are really two independent things.


> On Sep 30, 2018, at 9:04 PM, Rosy Song <rosysong at rosinson.com> wrote:
> 
> Signed-off-by: Rosy Song <rosysong at rosinson.com>
> ---
> block.c | 8 +++++++-
> 1 file changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/block.c b/block.c
> index 2651c86..b2cd32b 100644
> --- a/block.c
> +++ b/block.c
> @@ -881,7 +881,13 @@ static int handle_mount(const char *source, const char *target,
>    size_t mount_opts_len;
>    char *mount_opts = NULL, *ptr;
> 
> -    err = mount(source, target, fstype, m ? m->flags : 0,
> +    /* Mount ntfs filesystem with ntfs-3g utility */
> +    if (!strcmp(fstype, "ntfs") &&
> +        !access("/sbin/mount.ntfs-3g", X_OK)) {
> +        err = -1;
> +        errno = ENODEV;
> +    } else
> +        err = mount(source, target, fstype, m ? m->flags : 0,
>                (m && m->options) ? m->options : "");
> 
>    /* Requested file system type is not available in kernel,
> -- 
> 2.17.0
> 
> 
> _______________________________________________
> openwrt-devel mailing list
> openwrt-devel at lists.openwrt.org
> https://lists.openwrt.org/mailman/listinfo/openwrt-devel

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20181001/7abe1989/attachment.htm>
-------------- next part --------------
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


More information about the openwrt-devel mailing list