FreeBSD Bugzilla – Attachment 116415 Details for
Bug 158358
[loader] [patch] allow /boot/loader to work from an MBR extended partition
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
file.diff
file.diff (text/plain), 2.62 KB, created by
Gyrd Thane Lange
on 2011-06-28 02:00:20 UTC
(
hide
)
Description:
file.diff
Filename:
MIME Type:
Creator:
Gyrd Thane Lange
Created:
2011-06-28 02:00:20 UTC
Size:
2.62 KB
patch
obsolete
>--- biosdisk.c.orig 2007-11-13 00:53:43.000000000 +0100 >+++ biosdisk.c 2007-12-29 10:35:30.000000000 +0100 >@@ -162,7 +162,8 @@ > static void bd_closedisk(struct open_disk *od); > static int bd_open_mbr(struct open_disk *od, struct i386_devdesc *dev); > static int bd_bestslice(struct open_disk *od); >-static void bd_checkextended(struct open_disk *od, int slicenum); >+static void bd_checkextended(struct open_disk *od, struct dos_partition *dp, >+ struct dos_partition *primary_dp); > static int bd_open_gpt(struct open_disk *od, struct i386_devdesc *dev); > static struct gpt_part *bd_best_gptpart(struct open_disk *od); > >@@ -381,6 +382,13 @@ > > switch (dp->dp_typ) { > case DOSPTYP_386BSD: >+ if (verbose) >+ sprintf(line, "%s: BSD %.6dMB (%d - %d)\n", >+ prefix, dp->dp_size / 2048, >+ dp->dp_start, dp->dp_start + dp->dp_size); >+ else >+ sprintf(line, "%s: BSD\n", prefix); >+ pager_output(line); > bd_printbsdslice(od, (daddr_t)dp->dp_start, prefix, verbose); > return; > case DOSPTYP_LINSWP: >@@ -626,7 +634,7 @@ > sizeof(struct dos_partition) * NDOSPART); > od->od_nslices = 4; /* extended slices start here */ > for (i = 0; i < NDOSPART; i++) >- bd_checkextended(od, i); >+ bd_checkextended(od, &od->od_slicetab[i], &od->od_slicetab[i]); > od->od_flags |= BD_PARTTABOK; > dptr = &od->od_slicetab[0]; > >@@ -728,16 +736,12 @@ > } > > static void >-bd_checkextended(struct open_disk *od, int slicenum) >+bd_checkextended(struct open_disk *od, struct dos_partition *dp, struct dos_partition *primary_dp) > { > char buf[BIOSDISK_SECSIZE]; >- struct dos_partition *dp; >- u_int base; >- int i, start, end; >- >- dp = &od->od_slicetab[slicenum]; >- start = od->od_nslices; >- >+ int i; >+ struct dos_partition *base_dp; >+ > if (dp->dp_size == 0) > goto done; > if (dp->dp_typ != DOSPTYP_EXT) >@@ -748,24 +752,22 @@ > DEBUG("no magic in extended table"); > goto done; > } >- base = dp->dp_start; >+ base_dp = dp; > dp = (struct dos_partition *)(&buf[DOSPARTOFF]); > for (i = 0; i < NDOSPART; i++, dp++) { > if (dp->dp_size == 0) > continue; > if (od->od_nslices == NEXTDOSPART) > goto done; >- dp->dp_start += base; >- bcopy(dp, &od->od_slicetab[od->od_nslices], sizeof(*dp)); >- od->od_nslices++; >+ if (dp->dp_typ == DOSPTYP_EXT) { >+ dp->dp_start += primary_dp->dp_start; >+ bd_checkextended(od, dp, primary_dp); >+ } else { >+ dp->dp_start += base_dp->dp_start; >+ bcopy(dp, &od->od_slicetab[od->od_nslices], sizeof(*dp)); >+ od->od_nslices++; >+ } > } >- end = od->od_nslices; >- >- /* >- * now, recursively check the slices we just added >- */ >- for (i = start; i < end; i++) >- bd_checkextended(od, i); > done: > return; > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 158358
: 116415