diff options
author | Toomas Soome <tsoome@me.com> | 2019-08-14 23:27:11 +0300 |
---|---|---|
committer | Toomas Soome <tsoome@me.com> | 2019-08-15 23:21:01 +0300 |
commit | a8ffe4975d219124d53dcd9de30126f3a595d28f (patch) | |
tree | 51b9d44943cd8dfd12464ba15e048ba730b993db | |
parent | 79940ff6ac581ff9431c474dcfa18c78f1cb7a50 (diff) | |
download | illumos-joyent-a8ffe4975d219124d53dcd9de30126f3a595d28f.tar.gz |
11555 gptzfsboot: boot prompt is not refreshed on device change
Reviewed by: C Fraire <cfraire@me.com>
Reviewed by: Andy Fiddaman <andy@omniosce.org>
Approved by: Robert Mustacchi <rm@joyent.com>
-rw-r--r-- | usr/src/boot/Makefile.version | 2 | ||||
-rw-r--r-- | usr/src/boot/sys/boot/i386/gptzfsboot/zfsboot.c | 13 |
2 files changed, 8 insertions, 7 deletions
diff --git a/usr/src/boot/Makefile.version b/usr/src/boot/Makefile.version index 8c381aa113..754b809163 100644 --- a/usr/src/boot/Makefile.version +++ b/usr/src/boot/Makefile.version @@ -33,4 +33,4 @@ LOADER_VERSION = 1.1 # Use date like formatting here, YYYY.MM.DD.XX, without leading zeroes. # The version is processed from left to right, the version number can only # be increased. -BOOT_VERSION = $(LOADER_VERSION)-2019.08.15.1 +BOOT_VERSION = $(LOADER_VERSION)-2019.08.15.2 diff --git a/usr/src/boot/sys/boot/i386/gptzfsboot/zfsboot.c b/usr/src/boot/sys/boot/i386/gptzfsboot/zfsboot.c index cb088969dd..87ab980fc3 100644 --- a/usr/src/boot/sys/boot/i386/gptzfsboot/zfsboot.c +++ b/usr/src/boot/sys/boot/i386/gptzfsboot/zfsboot.c @@ -417,10 +417,9 @@ mount_root(char *arg) struct i386_devdesc *ddesc; uint8_t part; - root = malloc(strlen(arg) + 2); - if (root == NULL) + if (asprintf(&root, "%s:", arg) < 0) return (1); - sprintf(root, "%s:", arg); + if (i386_getdev((void **)&ddesc, root, NULL)) { free(root); return (1); @@ -439,6 +438,7 @@ mount_root(char *arg) bdev->dd.d_unit, part); bootinfo.bi_bios_dev = bd_unit2bios(bdev); } + strncpy(boot_devname, root, sizeof (boot_devname)); setenv("currdev", root, 1); free(root); return (0); @@ -569,10 +569,11 @@ parse_cmd(void) * If there is a colon, switch pools. */ if (strncmp(arg, "zfs:", 4) == 0) - q = strchr(arg + 4, ':'); + q = strrchr(arg + 4, ':'); else - q = strchr(arg, ':'); - if (q) { + q = strrchr(arg, ':'); + + if (q != NULL) { *q++ = '\0'; if (mount_root(arg) != 0) return (-1); |