- }
- fp = (struct fdisk_part *)&db->parts[i];
- DEBUG_DISK(("systid %x\n", fp->systid));
- if (fp->systid == 0xA8) {
- bcopy(fp, _fp, sizeof(struct fdisk_part));
- _fp->relsect += offset;
- DEBUG_DISK(("found %d\n", i));
- return 0;
- } else if (fp->systid == 0x05 ||
- fp->systid == 0x0F ||
- fp->systid == 0x85) {
- offset += fp->relsect;
- i = -1;
- continue;
- }
- }
+ for (i=0; i<FDISK_NPART; i++) {
+ DEBUG_DISK(("i=%d, offset %ld\n", i, offset));
+ fp = (struct fdisk_part *)&db->parts[i];
+ DEBUG_DISK(("systid %x\n", fp->systid));
+ if (fp->systid == FDISK_UFS) {
+ bcopy(fp, _fp, sizeof(struct fdisk_part));
+ _fp->relsect += offset;
+ DEBUG_DISK(("** found UFS at partition %d\n", i));
+ return 0;
+ } else if (fp->systid == FDISK_DOSEXT ||
+ fp->systid == 0x0F ||
+ fp->systid == 0x85) {
+ ext_index = i;
+ }
+ }
+ if (ext_index != -1) {
+ DEBUG_DISK(("Found ext part at %d\n", ext_index));
+ fp = (struct fdisk_part *)&db->parts[ext_index];
+ ext_index = -1;
+ offset = firstoff + fp->relsect;
+ if (firstoff == 0) {
+ firstoff = fp->relsect;
+ }
+ continue;
+ }
+ break;
+ } while (1);