Lines Matching defs:s
436 "\t%s update-archive [-vn] [-R altroot [-p platform]]\n", prog);
438 "\t%s list-archive [-R altroot [-p platform]]\n", prog);
441 "\t%s install-bootloader [-fv] [-R altroot] [-P pool]\n", prog);
444 "\t%s install-bootloader [-Mfv] [-R altroot] [-P pool]\n", prog);
448 (void) fprintf(stderr, "\t%s set-menu [-R altroot] key=value\n", prog);
449 (void) fprintf(stderr, "\t%s list-menu [-R altroot]\n", prog);
462 (void) snprintf(home_env, sizeof (home_env), "HOME=%s",
744 bam_error(_("cannot resolve path %s: %s\n"),
759 bam_error(_("invalid platform %s - must be "
812 bam_error(_("Internal error: %s\n"), "parse_args");
894 bam_error(_("invalid sub-command specified: %s\n"), subcmd);
913 bam_error(_("this sub-command (%s) does not "
917 "sub-command: %s\n"), subcmd);
953 bam_error(_("stat of file failed: %s: %s\n"), path,
959 bam_error(_("%s is not a regular file, skipping\n"), path);
964 bam_error(_("%s is not owned by %d, skipping\n"),
970 bam_error(_("%s is others or group writable, skipping\n"),
994 * If "which" is not a number, assume it's a setting we want
1023 bam_print("%s\n", lp->line);
1025 bam_print("%s\n", lp->arg);
1070 bam_error(_("stat of file failed: %s: %s\n"), bam_root,
1075 bam_error(_("failed to open file: %s: %s\n"),
1091 bam_error(_("alternate root %s not in mnttab\n"),
1101 bam_error(_("No BE's found\n"));
1109 bam_error(_("BE (%s) does not exist\n"), root_ds);
1161 bam_error(_("No BE's found\n"));
1177 bam_error(_("No active BE in %s\n"), bam_pool);
1201 bam_error(_("failed to open file: %s: %s\n"),
1219 bam_error(_("alternate root %s not in mnttab\n"), "/");
1237 bam_error(_("No such BE: %s\n"), root_ds);
1325 bam_error(_("cannot resolve path %s: %s\n"),
1340 bam_error(_("root <%s> on PCFS is not supported\n"), bam_root);
1349 BAM_DPRINTF(("%s: menu root is %s\n", fcn, menu_root));
1359 (void) snprintf(path, sizeof (path), "%s%s", bam_root,
1362 (void) snprintf(path, sizeof (path), "%s", GRUB_slice);
1366 bam_error(_("unsupported GRUB slice file (%s) exists - "
1375 "mount-point %s\n"), menu_root);
1382 bam_error(_("cant find pool for mount-point %s\n"),
1386 BAM_DPRINTF(("%s: derived pool=%s from special\n", fcn, pool));
1391 bam_error(_("cannot mount pool dataset for pool: %s\n"),
1396 BAM_DPRINTF(("%s: top dataset mountpoint=%s\n", fcn, zmntpt));
1399 BAM_DPRINTF(("%s: zfs menu_root=%s\n", fcn, menu_root));
1405 BAM_DPRINTF(("%s: cleaned menu root is <%s>\n", fcn, clean_menu_root));
1410 BAM_DPRINTF(("%s: menu path is: %s\n", fcn, menu_path));
1416 bam_print(_("the location for the active GRUB menu is: %s\n"),
1420 bam_error(_("cannot find GRUB menu file: %s\n"), menu_path);
1441 BAM_DPRINTF(("%s: Failed to get boot capability\n", fcn));
1460 bam_error(_("%s operation unsupported on SPARC "
1468 bam_error(_("%s operation unsupported on SPARC "
1485 * checking whatsoever, so it's the responsibility of
1516 BAM_DPRINTF(("%s: writing menu to clean-menu-root: <%s>\n",
1559 BAM_DPRINTF(("%s: Failed to get boot capability\n", fcn));
1570 "subcmd: %s\n"), subcmd);
1595 (void) fprintf(stderr, "%s: ", prog);
1662 bam_error(_("failed to open file: %s: %s\n"),
1674 bam_error(_("failed to lock file: %s: %s\n"),
1691 bam_error(_("failed to lock file: %s: %s\n"),
1722 bam_error(_("failed to unlock file: %s: %s\n"),
1727 bam_error(_("failed to close file: %s: %s\n"),
1750 bam_print(_("%s\n"), lp->line);
1777 (void) snprintf(path, sizeof (path), "%s%s", root, final);
1782 bam_print(_("file is empty, deleting file: %s\n"),
1785 bam_error(_("failed to unlink file: %s: %s\n"),
1809 bam_error(_("getpwnam: uid for %s failed, "
1817 bam_error(_("getgrnam: gid for %s failed, "
1824 (void) snprintf(tmpfile, sizeof (tmpfile), "%s%s", root, tmp);
1829 bam_error(_("failed to open file: %s: %s\n"), tmpfile,
1836 bam_error(_("failed to close file: %s: %s\n"),
1844 bam_error(_("failed to open file: %s: %s\n"), tmpfile,
1853 bam_error(_("write to file failed: %s: %s\n"),
1863 bam_error(_("failed to close file: %s: %s\n"),
1876 bam_error(_("chmod operation on %s failed - %s\n"),
1884 bam_error(_("chgrp operation on %s failed - %s\n"),
1895 bam_error(_("rename to file failed: %s: %s\n"), path,
1900 BAM_DPRINTF(("%s: wrote file successfully: %s\n", fcn, path));
1924 "path for %s\n"), path);
1927 bam_error(_("mkdir of %s failed: %s\n"),
1964 ret = snprintf(cf->path, sizeof (cf->path), "%s/%s", base, strip);
1966 bam_error(_("unable to create path on mountpoint %s, "
1977 bam_error(_("failed to open file: %s: %s\n"),
1986 bam_error(_("failed to open file: %s: %s\n"),
2002 bam_error(_("failed to write to %s\n"),
2005 bam_error(_("write to file failed: %s: %s\n"),
2012 bam_error(_("write to file failed: %s: %s\n"),
2029 bam_error(_("failed to close file: %s: %s\n"),
2038 bam_error(_("failed to close file: %s: %s\n"),
2065 bam_error(_("failed to open file: %s: %s\n"), path,
2118 ret = snprintf(dpath, sizeof (dpath), "%s/%s", updt ?
2122 bam_error(_("unable to create path on mountpoint %s, "
2170 bam_error(_("failed to open file: %s: %s\n"),
2183 bam_error(_("read failed for file: %s: %s\n"),
2215 bam_print(_("WARNING: file %s is neither a "
2290 bam_error(_("failed to update stat data for: %s: %s\n"),
2335 (void) fprintf(walk_arg.sparcfile, "/%s=%s\n", strip,
2346 bam_print(_(" new %s\n"), file);
2355 bam_error(_("directory cache update failed for %s\n"),
2378 "failed for %s\n"), file);
2384 bam_print(_(" new %s\n"), file);
2429 "for %s\n"), file);
2436 bam_print(" %s\n", file);
2438 bam_print(_(" changed %s\n"), file);
2462 (void) snprintf(tpath, sizeof (tpath), "%s/%s",
2477 * accordingly. If the path exists, but it's not a directory, a best effort
2488 "%s%s%s%s%s", root, ARCHIVE_PREFIX, get_machine(), what == FILE64 ?
2492 bam_error(_("unable to create path on mountpoint %s, "
2505 bam_print(_("archive cache directory not found: %s\n"),
2509 bam_error(_("mkdir of %s failed: %s\n"),
2537 sizeof (get_updatedir(what)), "%s%s%s/amd64%s", root,
2541 sizeof (get_updatedir(what)), "%s%s%s%s", root,
2545 bam_error(_("unable to create path on mountpoint %s, "
2576 "%s%s%s/amd64%s", root, ARCHIVE_PREFIX, get_machine(),
2579 ret = snprintf(archive_path, sizeof (archive_path), "%s%s%s%s",
2583 bam_error(_("unable to create path on mountpoint %s, "
2590 bam_print(_("archive not found: %s\n"), archive_path);
2607 ret = snprintf(timestamp_path, sizeof (timestamp_path), "%s%s", root,
2611 bam_error(_("unable to create path on mountpoint %s, "
2642 bam_print(_("archive %s is bigger than %d bytes and "
2691 sizeof (get_cachedir(FILE64)), "%s%s%s/%s", root,
2695 bam_error(_("unable to create path on mountpoint %s, "
2707 bam_error(_("failed to open file: %s: %s\n"),
2751 (void) snprintf(path, sizeof (path), "%s%s", root, filelist);
2755 BAM_DPRINTF(("%s: failed to open archive filelist: %s: %s\n",
2766 bam_error(_("failed to close file: %s: %s\n"),
2787 n = snprintf(path, sizeof (path), "%s%s", root, EXTRACT_BOOT_FILELIST);
2817 "-R %s", root);
2821 "-p %s", bam_platform);
2823 n = snprintf(cmd, sizeof (cmd), "%s %s %s /%s /%s",
2832 BAM_DPRINTF(("%s: failed to open archive "
2833 "filelist: %s: %s\n", fcn, path, strerror(errno)));
2862 (void) snprintf(path, sizeof (path), "%s%s", root, FILE_STAT);
2866 bam_print(_("failed to open file: %s: %s\n"),
2872 bam_error(_("stat of file failed: %s: %s\n"), path,
2880 bam_error(_("read failed for file: %s: %s\n"), path,
2895 bam_error(_("failed to unpack stat data: %s: %s\n"),
2918 (void) snprintf(path, sizeof (path), "%s/%s", get_cachedir(what), file);
2950 * If we need to (re)create the cache, there's no need to check for
2965 (void) snprintf(path, sizeof (path), "%s/%s",
2971 bam_print(_(" stale %s\n"), path);
2995 bam_error(_("failed to create stat data: %s\n"),
3013 (void) snprintf(path, sizeof (path), "%s%s", root, lp->line);
3023 bam_print(_("cannot find: %s: %s\n"),
3040 (void) snprintf(timestamp_path, sizeof (timestamp_path), "%s%s", root,
3049 bam_error(_("failed to open file: %s: %s\n"), timestamp_path,
3071 bam_error(_("failed to pack stat data: %s\n"),
3076 (void) snprintf(path, sizeof (path), "%s%s", root, FILE_STAT_TMP);
3079 bam_error(_("failed to open file: %s: %s\n"), path,
3086 bam_error(_("write to file failed: %s: %s\n"), path,
3095 (void) snprintf(path2, sizeof (path2), "%s%s", root, FILE_STAT);
3097 bam_error(_("rename to file failed: %s: %s\n"), path2,
3158 (void) snprintf(path, sizeof (path), "%s%s", root, FILE_STAT);
3232 (void) snprintf(cmd, sizeof (cmd), "%s -f \"%s\" 2>/dev/null",
3264 (void) fprintf(stderr, "%s\n", lp->line);
3278 (void) fprintf(stderr, "%s\n", lp->line);
3288 bam_error(_("archive file %s not generated correctly\n"), dest);
3369 bam_error(_("unable to access bootblk file : %s\n"), bootblk);
3376 (void) snprintf(cmdline, sizeof (cmdline), "%s %s -G %s -o \"%s\" "
3377 "-path-list \"%s\" 2>&1", MKISOFS_PATH, MKISO_PARAMS, bootblk,
3380 BAM_DPRINTF(("%s: executing: %s\n", func, cmdline));
3394 (void) snprintf(cmdline, sizeof (cmdline), "%s if=\"%s\" of=\"%s\""
3398 BAM_DPRINTF(("%s: executing: %s\n", func, cmdline));
3414 bam_error(_("boot-archive creation FAILED, command: '%s'\n"), cmdline);
3420 from_733(unsigned char *s)
3426 ret |= s[i] << (8 * i);
3432 to_733(unsigned char *s, unsigned int val)
3437 s[i] = s[7-i] = (val >> (8 * i)) & 0xFF;
3451 (void) asprintf(&archive_hash, "%s.hash", archive);
3467 (void) fprintf(fp, "%s\n", hash);
3490 bam_error(_("failed to open file: %s: %s\n"),
3502 bam_error(_("read failed for file: %s: %s\n"),
3509 bam_error(_("iso descriptor signature for %s is "
3520 (void) snprintf(cmdline, sizeof (cmdline), "%s -C 16,%d -M %s %s -o \""
3521 "%s\" \"%s\" 2>&1", MKISOFS_PATH, next_session, archive,
3524 BAM_DPRINTF(("%s: executing: %s\n", func, cmdline));
3529 bam_error(_("Command '%s' failed while generating "
3540 bam_error(_("failed to open file: %s: %s\n"),
3549 bam_error(_("read failed for file: %s: %s\n"),
3556 bam_error(_("iso descriptor signature for %s is "
3571 bam_print("%s: Updating descriptor entry [%d]\n", func,
3580 bam_error(_("write to file failed: %s: %s\n"),
3594 bam_error(_("failed to close file: %s: %s\n"),
3600 (void) snprintf(cmdline, sizeof (cmdline), "%s if=%s of=%s bs=32k "
3604 BAM_DPRINTF(("%s: executing: %s\n", func, cmdline));
3609 bam_error(_("Command '%s' failed while generating "
3646 (void) snprintf(cmdline, sizeof (cmdline), "%s %s -o \"%s\" \"%s\" "
3649 BAM_DPRINTF(("%s: executing: %s\n", func, cmdline));
3653 bam_error(_("boot-archive creation FAILED, command: '%s'\n"),
3679 "%s%s%s/amd64/archive-new-%d", root, ARCHIVE_PREFIX,
3682 ret = snprintf(temp, sizeof (temp), "%s%s%s/archive-new-%d",
3690 "%s%s%s/amd64%s", root, ARCHIVE_PREFIX, get_machine(),
3694 "%s%s%s%s", root, ARCHIVE_PREFIX, get_machine(),
3700 bam_print("updating %s\n", boot_archive);
3704 "%s/platform/%s/lib/fs/hsfs/bootblk", root, get_machine());
3714 "%s\n", boot_archive);
3720 bam_print("Successfully extended %s\n",
3738 bam_print("Unable to extend %s... rebuilding archive\n",
3753 bam_print("Successfully created %s\n", boot_archive);
3758 bam_error(_("unable to create path on mountpoint %s, path too long\n"),
3791 (void) snprintf(path, sizeof (path), "%s/%s", root, CREATE_RAMDISK);
3793 bam_error(_("archive creation file not found: %s: %s\n"),
3808 (void) snprintf(cmdline, len, "%s -p %s -R %s",
3813 (void) snprintf(cmdline, len, "%s -R %s", path, root);
3817 (void) snprintf(cmdline, len, "%s", path);
3820 bam_error(_("boot-archive creation FAILED, command: '%s'\n"),
3861 bam_error(_("failed to open file: %s: %s\n"),
3887 bam_error(_("alternate root %s not in mnttab\n"),
3896 bam_error(_("%s is on a ramdisk device\n"), bam_root);
3917 (void) snprintf(path, sizeof (path), "%s/%s", root, CREATE_RAMDISK);
3922 bam_print(_("file not found: %s\n"), path);
3923 BAM_DPRINTF(("%s: not a boot archive based Solaris "
3924 "instance: %s\n", fcn, root));
3928 BAM_DPRINTF(("%s: *IS* a boot archive based Solaris instance: %s\n",
3965 (void) snprintf(path, sizeof (path), "%s%s", root, GRUB_STAGE2);
3967 BAM_DPRINTF(("%s: Missing GRUB directory: %s\n",
3987 bam_error(_("statvfs failed for %s: %s\n"), root,
3993 BAM_DPRINTF(("%s: is a ZFS filesystem: %s\n", fcn, root));
3996 BAM_DPRINTF(("%s: is *NOT* a ZFS filesystem: %s\n", fcn, root));
4011 bam_error(_("statvfs failed for %s: %s\n"), root,
4017 BAM_DPRINTF(("%s: is a PCFS filesystem: %s\n", fcn, root));
4020 BAM_DPRINTF(("%s: is *NOT* a PCFS filesystem: %s\n",
4039 (void) snprintf(testfile, sizeof (testfile), "%s/%s.%d",
4049 BAM_DPRINTF(("%s: is a READONLY filesystem: %s\n", fcn, root));
4052 bam_error(_("error during read-only test on %s: %s\n"),
4059 BAM_DPRINTF(("%s: is a RDWR filesystem: %s\n", fcn, root));
4088 bam_print(_("%s: not a boot archive based Solaris "
4132 bam_error(_("%s filesystem is read-only, "
4201 BAM_DPRINTF(("%s: entered. No args\n", fcn));
4205 BAM_DPRINTF(("%s: not a Live Upgrade BE\n", fcn));
4210 BAM_DPRINTF(("%s: checksum file absent: %s\n",
4218 bam_error(_("failed to read GRUB menu checksum file: %s\n"),
4222 BAM_DPRINTF(("%s: opened checksum file: %s\n", fcn, LU_MENU_CKSUM));
4229 "checksum file: %s\n"), LU_MENU_CKSUM);
4235 BAM_DPRINTF(("%s: read checksum file: %s\n", fcn, LU_MENU_CKSUM));
4246 bam_error(_("error parsing GRUB menu checksum file: %s\n"),
4250 BAM_DPRINTF(("%s: parsed checksum file: %s\n", fcn, LU_MENU_CKSUM));
4257 bam_error(_("failed to mount top dataset for %s\n"),
4262 (void) snprintf(cmdline, sizeof (cmdline), "%s %s%s",
4265 (void) snprintf(cmdline, sizeof (cmdline), "%s %s",
4278 BAM_DPRINTF(("%s: successfully generated checksum\n", fcn));
4286 BAM_DPRINTF(("%s: generated checksum output valid\n", fcn));
4302 BAM_DPRINTF(("%s: successfully parsed generated checksum\n", fcn));
4308 BAM_DPRINTF(("%s: no change in checksum of GRUB menu\n", fcn));
4315 BAM_DPRINTF(("%s: checksum of GRUB menu has changed\n", fcn));
4321 "/bin/sh -c '. %s > /dev/null; %s %s yes > /dev/null'",
4329 BAM_DPRINTF(("%s: successfully propagated GRUB menu\n", fcn));
4331 (void) snprintf(cmdline, sizeof (cmdline), "/bin/cp %s %s > /dev/null",
4336 bam_error(_("failed to create backup for GRUB menu: %s\n"),
4340 BAM_DPRINTF(("%s: successfully created backup GRUB menu: %s\n",
4344 "/bin/sh -c '. %s > /dev/null; %s %s no > /dev/null'",
4349 bam_error(_("error propagating backup GRUB menu: %s\n"),
4353 BAM_DPRINTF(("%s: successfully propagated backup GRUB menu: %s\n",
4356 (void) snprintf(cmdline, sizeof (cmdline), "%s %s > %s",
4361 bam_error(_("failed to write GRUB menu checksum file: %s\n"),
4365 BAM_DPRINTF(("%s: successfully created checksum file: %s\n",
4369 "/bin/sh -c '. %s > /dev/null; %s %s no > /dev/null'",
4374 bam_error(_("error propagating GRUB menu checksum file: %s\n"),
4378 BAM_DPRINTF(("%s: successfully propagated checksum file: %s\n",
4399 bam_error(_("an alternate root (%s) cannot be used with this "
4419 bam_error(_("failed to open file: %s: %s\n"),
4436 (void) snprintf(creatram, sizeof (creatram), "%s/%s",
4446 (void) snprintf(rootbuf, sizeof (rootbuf), "%s/",
4451 * It's possible that other mounts may be an alternate boot
4468 bam_error(_("Deferred FDISK update file(s) found: %s, %s. "
4519 BAM_DPRINTF(("%s: new boot entry alloced\n", fcn));
4525 BAM_DPRINTF(("%s: (first) new boot entry created\n", fcn));
4534 BAM_DPRINTF(("%s: new boot entry linked in\n", fcn));
4557 BAM_DPRINTF(("%s: entered. args: %s %s\n", fcn, arg, str));
4562 BAM_DPRINTF(("%s: command %s does not match %s\n",
4571 BAM_DPRINTF(("%s: returning SUCCESS\n", fcn));
4573 BAM_DPRINTF(("%s: returning FAILURE\n", fcn));
4590 BAM_DPRINTF(("%s: not a kernel command: %s\n", fcn, cmd));
4595 BAM_DPRINTF(("%s: setting DBOOT|DBOOT_32 flag: %s\n",
4600 BAM_DPRINTF(("%s: setting DBOOT flag: %s\n", fcn, arg));
4604 BAM_DPRINTF(("%s: setting DBOOT|DBOOT_64 flag: %s\n",
4609 BAM_DPRINTF(("%s: setting DBOOT|DBOOT_FAILSAFE flag: %s\n",
4614 BAM_DPRINTF(("%s: setting DBOOT|DBOOT_FAILSAFE|DBOOT_32 "
4615 "flag: %s\n", fcn, arg));
4620 BAM_DPRINTF(("%s: setting DBOOT|DBOOT_FAILSAFE|DBOOT_64 "
4621 "flag: %s\n", fcn, arg));
4625 BAM_DPRINTF(("%s: setting MULTIBOOT flag: %s\n", fcn, arg));
4629 BAM_DPRINTF(("%s: setting MULTIBOOT|MULTIBOOT_FAILSAFE "
4630 "flag: %s\n", fcn, arg));
4633 BAM_DPRINTF(("%s: setting XEN HV flag: %s\n", fcn, arg));
4636 BAM_DPRINTF(("%s: is HAND kernel flag: %s\n", fcn, arg));
4645 BAM_DPRINTF(("%s: is UNKNOWN kernel entry: %s\n", fcn, arg));
4665 BAM_DPRINTF(("%s: not module cmd: %s\n", fcn, cmd));
4678 BAM_DPRINTF(("%s: bootadm or LU module cmd: %s\n", fcn, arg));
4683 BAM_DPRINTF(("%s: is HAND module: %s\n", fcn, arg));
4686 BAM_DPRINTF(("%s: is UNKNOWN module: %s\n", fcn, arg));
4799 BAM_DPRINTF(("%s: is bootadm(1M) entry: %s\n",
4805 BAM_DPRINTF(("%s: is LU entry: %s\n",
4827 BAM_DPRINTF(("%s: setting ROOT: %s\n",
4832 BAM_DPRINTF(("%s: setting "
4833 "FINDROOT: %s\n", fcn, arg));
4837 BAM_DPRINTF(("%s: setting "
4838 "CHAINLOADER: %s\n", fcn, arg));
4966 (void) snprintf(buf, sizeof (buf), "%s%s%s",
5007 bam_error(_("failed to close file: %s: %s\n"), menu_path,
5034 bam_error(_("invalid option: %s\n"), opt);
5044 bam_error(_("invalid boot entry number: %s\n"), eq + 1);
5052 bam_error(_("invalid option: %s\n"), opt);
5080 BAM_DPRINTF(("%s: entered. args: %s %s\n", "list_entry", menu_path,
5084 bam_error(_("menu file not found: %s\n"), menu_path);
5103 bam_print(_("%d %s\n"), lp->entryNum,
5109 bam_print(_("%s\n"), lp->line);
5122 bam_print(_("%s\n"), lp->line);
5165 bam_error(_("missing suboption: %s\n"), menu_cmds[KERNEL_CMD]);
5170 bam_error(_("missing suboption: %s\n"),
5200 (void) snprintf(linebuf, sizeof (linebuf), "%s%s",
5204 (void) snprintf(linebuf, sizeof (linebuf), "%s%s%s",
5208 (void) snprintf(linebuf, sizeof (linebuf), "%s%s%s",
5211 BAM_DPRINTF(("%s: findroot added: line#: %d: entry#: %d\n",
5215 (void) snprintf(linebuf, sizeof (linebuf), "%s%s%s",
5220 (void) snprintf(linebuf, sizeof (linebuf), "%s%s%s",
5225 (void) snprintf(linebuf, sizeof (linebuf), "%s%s%s",
5230 (void) snprintf(linebuf, sizeof (linebuf), "%s%s%s",
5234 (void) snprintf(linebuf, sizeof (linebuf), "%s%s",
5260 * Check entry number and make sure it's a modifiable entry.
5278 BAM_DPRINTF(("%s: freeing line: %d\n",
5294 BAM_DPRINTF(("%s: freeing entry: %d\n", fcn, tmp->entryNum));
5324 BAM_DPRINTF(("%s: entered. No args\n", "delete_all_entries"));
5351 ret = snprintf(path, sizeof (path), "%s/%s", osroot,
5354 bam_error(_("unable to create path on mountpoint %s, "
5362 "%s/%s > /dev/null", osroot, CREATE_DISKMAP);
5368 BAM_DPRINTF(("%s: created diskmap file: %s\n",
5371 BAM_DPRINTF(("%s: FAILED to create diskmap file: %s\n",
5395 is_pcfs = (*slice != 's');
5401 *slice = 's';
5497 bam_error(_("not a /dev/[r]dsk name: %s\n"), osdev);
5504 "bootdisk: %s\n"), osdev);
5509 slice = strrchr(ctdname, 's');
5515 bam_error(_("create_diskmap command failed for OS root: %s.\n"),
5534 *slice = 's';
5541 bam_error(_("not using biosdev command for disk: %s.\n"),
5549 bam_error(_("failed to determine fdisk partition: %s\n"),
5561 (void) snprintf(grubroot, 10, "(hd%s,%d,%c)",
5564 (void) snprintf(grubroot, 10, "(hd%s,%d)",
5585 (void) snprintf(signdir, sizeof (signdir), "%s/%s",
5589 BAM_DPRINTF(("%s: no sign dir: %s\n", fcn, signdir));
5596 bam_error(_("opendir of %s failed: %s\n"), signdir,
5608 (void) snprintf(tmpsign, sizeof (tmpsign), "%s", entp->d_name);
5629 BAM_DPRINTF(("%s: existing primary signs: zfs=%s ufs=%s lu=%s\n", fcn,
5640 bam_error(_("found mismatched boot signature %s for "
5641 "filesystem type: %s.\n"), zfs, "ufs");
5645 bam_error(_("found mismatched boot signature %s for "
5646 "filesystem type: %s.\n"), ufs, "zfs");
5655 BAM_DPRINTF(("%s: feeing LU sign: %s\n", fcn, lu));
5679 (void) snprintf(backup, sizeof (backup), "%s%s",
5686 bam_error(_("failed to open file: %s: %s\n"),
5689 BAM_DPRINTF(("%s: failed to open %s: %s\n",
5717 BAM_DPRINTF(("%s: existing backup signs: zfs=%s ufs=%s lu=%s\n", fcn,
5728 bam_error(_("found mismatched boot signature %s for "
5729 "filesystem type: %s.\n"), zfs, "ufs");
5733 bam_error(_("found mismatched boot signature %s for "
5734 "filesystem type: %s.\n"), ufs, "zfs");
5743 BAM_DPRINTF(("%s: feeing LU sign: %s\n", fcn, lu));
5760 BAM_DPRINTF(("%s: existing backup sign: %s\n", fcn,
5763 BAM_DPRINTF(("%s: existing primary sign: %s\n", fcn, sign));
5779 BAM_DPRINTF(("%s: entered. args: %s %s\n", fcn, special, fstype));
5785 bam_error(_("failed to open file: %s: %s\n"),
5797 BAM_DPRINTF(("%s: no mount-point for special=%s and "
5798 "fstype=%s\n", fcn, special, fstype));
5805 BAM_DPRINTF(("%s: returning mount-point for special %s: %s\n",
5827 BAM_DPRINTF(("%s: entered. arg: %s\n", fcn, pool));
5832 "/sbin/zfs get -Ho value mounted %s",
5839 "pool %s\n"), pool);
5845 bam_error(_("ZFS pool %s has bad mount status\n"), pool);
5857 BAM_DPRINTF(("%s: legacy pool %s already mounted\n",
5868 (void) snprintf(tmpmnt, sizeof (tmpmnt), "%s.%d",
5873 BAM_DPRINTF(("%s: legacy pool %s mount-point %s absent\n",
5878 bam_error(_("mkdir of %s failed: %s\n"), tmpmnt,
5883 BAM_DPRINTF(("%s: legacy pool %s mount-point %s is already "
5888 "/sbin/mount -F zfs %s %s",
5894 bam_error(_("mount of ZFS pool %s failed\n"), pool);
5900 BAM_DPRINTF(("%s: legacy pool %s successfully mounted at %s\n",
5923 BAM_DPRINTF(("%s: entered. arg: %s\n", fcn, pool));
5929 "/sbin/zfs get -Ho value mountpoint %s",
5934 bam_error(_("failed to determine mount point of ZFS pool %s\n"),
5943 BAM_DPRINTF(("%s: is legacy, pool=%s\n", fcn, pool));
5950 BAM_DPRINTF(("%s: is *NOT* legacy, pool=%s\n", fcn, pool));
5953 "/sbin/zfs get -Ho value mounted %s",
5960 "pool %s\n"), pool);
5966 bam_error(_("ZFS pool %s has bad mount status\n"), pool);
5977 BAM_DPRINTF(("%s: non-legacy pool %s mounted already\n",
5983 BAM_DPRINTF(("%s: non-legacy pool %s *NOT* already mounted\n",
5988 "/sbin/zfs mount %s", pool);
5992 bam_error(_("mount of ZFS pool %s failed\n"), pool);
5996 BAM_DPRINTF(("%s: non-legacy pool %s mounted now\n", fcn, pool));
6003 "/sbin/zfs get -Ho value mountpoint %s",
6009 bam_error(_("failed to determine mount point of ZFS pool %s\n"),
6016 bam_error(_("ZFS pool %s has no mount-point\n"), pool);
6023 bam_error(_("ZFS pool %s has bad mount-point %s\n"),
6031 BAM_DPRINTF(("%s: non-legacy pool %s is mounted at %s\n",
6039 BAM_DPRINTF(("%s: returning FAILURE\n", fcn));
6055 BAM_DPRINTF(("%s: pool %s was already mounted at %s, Nothing "
6061 "/sbin/umount %s", pool);
6065 bam_error(_("umount of %s failed\n"), pool);
6072 BAM_DPRINTF(("%s: legacy pool %s was mounted by us, "
6078 "/sbin/zfs unmount %s", pool);
6082 bam_error(_("umount of %s failed\n"), pool);
6085 BAM_DPRINTF(("%s: nonleg pool %s was mounted by us, "
6090 "pool %s\n"), pool);
6119 BAM_DPRINTF(("%s: osdev arg = %s\n", fcn, osdev));
6127 BAM_DPRINTF(("%s: got pool. pool = %s\n", fcn, pool));
6131 bam_error(_("invalid device %s: cannot determine pool name\n"),
6141 "/usr/lib/fs/zfs/fstyp -a %s 2>/dev/null | /bin/grep '^name:'",
6147 bam_error(_("fstyp -a on device %s failed\n"), osdev);
6153 bam_error(_("NULL fstyp -a output for device %s\n"), osdev);
6162 bam_error(_("bad fstyp -a output for device %s\n"), osdev);
6171 BAM_DPRINTF(("%s: got pool. pool = %s\n", fcn, pool));
6188 bam_error(_("failed to get pool for device: %s\n"), osdev);
6195 bam_error(_("failed to mount top dataset for pool: %s\n"),
6204 BAM_DPRINTF(("%s: existing backup sign: %s\n", fcn,
6207 BAM_DPRINTF(("%s: existing primary sign: %s\n", fcn, sign));
6224 BAM_DPRINTF(("%s: checking for existing UFS sign\n", fcn));
6227 BAM_DPRINTF(("%s: checking for existing ZFS sign\n", fcn));
6230 bam_error(_("boot signature not supported for fstype: %s\n"),
6289 bam_error(_("failed to open file: %s: %s\n"), MNTTAB,
6311 BAM_DPRINTF(("%s: caching mount: special=%s, mntpt=%s, "
6312 "fstype=%s\n", fcn, ctds, mnt.mnt_mountp, mnt.mnt_fstype));
6359 bam_error(_("invalid key for mnttab hash: %s\n"), special);
6371 BAM_DPRINTF(("%s: no match in cache for: %s\n", fcn, special));
6377 BAM_DPRINTF(("%s: *MATCH* in cache for: %s\n", fcn, special));
6395 BAM_DPRINTF(("%s: no sign on %s to add to signlist\n",
6400 (void) snprintf(signbuf, sizeof (signbuf), "%s\n", sign);
6406 bam_error(_("invalid UFS boot signature %s\n"), sign);
6416 bam_error(_("failed to write signature %s to signature "
6417 "list: %s\n"), sign, strerror(error));
6424 BAM_DPRINTF(("%s: successfully added sign on %s to signlist\n",
6460 (void) snprintf(path, sizeof (path), "/dev/rdsk/%s", slice);
6462 BAM_DPRINTF(("%s: slice does not exist: %s\n", fcn, path));
6468 "/usr/lib/fs/ufs/fstyp /dev/rdsk/%s 2>/dev/null",
6473 bam_print(_("fstyp failed for slice: %s\n"), slice);
6479 bam_print(_("bad output from fstyp for slice: %s\n"),
6488 bam_print(_("%s is not a ufs slice: %s\n"),
6502 (void) snprintf(blkslice, sizeof (blkslice), "/dev/dsk/%s",
6506 "/usr/sbin/mount -F ufs -o ro %s %s "
6511 bam_print(_("mount of %s (fstype %s) failed\n"),
6519 "/usr/sbin/umount -f %s > /dev/null 2>&1",
6523 bam_print(_("umount of %s failed\n"), slice);
6546 assert(s0[len - 2] == 's' && s0[len - 1] == '0');
6561 BAM_DPRINTF(("%s: VTOC: skipping 0-length slice: %s\n",
6574 BAM_DPRINTF(("%s: VTOC: unsupported tag, "
6575 "skipping: %s\n", fcn, slice));
6578 BAM_DPRINTF(("%s: VTOC: supported tag, checking: %s\n",
6587 BAM_DPRINTF(("%s: VTOC: non-RDWR flag, skipping: %s\n",
6591 BAM_DPRINTF(("%s: VTOC: RDWR flag, checking: %s\n",
6620 assert(s0[len - 2] == 's' && s0[len - 1] == '0');
6635 BAM_DPRINTF(("%s: EFI: skipping 0-length slice: %s\n",
6648 BAM_DPRINTF(("%s: EFI: unsupported tag, skipping: %s\n",
6652 BAM_DPRINTF(("%s: EFI: supported tag, checking: %s\n",
6661 BAM_DPRINTF(("%s: EFI: non-RDWR flag, skipping: %s\n",
6665 BAM_DPRINTF(("%s: EFI: RDWR flag, checking: %s\n",
6695 (void) snprintf(s0path, sizeof (s0path), "/dev/rdsk/%s", s0);
6698 BAM_DPRINTF(("%s: slice 0 does not exist: %s\n", fcn, s0path));
6704 bam_error(_("failed to open file: %s: %s\n"), s0path,
6713 BAM_DPRINTF(("%s: VTOC: failed to read: %s\n",
6717 BAM_DPRINTF(("%s: VTOC: is INVALID: %s\n",
6721 BAM_DPRINTF(("%s: VTOC: unknown error while "
6722 "reading: %s\n", fcn, s0path));
6726 BAM_DPRINTF(("%s: VTOC: not supported: %s\n",
6731 BAM_DPRINTF(("%s: VTOC: SUCCESS reading: %s\n",
6735 BAM_DPRINTF(("%s: VTOC: READ: unknown return "
6736 "code: %s\n", fcn, s0path));
6746 BAM_DPRINTF(("%s: EFI: failed to read: %s\n",
6750 BAM_DPRINTF(("%s: EFI: is INVALID: %s\n", fcn, s0path));
6753 BAM_DPRINTF(("%s: EFI: unknown error while "
6754 "reading: %s\n", fcn, s0path));
6757 BAM_DPRINTF(("%s: EFI: not supported: %s\n",
6762 BAM_DPRINTF(("%s: EFI: SUCCESS reading: %s\n",
6766 BAM_DPRINTF(("%s: EFI: READ: unknown return code: %s\n",
6781 BAM_DPRINTF(("%s: disk has neither VTOC nor EFI: %s\n",
6809 bam_print(_(" - signature list %s exists\n"),
6819 bam_error(_("failed to open file: %s: %s\n"),
6828 bam_error(_("failed to close file: %s: %s\n"),
6838 bam_error(_("failed to open file: %s: %s\n"),
6849 bam_error(_("%s: failed to cache /etc/mnttab\n"), fcn);
6861 bam_error(_("mkdir of %s failed: %s\n"), tmpmnt,
6873 bam_error(_("opendir of %s failed: %s\n"), "/dev/rdsk",
6885 * have 's' at len - 2.
6888 if (dp->d_name[len - 2 ] != 's' || dp->d_name[len - 1] != '0') {
6889 BAM_DPRINTF(("%s: skipping non-s0 slice: %s\n",
6908 bam_error(_("failed to close file: %s: %s\n"),
6916 "/usr/bin/sort -u %s.tmp > %s.sorted",
6934 bam_error(_("rename to file failed: %s: %s\n"),
6941 BAM_DPRINTF(("%s: generated zero length signlist: %s.\n",
6945 BAM_DPRINTF(("%s: returning SUCCESS\n", fcn));
6955 BAM_DPRINTF(("%s: returning FAILURE\n", fcn));
6986 bam_error(_("missing UFS signature list file: %s\n"),
7003 "file %s: %s\n"), UFS_SIGNATURE_LIST, strerror(error));
7014 bam_error(_("bad UFS boot signature: %s\n"), tmpsign);
7022 bam_error(_("bad UFS boot signature: %s\n"), tmpsign);
7031 bam_error(_("bad UFS boot signature: %s\n"), tmpsign);
7036 BAM_DPRINTF(("%s: found hole %d in sign list.\n",
7052 bam_error(_("failed to add sign %s to signlist.\n"), tmpsign);
7056 BAM_DPRINTF(("%s: returning SUCCESS\n", fcn));
7081 bam_error(_("failed to open file: %s: %s\n"), MNTTAB,
7094 bam_error(_("failed to find OS mountpoint %s in %s\n"),
7103 bam_error(_("NULL fstype found for OS root %s\n"), osroot);
7107 BAM_DPRINTF(("%s: returning SUCCESS\n", fcn));
7119 BAM_DPRINTF(("%s: entered. arg: %s\n", fcn, osdev));
7127 bam_error(_("failed to get pool name from %s\n"), osdev);
7131 (void) snprintf(tmpsign, sizeof (tmpsign), "pool_%s", pool);
7133 BAM_DPRINTF(("%s: created ZFS sign: %s\n", fcn, tmpsign));
7137 BAM_DPRINTF(("%s: returning SUCCESS\n", fcn));
7151 BAM_DPRINTF(("%s: created new ZFS sign\n", fcn));
7154 BAM_DPRINTF(("%s: created new UFS sign\n", fcn));
7157 bam_error(_("boot signature not supported for fstype: %s\n"),
7162 BAM_DPRINTF(("%s: created new sign: %s\n", fcn,
7180 (void) snprintf(backup, sizeof (backup), "%s%s",
7188 BAM_DPRINTF(("%s: found sign (%s) in backup.\n",
7195 BAM_DPRINTF(("%s: backup exists but sign %s not found\n",
7198 BAM_DPRINTF(("%s: no backup file (%s) found.\n", fcn, backup));
7214 BAM_DPRINTF(("%s: backup dir (%s) does not exist.\n",
7220 bam_error(_("mkdirp() of backup dir failed: %s: %s\n"),
7237 "file %s: %s\n"), GRUBSIGN_BACKUP, strerror(error));
7241 (void) snprintf(tmpsign, sizeof (tmpsign), "%s\n", sign);
7248 "file %s: %s\n"), GRUBSIGN_BACKUP, strerror(error));
7256 bam_print(_("updated boot signature backup file %s\n"),
7259 BAM_DPRINTF(("%s: returning SUCCESS\n", fcn));
7269 BAM_DPRINTF(("%s: entered. args: %s %s\n", fcn, osroot, sign));
7282 BAM_DPRINTF(("%s: entered. args: %s %s\n", fcn, osdev, sign));
7287 bam_error(_("failed to get pool name from %s\n"), osdev);
7294 bam_error(_("failed to mount top dataset for %s\n"), pool);
7307 BAM_DPRINTF(("%s: returning SUCCESS\n", fcn));
7309 BAM_DPRINTF(("%s: returning FAILURE\n", fcn));
7324 BAM_DPRINTF(("%s: setting UFS backup sign\n", fcn));
7327 BAM_DPRINTF(("%s: setting ZFS backup sign\n", fcn));
7330 bam_error(_("boot signature not supported for fstype: %s\n"),
7336 BAM_DPRINTF(("%s: returning SUCCESS\n", fcn));
7338 BAM_DPRINTF(("%s: returning FAILURE\n", fcn));
7355 (void) snprintf(signfile, sizeof (signfile), "%s/%s/%s",
7360 bam_print(_("primary sign %s exists\n"), sign);
7363 BAM_DPRINTF(("%s: primary sign (%s) does not exist\n",
7367 (void) snprintf(signdir, sizeof (signdir), "%s/%s",
7371 BAM_DPRINTF(("%s: primary signdir (%s) does not exist\n",
7378 "directory %s: %s\n"), signdir, strerror(errno));
7387 bam_error(_("error creating primary boot signature %s: %s\n"),
7396 bam_error(_("error syncing primary boot signature %s: %s\n"),
7403 bam_print(_("created primary GRUB boot signature: %s\n"),
7406 BAM_DPRINTF(("%s: returning SUCCESS\n", fcn));
7416 BAM_DPRINTF(("%s: entered. args: %s %s\n", fcn, osroot, sign));
7429 BAM_DPRINTF(("%s: entered. args: %s %s\n", fcn, osdev, sign));
7434 bam_error(_("failed to get pool name from %s\n"), osdev);
7442 bam_error(_("pool name %s not present in signature %s\n"),
7451 bam_error(_("failed to mount top dataset for %s\n"), pool);
7464 BAM_DPRINTF(("%s: returning SUCCESS\n", fcn));
7466 BAM_DPRINTF(("%s: returning FAILURE\n", fcn));
7480 BAM_DPRINTF(("%s: setting UFS primary sign\n", fcn));
7483 BAM_DPRINTF(("%s: setting ZFS primary sign\n", fcn));
7486 bam_error(_("boot signature not supported for fstype: %s\n"),
7492 BAM_DPRINTF(("%s: returning SUCCESS\n", fcn));
7494 BAM_DPRINTF(("%s: returning FAILURE\n", fcn));
7513 bam_error(_("invalid UFS boot signature %s\n"), sign);
7527 bam_error(_("rename to file failed: %s: %s\n"),
7537 bam_error(_("failed to open file: %s: %s\n"),
7543 (void) snprintf(signline, sizeof (signline), "%s\n", sign);
7549 bam_error(_("failed to write signature %s to signature "
7550 "list: %s\n"), sign, strerror(error));
7560 bam_error(_("failed to close file: %s: %s\n"),
7568 "/usr/bin/sort -u %s.tmp > %s.sorted",
7586 bam_error(_("rename to file failed: %s: %s\n"),
7592 BAM_DPRINTF(("%s: returning SUCCESS\n", fcn));
7603 BAM_DPRINTF(("%s: entered. args: %s %s %s %s\n", fcn,
7609 BAM_DPRINTF(("%s: returning FAILURE\n", fcn));
7610 bam_error(_("failed to set backup sign (%s) for %s: %s\n"),
7619 BAM_DPRINTF(("%s: returning SUCCESS\n", fcn));
7621 BAM_DPRINTF(("%s: returning FAILURE\n", fcn));
7622 bam_error(_("failed to set primary sign (%s) for %s: %s\n"),
7640 BAM_DPRINTF(("%s: entered. args: %s %s\n", fcn, osroot, osdev));
7644 bam_error(_("failed to get fstype for %s\n"), osroot);
7651 BAM_DPRINTF(("%s: no existing grubsign for %s: %s\n",
7657 "device: %s\n"), osdev);
7667 "device: %s\n"), osdev);
7677 bam_print(_("found or created GRUB signature %s for %s\n"),
7683 bam_error(_("failed to determine fdisk partition: %s\n"),
7689 slice = strrchr(osdev, 's');
7698 (void) snprintf(grubsign, MAXNAMELEN + 10, "(%s,%d,%c)",
7701 (void) snprintf(grubsign, MAXNAMELEN + 10, "(%s,%d)",
7706 BAM_DPRINTF(("%s: successfully created grubsign %s\n", fcn, grubsign));
7721 (void) snprintf(release, sizeof (release), "%s/etc/release", rootdir);
7725 bam_error(_("failed to open file: %s: %s\n"), release,
7743 BAM_DPRINTF(("%s: got title: %s\n", fcn, cp));
7768 bam_error(_("failed to open file: %s: %s\n"), MNTTAB,
7782 BAM_DPRINTF(("%s: Cannot get special file: mount-point %s "
7788 BAM_DPRINTF(("%s: returning special: %s\n", fcn, mp.mnt_special));
7802 BAM_DPRINTF(("%s: entering args: %d\n", fcn, n));
7809 BAM_DPRINTF(("%s: returning SUCCESS\n", fcn));
7829 BAM_DPRINTF(("%s: entered. arg: %s\n", fcn, special));
7833 bam_error(_("invalid device for ZFS filesystem: %s\n"),
7843 bam_error(_("cannot derive ZFS pool from special: %s\n"),
7848 (void) snprintf(cmd, sizeof (cmd), "/sbin/zpool status %s", pool);
7853 bam_error(_("cannot get zpool status for pool: %s\n"), pool);
7859 bam_error(_("bad zpool status for pool=%s\n"), pool);
7865 BAM_DPRINTF(("%s: strtok() zpool status line=%s\n",
7882 BAM_DPRINTF(("%s: found pool name: %s in zpool "
7889 bam_error(_("no pool name %s in zpool status\n"), pool);
7903 BAM_DPRINTF(("%s: counting phys slices in zpool status: %d\n",
7908 bam_error(_("no physical device in zpool status for pool=%s\n"),
7926 (void) snprintf(dsk, sizeof (dsk), "/dev/rdsk/%s",
7931 BAM_DPRINTF(("%s: adding phys slice=%s from pool %s status\n",
7940 BAM_DPRINTF(("%s: returning SUCCESS\n", fcn));
7958 BAM_DPRINTF(("%s: entered. arg: %s\n", fcn, menu_root));
7964 bam_error(_("cannot get special file for mount-point: %s\n"),
7972 BAM_DPRINTF(("%s: got physical device already directly for "
7973 "menu_root=%s special=%s\n", fcn, menu_root, special));
7974 BAM_DPRINTF(("%s: returning SUCCESS\n", fcn));
7984 bam_error(_("cannot derive physical device for %s (%s), "
7993 BAM_DPRINTF(("%s: returning FAILURE\n", fcn));
7998 BAM_DPRINTF(("%s: returning physical=%s\n",
8017 BAM_DPRINTF(("%s: entered. args: %s %s\n", fcn, osroot, physical));
8036 "disk: %s\n"), physical);
8042 BAM_DPRINTF(("%s: returning ret = %d\n", fcn, ret));
8061 BAM_DPRINTF(("%s: entered. args: %s %s\n", fcn, osroot, menu_root));
8067 "root: %s\n"), menu_root);
8081 BAM_DPRINTF(("%s: checking if phys-device=%s is on bootdisk\n",
8085 BAM_DPRINTF(("%s: phys-device=%s *IS* on bootdisk\n",
8095 BAM_DPRINTF(("%s: returning SUCCESS\n", fcn));
8097 BAM_DPRINTF(("%s: returning FAILURE\n", fcn));
8115 BAM_DPRINTF(("%s: previous next exists\n", fcn));
8118 BAM_DPRINTF(("%s: previous next does not exist\n", fcn));
8124 BAM_DPRINTF(("%s: last line in entry\n", fcn));
8130 BAM_DPRINTF(("%s: last line in menu\n", fcn));
8177 BAM_DPRINTF(("%s: matched title: %s\n",
8181 BAM_DPRINTF(("%s: no match title: %s, %s\n",
8194 BAM_DPRINTF(("%s: no match line has findroot, "
8195 "we don't: %s\n", fcn, lp->arg));
8200 BAM_DPRINTF(("%s: no match findroot: %s, %s\n",
8204 BAM_DPRINTF(("%s: matched findroot: %s\n",
8211 BAM_DPRINTF(("%s: no match, line has root, we "
8212 "don't: %s\n", fcn, lp->arg));
8217 BAM_DPRINTF(("%s: no match root: %s, %s\n",
8221 BAM_DPRINTF(("%s: matched root: %s\n", fcn, root));
8230 BAM_DPRINTF(("%s: root NOT optional\n", fcn));
8233 BAM_DPRINTF(("%s: root IS optional\n", fcn));
8250 BAM_DPRINTF(("%s: kernel match: %s, %s\n", fcn,
8264 BAM_DPRINTF(("%s: module match: %s, %s\n", fcn,
8283 BAM_DPRINTF(("%s: returning ret = %d\n", fcn, i));
8285 BAM_DPRINTF(("%s: returning ret = %d\n", fcn, BAM_ERROR));
8302 /* note: don't match on title, it's updated on upgrade */
8314 BAM_DPRINTF(("%s: upgrading entry from dboot to "
8315 "multiboot: root = %s\n", fcn, root));
8319 BAM_DPRINTF(("%s: found entry with matching findroot: %s\n",
8324 BAM_DPRINTF(("%s: boot entry not found in menu. Creating "
8325 "new entry, findroot = %s\n", fcn, findroot));
8333 (void) snprintf(linebuf, sizeof (linebuf), "%s%s%s",
8339 BAM_DPRINTF(("%s: changing title to: %s\n", fcn, title));
8361 (void) snprintf(linebuf, sizeof (linebuf), "%s%s%s",
8364 BAM_DPRINTF(("%s: adding findroot line: %s\n", fcn, findroot));
8372 params = strstr(lp->line, "-s");
8374 (void) snprintf(linebuf, sizeof (linebuf), "%s%s%s%s",
8378 (void) snprintf(linebuf, sizeof (linebuf), "%s%s%s",
8391 BAM_DPRINTF(("%s: adding new kernel$ line: %s\n",
8401 (void) snprintf(linebuf, sizeof (linebuf), "%s%s%s",
8411 BAM_DPRINTF(("%s: adding new kernel$ line: %s\n",
8416 (void) snprintf(linebuf, sizeof (linebuf), "%s%s%s",
8426 BAM_DPRINTF(("%s: adding new module$ line: %s\n",
8437 (void) snprintf(linebuf, sizeof (linebuf), "%s%s%s",
8448 BAM_DPRINTF(("%s: adding new module$ line: %s\n",
8453 BAM_DPRINTF(("%s: returning ret = %d\n", fcn, i));
8468 BAM_DPRINTF(("%s: entered. args: %s %s\n", fcn, osroot, menu_root));
8480 BAM_DPRINTF(("%s: one or more non-ZFS filesystems (%s, %s)\n",
8489 bam_error(_("failed to get special file for osroot: %s\n"),
8493 BAM_DPRINTF(("%s: ospecial=%s for osroot=%s\n", fcn, ospecial, osroot));
8498 bam_error(_("failed to get special file for menu_root: %s\n"),
8503 BAM_DPRINTF(("%s: mspecial=%s for menu_root=%s\n",
8509 BAM_DPRINTF(("%s: FIXED ospecial=%s for osroot=%s\n",
8521 BAM_DPRINTF(("%s: returning SUCCESS\n", fcn));
8523 BAM_DPRINTF(("%s: returning FAILURE\n", fcn));
8550 BAM_DPRINTF(("%s: entered. args: %s %s %s\n", fcn, menu_root, osdev,
8561 bam_error(_("failed to get grubsign for root: %s, device %s\n"),
8574 BAM_DPRINTF(("%s: get_grubroot success. osroot=%s, osdev=%s, "
8575 "menu_root=%s\n", fcn, osroot, osdev, menu_root));
8577 BAM_DPRINTF(("%s: get_grubroot failed. osroot=%s, osdev=%s, "
8578 "menu_root=%s\n", fcn, osroot, osdev, menu_root));
8589 BAM_DPRINTF(("%s: updated boot entry bam_zfs=%d, "
8590 "grubsign = %s\n", fcn, bam_zfs, grubsign));
8597 BAM_DPRINTF(("%s: updated HV entry bam_zfs=%d, "
8598 "grubsign = %s\n", fcn, bam_zfs, grubsign));
8605 BAM_DPRINTF(("%s: updated MULTIBOOT entry grubsign = %s\n",
8613 (void) snprintf(failsafe, sizeof (failsafe), "%s%s",
8615 (void) snprintf(failsafe_64, sizeof (failsafe_64), "%s%s",
8627 (void) snprintf(failsafe, sizeof (failsafe), "%s%s", osroot,
8629 (void) snprintf(failsafe_64, sizeof (failsafe_64), "%s%s",
8635 (void) snprintf(failsafe, sizeof (failsafe), "%s%s",
8645 BAM_DPRINTF(("%s: updated FAILSAFE entry "
8646 "failsafe_kernel = %s\n", fcn, failsafe_kernel));
8653 bam_error(_("failed to add boot entry with title=%s, grub "
8654 "signature=%s\n"), title, grubsign);
8666 BAM_DPRINTF(("%s: returning SUCCESS\n", fcn));
8691 (void) snprintf(linebuf, sizeof (linebuf), "#%s%d", which, entry);
8692 BAM_DPRINTF(("%s: saving default to: %s\n", fcn, linebuf));
8694 BAM_DPRINTF(("%s: saved default to lineNum=%d, entryNum=%d\n", fcn,
8706 BAM_DPRINTF(("%s: NULL saved default\n", fcn));
8710 BAM_DPRINTF(("%s: saved default string: %s\n", fcn, which));
8716 BAM_DPRINTF(("%s: restored default to entryNum: %d\n", fcn, entry));
8755 BAM_DPRINTF(("%s: entered. arg: %s\n", fcn, opt ? opt : "<NULL>"));
8756 BAM_DPRINTF(("%s: bam_alt_root: %d, bam_root: %s\n", fcn,
8762 bam_error(_("an alternate root (%s) cannot be used with this "
8770 BAM_DPRINTF(("%s: opt is NULL\n", fcn));
8774 BAM_DPRINTF(("%s: transient entry not found\n", fcn));
8780 BAM_DPRINTF(("%s: restored old default\n", fcn));
8781 BAM_DPRINTF(("%s: returning SUCCESS\n", fcn));
8788 BAM_DPRINTF(("%s: opt has entry=: %s\n", fcn, opt));
8792 BAM_DPRINTF(("%s: default set to %d, "
8856 /* It's an option - first see if boot-file is set */
8878 BAM_DPRINTF(("%s: reboot with args, option specified: "
8879 "kern=%s\n", fcn, kernbuf));
8881 /* It's a full path, so write it out. */
8895 * we don't need to mess with boot-args. If there's
8916 BAM_DPRINTF(("%s: reboot with args, abspath specified: "
8917 "kern=%s\n", fcn, kernbuf));
8964 BAM_DPRINTF(("%s: resolved partial path: %s\n",
8968 bam_error(_("unable to expand %s to a full file"
8992 BAM_DPRINTF(("%s: returning SUCCESS\n", fcn));
9017 bam_error(_("invalid boot entry number: %s\n"), prefix);
9037 BAM_DPRINTF(("%s: found matching global command: %s\n",
9041 bam_error(_("duplicate command %s at line %d of "
9064 (void) snprintf(lp->line, len, "%s%s%d",
9066 BAM_DPRINTF(("%s: wrote new global line: %s\n", fcn, lp->line));
9067 BAM_DPRINTF(("%s: returning SUCCESS\n", fcn));
9087 "%s%s%s%d", prefix, globalcmd, menu_cmds[SEP_CMD], val);
9089 BAM_DPRINTF(("%s: replaced global line with: %s\n", fcn, found->line));
9090 BAM_DPRINTF(("%s: returning SUCCESS\n", fcn));
9112 (void) snprintf(new_path, new_path_len, "/platform/i86pc/%s",
9115 BAM_DPRINTF(("%s: expanded path: %s\n", fcn, new_path));
9120 (void) snprintf(new_path, new_path_len, "%s -k",
9122 BAM_DPRINTF(("%s: expanded path: %s\n", fcn, new_path));
9130 (void) snprintf(new_path, new_path_len, "/platform/i86pc/%s/unix",
9132 (void) snprintf(new_path2, PATH_MAX, "/platform/i86pc/%s/amd64/unix",
9141 "/platform/i86pc/kernel/%s/$ISADIR/unix",
9144 BAM_DPRINTF(("%s: expanded path: %s\n", fcn, new_path));
9149 BAM_DPRINTF(("%s: returning FAILURE\n", fcn));
9173 BAM_DPRINTF(("%s: no module/archive line for entry: "
9180 BAM_DPRINTF(("%s: no module/archive line for entry: %d\n",
9197 BAM_DPRINTF(("%s: no change for line: %s\n", fcn, lp->arg));
9209 BAM_DPRINTF(("%s: replaced for line: %s\n", fcn, lp->line));
9261 bam_error(_("bootadm set-menu %s may only be run on "
9312 BAM_DPRINTF(("%s: no RC entry, nothing to report\n",
9314 BAM_DPRINTF(("%s: returning SUCCESS\n", fcn));
9321 BAM_DPRINTF(("%s: read menu boot-args: %s\n",
9328 * We don't print anything if it's the default kernel.
9334 BAM_DPRINTF(("%s: read menu boot-file: %s\n",
9339 BAM_DPRINTF(("%s: returning SUCCESS\n", fcn));
9350 /* No previous entry, it's already the default */
9351 BAM_DPRINTF(("%s: no reset, already has default\n",
9373 BAM_DPRINTF(("%s: resetting to default\n", fcn));
9386 (void) snprintf(new_arg, new_str_len, "%s %s",
9396 BAM_DPRINTF(("%s: reset kernel to default, but "
9397 "retained old args: %s\n", fcn, kernelp->arg));
9405 (void) snprintf(new_arg, old_kernel_len + 1, "%s",
9409 BAM_DPRINTF(("%s: reset args to default, but retained "
9410 "old kernel: %s\n", fcn, kernelp->arg));
9422 bam_error(_("unable to expand %s to a full file "
9424 BAM_DPRINTF(("%s: returning FAILURE\n", fcn));
9485 (void) snprintf(new_arg, new_str_len, "%s %s",
9487 BAM_DPRINTF(("%s: new kernel=%s\n", fcn,
9493 BAM_DPRINTF(("%s: new kernel=%s\n", fcn,
9503 (void) snprintf(new_arg, new_str_len, "%s %s",
9508 (void) snprintf(new_arg, new_str_len, "%s %s",
9512 BAM_DPRINTF(("%s: new args=%s\n", fcn, new_arg));
9521 bam_error(_("failed to add boot entry: %s\n"),
9543 (void) snprintf(new_arg, new_str_len, "%s %s", new_path,
9553 BAM_DPRINTF(("%s: rc line exists, replaced kernel, same "
9554 "args: %s\n", fcn, kernelp->arg));
9563 BAM_DPRINTF(("%s: rc line exists, same kernel, but new "
9564 "args: %s\n", fcn, kernelp->arg));
9574 BAM_DPRINTF(("%s: returning SUCCESS\n", fcn));
9576 BAM_DPRINTF(("%s: returning FAILURE\n", fcn));
9585 BAM_DPRINTF(("%s: entered. arg: %s\n", fcn, menu_cmds[optnum]));
9594 BAM_DPRINTF(("%s: entered. args: %s %s\n", fcn,
9615 BAM_DPRINTF(("%s: entered. arg: %s\n", fcn, opt));
9631 bam_error(_("invalid option: %s\n"), opt);
9640 bam_error(_("option has no argument: %s\n"), opt);
9647 BAM_DPRINTF(("%s: setting %s option to %s\n",
9655 (void) printf("%s\n", buf);
9658 BAM_DPRINTF(("%s: setting %s option to %s\n", fcn,
9664 BAM_DPRINTF(("%s: returning SUCCESS\n", fcn));
9666 BAM_DPRINTF(("%s: returning FAILURE\n", fcn));
9689 bam_error(_("menu file not found: %s\n"), menu_path);
9710 bam_error(_("duplicate command %s at line %d of "
9717 bam_print(_("%s %s\n"), globalcmd, arg);
9722 bam_print(_("no %s entry found\n"), globalcmd);
9732 BAM_DPRINTF(("%s: entered menu_write() for root: <%s>\n", fcn, root));
9815 bam_error(_("path is not absolute: %s\n"), cmdline);
9827 bam_error(_("cannot unblock SIGCHLD: %s\n"), strerror(errno));
9836 bam_error(_("cannot set SIGCHLD disposition: %s\n"),
9841 bam_error(_("SIGCHLD signal blocked. Cannot exec: %s\n"),
9848 bam_error(_("popen failed: %s: %s\n"), cmdline,
9872 bam_print(_("%s\n"), buf);
9880 bam_error(_("pclose failed: %s: %s\n"), cmdline,
9888 bam_error(_("command terminated abnormally: %s: %d\n"),
9926 (void) snprintf(linebuf, sizeof (linebuf), "%s\n", str);
9943 "(> %d chars)\n\t%s\n"), buflen - 1, buf);
10073 append_to_flist(filelist_t *flistp, char *s)
10078 lp->line = s_strdup(s);
10104 (void) snprintf(file, PATH_MAX, "%s/%s/%s-ucode.%s",
10111 (void) snprintf(timestamp, PATH_MAX, "%s.ts", file);
10118 "%s/%s/%s %s > /dev/null 2>&1", bam_root,