Print this page
5377 bootadm update-archive misidentifies BEs as ramdisks

Split Close
Expand all
Collapse all
          --- old/usr/src/cmd/boot/bootadm/bootadm.c
          +++ new/usr/src/cmd/boot/bootadm/bootadm.c
↓ open down ↓ 16 lines elided ↑ open up ↑
  17   17   * information: Portions Copyright [yyyy] [name of copyright owner]
  18   18   *
  19   19   * CDDL HEADER END
  20   20   */
  21   21  /*
  22   22   * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
  23   23   * Copyright 2012 Milan Jurik. All rights reserved.
  24   24   */
  25   25  
  26   26  /*
  27      - * Copyright 2011 Nexenta Systems, Inc. All rights reserved.
       27 + * Copyright 2014 Nexenta Systems, Inc. All rights reserved.
  28   28   */
  29   29  
  30   30  /*
  31   31   * bootadm(1M) is a new utility for managing bootability of
  32   32   * Solaris *Newboot* environments. It has two primary tasks:
  33   33   *      - Allow end users to manage bootability of Newboot Solaris instances
  34   34   *      - Provide services to other subsystems in Solaris (primarily Install)
  35   35   */
  36   36  
  37   37  /* Headers */
↓ open down ↓ 76 lines elided ↑ open up ↑
 114  114  
 115  115  #define LINE_INIT       0       /* lineNum initial value */
 116  116  #define ENTRY_INIT      -1      /* entryNum initial value */
 117  117  #define ALL_ENTRIES     -2      /* selects all boot entries */
 118  118  
 119  119  #define GRUB_DIR                "/boot/grub"
 120  120  #define GRUB_STAGE2             GRUB_DIR "/stage2"
 121  121  #define GRUB_MENU               "/boot/grub/menu.lst"
 122  122  #define MENU_TMP                "/boot/grub/menu.lst.tmp"
 123  123  #define GRUB_BACKUP_MENU        "/etc/lu/GRUB_backup_menu"
 124      -#define RAMDISK_SPECIAL         "/ramdisk"
      124 +#define RAMDISK_SPECIAL         "/dev/ramdisk/"
 125  125  #define STUBBOOT                "/stubboot"
 126  126  #define MULTIBOOT               "/platform/i86pc/multiboot"
 127  127  #define GRUBSIGN_DIR            "/boot/grub/bootsign"
 128  128  #define GRUBSIGN_BACKUP         "/etc/bootsign"
 129  129  #define GRUBSIGN_UFS_PREFIX     "rootfs"
 130  130  #define GRUBSIGN_ZFS_PREFIX     "pool_"
 131  131  #define GRUBSIGN_LU_PREFIX      "BE_"
 132  132  #define UFS_SIGNATURE_LIST      "/var/run/grub_ufs_signatures"
 133  133  #define ZFS_LEGACY_MNTPT        "/tmp/bootadm_mnt_zfs_legacy"
 134  134  
↓ open down ↓ 3324 lines elided ↑ open up ↑
3459 3459                  }
3460 3460          }
3461 3461  
3462 3462          if (!found) {
3463 3463                  if (bam_verbose)
3464 3464                          bam_error(NOT_IN_MNTTAB, mntpt);
3465 3465                  (void) fclose(fp);
3466 3466                  return (0);
3467 3467          }
3468 3468  
3469      -        if (strstr(mnt.mnt_special, RAMDISK_SPECIAL) != NULL) {
     3469 +        if (strncmp(mnt.mnt_special, RAMDISK_SPECIAL,
     3470 +            strlen(RAMDISK_SPECIAL)) == 0) {
3470 3471                  if (bam_verbose)
3471 3472                          bam_error(IS_RAMDISK, bam_root);
3472 3473                  (void) fclose(fp);
3473 3474                  return (1);
3474 3475          }
3475 3476  
3476 3477          (void) fclose(fp);
3477 3478  
3478 3479          return (0);
3479 3480  }
↓ open down ↓ 6194 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX