Message ID | 20180928230102.251-1-ansuelsmth@gmail.com |
---|---|
State | Accepted |
Delegated to: | John Crispin |
Headers | show |
Series | [OpenWrt-Devel] fstools: add ntfs support | expand |
On Fri, Sep 28, 2018 at 16:01 Ansuel Smith <ansuelsmth@gmail.com> wrote: > This adds ntfs support to block-mount What’s the point of this? This is also read only if I’m not mistaken. > > > Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com> > --- > block.c | 9 ++++++++- > 1 file changed, 8 insertions(+), 1 deletion(-) > > diff --git a/block.c b/block.c > index b377429..2e3841a 100644 > --- a/block.c > +++ b/block.c > @@ -711,6 +711,7 @@ static void check_filesystem(struct probe_info *pr) > const char *f2fsck = "/usr/sbin/fsck.f2fs"; > const char *dosfsck = "/usr/sbin/dosfsck"; > const char *btrfsck = "/usr/bin/btrfsck"; > + const char *ntfsck = "/usr/bin/ntfsfix"; > const char *ckfs; > > /* UBIFS does not need stuff like fsck */ > @@ -725,6 +726,8 @@ static void check_filesystem(struct probe_info *pr) > ckfs = e2fsck; > } else if (!strncmp(pr->type, "btrfs", 5)) { > ckfs = btrfsck; > + } else if (!strncmp(pr->type, "ntfs", 4)) { > + ckfs = ntfsck; > } else { > ULOG_ERR("check_filesystem: %s is not supported\n", > pr->type); > return; > @@ -743,6 +746,9 @@ static void check_filesystem(struct probe_info *pr) > } else if(!strncmp(pr->type, "btrfs", 5)) { > execl(ckfs, ckfs, "--repair", pr->dev, NULL); > exit(-1); > + } else if(!strncmp(pr->type, "ntfs", 4)) { > + execl(ckfs, ckfs, "-b", pr->dev, NULL); > + exit(-1); > } else { > execl(ckfs, ckfs, "-p", pr->dev, NULL); > exit(-1); > @@ -1437,8 +1443,9 @@ static int mount_extroot(char *cfg) > if (strncmp(pr->type, "ext", 3) && > strncmp(pr->type, "f2fs", 4) && > strncmp(pr->type, "btrfs", 5) && > + strncmp(pr->type, "ntfs", 4) && > strncmp(pr->type, "ubifs", 5)) { > - ULOG_ERR("extroot: unsupported filesystem %s, try > ext4, f2fs, btrfs or ubifs\n", pr->type); > + ULOG_ERR("extroot: unsupported filesystem %s, try > ext4, f2fs, btrfs, ntfs or ubifs\n", pr->type); > return -1; > } > > -- > 2.17.1 > > > _______________________________________________ > openwrt-devel mailing list > openwrt-devel@lists.openwrt.org > https://lists.openwrt.org/mailman/listinfo/openwrt-devel > <div><br></div><div><br><div class="gmail_quote"><div dir="ltr">On Fri, Sep 28, 2018 at 16:01 Ansuel Smith <<a href="mailto:ansuelsmth@gmail.com">ansuelsmth@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">This adds ntfs support to block-mount</blockquote><div dir="auto">What’s the point of this? This is also read only if I’m not mistaken.</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br> <br> Signed-off-by: Ansuel Smith <<a href="mailto:ansuelsmth@gmail.com" target="_blank">ansuelsmth@gmail.com</a>><br> ---<br> block.c | 9 ++++++++-<br> 1 file changed, 8 insertions(+), 1 deletion(-)<br> <br> diff --git a/block.c b/block.c<br> index b377429..2e3841a 100644<br> --- a/block.c<br> +++ b/block.c<br> @@ -711,6 +711,7 @@ static void check_filesystem(struct probe_info *pr)<br> const char *f2fsck = "/usr/sbin/fsck.f2fs";<br> const char *dosfsck = "/usr/sbin/dosfsck";<br> const char *btrfsck = "/usr/bin/btrfsck";<br> + const char *ntfsck = "/usr/bin/ntfsfix";<br> const char *ckfs;<br> <br> /* UBIFS does not need stuff like fsck */<br> @@ -725,6 +726,8 @@ static void check_filesystem(struct probe_info *pr)<br> ckfs = e2fsck;<br> } else if (!strncmp(pr->type, "btrfs", 5)) {<br> ckfs = btrfsck;<br> + } else if (!strncmp(pr->type, "ntfs", 4)) {<br> + ckfs = ntfsck;<br> } else {<br> ULOG_ERR("check_filesystem: %s is not supported\n", pr->type);<br> return;<br> @@ -743,6 +746,9 @@ static void check_filesystem(struct probe_info *pr)<br> } else if(!strncmp(pr->type, "btrfs", 5)) {<br> execl(ckfs, ckfs, "--repair", pr->dev, NULL);<br> exit(-1);<br> + } else if(!strncmp(pr->type, "ntfs", 4)) {<br> + execl(ckfs, ckfs, "-b", pr->dev, NULL);<br> + exit(-1);<br> } else {<br> execl(ckfs, ckfs, "-p", pr->dev, NULL);<br> exit(-1);<br> @@ -1437,8 +1443,9 @@ static int mount_extroot(char *cfg)<br> if (strncmp(pr->type, "ext", 3) &&<br> strncmp(pr->type, "f2fs", 4) &&<br> strncmp(pr->type, "btrfs", 5) &&<br> + strncmp(pr->type, "ntfs", 4) &&<br> strncmp(pr->type, "ubifs", 5)) {<br> - ULOG_ERR("extroot: unsupported filesystem %s, try ext4, f2fs, btrfs or ubifs\n", pr->type);<br> + ULOG_ERR("extroot: unsupported filesystem %s, try ext4, f2fs, btrfs, ntfs or ubifs\n", pr->type);<br> return -1;<br> }<br> <br> -- <br> 2.17.1<br> <br> <br> _______________________________________________<br> openwrt-devel mailing list<br> <a href="mailto:openwrt-devel@lists.openwrt.org" target="_blank">openwrt-devel@lists.openwrt.org</a><br> <a href="https://lists.openwrt.org/mailman/listinfo/openwrt-devel" rel="noreferrer" target="_blank">https://lists.openwrt.org/mailman/listinfo/openwrt-devel</a><br> </blockquote></div></div>
> On Sep 28, 2018, at 16:31, Ansuel Smith <ansuelsmth@gmail.com> wrote: > > If you also install ntfs-3g it's not read only Hmm? That requires specifying NTFS-3G manually, no? > > Il Sab 29 Set 2018, 01:28 Rosen Penev <rosenp@gmail.com> ha scritto: >> >> >>> On Fri, Sep 28, 2018 at 16:01 Ansuel Smith <ansuelsmth@gmail.com> wrote: >>> This adds ntfs support to block-mount >> What’s the point of this? This is also read only if I’m not mistaken. >>> >>> >>> Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com> >>> --- >>> block.c | 9 ++++++++- >>> 1 file changed, 8 insertions(+), 1 deletion(-) >>> >>> diff --git a/block.c b/block.c >>> index b377429..2e3841a 100644 >>> --- a/block.c >>> +++ b/block.c >>> @@ -711,6 +711,7 @@ static void check_filesystem(struct probe_info *pr) >>> const char *f2fsck = "/usr/sbin/fsck.f2fs"; >>> const char *dosfsck = "/usr/sbin/dosfsck"; >>> const char *btrfsck = "/usr/bin/btrfsck"; >>> + const char *ntfsck = "/usr/bin/ntfsfix"; >>> const char *ckfs; >>> >>> /* UBIFS does not need stuff like fsck */ >>> @@ -725,6 +726,8 @@ static void check_filesystem(struct probe_info *pr) >>> ckfs = e2fsck; >>> } else if (!strncmp(pr->type, "btrfs", 5)) { >>> ckfs = btrfsck; >>> + } else if (!strncmp(pr->type, "ntfs", 4)) { >>> + ckfs = ntfsck; >>> } else { >>> ULOG_ERR("check_filesystem: %s is not supported\n", pr->type); >>> return; >>> @@ -743,6 +746,9 @@ static void check_filesystem(struct probe_info *pr) >>> } else if(!strncmp(pr->type, "btrfs", 5)) { >>> execl(ckfs, ckfs, "--repair", pr->dev, NULL); >>> exit(-1); >>> + } else if(!strncmp(pr->type, "ntfs", 4)) { >>> + execl(ckfs, ckfs, "-b", pr->dev, NULL); >>> + exit(-1); >>> } else { >>> execl(ckfs, ckfs, "-p", pr->dev, NULL); >>> exit(-1); >>> @@ -1437,8 +1443,9 @@ static int mount_extroot(char *cfg) >>> if (strncmp(pr->type, "ext", 3) && >>> strncmp(pr->type, "f2fs", 4) && >>> strncmp(pr->type, "btrfs", 5) && >>> + strncmp(pr->type, "ntfs", 4) && >>> strncmp(pr->type, "ubifs", 5)) { >>> - ULOG_ERR("extroot: unsupported filesystem %s, try ext4, f2fs, btrfs or ubifs\n", pr->type); >>> + ULOG_ERR("extroot: unsupported filesystem %s, try ext4, f2fs, btrfs, ntfs or ubifs\n", pr->type); >>> return -1; >>> } >>> >>> -- >>> 2.17.1 >>> >>> >>> _______________________________________________ >>> openwrt-devel mailing list >>> openwrt-devel@lists.openwrt.org >>> https://lists.openwrt.org/mailman/listinfo/openwrt-devel <html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div dir="ltr"></div><div dir="ltr"><br></div><div dir="ltr"><br>On Sep 28, 2018, at 16:31, Ansuel Smith <<a href="mailto:ansuelsmth@gmail.com">ansuelsmth@gmail.com</a>> wrote:<br><br></div><blockquote type="cite"><div dir="ltr"><div dir="auto">If you also install ntfs-3g it's not read only </div></div></blockquote>Hmm? That requires specifying NTFS-3G manually, no?<br><blockquote type="cite"><div dir="ltr"><br><div class="gmail_quote"><div dir="ltr">Il Sab 29 Set 2018, 01:28 Rosen Penev <<a href="mailto:rosenp@gmail.com">rosenp@gmail.com</a>> ha scritto:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><br></div><div><br><div class="gmail_quote"><div dir="ltr">On Fri, Sep 28, 2018 at 16:01 Ansuel Smith <<a href="mailto:ansuelsmth@gmail.com" target="_blank" rel="noreferrer">ansuelsmth@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">This adds ntfs support to block-mount</blockquote><div dir="auto">What’s the point of this? This is also read only if I’m not mistaken.</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br> <br> Signed-off-by: Ansuel Smith <<a href="mailto:ansuelsmth@gmail.com" target="_blank" rel="noreferrer">ansuelsmth@gmail.com</a>><br> ---<br> block.c | 9 ++++++++-<br> 1 file changed, 8 insertions(+), 1 deletion(-)<br> <br> diff --git a/block.c b/block.c<br> index b377429..2e3841a 100644<br> --- a/block.c<br> +++ b/block.c<br> @@ -711,6 +711,7 @@ static void check_filesystem(struct probe_info *pr)<br> const char *f2fsck = "/usr/sbin/fsck.f2fs";<br> const char *dosfsck = "/usr/sbin/dosfsck";<br> const char *btrfsck = "/usr/bin/btrfsck";<br> + const char *ntfsck = "/usr/bin/ntfsfix";<br> const char *ckfs;<br> <br> /* UBIFS does not need stuff like fsck */<br> @@ -725,6 +726,8 @@ static void check_filesystem(struct probe_info *pr)<br> ckfs = e2fsck;<br> } else if (!strncmp(pr->type, "btrfs", 5)) {<br> ckfs = btrfsck;<br> + } else if (!strncmp(pr->type, "ntfs", 4)) {<br> + ckfs = ntfsck;<br> } else {<br> ULOG_ERR("check_filesystem: %s is not supported\n", pr->type);<br> return;<br> @@ -743,6 +746,9 @@ static void check_filesystem(struct probe_info *pr)<br> } else if(!strncmp(pr->type, "btrfs", 5)) {<br> execl(ckfs, ckfs, "--repair", pr->dev, NULL);<br> exit(-1);<br> + } else if(!strncmp(pr->type, "ntfs", 4)) {<br> + execl(ckfs, ckfs, "-b", pr->dev, NULL);<br> + exit(-1);<br> } else {<br> execl(ckfs, ckfs, "-p", pr->dev, NULL);<br> exit(-1);<br> @@ -1437,8 +1443,9 @@ static int mount_extroot(char *cfg)<br> if (strncmp(pr->type, "ext", 3) &&<br> strncmp(pr->type, "f2fs", 4) &&<br> strncmp(pr->type, "btrfs", 5) &&<br> + strncmp(pr->type, "ntfs", 4) &&<br> strncmp(pr->type, "ubifs", 5)) {<br> - ULOG_ERR("extroot: unsupported filesystem %s, try ext4, f2fs, btrfs or ubifs\n", pr->type);<br> + ULOG_ERR("extroot: unsupported filesystem %s, try ext4, f2fs, btrfs, ntfs or ubifs\n", pr->type);<br> return -1;<br> }<br> <br> -- <br> 2.17.1<br> <br> <br> _______________________________________________<br> openwrt-devel mailing list<br> <a href="mailto:openwrt-devel@lists.openwrt.org" target="_blank" rel="noreferrer">openwrt-devel@lists.openwrt.org</a><br> <a href="https://lists.openwrt.org/mailman/listinfo/openwrt-devel" rel="noreferrer noreferrer" target="_blank">https://lists.openwrt.org/mailman/listinfo/openwrt-devel</a><br> </blockquote></div></div> </blockquote></div> </div></blockquote></body></html>
diff --git a/block.c b/block.c index b377429..2e3841a 100644 --- a/block.c +++ b/block.c @@ -711,6 +711,7 @@ static void check_filesystem(struct probe_info *pr) const char *f2fsck = "/usr/sbin/fsck.f2fs"; const char *dosfsck = "/usr/sbin/dosfsck"; const char *btrfsck = "/usr/bin/btrfsck"; + const char *ntfsck = "/usr/bin/ntfsfix"; const char *ckfs; /* UBIFS does not need stuff like fsck */ @@ -725,6 +726,8 @@ static void check_filesystem(struct probe_info *pr) ckfs = e2fsck; } else if (!strncmp(pr->type, "btrfs", 5)) { ckfs = btrfsck; + } else if (!strncmp(pr->type, "ntfs", 4)) { + ckfs = ntfsck; } else { ULOG_ERR("check_filesystem: %s is not supported\n", pr->type); return; @@ -743,6 +746,9 @@ static void check_filesystem(struct probe_info *pr) } else if(!strncmp(pr->type, "btrfs", 5)) { execl(ckfs, ckfs, "--repair", pr->dev, NULL); exit(-1); + } else if(!strncmp(pr->type, "ntfs", 4)) { + execl(ckfs, ckfs, "-b", pr->dev, NULL); + exit(-1); } else { execl(ckfs, ckfs, "-p", pr->dev, NULL); exit(-1); @@ -1437,8 +1443,9 @@ static int mount_extroot(char *cfg) if (strncmp(pr->type, "ext", 3) && strncmp(pr->type, "f2fs", 4) && strncmp(pr->type, "btrfs", 5) && + strncmp(pr->type, "ntfs", 4) && strncmp(pr->type, "ubifs", 5)) { - ULOG_ERR("extroot: unsupported filesystem %s, try ext4, f2fs, btrfs or ubifs\n", pr->type); + ULOG_ERR("extroot: unsupported filesystem %s, try ext4, f2fs, btrfs, ntfs or ubifs\n", pr->type); return -1; }
This adds ntfs support to block-mount Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com> --- block.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)