Index: bootadm/usr/src/cmd/boot/bootadm/bootadm.c =================================================================== --- bootadm.orig/usr/src/cmd/boot/bootadm/bootadm.c 2013-01-02 16:04:48.857015820 +0400 +++ bootadm/usr/src/cmd/boot/bootadm/bootadm.c 2013-01-02 16:06:08.556956182 +0400 @@ -3370,63 +3370,14 @@ struct stat sb; int ret, what, status = BAM_SUCCESS; - /* If there is mkisofs, use it to create the required archives */ - if (is_mkisofs()) { - what = is_amd64() ? FILE64 : FILE32; - if (has_cachedir(what) && is_dir_flag_on(what, - NEED_UPDATE)) { - ret = mkisofs_archive(root, what); - if (ret != 0) - status = BAM_ERROR; - } - return (status); - } - - /* - * Else setup command args for create_ramdisk.ksh for the UFS archives - */ - if (bam_verbose) - bam_print("mkisofs not found, creating UFS archive\n"); - - (void) snprintf(path, sizeof (path), "%s/%s", root, CREATE_RAMDISK); - if (stat(path, &sb) != 0) { - bam_error(ARCH_EXEC_MISS, path, strerror(errno)); - return (BAM_ERROR); - } - - if (is_safe_exec(path) == BAM_ERROR) - return (BAM_ERROR); - - len = strlen(path) + strlen(root) + 10; /* room for space + -R */ - if (bam_alt_platform) - len += strlen(bam_platform) + strlen("-p "); - cmdline = s_calloc(1, len); - - if (bam_alt_platform) { - assert(strlen(root) > 1); - (void) snprintf(cmdline, len, "%s -p %s -R %s", - path, bam_platform, root); - /* chop off / at the end */ - cmdline[strlen(cmdline) - 1] = '\0'; - } else if (strlen(root) > 1) { - (void) snprintf(cmdline, len, "%s -R %s", path, root); - /* chop off / at the end */ - cmdline[strlen(cmdline) - 1] = '\0'; - } else - (void) snprintf(cmdline, len, "%s", path); - - if (exec_cmd(cmdline, NULL) != 0) { - bam_error(ARCHIVE_FAIL, cmdline); - free(cmdline); - return (BAM_ERROR); - } - free(cmdline); - /* - * The existence of the expected archives used to be - * verified here. This check is done in create_ramdisk as - * it needs to be in sync with the altroot operated upon. - */ - return (BAM_SUCCESS); + what = is_amd64() ? FILE64 : FILE32; + if (has_cachedir(what) && is_dir_flag_on(what, NEED_UPDATE)) + { + ret = mkisofs_archive(root, what); + if (ret != 0) + status = BAM_ERROR; + } + return (status); } /* @@ -3501,25 +3452,6 @@ static int is_boot_archive(char *root) { - char path[PATH_MAX]; - struct stat sb; - int error; - const char *fcn = "is_boot_archive()"; - - /* - * We can't create an archive without the create_ramdisk script - */ - (void) snprintf(path, sizeof (path), "%s/%s", root, CREATE_RAMDISK); - error = stat(path, &sb); - INJECT_ERROR1("NOT_ARCHIVE_BASED", error = -1); - if (error == -1) { - if (bam_verbose) - bam_print(FILE_MISS, path); - BAM_DPRINTF((D_NOT_ARCHIVE_BOOT, fcn, root)); - return (0); - } - - BAM_DPRINTF((D_IS_ARCHIVE_BOOT, fcn, root)); return (1); } @@ -3977,58 +3909,6 @@ */ if (update_archive(root, opt) != BAM_SUCCESS) ret = BAM_ERROR; - - if (ret == BAM_ERROR) - goto out; - - /* - * Now walk the mount table, performing archive update - * for all mounted Newboot root filesystems - */ - fp = fopen(MNTTAB, "r"); - if (fp == NULL) { - bam_error(OPEN_FAIL, MNTTAB, strerror(errno)); - ret = BAM_ERROR; - goto out; - } - - resetmnttab(fp); - - while (getextmntent(fp, &mnt, sizeof (mnt)) == 0) { - if (mnt.mnt_special == NULL) - continue; - if ((strcmp(mnt.mnt_fstype, MNTTYPE_ZFS) != 0) && - (strncmp(mnt.mnt_special, "/dev/", strlen("/dev/")) != 0)) - continue; - if (strcmp(mnt.mnt_mountp, "/") == 0) - continue; - - (void) snprintf(creatram, sizeof (creatram), "%s/%s", - mnt.mnt_mountp, CREATE_RAMDISK); - - if (stat(creatram, &sb) == -1) - continue; - - /* - * We put a trailing slash to be consistent with root = "/" - * case, such that we don't have to print // in some cases. - */ - (void) snprintf(rootbuf, sizeof (rootbuf), "%s/", - mnt.mnt_mountp); - bam_rootlen = strlen(rootbuf); - - /* - * It's possible that other mounts may be an alternate boot - * architecture, so check it again. - */ - if ((get_boot_cap(rootbuf) != BAM_SUCCESS) || - (update_archive(rootbuf, opt) != BAM_SUCCESS)) - ret = BAM_ERROR; - } - - (void) fclose(fp); - -out: /* * We no longer use biosdev for Live Upgrade. Hence * there is no need to defer (to shutdown time) any fdisk