+ if (var != NULL) {
+ int p;
+ char str[512] = { '\0', };
+ disk_partition_t info;
+
+ for (p = 1; p < 128; p++) {
+ char t[5];
+ int r = get_partition_info(desc, p, &info);
+
+ if (r != 0)
+ continue;
+
+ if (bootable && !info.bootable)
+ continue;
+
+ sprintf(t, "%s%d", str[0] ? " " : "", p);
+ strcat(str, t);
+ }
+ setenv(var, str);
+ return 0;
+ }
+