cdrom: primarily try mount first partition of hybrid image

This commit is contained in:
Led 2013-03-15 20:13:28 +02:00
parent 467eace834
commit 4d66f07d59

17
cdrom.c
View File

@ -26,6 +26,8 @@
#include <string.h>
#include <stdio.h>
#include <sys/mount.h>
#include <dirent.h>
#include <ctype.h>
#include "stage1.h"
#include "frontend.h"
#include "modules.h"
@ -39,10 +41,19 @@ extern char version[];
static int mount_that_cd_device(char * dev_name)
{
char device_fullname[50];
char device_fullname[64] = "/dev/";
size_t l = strlen(strcpy(device_fullname + 5, dev_name));
strcpy(device_fullname, "/dev/");
strcat(device_fullname, dev_name);
if (islower(device_fullname[l - 1])) {
int ret;
device_fullname[l] = '1';
device_fullname[l + 1] = '\0';
ret = my_mount(device_fullname, IMAGE_LOCATION, "iso9660", 0);
if (ret != -1)
return ret;
device_fullname[l] = '\0';
}
return my_mount(device_fullname, IMAGE_LOCATION, "iso9660", 0);
}