From 32c51e05eb961f3d2b55ebdab7556b9cbae09e33 Mon Sep 17 00:00:00 2001 From: Dmitrii Merkurev Date: Thu, 17 Nov 2022 19:18:32 +0000 Subject: Introduce mock codepages config option for mtools We're using arm64 version of mmd to generate ESP image for cuttlefish boot. But AOSP only supports bionic libc for arm64, so introduce here mock codepages to use it instead of glibc specific iconv library. It introduces additional limitations that every path inside msdos partition must only contain symbols between ' ' and '~' that we're ok with. Bug: 227660047 Test: launch_cvd on x86 and aarm64 to verify ESP image is correct Change-Id: Ieae82efdafbd055e062afc964d1118e7c87473a6 --- codepages.c | 9 +++++++++ config.h | 5 ++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/codepages.c b/codepages.c index ecb99ee..944131c 100644 --- a/codepages.c +++ b/codepages.c @@ -20,6 +20,13 @@ #ifndef HAVE_ICONV_H #include "codepage.h" +#ifdef USE_MOCK_CODEPAGES +Codepage_t codepages[]= { + { 850, + "" + }, +}; +#else Codepage_t codepages[]= { { 437, "ЗьйвдаезклипомДЕ" @@ -113,6 +120,8 @@ Codepage_t codepages[]= { { 0 } }; +#endif + #else /* Should down ISO C forbids an empty translation unit warning [-Wpedantic]: */ typedef int make_iso_compilers_happy; diff --git a/config.h b/config.h index 582e419..b9223b9 100644 --- a/config.h +++ b/config.h @@ -53,7 +53,10 @@ #define HAVE_HTONS 1 /* Define to 1 if you have the header file. */ -#define HAVE_ICONV_H 1 +/* #undef HAVE_ICONV_H */ + +/* Define to 1 if you want to use mock code pages. */ +#define USE_MOCK_CODEPAGES 1 /* Define to 1 if you have the header file. */ #define HAVE_INTTYPES_H 1 -- cgit v1.2.3