How export /system or /dev/stl12 to update.zip? I need it for ext2 feature! - Android Software/Hacking General [Developers Only]

I have /dev/stl12 which is mounted to /system in my S5660
I want to first format the partition to ext2 with: mkfs.ext2
I want my rom to be flashed with a update.zip only after the partitions are all formatted.
Is there a good way to export my whole system partition to update.zip?

Related

[Question] Converting MTD Partition(s): yaffs2 -> ext2/3/4

hi @all,
is there a way to convert a mtd partition to another filesystem?
i've tryed the following procedure:
1.) boot to recovery
2.) login to system via adb (adb shell)
3.) mke2fs -m 5 -b 4096 /dev/block/mtdblock1
at point 3, it gives errors and nothing is happen.
now, i've tryed to flash a ext3 filesystem on this partition via
flash_image system system.ex3.img (found a explanation on how to create a ex3 system.img), but after mounting the /dev/block/mtdblock1 on /system it shows still device as "yaffs2".
would be nice, if someone can explain me if it's definitvly not possible to convert
mtd partitions or tell me a short tip what can i test
ThX
Andy
An anything known about this in the last year BUMP

[Q] Is possible to port FlyOnGB under cm 10.1 partitioning?

Never tryed this rom but seems very good :good:
I like switch between roms using this to restore sms and call logs from nandroid backup:
https://play.google.com/store/apps/details?id=com.h3r3t1c.bkrestore&hl=it
..so no good for me use odin to switch to this rom when I need
What happen if:
flash FLYonGB
recovery --> backup
Flash CM 10.1 v7
Recovery --> wipe data, cache, dalwik ..all
--> advanced restore --> restore boot and system from FLYonGB nandroid backup? :silly:
p1p3r said:
What happen if:
flash FLYonGB
recovery --> backup
Flash CM 10.1 v7
Recovery --> wipe data, cache, dalwik ..all
--> advanced restore --> restore boot and system from FLYonGB nandroid backup? :silly:
Click to expand...
Click to collapse
Dont Brick Ur Device
I don't belive I brick my phone this way..
..anyway I will not try
GB roms and JB roms have diferent partitioning, so if anybody will to switch between those roms ALWAYS need a repartition in Odin.
Data,sistem, cache..... Are not in the same partition, this is the main reason of the problem.
Please dont forget this rule or you will Brick your phone.
Sent from my GT-I9003 using xda premium
p1p3r said:
I don't belive I brick my phone this way..
..anyway I will not try
Click to expand...
Click to collapse
You will definitely brick your phone with that! But yeah if you wanna prove me wrong, go ahead try it :laugh:
I think better no one try this!!!
Take a look here: http://forum.xda-developers.com/showpost.php?p=43625837&postcount=271
p1p3r said:
I think better no one try this!!!
Take a look here: http://forum.xda-developers.com/showpost.php?p=43625837&postcount=271
Click to expand...
Click to collapse
I have tryed to flash a 2.3.6 rom on cyno 10.1 and i had only a soft brik recovery didn't work, but download was still working so i flashed pit and all the xxkpe from the beginning and the phone was normally working :laugh:
First reply
redflash52 said:
I have tryed to flash a 2.3.6 rom on cyno 10.1 and i had only a soft brik recovery didn't work, but download was still working so i flashed pit and all the xxkpe from the beginning and the phone was normally working :laugh:
Click to expand...
Click to collapse
i never followed traditional flashing trend like full xxkpe > so n so ... i just flashed DXKF1 (Korean version )froyo stock rom with a pit > XXKPQ-PDA(Siberian ver.) > DDLF2-PDA> cm9 >cm10 --- i personally followed this trend and never faced any soft brick hard brick or any thing.The stock roms i used were on multi CSC so that also did not effect. :angel:
so i too agree with you buddy..
[QRCODE][/QRCODE]
p1p3r said:
I think better no one try this!!!
Take a look here: http://forum.xda-developers.com/showpost.php?p=43625837&postcount=271
Click to expand...
Click to collapse
One question : Can we merge partition files i mean the code so both CM n GB can read from that single partition file. Don't know it is technically feasible or not .
My idea use FLTOnGB recovery to nandroid backup kernel+ramdisk and system image.
After installed cm 10.1 (so repartitioned the phone) use his recovery to replace boot.img and system with those of FLTOnGB nandroid backup.
Don't know if recovery stuff may work.. anyway I think things to change in ramdisk:
cfroot ramdisk: fota.rc
Code:
.....
# create mountpoints and mount tmpfs on sqlite_stmt_journals
mkdir /sdcard 0000 system system
chown system system /sdcard
chmod 0000 /sdcard
mkdir /system
mkdir /data 0771 system system
chown system system /data
chmod 0771 /data
#parameter block
mkdir /mnt 0775 root system
mkdir /mnt/.lfs 0755 root root
insmod /lib/modules/2.6.35.7/kernel/samsung/j4fs/j4fs.ko
mount j4fs /dev/block/stl6 /mnt/.lfs
insmod /lib/modules/2.6.35.7/kernel/samsung/param/param.ko
insmod /lib/modules/drop_caches.ko
#==============================================================================
# Trigger : early-fs
#==============================================================================
#on early-fs
#==============================================================================
# Trigger : fs
#==============================================================================
on fs
# mount rfs partitions
mount rfs /dev/block/stl9 /system check=no,iocharset=utf8
chown system system /system
chmod 0771 /system
# use movinand second partition as /data. d.moskvitin
exec apply_disk_policy
# We chown/chmod /data again so because mount is run as root + defaults
# mount rfs /dev/block/mmcblk0p3 /data nosuid nodev check=no,iocharset=utf8
# We chown/chmod /cache again so because mount is run as root + defaults
mount rfs /dev/block/stl11 /cache nosuid nodev check=no,iocharset=utf8
chown system cache /cache
chmod 0770 /cache
# mount vfat /dev/block/mmcblk0p1 /sdcard
...
cm 10.1 ramdisk: fstab.latona
Code:
# Android fstab file.
#<src> <mnt_point> <type> <mnt_flags and options> <fs_mgr_flags>
# The filesystem that contains the filesystem checker binary (typically /system) cannot
# specify MF_CHECK, and must come before any filesystems that do specify MF_CHECK
/dev/block/mmcblk0p2 /cache ext4 noatime,nosuid,nodev,noauto_da_alloc,errors=panic wait
/dev/block/mmcblk0p3 /data ext4 noatime,nosuid,nodev,noauto_da_alloc,errors=panic wait

Journal Disabler For Pico! :D

----------------------- Journaling Disabler For Pico ----------------------
This is just a simple Zip to Disable Journaling on pico! as we use 2 or 3 extra ext4 partitions for OC!
It even clear's /sd-data,/sd-cache - for aosp
and /sd-ext,/sd-data,/sd-cache - for sense 4
Which means you need not always format your sd-card to switch between roms! .. But if you are switching from aosp rom to sense 4 you need to partition the sd-card appropriately!
Steps to USE:
******* Use this Zip Only when installing a Rom from scratch!... cause it wipes everything! ******
-- clear almost everything you can from recovery e.g factory-reset,/system,/boot,/cache etc
-- install this Zip! as like you do with any other zip (Prefered Recovery TWRP 2.4.X)
-- Flash Your Favourite Rom Now!!
I can use this even if i am not oc'ing?? Just like superwipe?
Disabling journal wont harm anything! Right?
Parth_14 said:
I can use this even if i am not oc'ing?? Just like superwipe?
Disabling journal wont harm anything! Right?
Click to expand...
Click to collapse
From the wikipedia's article:
A journaling file system is a file system that keeps track of the changes that will be made in a journal (usually a circular log in a dedicated area of the file system) before committing them to the main file system. In the event of a system crash or power failure, such file systems are quicker to bring back online and less likely to become corrupted.[1]
Click to expand...
Click to collapse
For overclocking, the SD Card is used for the /data and /cache partition. In that case, the SD Card would be read more frequently as the /data and /cache partitions are the most frequently accessed and modified partitions while running the Android system. In that case, using a Journal would slow down the memory access times if the SD Card is not fast enough. Also, as many modifications are made to the /data and /cache partition, the SD Card would be going through the read/write cycle twice the number of times, once for the journaling and once for the "commiting them to the main file system". So, it is likely that the SD Card might get corrupted faster than it normally should. That is the reason why Class 4 and below SD Cards are likely to "go dead" soon when overclocking with cute_prince's new PLL2 overclocking method. And, this is why ateeq72 has made this flashable zip to disable journaling. It would reduce the possibility/risk of losing your SD Card and at the same time allow you to OC your phone.
Using this when you are not OC'ing your phone? I wouldn't recommend that you flash this zip, but you would need a slightly modified zip. Also, journaling, I presume you want to disable in your phone's sd-ext memory. It would increase your phone's performance in case you are using any memory increasing scripts like int2ext which mount the sd-ext partition in the /data folder.
vineethraj49 said:
Using this when you are not OC'ing your phone? I wouldn't recommend that you flash this zip, but you would need a slightly modified zip. Also, journaling, I presume you want to disable in your phone's sd-ext memory. It would increase your phone's performance in case you are using any memory increasing scripts like int2ext which mount the sd-ext partition in the /data folder.
Click to expand...
Click to collapse
Thanks man!
Can you tell what is to be modified in the zip so that i can use it when i am not oc'ing?
Parth_14 said:
Thanks man!
Can you tell what is to be modified in the zip so that i can use it when i am not oc'ing?
Click to expand...
Click to collapse
No need to mod dude, u can use it if u dont OC.
Helped? Thanks maybe!
Parth_14 said:
Thanks man!
Can you tell what is to be modified in the zip so that i can use it when i am not oc'ing?
Click to expand...
Click to collapse
Edit the file named "ateeqscript" using Notepad++.
Make sure the file looks like the one below.
Code:
#!/bin/sh
echo ***************Begin Disable Journaling Partition***************
/sbin/busybox mount -t auto /dev/block/mmcblk0p2 /sd-ext
rm -rf /sd-ext/*
/sbin/busybox umount -l /sd-ext
/tmp/tune2fs -O ^has_journal -c 1 -i 1d -m 0 /dev/block/mmcblk0p2
fsck.ext4 -Dfy /dev/block/mmcblk0p2
sync
echo ***************Data Partion Done***************
echo ***************Finished No Journaling Partions***************
What I have done? Simple. Removed all code related to /sd-data and sd-cache, and kept only commands necessary for the sd-ext partition.
---------------------------------------------------
@OP, I suggest a few changes in your script. First, the mounting commands are run, so, if the sd-ext is already mounted by the recovery (just in case, accidentally it happened), then, you wouldn't (or rather shouldn't) be able to mount it in another folder, namely /sd-data. I would suggest the following change in your flashable zip. Try to make it look something like the one below.
Code:
#!/bin/sh
echo "\"Disabling Journaling\" Script"
echo "Initializing script..."
/sbin/busybox umount -l /sd-ext
/sbin/busybox mkdir /sd-data
/sbin/busybox mount /dev/block/mmcblk0p2 /sd-data
/sbin/busybox mkdir /sd-cache
/sbin/busybox mount /dev/block/mmcblk0p3 /sd-cache
/sbin/busybox mkdir /sd-ext2
/sbin/busybox mount /dev/block/mmcblk0p4 /sd-ext
rm -rf /sd-cache/*
rm -rf /sd-data/*
rm -rf /sd-ext/*
/sbin/busybox umount -l /sd-data
/sbin/busybox umount -l /sd-cache
/sbin/busybox umount -l /sd-ext
echo "Disabling Journal in sd-data"
/tmp/tune2fs -O ^has_journal -c 1 -i 1d -m 0 /dev/block/mmcblk0p2
fsck.ext4 -Dfy /dev/block/mmcblk0p2
echo "Disabling Journal in sd-cache"
/tmp/tune2fs -O ^has_journal -c 1 -i 1d -m 0 /dev/block/mmcblk0p3
fsck.ext4 -Dfy /dev/block/mmcblk0p3
echo "Disabling Journal in sd-ext"
/tmp/tune2fs -O ^has_journal -c 1 -i 1d -m 0 /dev/block/mmcblk0p4
fsck.ext4 -Dfy /dev/block/mmcblk0p4
sync
echo "Partitions Journaling Disabled..."
echo "Finished no journaling partitions"
Do we need to flash this zip for every new rom or just once is enough?
Sent from my HTC Explorer A310e using xda app-developers app
faiPICO said:
Do we need to flash this zip for every new rom or just once is enough?
Sent from my HTC Explorer A310e using xda app-developers app
Click to expand...
Click to collapse
i guess one time is enough no need to flash again and again
@ateeq72
Can you edit this script with just the wiping part? As it is not necessary to disable journal for aosp roms!
Parth_14 said:
@ateeq72
Can you edit this script with just the wiping part? As it is not necessary to disable journal for aosp roms!
Click to expand...
Click to collapse
Its already there I guess
vineethraj49 said:
Its already there I guess
Click to expand...
Click to collapse
I've read that it formats through ext2/4 ! What i want is the parition to be remain untouched..
Parth_14 said:
@ateeq72
Can you edit this script with just the wiping part? As it is not necessary to disable journal for aosp roms!
Click to expand...
Click to collapse
vineethraj49 said:
Its already there I guess
Click to expand...
Click to collapse
journal disabling is required for only ext4 partition for max performace
if u dont use ext4 use any wiping script
the script keval gave format partitions to ext2 only not ext4
sakshamx said:
journal disabling is required for only ext4 partition for max performace
if u dont use ext4 use any wiping script
the script keval gave format partitions to ext2 only not ext4
Click to expand...
Click to collapse
NOTE:------------>Do remember the script of sense will format partitions as EXT2 and script for aosp roms will format partitions as EXT4 and sense 4.1 sctript will also format as EXT4
Click to expand...
Click to collapse
vineethraj49 said:
Click to expand...
Click to collapse
u can check the script it formats as ext2 i had also checked from sd card its ext2
i also had thought that as it was given in thread but its not
is it updated script which u posted in facebook
bloodhound42 said:
is it updated script which u posted in facebook
Click to expand...
Click to collapse
yup! it is!
vineethraj49 said:
@OP, I suggest a few changes in your script. First, the mounting commands are run, so, if the sd-ext is already mounted by the recovery (just in case, accidentally it happened), then, you wouldn't (or rather shouldn't) be able to mount it in another folder, namely /sd-data. I would suggest the following change in your flashable zip. Try to make it look something like the one below.
Code:
#!/bin/sh
echo "\"Disabling Journaling\" Script"
echo "Initializing script..."
/sbin/busybox umount -l /sd-ext
/sbin/busybox mkdir /sd-data
/sbin/busybox mount /dev/block/mmcblk0p2 /sd-data
/sbin/busybox mkdir /sd-cache
/sbin/busybox mount /dev/block/mmcblk0p3 /sd-cache
/sbin/busybox mkdir /sd-ext2
/sbin/busybox mount /dev/block/mmcblk0p4 /sd-ext
rm -rf /sd-cache/*
rm -rf /sd-data/*
rm -rf /sd-ext/*
Click to expand...
Click to collapse
Bro thats why i have mounted sd-ext as "sd-ext2" ! to make sure every recovery doesnt have any issue mounting it!
what is journal?
in many posts i found this about this journal what is this actually..

[GUIDE][DEV] How to convert NAND ROM to SD-EXT ROM for MultiBootloader

How to convert NAND ROM to SD-EXT ROM for MultiBootloader​
Code:
After following this guide, your ROM can be use with [URL="http://forum.xda-developers.com/nokia-x2/development/sbl-multibootloader-v1-00-04-10-2015-t3217360"]MultiBootloader[/URL]
THIS GUIDE IS NOT FOR NOOBs
Requirements
Knowledge about Android Image Kitchen
Notepad ++
A nand ROM extracted
Instructions
Delete the RED COLOR
Add the BLUE COLOR
Step 1: Modifying boot.img (FOR STOCK KERNEL ONLY) - Check post #2 to download the modified boot image, you don't need to edit it yourself.
Use Android Image Kitchen's unpackimg command to unpack the boot.img file from the ROM your want to port.
Go to Android Image Kitchen\ramdisk folder, edit these files:
fstab.qcom
Change like this:
Code:
# Android fstab file.
# The filesystem that contains the filesystem checker binary (typically /system) cannot
# specify MF_CHECK, and must come before any filesystems that do specify MF_CHECK
#TODO: Add 'check' as fs_mgr_flags with data partition.
# Currently we dont have e2fsck compiled. So fs check would failed.
#<src> <mnt_point> <type> <mnt_flags and options> <fs_mgr_flags>
[COLOR="Red"]/dev/block/platform/msm_sdcc.1/by-name/system /system ext4 ro,barrier=1 wait
/dev/block/platform/msm_sdcc.1/by-name/userdata /data ext4 nosuid,nodev,barrier=1,noauto_da_alloc,discard wait,check,encryptable=footer[/COLOR]
[COLOR="Blue"]/dev/block/platform/msm_sdcc.1/by-name/userdata /nanddata ext4 nosuid,nodev,barrier=1,noauto_da_alloc,discard wait,check,encryptable=footer[/COLOR]
/devices/msm_sdcc.2/mmc_host /storage/sdcard1 vfat nosuid,nodev wait,voldmanaged=sdcard:auto
#/dev/block/mmcblk0p11 /system ext4 ro,barrier=1 wait
#/dev/block/mmcblk0p12 /data ext4 nosuid,nodev,barrier=1,noauto_da_alloc wait,check,encryptable=footer
init.rc
- Find this event:
Code:
on fs
- Change like this:
Code:
on fs
# mount mtd partitions
# Mount /system rw first to give the filesystem a chance to save a checkpoint
[COLOR="Red"]mount yaffs2 [email protected] /system
mount yaffs2 [email protected] /system ro remount
mount yaffs2 [email protected] /data nosuid nodev[/COLOR]
[COLOR="Blue"] mount ext4 /dev/block/mmcblk1p2 /system
mount ext4 /dev/block/mmcblk1p2 /system ro remount
mount ext4 /dev/block/mmcblk1p3 /data nosuid nodev[/COLOR]
mount yaffs2 [email protected] /cache nosuid nodev
[COLOR="Blue"]#mount nand data for sharing data/app
mkdir /nanddate 0771 system system
mount yaffs2 [email protected] /nanddata nosuid nodev
# mount sdcard
wait /dev/block/mmcblk1p1
wait /dev/block/mmcblk1p1
mount vfat /dev/block/mmcblk1p1 /storage/sdcard1[/COLOR]
​
init.target.rc
- Find this event:
Code:
on fs
- Change like this:
Code:
on fs
mount_all fstab.qcom
# Keeping following partitions outside fstab file. As user may not have
# these partition flashed on the device. Failure to mount any partition in fstab file
# results in failure to launch late-start class.
wait /dev/block/platform/msm_sdcc.1/by-name/cache
mount ext4 /dev/block/platform/msm_sdcc.1/by-name/cache /cache nosuid nodev barrier=1
wait /dev/block/platform/msm_sdcc.1/by-name/persist
mount ext4 /dev/block/platform/msm_sdcc.1/by-name/persist /persist nosuid nodev barrier=1
wait /dev/block/platform/msm_sdcc.1/by-name/modem
mount vfat /dev/block/platform/msm_sdcc.1/by-name/modem /firmware ro shortname=lower,uid=1000,gid=1000,dmask=227,fmask=337
[COLOR="Red"] wait /dev/block/platform/msm_sdcc.1/by-name/custom
mount ext4 /dev/block/platform/msm_sdcc.1/by-name/custom /custom nosuid nodev barrier=1 ro[/COLOR]
[COLOR="Blue"] wait /dev/block/mmcblk1p4
mount ext4 /dev/block/mmcblk1p4 /custom nosuid nodev barrier=1 ro[/COLOR]
​
Repack boot.img and copy to the ROM folder.
Step 2: Modifying updater-script
Open ROM-name\META-INF\com\google\android\updater-script
Find:
Code:
mount("ext4", "EMMC", "/dev/block/mmcblk0p19", "/system");
or
Code:
mount("ext4", "EMMC", "/dev/block/platform/msm_sdcc.1/by-name/system", "/system");
Add these lines above it:
Code:
[COLOR="blue"]ui_print(" Mounting Partitions ");
mount("ext4", "MMC", "/dev/block/mmcblk1p2", "/system-ext");
mount("ext4", "MMC", "/dev/block/mmcblk1p4", "/custom-ext");
mount("ext4", "EMMC", "/dev/block/mmcblk0p20", "/cache");
mount("ext4", "MMC", "/dev/block/mmcblk1p3", "/data-ext");
ui_print(" Formatting Partitions ");
delete_recursive("/system-ext");
delete_recursive("/custom-ext");
delete_recursive("/cache");
delete_recursive("/data/dalvik-cache");
delete_recursive("/data-ext");[/COLOR]
Find this line:
Code:
package_extract_file("boot.img", "/tmp/boot.img");
Change like this:
Code:
[INDENT][COLOR="Red"]package_extract_file("boot.img", "/tmp/boot.img");
run_program("/system/xbin/busybox", "dd", "if=/tmp/boot.img", "of=/dev/block/mmcblk0p10");
delete("/tmp/boot.img");[/COLOR][COLOR="Blue"]
package_extract_file("boot.img", "/emmc/kernels/[I]your_rom_name[/I].img");[/COLOR][/INDENT]
Find and change all /system/ to /system-EXT/
Find and change all /custom/ to /custom-EXT/
Save.
Step 3: Create the ZIP
Make sure you have copy the modified boot.img to the ROM folder
Select all the files and folders in the ROM folder (custom, system, META-INF, boot.img,etc..)
Compress into ZIP file.
Done.
<EDITTING>
I have modifed the boot.img to boot into sdext ROM:
For stock based ROM: stock_ext.img - thanks to @symbuzzer for adding some features and fixing the ril & sdcard bugs
modified_stock_insecure-kernel.img - (Maybe I've made some mistake in this file. I don't recommend to use this, it can cause some bugs with sdcard0. Better modify it yourself.)
For CM11 based ROM: ext_cm11.img
Great ! Im waiting for this
Bro how can intsall the rom
I m try but couldn't with me
Plz help ??
@SonnySimon this method doesnt work on Stock Kernel/Rom. I will attach stock kernel on XDA today. You can compare mine with yours and update this post. Thanks
symbuzzer said:
@SonnySimon this method doesnt work on Stock Kernel/Rom. I will attach stock kernel on XDA today. You can compare mine with yours and update this post. Thanks
Click to expand...
Click to collapse
It works. I tried and it boots successfully into ext stock ROM but have some bugs with ril and sdcard.
SonnySimon said:
It works. I tried and it boots successfully into ext stock ROM but have some bugs with ril and sdcard.
Click to expand...
Click to collapse
I meant yours have bugs Thanks anyway
[HOW TO] BOOT FROM SD CARD [SUCCESSFULLY] on QMobile Z8 with BRICKED/DEAD eMMC
SimonVN said:
How to convert NAND ROM to SD-EXT ROM for MultiBootloader
Click to expand...
Click to collapse
I have been successfully able to boot from SD card on QMobile Z8 by partitioning SD card on a Ubuntu machine using 'parted' and 'fdisk' commands, replicating eMMC partition table and then flashing factory firmware images to these newly created partitions using 'dd' command. Then I modified "fstab.qcom" & "init.tegra.rc" files in kernel (boot.img) and "recovery.fstab" and "uneventd.rc" files in twrp recovery to initiate mounting and booting from sd card instead of internal memory. It was successful after some experiments. Details can be found here:
https://forum.xda-developers.com/android/help/how-to-boot-sd-card-qmobile-z8-bricked-t3712171
But I have still a few queries to be answered. Please have a look. Any help, comments, information or suggestions will be appreciated.

twrp.fstab HELP!!!

Hi! I'm a newbie here. I want to ask if the below code is correct for twrp.fstab? Those are the first 5 lines of twrp.fstab.
I change the following lines instead of ".../11120000.msdc0/by-name/system" to ".../11120000.msdc0/mmcblk0p23" and so on.
/dev/block/platform/mtk-msdc.0/11120000.msdc0/mmcblk0p23 /system ext4 ro wait,recoveryonly
/dev/block/platform/mtk-msdc.0/11120000.msdc0/by-name/vendor /vendor ext4 ro wait,recoveryonly
/dev/block/platform/mtk-msdc.0/11120000.msdc0/mmcblk0p25 /data f2fs noatime,nosuid,nodev,discard,noflush_merge wait,check,formattable,resize,encryptable=/dev/block/platform/mtk-msdc.0/11120000.msdc0/by-name/metadata,
/dev/block/platform/mtk-msdc.0/11120000.msdc0/mmcblk0p24 /cache ext4 noatime,nosuid,nodev,noauto_da_alloc,discard wait,check
PS. My recovery.img was ported using twrp auto porter but it can't mount system, data and cache.

Categories

Resources