/* Routine implementing u-boot ls command which lists content of a given directory on a current partition. */
int do_jffs2_ls(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
/* Routine implementing u-boot ls command which lists content of a given directory on a current partition. */
int do_jffs2_ls(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
{
	char *filename = "/";
	int ret;
	struct part_info *part;
	if (argc == 2)
		filename = argv[1];
	if (mtdparts_init() !=0)
		return 1;
	if ((part = jffs2_part_info(current_mtd_dev, current_mtd_partnum))){
		if (cramfs_check(part)) {
			ret = cramfs_ls (part, filename);
		} else {
			ret = jffs2_1pass_ls(part, filename);
		}
		return ret ? 0 : 1;
	}
	return 1;
}