|
Lines 669-674
Link Here
|
| 669 |
/* Set part metadata */ |
669 |
/* Set part metadata */ |
| 670 |
md = get_part_metadata(name, 1); |
670 |
md = get_part_metadata(name, 1); |
| 671 |
|
671 |
|
|
|
672 |
if (strcmp("freebsd-zfs", type) == 0) { |
| 673 |
zpool_name = strdup((strlen(mountpoint) == 1) ? |
| 674 |
"root" : &mountpoint[1]); |
| 675 |
for (i = 0; zpool_name[i] != 0; i++) |
| 676 |
if (!isalnum(zpool_name[i])) |
| 677 |
zpool_name[i] = '_'; |
| 678 |
} |
| 679 |
|
| 672 |
if (newfs) { |
680 |
if (newfs) { |
| 673 |
if (md->newfs != NULL) { |
681 |
if (md->newfs != NULL) { |
| 674 |
free(md->newfs); |
682 |
free(md->newfs); |
|
Lines 679-689
Link Here
|
| 679 |
md->newfs = malloc(strlen(newfs) + strlen(" /dev/") + |
687 |
md->newfs = malloc(strlen(newfs) + strlen(" /dev/") + |
| 680 |
strlen(mountpoint) + 5 + strlen(name) + 1); |
688 |
strlen(mountpoint) + 5 + strlen(name) + 1); |
| 681 |
if (strcmp("freebsd-zfs", type) == 0) { |
689 |
if (strcmp("freebsd-zfs", type) == 0) { |
| 682 |
zpool_name = strdup((strlen(mountpoint) == 1) ? |
|
|
| 683 |
"root" : &mountpoint[1]); |
| 684 |
for (i = 0; zpool_name[i] != 0; i++) |
| 685 |
if (!isalnum(zpool_name[i])) |
| 686 |
zpool_name[i] = '_'; |
| 687 |
sprintf(md->newfs, "%s %s /dev/%s", newfs, |
690 |
sprintf(md->newfs, "%s %s /dev/%s", newfs, |
| 688 |
zpool_name, name); |
691 |
zpool_name, name); |
| 689 |
} else { |
692 |
} else { |
|
Lines 758-765
Link Here
|
| 758 |
md->fstab->fs_mntops = strdup(md->fstab->fs_type); |
761 |
md->fstab->fs_mntops = strdup(md->fstab->fs_type); |
| 759 |
} |
762 |
} |
| 760 |
|
763 |
|
| 761 |
if (zpool_name != NULL) |
764 |
free(zpool_name); |
| 762 |
free(zpool_name); |
|
|
| 763 |
} |
765 |
} |
| 764 |
|
766 |
|
| 765 |
static |
767 |
static |