summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorErwan Velu <erwan.velu@free.fr>2009-04-13 20:19:50 (GMT)
committerErwan Velu <erwan.velu@free.fr>2009-04-13 20:19:50 (GMT)
commit6528356ce321942cf2d1060f84f4fc5f73408249 (patch)
tree9e7f639cb498b073f2701056408d13474e1e28a7
parent14c97cc5f8f32fb6b8642cb31f4f2d9ca4af6b65 (diff)
downloadhdt-6528356ce321942cf2d1060f84f4fc5f73408249.zip
hdt-6528356ce321942cf2d1060f84f4fc5f73408249.tar.gz
hdt-6528356ce321942cf2d1060f84f4fc5f73408249.tar.bz2
hdt-6528356ce321942cf2d1060f84f4fc5f73408249.tar.xz
hdt: Shortening extension when using ISOLINUX
Impact: When using ISOLINUX, we have to shorten the extension Shortening extension when using ISOLINUX. i.e: modules.pcimap is convertd to modules.pci
-rw-r--r--com32/hdt/hdt-common.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/com32/hdt/hdt-common.c b/com32/hdt/hdt-common.c
index d02533c..83dcfc2 100644
--- a/com32/hdt/hdt-common.c
+++ b/com32/hdt/hdt-common.c
@@ -35,6 +35,22 @@
#include "hdt-common.h"
#include "lib-ansi.h"
+/* ISOlinux requires a 8.3 format */
+void convert_isolinux_filename(char *filename, struct s_hardware *hardware) {
+ /* Exit if we are not running ISOLINUX */
+ if (hardware->sv->filesystem != SYSLINUX_FS_ISOLINUX) return;
+ /* Searching the dot */
+ char *dot=strchr(filename,'.');
+ /* Exiting if not dot exists in that string */
+ if (dot==NULL) return;
+ /* Exiting if the extension is 3 char or less */
+ if (strlen(dot)<=4) return;
+
+ /* We have an extension bigger than .blah
+ * so we have to shorten it to 3*/
+ dot[4]='\0';
+}
+
void detect_parameters(const int argc, const char *argv[],
struct s_hardware *hardware)
{
@@ -42,12 +58,15 @@ void detect_parameters(const int argc, const char *argv[],
if (!strncmp(argv[i], "modules=", 8)) {
strncpy(hardware->modules_pcimap_path, argv[i] + 8,
sizeof(hardware->modules_pcimap_path));
+ convert_isolinux_filename(hardware->modules_pcimap_path,hardware);
} else if (!strncmp(argv[i], "pciids=", 7)) {
strncpy(hardware->pciids_path, argv[i] + 7,
sizeof(hardware->pciids_path));
+ convert_isolinux_filename(hardware->pciids_path,hardware);
} else if (!strncmp(argv[i], "memtest=", 8)) {
strncpy(hardware->memtest_label, argv[i] + 8,
sizeof(hardware->memtest_label));
+ convert_isolinux_filename(hardware->memtest_label,hardware);
}
}
}