Install official AOSP GSI using Odin

Search This thread

mqbtcm8a4

New member
Mar 24, 2021
1
0
Hi,

I have the latest stock ROM (G960FXXSFFUB3) on my Galaxy S9 (SM-G960F, Exynos) and my goal is to install official AOSP Android 11 GSI using Odin. I pretty much succeed, but I got bootloop as a result. Can you please help me to resolve this problem?

Steps to reproduce:

1. OEM Unlock [source, by @georgeburduli ]
1.1. Connect your phone to the Internet
1.2. Navigate to "Settings" -> "General management" -> "Date and time"
1.3. Disable "Automatic date and time"
1.4. Click on "Set time"
1.5. Select any date from the previous month
1.6. Navigate to "About phone" -> "Software update"
1.7. Disable "Auto download over Wi-Fi"
1.8. Click on "Download and install"
1.9. Navigate to "About phone" -> "Software information"
1.7. Tap on "Build number" 7 times to activate "Developer options"
1.8. Navigate to "Settings" -> "Developer options"
1.9. Disable "Auto update system"
1.10. Enable "OEM Unlock". If there are no "OEM Unlock" option in "Developer options", then try to repeat steps 1.1 - 1.10.


2. Prepare building tools [source, by @kkoo ]
2.1. Install 7zip
2.2. Create a new folder "tools"
2.3. Create a new folder "tools\bin"
2.4. Download the following files
- coreutils-8.26-2.tar.xz
- cygwin-3.2.0-0.1.tar.xz
- libattr1-2.4.48-2.tar.xz
- libgcc1-9.3.0-2.tar.xz
- libiconv2-1.16-2.tar.xz
- libintl8-0.19.8.1-2.tar.xz
- tar-1.33-1.tar.xz
2.5. Using 7zip open each *.tar.xz file and extract the following files and place them inside "tools\bin":
- cygattr-1.dll
- cyggcc_s-seh-1.dll
- cygiconv-2.dll
- cygintl-8.dll
- cygwin1.dll
- ls.exe
- md5sum.exe
- mv.exe
- tar.exe
2.6. Create file "tools\batch.bat"
Code:
@echo ---------------mkh.mourad batch script

rem Setup ENV
SETLOCAL ENABLEDELAYEDEXPANSION
rem // Delete Previous Folder
RMDIR /S /Q temp-folder
MKDIR temp-folder
call set curentDir="%cd%%"
FOR /f "delims=" %%G in ('DIR /S /A:-D /B  *.lz4') do (
    call cd %%~dpG
    call !curentDir!\BIN\tar --create --format=gnu -b20 --quoting-style=escape --owner=0 --group=0 --totals --mode=644  -f %%~nG.tar %%~nxG
        xcopy %%~nxG  !curentDir!\temp-folder\
    )
cd !curentDir!


rem Build the TAR File
cd temp-folder
call !curentDir!\BIN\ls *.lz4 > temp-file.txt
call !curentDir!\BIN\tar --create --format=gnu -b20 --quoting-style=escape --owner=0 --group=0 --totals --mode=644  -f AP_TAR_MD5_CUSTOM_FILE_ODIN.tar -T temp-file.txt
del /Q temp-file.txt
cd !curentDir!


rem Create the MD5 Final File:
FOR /f "delims="  %%G in ('DIR /S /A:-D /B  *.tar') do (
    call cd %%~dpG
    call !curentDir!\BIN\md5sum -t %%~nxG >> %%~nxG
        call !curentDir!\BIN\mv %%~nxG %%~nxG.md5
    )
cd !curentDir!

rem Cleaning Files
FOR /f "delims=" %%G in ('DIR /S /A:-D /B *.lz4 *.md5 ^| FINDSTR /v /i "\AP_TAR_MD5_CUSTOM_FILE_ODIN.tar.md5$"') do del /Q "%%G"


3. Build the AP file to use with Odin [source, by @kkoo ]
3.1. Download lz4_win64_v*_*_*.zip
3.2. Using 7zip extract lz4_win64_v*_*_*.zip to "lz4_win64_v1_9_3"
3.3. Download vbmeta.img
3.4. Place vbmeta.img into "lz4_win64_v1_9_3/bin" and run the following command:
Code:
lz4.exe -B6 --content-size vbmeta.img vbmeta.img.lz4
3.5. Download the latest aosp_arm64_ab ROM and using 7zip extract system.img, vendor.img and cache.img into "lz4_win64_v1_9_3/bin"
3.6. Run the following command:
Code:
lz4.exe -B6 --content-size system.img system.img.lz4
lz4.exe -B6 --content-size vendor.img vendor.img.lz4
lz4.exe -B6 --content-size cache.img cache.img.lz4
3.7. Download your phone latest Official Stock ROM (I got my using Samsung Smart Switch)
3.8. Extract the downloaded file (you'll have the BL, AP, CP, CSC, HOME_CSC .tar.md5 files)
3.9. Using 7zip extract the following files from AP_*.tar.md5 into the "tools" folder from step 2.2:
- boot.img.lz4
- dqmdbg.img.lz4
- recovery.img.lz4
- userdata.img.lz4
- vendor.img.lz4
3.10. Move vbmeta.img.lz4, system.img.lz4 and cache.img.lz4 from the "lz4_win64_v1_9_3/bin/" into the "tools" folder
3.11. Double click on the "tools/batch.bat" file
3.12. Once it finishes go to the "tools/temp-folder". Inside you will find the AP_TAR_MD5_CUSTOM_FILE_ODIN.tar.md5


4. Flash the ROM
3.1. Install SAMSUNG_USB_Driver_for_Mobile_Phones.exe
3.2. Download Odin3-v3.14.1.zip
3.3. Extract the downloaded file
3.4. Run Odin3 v3.14.1.exe
3.5. Flash the BL, CP, HOME_CSC from your Stock ROM and AP (using AP_TAR_MD5_CUSTOM_FILE_ODIN.tar.md5)

Result: Bootloop

1616609579450.png
 
Last edited:

It_ler

Recognized Contributor
  • Aug 23, 2011
    12,127
    16,931
    Samsung Galaxy S8
    Samsung Galaxy S10
    I heard that many users have issue get GSI running in their S9. Endless Bootloops.
    Don't users could fix it flashing stock firmware.
    Others by doing a factory reset.
    Others by flashing TWRP recovery:
    Hope that your can find a way to get your device up and running again.
     
    Our Apps
    Get our official app!
    The best way to access XDA on your phone
    Nav Gestures
    Add swipe gestures to any Android
    One Handed Mode
    Eases uses one hand with your phone