mirror of
https://github.com/vivier/EMILE.git
synced 2025-01-03 12:31:57 +00:00
moved to emile-map-set.c
This commit is contained in:
parent
e893a1c9ba
commit
c43e184cff
@ -1,49 +0,0 @@
|
||||
/*
|
||||
*
|
||||
* (c) 2004 Laurent Vivier <LaurentVivier@wanadoo.fr>
|
||||
*
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#include "libemile.h"
|
||||
|
||||
static void usage(int argc, char** argv)
|
||||
{
|
||||
fprintf(stderr, "Usage: %s <partition>\n", argv[0]);
|
||||
fprintf(stderr, "\n Set startup partition\n");
|
||||
fprintf(stderr, "\nbuild: \n%s\n", SIGNATURE);
|
||||
}
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
int ret;
|
||||
int disk;
|
||||
int partition;
|
||||
char disk_name[16];
|
||||
|
||||
if (argc != 2)
|
||||
{
|
||||
usage(argc, argv);
|
||||
return 1;
|
||||
}
|
||||
|
||||
ret = emile_scsi_get_rdev(argv[1], &disk, &partition);
|
||||
if (ret == -1)
|
||||
{
|
||||
fprintf(stderr, "ERROR: cannot find disk of %s\n", argv[1]);
|
||||
return 1;
|
||||
}
|
||||
|
||||
sprintf(disk_name, "/dev/sd%c", 'a' + disk);
|
||||
|
||||
printf("Setting startup partition : %s%d\n", disk_name, partition);
|
||||
|
||||
ret = emile_map_set_startup(disk_name, partition - 1);
|
||||
if (ret == -1) {
|
||||
fprintf(stderr, "ERROR: cannot set startup partition\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
Loading…
Reference in New Issue
Block a user