Monday , 22 January 2018
Breaking News

[MOD][APP] MaulBoot – Dualboot for S3

Introducing MaulBoot: Dualboot for S3
Everyone knows about MultiBoot, the famous tool to let you install multiple ROMs on some devices. That’s pretty cool, but unfortunately is only compatible with a handful of devices. So what if you want to dualboot on your Verizon Samsung Galaxy S III (SCH-I535)? Now, with the help of a microSD card, you can!

(credit Nicene Nerd)
 _______   __       _______.  ______  __          ___       __  .___  ___.  _______ .______      
| | | / | / || | / | | | / | | ____|| _
| .--. || | | (----`| ,----'| | / ^ | | | / | | |__ | |_) |
| | | || | | | | | / /_ | | | |/| | | __| | /
| '--' || | .----) | | `----.| `----./ _____ | | | | | | | |____ | | ----.
|_______/ |__| |_______/ ______||_______/__/ __ |__| |__| |__| |_______|| _| `._____|

REMEMBER: Use this utility at your own risk. I am not responsible for any
data loss, bricked devices, thunderstorms, or undesirable election
outcomes that result from using this utility.

Celebrate! The Fully Functional MaulBoot App Is Here!

You’ve been waiting patiently, and now the time has come. I’ve been working hard almost a week to add lots of fancy new features. Basically, you can now have fully functioning dual boot using the MaulBoot app alone. No more messy attempts to manually repartition your SD card. No more relying on a Windows-only ROM patching script. No more… Well, I’ll let the new feature set speak for itself.

MaulBoot 0.9 Features

  • The Holy Grail: Patch most ROMs on-device. Exceptions include ROMs which use AROMA installer and maybe some other random cases (I’m looking at you, SlimKat).
  • Repartition your SD card for dual boot with a single tap.
  • Wipe all or any of your external partitions.
  • Mount partitions from your other ROM.
  • External ROMs mount the internal ROM’s internal storage automatically at /sd-int.
  • Two themes: Holo Darth and the traditional Holo Light w/ Dark Action Bar.
  • Installed an external ROM without root permissions? That’s okay, you can now root your external ROM from the app.
  • Patch Google Apps packages on-device.
  • If there’s anything else I forgot, download the app and find out!

Get Started with MaulBoot

  1. Install the MaulBoot app to your phone.
  2. On the first screen, click “Set Current ROM as Internal.”
  3. Backup your SD card unless you want it to be wiped clean.
  4. Swipe to the Tools tab and click “Partition SD Card for Dualboot.”
  5. When finished, verify your new partitions by running the following command either in an ADB shell or the Terminal Emulator:
    ls /dev/block/

    If successful, you should see mmcblk1p1, mmcblk1p2, mmcblk1p3, and mmcblk1p4 in the list.

  6. Back in the Tools tab, click “Patch ROM for External Flash.” Choose the ROM you want to use on your external storage.
  7. [OPTIONAL] Click “Patch Google Apps Package” to prepare if you want to flash Google Apps on your external ROM.
  8. Reboot to recovery.
  9. Flash your patched ROM and (optionally) Google Apps package. Remember that the patched zips are prefixed with “external-“.
  10. If the flash is successful, reboot and you will be in your external ROM. Open the MaulBoot app and click “Set Current ROM as External.”
  11. Now you’re done! Enjoy dual booting your SGS3.

Downloads

  • The recommended source for MaulBoot downloads is my Dev-Host folder here.
  • You can also download important files attached to this post. They may not stay as well updated as the Dev-Host files.

Remember: Do NOT flash your external ROM before installing MaulBoot to your internal ROM and saving the boot image!

Remember to check the full post for instructions on how to patch ROMs and Gapps packages manually.
Attached Files

external-wipes.zip – (703.1 KB)
MaulBootForS3.apk – (2.05 MB)
MaulBoot ROM Patcher.zip – (4.56 MB)
(credit Nicene Nerd)
 Tips for Better Dual Booting
  • If you can, use a class 10 SD card. Lower clases (esp. class 4) tend to host laggy external ROMs.
  • If you plan on dual booting an AOSP and a TouchWiz ROM, consider putting the TouchWiz ROM on internal storage regardles of which one you want to use as your daily driver. Since TouchWiz ROMs are generally bulkier and slower than AOSP ROMs, they will benefit from the speed of NAND memory, while the speed of the SD card will not adversly affect an AOSP ROM as much.
  • Make a recovery backup of your boot partition both before and after flashing an external ROM. This will enable you to switch back and forth between ROMs even if you can’t use MaulBoot for some reason (e.g. you lose root on one or both ROMs).
  • If you are, as I am, flashed to another carrier, be aware that sometimes your service will work differently on your internal ROM than you external. Sometimes one will get service or data while the other does not.
  • If you want to flash a custom kernel to your external ROM, check to see if it has a boot.img in the update ZIP. If so, the ROM patch button should work on it. If not, the Google Apps patch should work.

Instructions on Patching ROMs for External Use Manually

  1. Using a program like 7-Zip, extract boot.img and META-INFcomgoogleandroidupdater-script from your ROM.
  2. WINDOWS ONLY: Extract the /system/media/audio directory tree. Then delete it within the ROM package, and finally place the extracted audio folder back in /system/media/
  3. Unpack the boot image and its ramdisk. A search of XDA will show you how to do this.
  4. Open the files fstab.qcom and init.target.rc from the ramdisk.
  5. Fix the mount instructions for /system, /data, and /cache. Use the chart below to help.
    Code:
    Find                                                  Replace With
    ----------------------------------------------------------------------------
    /dev/block/platform/msm_sdcc.1/by-name/system /dev/block/mmcblk1p2
    /dev/block/mmcblk0p14 /dev/block/mmcblk1p2

    /dev/block/platform/msm_sdcc.1/by-name/userdata /dev/block/mmcblk1p4
    /dev/block/mmcblk0p37 /dev/block/mmcblk1p4

    /dev/block/platform/msm_sdcc.1/by-name/cache /dev/block/mmcblk1p3
  6. Repack the boot image.
  7. Open the updater-script and replace the same things you replaced in the ramdisk.
  8. Using 7-Zip or a similar program, update boot.img and updater-script in the ROM zip.
  9. Volia! Your ROM is now ready to use on your external partitions.

Instructions on Patching Google Apps ZIPs

  1. Open the Google Apps package in 7-Zip or a similar program.
  2. Extract the updater-script from META-INFcomgoogleandroidupdater-script
  3. Replace the following:
    Find                                                  Replace With
    ----------------------------------------------------------------------------------------------------------------
    run_program("/sbin/busybox", "mount", "/system"); mount("ext4", "EMMC", "/dev/block/mmcblk1p2", "/system");
    run_program("/sbin/busybox", "umount", "/system"); unmount("/system");
  4. Replace the old updater-script in the ROM zip with the new one.
  5. Volia! You can now flash this Google Apps package over an external ROM.

Explaining the /system/media/audio Step
If you use my MaulBoot ROM Patcher script, you will early on have to perform a step in which you extract /system/media/audio, delete it from the archive, and then place the extracted files back in the archive. Why? See, Linux filenames are case-sensitive. This means, in Linux, ANDROMEDA.ogg is different than Andromeda.ogg. However, Windows filenames are not case-sensitive. In Windows, ANDROMEA.ogg and Andromea.ogg refer to the same file. Unfortunately, since most ROMs are packed in Linux (and since Android is Linux-based), sometimes files just like ANDROMEDA.ogg and Andromeda.ogg will appear in /system/media/audio. When this happens, Windows programs (7-Zip, for example) cannot edit the ROM zip properly. When extracting, though, one of the two files sharing a name will overwrite the other, leaving no duplicates. Thus when they are injected back into the ROM zip, there are no more errors.

Q&A Stuff

  • Can I use MaulBoot with SafeStrap?
    No. SafeStrap is for devices with locked bootloaders. You cannot use MaulBoot unless your bootloader is unlocked! If you are one of the few who uses SafeStrap on an unlocked bootloader, I advise against using MaulBoot because anything could happen. They are not meant for each other they way Amy Pond and Rory Williams are.
  • Can I use a custom kernel on my external ROM?
    Absolutely. In most cases, you merely need to patch the updater-script. Check the instructions in the previous post on patching ROMs and Google Apps packages, and follow whichever one looks most like your kernel’s updater-script.
  • BMS has a dummy updater-script! How do I use it with my external ROM?
    You can find the answer to that here.
  • Will MaulBoot ever have [insert feature here]?
    Maybe, maybe not. If I am working on new features, I will mention it in this thread. If I do not mention a feature, that is probably because it is either impossible, painfully impractical, beyond my skill, or I haven’t been struck with the lightning of inspiration yet.
  • I love you! Will you father my child?
    No, I’m happily married and intend to stay that way.
  • Fine. Will you godfather my child?
    While I’m not morally opposed to that one as I am your first request, I’d rather leave that honor to someone you know in person.
  • Will MaulBoot work on any other devices?
    Right now, MaulBoot is only compatible with the S III (and probably just the Verizon S III). However, the basic concept is probably compatible with many devices. I do intend to expand support in the future, though only to Samsung devices. If you want your device supported, send me info on your devices’s partition layout. Specifically, I need to know the locations of the boot, system, data, and cache partitions, along with a note if any other partitions directly affect ROM flashing.

Partitioning the SD Card

To use MaulBoot, you will have one ROM on internal storage (primary ROM), and one on a microSD card (secondary ROM). The card will still be used for normal storage, so a card size of 16GB or more is recommended.

To partition your SD card, a Linux user has a number of options. However, if you use Windows, you need a partitioning program that supports the EXT4 filesystem, which we will use for the external ROM partitions. I used MiniTool Partition Wizard Home Edition (found here). You will need a total of four partitions.

  1. The first partition must be your FAT32 storage partition. This can be as big as you have space to be after the other three partitions are accounted for.
  2. The second partition will be for your external /system. It should be approximately 1.5GB, formatted as EXT4.
  3. The third partition, the /cache partition, should be about 800MB, though you may be able to get away with less, also EXT4.
  4. The final partition, for /data, should be at least2GB, but can be as big as you need it to be, and must also be EXT4.

As of yet, your internal storage folder (/sdcard) on your internal ROM cannot be shared with that of your external ROM, so make /data big enough for your internal storage needs.

When you are finished, you should have four partitions, which you can verify on your device by running, either through ADB or in a terminal emulator, the command ls /dev/block/. The partitions will show up as mmcblk1p1 (normal SD storage), mmcblk1p2 (system), mmcblk1p3 (cache), and mmcblk1p4 (data).

Patching ROMs for External Use
To use a ROM as an external (secondary) ROM, you must patch it first to install to and run from the external ROM partitions. Fortunately for Windows users, I have created a script (with help from osm0sis’s Android Image Kitchen) that can patch ROMs for you for external use. So far the script has been tested with only Jelly Bean and KitKat ROMs. While an ICS ROM might work, I cannot guarantee it. Also, ROMs which use AROMA are not compatible.

The MaulBoot ROM Patcher script can be found attached to this post, or here: https://dl.dropboxusercontent.com/u/…%20Patcher.zip
To use, follow these directions:

  1. Download and extract MaulBoot ROM Patcher.zip to the location of your choice.
  2. Open a command window in the MaulBoot ROM Patcher directory containing the file “MaulBootPatcher.bat”
  3. To patch your ROM, type the command:
    Code:
    MaulBootPatcher rom-package-here.zip
  4. Read and follow all instructions and wait for the script to complete.
  5. Your patched ROM will appear as external-rom-name.zip
  6. This zip can be flashed in recovery. It will automatically install to the external partitions.

If you are on Linux, or if you need to patch a ROM manually, read instructions in the second post. The basic idea is to update the ramdisk to mount external partitions instead of internal ones, and to make the updater-script also point to external partitions.

Other Stuff to Know

  • The ROM patcher script will not work on Google Apps packages. To use Google Apps with an external ROM, you must either patch the updater-script yourself or use the following Gapps package, meant for external KitKat ROMs: https://www.dropbox.com/s/k9t7v1yi6n…s-micro-kk.zip
  • I have attached a collection of zip files which can be flashed in recovery to wipe external partitions. There are zips for wiping everything, factory resetting, wiping Dalvik cache, and wiping cache + Dalvik cache.
  • If you have any questions, don’t hesitate to ask!
  • Donations are accepted, but never obligatory.

About Xeon Zolt

Leave a Reply

Your email address will not be published. Required fields are marked *

*

%d bloggers like this: