return err;
}
-static int ubi_create_vol(char *volume, int64_t size, int dynamic)
+static int ubi_create_vol(char *volume, int64_t size, int dynamic, int vol_id)
{
struct ubi_mkvol_req req;
int err;
else
req.vol_type = UBI_STATIC_VOLUME;
- req.vol_id = UBI_VOL_NUM_AUTO;
+ req.vol_id = vol_id;
req.alignment = 1;
req.bytes = size;
if (strncmp(argv[1], "create", 6) == 0) {
int dynamic = 1; /* default: dynamic volume */
+ int id = UBI_VOL_NUM_AUTO;
/* Use maximum available size */
size = 0;
+ /* E.g., create volume size type vol_id */
+ if (argc == 6) {
+ id = simple_strtoull(argv[5], NULL, 16);
+ argc--;
+ }
+
/* E.g., create volume size type */
if (argc == 5) {
if (strncmp(argv[4], "s", 1) == 0)
}
/* E.g., create volume */
if (argc == 3)
- return ubi_create_vol(argv[2], size, dynamic);
+ return ubi_create_vol(argv[2], size, dynamic, id);
}
if (strncmp(argv[1], "remove", 6) == 0) {
" - Display volume and ubi layout information\n"
"ubi check volumename"
" - check if volumename exists\n"
- "ubi create[vol] volume [size] [type]"
+ "ubi create[vol] volume [size] [type] [id]"
" - create volume name with size\n"
"ubi write[vol] address volume size"
" - Write volume from address with size\n"