Changeset View
Changeset View
Standalone View
Standalone View
stand/i386/libi386/bootinfo32.c
Show First 20 Lines • Show All 175 Lines • ▼ Show 20 Lines | return(EINVAL); | ||||
/* Try reading the /etc/fstab file to select the root device */ | /* Try reading the /etc/fstab file to select the root device */ | ||||
getrootmount(i386_fmtdev((void *)rootdev)); | getrootmount(i386_fmtdev((void *)rootdev)); | ||||
/* Do legacy rootdev guessing */ | /* Do legacy rootdev guessing */ | ||||
/* XXX - use a default bootdev of 0. Is this ok??? */ | /* XXX - use a default bootdev of 0. Is this ok??? */ | ||||
bootdevnr = 0; | bootdevnr = 0; | ||||
switch(rootdev->d_type) { | switch(rootdev->d_dev->dv_type) { | ||||
case DEVT_CD: | case DEVT_CD: | ||||
/* Pass in BIOS device number. */ | /* Pass in BIOS device number. */ | ||||
bi.bi_bios_dev = bc_unit2bios(rootdev->d_unit); | bi.bi_bios_dev = bc_unit2bios(rootdev->d_unit); | ||||
bootdevnr = bc_getdev(rootdev); | bootdevnr = bc_getdev(rootdev); | ||||
break; | break; | ||||
case DEVT_DISK: | case DEVT_DISK: | ||||
/* pass in the BIOS device number of the current disk */ | /* pass in the BIOS device number of the current disk */ | ||||
bi.bi_bios_dev = bd_unit2bios(rootdev->d_unit); | bi.bi_bios_dev = bd_unit2bios(rootdev->d_unit); | ||||
bootdevnr = bd_getdev(rootdev); | bootdevnr = bd_getdev(rootdev); | ||||
break; | break; | ||||
case DEVT_NET: | case DEVT_NET: | ||||
case DEVT_ZFS: | case DEVT_ZFS: | ||||
break; | break; | ||||
default: | default: | ||||
printf("WARNING - don't know how to boot from device type %d\n", rootdev->d_type); | printf("WARNING - don't know how to boot from device type %d\n", rootdev->d_dev->dv_type); | ||||
} | } | ||||
if (bootdevnr == -1) { | if (bootdevnr == -1) { | ||||
printf("root device %s invalid\n", i386_fmtdev(rootdev)); | printf("root device %s invalid\n", i386_fmtdev(rootdev)); | ||||
return (EINVAL); | return (EINVAL); | ||||
} | } | ||||
free(rootdev); | free(rootdev); | ||||
/* find the last module in the chain */ | /* find the last module in the chain */ | ||||
▲ Show 20 Lines • Show All 81 Lines • Show Last 20 Lines |