]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
ubifs: Allow ubifsmount volume reference by number
authorJoe Hershberger <joe.hershberger@ni.com>
Thu, 1 Nov 2012 16:54:18 +0000 (16:54 +0000)
committerTom Rini <trini@ti.com>
Mon, 4 Mar 2013 19:19:56 +0000 (14:19 -0500)
UBI can mount volumes by name or number  The current code forces you
to name the volume by prepending every name with "ubi:".

>From fs/ubifs/super.c
 * There are several ways to specify UBI volumes when mounting UBIFS:
 * o ubiX_Y    - UBI device number X, volume Y;
 * o ubiY      - UBI device number 0, volume Y;
 * o ubiX:NAME - mount UBI device X, volume with name NAME;
 * o ubi:NAME  - mount UBI device 0, volume with name NAME.

Now any name passed in any of the above forms are allowed.

Also update the configs that referenced ubifsmount.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
fs/ubifs/super.c
include/configs/apx4devkit.h
include/configs/cam_enc_4xx.h
include/configs/dockstar.h
include/configs/ea20.h
include/configs/ib62x0.h
include/configs/iconnect.h
include/configs/omap3_pandora.h
include/configs/tricorder.h
include/configs/x600.h

index 30ccd98c22b3942bbb2a909a18d0ff3516953260..9acf243eeff42bf88f56a23ef8d7258ac1f4692f 100644 (file)
@@ -1164,10 +1164,9 @@ static struct file_system_type ubifs_fs_type = {
        .get_sb  = ubifs_get_sb,
 };
 
-int ubifs_mount(char *vol_name)
+int ubifs_mount(char *name)
 {
        int flags;
-       char name[80] = "ubi:";
        void *data;
        struct vfsmount *mnt;
        int ret;
@@ -1186,7 +1185,6 @@ int ubifs_mount(char *vol_name)
         * Mount in read-only mode
         */
        flags = MS_RDONLY;
-       strcat(name, vol_name);
        data = NULL;
        mnt = NULL;
        ret = ubifs_get_sb(&ubifs_fs_type, flags, name, data, mnt);
index 73c66af06d5b54ecd53c0c0b2a8705a7d5f7819b..ab4efa4b03cad23a2ad8c6ea5c3632736b1f632b 100644 (file)
                "root=ubi0:rootfs rootfstype=ubifs ${mtdparts} rw\0" \
        "bootcmd_nand=" \
                "run bootargs_nand && ubi part root 2048 && " \
-               "ubifsmount rootfs && ubifsload 41000000 boot/uImage && " \
+               "ubifsmount ubi:rootfs && ubifsload 41000000 boot/uImage && " \
                "bootm 41000000\0" \
        "bootargs_mmc=" \
                "setenv bootargs ${kernelargs} " \
index a7a698c0caa6b593f9bbb85d61b636bfeaaee8eb..56528ddaafb2ae074953f80c186ff75921a7dacf 100644 (file)
        "bootfile=" __stringify(CONFIG_HOSTNAME) "/uImage \0"           \
        "kernel_addr_r=80600000\0"                                      \
        "load_kernel=tftp ${kernel_addr_r} ${bootfile}\0"               \
-       "ubi_load_kernel=ubi part ubi 2048;ubifsmount ${img_volume};"   \
+       "ubi_load_kernel=ubi part ubi 2048;ubifsmount ubi:${img_volume};" \
                "ubifsload ${kernel_addr_r} boot/uImage\0"              \
        "fit_addr_r=" __stringify(CONFIG_BOARD_IMG_ADDR_R) "\0"         \
        "img_addr_r=" __stringify(CONFIG_BOARD_IMG_ADDR_R) "\0"         \
index 249f93bf130f3baa8206a20093096cb5a68c4df6..63d5e35e92949815d293ab7868a526c17deecbe5 100644 (file)
@@ -85,7 +85,7 @@
 #define CONFIG_BOOTCOMMAND \
        "setenv bootargs ${console} ${mtdparts} ${bootargs_root}; "     \
        "ubi part root; " \
-       "ubifsmount root; " \
+       "ubifsmount ubi:root; " \
        "ubifsload 0x800000 ${kernel}; " \
        "ubifsload 0x1100000 ${initrd}; " \
        "bootm 0x800000 0x1100000"
index d3eb5969dc99e37c8881a0d99841f78c3851050c..a8c08e8d95d15b19f94b7da8669018632adf41f3 100644 (file)
                "bootm ${kernel_addr_r}\0"                              \
        "net_self_load=tftp ${kernel_addr_r} ${bootfile};"              \
                "tftp ${ramdisk_addr_r} ${ramdisk_file};\0"             \
-       "nand_nand=ubi part nand0,${as};ubifsmount rootfs;"             \
+       "nand_nand=ubi part nand0,${as};ubifsmount ubi:rootfs;"         \
                "ubifsload ${kernel_addr_r} /boot/uImage;"              \
                "ubifsumount; run nandargs addip addtty "               \
                "addmtd addmisc addmem;clrlogo;"                        \
                "bootm ${kernel_addr_r}\0"                              \
-       "nand_nandrw=ubi part nand0,${as};ubifsmount rootfs;"           \
+       "nand_nandrw=ubi part nand0,${as};ubifsmount ubi:rootfs;"       \
                "ubifsload ${kernel_addr_r} /boot/uImage;"              \
                "ubifsumount; run nandrwargs addip addtty "             \
                "addmtd addmisc addmem;clrlogo;"                        \
        "u-boot=" __stringify(CONFIG_HOSTNAME) "/u-boot.bin\0"          \
        "load_magic=if sf probe 0;then sf "                             \
                "read c0000000 0x10000 0x60000;fi\0"                    \
-       "load_nand=ubi part nand0,${as};ubifsmount rootfs;"             \
+       "load_nand=ubi part nand0,${as};ubifsmount ubi:rootfs;"         \
                "if ubifsload c0000014 /boot/u-boot.bin;"               \
                "then mw c0000008 ${filesize};else echo Error reading"  \
                " u-boot from nand!;fi\0"                               \
index f646ae57764de475ae23d701c8a74eed675a1041..d3c664cd1889aa04fddf836786138d29e46f2e37 100644 (file)
@@ -88,7 +88,7 @@
 #define CONFIG_BOOTCOMMAND \
        "setenv bootargs ${console} ${mtdparts} ${bootargs_root}; "     \
        "ubi part root; "                                               \
-       "ubifsmount root; "                                             \
+       "ubifsmount ubi:root; "                                         \
        "ubifsload 0x800000 ${kernel}; "                                \
        "ubifsload 0x1100000 ${initrd}; "                               \
        "bootm 0x800000 0x1100000"
index ba57849a602f32223b42df8601da632e3eac5745..c882bfa60669a84026e591b622e97eaba3a7e3ce 100644 (file)
@@ -87,7 +87,7 @@
 #define CONFIG_BOOTCOMMAND \
        "setenv bootargs ${console} ${mtdparts} ${bootargs_root}; "     \
        "ubi part rootfs; "                                             \
-       "ubifsmount rootfs; "                                           \
+       "ubifsmount ubi:rootfs; "                                       \
        "ubifsload 0x800000 ${kernel}; "                                \
        "bootm 0x800000"
 
index ee888418c59a84779622b9b47f6a88a7c744f706..b77ce25880dc33a94d04eb7e33b562fa91edfd0f 100644 (file)
                        "ext2load mmc1 0 ${loadaddr} autoboot.scr; then " \
                "source ${loadaddr}; " \
        "fi; " \
-       "ubi part boot && ubifsmount boot && ubifsload ${loadaddr} uImage && bootm ${loadaddr}"
+       "ubi part boot && ubifsmount ubi:boot && " \
+               "ubifsload ${loadaddr} uImage && bootm ${loadaddr}"
 
 #define CONFIG_AUTO_COMPLETE   1
 /*
index 1a665ac3ac0b7737fc837ec1838ed3cdb7b7c2c2..ebd7a257f36a001e78f2c14968e6e51d3ec4a437 100644 (file)
                "bootm ${loadaddr}\0" \
        "loaduimage_ubi=mtd default; " \
                "ubi part fs; " \
-               "ubifsmount root; " \
+               "ubifsmount ubi:root; " \
                "ubifsload ${loadaddr} /boot/uImage\0" \
        "nandboot=echo Booting from nand ...; " \
                "run nandargs; " \
index 3082aaa1e6368e144d8da55bb7bd1be1fd22927e..bb495a1c909885be9d28b46f584703be9dea2acd 100644 (file)
        "nand_ubifs=run ubifs_mount ubifs_load ubifsargs addip"         \
                " addcon addmisc addmtd;"                               \
                "bootm ${kernel_addr} - ${dtb_addr}\0"                  \
-       "ubifs_mount=ubi part ubi${boot_part};ubifsmount rootfs\0"      \
+       "ubifs_mount=ubi part ubi${boot_part};ubifsmount ubi:rootfs\0"  \
        "ubifs_load=ubifsload ${kernel_addr} ${kernel_fs};"             \
                "ubifsload ${dtb_addr} ${dtb_fs};\0"                    \
        "nand_ubifs=run ubifs_mount ubifs_load ubifsargs addip addcon " \