public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: "Andreas Bießmann" <andreas.devel@googlemail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH V4 3/3] fs: add filesystem switch libary, implement ls and fsload commands
Date: Tue, 30 Oct 2012 12:05:37 +0100	[thread overview]
Message-ID: <508FB481.3020101@gmail.com> (raw)
In-Reply-To: <1350924231-5830-3-git-send-email-swarren@wwwdotorg.org>

Dear all,

On 22.10.2012 18:43, Stephen Warren wrote:
> From: Stephen Warren <swarren@nvidia.com>
> 
> Implement "ls" and "fsload" commands that act like {fat,ext2}{ls,load},
> and transparently handle either file-system. This scheme could easily be
> extended to other filesystem types; I only didn't do it for zfs because
> I don't have any filesystems of that type to test with.
> 
> Replace the implementation of {fat,ext[24]}{ls,load} with this new code
> too.
> 
> Signed-off-by: Stephen Warren <swarren@nvidia.com>

this patch (namely 045fa1e1142552799ad3203e9e0bc22a11e866ea) seems to
break avr32 on runtime. It seems there is a new array introduced (the
fstypes array in fs/fs.c) which do not provide a relocation method
(CONFIG_NEEDS_MANUAL_RELOC). This is currently only a weak assumption,
but has any other requiring manual relocation m86k, mips, nds32m sparc)
also encountered this problem?

> ---

<snip>

> diff --git a/fs/fs.c b/fs/fs.c
> new file mode 100644
> index 0000000..23ffa25
> --- /dev/null
> +++ b/fs/fs.c
> @@ -0,0 +1,308 @@

<snip>

> +
> +static const struct {
> +	int fstype;
> +	int (*probe)(void);
> +} fstypes[] = {
> +	{
> +		.fstype = FS_TYPE_FAT,
> +		.probe = fs_probe_fat,
> +	},
> +	{
> +		.fstype = FS_TYPE_EXT,
> +		.probe = fs_probe_ext,
> +	},
> +};

I currently think this should be manually relocated for those arches
which need the manual relocation.

> +
> +int fs_set_blk_dev(const char *ifname, const char *dev_part_str, int fstype)
> +{
> +	int part, i;
> +
> +	part = get_device_and_partition(ifname, dev_part_str, &fs_dev_desc,
> +					&fs_partition, 1);
> +	if (part < 0)
> +		return -1;
> +
> +	for (i = 0; i < ARRAY_SIZE(fstypes); i++) {
> +		if ((fstype != FS_TYPE_ANY) && (fstype != fstypes[i].fstype))
> +			continue;
> +
> +		if (!fstypes[i].probe()) {
> +			fs_type = fstypes[i].fstype;
> +			return 0;
> +		}
> +	}
> +
> +	printf("** Unrecognized filesystem type **\n");
> +	return -1;
> +}

Best regards

Andreas Bie?mann

  reply	other threads:[~2012-10-30 11:05 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-22 16:43 [U-Boot] [PATCH V4 1/3] fs: delete unused Makefile Stephen Warren
2012-10-22 16:43 ` [U-Boot] [PATCH V4 2/3] fs: separate CONFIG_FS_{FAT, EXT4} from CONFIG_CMD_{FAT, EXT*} Stephen Warren
2012-10-22 16:43 ` [U-Boot] [PATCH V4 3/3] fs: add filesystem switch libary, implement ls and fsload commands Stephen Warren
2012-10-30 11:05   ` Andreas Bießmann [this message]
2012-10-30 16:47     ` Tom Rini
2012-10-30 18:29       ` [U-Boot] [PATCH] fs/fs.c: fix fs_set_blk_dev() for manual relocation Andreas Bießmann
2012-10-30 18:41         ` Stephen Warren
2012-10-30 22:19           ` Tom Rini
2012-10-31  9:42           ` Andreas Bießmann
2012-10-30 17:50     ` [U-Boot] [PATCH] fs: handle CONFIG_NEEDS_MANUAL_RELOC Stephen Warren
2012-10-31  9:47       ` Andreas Bießmann
2012-11-04 18:28         ` Tom Rini
2012-10-30 20:23   ` [U-Boot] [PATCH V4 3/3] fs: add filesystem switch libary, implement ls and fsload commands Benoît Thébaudeau
2012-10-30 21:18     ` Stephen Warren
2012-10-30 21:29       ` Tom Rini
2012-10-30 21:59       ` Benoît Thébaudeau
2012-10-30 22:01         ` Stephen Warren
2012-10-31 10:43   ` Andreas Bießmann
2012-10-31 17:03     ` Stephen Warren
2012-10-29 22:55 ` [U-Boot] [PATCH V4 1/3] fs: delete unused Makefile Tom Rini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=508FB481.3020101@gmail.com \
    --to=andreas.devel@googlemail.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox