From 7d1a3d82cc8d0cb82d206010b0944a86e575f617 Mon Sep 17 00:00:00 2001 From: Pete Batard Date: Tue, 4 Feb 2014 20:01:28 +0000 Subject: [PATCH] [syslinux] improve handling of 4.x C32 files * Download the files from files/syslinux-4.07 on the server * Save local copy in rufus_files/syslinux-4.07 * Move menu.c32/vesamenu.c32 check to BootCheck() --- src/iso.c | 13 ++++-- src/rufus.c | 128 ++++++++++++++++++++++++++++----------------------- src/rufus.h | 1 - src/rufus.rc | 12 ++--- 4 files changed, 84 insertions(+), 70 deletions(-) diff --git a/src/iso.c b/src/iso.c index 246b0fd4..acd89e2a 100644 --- a/src/iso.c +++ b/src/iso.c @@ -69,7 +69,7 @@ static const char* pe_dirname[] = { "/i386", "/minint" }; static const char* pe_file[] = { "ntdetect.com", "setupldr.bin", "txtsetup.sif" }; static const char* reactos_name = "setupldr.sys"; // TODO: freeldr.sys doesn't seem to work static const char* autorun_name = "autorun.inf"; -static const char* old_c32_name[NB_OLD_C32] = OLD_C32_NAMES; +const char* old_c32_name[NB_OLD_C32] = OLD_C32_NAMES; static const int64_t old_c32_threshold[NB_OLD_C32] = OLD_C32_THRESHOLD; static uint8_t i_joliet_level = 0; static uint64_t total_blocks, nb_blocks; @@ -218,7 +218,7 @@ static int udf_extract_files(udf_t *p_udf, udf_dirent_t *p_udf_dirent, const cha BOOL r, is_syslinux_cfg, is_old_c32[NB_OLD_C32]; int i_length; size_t i, nul_pos; - char* psz_fullpath = NULL; + char tmp[128], *psz_fullpath = NULL; const char* psz_basename; udf_dirent_t *p_udf_dirent2; uint8_t buf[UDF_BLOCKSIZE]; @@ -266,7 +266,8 @@ static int udf_extract_files(udf_t *p_udf, udf_dirent_t *p_udf_dirent, const cha psz_fullpath[nul_pos] = 0; for (i=0; i= 5) && (iso_report.sl_version != embedded_sl_version[1])) { - // Unlike what was the case for v4 and earlier, Syslinux v5+ versions are INCOMPATIBLE with one another! - IGNORE_RETVAL(_chdirU(app_dir)); - IGNORE_RETVAL(_mkdir(FILES_DIR)); - IGNORE_RETVAL(_chdir(FILES_DIR)); - for (i=0; i<2; i++) { - // Check if we already have the relevant ldlinux_v#.##.sys & ldlinux_v#.##.bss files - static_sprintf(tmp, "%s-%s/%s.%s", syslinux, iso_report.sl_version_str, ldlinux, ldlinux_ext[i]); - fd = fopen(tmp, "rb"); - if (fd != NULL) { - fseek(fd, 0, SEEK_END); - syslinux_ldlinux_len[i] = (DWORD)ftell(fd); - fclose(fd); + + if (HAS_SYSLINUX(iso_report)) { + if (SL_MAJOR(iso_report.sl_version) < 5) { + IGNORE_RETVAL(_chdirU(app_dir)); + for (i=0; i