Skip to content

How to extract the 2.6 rootfs img from the update.img

TheKikGen edited this page Jan 31, 2021 · 14 revisions

An extraction and compression tool for InMusic MPC images is now available. This article details the format of these images.

I will focus on the Windows platform here but the principle stays the same for MacOs.

Beyond the hack aspect, this method can be used to restore a bricked MPC Live/X manually.

To do this, you need :

  • The MPCxxUpdaterWin.exe file from Akai.
  • 7Zip
  • An hex editor. I recommend HxD.

Extract the Update.img

Extract the update.img file from the MPCxxUpdaterWin.exe with 7zip, and rename it to "Update-2.6.ori.img".

Note : you can also use the mpc image extractor tool for a more automated procedure that will avoid you the extract/uncompress following steps.

Extract the rootfs volume from the specific Akai Update.img

Since the version 2.6, the rootfs image is compressed with the XZ algorithm. Open the Update-2.6.ori.img with your Hex editor and search for the XZ header "FD 37 7A 58 5A", then remove all bytes before that header.

Search again for the footer magic bytes "59 5A", and remove all bytes after the footer to the end of the file. Save the file as "Update-2.6-rootfs.xz".

Uncompress the XZ file with 7ZIP

Open the Update-2.6-rootfs.xz with 7ZIP and extract it to a subdirectory. You will encounter some errors but you can ignore it.

Rename the extracted file to Update-2.6-rootfs.img . Now you are ready to flash the rootfs volume.

Flash the rootfs volume with the fastboot utility

Official Akai updates only write to the rootfs partition. When the MPC is connected in update mode to a USB port, the "fastboot" command can be used to perform this operation manually from a command line. The fastboot is locked by a "magic" key, which can be seen in clear on a dump of the partition containing the bootloader, or by sniffing USB communications during a regular update with the Akai utility. Once unlocked, you can flash a new bootloader and file system on the internal SSD disk.

For unknown reasons, the fastboot utility doesn't work properly under Windows (but should be. Need more investigations), so the following is valid only on a Linux OS.

Connect the USB cable from the MPC to your PC. Re-boot the MPC in update mode ( "Preferences" menu, Shift key, then "Update" button at the bottom), as for a normal Akai update. Check that the MPC Live is in "fastboot" mode, by entering the command :

$ sudo fastboot devices       
Answer >>A1XXXXXXXXXXXXXXXXXXXXX fastboot

You should see your serial number appear.

Unlock the bootloader :

sudo fastboot oem inmusic-unlock-magic-7de5fbc22b8c524e
>>...
>>OKAY [ 0.000s]
>>finished. to

then flash the decompressed image (possibly change the name of the img file):

sudo fastboot flash rootfs Update-2.6-rootfs.img
>>Target reported max download size of 1879048192 bytes
>>erasing'rootfs'....
>>OKAY [ 3,631s]
>>Sending'rootfs' (409601 KB)....
>>OKAY [ 30,779s]
>>writing "rootfs'....
>>OKAY [ 33,336s]
>>finished. total time: 67,745s
sudo fastboot reboot

Extract informations from an update.img file

The update image file used for the MPC is in fact a dtb (Thanks to mamatt who has pointed that !!). The structure is the following :

/dts-v1/;
/ 
{
	timestamp = <0x5de0e899>;
	description = "MPC upgrade image";
	compatible = "inmusic,acv5", "inmusic,acv8";
	inmusic,devices = <0x9e8403a 0x9e8403b>;
	inmusic,version = "2.7.0.43";
	images {
		rootfs {
			description = "Root filesystem";
			data = <  (bynary data) >;
			partition = "rootfs";
			compression = "xz";
			hash {
				value = <0xba31c00 0x56e3a8f0 0x9a55019c 0x1e8f64c2 0xb173019b>;
				algo = "sha1";
			};
		};
	};
};.

You can use the following command to generate the "dts" source file :

dtc -I dtb -O dts -o MPC-2.X-update.dts MPC-2.X-update.img

It is possible to rebuild a modified Akai update image for the MPC and the Force hardwares, being flashable with the Akai official update tool or the usb procedure with the mpc image extractor/maker tool