commit f0c905f3939e094f7f6971dd84cef14f692b0d92 Author: Leonid Krivoshein Date: Fri Oct 20 18:33:52 2017 +0300 20171020-alt1 - cdrom.c: fixed implicit declaration of function 'opendir' warning. - probing.c: added support for MMC devices when boot in LiveCD-mode. diff --git a/cdrom.c b/cdrom.c index 6c60730..ba1ae8b 100644 --- a/cdrom.c +++ b/cdrom.c @@ -27,6 +27,8 @@ #include #include #include +#include + #include "stage1.h" #include "frontend.h" #include "modules.h" diff --git a/probing.c b/probing.c index 56d1375..b5f2ecd 100644 --- a/probing.c +++ b/probing.c @@ -149,7 +149,7 @@ static void find_media(void) while ((dirent = readdir(dir)) != NULL) { if (!strcmp(dirent->d_name, ".") || !strcmp(dirent->d_name, "..")) continue; - + memset(path, 0, SYSFS_PATH_MAX); strcpy(path, "/sys/block/"); strcat(path, dirent->d_name); @@ -161,11 +161,15 @@ static void find_media(void) tmp[count].name = strdup(dirent->d_name); tmp[count].type = UNKNOWN_MEDIA; if ((f = fopen(path, "r")) != NULL) { - int type; - if (fgets(buf, sizeof(buf), f) && sscanf(buf, "%d", &type)) { - if (type == SCSI_TYPE_DISK) tmp[count].type = DISK; - else if (type == SCSI_TYPE_ROM) tmp[count].type = CDROM; - else if (type == SCSI_TYPE_TAPE) tmp[count].type = TAPE; + int type = SCSI_TYPE_DISK; + if (fgets(buf, sizeof(buf), f) > 0) { + if (strncmp(buf, "MMC", 3) == 0) + tmp[count].type = DISK; + else if (sscanf(buf, "%d", &type) > 0) { + if (type == SCSI_TYPE_DISK) tmp[count].type = DISK; + else if (type == SCSI_TYPE_ROM) tmp[count].type = CDROM; + else if (type == SCSI_TYPE_TAPE) tmp[count].type = TAPE; + } } fclose(f); } diff --git a/propagator.spec b/propagator.spec index cb34b2e..103e759 100644 --- a/propagator.spec +++ b/propagator.spec @@ -2,7 +2,7 @@ %def_with splash Name: propagator -Version: 20170511 +Version: 20171020 Release: alt1 Summary: 'Early userspace' set of binaries @@ -37,6 +37,10 @@ including init and various helpers for hw probing and bootstrapping. %_sbindir/propagator %changelog +* Fri Oct 20 2017 Leonid Krivoshein 20171020-alt1 +- cdrom.c: fixed implicit declaration of function 'opendir' warning. +- probing.c: added support for MMC devices when boot in LiveCD-mode. + * Thu May 11 2017 Gleb F-Malinovskiy 20170511-alt1 - Fixed errors found by cppcheck.