2004-12-03 00:29:29 +00:00
|
|
|
/*
|
|
|
|
*
|
|
|
|
* (c) 2004 Laurent Vivier <LaurentVivier@wanadoo.fr>
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <sys/types.h>
|
|
|
|
#include <sys/stat.h>
|
|
|
|
#include <fcntl.h>
|
|
|
|
#include <errno.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <unistd.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
2004-12-10 00:28:35 +00:00
|
|
|
#include "libemile.h"
|
2004-12-07 00:39:39 +00:00
|
|
|
|
|
|
|
int main(int argc, char **argv)
|
|
|
|
{
|
|
|
|
int fd;
|
|
|
|
short id;
|
|
|
|
int ret;
|
|
|
|
|
|
|
|
fd = open(argv[1], O_RDWR);
|
|
|
|
if (fd == -1)
|
|
|
|
{
|
|
|
|
perror("Cannot open second stage");
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
ret = read(fd, &id, 2);
|
|
|
|
lseek(fd, 0, SEEK_SET);
|
|
|
|
if ( (ret == 2) && (id == 0x4C4B) )
|
2004-12-10 00:28:35 +00:00
|
|
|
emile_first_set_param_scsi(fd, argv[2]);
|
2004-12-07 00:39:39 +00:00
|
|
|
else
|
2004-12-10 00:28:35 +00:00
|
|
|
emile_second_set_kernel_scsi(fd, argv[2]);
|
2004-12-03 00:29:29 +00:00
|
|
|
|
|
|
|
|
|
|
|
close(fd);
|
|
|
|
return 0;
|
|
|
|
}
|