Index: /branches/rel_apv_10_7_3/usr/click/bin/Makefile
===================================================================
--- /branches/rel_apv_10_7_3/usr/click/bin/Makefile	(revision 39490)
+++ /branches/rel_apv_10_7_3/usr/click/bin/Makefile	(working copy)
@@ -67,7 +67,6 @@
 	system_monitor \
 	dhcp \
 	http_filter_d \
-	boot0cfg \
 	encode_lickey \
 	encode_wr_lickey \
 	saml \
@@ -141,7 +140,6 @@
 	system_monitor \
 	dhcp \
 	http_filter_d \
-	boot0cfg \
 	encode_lickey \
 	encode_wr_lickey \
 	saml \
Index: /branches/rel_apv_10_7_3/usr/click/bin/boot0cfg/Makefile
===================================================================
--- /branches/rel_apv_10_7_3/usr/click/bin/boot0cfg/Makefile	(revision 39490)
+++ /branches/rel_apv_10_7_3/usr/click/bin/boot0cfg/Makefile	(nonexistent)
@@ -1,6 +0,0 @@
-# ArrayOS
-NO_MAN=
-PROG=	boot0cfg
-SRCS=	boot0cfg.c
-
-.include <bsd.prog.mk>
Index: /branches/rel_apv_10_7_3/usr/click/bin/boot0cfg/boot0cfg.c
===================================================================
--- /branches/rel_apv_10_7_3/usr/click/bin/boot0cfg/boot0cfg.c	(revision 39490)
+++ /branches/rel_apv_10_7_3/usr/click/bin/boot0cfg/boot0cfg.c	(nonexistent)
@@ -1,405 +0,0 @@
-/*
- * Copyright (c) 2008 Luigi Rizzo
- * Copyright (c) 1999 Robert Nordier
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
- * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
- * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
- * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
- * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <sys/cdefs.h>
-
-#include <sys/param.h>
-#include <sys/stat.h>
-
-#include <err.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <paths.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-
-#define MBRSIZE         512     /* master boot record size */
-
-#define OFF_VERSION	0x1b0	/* offset: version number, only boot0version */
-#define OFF_SERIAL	0x1b8	/* offset: volume serial number */
-#define OFF_PTBL        0x1be   /* offset: partition table */
-#define OFF_MAGIC       0x1fe   /* offset: magic number */
-/*
- * Offsets to the parameters of the 512-byte boot block.
- * For historical reasons they are set as macros
- */
-struct opt_offsets {
-	int opt;
-	int drive;
-	int flags;
-	int ticks;
-};
-
-static struct opt_offsets b0_ofs[] = {
-	{ 0x0, 0x0, 0x0, 0x0 },		/* no boot block */
-	{ 0x1b9, 0x1ba, 0x1bb, 0x1bc },	/* original block */
-	{ 0x1b5, 0x1b6, 0x1b7, 0x1bc },	/* NT_SERIAL block */
-};
-
-static int b0_ver;	/* boot block version set by boot0bs */
-
-#define OFF_OPT		(b0_ofs[b0_ver].opt)	/* default boot option */
-#define OFF_DRIVE	(b0_ofs[b0_ver].drive)	/* setdrv drive */
-#define OFF_FLAGS       (b0_ofs[b0_ver].flags)	/* option flags */
-#define OFF_TICKS       (b0_ofs[b0_ver].ticks)	/* clock ticks */
-
-
-#define cv2(p)  ((p)[0] | (p)[1] << 010)
-
-#define mk2(p, x)                               \
-    (p)[0] = (u_int8_t)(x),                     \
-    (p)[1] = (u_int8_t)((x) >> 010)
-
-static const struct {
-    const char *tok;
-    int def;
-} opttbl[] = {
-    {"packet", 0},
-    {"update", 1},
-    {"setdrv", 0}
-};
-static const int nopt = sizeof(opttbl) / sizeof(opttbl[0]);
-
-static const char fmt0[] = "#   flag     start chs   type"
-    "       end chs       offset         size\n";
-
-static const char fmt1[] = "%d   0x%02x   %4u:%3u:%2u   0x%02x"
-    "   %4u:%3u:%2u   %10u   %10u\n";
-
-/* START copy from sys/diskmbr.h */
-struct dos_partition {
-	unsigned char	dp_flag;	/* bootstrap flags */
-	unsigned char	dp_shd;		/* starting head */
-	unsigned char	dp_ssect;	/* starting sector */
-	unsigned char	dp_scyl;	/* starting cylinder */
-	unsigned char	dp_typ;		/* partition type */
-	unsigned char	dp_ehd;		/* end head */
-	unsigned char	dp_esect;	/* end sector */
-	unsigned char	dp_ecyl;	/* end cylinder */
-	u_int32_t	dp_start;	/* absolute starting sector number */
-	u_int32_t	dp_size;	/* partition size in sectors */
-};
-
-#define	DOSPARTOFF	446
-#define	NDOSPART	4
-/* END copy from sys/diskmbr.h */
-
-static int read_mbr(const char *, u_int8_t **, int);
-static void write_mbr(const char *, int, u_int8_t *, int);
-static void display_mbr(u_int8_t *);
-static int boot0version(const u_int8_t *);
-static int boot0bs(const u_int8_t *);
-static int argtoi(const char *, int, int, int);
-static void usage(void);
-
-static int v_flag;
-/*
- * Boot manager installation/configuration utility.
- */
-int
-main(int argc, char *argv[])
-{
-    u_int8_t *mbr;
-    int mbr_size;
-    char *disk;
-    int s_arg = -1;
-    int up, c;
-
-    while ((c = getopt(argc, argv, "vs:")) != -1)
-        switch (c) {
-        case 'v':
-            v_flag = 1;
-            break;
-        case 's':
-	    s_arg = argtoi(optarg, 1, 6, 's');
-            break;
-        default:
-            usage();
-        }
-    argc -= optind;
-    argv += optind;
-    if (argc != 1)
-        usage();
-    disk = *argv;
-    up = (s_arg != -1);
-
-    /* open the disk and read in the existing mbr.
-     */
-    mbr_size = read_mbr(disk, &mbr, 0);
-
-    /* set the default boot selection */
-    if (s_arg != -1)
-        mbr[OFF_OPT] = s_arg - 1;
-
-    /* write the MBR back to disk */
-    if (up)
-	write_mbr(disk, 0, mbr, mbr_size);
-
-    /* display the MBR */
-    if (v_flag)
-	display_mbr(mbr);
-
-    /* clean up */
-    free(mbr);
-
-    return 0;
-}
-
-/* get or set the 'bell' character to be used in case of errors.
- * Lookup for a certain code sequence, return -1 if not found.
- */
-static int
-set_bell(u_int8_t *mbr, int new_bell, int report)
-{
-    /* lookup sequence: 0x100 means skip, 0x200 means done */
-    static unsigned seq[] =
-		{ 0xb0, 0x100, 0xe8, 0x100, 0x100, 0x30, 0xe4, 0x200 };
-    int ofs, i, c;
-    for (ofs = 0x60; ofs < 0x180; ofs++) { /* search range */
-	if (mbr[ofs] != seq[0])	/* search initial pattern */
-	    continue;
-	for (i=0;; i++) {
-	    if (seq[i] == 0x200) {	/* found */
-		c = mbr[ofs+1];
-		if (!report)
-		    mbr[ofs+1] = c = new_bell;
-		else
-		    printf("  bell=%c (0x%x)",
-			(c >= ' ' && c < 0x7f) ? c : ' ', c);
-		return c;
-	    }
-	    if (seq[i] != 0x100 && seq[i] != mbr[ofs+i])
-		break;
-	}
-    }
-    warn("bell not found");
-    return -1;
-}
-/*
- * Read in the MBR of the disk.  If it is boot0, then use the version to
- * read in all of it if necessary.  Use pointers to return a malloc'd
- * buffer containing the MBR and then return its size.
- */
-static int
-read_mbr(const char *disk, u_int8_t **mbr, int check_version)
-{
-    u_int8_t buf[MBRSIZE];
-    int mbr_size, fd;
-    int ver;
-    ssize_t n;
-
-    if ((fd = open(disk, O_RDONLY)) == -1)
-        err(1, "open %s", disk);
-    if ((n = read(fd, buf, MBRSIZE)) == -1)
-        err(1, "read %s", disk);
-    if (n != MBRSIZE)
-        errx(1, "%s: short read", disk);
-    if (cv2(buf + OFF_MAGIC) != 0xaa55)
-        errx(1, "%s: bad magic", disk);
-
-    if (! (ver = boot0bs(buf))) {
-	if (check_version)
-	    errx(1, "%s: unknown or incompatible boot code", disk);
-    } else if (boot0version(buf) == 0x101) {
-	mbr_size = 1024;
-	if ((*mbr = malloc(mbr_size)) == NULL)
-	    errx(1, "%s: unable to allocate read buffer", disk);
-	if (lseek(fd, 0, SEEK_SET) == -1 ||
-	    (n = read(fd, *mbr, mbr_size)) == -1)
-	    err(1, "%s", disk);
-	if (n != mbr_size)
-	    errx(1, "%s: short read", disk);
-	close(fd);
-	return (mbr_size);
-    }
-    *mbr = malloc(sizeof(buf));
-    memcpy(*mbr, buf, sizeof(buf));
-    close(fd);
-
-    return sizeof(buf);
-}
-
-/*
- * Write out the mbr to the specified file.
- */
-static void
-write_mbr(const char *fname, int flags, u_int8_t *mbr, int mbr_size)
-{
-	ssize_t n;
-	int fd;
-
-	fd = open(fname, O_WRONLY | flags, 0666);
-	if (fd != -1) {
-		n = write(fd, mbr, mbr_size);
-		close(fd);
-		if (n != mbr_size)
-			errx(1, "%s: short write", fname);
-		return;
-	} else {
-		errx(1, "can't write MBR to %s", fname);
-	}
-}
-
-/*
- * Outputs an informative dump of the data in the MBR to stdout.
- */
-static void
-display_mbr(u_int8_t *mbr)
-{
-    struct dos_partition *part;
-    int i, version;
-
-    part = (struct dos_partition *)(mbr + DOSPARTOFF);
-    printf(fmt0);
-    for (i = 0; i < NDOSPART; i++)
-	if (part[i].dp_typ)
-	    printf(fmt1, 1 + i, part[i].dp_flag,
-		part[i].dp_scyl + ((part[i].dp_ssect & 0xc0) << 2),
-		part[i].dp_shd, part[i].dp_ssect & 0x3f, part[i].dp_typ,
-                part[i].dp_ecyl + ((part[i].dp_esect & 0xc0) << 2),
-                part[i].dp_ehd, part[i].dp_esect & 0x3f, part[i].dp_start,
-                part[i].dp_size);
-    printf("\n");
-    version = boot0version(mbr);
-    printf("version=%d.%d  drive=0x%x  mask=0x%x  ticks=%u",
-	version >> 8, version & 0xff, mbr[OFF_DRIVE],
-	mbr[OFF_FLAGS] & 0xf, cv2(mbr + OFF_TICKS));
-    set_bell(mbr, 0, 1);
-    printf("\noptions=");
-    for (i = 0; i < nopt; i++) {
-	if (i)
-	    printf(",");
-	if (!(mbr[OFF_FLAGS] & 1 << (7 - i)) ^ opttbl[i].def)
-	    printf("no");
-	printf("%s", opttbl[i].tok);
-    }
-    printf("\n");
-    if (b0_ver == 2)
-	printf("volume serial ID %02x%02x-%02x%02x\n",
-		mbr[OFF_SERIAL], mbr[OFF_SERIAL+1],
-		mbr[OFF_SERIAL+2], mbr[OFF_SERIAL+3]);
-    printf("default_selection=F%d (", mbr[OFF_OPT] + 1);
-    if (mbr[OFF_OPT] < 4)
-	printf("Slice %d", mbr[OFF_OPT] + 1);
-    else if (mbr[OFF_OPT] == 4)
-	printf("Drive 1");
-    else
-	printf("PXE");
-    printf(")\n");
-}
-
-/*
- * Return the boot0 version with the minor revision in the low byte, and
- * the major revision in the next higher byte.
- */
-static int
-boot0version(const u_int8_t *bs)
-{
-    /* Check for old version, and return 0x100 if found. */
-    int v = boot0bs(bs);
-    if (v != 0)
-        return v << 8;
-
-    /* We have a newer boot0, so extract the version number and return it. */
-    return *(const int *)(bs + OFF_VERSION) & 0xffff;
-}
-
-/* descriptor of a pattern to match.
- * Start from the first entry trying to match the chunk of bytes,
- * if you hit an entry with len=0 terminate the search and report
- * off as the version. Otherwise skip to the next block after len=0
- * An entry with len=0, off=0 is the end marker.
-  */
-struct byte_pattern {
-    unsigned off;
-    unsigned len;
-    u_int8_t *key;
-};
-
-/*
- * Decide if we have valid boot0 boot code by looking for
- * characteristic byte sequences at fixed offsets.
- */
-static int
-boot0bs(const u_int8_t *bs)
-{
-    /* the initial code sequence */
-    static u_int8_t id0[] = {0xfc, 0x31, 0xc0, 0x8e, 0xc0, 0x8e, 0xd8,
-			     0x8e, 0xd0, 0xbc, 0x00, 0x7c };
-    /* the drive id */
-    static u_int8_t id1[] = {'D', 'r', 'i', 'v', 'e', ' '};
-    static struct byte_pattern patterns[] = {
-        {0x0,   sizeof(id0), id0},
-        {0x1b2, sizeof(id1), id1},
-        {1, 0, NULL},
-        {0x0,   sizeof(id0), id0},	/* version with NT support */
-        {0x1ae, sizeof(id1), id1},
-        {2, 0, NULL},
-        {0, 0, NULL},
-    };
-    struct byte_pattern *p = patterns;
-
-    for (;  p->off || p->len; p++) {
-	if (p->len == 0)
-	    break;
-	if (!memcmp(bs + p->off, p->key, p->len))	/* match */
-	    continue;
-	while (p->len)	/* skip to next block */
-	    p++;
-    }
-    b0_ver = p->off;	/* XXX ugly side effect */
-    return p->off;
-}
-
-/*
- * Convert and check an option argument.
- */
-static int
-argtoi(const char *arg, int lo, int hi, int opt)
-{
-    char *s;
-    long x;
-
-    errno = 0;
-    x = strtol(arg, &s, 0);
-    if (errno || !*arg || *s || x < lo || x > hi)
-        errx(1, "%s: Bad argument to -%c option", arg, opt);
-    return x;
-}
-
-/*
- * Display usage information.
- */
-static void
-usage(void)
-{
-    fprintf(stderr, "%s\n",
-    "usage: boot0cfg [-v] [-s slice] disk");
-    exit(1);
-}
Index: /branches/rel_apv_10_7_3/usr/click/etc/grub.cfg.hw
===================================================================
--- /branches/rel_apv_10_7_3/usr/click/etc/grub.cfg.hw	(revision 39490)
+++ /branches/rel_apv_10_7_3/usr/click/etc/grub.cfg.hw	(working copy)
@@ -105,12 +105,6 @@
         set avx_bootcount=0
         if [ ${avx_menuent} == 0 ]; then
                 set avx_menuent=1
-        elif [ ${avx_menuent} == 1 ]; then
-                set avx_menuent=0
-        elif [ ${avx_menuent} == 2 ]; then
-                set avx_menuent=3
-        elif [ ${avx_menuent} == 3 ]; then
-                set avx_menuent=2
         else
                 set avx_menuent=0
         fi
@@ -120,14 +114,8 @@
 
 if [ ${avx_menuent} == 0 ]; then
 set default="0"
-elif [ ${avx_menuent} == 1 ]; then
-set default="1"
-elif [ ${avx_menuent} == 2 ]; then
-set default="2"
-elif [ ${avx_menuent} == 3 ]; then
-set default="3"
 else
-set default="0"
+set default="1"
 fi
 
 set timeout=10
@@ -145,18 +133,19 @@
 	set root='hd0,7'
 	linux16 /vmlinuz root=/dev/sda7 ro crashkernel=auto arraykicker nomodeset xdriver=vesa brokenmodules=ast rhgb quiet LANG=en_US.UTF-8 console=tty0 console=ttyS0,9600n8 iommu=pt intel_iommu=on hugepagesz=$hugepagesz hugepages=$hugepages pcie_acs_override=downstream loglevel=3
 }
-menuentry 'Ustack Slave1' --class centos --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-3.10.0-123.el7.x86_64-advanced-8f32541a-803b-4f4e-8146-780a490d3139' {
-	load_video
-	set gfxpayload=keep
-	set root='hd0,8'
-	linux16 /vmlinuz root=/dev/sda8 ro crashkernel=auto arraykicker nomodeset xdriver=vesa brokenmodules=ast rhgb quiet LANG=en_US.UTF-8 console=tty0 console=ttyS0,9600n8 iommu=pt intel_iommu=on hugepagesz=$hugepagesz hugepages=$hugepages intel_pstate=disable
-}
-menuentry 'Ustack Slave2' --class centos --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-3.10.0-123.el7.x86_64-advanced-8f32541a-803b-4f4e-8146-780a490d3139' {
-	load_video
-	set gfxpayload=keep
-	set root='hd0,9'
-	linux16 /vmlinuz root=/dev/sda9 ro crashkernel=auto arraykicker nomodeset xdriver=vesa brokenmodules=ast rhgb quiet LANG=en_US.UTF-8 console=tty0 console=ttyS0,9600n8 iommu=pt intel_iommu=on hugepagesz=$hugepagesz hugepages=$hugepages intel_pstate=disable
-}
+### TWSD-812, remove unused menuentry in boot menu
+# menuentry 'Ustack Slave1' --class centos --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-3.10.0-123.el7.x86_64-advanced-8f32541a-803b-4f4e-8146-780a490d3139' {
+# 	load_video
+# 	set gfxpayload=keep
+# 	set root='hd0,8'
+# 	linux16 /vmlinuz root=/dev/sda8 ro crashkernel=auto arraykicker nomodeset xdriver=vesa brokenmodules=ast rhgb quiet LANG=en_US.UTF-8 console=tty0 console=ttyS0,9600n8 iommu=pt intel_iommu=on hugepagesz=$hugepagesz hugepages=$hugepages intel_pstate=disable
+# }
+# menuentry 'Ustack Slave2' --class centos --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-3.10.0-123.el7.x86_64-advanced-8f32541a-803b-4f4e-8146-780a490d3139' {
+# 	load_video
+# 	set gfxpayload=keep
+# 	set root='hd0,9'
+# 	linux16 /vmlinuz root=/dev/sda9 ro crashkernel=auto arraykicker nomodeset xdriver=vesa brokenmodules=ast rhgb quiet LANG=en_US.UTF-8 console=tty0 console=ttyS0,9600n8 iommu=pt intel_iommu=on hugepagesz=$hugepagesz hugepages=$hugepages intel_pstate=disable
+# }
 
 ### END /etc/grub.d/10_linux ###
 
Index: /branches/rel_apv_10_7_3/usr/click/lib/libmultiroot_cli/multiroot_cli.c
===================================================================
--- /branches/rel_apv_10_7_3/usr/click/lib/libmultiroot_cli/multiroot_cli.c	(revision 39490)
+++ /branches/rel_apv_10_7_3/usr/click/lib/libmultiroot_cli/multiroot_cli.c	(working copy)
@@ -245,19 +245,3 @@
     sync();
     return 0;
 }
-
-int 
-system_next(int nextboot) {
-	char cmd[] = "/ca/bin/boot0cfg -s x /dev/sda ";
-
-	if (nextboot > 2 || nextboot < 1) {
-		printf("Invalid parameter.\n");
-		return -1;
-	}
-
-	/* assume that all the 10.x golden disk have at least 2 slice, and the slice 1 is 
-	 * FreeBSD, so we can just call "/ca/bin/boot0cfg -s nextboot /dev/sda" */
-	sprintf(cmd, "/ca/bin/boot0cfg -s %d /dev/sda", nextboot);
-	system(cmd);
-	return 0;
-}
Index: /branches/rel_apv_10_7_3/usr/click/lib/libparser/commands.pm
===================================================================
--- /branches/rel_apv_10_7_3/usr/click/lib/libparser/commands.pm	(revision 39490)
+++ /branches/rel_apv_10_7_3/usr/click/lib/libparser/commands.pm	(working copy)
@@ -62372,22 +62372,6 @@
 	},
         {
                 obj_type => "ITEM",
-                name => "slice",
-                menu => "root_system_boot",
-                help_string => "Choose the next boot slice",
-                cmd_attribute => "CMD_ARRAYOS|CMD_NORMAL",
-                user_level => "CLI_LEVEL_ENGINEER",
-                function_name => "system_next",
-		function_args => [
-		{
-			type => "U32",
-			help_string => "Choose the slice to boot up next time. The value is 1 or 2.",
-			optional => "NO",
-		},
-		],
-        },
-        {
-                obj_type => "ITEM",
                 name => "avx",
                 menu => "root_system_boot",
                 help_string => "Choose the next boot AVX",
