diff options
Diffstat (limited to 'sys/boot')
-rw-r--r-- | sys/boot/forth/loader.conf | 1 | ||||
-rw-r--r-- | sys/boot/powerpc/ofw/Makefile | 5 | ||||
-rw-r--r-- | sys/boot/powerpc/uboot/Makefile | 8 | ||||
-rw-r--r-- | sys/boot/powerpc/uboot/conf.c | 2 | ||||
-rw-r--r-- | sys/boot/sparc64/loader/main.c | 2 | ||||
-rw-r--r-- | sys/boot/uboot/common/main.c | 25 | ||||
-rw-r--r-- | sys/boot/uboot/lib/disk.c | 8 | ||||
-rw-r--r-- | sys/boot/uboot/lib/time.c | 2 | ||||
-rw-r--r-- | sys/boot/zfs/zfs.c | 2 |
9 files changed, 40 insertions, 15 deletions
diff --git a/sys/boot/forth/loader.conf b/sys/boot/forth/loader.conf index f7e01ac..d7f1323 100644 --- a/sys/boot/forth/loader.conf +++ b/sys/boot/forth/loader.conf @@ -225,6 +225,7 @@ if_axe_load="NO" # ASIX Electronics AX88172 USB Ethernet if_bce_load="NO" # Broadcom NetXtreme II Gigabit Ethernet if_bfe_load="NO" # Broadcom BCM4401 if_bge_load="NO" # Broadcom BCM570x PCI Gigabit Ethernet +if_bwn_load="NO" # Broadcom BCM43xx IEEE 802.11 wireless NICs if_cas_load="NO" # Sun Cassini/Cassini+ and NS DP83065 Saturn if_cm_load="NO" # SMC (90c26, 90c56, 90c66) if_cs_load="NO" # Crystal Semiconductor CS8920 diff --git a/sys/boot/powerpc/ofw/Makefile b/sys/boot/powerpc/ofw/Makefile index dfc80db..d42fa92 100644 --- a/sys/boot/powerpc/ofw/Makefile +++ b/sys/boot/powerpc/ofw/Makefile @@ -56,6 +56,11 @@ CFLAGS+= -DBOOT_FORTH -I${.CURDIR}/../../ficl -I${.CURDIR}/../../ficl/powerpc LIBFICL= ${.OBJDIR}/../../ficl/libficl.a .endif +# Avoid the open-close-dance for every file access as some firmwares perform +# an auto-negotiation on every open of the network interface and thus causes +# netbooting to take horribly long. +CFLAGS+= -DNETIF_OPEN_CLOSE_ONCE + # Always add MI sources .PATH: ${.CURDIR}/../../common .include "${.CURDIR}/../../common/Makefile.inc" diff --git a/sys/boot/powerpc/uboot/Makefile b/sys/boot/powerpc/uboot/Makefile index efb401e..62a2868 100644 --- a/sys/boot/powerpc/uboot/Makefile +++ b/sys/boot/powerpc/uboot/Makefile @@ -9,8 +9,8 @@ NO_MAN= # Architecture-specific loader code SRCS= start.S conf.c vers.c -LOADER_DISK_SUPPORT?= no -LOADER_UFS_SUPPORT?= no +LOADER_DISK_SUPPORT?= yes +LOADER_UFS_SUPPORT?= yes LOADER_CD9660_SUPPORT?= no LOADER_EXT2FS_SUPPORT?= no LOADER_NET_SUPPORT?= yes @@ -85,11 +85,11 @@ LDADD= ${LIBFICL} ${LIBUBOOT} -lstand vers.c: ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version sh ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version ${NEWVERSWHAT} -${PROG}.help: help.common help.uboot +loader.help: help.common help.uboot cat ${.ALLSRC} | \ awk -f ${.CURDIR}/../../common/merge_help.awk > ${.TARGET} .PATH: ${.CURDIR}/../../forth -FILES= ${PROG}.help +FILES= loader.help .include <bsd.prog.mk> diff --git a/sys/boot/powerpc/uboot/conf.c b/sys/boot/powerpc/uboot/conf.c index 5a9515a..3530537 100644 --- a/sys/boot/powerpc/uboot/conf.c +++ b/sys/boot/powerpc/uboot/conf.c @@ -47,7 +47,7 @@ __FBSDID("$FreeBSD$"); /* Exported for libstand */ struct devsw *devsw[] = { #if defined(LOADER_DISK_SUPPORT) || defined(LOADER_CD9660_SUPPORT) - &uboot_disk, + &uboot_storage, #endif #if defined(LOADER_NET_SUPPORT) &netdev, diff --git a/sys/boot/sparc64/loader/main.c b/sys/boot/sparc64/loader/main.c index 7204169..2afbfee 100644 --- a/sys/boot/sparc64/loader/main.c +++ b/sys/boot/sparc64/loader/main.c @@ -137,7 +137,7 @@ struct tlb_entry *dtlb_store; struct tlb_entry *itlb_store; u_int dtlb_slot; u_int itlb_slot; -int cpu_impl; +static int cpu_impl; static u_int dtlb_slot_max; static u_int itlb_slot_max; diff --git a/sys/boot/uboot/common/main.c b/sys/boot/uboot/common/main.c index 1ebb097..7d068ee 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); diff --git a/sys/boot/uboot/lib/disk.c b/sys/boot/uboot/lib/disk.c index 4cbdbea..3af4c79 100644 --- a/sys/boot/uboot/lib/disk.c +++ b/sys/boot/uboot/lib/disk.c @@ -376,6 +376,14 @@ stor_open_gpt(struct open_dev *od, struct uboot_devdesc *dev) } dev->d_disk.ptype = PTYPE_GPT; + /* + * If index of partition to open (dev->d_disk.pnum) is not defined + * we set it to the index of the first existing partition. This + * handles cases when only a disk device is specified (without full + * partition information) by the caller. + */ + if ((od->od_nparts > 0) && (dev->d_disk.pnum == 0)) + dev->d_disk.pnum = od->od_partitions[0].gp_index; for (i = 0; i < od->od_nparts; i++) if (od->od_partitions[i].gp_index == dev->d_disk.pnum) diff --git a/sys/boot/uboot/lib/time.c b/sys/boot/uboot/lib/time.c index b7c3fe8..9083675 100644 --- a/sys/boot/uboot/lib/time.c +++ b/sys/boot/uboot/lib/time.c @@ -48,7 +48,7 @@ time(time_t *tloc) } int -getsecs() +getsecs(void) { return (time(NULL)); diff --git a/sys/boot/zfs/zfs.c b/sys/boot/zfs/zfs.c index 52df773..99bb60a 100644 --- a/sys/boot/zfs/zfs.c +++ b/sys/boot/zfs/zfs.c @@ -397,7 +397,7 @@ zfs_dev_init(void) /* * Open all the disks we can find and see if we can reconstruct * ZFS pools from them. Bogusly assumes that the disks are named - * diskN or diskNsM. + * diskN, diskNpM or diskNsM. */ zfs_init(); for (unit = 0; unit < 32 /* XXX */; unit++) { |