On Tue, Dec 18, 2001 at 08:32:26PM +0000, Phil Blundell wrote:
> The LILO stuff needs a bit more thought. The udma100-ext3 situation where
> hde is actually the "primary" IDE interface clearly needs to be made to
> work one way or another. I'm not so sure about the screwball case where
> someone has hooked his drives up to hdc/hdd rather than hda/hdb; that one
> could maybe be dealt with by documentation. This whole business involves
> second guessing what the BIOS is going to do, and it may not be possible
> to arrive at a situation where everything works straight off.
The following patch installs the MBR to the first existing IDE
drive, rather than /dev/hda. For systems which have /dev/hda,
behavior is unchanged. Is this reasonable?
Matt
Index: debian/changelog
===================================================================
RCS file: /cvs/debian-boot/boot-floppies/debian/changelog,v
retrieving revision 1.903
diff -u -p -r1.903 changelog
--- debian/changelog 2001/12/18 21:22:57 1.903
+++ debian/changelog 2001/12/18 21:53:46
@@ -1,5 +1,6 @@
* Matt Kraai
- tell pcmcia to use dhclient, closes: #125683
+ - use the first available IDE disk for the MBR, closes: #119825
boot-floppies (3.0.18) unstable; urgency=high
Index: utilities/dbootstrap/bootconfig.c
===================================================================
RCS file: /cvs/debian-boot/boot-floppies/utilities/dbootstrap/bootconfig.c,v
retrieving revision 1.155
diff -u -p -r1.155 bootconfig.c
--- utilities/dbootstrap/bootconfig.c 2001/12/05 11:04:27 1.155
+++ utilities/dbootstrap/bootconfig.c 2001/12/18 21:53:46
@@ -499,6 +499,18 @@ int is_scsiida(const char *name)
{
return strncmp(name, DEV_IDA_C0D0, strlen(DEV_IDA_C0D0) - 3) == 0;
}
+
+/* Return a string containing the name of the first existing IDE disk. */
+char *first_ide_disk(void)
+{
+ static char disk[] = "/dev/hda";
+
+ for (; disk[strlen(disk) - 1] < 'l'; (disk[strlen(disk) - 1])++)
+ if (fdisk_find_disk(disk) != NULL)
+ return disk;
+
+ return NULL;
+}
#endif /* #cpu (i386) */
@@ -2316,7 +2328,7 @@ int make_bootable(void)
}
/* set device to what we think is the boot disk */
- if (is_ide(boot)) device = DEV_HDA;
+ if (is_ide(boot)) device = first_ide_disk ();
else if (is_scsi(boot)) device = DEV_SDA;
else if (is_scsird(boot)) device = DEV_RD_C0D0;
else if (is_scsiida(boot)) device = DEV_IDA_C0D0;
Attachment:
pgpXFGmhcqNgX.pgp
Description: PGP signature