yashsingh1/xdaforums huggingface dataset:
[Xperia Z1 Original Android Development] Androguide.fr:
Here is the edify (updater-script) version of this script to create the partitions.

We can't do any calculation in edify though so you need to change the "count=128000" with the count you want by following the formula [MENTION=4120742]munjeni[/MENTION] posted above.

An aroma script to let users choose between different preset sizes for their partitions can easily be done however.

run_program("/sbin/busybox", "mkdir", "/data/media/0/bootmenu/folder_you_want");

run_program("/sbin/busybox", "dd", "if=/dev/zero of=/data/media/0/bootmenu/folder_you_want/system.ext4", "bs=4096", "count=128000");
run_program("/sbin/busybox", "dd", "if=/dev/zero of=/data/media/0/bootmenu/folder_you_want/data.ext4", "bs=4096", "count=128000");
run_program("/sbin/busybox", "dd", "if=/dev/zero of=/data/media/0/bootmenu/folder_you_want/cache.ext4", "bs=4096", "count=128000");

set_var("UUID", run_program("/sbin/busybox", "blkid", "/dev/block/platform/msm_sdcc.1/by-name/system"));

ui_print("System partition UUID: " + get_var("UUID"));

run_program("/sbin/busybox", "losetup", "/dev/block/loop1", "/data/media/0/bootmenu/folder_you_want/system.ext4");
run_program("/sbin/busybox", "losetup", "/dev/block/loop2", "/data/media/0/bootmenu/folder_you_want/data.ext4");
run_program("/sbin/busybox", "losetup", "/dev/block/loop3", "/data/media/0/bootmenu/folder_you_want/cache.ext4");

run_program("/sbin/busybox", "mke2fs", "-T", "ext4", "-O", "has_journal,ext_attr,resize_inode,filetype,extent,sparse_super,large_file,uninit_bg", "-U", get_var("UUID"), "-I", "256", "/dev/block/loop1");
run_program("/sbin/busybox", "mke2fs", "-T", "ext4", "-O", "has_journal,ext_attr,resize_inode,filetype,extent,sparse_super,large_file,uninit_bg", "-U", get_var("UUID"), "-I", "256", "/dev/block/loop2");
run_program("/sbin/busybox", "mke2fs", "-T", "ext4", "-O", "has_journal,ext_attr,resize_inode,filetype,extent,sparse_super,large_file,uninit_bg", "-U", get_var("UUID"), "-I", "256", "/dev/block/loop3");

run_program("/sbin/busybox", "tune2fs", "-o", "journal_data_writeback", "/dev/block/loop2");
run_program("/sbin/busybox", "tune2fs", "-o", "journal_data_writeback", "/dev/block/loop3");

run_program("/sbin/busybox", "losetup", "-d", "/dev/block/loop1");
run_program("/sbin/busybox", "losetup", "-d", "/dev/block/loop2");
run_program("/sbin/busybox", "losetup", "-d", "/dev/block/loop3");

If the fstab(s) and ramdisk modifications have been done in the ROM/Kernel then most of the process would be automated for the end users this way, right ?
[Xperia Z1 Original Android Development] mai77:
better readable tut provided

hey guys, :highfive:

I'd like to adapt this tut for XPERIA E1 :angel:

so I put the gist of it (slightly reworded for clarity) in a pad here : https://piratenpad.de/hqinH9eVKY :good:

feel free to improve it. It's much better readable with no ads and crap. :cool:
[Xperia Z1 Original Android Development] N10AP:
You made the portal, son!!!

http://xdaforums.com/showthread.php?t=2447534

I am trying this. Some success. You can install the switcher and save / flash kernel, therefore switch between ROMS...but currently I`m trying to work out how to patch a secondary ROM as obviously Honami / Togari isn`t supported.

[MENTION=4277844]chenxiaolong[/MENTION] could you help? Might just help on our devices!

EDIT:

Right, I have successfully patched the Togari Google edition ROM, but struggling on the Ramdisk. My quest continues!
[Xperia Z1 Original Android Development] munjeni:
I will make an automated tool for doing these things, but not promising since I need a free time for doing that.
[Xperia Z1 Original Android Development] ntmohammad:
would u mind plz complete this tutorial soon ? cuz im so interested to have multiboot on my phone
[Xperia Z1 Original Android Development] HypoTurtle:
Is there a reason for using loops rather than just binding?? That would remove the need to dd anything.
[Xperia Z1 Original Android Development] SafiXS:
Once again :D

Inside CM11

Inside CWM
[Xperia Z1 Original Android Development] abbychauhan:
Can u tell how u did mainrom process without doomkernal because i am unable to find boot.img file in the ftf file which has to be kept in bootmenu folder
[Xperia Z1 Original Android Development] munjeni:
New bootmenu_honami.zip is out, hope cwm screen shoot solved! Any one try and give me screen shoot of the my cwm
[Xperia Z1 Original Android Development] SafiXS:
you can use also the kernel.elf. you can extract it from every .ftf file with 7zip for kernel.sin and flashtool to extract kernel.elf.
[Xperia Z1 Original Android Development] abbychauhan:
I see kernal.sin not kernal.elf

Ok i converted it to elf
[Xperia Z1 Original Android Development] SafiXS:
flashtool use Tools/Sin Editor and extract kernel.sin
[Xperia Z1 Original Android Development] munjeni:
Make sure one important thing: every kernel have unique kernel modules which is paired with every kernel (located under /system/lib/modules) ...so make sure your rom have proper kernel modules! For example: if you have DooM kernel than you will need DooM kernel modules, or if you have for example stock kernel than you will need stock kernel modules ...in your rom "/system/lib/modules" folder. Do in your mind that every kernel is unique, so kernel modules too!
[Xperia Z1 Original Android Development] abbychauhan:
Ok mainrom stock based rom is done.. No delay in booting

---------- Post added at 01:26 AM ---------- Previous post was at 01:25 AM ----------

Going for second step
[Xperia Z1 Original Android Development] munjeni:
Great! This is a good time for testing if mainrom-CWM is working + screenshot ok? :D
[Xperia Z1 Original Android Development] abbychauhan:
Process going on doing second step.. I dont think screenshot will come proper because i am using the bootmenu_honami.zip which u released a little earlier..
[Xperia Z1 Original Android Development] SafiXS:
Tada..

By the way, is it possible to resize the font of you bootmenu too? it is so small like cwm was befor your edit. hard to read ;D
[Xperia Z1 Original Android Development] abbychauhan:
Yes theming of boot menu has to be done.. More pretty bootmenu matching with BootMenu Logo has to be there, what say?
[Xperia Z1 Original Android Development] SafiXS:
Sounds Good! Maybe some graphical stuff etc. He have so much things planed i'm so happy to have a such developer here!
[Xperia Z1 Original Android Development] munjeni:
Yes ofcourse, thats a reason why I insisted for a screen shoot :good:
[Xperia Z1 Original Android Development] abbychauhan:
MainRom CWM is working fine via bootmenu recovery.. But im unable to go into bootmenu recovery of second ROM.. It shows the logo of bootmenu recovery but stays there.. Yet i can go to recovery of second rom by old method by selection of second rom and when it shows boot logo then pressing up button

Can anyone conform this??
[Xperia Z1 Original Android Development] SafiXS:
After dirty repatch / flash i can confrim. I'm so blind it boots to rom related cwm before :rolleyes:
[Xperia Z1 Original Android Development] abbychauhan:
Ok now brief of what i have on Multiboot..

I am using iHackers .681 4.4 Kitkat FW Stock based ROM ( I had this only saved into my PC ) as Primary ROM,

And Secondary ROM is AOSP Based Paranoid Android Latest Ver.

And No Custom Kernal on any of the ROM.

I ll try vise versa later on with AOSP as primary and Stock based as Secondary
[Xperia Z1 Original Android Development] munjeni:
New bootmenu_honami.zip is out! Changelog:

- increased font

- roboto font by now since I have no free time to make a new one (lucida console) by now

About no boot bug in cwm... I have noticed on my phone the same bug yesterday, but I fixed them by giving proper permissions to some files, probably I forgot to change in previous cwm :o Let me know pleaaaaasseee if everything is finaly ok :D
[Xperia Z1 Original Android Development] munjeni:
You can install 5 roms (10 entries max)... just for info! There is only free space limitation.
[Xperia Z1 Original Android Development] abbychauhan:
Also forgot to say instead of the WORD "CWM" Cant we have WORD "RECOVERY" because some ROM uses TWRP and Some uses Philz.. so i think using of the word CWM in bootmenu is a mismatch.. It should be RECOVERY.

Just a thought.. U are the creator.. Thanks

---------- Post added at 02:35 AM ---------- Previous post was at 02:24 AM ----------

I have only one thing in my mind how am i going to do the kernal.elf thing if stock is on secondary.. As i remember u told me about ur tool which will change the ftf file to a flashable zip but i cannot find the procedure on that thread, also it had to be mentioned on OP.. can u please update the OP with proper links and the procedure for how to convert ftf to flashable zip
[Xperia Z1 Original Android Development] SafiXS:
Hmmm.

for me nothing changed. Did again a complete dirty flash / patch / copy of multiboot

1. Stock Rom with Doom kernel - Rom boot and your recovery works

2. CM11 with cm kernel - Rom boot after flash patched zip with cm11 recovery / Your Recovery now cause reboot for me

3. Font and Fontsize is still the same as before
[Xperia Z1 Original Android Development] munjeni:
As I know every rom package come with boot.img or kernel.elf, so you no need to use any external kernel for seccond roms. But if you realy want to replace kernel on seccond roms than you can use kernel_dump binary from botmenu/bin folder! Tool will extract 3 diferent formats of the kernel packages:

1. Directly by dumping from boot block device

2. Directly from boot.img

3. Directly from kernel.elf

To get tool help siple execute binary by command:

adb shell /data/media/0/bootmenu/bin/kernel_dump
[Xperia Z1 Original Android Development] abbychauhan:
Same here no changes at all same as before..
[Xperia Z1 Original Android Development] munjeni:
Sorry I was fast so probaly patched amami build instad of honami... Lets continue tomorow! Thanks again for your time, hope next day get better! I will carefully check cwm
[Xperia Z1 Original Android Development] abbychauhan:
Thanks for ur work man.. Will definitely continue tomorrow, trying to get sleep its 3.30 AM in India.. Good night..
[Xperia Z1 Original Android Development] SafiXS:
removed
[Xperia Z1 Original Android Development] abbychauhan:
Sorry to disturb u mate.. Have u found the bug in CWM for permission of Secondary ROM CWM to be accessible via bootmenu?
[Xperia Z1 Original Android Development] munjeni:
We will fix that I am sure! New bootmenu_honami.zip is out, please test new cwm (give me screen shoot please)!
[Xperia Z1 Original Android Development] munjeni:
Thats not permissions related! Problem might be kexec since kexec use specific memory range to load, store and boot things from bootmenu folder, but sometimes these files in memory get overwriten on boot! We need at least to find a stable memory region to load kexec things! You guys can help me finding a stable --mem-min range! You can test by self by command:
[Xperia Z1 Original Android Development] SafiXS:
Hey dude,

nice to see you here again!

I've repatched everything with new bootmenu.zip

No Recovery anymore, not on Stock (primary) and no CM11 (secondary).

I did the steps as always

1. rewrite all data with the new one in bootmenu folder

2. reboot in bootmenu

3. patch mainrom first, then secondary

4. Reboot (its not necessary)

5. Choose Rom/CWM

forgot to renew boot.img in mainrom folder. Mainrom CWM work, Secondary Rom CWM don't work

--------------------------------------------------------

Where we have to use this commands? Your Recovery, Rom Recovery, System (Stock CM11)?
[Xperia Z1 Original Android Development] abbychauhan:
Hang on a min. i am testing.. I can go to primary ROM cwm via bootmenu.. Checking secondary now
[Xperia Z1 Original Android Development] SafiXS:
loooool you know what? i forgot to copy fresh boot.img in folder ;D OMG my brain is overheated.

Checking once again and edit this post with result ;D

x x x x x x x x x x x x x x x x x x x x x x x x x x x x x

enough is enough, i now write down every step i have to do after update to stop the fail reports! :mad:

Thank you abbychaun, 4 eyes see more than two eyes dude ;D
[Xperia Z1 Original Android Development] abbychauhan:
Ok i deleted the whole bootmenu folder from internal memory and placed the new one and kept the kernal.elf in mainrom folder.. Did patching of mainrom again - I was able to boot Mainrom and the cwm of mainrom

Did th

---------- Post added at 11:32 PM ---------- Previous post was at 11:30 PM ----------

*Did the patching of Secondary ROM - Can boot into Second ROM but not into CWM via bootmenu

---------- Post added at 11:37 PM ---------- Previous post was at 11:32 PM ----------

+1

I think first download the Terminal Emulator install it on Primary ROM and then Give the command.. Am i right [MENTION=4120742]munjeni[/MENTION] ?
[Xperia Z1 Original Android Development] munjeni:
Hi, that is kexec principe used in our bootmenu. You can boot your roms by using adb shell in combination with commands provided in my previous post! I will need some tests from you guys by adb shell since need to find what is right --mem-min parameter (I think these parameter cause cwm to fail to boot! Please test with --mem-min=0x30000000 ! We can try many combinations, many kernels and dt (for example zImage from /dev/block/0/bootmenu/xxx_rom_cm_blabla/zImage + dt.img from the same folder) until we get right one mem-min which wll work with every kernel) but til after some one confirm if cwm font is ok now, allso will be great if some one put screen shoot attachment here!
[Xperia Z1 Original Android Development] abbychauhan:
CWM Font is ok.. We are asking about BootMenu Font and Design
[Xperia Z1 Original Android Development] munjeni:
Lets forget that for now since we need to solve more important things here! :) I have plan to do something with skin but not now. What you think about skin features from htc hd2 cwm (http://xdaforums.com/showthread.php?t=1419733), these recovery had ability for changing a skins, some example skins is allready there, look into these thread and let me know what you think!
[Xperia Z1 Original Android Development] abbychauhan:
Yep thats look good enough and easy to operate ..
[Xperia Z1 Original Android Development] munjeni:
Uhhh, I need to give you new bootmenu with the same font like on latest cwm!!? Allso will change --mem-min parameter for test... going to compile now! :)
[Xperia Z1 Original Android Development] SafiXS:
Screenshot is some posts before ;D

Soooooo....

I've test your command

/sbin/kexec --load-hardboot /data/media/0/bootmenu/mainrom/zImage --initrd=/data/media/0/bootmenu/bin/ramdisk-recovery.cpio --mem-min=0x20000000 --command-line="$(cat /proc/cmdline)" --dtb=/data/media/0/bootmenu/mainrom/dt.img

and one time with 0x30000000, both boot in cwm

BUT if i change the "mainroms" to "CM11" (foldername of my secondary rom) it reboot immediately.

/sbin/kexec --load-hardboot /data/media/0/bootmenu/CM11/zImage --initrd=/data/media/0/bootmenu/bin/ramdisk-recovery.cpio --mem-min=0x20000000 --command-line="$(cat /proc/cmdline)" --dtb=/data/media/0/bootmenu/CM11/dt.img

---------- Post added at 08:43 PM ---------- Previous post was at 08:40 PM ----------

you need adb on your pc. if you have "Backup TA" on your PC you will found adb in the tools folder.

SHIFT+rightclick in tools folder and klick on "start commandline here". now you'll have adb and can use these command without terminal ;D
[Xperia Z1 Original Android Development] abbychauhan:
Ur right completely forget about it.. Thanks
[Xperia Z1 Original Android Development] munjeni:
Thanks for this, it was excatly what I wanted! So cwm can not boot with cm kernels :( Did you tried with --mem-min=0x30000000 ?
[Xperia Z1 Original Android Development] SafiXS:
yes, also with 0x30000000. Do you thin you can found a solution for this? Most of the Roms are based on cyanogenmod -.-

Maybe abbychauhan get other results because he use other roms like i use
[Xperia Z1 Original Android Development] munjeni:
Hmm, by now I have no idea why it fail to boot with cm kernel. I had the same problem on Z1C + totaly understandable reason was... the same cwm compiled the day before worked with all kernels but the new one was not, I have fixed new one by changing some permissions (done the same for Honami) and it get worked, but on Z1 its not work :(
[Xperia Z1 Original Android Development] SafiXS:
can i read out the errors/warning who causes this error like with logcat?
[Xperia Z1 Original Android Development] ntmohammad:
mainrom cwm work fine , but for second rom it doesnt , it will stock on cwm boot logo ( i dont know the name of that picture , sry )

and my second rom is cm based , must it work on cm or its just for stock roms ?
[Xperia Z1 Original Android Development] abbychauhan:
We are also facing the same problems.. U can hold on.. munjeni is working on it

About the code check previous page - http://xdaforums.com/showthread.php?p=53255933
[Xperia Z1 Original Android Development] ntmohammad:
i only wanted to report , since kernel cwm is working fine
[Xperia Z1 Original Android Development] munjeni:
Hmm I thinking to add few lines to the init.rc for dumping recovery.log to the internal storage...
[Xperia Z1 Original Android Development] SafiXS:
i will do everything you need/wanted to find this beast in our z1 ;D

Explain me please what i have to do or gimme link to thread who explain dis

Edit:New bootmenu.img flashed, finaly bigger font! Thank you man ;D
[Xperia Z1 Original Android Development] munjeni:
Thats easy... simple need to put one service, for example something like this:

service dump /sbin/cp -fr /tmp/recovery.log /data/media/0/bootmenu/recovery.log ...just an example.

or few lines for example "on init" to mount internal storage first...
[Xperia Z1 Original Android Development] munjeni:
New bootmenu.img with new font is out, hope size of the font is good now :)
[Xperia Z1 Original Android Development] munjeni:
Will try to use cm ramdisk recovery init binary maybe my cwm init binary cause bootloop
[Xperia Z1 Original Android Development] SafiXS:
sorry, no plan what to do -.-. New bootmenu with bigger font looks very good thanks.
[Xperia Z1 Original Android Development] munjeni:
please try kexec with this recovery -> http://munjeni.homeunix.com/ramdisk-recovery.cpio and cm kernel
[Xperia Z1 Original Android Development] SafiXS:
CM Kernel cause reboot again

Sock work like before

have tried it with both 0x200... and 0x300...
[Xperia Z1 Original Android Development] munjeni:
You can see a black screen for about 10 secconds after boot logo, or it reboot imediately?
[Xperia Z1 Original Android Development] SafiXS:
immediately rebooting. after enter command "kexec -e" display is black and only 3 or 4 secounds later i will see bootmenu bootscreen not recovery bootscreen. it vibrates also only once

Its like a crash after kexec command. directly boot into bootmenu not recovery
[Xperia Z1 Original Android Development] munjeni:
Did you chose right dt.img for right zImage? Maybe dt.img you have used from another kernel... please double check that! Is your CM11 rom booting or he crash allso imediatelly?
[Xperia Z1 Original Android Development] SafiXS:
Doublechecked

1. repatched cm11 rom same results. no boot into recovery, instant reboot.

2. cm11 boot nice

3. i've devinitly have right recovery file in system because now the ui in your cwm is re scaled to small in mainrom cwm
[Xperia Z1 Original Android Development] munjeni:
Ok thank you for your time! I must go now, I am free next day and will definitelly look deeply into cwm to see what might be a problem, You can try if you have more free time to extract recovery.ramdisk.cpio from cm11 rom and try with these cwm if will boot with most kernels! Good night, bye!
[Xperia Z1 Original Android Development] SafiXS:
i will do what i can ;D

Good night dude and thanks for you efforts!
[Xperia Z1 Original Android Development] SafiXS:
Okay Dude,

i've extracted recovery.ramdisk from FXP CM11 Kernel and replaced it with the recovery.ramdisk in /bin folder of bootmenu

ramdisk-recovery.cpio if needed

Result:

Primary Stock Rom with Doomkernel

0x200... recovery boot fine

0x300... recovery boot fine

with bootmenu recovery boot fine

Secondary CM11 Rom with Stock Kernel

Crazy things happend, first boot in recovery with bootmenu stucked on Recovery Bootscreen. After reboot i'll retry it in bootmenu and it instant reboot. now i tried adb method with 0x300... cause instant reboot. After that i tried 0x200... with adb method and recovery boot fine. To be sure it will work i reboot and retry adb 0x200 method with instant reboot -.- again adb 0x300 causes reboot again adb 0x200 recovery boot the last time. i've tried many many methods to find a system behind but recovery dont boot anymore o.O

Now im tired, gn8 community ;D
[Xperia Z1 Original Android Development] SafiXS:
Update:

Today i retry some methods to boot cwm for cm11.

i recopy your own ramdisk (this one with bigger font) in bin folder and start to boot in cm11 cwm. It boot in it

i connect device to pc and make 5 boots in cwm with the 0x200... method, all 5 boot into cwm

i risk to trie 0x300 method with instant reboot. since i do this, i dont get cwm anymore to boot.

this sounds very crazy o.O
[Xperia Z1 Original Android Development] munjeni:
Did you doing command: "sync" before "kexec -e" ? If you get few boots but few no boots than definitelly thats crazy, for example I realy not understand why only cwm ramdisk sometimes fail to boot but cm11 rom ramdisk never fail to boot, so definitelly something is cwm related (but allso, kexec allso sometimes can get troubles if mem-min parameter is not valid since temporary data loaded to the ram sometimes get overwriten by boot proces if mem-min parameter is not valid). I have no idea how to find free ram memory range which will be used for kexec ANG GET NOT OVERWRITEN by boot!

cat /proc/iomem looking like:

Red lines is ram memory. We need to find ~50mb of the memory (??) which will be not overwiten on boot. I will research Google about kexec problems, maybe I get something interesting related to the "data overwrite"... But again, crazy thing for me and not understandable for me is why rom ramdisk never fail to boot but only cwm ramdisk sometimes fail to boot :( It must be something cwm related if I am not wrong? :(
[Xperia Z1 Original Android Development] munjeni:
And one more crazy thing is: I am unable to make permanet last_kmsg log! I never got last_mksg, probably its not working in kernel!!? You can see memory is alocated and reserved for last_kmsg (7ff80000-7ffa0fff : last_kmsg

) but why its not working I have realy no idea! I have tried to enable them permanetly by changing line 35 (static int ramdump_mode) to (static int ramdump_mode = 1) which mean permanently enabled (??) but its not working and I have no idea why its not working :( So we can not debug kernel if there is some faults kexec related since we have no last_kmsg dump! :( I will try to enable cwm loging to dump logs on every boot directly to the internal storage bootmenu folder, hope we locate our crazy problem.
[Xperia Z1 Original Android Development] SafiXS:
Hey Buddy,

sorry for delay.

I'm no Pro in android programming, so i need help with some commands like kmsg log or similar. I only know some basics in adb

---------- Post added at 04:47 PM ---------- Previous post was at 04:26 PM ----------

Yes Sir, sync and kexec -e i done every time. Rom boot every time without any problem.

you have a very hard project dude :D respect ^^