If you are on a 32bit computer you need to do a 32bit build instead of 64bit (so all of the msys packages should be for i686 32 bit) and if you are somehow on an ARM64 processor you would need to get the aarch64 instead.
Msys2 PATH variable and Windows command prompt PATH variables are different, I ran simg2img.exe from Windows command prompt and I didn't have to add dll files or get errors.
I don't know any more besides that, best of luck
Thank you for your response towardsdawn once again. I was eventually able to get it to function.
Here are the exact steps in case anybody wishes to duplicate what was done (Credits to towardsdawn for the substantial help)
Note: The steps below were performed on a 64-bit Windows 10 computer; however, the steps may vary depending on the operating system and/or system architecture.
1. Install
MSYS2
1a. Download the
latest phhusson GSI build w/ root
2. Run "MSYS2 MinGW x64" application
3. Paste
pacman -S mingw-w64-x86_64-toolchain
into the application
- Click enter (Selecting "All" by default)
- Proceed with installation (Y)
4. Paste
pacman -S base-devel
into the application
- Proceed with installation (Y)
5. Paste
pacman -S mingw-w64-x86_64-gettext
into the application
- Proceed with installation (Y)
6. Paste
pacman -S zlib
into the application
- Proceed with installation (Y)
7. Paste
pacman -S libasprintf
into the application
- Proceed with installation (Y)
8. Git clone
simg2img (By anestisb)
- I downloaded the zip, and then decompressed it
9. In the "MSYS2 MinGW x64" application", cd into the directory where the decompressed "android-simg2img-master" folder is stored
- Example command:
cd /c/Users/YourPCNameHere/Downloads/Compressed/android-simg2img-master
10. Set all the proper path variables
- Run command prompt as admin, cd into mingw64\bin directory (Ex:
cd C:\msys64\mingw64\bin
), paste
mklink make mingw32-make.exe
and click enter
- Add mingw64/bin directory to path (Ex: I pasted C:\msys64\mingw64\bin into my path)
11. Download the
asprintf and vasprintf implementations zip and decompress it
12. Create a new folder in the "android-simg2img-master" folder
- I titled mine "folder"
13. Paste everything that's inside the asprintf folder (asprintf.h is all that is required; you can keep or remove everything else if you want) into the new folder you created in the "android-simg2img-master" folder
14. Edit the "Makefile" inside the "android-simg2img-master" folder with notepad or a similar application
- There should be a line that says
CPPFLAGS += -std=gnu++17 -O2 -W -Wall -Werror -Wextra \ -D__STDC_FORMAT_MACROS -D__STDC_CONSTANT_MACROS
, delete the
-Werror
from the line and save
15. Edit the "append2simg.cpp" file inside the "android-simg2img-master" folder with notepad or a similar application and add #include "TheNewFolderYouNamedHere/asprintf.h"
- Ex: I added
#include "folder/asprintf.h"
to the file
16. Close out, and then open again the "MSYS2 MinGW x64" application, make sure your directory is set to the one where android-simg2img-master is stored (Refer to step 8 if you forgot how to change directory)
17. Run
CFLAGS="-DUSE_MINGW" LDFLAGS="-lasprintf" mingw32-make
into the application
- simg2img should have been successfully built
18. Run command prompt again, cd into the simg2img directory
19. Decompress the GSI built you download from step 1a, and put it into the "android-simg2img-master" folder
20. Run
simg2img.exe system-roar-arm64-ab-floss.img system-raw.img
into the command prompt
- If you ran the above command, you should now have an unsparsed system image (named system-raw.img) that can be gzipped and used to run DSU with a custom image