Re: Bug in installation of Debian 2.1 on Atari
> And hd_size is size in blocks >> 1 (fdisk_add_disk) so it truncates
> for disks with an odd number of 512 byte blocks. If only the last
> partition were valid in such a situation, and extended to the actual
> last block, we'd miss that one again. Not very likely though. And
> easier to work around.
Ah, I see what you mean, and you're right. We should add another 1 to
hd_size, since the cases should be very rare that a partition is
*invalid* because it exceeds the disk size by exactly 1 sector (and it
also doesn't hurt much...)
So, please use this modified patch: (I'll check it in, too)
--- boot-floppies/utilities/libfdisk/partbl_atari.c 1998/02/24 10:32:59 1.3
+++ boot-floppies/utilities/libfdisk/partbl_atari.c 1999/05/17 13:16:18 1.4
@@ -68,7 +68,9 @@
rs = (struct rootsector *) data;
if (!(fdisk_device = fdisk_find_disk( device )))
return 0;
- hd_size = fdisk_device->size;
+ /* fdisk_device->size is in kByte, but we need it in sectors for
+ * comparisons. */
+ hd_size = 2*fdisk_device->size+1;
if (!VALID_PARTITION( &rs->part[0], hd_size ) &&
!VALID_PARTITION( &rs->part[1], hd_size ) &&
Roman
Reply to: