Index: stand/i386/zfsboot/zfsboot.c =================================================================== --- stand/i386/zfsboot/zfsboot.c (revision 345082) +++ stand/i386/zfsboot/zfsboot.c (working copy) @@ -528,7 +528,7 @@ return (size * DEV_BSIZE); } -static void +static int probe_drive(struct zfsdsk *zdsk) { #ifdef GPT @@ -568,7 +568,7 @@ * First check for GPT. */ if (drvread(&zdsk->dsk, sec, 1, 1)) { - return; + return (1); } memcpy(&hdr, sec, sizeof(hdr)); if (memcmp(hdr.hdr_sig, GPT_HDR_SIG, sizeof(hdr.hdr_sig)) != 0 || @@ -591,7 +591,7 @@ while (slba < elba) { zdsk->dsk.start = 0; if (drvread(&zdsk->dsk, sec, slba, 1)) - return; + return (1); for (part = 0; part < entries_per_sec; part++) { ent = (struct gpt_ent *)(sec + part * hdr.hdr_entsz); if (memcmp(&ent->ent_type, &freebsd_zfs_uuid, @@ -631,12 +631,12 @@ } slba++; } - return; + return (0); trymbr: #endif /* GPT */ if (drvread(&zdsk->dsk, sec, DOSBBSECTOR, 1)) - return; + return (1); dp = (void *)(sec + DOSPARTOFF); for (i = 0; i < NDOSPART; i++) { @@ -668,6 +668,7 @@ } #endif /* LOADER_GELI_SUPPORT */ } + return (0); } int @@ -676,7 +677,7 @@ dnode_phys_t dn; off_t off; struct zfsdsk *zdsk; - int autoboot, i; + int autoboot, i, err; int nextboot; int rc; @@ -722,7 +723,7 @@ * Probe the boot drive first - we will try to boot from whatever * pool we find on that drive. */ - probe_drive(zdsk); + err = probe_drive(zdsk); /* * Probe the rest of the drives that the bios knows about. This @@ -735,7 +736,7 @@ for (i = 0; i < MAXBDDEV; i++) #endif { - if ((i | DRV_HARD) == *(uint8_t *)PTOV(ARGS)) + if (err == 0 && ((i | DRV_HARD) == *(uint8_t *)PTOV(ARGS))) continue; if (!int13probe(i | DRV_HARD))