Task
It all started with the fact that I wanted to install GTA San Andreas on the Digma Optima 7.61 tablet. Unfortunately, the virtual SD card of the tablet has a volume of less than 1 GB, and the game cache weighs about 2-3 GB. Android 4.4.2 is installed on the tablet and there is no possibility to simply take and change the default memory. Also there is no file /etc/vold.fstab (it is on older versions of android, and by changing this file with root-rights, you can swap the virtual and real memory cards).
Required Tools
1. Computer or laptop with Linux OS.
2. The adb and fastboot utilities (included in the Android SDK, just as
tmnhy noted, are included in the repositories as separate packages).
3. The
bootimg_tools utility
set (found
here ).
Decision
1. Extract the boot image from the device
- We connect the device to the computer via usb-cable and go into the device shell:
')
adb shell
- Somewhere in the
/ dev / block folder on the device you need to find a file called
boot . I was on the path
/ dev / block / by-name / boot , but this path may vary on different devices.
- Extract the boot image:
dd if=/dev/block/path/to/boot of=/mnt/sdcard/boot-from-device.img
- Exit the shell (exit) and extract the image:
adb pull /mnt/sdcard/boot-from-device.img
2. Then the boot image needs to be parsed.
- Download and unpack bootimg_tools.
- Add bootimg_tools to PATH:
export PATH=$PATH:/path/to/bootimg_tools
- Unpack the image:
unpack boot-from-device.img
- If all previous steps are done correctly, then the folder
boot-from-device should appear. Inside it should be the files
zImage and
ramdisk.cpio.gz , as well as the
ramdisk folder. Just inside the latter is the contents of the boot image, which we will patch.
3. Patches
To solve my problem, I found the line to be replaced in the file init.sun8i.rc. I just replaced
export EXTERNAL_STORAGE / mnt / sdcard with
export EXTERNAL_STORAGE / mnt / extsd . As I understand it, this is exactly the value returned by the
Environment method
. getExternalStorageDirectory () in the Android API. This assumption is supported by the fact that after applying the patch, applications started using a hardware memory card instead of a virtual one to store their data.
4. Replace the boot image on the device
I wrote a small script for this purpose:
repack_ramdisk boot-from-device/ramdisk mkbootimg --kernel boot-from-device/zImage --ramdisk boot-from-device/new-ramdisk.cpio.gz --base 0x40000000 --cmdline 'console=ttyS0,115200 rw init=/init loglevel=4' -o new_boot.img sudo adb reboot-bootloader sudo fastboot flash boot new_boot.img sudo fastboot reboot
Results
After the done manipulations, the game on the tablet has successfully earned.
PS
All of the above you do with your device at your own risk and peril. For turning your device into a brick author is not responsible.