yashsingh1/xdaforums huggingface dataset:
[Xperia Z1 Original Android Development] abbychauhan:
Give this command in Terminal emulator -

mount -o remount,rw /

mkdir /external_rom_partition

losetup /dev/block/loop1 /data/media/0/bootmenu/u ll have to put the name of the folder here go to folder named bootmenu and inside that check the name of folder of the desired rom/cache.ext4

mount -t ext4 /dev/block/loop1 /external_rom_partition

you are done

Open file explorer and go to -

/external_rom_partition

to see your files in cache partition of your rom

When you finish than dont forget to umount partition and delete loop1

Give this command -

umount /external_rom_partition

losetup -d /dev/block/loop1

rmdir /external_rom_partition

mount -o remount,ro /

I am having no errors.. But inside "/external_rom_partition" I see its empty.. U check urs is it empty too

---------- Post added at 03:19 PM ---------- Previous post was at 02:51 PM ----------

Something is wrong with the command, I have checked it with cache.ext4 , system.ext4 and data.ext4 .. In all of them the folder /external_rom_partition is empty
[Xperia Z1 Original Android Development] gregbradley:
Already done that

The mkdir /external_rom_partition comaand works fine as makes the directory. As you say it empty.

The error is in the losetup command. It says no such file or directory

I am doing this from the secondary rom and want to link to the external SDcard of the main rom. The main rom folder is still called "mainrom" I sued that and it does not work....
[Xperia Z1 Original Android Development] munjeni:
Hi, thanks for suggestion, but I have plan to add support for changing theme and font color (another settings.ini) but I have no free time to play with bootmenu, I will do it next time when I get playing with bootmenu, for sure!
[Xperia Z1 Original Android Development] munjeni:
Seccond rom partitions is dedicated! So data, cache, system and internal storage is dedicated on every "seccond" rom! To get into bootmenu which is located on MAINROM dedicated partition (data partition) you must mound data partition of the mainrom! To do it do:

- adb shell

- cd /

- mount -o remount,rw /

- mkdir /mymainrom

- mount -t ext4 /dev/block/platform/msm_sdcc.1/by-name/userdata /mymainrom

Than your bootmenu and whole data folder of the mainrom will be inside folder "/mymainrom" ! So bootmenu will be on /mymainrom/media/0/bootmenu :)

Do not forget to umount them when you finish your things (umount /mymainrom) ;)
[Xperia Z1 Original Android Development] munjeni:
You can not patch mainrom twice because if you do it twice your cache.ext4, data.ext4 and system.ext4 will be empty since mainrom not working by that way! If you patch your mainrom twice bootmenu thinking that you want to install mainrom as a seccond rom! But if you delete one of the files (zImage, dt.img, initrd.gz) than you can perform mainrom step since bootmenu is programed to check if these 3 files exist by this way: if files exist than mainrom step is not performed (bootmenu think that you not complete mainrom step!), but if you not delete one of these files than bootmenu think that you completed mainrom step and thinking that you installing mainrom as a seccond rom! ;) Thats a bit confused but I have no better way to make that simple since all things is allready complicated since whole bootmenu idea was not to use multiboot.sh (automated and easy rom patching script) since it was programed to use manualy patching procedure, but I improved all things a bit and done our automaded procedure. :) Yes, its a bit complicate if you not understand how things working, but if you understand our multiboot than I think its very easy! First of all you must understand bootmenu.

You must understand diferencie between mainrom and seccond roms:

- Main rom use internal partitions of the phone (/dev/block/platform/msm_sdcc.1/by-name/XXX)! It not use any file based partition like seccond roms!

- Seccond roms use file based partition (data.ext4, cache.ext4, system.ext4 located on your bootmenu folder)!

Internal storages:

- mainrom (mainrom internal storage is on /data partition). Bootmenu folder is on internal partition of the main rom.

- seccond roms internal storage is on (data.ext4 file based partition located in bootmenu/ROM_NAME folder) so all internal sdcard files is on these file based partition (data.ext4) and you can not see internal storage of the main rom since its dedicated!

External storage:

- external storage partition (external sdcard) is shared between all roms (mainrom, seccond roms), yopu can access them in all roms.

To access dedicated partitions:

- you must mount them first!

Hope things clear now?!
[Xperia Z1 Original Android Development] munjeni:
Things is not easy since update.packages is not "standard" like "complete" rom packages! For example some of the packages (for example Superuser package) have no updater-script, it have updater-binary which is in binary form and not in text form, so there is a problem patching them "by an automated script" ! SO from these reason I thinking to not include another submenu in bootmenu since I found no way to program them into bootmenu for auto patching since its so hard making them automated! If you have good idea how we can do it "safetu" than please post your idea here!
[Xperia Z1 Original Android Development] dolly.anupriya:
Whattt me??? I am not a expert like u, that was just a humble request but i know you will find a solution.

Anyways thanks for the humble reply

Sent from my MultiBooted XZ1
[Xperia Z1 Original Android Development] gregbradley:
My second rom shows a blank external sdcard. in my main rom everything is fine.

I want to be able to access the external sd card from the second rom....but it shows an empty folder...
[Xperia Z1 Original Android Development] dolly.anupriya:
Not a problem in mine, i can access to external sd card via second and third ROM and its not empty, its in "/ ext_card"

That is something different problem that you are facing.

Sent from my MultiBooted XZ1
[Xperia Z1 Original Android Development] gregbradley:
No that's blank as well

In the storage options in settings to says that the sdcard is 0bytes and has 0 bytes available

However, when I remove it I get the removed sdcard unexpectedly warning and when I put it back in I get preparing sdcard...

but it remains at 0 bytes

All works fine in my main rom...

maybe its a problem with the second rom, but I cant see why it would be that
[Xperia Z1 Original Android Development] dolly.anupriya:
My Sd card is fat32 and its accessible from any ROM.. Why dont u create third ROM and see.. Even if that wont do then delete the second rom or batter whole bootmenu folder and again do the whole mainrom thing and second and third rom thing

Sent from my MultiBooted XZ1
[Xperia Z1 Original Android Development] gregbradley:
I was thinking that. I chose my second rom as it was the only one I could download at work. CM11 download sites are blocked.

My ext card is exFAT (64gb)

Trying an old sdcard (2 gb FAT) works. So problem identified, I can sort a solution out now

Thanks
[Xperia Z1 Original Android Development] dolly.anupriya:
Your welcome..

That means ur second ROM doesn't support exfat.. U can use PA, it has got exfat support

Sent from my MultiBooted XZ1
[Xperia Z1 Original Android Development] munjeni:
Most probably true! Is possible formating 64gb shdc to fat32 ?
[Xperia Z1 Original Android Development] dolly.anupriya:
That could be done but it might or might not work properly, exfat for more then 4gb and fat32 for less then 4gb (as i have read somewhere and exfat support large sized files too). But my MC is 32gb and its fat32 but if i keep a file or movie bigger then 1.5gb it gets corrupted, Thats the downlow of fat32

Sent from my MultiBooted XZ1
[Xperia Z1 Original Android Development] gregbradley:
Its not a big issue, I will download PA and CM11 and have them as second and third rom

I just wanted to know it was not an issue with multi boot before I carried on..

Thanks again
[Xperia Z1 Original Android Development] abbychauhan:
I have exfat 32gb works fine with PA and AOSB
[Xperia Z1 Original Android Development] adamkx7xdesire:
OK I can't flash Gapps for PA 4.4RC2 (as a second rom)...

I didn't find any lines "/dev/block/platform/msm_sdcc.1/by-name/*******" in updater-script....

the PA CWM recovery returns an "status 7" error...

What should I do?
[Xperia Z1 Original Android Development] Chocolatetrain:
Reboot and try again, I sometimes have mounting issues on the first try.
[Xperia Z1 Original Android Development] adamkx7xdesire:
nope :( I've tried few times... also it didn't work with minimal gapps neither with micro.. the same error "insufficient storage space available in system partition" ... "status 7"
[Xperia Z1 Original Android Development] SafiXS:
can you upload the script as txt and I will take a look into it

Gesendet von meinem C6903 mit Tapatalk
[Xperia Z1 Original Android Development] adamkx7xdesire:
Here you go... from full pa gapps :)
[Xperia Z1 Original Android Development] Chocolatetrain:
Maybe there is insufficient storage available? ?

Modify the script to make the system partition to be bigger, I have mine at 1gb just in case. ;)
[Xperia Z1 Original Android Development] adamkx7xdesire:
Yeah ok but... as I can see in the multiboot.sh script there is:

### create file based partitions

echo "____________ creating file based partitions"

echo ""

GAPPSSIZE="25600"

ZIPSIZE=`ls -l $ARG | awk '{print $5}'`

ZIPSIZEMB=$(($ZIPSIZE / 1024 /1024))

SIZECALC=$((($ZIPSIZEMB * 1024 * 1024) / 4096))

SIZECALC=$((($SIZECALC * 2) + $GAPPSSIZE))

which I think means that the gapps should be max 256mb.... than the partition created is size of rom.zip+gapps... so if even full gapps doesn't fit (269mb) than minimalist or micro gapps should fit without any problem ... or am I missing something?
[Xperia Z1 Original Android Development] SafiXS:
Link two posts later! give it a try

DONT FORGET TO RECONVERT IT TO A NORMAL TXT FORMAT, docx is not supported by update binary

Gesendet von meinem C6903 mit Tapatalk
[Xperia Z1 Original Android Development] adamkx7xdesire:
error status 6 :P

i think it's because of chars which was converted by microsoft office... I'll delete this few lines from the original script and see if it will do the work
[Xperia Z1 Original Android Development] SafiXS:
https://drive.google.com/file/d/0B4-tw1zxYiJyY0FSRWxwQTVFQTQ/edit?usp=sharing once again, only delete .txt on end and copy in right place. if it's don't work use cm gapps [emoji3]

Gesendet von meinem C6903 mit Tapatalk

---------- Post added at 11:53 PM ---------- Previous post was at 11:41 PM ----------

http://xdaforums.com/google-nexus-5/themes-apps/standard-minimal-gapps-t2012857

This one works for me

Gesendet von meinem C6903 mit Tapatalk
[Xperia Z1 Original Android Development] hxq88:
i followed guide in #4 but in multibot UI i cant find bootmenu folder, i reflash kernel.img to enter rom, re-check the folder is in internal memory already but i cant see it in multiboot UI :confused: what wrong with me ? can i patch main rom from SD card ?
[Xperia Z1 Original Android Development] gregbradley:
its not in the UI.

Extract the multiboot.rar and put the contents on your internal memory. Then put the kernel of your main rom in the mainrom folder in the bootmenu folder on your internal memory.

Now you need the .zip you used to flash your main rom. Put it on your ext sdcard.

reboot to multiboot and choose patch main rom

navigate to the .zip of your main rom and patch it.
[Xperia Z1 Original Android Development] abbychauhan:
Ok i did a little Edit of Post #4 .. Now check.. Hope things will be clear now
[Xperia Z1 Original Android Development] gregbradley:
That's not right

I put the .zip on my external memory card, it works fine. The kernel.elf or boot.img must be inside the mainrom folder in the bootmenu folder int he internal storage but the mainrom.zip can be on external sdcard
[Xperia Z1 Original Android Development] abbychauhan:
Well thats some modifications from ur side.. Because my instructions are based on munjeni's instructions.

Anyways thats good to know
[Xperia Z1 Original Android Development] gregbradley:
hmmm, I followed your instructions :D

But it works with all the .zips on the sdcard, just the mainrom kernel in the internal sdcard.

I have made no modifications to the .sh, so it will work for everyone
[Xperia Z1 Original Android Development] munjeni:
You can patch zips booth on internal or external sdcard, but problem will be only for seccond roms if patched zip remain on internal storage since recovery of the these seccond rom will not see internal storage of the main rom since all partitions is dedicated except external sdcard! So everyone must put seccond rom packages to the external sdcard before patching!
[Xperia Z1 Original Android Development] hxq88:
wp project. I did it :D.

but boot time from bootmenu to mainrom boot logo is 1 min, is it normal? second rom boot very fast.
[Xperia Z1 Original Android Development] abbychauhan:
Yes its normal
[Xperia Z1 Original Android Development] hxq88:
i tried flash a custom kernel through secondary rom recovery but my bootmenu was wiped :D. how to flash kernel for secondary rom?
[Xperia Z1 Original Android Development] abbychauhan:
Check 7th point in Part 2 in post #4
[Xperia Z1 Original Android Development] gregbradley:
[MENTION=4120742]munjeni[/MENTION]

Another UI issue that could be improved on

I flash cm 11 to as my secondary rom and did not change the file name, which is quite long

So once the ROM was patched I had two entries with the file name going off the edge of the screen where the "patched" was added to the end of the file name. I knew the patched one would be the second one, but if you could add the word "patched" to the start of the file name that would solve that issue.

There may be better solutions, but its just an idea.

Greg
[Xperia Z1 Original Android Development] abbychauhan:
Thats a good suggestion.. I didnt face this problem because I always Change the Name of Zip files (Secondary ROMs) before patching as it helps when i receive a update to a ROM by keeping the same name of the updated zip file similar to the earlier zip file name for e.g. I had earlier pa_honami-4.4-RC1-20140610.zip so i changed its name to Paranoid_Android.zip , so when i receive an update pa_honami-4.4-RC2-20140617.zip i changed its name to Paranoid_Android.zip and did the Second ROM step and i have updated PA from RC1 to RC2 without loosing anything
[Xperia Z1 Original Android Development] munjeni:
You can change that in multiboot.sh script! In any way I have opened bootmenu source code bublic so everyone is free to use them and compile/improve things by self, I am a bit lazy now for playing with anything including bootmenu :o maybe later I will do something (first thing will be making "bind mounts" instead of using file based partitions, for that I need some more free time + good idea + free brain and it will be done :). I am more interested in kernel hacking since I saw some hacking principe in wp mod + maybe I will start working on miui rom, these 2 things I have in plan by now.
[Xperia Z1 Original Android Development] hxq88:
rename and re-patch package to update rom method is working with mainrom? or need do something else to update mainrom ?
[Xperia Z1 Original Android Development] abbychauhan:
Keep Safe the bootmenu Folder (Precautionary Step), then flash the Update ROM via MainRom-CWM and later on reflash the bootmenu.img and the put bootmenu folder back to its place

Keep in mind if changes to mainrom Kernel or updation of mainrom Kernel then place the boot.img or kernel.elf of mainrom into folder - "/bootmenu/mainrom" (The old bootmenu folder which u have kept safe) and patch the mainrom as specified in step one again.
[Xperia Z1 Original Android Development] hxq88:
thanks alot. I think you should add "how to update mainrom" to #4 :good:
[Xperia Z1 Original Android Development] abbychauhan:
Ya i ll do that when i ll have access to PC
[Xperia Z1 Original Android Development] SafiXS:
no replace dude, after patch mainrom there is no. img or. elf file anymore. if someone want to update kernel of mainrom they have to delete everything except the mainrom.zip from folder and push new boot.img or kernel.elf inside mainrom folder and patch.

thanks for your efforts for this faq

Gesendet von meinem C6903 mit Tapatalk
[Xperia Z1 Original Android Development] abbychauhan:
Yes.. Instead of replace (if old one exist then replace and if doesn't then place the new one) the new boot.img has to be placed in the mainrom folder and patching has to be done

Just no need to delete everything when we patch with new boot.img then old files will be overwritten

Edited the Comment Thanks for Correction
[Xperia Z1 Original Android Development] hxq88:
excuse me, but i stuck on custom kernel for secondary rom. How to add kernel to rom.zip? i did manually: extract, drag and drop, but it was fail cant have success patch :(
[Xperia Z1 Original Android Development] munjeni:
For mainrom? For mainrom updates you no need to patch anything, simple flash update than reflash bootmenu.img if update package overwrite your boot partition :)
[Xperia Z1 Original Android Development] abbychauhan:
And for mainrom Kernel changes? For eg. If i want to go from Stock Kernel to DoomKernal then?
[Xperia Z1 Original Android Development] hxq88:
[MENTION=4120742]munjeni[/MENTION]

It's able to custom size of data partition for each roms? edit multiboot.sh to change data size before patch them ( rom A: 1 GB data, rom B: 2 GB data)
[Xperia Z1 Original Android Development] abbychauhan:
Yes.. u already have the answer. "multiboot.sh to change data size before patch them"
[Xperia Z1 Original Android Development] munjeni:
Sorry but I not understand what are you mean! How its working? Where is stored system partition data? What mean "binding"? Etc...etc. Please explain me with an good example! :)
[Xperia Z1 Original Android Development] HypoTurtle:
Have a look at my sig. either Patcher or In Progress. In HD2 terms using loops was essentialy how the old SD ROMS were run (with the .img and ext2 files present on the fat partition of the sdcard.), binds are how the current NativeSD/DirectSD roms are run.

The conversion from a nand ramdisk to one that runs NativeSD/DirectSD (native uses one sdcard partition Direct uses 2) are run is fairly simple - remove/comment the yaffs/mtdblock references and executing a mounting script (like the one posted below).

How it works for the HD2 is the partition is mounted first to say /NativeSD and then the appropriate folder is mounted where it need to /NativeSD/$ROM_NAME/system to /system and /NativeSD/$ROM_NAME/data to /data.

Here's a sample mounter script (from my patcher), if that would explain things better...

#!/bin/busybox sh

# wait for 2nd partition ready
wait /dev/block/mmcblk0p2
wait /dev/block/mmcblk0p2
wait /dev/block/mmcblk0p2
wait /dev/block/mmcblk0p2

# check the ext4 fs
/bin/e2fsck -p /dev/block/mmcblk0p2 > /e2fsck.log

# mount the 1st (NativeSD) SD-EXT partition
/bin/busybox mkdir -p /NativeSD
/bin/busybox mount -t auto -o ro,noatime,nodiratime,barrier=0 /dev/block/mmcblk0p2 /NativeSD

# mount the system data app dir
/bin/busybox mount --bind /NativeSD/rOm/system /system
/bin/busybox mount --bind /NativeSD/rOm/data /data

# cleanup
# delete /bin to free ram
/bin/busybox rm -rf /bin

would this work with the z1?
[Xperia Z1 Original Android Development] munjeni:
Thats great idea! :) But things is prety the same since on your way you have runing them from sd parrition, but on my way it runing from file based partition, booth ways is the same since in booth ways we need to mess with ramdisk. Problem on z1 will be runing room on slow sdcards since rom lag a lot if sdcard is slow! So I runing them on internal storage since performanve have no changes and than rom is normaly fast! :)ootmenu support that! But I am not sure if our kernel support bind mount, probably it support! You can try! I not like to partition my sdcard since I can easilly delete every file based partition when I need more free space. In any way idea is good!
[Xperia Z1 Original Android Development] HypoTurtle:
I was thinking more of just using that as as example. using mount --bind on for example /data/media/0/bootmenu/folder_you_want/system to /system and the same for /data and /cache. Only thing I'm not sure about is if /data/media/0/bootmenu/folder_you_want/data can't be mounted upon itself...

(I would try if I had a z1 just spotted the count stuff and though this would be a viable alternative as the system and data (and cache) folders aren't limited in size at all (except by the size of the internal storage))
[Xperia Z1 Original Android Development] munjeni:
Good thing related to bind mount would be more disk space, thats realy good! And allso no needs for making ext4 partitions since internal storage is on ext4 allready, thats great too! I will try your method when I finish some projects.:good:
[Xperia Z1 Original Android Development] HypoTurtle:
Just posting this if it might be of any help speeding things along:

#!/sbin/sh

##if [ -f "/tmp/ROM_NAME.prop" ]; then
ROM_NAME=`cat '/tmp/ROM_NAME.prop' | sed 's/ROM_NAME=//g'`

mkdir -p /data/media/0/bootmenu/$ROM_NAME/system
mkdir -p /data/media/0/bootmenu/$ROM_NAME/data
mkdir -p /data/media/0/bootmenu/$ROM_NAME/cache
mkdir -p /boot_dir

mount --bind /data/media/0/bootmenu/$ROM_NAME/system /system
mount --bind /data/media/0/bootmenu/$ROM_NAME/data /data
mount --bind /data/media/0/bootmenu/$ROM_NAME/cache /cache
mount --bind /data/media/0/bootmenu/$ROM_NAME/ /boot_dir

# delete the old system
rm -rf /system/*

mkdir -p /tmp/work/ing
mkdir -p /tmp/work/ramd
cd /tmp
./unpackbootimg /tmp/boot.img /tmp/work/

## Setting up working directory
cp /tmp/boot.img-ramdisk.gz /tmp/work/initrd.gz

cd /tmp/work/ing
## Unzipping nand kernel
gzip -d -c ../initrd.gz | cpio -i -d

chmod 777 sbin
chmod 777 sbin/ramdisk.cpio
cp /tmp/work/ing/sbin/ramdisk.cpio /tmp/work/ramd
cd /tmp/work/ramd
cpio -i -d < ramdisk.cpio
rm ramdisk.cpio
mkdir bin
cp /tmp/busybox bin/busybox
cp /tmp/e2fsck bin/e2fsck
cp /tmp/mountfs.sh /tmp/work/ramd/
chmod 0777 mountfs.sh
chmod 0777 bin/busybox
chmod 0777 bin/e2fsck

## Modifying ramdisk to not use fstab, and use mountfs.sh instead.

sed -i '/mount_all/s/^/#/' init.qcom.rc
sed -i "s/rOm/$ROM_NAME/g" mountfs.sh
sed -i '/on fs/ a exec /mountfs.sh' init.qcom.rc
chmod 0750 init.qcom.rc
find .| cpio -o -H newc > newramdisk.cpio
cp /tmp/ramd/newramdisk.cpio /tmp/work/ing/sbin/ramdisk.cpio
chmod 750 /tmp/work/ing/sbin/ramdisk.cpio
chmod 750 /tmp/work/ing/sbin
cd /tmp/work/ing
# Building new ramdisk
find .| cpio -o -H newc | gzip -9 > ../boot.img-ramd.gz
cd ..

###mkdir -p /sdcard/Repacked
###cd /tmp
###./mkbootimg --kernel /tmp/work/boot.img-zImage --ramdisk /tmp/work/boot.img-ramd.gz --cmdline \"$(cat /tmp/work/boot.img-cmdline)\" --###base $(cat /tmp/work/ramdisks/boot.img-base) --output /sdcard/Repacked/newboot.img

## I take it a different zImage that the one in the original ROM zip is needed
cp /tmp/zImage /boot_dir/zImage-dtb
cp /tmp/work/boot.img-ramd.gz /boot_dir/initrd.gz
##else
##exit 0
#fi

I think I got most things covered. Wasn't sure where the boot.img for the multiboot was supposed to end up but I see now that you have them set up as separate zImage and ramdisk (fixed that I think.) Other things needed ROM_NAME.prop file, unpackbootimg, busybox, e2fsck and desired mountfs.sh. The above would need to be run prior to the copying of /system in the updater script and after having the boot.img copied to /tmp

Not sure where setting.ini is located but

echo 'menutitle=$ROM_NAME
kernel=/data/media/0/bootmenu/$ROM_NAME/zImage-dtb
ramdisk=/data/media/0/bootmenu/$ROM_NAME/initrd.gz' >> setting.ini

would do it (as long as setting.ini is available during install)
[Xperia Z1 Original Android Development] munjeni:
I will try to implement all things natively in bootmenu without needs for using scripts! :) First of all need to finish some things which I have started on stock rom, than will investigate in bootmenu.