summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormarcel <marcel@FreeBSD.org>2016-02-26 15:52:55 +0000
committermarcel <marcel@FreeBSD.org>2016-02-26 15:52:55 +0000
commitc7c518e5f0e64f7849df142f0b24e2a883348bbd (patch)
tree51f697127b0024b4cf75be908f3286c1171b64c7
parent8f312d1fbe6eda36ce3ff77c7af436797b60c955 (diff)
downloadFreeBSD-src-c7c518e5f0e64f7849df142f0b24e2a883348bbd.zip
FreeBSD-src-c7c518e5f0e64f7849df142f0b24e2a883348bbd.tar.gz
Check that the userboot version is at least 3, rather than
3 exactly. The structure may be of a newer version and as long as it is backward compatible with 3, we can work with it. While here: whitespace nits.
-rw-r--r--sys/boot/userboot/userboot/main.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/sys/boot/userboot/userboot/main.c b/sys/boot/userboot/userboot/main.c
index e64bbc7..3a7a7fb 100644
--- a/sys/boot/userboot/userboot/main.c
+++ b/sys/boot/userboot/userboot/main.c
@@ -43,6 +43,7 @@ static void userboot_zfs_probe(void);
static int userboot_zfs_found;
#endif
+/* Minimum version required */
#define USERBOOT_VERSION USERBOOT_VERSION_3
#define MALLOCSZ (10*1024*1024)
@@ -64,7 +65,7 @@ void
delay(int usec)
{
- CALLBACK(delay, usec);
+ CALLBACK(delay, usec);
}
void
@@ -82,11 +83,11 @@ loader_main(struct loader_callbacks *cb, void *arg, int version, int ndisks)
const char *var;
int i;
- if (version != USERBOOT_VERSION)
- abort();
+ if (version < USERBOOT_VERSION)
+ abort();
callbacks = cb;
- callbacks_arg = arg;
+ callbacks_arg = arg;
userboot_disk_maxunit = ndisks;
/*
@@ -95,9 +96,9 @@ loader_main(struct loader_callbacks *cb, void *arg, int version, int ndisks)
*/
setheap((void *)mallocbuf, (void *)(mallocbuf + sizeof(mallocbuf)));
- /*
- * Hook up the console
- */
+ /*
+ * Hook up the console
+ */
cons_probe();
printf("\n");
@@ -192,9 +193,9 @@ extract_currdev(void)
}
env_setenv("currdev", EV_VOLATILE, userboot_fmtdev(&dev),
- userboot_setcurrdev, env_nounset);
+ userboot_setcurrdev, env_nounset);
env_setenv("loaddev", EV_VOLATILE, userboot_fmtdev(&dev),
- env_noset, env_nounset);
+ env_noset, env_nounset);
}
#if defined(USERBOOT_ZFS_SUPPORT)
OpenPOWER on IntegriCloud