diff options
| author | Rafal Jaworowski <raj@FreeBSD.org> | 2010-03-04 20:07:59 +0000 |
|---|---|---|
| committer | Rafal Jaworowski <raj@FreeBSD.org> | 2010-03-04 20:07:59 +0000 |
| commit | 17b7e3fbec8efb9aa1e15b47869934786fa86482 (patch) | |
| tree | 2407a78adc35dfb50b109db10d0ae1fab0883a28 /sys/boot | |
| parent | bdf0c295b93964510ff64fc8df12ab581b2a28a4 (diff) | |
Notes
Diffstat (limited to 'sys/boot')
| -rw-r--r-- | sys/boot/uboot/common/main.c | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/sys/boot/uboot/common/main.c b/sys/boot/uboot/common/main.c index 1ebb09750f67..7d068ee9617b 100644 --- a/sys/boot/uboot/common/main.c +++ b/sys/boot/uboot/common/main.c @@ -117,6 +117,7 @@ main(void) { struct api_signature *sig = NULL; int i; + struct open_file f; if (!api_search_sig(&sig)) return (-1); @@ -168,18 +169,28 @@ main(void) printf("(%s, %s)\n", bootprog_maker, bootprog_date); meminfo(); - /* XXX only support netbooting for now */ - for (i = 0; devsw[i] != NULL; i++) + for (i = 0; devsw[i] != NULL; i++) { + printf("\nDevice %d: %s\n", i, devsw[i]->dv_name); + + currdev.d_dev = devsw[i]; + currdev.d_type = currdev.d_dev->dv_type; + currdev.d_unit = 0; + + if (strncmp(devsw[i]->dv_name, "disk", + strlen(devsw[i]->dv_name)) == 0) { + f.f_devdata = &currdev; + currdev.d_disk.pnum = 0; + if (devsw[i]->dv_open(&f,&currdev) == 0) + break; + } + if (strncmp(devsw[i]->dv_name, "net", strlen(devsw[i]->dv_name)) == 0) break; + } if (devsw[i] == NULL) - panic("no network devices?!"); - - currdev.d_dev = devsw[i]; - currdev.d_type = currdev.d_dev->dv_type; - currdev.d_unit = 0; + panic("No boot device found!"); env_setenv("currdev", EV_VOLATILE, uboot_fmtdev(&currdev), uboot_setcurrdev, env_nounset); |
