/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#include <stdio.h>
#include <string.h>
#include <fcntl.h>
#include <libgen.h>
#include <stdlib.h>
#include <strings.h>
#include <unistd.h>
static void
{
exit(-1);
}
int
{
char *device;
switch (c) {
case 'd':
list_hd = 1;
continue;
case 'n':
setnew = 1;
continue;
case 'o':
setold = 1;
continue;
case 'r':
write_mboot = 1;
continue;
default:
}
}
/* check arguments */
}
}
if (!mboot_file) {
}
if (fd == -1)
perror("open");
else
perror("read");
exit(-1);
}
if (!device) {
}
if (fd == -1)
perror("open");
else
perror("read");
exit(-1);
}
for (i = 0; i < FD_NUMPART; i++) {
if (!list_hd) {
printf("active ");
else
printf(" ");
}
sol_part = i;
sol_part = i;
} else if (list_hd &&
sol_part = i;
}
if (!list_hd)
printf("%d (0x%2x): start_sect %u, size_sect %u\n",
}
if (list_hd) {
return (0);
}
/* write new mboot */
if (write_mboot) {
/* copy over the new boot program */
}
perror("failed to update MBR");
exit(-1);
}
if (sol_part != -1) {
if (setnew)
printf("from 0x82 to 0xbf\n");
else
printf("from 0xbf to 0x82\n");
}
if (write_mboot) {
}
}
return (0);
}