- Preliminary Downloads
- Install the ROM cooking kitchen (Windows)
- Extract Original Firmware (Windows)
- Generate RootFS from Bootloader (linux)
- Modify Root or Recovery Filesystem (Linux)
- Modify /system Filesystem (Linux)
- Assembly of Final Firmware (Windows)
Slidepad 704ce is based on a Allwinner A13 SingleOnChip. The ROM cooking procedure of Allwinner A10 & A13 devices is done thru 3 main steps :
- Extraction of original firmware (under Windows)
- Modification of filesystem components (under Linux)
- Assembly of final firmware (under Windows)
The filesystem components that may be modified are typically :
- the bootloader
- the root filesystem
- the recovery filesystem
- the /system filesystem
This article will explain the simple steps needed to cook a new ROM for a Slidepad 704ce. This process needs 2 different computer environments :
- Windows for ROM extraction and repacking
- Ubuntu for filesystem modifications (but any other Linux flavour should do).
It has been specifically written for Slidepad 704ce ROM cooking, but it should be applicable to many (if not any) Allwinner A10 or A13 SoC devices.
1. Preliminary Downloads
1.1. ROM Cooking Kitchen (Windows)
This following ROM cooking procedure is based on a very good & complete guide, which has been my main inspiration. But as :
- the LiveSuit Kitchen Pack provided in this guide is embedding both GB & ICS versions
- the ICS version needs some tweaks
I've tweaked the provided ROM kitchen to simplify the procedure. Typically, all filesystems candidates for modification are exported to a specific directory.
This tweaked version can be downloaded from LiveSuit Kitchen Pack modified for Slidepad 704ce.
1.2. Original Firmware (Windows)
The first thing to download is the original Livesuit ROM of your device.
For Slidepad 704ce, it is available on Memup site at Original firmware Jelly Bean 4.1.1 for Slidepad 704ce (section Tablet/slidepad 704 CE).
1.3. Custom Recovery (Windows)
Next you need to download a Custom Recovery, that will allow you to flash some unsigned updates (typically a rooting update bringing su & busybox to your device).
For Slidepad 704ce, Mateusz Krawczuk has ported ClockWorkMod Recovery 18.104.22.168 to Manta MID08 tablet and as MID08 is using the same hardware platform, this port of CWM can be used on our tablet.
The only problem is that Internal scard is mounted from nandi on most A10 and A13 tablets, but on Slidepad 704ce it is mounted from nandj.
So, I had to modify ClockWorkMod image to properly mount internal sdcard on nandj. This has been done by modifying /etc/recovery.fstab in the InitRamFS image.
This modified version can be dowloaded from CWM 22.214.171.124 for A10 modified for Slidepad 704ce.
1.4. Other Tools (Linux)
If you plan to modifiy the /system filesystem, you'll also need some specific tools to be able to :
- simg2img : convert a sparsed ext4 image to plain ext4 image
- make_ext4fs : repack sparsed filesystem from a directory
You have to download & install these tools :
# sudo wget -O /usr/local/sbin/simg2img http://bernaerts.dyndns.org/download/ubuntu/simg2img
# sudo chmod +x /usr/local/sbin/simg2img
# sudo wget -O /usr/local/sbin/make_ext4fs http://bernaerts.dyndns.org/download/ubuntu/make_ext4fs
# sudo chmod +x /usr/local/sbin/make_ext4fs
2. Install the ROM cooking kitchen (Windows)
You are now ready to start the ROM cooking procedure.
On a Windows PC, first unzip the kitchen package. You'll get a rom_kitchen file structure.
The ROM cooking kitchen is ready to be used.
3. Extract Original Firmware (Windows)
Unzip the original Memup firmware.
The file update SLIDEPAD 704CE - Firmware xxxxx.img is the original ROM image.
Copy it under rom_kitchen\original.img (filename is changed).
Open a DOS console in the sub-directory rom_kitchen and start the ROM extraction with :
Extraction will take some time. The sub-directory rom_kitchen\_extract will be populated with all the components extracted from the original rom.
You should also get 4 files in rom_kitchen\_input :
These files are the ones you may want to modify in a ROM cooking process.
4. Generate RootFS from Bootloader (linux)
This second part has to be done from a Linux computer. We will now recreate the complete Root Filesystem from the extracted bootloader block.
Copy the file rom_kitchen\_input\bootloader.fex on a linux machine.
From a console, run these commands
# mkdir tempfs
# sudo mount -o loop bootloader.fex tempfs
# cp -a tempfs bootfs
# sudo umount tempfs
The complete Root filesystem directory structure is now available under bootfs.
If needed, you can modify this filestructure according to your needs. A boot logo modification procedure is available at Slidepad 704ce - Modify the Bootloader (boot logo, ...).
Finally, you must copy the full content of bootfs directory under rom_kitchen\_bootfs on the Windows computer.
5. Modify Root or Recovery Filesystem (Linux)
These 2 filesystems are available :
- root image is available under _input/root.fex
- recovery image is available under _input/recovery.fex
You can modify these 2 filesystems following Slidepad 704ce - Modify the Root filesystem (root logo, ...).
The 2 .fex files have to be handled exactly as the extracted nandc-root.img file in this guide.
After modification, just replace the resulting .fex file under rom_kitchen\_input on the Windows computer.
If you don't plan to do any modification on the Recovery, just replace _input/recovery.fexwith the modified Custom Recovery you've downloaded (recovery.img has to be renamed revovery.fex).
6. Modify /system Filesystem (Linux)
The /system filesystem image is available under _input/system.fex.
Modification of this filesystem has to be done in 3 steps.
6.1. Mount the Filesystem
You need to copy the file _input/system.fex to a folder on your Linux computer and to open a terminal in this folder.
We can now convert the /system filesystem with simg2img and mount it under a system directory :
# mkdir system
# simg2img system.fex system.img
# sudo mount -t ext4 -o loop system.img system/
The complete /system file structure is now available in your current system directory.
6.2. Modify the files
You can now modify whatever file you want within this directory structure.
Whatever you'll modify has to be done as root (sudo ...).
6.3. Repack the /system image
You now need to repack the sparsed ext4 filesystem to reintroduce it within the ROM cooking environment.
This is quite simple with the make_ext4 tool :
# rm system.fex
# sudo make_ext4fs -s -l 512M -a system system.fex system/
# sudo umount system
# rm system.img
Your updated /system sparsed ext4 image is now available under system.fex.
You can copy it back to the ROM cooking structure.
7. Assembly of Final Firmware (Windows)
Once all the filesystems modification have been done and the new .fex images placed back in the kitchen environment, you are now ready to reassemble and generate the new firmware image.
From the DOS console, launch :
The resulting image will be available under rom_kitchen\output.img.
Your new image is ready to be flashed with LiveSuit.
Hope it helps.