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

@@ -22,11 +22,11 @@
  * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2012 Milan Jurik. All rights reserved.
  */
 
 /*
- * Copyright 2011 Nexenta Systems, Inc. All rights reserved.
+ * Copyright 2014 Nexenta Systems, Inc. All rights reserved.
  */
 
 /*
  * bootadm(1M) is a new utility for managing bootability of
  * Solaris *Newboot* environments. It has two primary tasks:

@@ -119,11 +119,11 @@
 #define GRUB_DIR                "/boot/grub"
 #define GRUB_STAGE2             GRUB_DIR "/stage2"
 #define GRUB_MENU               "/boot/grub/menu.lst"
 #define MENU_TMP                "/boot/grub/menu.lst.tmp"
 #define GRUB_BACKUP_MENU        "/etc/lu/GRUB_backup_menu"
-#define RAMDISK_SPECIAL         "/ramdisk"
+#define RAMDISK_SPECIAL         "/dev/ramdisk/"
 #define STUBBOOT                "/stubboot"
 #define MULTIBOOT               "/platform/i86pc/multiboot"
 #define GRUBSIGN_DIR            "/boot/grub/bootsign"
 #define GRUBSIGN_BACKUP         "/etc/bootsign"
 #define GRUBSIGN_UFS_PREFIX     "rootfs"

@@ -3464,11 +3464,12 @@
                         bam_error(NOT_IN_MNTTAB, mntpt);
                 (void) fclose(fp);
                 return (0);
         }
 
-        if (strstr(mnt.mnt_special, RAMDISK_SPECIAL) != NULL) {
+        if (strncmp(mnt.mnt_special, RAMDISK_SPECIAL,
+            strlen(RAMDISK_SPECIAL)) == 0) {
                 if (bam_verbose)
                         bam_error(IS_RAMDISK, bam_root);
                 (void) fclose(fp);
                 return (1);
         }