diff options
author | Gangadhar Mylapuram <Gangadhar.M@Sun.COM> | 2010-03-01 00:46:02 -0800 |
---|---|---|
committer | Gangadhar Mylapuram <Gangadhar.M@Sun.COM> | 2010-03-01 00:46:02 -0800 |
commit | 1130146c106aae1a60b30bcc30521647a9474892 (patch) | |
tree | 2f2522ab2b117db5ecf4194e58e906afe8feca32 /usr/src/cmd/boot | |
parent | 29bb6f107ad290f4e71abd79e2b553a7ea1b367f (diff) | |
download | illumos-gate-1130146c106aae1a60b30bcc30521647a9474892.tar.gz |
6881648 running reboot in single user mode ( reboot -- -s ) after 141445-09 is applied gives errors
Diffstat (limited to 'usr/src/cmd/boot')
-rw-r--r-- | usr/src/cmd/boot/bootadm/bootadm.c | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/usr/src/cmd/boot/bootadm/bootadm.c b/usr/src/cmd/boot/bootadm/bootadm.c index 99cb553e63..5e8110e481 100644 --- a/usr/src/cmd/boot/bootadm/bootadm.c +++ b/usr/src/cmd/boot/bootadm/bootadm.c @@ -3698,7 +3698,9 @@ synchronize_BE_menu(void) char *curr_cksum_str; char *curr_size_str; char *curr_file; - char *pool; + char *pool = NULL; + char *mntpt = NULL; + zfs_mnted_t mnted; FILE *cfp; int found; int ret; @@ -3753,11 +3755,24 @@ synchronize_BE_menu(void) /* Get checksum of current menu */ pool = find_root_pool(); - (void) snprintf(cmdline, sizeof (cmdline), "%s %s%s%s", - CKSUM, pool == NULL ? "" : "/", pool == NULL ? "" : pool, - GRUB_MENU); - free(pool); + if (pool) { + mntpt = mount_top_dataset(pool, &mnted); + if (mntpt == NULL) { + bam_error(FAIL_MNT_TOP_DATASET, pool); + free(pool); + return (BAM_ERROR); + } + (void) snprintf(cmdline, sizeof (cmdline), "%s %s%s", + CKSUM, mntpt, GRUB_MENU); + } else { + (void) snprintf(cmdline, sizeof (cmdline), "%s %s", + CKSUM, GRUB_MENU); + } ret = exec_cmd(cmdline, &flist); + if (pool) { + (void) umount_top_dataset(pool, mnted, mntpt); + free(pool); + } INJECT_ERROR1("GET_CURR_CKSUM", ret = 1); if (ret != 0) { bam_error(MENU_CKSUM_FAIL); |