yashsingh1/xdaforums huggingface dataset:
[Xperia Z1 Original Android Development] munjeni:
ROM ramdisk modifications

For example CM11 ramdisk.

when you unpack cm11 boot.img, when you unpack ramdisk you will notice 2 ramdisks, one is rom ramdisk and one is recovery ramdisk (ramdisk.cpio and ramdisk.recovery.cpio). Look into previous post for CWM ramdisk modification.

Modification for ROM ramdisk (ramdisk.cpio):

init.rc file:

look for line "mkdir /system", added one line before these line: "mkdir /sde"

fstab.qcom:

the same like you done on CWM ramdisk!

init.qcom.rc:

look for lines:

add:

red line "cm11" mean that you have created cm11 folder in boot menu and use these folder for example for booting into cm11! On these "cm11" folder you have created partitons, ramdisks, kernel...etc!
[Xperia Z1 Original Android Development] munjeni:
updater script in rom zip modification

For example you want to install cm11 in multiboot, ok, download an rom, for example download CM11 by FXP or one by Cyanogenmod, open zip, find, open and modify updater-script and change all lines:

1. for system:

.........."/dev/block/platform/msm_sdcc.1/by-name/system"............

change to:

.............."/dev/block/loop1"..............

2. for userdata:

............."/dev/block/platform/msm_sdcc.1/by-name/userdata"............

change to:

..........."/dev/block/loop2"................

3. for cache:

........"/dev/block/platform/msm_sdcc.1/by-name/cache"..........

change to:

..........."/dev/block/loop3"...........

4. for boot:

.........."/dev/block/platform/msm_sdcc.1/by-name/boot".........

change to:

............"/dev/null"...........

Note:

To understand this step. You doing these modifications since you going to install rom to partitions which you created on your internal sdcard! For example: if you not modify ramdisk, your rom will be installed to your phone partitions instead of one created by you! So to install rom to partitions which you have created, you must modify updater script to point installation to install rom into partitions which you created earlier instead of intalling them to regular partition! If you install rom to regular partitions that mean you will overwrite your main rom and bootmenu, so you will boot into cm11 on reboot instead of buting into multiboot! Hope thing clear?
[Xperia Z1 Original Android Development] munjeni:
Creating menuentry for new rom in multiboot (boot menu) settings.ini

Since you created partitions, since you modified ramdsiks, since you created kernel (sorry I removed post entry related to kernel modification... I will instruct you later!), since you modified rom zip which you want to install... you are ready for flashing! Before flashing rom to partitions, you need to add menu entry in settings.ini of the bootmenu!

How to add new rom entry to boot menu:

For example you created all partitons in .../bootmenu/cm11 folder

For example you have system.ext4, data.ext4, cache.ext.4, initrd.gz (modified cm11 ramdisk), and Zimage-dtb (modified CM11 zImage) in cm11 folder

Ok now you can add menuentry to setting.ini:

You are done! Title you have defined in "menutitle" will be displayed in boot menu!

Now you need to boot into cm11. When you boot into cm11 you will get "timing for recovery boot, led light!", if everything is propertly modified in all of the things you will get lucky to see led light where you need to pres volume button to get into recovery! If you enter into cm11 recovery that mean that you are in sucess :), Ok now install your modified rom zip package (in these step cm11 will be installed to partitions which you have created earlier) and you are done! Reboot and enjoy cm11 in multiboot! The same steps is for all roms which you want in multi boot! Max roms is 10!
[Xperia Z1 Original Android Development] munjeni:
Not for noobs but hope our things is clear now for experienced users?
[Xperia Z1 Original Android Development] guddu2011:
still same, no signal
[Xperia Z1 Original Android Development] munjeni:
Ok, please give me logcat and dmesg, want to see why its happening on your phone
[Xperia Z1 Original Android Development] guddu2011:
here you go
[Xperia Z1 Original Android Development] munjeni:
Thanks! From what I can see in your dmesg problem is kernel (PBL complaining), constanly loop on failed atempt to wake up modem:

I have no idea why thats happening, but there is 3 reason probably: 1. Something related to the TA (maybe you need to restore your ta backup and reinstall everything by SPCC because something sw based is broken in your phone) "see lines related to the TA in your logcat!", 2. your phone model is not compatible with kexec, 3. or you have missing something from the latest update by Sony). Did you updated your phone to the latest kitkat by Sony PC Companion? If not than do you mind to reinstall everything including to restore your ta backup and use Sony PPC to try to repair phone completely with fresh Sony firmware (if you going to do it please do not use ftf and flash tool, do it with oficial Sony PC Companion software!). Let me know!
[Xperia Z1 Original Android Development] ikenley:
So can I use CM11 as my main rom and then load Sony stock rom to make the most of its camera?
[Xperia Z1 Original Android Development] munjeni:
Curently stock roms or stock based roms is not supported in two click solution! Reason you can se here -> http://xdaforums.com/showpost.php?p=52875418&postcount=154 . But if you have skills in patching ramdisk of the stock rom manually than you can install stock rom as a seccond rom - tutorial is some pages back! :)
[Xperia Z1 Original Android Development] abbychauhan:
I am Not using Multi Boot now (Will do it as soon as i get time) but im on AOSP ROM only and all three worked for me.. But as u said that "no signal on all of them on secondary rom,

but working on main rom

" try the solution given by munjeni.
[Xperia Z1 Original Android Development] guddu2011:
did every possible way to solve this thing.. still no luck.. can u try this?
[Xperia Z1 Original Android Development] guddu2011:
this kernel is not booting, there no kernel sceen also, just screen flickering 2 times and loop
[Xperia Z1 Original Android Development] munjeni:
Please try this one

removed
[Xperia Z1 Original Android Development] guddu2011:
not even flickering this time, just blank screen. i thought i hard bricked my phone :P
[Xperia Z1 Original Android Development] munjeni:
Hmm interesting thing (not belivable) is http://developer.sonymobile.com/dow...s/open-source-archive-for-build-14-3-a-0-757/ can not boot, wtf! Anyone have idea why? Current host kernel is from Krabappel2548 git (Sony 14.2.A.0.290 fw sources) which is an old kernel, we need a new one, but new one can not boot :( I am sure new one will solve problems like you have.
[Xperia Z1 Original Android Development] guddu2011:
[MENTION=2784807]DooMLoRD[/MENTION] please help :(
[Xperia Z1 Original Android Development] munjeni:
I can fix kernel on Z1 but I am Z1C owner so I can not test, maybe some one give me last_kmsg from failed boot? Here is short how to -> http://xdaforums.com/galaxy-nexus/general/how-to-t2093987
[Xperia Z1 Original Android Development] abbychauhan:
Any Light u see on ur phone.. Red or something??.. Please follow this http://xdaforums.com/showthread.php?t=2574764
[Xperia Z1 Original Android Development] ntmohammad:
i want to flash a flashable zip on cm11 on second rom.(aka a font package or supersu) so is there a way to patch it ? or i have to modify its update-scrpit manually ?
[Xperia Z1 Original Android Development] sumedh123:
can u just tell me where is the tutorial for installing stock based roms.

thank you
[Xperia Z1 Original Android Development] ntmohammad:
deleted
[Xperia Z1 Original Android Development] munjeni:
Are you lazy to find this -> http://xdaforums.com/showthread.php?t=2717546&page=2 ??? :(

That is not a purpose of the two way solution! I have created multiboot.sh for making things easy, but since you guys continue to complicate our things, since no one dev going to help here, since I have no Z1 to test all things, since latest Sony open archive kernel source can not boot, since blabla... I thinking now to stop support for Xperia Z1, sorry! If some one manage to compile and boot latest kernel open sourc from Sony developers world than send me a pm and let me know how can I compile new kernel, than I will give you a new bootmenu version. By now I will be silent in Z1 bootmenu thread until some one get a success in new Sony kernel build procedure! Kernel is here -> http://developer.sonymobile.com/dow...s/open-source-archive-for-build-14-3-a-0-757/ good luck! You can tell Sony about broken kernel archive, hope Sony reupload a new working one. Bye!
[Xperia Z1 Original Android Development] DooMLoRD:
kernel sources are perfectly fine...

use these if you want build-able kernel...

https://github.com/DooMLoRD/android_kernel_sony_msm8974/tree/sony_sources
[Xperia Z1 Original Android Development] munjeni:
Thanks but latest Sony archive can not boot! I will merge with your kernel to see what is a broken. I used honami_row defconfig, did you used the same?
[Xperia Z1 Original Android Development] DooMLoRD:
yup...

i keep merging the changes from upstream sony patches into my kernel...
[Xperia Z1 Original Android Development] munjeni:
Complete merge or partial merge? Are you sure kernel is bootable?
[Xperia Z1 Original Android Development] DooMLoRD:
yes very much!

i had added the changes to my kernel on April 10:

https://github.com/DooMLoRD/android_kernel_sony_msm8974/commits/master_kk-4.4.2?page=3

after that there were atleast 7 kernel versions released so i am sure about that :D
[Xperia Z1 Original Android Development] munjeni:
Ok thanks! Lets see what is missing in Sony kernel (probably your latest 757 merge have something from old merge which is missing in latest Sony archive) :)
[Xperia Z1 Original Android Development] munjeni:
Hey Doom, probably you have no merged latest Sony archive, see this big diferencie between your git and latest Sony 757 archive -> http://pastebin.com/mLT7Akzn There is a TOOOOONNNNN of diferencie, probably you have partialy merged them??? Or Sony uploaded a new one, I have no idea why there is a big diferencie, there is an mess for sure, so thats a reason why its not working on Z1 (but working on Z1C)! I am sure that you have no latest Sony changes in your git!

Edit:

One more thing... did you see mach-msm/memutils ...maybe we can make new root tool by hacking kernel memory using memutils from userspace?
[Xperia Z1 Original Android Development] DooMLoRD:
you seem to be working on a compiled kernel source...

do a:

make distclean

and then check

i am also downloading the sources again:

http://developer.sonymobile.com/dow...s/open-source-archive-for-build-14-3-a-0-757/

and comparign with my git tree:

https://github.com/DooMLoRD/android_kernel_sony_msm8974
[Xperia Z1 Original Android Development] DooMLoRD:
why are u comparing against my main kernel? main kernel has loads of changes feature wise

you should compare on sony_sources branch
[Xperia Z1 Original Android Development] munjeni:
No since I done make distclean and make mrproper !
[Xperia Z1 Original Android Development] munjeni:
Ok, let see diferencie...
[Xperia Z1 Original Android Development] DooMLoRD:
ya i am also checking right now...
[Xperia Z1 Original Android Development] munjeni:
There is a TON on diferencie in sony_sources branch -> http://pastebin.com/iw3MRWcz

Edit:

I will download Sony archive again and compare with your git, meybe I have an old kernel :eek:
[Xperia Z1 Original Android Development] munjeni:
Ohhh MG, I have an old kernel :o:o:o wtf thats happened and why thats working on Z1C perfectly but not on Z1 ... definitelly have no idea from where come these kernel source to my hard disk :eek: Thanks a lot for your time, you helped me a TON!
[Xperia Z1 Original Android Development] DooMLoRD:
here is the diff with sony sources and my git (sony sources branch)

doomlord@doomstorage:~/sources$ diff --exclude=.git -r ~/git_repos/android_kernel_sony_msm8974 ~/sources/14.3.A.0.757/kernel > diff_git_vs_sony-z1-757.diff

doomlord@doomstorage:~/sources$ cat diff_git_vs_sony-z1-757.diff

doomlord@doomstorage:~/sources$ ls -l diff_git_vs_sony-z1-757.diff
-rw-rw-r-- 1 doomlord doomlord 0 May 28 14:35 diff_git_vs_sony-z1-757.diff

doomlord@doomstorage:~/sources$

EXACTLY THE SAME :D
[Xperia Z1 Original Android Development] munjeni:
Use this patch if you need my version kexec patch (better memory reservation and KEXEC_HB_PAGE_ADDR at 0x7FE00000 which is better than krabappel2548's one), thanks again! :good:
[Xperia Z1 Original Android Development] munjeni:
Here is new version of the bootmenu.img, please let me know if there is no more network signal isue!
[Xperia Z1 Original Android Development] zhuoyang:
Thank you for your hard work [MENTION=4120742]munjeni[/MENTION] , I'lll try this later.

btw, what a coincidence to see your work again on the Z1, I've been used your ROM when I am using HTC Aria.
[Xperia Z1 Original Android Development] munjeni:
Hi, only bootmenu, nothing more for Z1
[Xperia Z1 Original Android Development] guddu2011:
still same. no signal :(
[Xperia Z1 Original Android Development] munjeni:
Please give me dmesg! My I ask 2 questions:

1. are you 100 percent sure you not using any external kernel other than these from patched zip?

2. did you restored ta backup and updated your phone to the latest Sony KitKat by using Sony PC Companion software?

Too all - anyone have network signal problem?
[Xperia Z1 Original Android Development] Chocolatetrain:
I've never had any of these problems, also btw, the bootmenu is now more responsive for me.
[Xperia Z1 Original Android Development] guddu2011:
1. yes no external kernel only patched zip your bootmenu created.

2. took me a day doing so :P did it day before yesterday

i think C6902 models are facing this issue as they both have different modems. btw i flashed 6902 patch but still no network
[Xperia Z1 Original Android Development] munjeni:
Is there any kernel patch for 6902 ?
[Xperia Z1 Original Android Development] guddu2011:
not a kernel patch just modem flash zip

here is a link to it

http://xdaforums.com/devdb/project/dl/?id=953
[Xperia Z1 Original Android Development] abbychauhan:
I dont think so there is specific Kernal differences for C6902 and C6903.. only modem Difference.. I might be wrong.. as im saying this because i have used pimped kernal and its same for both models.. i think [MENTION=4752917]Androguide.fr[/MENTION] can give some suggestion..
[Xperia Z1 Original Android Development] guddu2011:
can you try multiboot and see if its working for you?
[Xperia Z1 Original Android Development] munjeni:
Bootmenu is working for sure, but seems only C6902 have a problem after kexec open a new kernel (probably some chips was not reset corectly... I will check). Problem by now is I can not see last_kmsg for looking into last kernel message from host kernel! I will enable LAST_KMSG in defconfig, will compile a new kernel just for you only, you will try (?) and give me last_kmsg (cat /proc/last_kmsg) after you see no signal, ok? I will let you know when I make new bootmenu.img !

In dmesg I can see some problems but these information is not enought since we need to look into dmesg from host kernel but in order to see these log I need to enable support for last kmsg and compile new host kernel. In your dmesg (not host kernel) I can see:

So probably there was an unclean kexec reboot so some chips was confused. I need to see dmesg from host kernel than start locating our problem on c6902, without them I can do nothing by now :) But allso there maybe will be no fix since "PBL returned unexpected status" which mean there was some comunication with PBL (primary boot loader) so if something is related PBL side we can do nothing for them. With your help maybe we get a fix for signal.

Edit:

I think this is a not good:

Allso arch/arm/kernel/machine_kexec.c ...there is a missing something. For example there is a missing irq disable, fiq disable...etc in reboot part... I wil try something now.
[Xperia Z1 Original Android Development] zhuoyang:
Hi , I have a few question

1.now PAC ROM is my main rom and i wanted to install stock rom as secondary rom.

The stock rom I wanted to install has no kernel in its zip file, can I just patch the doom kernel zip, and flash the rom's zip then flash patched zip ?

2.is it better to install stock rom as main rom and PAC ROM as secondary rom?

3.where does the secondary rom's data partition store?

4. How to update kernel ? AFAIK , kernel need patching before we can use it in the boot menu.
[Xperia Z1 Original Android Development] munjeni:
1. First of all... stock roms or stock based roms can not be installed using two click solution via bootmenu! I will add support soon! By now only CM or AOSP based roms is supported in two click solution! If you realy want stock rom or stock based rom as a seccond rom than you will need to make all changes manually!

2. yes, install stock rom or stock based rom as a main rom, than you can install (via two click solution) every CM or AOSP based rom

3. data partition and internal storage of the seccondary rom is dedicated (file based) so you can not see your main rom internal storage

4. if you want CM or AOSP based rom as a seccond rom than bootmenu will patch all for you (that is a purpose of the my 2 click solution :))

If you realy want stock rom as a seccond rom than you will need to patch everything manualy - if you want to patch stock kernel manualy than use my tool (kernel_dump and kernel_dt) from bootmenu/bin folder. Kernel_dump will extract zImage, ramdisk and dt, but kernel_dt will patch zImage and append dt to them (thats needed for bootmenu). Hope things clear. :)
[Xperia Z1 Original Android Development] munjeni:
Here is a new kexec_patch (no more kexec_hardboot_hook!)...
[Xperia Z1 Original Android Development] munjeni:
There is a 5 diferent defconfigs so definitelly there is a diferencie! CM kernel is another story and support booth devices since kernel is a LOT diferent than stock one! On stock kernel we have 5 defconfigs:

1. rhine_honami_brazil_defconfig

2. rhine_honami_dcm_defconfig

3. rhine_honami_kddi_defconfig

4. rhine_honami_row_defconfig

5. rhine_honami_tmous_defconfig

If you compare you will see why diferencie is there. :) On CM kernel, probably some one allready added support for booth devices.
[Xperia Z1 Original Android Development] munjeni:
New version for [MENTION=3853774]guddu2011[/MENTION], please let me know about signal isue

I have used a red one for host kernel, Host kernel is stock kernel based since I am unable to get working kexec using CM kernel source code! So if you know what is right one defconfig for your phone than please let me know and I will compile a new bootmenu for you!

1. rhine_honami_brazil_defconfig

2. rhine_honami_dcm_defconfig

3. rhine_honami_kddi_defconfig

4. rhine_honami_row_defconfig

5. rhine_honami_tmous_defconfig

Attachment moved to the first post!
[Xperia Z1 Original Android Development] zhuoyang:
Okay, I am done flashing stock rom as my primary rom and I patched doomkernel v18 using bootmenu, after selecting mainrom in the boot menu it take about 2 minutes to boot to kernel screen , is it normal ?
[Xperia Z1 Original Android Development] munjeni:
Try new bootmenu from previous post and let me know! Simple reflash with:

fastboot flash boot bootmenu.img
[Xperia Z1 Original Android Development] zhuoyang:
This time I used a proper stopwatch to count the boot time, seems like both version of bootmenu also takes around 50 second.

EDIT: Installed second rom (PAC ROM with Pimped kernel) and it only takes 5 sec to boot to kernel screen.

btw how do i install gapps ? just install it in recovery ?
[Xperia Z1 Original Android Development] Chocolatetrain:
The problem is non-existent with aosp roms, doomkernel is the only problem with the time it takes to boot
[Xperia Z1 Original Android Development] guddu2011:
still no luck :(
[Xperia Z1 Original Android Development] Chocolatetrain:
Could somebody help me? I've been trying to boot from the external sd for a while and this is the furthest i've got, http://d-h.st/hKA#.U4e6PPnxpaQ

What am i doing wrong? When i go into recovery it says unable to mount cache, data and system, this is the log; http://d-h.st/u3A#.U4e61_nxpaQ

What do i do now :(
[Xperia Z1 Original Android Development] munjeni:
Yes! But to be sure gapps not install to the your primary rom... open updater-script from gapps package and double chech if there is no lines:

/dev/block/platform/msm_sdcc.1/by-name/*******

if you see these lines than you will need to patch them before install ! On page 2 you have tutorial for updater-script modification! If there is no these lines than simple reboot to the recovery of these rom and install gapps or whatewer you want!
[Xperia Z1 Original Android Development] munjeni:
Hmmm thanks! I will compile all 5 defconfig diferent bootmenu, hope one of these get working :(
[Xperia Z1 Original Android Development] munjeni:
Probably true! But I have no idea why thats happening.
[Xperia Z1 Original Android Development] munjeni:
Sorry but 2 click solution is hard work only possible since you need a hard work to optimise multiboot.sh! There is 2 important reasons:

1. multiboot.sh script can not run from external storage since external storage is vfat so you can not run linux script from vfat partition !

2. bootmenu is programed to send argument to /data/media/0/bootmenu/multiboot.sh so multiboot.sh must be on these path! But than there will be one problem related to the booting from external sdcard: bootmenu is designed to detect bootmenu folder booth in external or internal storage, priority have internal storage! So if internal storage contain folder bootmenu than bootmenu will automaticaly switch to use internal storage! Probably you will need to hard work if you need to use externl storage since you will need at end of your patchig to delete whole folder bootmenu from internal storage after you patch all your roms! You have 2 solutions only:

1. solution one (easy solution) - modify multiboot.sh to patch your rom to prepare them for external sdcard booting

2. solution two (hard solution) - patch your roms and ramdisk, kernels...etc manually without needs for using multiboot.sh script

Here is a bit modified multiboot.sh, hope you understand that multiboot.sh with all binaries in bin folder must be on /data/media/0/bootmenu path, hope you understand that you must delete whole folder bootmenu from internal storage when you finish your rom pathing! Good luck! :)
[Xperia Z1 Original Android Development] Chocolatetrain:
Yeah I finally learnt how the boot menu works so I know this, and thanks, I might just have to go with the manual option after this :P
[Xperia Z1 Original Android Development] abbychauhan:
Actually I'm in middle of very important week.. Don't have time to do something new.. I can understand the pain And the problems for C6902 as there are lack of testers for c6902.. Will surely let u know and munjeni.. Also I have sent u a pm plz check

---------- Post added at 07:52 PM ---------- Previous post was at 07:50 PM ----------

My bad u know the best.. Thanks
[Xperia Z1 Original Android Development] zhuoyang:
[MENTION=4120742]munjeni[/MENTION] , Anyway to put the system.ext4 into /system partition ?, our system partition is too large, so i think we could make use of it.
[Xperia Z1 Original Android Development] munjeni:
Things is already complicated for noobs so I no want to complicate more! Everything is in first post and thats easy solution so I recomend everyone to install tgings folowing instructions from first post! If you are experienced user than you can do whatever you want, but if you are a noob than folow first post. :)
[Xperia Z1 Original Android Development] abbychauhan:
Hi there [MENTION=4120742]munjeni[/MENTION] I have some time now.. Please guide me.. For testing.. I have to follow the instructions in OP only? Any other added instructions? Plz provide boot.img for C6902

I'm currently on PA 4.3 beta 7
[Xperia Z1 Original Android Development] munjeni:
Yes folow op carefully and you will get them working (not sure if you will get mobile signal since your device is c6902 !) ...you can try and let me know! Good luck! :)