Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 149968 Details for
Bug 231330
RHEL4 U5 beta1 installation failure: anaconda unhandled exception
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
Patch to probe_partition_for_geom() for DL585g systems
parted-1.6.19-DL585g.patch (text/plain), 4.30 KB, created by
David Cantrell
on 2007-03-13 18:33:04 UTC
(
hide
)
Description:
Patch to probe_partition_for_geom() for DL585g systems
Filename:
MIME Type:
Creator:
David Cantrell
Created:
2007-03-13 18:33:04 UTC
Size:
4.30 KB
patch
obsolete
>--- parted-1.6.19/libparted/disk_dos.c.dl585g2 2007-03-13 13:53:09.000000000 -0400 >+++ parted-1.6.19/libparted/disk_dos.c 2007-03-13 14:03:10.000000000 -0400 >@@ -463,9 +463,14 @@ > * We can rewrite this in matrix form: > * > * [ c h ] [ cyl_sectors ] = [ s - a ] = [ a_ ] >- * [ C H ] [ head_sectors ] [ S - A ] [ A_ ] >+ * [ C H ] [ head_sectors ] [ S - A ] [ A_ ]. > * > * (s - a is abbreviated to a_to simplify the notation.) >+ * >+ * This can be abbreviated into augmented matrix form: >+ * >+ * [ c h | a_ ] >+ * [ C H | A_ ]. > * > * Solving these equations requires following the row reduction algorithm. We > * need to be careful about a few things though: >@@ -477,13 +482,14 @@ > * the algorithm. We know, however, that C > 0. > */ > static int >-probe_partition_for_geom (PedPartition* part, PedCHSGeometry* bios_geom) >+probe_partition_for_geom (const PedPartition* part, PedCHSGeometry* bios_geom) > { > DosPartitionData* dos_data; > RawCHS* start_chs; > RawCHS* end_chs; > PedSector c, h, s, a, a_; /* start */ > PedSector C, H, S, A, A_; /* end */ >+ PedSector dont_overflow, denum; > PedSector cyl_size, head_size; > PedSector cylinders, heads, sectors; > >@@ -514,7 +520,12 @@ > return 0; > if (c > C) > return 0; >- if (A > MAX_CHS_CYLINDER * 255 * 63) >+ >+ /* If no geometry is feasible, then don't even bother. >+ * Useful for eliminating assertions for broken partition >+ * tables generated by Norton Ghost et al. >+ */ >+ if (A > (C+1) * 255 * 63) > return 0; > > /* Not enough information. In theory, we can do better. Should we? */ >@@ -523,46 +534,57 @@ > if (C == 0) > return 0; > >- /* STEP ONE: find cyl_size */ >- if (h == 0 && c > 0) { >- /* If the matrix looks like this, then it's easy! >- * [ c 0 ] >- * [ C H ] >- */ >- cyl_size = a_ / c; >- } else if (h > 0) { >- /* if h > 0, we can do R2 -> R2 - H/h R1 to get: >- * >- * [ c h ] = [ a_ ] >- * [ X 0 ] = [ Y ] >- * >- * Then, cyl_size = Y / X >- * >- * However, if H/h isn't an integer, this isn't going >- * to work out nicely, so the partition table must >- * be inconsistent. >- */ >- if (H % h != 0) >- return 0; >- if (C == H/h * c) >- return 0; >- cyl_size = (A_ - H/h * a_) / (C - H/h * c); >- } else { >- /* h == 0 && c == 0: not enough information */ >+ /* Calculate the maximum number that can be multiplied by >+ * any head count without overflowing a PedSector >+ * 2^8 = 256, 8 bits + 1(sign bit) = 9 >+ */ >+ dont_overflow = 1; >+ dont_overflow <<= (8*sizeof(dont_overflow)) - 9; >+ dont_overflow--; >+ >+ if (a_ > dont_overflow || A_ > dont_overflow) >+ return 0; >+ >+ /* The matrix is solved by : >+ * >+ * [ c h | a_] R1 >+ * [ C H | A_] R2 >+ * >+ * (cH - Ch) cyl_size = a_H - A_h H R1 - h R2 >+ * => (if cH - Ch != 0) cyl_size = (a_H - A_h) / (cH - Ch) >+ * >+ * (Hc - hC) head_size = A_c - a_C c R2 - C R1 >+ * => (if cH - Ch != 0) head_size = (A_c - a_C) / (cH - Ch) >+ * >+ * But this calculation of head_size would need >+ * not overflowing A_c or a_C >+ * So substitution is use instead, to minimize dimension >+ * of temporary results : >+ * >+ * If h != 0 : head_size = ( a_ - c cyl_size ) / h >+ * If H != 0 : head_size = ( A_ - C cyl_size ) / H >+ * >+ */ >+ denum = c * H - C * h; >+ if (denum == 0) >+ return 0; >+ >+ cyl_size = (a_*H - A_*h) / denum; >+ /* Check for non integer result */ >+ if (cyl_size * denum != a_*H - A_*h) > return 0; >- } > > PED_ASSERT (cyl_size > 0, return 0); > PED_ASSERT (cyl_size <= 255 * 63, return 0); > >- /* STEP TWO: find head_size */ >- if (h > 0) { >- head_size = (a_ - c * cyl_size) / h; >- } else if (H > 0) { >- head_size = (A_ - C * cyl_size) / H; >- } else { >- /* not enough information */ >- return 0; >+ if (h > 0) >+ head_size = ( a_ - c * cyl_size ) / h; >+ else if (H > 0) >+ head_size = ( A_ - C * cyl_size ) / H; >+ else { >+ /* should not happen because denum != 0 */ >+ head_size = 0; >+ PED_ASSERT (0, return 0); > } > > PED_ASSERT (head_size > 0, return 0); >@@ -578,6 +600,13 @@ > PED_ASSERT (sectors > 0, return 0); > PED_ASSERT (sectors <= 63, return 0); > >+ /* Some broken OEM partitioning program(s) seem to have an out-by-one >+ * error on the end of partitions. We should offer to fix the >+ * partition table... >+ */ >+ if (((C + 1) * heads + H) * sectors + S == A) >+ C++; >+ > PED_ASSERT ((c * heads + h) * sectors + s == a, return 0); > PED_ASSERT ((C * heads + H) * sectors + S == A, return 0); >
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 231330
:
149479
| 149968 |
149969
|
149970
|
149971
|
149972