Re-enabling ext4 journaling in ROMs based on Stock - LG Optimus 2x

Hey there,
it's known that ext4 with disabled journaling is little faster than default, but it is also less reliable.
This can result in screwed up homescreens and force-closes after reboot/shutdown/battery pull.
I have successfully re-enabled journaling for system and cache partition, but it seems not to work correctly for data partition, at least for me. Can you help?
Code:
echo ..............system Partition...............
/sbin/busybox umount -l /system
/sdcard/tmp/tune2fs -O +has_journal -c 5 -i 5d -m 0 -o journal_data_ordered /dev/block/mmcblk0p1
fsck.ext4 -Dfy /dev/block/mmcblk0p1
/sbin/busybox mount -t ext4 -o nosuid,nodev,noatime,nodiratime,barrier=0,nobh,data=ordered,noauto_da_alloc /dev/block/mmcblk0p1 /system
echo ...............done...............
echo ...............cache Partition...............
/sbin/busybox umount -l /cache
/sdcard/tmp/tune2fs -O +has_journal -c 100 -i 100d -m 0 -o journal_data_writeback /dev/block/mmcblk0p2
fsck.ext4 -Dfy /dev/block/mmcblk0p2
/sbin/busybox mount -t ext4 -o nosuid,nodev,noatime,nodiratime,barrier=0,nobh,data=ordered,noauto_da_alloc /dev/block/mmcblk0p2 /cache
echo ...............done...............
echo ...............data Partition...............
/sbin/busybox umount -l /data
/sdcard/tmp/tune2fs -O +has_journal -c 5 -i 5d -m 0 -o journal_data_ordered /dev/block/mmcblk0p8
fsck.ext4 -Dfy /dev/block/mmcblk0p8
/sbin/busybox mount -t ext4 -o nosuid,nodev,noatime,nodiratime,barrier=0,nobh,data=ordered,noauto_da_alloc /dev/block/mmcblk0p8 /data
sync
echo ...............done...............
Semi-finished:
Flash journaling.zip via CWM to enable back journaling
Download
Download 'terminal emulator' from market and type the following to test if it works.
If 'has_journal' is present then journaling is enabled.
For /system
Code:
/system/bin/tune2fs -l /dev/block/mmcblk0p1 | grep features
For /cache
Code:
/system/bin/tune2fs -l /dev/block/mmcblk0p2 | grep features
For /data
Code:
/system/bin/tune2fs -l /dev/block/mmcblk0p8 | grep features
Please post feedback if it works for you (fully)!

nice good work!

Thanks!
Another easy, though more time consuming, way to re-enable journaling is to let CWM do it by a complete backup and restore.
(You can also switch between ext3 and ext4 by changing the file names in clockworkmod/backup/.../ and of course also in the nandroid.md5 file.)

Please post feedback if it works for you (especially for data partition)

Related

[BRAINSTORM] Booting directly into recovery

For reference, these are my thoughts on the matter.
We have 3 ways to do this:
1. Get hold of SBL, change it and flash it
Currently impossible afaik.
2. Get an init.d bash script to reboot into recovery if key is pressed
Most likely possible taking these 2 assumptions into account:
a) Bash allows to detect a pressed key, something like this:
Code:
_key()
{
local kp
ESC=$'\e'
_KEY=
read -d '' -sn1 _KEY
case $_KEY in
"$ESC")
while read -d '' -sn1 -t1 kp
do
_KEY=$_KEY$kp
case $kp in
[a-zA-NP-Z~]) break;;
esac
done
;;
esac
printf -v "${1:-_KEY}" "%s" "$_KEY"
}
_key x
case $x in
$'\e[15~') reboot recovery ;;
esac
Replacing this key code for one of OB's.
But for this, we need assumption number 2:
b) Key codes mapping is the same for recoveries.
Now, while this is the method of the greatest chance to work, it is also fairly useless. Developers will often break the boot before the init.d scripts are ran. So, this code should be ran before. Hence, the third method.
3. Start a custom service in init.rc (@ ramdisk) that will detect pressed key
This would be the perfect solution as it can't be broken from kernel (zImage) or system changes. However, init.rc has its own programming language (android init language) and there's no way to run this kind of listener.
However, it is possible to run an external script located for example in /system/bin/. These can be both an executable compiled from c (higher chances of working) or a bash scripting like the aforementioned one (lower chances of working since android probably doesn't start a console on boot).
Code for this would be something like:
Code:
service exampleservice /system/bin/exampleservice
user exampleservice
group exampleservice
oneshot
So uh, am I missing anything?
Anyone has other ideas?
a lot of times i heared about pressing "G" and "Power" would boot into some kind of save mode... if thats true i guess its easyer to reprogramm that keycombo to do something else... so does that keycombo anything? i couldnt figure out^^
Sent from my LG-P970 using XDA App
Are others devices has the key combination code in SBL?
I wish I have enough knowledge about android system so i can help...
i04055 said:
Are others devices has the key combination code in SBL?
I wish I have enough knowledge about android system so i can help...
Click to expand...
Click to collapse
Yes there are devices heaving the key-combo in SBL if that answers your question. The "Samsung Galaxy S GT-I9000" e.g. has them there afaik. With that device it was possible flashing the SBL to add a "booting directly into recovery" key-combo...
So I don´t know why there should not be a solution to do the same to the OB but Noejn surely has good reason for telling its impossible.
But hey what about booting into recovery on every system startup and only boot into the system through the recovery? It´s a "quick & dirty" solution even if its possible but better than developing the way we do isn´t it? I´m not sure if its easier to change the startup that way than to add or modify a key-combo but maybe someone here does?
I'm sure (or hope..) someone can, but perhaps we should move this Thread to another part of the Forum so someone with the knowledge how to do this will read it.
d0n22 said:
But hey what about booting into recovery on every system startup and only boot into the system through the recovery? It´s a "quick & dirty" solution even if its possible but better than developing the way we do isn´t it? I´m not sure if its easier to change the startup that way than to add or modify a key-combo but maybe someone here does?
Click to expand...
Click to collapse
Yeah, i prefer that way if poosibble rather than nothing.
But if put it that way, when the phone get bootloop is it still posibbe to boot into recovery?
Sent from my LG-P970 using XDA App
This is how it's done on Xperia X8 phone.
The /system/bin/chargemon is usb-charge daemon that is being hijacked on boot (it's binary is replaced with this script)
Original chargemon is copied into "charger" to keep it's functionality.
Than "sleep 3" waits for any keypress, and checks the dump, if keys were pressed, it launches the recovery binary.
quite simple.
Code:
#!/system/bin/busybox sh
/system/bin/charger
cat /dev/input/event1 > /dev/keycheck&
sleep 3
kill -9 $!
if [ -s /dev/keycheck -o -f /data/local/tmp/xrecovery ]
then
rm -f /data/local/tmp/xrecovery
# remount rootfs rw
mount -o remount,rw rootfs /
# Umount MTDs
umount -l /dev/block/mtdblock1
umount -l /dev/block/mtdblock2
umount -l /dev/block/mtdblock3
# Mount recovery partition
cd /
rm -r /sbin
rm -f etc
tar -xf /system/bin/xrecovery.tar
# Umount /system
umount -l /dev/block/mtdblock0
# chroot
chroot / /init
fi
# remount rootfs rw
mount -o remount,rw rootfs /
chmod 0777 /dev -R
chown 0.2000 /dev/oncrpc -R
cd /
rm init*
rm logo.rle
rm default.prop
tar -xf /system/bin/ramdisk.tar
mkdir -p /minicm
cd /minicm
tar -xf /system/bin/ramdisk.tar
# Umount /system, data and cache
umount -l /dev/block/mtdblock0
umount /dev/block/mtdblock3
umount /dev/block/mtdblock1
rmdir /system /data /cache /mnt
racht said:
This is how it's done on Xperia X8 phone.
The /system/bin/chargemon is usb-charge daemon that is being hijacked on boot (it's binary is replaced with this script)
Original chargemon is copied into "charger" to keep it's functionality.
Than "sleep 3" waits for any keypress, and checks the dump, if keys were pressed, it launches the recovery binary.
quite simple.
Code:
#!/system/bin/busybox sh
/system/bin/charger
cat /dev/input/event1 > /dev/keycheck&
sleep 3
kill -9 $!
if [ -s /dev/keycheck -o -f /data/local/tmp/xrecovery ]
then
rm -f /data/local/tmp/xrecovery
# remount rootfs rw
mount -o remount,rw rootfs /
# Umount MTDs
umount -l /dev/block/mtdblock1
umount -l /dev/block/mtdblock2
umount -l /dev/block/mtdblock3
# Mount recovery partition
cd /
rm -r /sbin
rm -f etc
tar -xf /system/bin/xrecovery.tar
# Umount /system
umount -l /dev/block/mtdblock0
# chroot
chroot / /init
fi
# remount rootfs rw
mount -o remount,rw rootfs /
chmod 0777 /dev -R
chown 0.2000 /dev/oncrpc -R
cd /
rm init*
rm logo.rle
rm default.prop
tar -xf /system/bin/ramdisk.tar
mkdir -p /minicm
cd /minicm
tar -xf /system/bin/ramdisk.tar
# Umount /system, data and cache
umount -l /dev/block/mtdblock0
umount /dev/block/mtdblock3
umount /dev/block/mtdblock1
rmdir /system /data /cache /mnt
Click to expand...
Click to collapse
yeah ,from this we can see what is running before logo screen and we can mod that file
so.. is that mean we can boot to recovery mode same as x8?
racht said:
This is how it's done on Xperia X8 phone.
The /system/bin/chargemon is usb-charge daemon that is being hijacked on boot (it's binary is replaced with this script)
Original chargemon is copied into "charger" to keep it's functionality.
Than "sleep 3" waits for any keypress, and checks the dump, if keys were pressed, it launches the recovery binary.
quite simple.
Code:
#!/system/bin/busybox sh
/system/bin/charger
cat /dev/input/event1 > /dev/keycheck&
sleep 3
kill -9 $!
if [ -s /dev/keycheck -o -f /data/local/tmp/xrecovery ]
then
rm -f /data/local/tmp/xrecovery
# remount rootfs rw
mount -o remount,rw rootfs /
# Umount MTDs
umount -l /dev/block/mtdblock1
umount -l /dev/block/mtdblock2
umount -l /dev/block/mtdblock3
# Mount recovery partition
cd /
rm -r /sbin
rm -f etc
tar -xf /system/bin/xrecovery.tar
# Umount /system
umount -l /dev/block/mtdblock0
# chroot
chroot / /init
fi
# remount rootfs rw
mount -o remount,rw rootfs /
chmod 0777 /dev -R
chown 0.2000 /dev/oncrpc -R
cd /
rm init*
rm logo.rle
rm default.prop
tar -xf /system/bin/ramdisk.tar
mkdir -p /minicm
cd /minicm
tar -xf /system/bin/ramdisk.tar
# Umount /system, data and cache
umount -l /dev/block/mtdblock0
umount /dev/block/mtdblock3
umount /dev/block/mtdblock1
rmdir /system /data /cache /mnt
Click to expand...
Click to collapse
soundes quite promising... have you tried it?
Can this be usefull?
http://forum.xda-developers.com/showthread.php?t=991276
Noejn have you abandoned us ? Or are u planning to take a look at this ? Would be nice if u get OB up and running
recovery
Hi,
has there been any success with booting into recovery mode?
BR,
J
logitec said:
Hi,
has there been any success with booting into recovery mode?
BR,
J
Click to expand...
Click to collapse
No,I try to boot directly into recovery through boot.img,but I get a big "error" form the LG Security Team!
Hijacking a daemon would work if Optimus Black had those binaries. I took a quick glance at a backup and I didn't see chargemon in /system/bin.
Besides, a xRecovery is limited as it's dependent on system files so a /format can't be done which isn't really that "comfy", especially when changing fs.
But yeah, better than nothing. Still, the method you described is only possible in Xperia phones, as far as I know.
I still say injecting a service on the init.rc is the way to go.
However, I can't test this now.
racht said:
This is how it's done on Xperia X8 phone.
The /system/bin/chargemon is usb-charge daemon that is being hijacked on boot (it's binary is replaced with this script)
Original chargemon is copied into "charger" to keep it's functionality.
Than "sleep 3" waits for any keypress, and checks the dump, if keys were pressed, it launches the recovery binary.
quite simple.
Code:
#!/system/bin/busybox sh
/system/bin/charger
cat /dev/input/event1 > /dev/keycheck&
sleep 3
kill -9 $!
if [ -s /dev/keycheck -o -f /data/local/tmp/xrecovery ]
then
rm -f /data/local/tmp/xrecovery
# remount rootfs rw
mount -o remount,rw rootfs /
# Umount MTDs
umount -l /dev/block/mtdblock1
umount -l /dev/block/mtdblock2
umount -l /dev/block/mtdblock3
# Mount recovery partition
cd /
rm -r /sbin
rm -f etc
tar -xf /system/bin/xrecovery.tar
# Umount /system
umount -l /dev/block/mtdblock0
# chroot
chroot / /init
fi
# remount rootfs rw
mount -o remount,rw rootfs /
chmod 0777 /dev -R
chown 0.2000 /dev/oncrpc -R
cd /
rm init*
rm logo.rle
rm default.prop
tar -xf /system/bin/ramdisk.tar
mkdir -p /minicm
cd /minicm
tar -xf /system/bin/ramdisk.tar
# Umount /system, data and cache
umount -l /dev/block/mtdblock0
umount /dev/block/mtdblock3
umount /dev/block/mtdblock1
rmdir /system /data /cache /mnt
Click to expand...
Click to collapse
Good news, I'm getting close.
ok, thank you for everithing
Noejn said:
Good news, I'm getting close.
Click to expand...
Click to collapse
good news indeed^^ im working on it as well but im not feeling like getting close :-\ pls let me know what you did and how you did it as soon as its done... again thank you very much for your efforts!
Sent from my LG-P970 using XDA App
d0n22 said:
good news indeed^^ im working on it as well but im not feeling like getting close :-\ pls let me know what you did and how you did it as soon as its done... again thank you very much for your efforts!
Sent from my LG-P970 using XDA App
Click to expand...
Click to collapse
Well, I've succeed injecting the script on boot.
However, I'm getting some problems on the event0 > keycheck; I don't think at this time of boot /dev entries are up.
But I've already thought of a workaround and I'll test it tomorrow.
I´m thinking, if i compile kernel of ubuntu and install it in recovery partition, not possible then run ubuntu in native mode from sdcard with dualboot?

[Q] ubuntu on sgs mounting problem

Hi
i ve got a problem with the whole stuff.
it runs smoothly, but the filesystem is read-only.
it's a img file and script. it makes a chrooted system.
the problem could be the script. may the point where the partitions mounted.
or anywhere. i dont know.
i guess the problem:
#
busybox mknod /dev/block/loop255 b 7 255 > /dev/null 2>&1
busybox losetup /dev/block/loop255 ./ubuntu.img > /dev/null 2>&1
busybox mount /dev/block/loop255 /data/local/mnt > /dev/null 2>&1
#
the last line.
or
#
busybox mount -t proc proc /data/local/mnt/proc > /dev/null 2>&1
busybox mount -t devpts devpts /data/local/mnt/dev/pts > /dev/null 2>&1
busybox mount -t sysfs sysfs /data/local/mnt/sys > /dev/null 2>&1
busybox chroot /data/local/mnt /root/init.sh > /dev/null 2>&1
#
if its not enough to find out
i ll attach the file, but im writing from phone right now
Please help i cant wait xd
i neeed a writable system.

[Q] how to mount cdrom as rw?

how can I mount the /dev/block/mmcblk1p17 as read write.
I have tried:
[email protected]:/# mount -t iso9660 /dev/block/mmcblk1p17 /data/local/mystuff/cdrom2
and
[email protected]:/# mount -o remount,rw /dev/block/mmcblk1p17 /data/local/mystuff/cdrom2
Always shows as read only though:
[email protected]:/# mount |grep cdrom
mount |grep cdrom
/dev/block/mmcblk1p17 /data/local/mystuff/cdrom2 iso9660 ro,relatime 0 0
I would like to update the motohelper driver file to latest version on this partition. Any ideas on how to do this?

Dual Boot Atrix CM9 (emmc) and CM7 (sdcard)

Recently I became interested in dual booting my Atrix, mainly for the fun of it, and because I like the convenience of quickly reverting to a different ROM without having to restore it from backup. I would also like to evaluate the performance of my system with sdcard in the loop among other things.
From my web research, it appears that multiple attempts at dual booting the Atrix have been made without much success. I have heard of SafeStrap, but I'm the kind of person who wants to know what’s happening inside the black box. So I decided to try my hand by flashing CM9 to internal memory and CM7 to my Patriot 16GB Class 4 micro-SD card. I did all of this on Ubuntu 11.10 using GParted, Android SDK and several Perl and Bourne shell scripts that I either customized or created.
I probably could have done this on Windows (which for example has Atrix USB drivers whereas Ubuntu does not) and perhaps be able to use available space on my 10GB emmc to host additional ROMs. But in spite of the lack of drivers, I felt more comfortable having a full-up, dedicated *nix-based OS on hand to support the experiment.
I decided to to push a stable ROM to sdcard (in this case, CM7.2 RC1), one that runs well without any patches --- because a stock recovery tool wouldn't recognize it.
The experiment was successful as I now enjoy my 3GB CM7 build running from SD card with stable browser, keyboard and camera. And I can still use Joker's Kitchen Sink to explore some of the many possible ROM configurations without touching the CM7 build.
YouTube video (3:38) showing reboots from one ROM to the other: http://www.youtube.com/watch?v=31TPyAguQ60
Preliminaries (Ubuntu)
GParted and Perl installed
Android SDK for Linux (i386) installed http://developer.android.com/sdk/index.html
I download testsign.zip from http://forum.xda-developers.com/showthread.php?t=551711 , copy to Ubuntu <android-sdk-linux/tools> directory and extract zip there. This creates a testsign subfolder with testsign.jar file inside.
Atrix Filesystem Analysis
I boot my phone to CWM 5.0.2.0, open an Ubuntu terminal, get root (sudo -s), run adb shell and invoke the “edify” and “df” commands to view the current filesystem:
~ # edify
recovery filesystem table
=========================
0 /tmp ramdisk (null) (null)
1 /boot emmc /dev/block/mmcblk0p11 (null)
2 /cache ext3 /dev/block/mmcblk0p15 (null)
3 /data ext3 /dev/block/mmcblk0p16 (null)
4 /sdcard vfat /dev/block/mmcblk1p1 (null)
5 /emmc vfat /dev/block/mmcblk0p18 (null)
6 /system ext3 /dev/block/mmcblk0p12 (null)
7 /recovery emmc /dev/block/mmcblk0p10 (null)
8 /osh ext3 /dev/block/mmcblk0p13 (null)
9 /preinstall ext3 /dev/block/mmcblk0p17 (null)
~ # df -a
Filesystem 1K-blocks Used Available Use% Mounted on
tmpfs 417804 32 417772 0% /dev
devpts 0 0 0 0% /dev/pts
proc 0 0 0 0% /proc
sysfs 0 0 0 0% /sys
/dev/block/mmcblk0p15 645056 69020 543268 11% /cache
/dev/block/mmcblk0p16 2064208 129052 1830300 7% /data
/dev/block/mmcblk0p12 322516 238496 84020 74% /system​
SD Card Partitioning
Next I get root on Ubuntu, connect SD card to PC, ensure SD card adapter switch is set to read/write, run GParted and shrink the vfat (fat32) partition to allow room for /system, /cache and /data in that order. Then I create these partitions as ext4 with sizes reasonably consistent with the existing filesystem on emmc.
Note: GParted did not see my internal (emmc) card, and it prefixed the sdcard partitions as “/dev/mmcblk0” instead of “/dev/mmcblk1”.
Now I exit GParted, pull sdcard from PC and reinsert into phone. Then I boot to CWM, connect phone to PC, enter adb shell and verify the new sdcard partition map using the onboard “parted” tool:
~ # parted /dev/block/mmcblk1
GNU Parted 1.8.8.1.179-aef3
Using /dev/block/mmcblk1
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) print
Model: SD SU16G (sd/mmc)
Disk /dev/block/mmcblk1: 15.9GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Number Start End Size Type File system Flags
1 4194kB 10.7GB 10.7GB primary fat32 lba
2 10.7GB 11.1GB 346MB primary ext4
3 11.1GB 11.8GB 692MB primary ext4
4 11.8GB 14.0GB 2217MB primary ext4
quit
~#​
Clone CM7 to SD Card
Presently I have CM7.2 RC1 installed in emmc, and I want to clone this ROM to sdcard. But I first ensure that my phone is adequately charged, especially if I will be in CWM for a long time. My experience is that CWM can drain the battery, even when phone is connected to a powered USB hub.
I boot to CWM 5.0.2.0, open Ubuntu terminal on PC, get root (sudo -s), run adb shell and mount the new CM7 sdcard partitions.
Then I clone ROM to sdcard. (I did this over ADB, though in retrospect I probably could have done it more quickly with terminal emulator.)
~ # dd if=/dev/block/mmcblk0p12 of=/dev/block/mmcblk1p2
655360+0 records in
655360+0 records out
335544320 bytes (320.0MB) copied, 140.786369 seconds, 2.3MB/s
~ # dd if=/dev/block/mmcblk0p15 of=/dev/block/mmcblk1p3
1310720+0 records in
1310720+0 records out
671088640 bytes (640.0MB) copied, 282.791984 seconds, 2.3MB/s
~ # dd if=/dev/block/mmcblk0p16 of=/dev/block/mmcblk1p4
4194304+0 records in
4194304+0 records out
2147483648 bytes (2.0GB) copied, 898.662170 seconds, 2.3MB/s​
Since the data partition is fairly large, I ending up using the “cat” command, which cut the transfer time to about 6 minutes….
~ # cat /dev/block/mmcblk0p16 > /dev/block/mmcblk1p4​
Flash CM9 to Internal Memory
Now I push Joker CM9 beta 0.6.0 zip to sdcard and install via CWM...
[email protected]:~/Desktop# adb push beta-0.6.0-cm-9.0.0-RC0-olympus-UNOFFICIAL-signed.zip /sdcard/Download
1286 KB/s (125162795 bytes in 95.013s)
[email protected]:~/Desktop#​
Modify CM7 Ramdisk, Re-pack ROM Zip and Re-sign
Now I modify ramdisk in the CM7 boot.img to mount the sdcard /system, /cache and /data partitions at boot time. To help streamline the mod, I wrote custom Perl scripts based on the ones linked here:
http://android-dls.com/wiki/index.php?title=HOWTO:_Unpack,_Edit,_and_Re-Pack_Boot_Images
My Perl script “unpack-romzip.pl” actually starts with a baseline ROM, extracts boot.img and then p****s out kernel and ramdisk directory from boot.img. Here is the script in action...
[email protected]:~/Desktop# ./unpack-romzip.pl update-cm-7.2.0-RC1-olympus+gapps.zip
Extract boot.img from update-cm-7.2.0-RC1-olympus+gapps.zip
Archive: update-cm-7.2.0-RC1-olympus+gapps.zip
inflating: boot.img
Rename boot.img to update-cm-7.2.0-RC1-olympus+gapps.img
kernel written to update-cm-7.2.0-RC1-olympus+gapps.img-kernel
ramdisk written to update-cm-7.2.0-RC1-olympus+gapps.img-ramdisk.cpio.gz
Extract ramdisk zip to directory: update-cm-7.2.0-RC1-olympus+gapps.img-ramdisk
513 blocks
Delete intermediate file: update-cm-7.2.0-RC1-olympus+gapps.img-ramdisk.cpio.gz​
Results...
-rw-r--r-- 1 root root 2574336 2012-05-03 19:12 update-cm-7.2.0-RC1-olympus+gapps.img-kernel
drwxr-xr-x 8 root root 4096 2012-05-03 19:12 update-cm-7.2.0-RC1-olympus+gapps.img-ramdisk​
In this experiment, the only ramdisk file I will modify is init.olympus.rc: I do so by commenting out the /system, /cache and /data mount commands for the emmc partitions and creating equivalent mount commands for the sdcard partitions...
# mount ext4 /dev/block/mmcblk0p12 /system noatime nodiratime wait ro barrier=1
# mount ext4 /dev/block/mmcblk0p16 /data nosuid nodev noatime nodiratime wait barrier=1 noauto_da_alloc
# mount ext4 /dev/block/mmcblk0p15 /cache nosuid nodev noatime nodiratime wait barrier=1 noauto_da_alloc
mount ext4 /dev/block/mmcblk1p2 /system noatime nodiratime wait ro barrier=1
mount ext4 /dev/block/mmcblk1p4 /data nosuid nodev noatime nodiratime wait barrier=1 noauto_da_alloc
mount ext4 /dev/block/mmcblk1p3 /cache nosuid nodev noatime nodiratime wait barrier=1 noauto_da_alloc​
Now I back out of ramdisk and run my other Perl script: repack-romzip.pl, which combines ramdisk and kernel to obtain a new boot image and then generates a repacked ROM zip. Here is the script in action...
[email protected]:~/Desktop# ./repack-romzip.pl update-cm-7.2.0-RC1-olympus+gapps.zip
Repack Android boot image from kernel file and ramdisk directory and roll into new ROM zip
Run cpio and gzip on ramdisk directory
514 blocks
Make boot image from kernel file and ramdisk cpio zip
Updated boot.img...
-rw-r--r-- 1 root root 2725888 2012-05-03 19:20 update-cm-7.2.0-RC1-olympus+gapps-repack.img
Copy update-cm-7.2.0-RC1-olympus+gapps.zip to update-cm-7.2.0-RC1-olympus+gapps-repack.zip
Add updated boot.img to update-cm-7.2.0-RC1-olympus+gapps-repack.zip
updating: boot.img
zip warning: Local Entry CRC does not match CD: boot.img
(deflated 0%)​
I am almost ready to re-sign my CM7 ROM zip. But I first need to modify its updater-script to mount /system to /dev/block/mmcblk1p2 (sdcard) instead of /dev/block/mmcblk0p12 (emmc). So I edit the updater-script and change:
format("ext4", "EMMC", "/dev/block/mmcblk0p12");
mount("ext4", "EMMC", "/dev/block/mmcblk0p12", "/system");​
to
format("ext4", "EMMC", "/dev/block/mmcblk1p2");
mount("ext4", "EMMC", "/dev/block/mmcblk1p2", "/system");​
Now I invoke the java command below to re-sign the CM7 zip:
[email protected]:~/Desktop# java -classpath ~/android-sdk-linux/tools/testsign/testsign.jar testsign update-cm-7.2.0-RC1-olympus+gapps-repack.zip update-cm-7.2.0-RC1-olympus+gapps-repack-signed.zip
[email protected]:~/Desktop# ls -ld *.zip
-rw-rw-r-- 1 robert robert 125162795 2012-05-03 18:05 beta-0.6.0-cm-9.0.0-RC0-olympus-UNOFFICIAL-signed.zip
-rw-r--r-- 1 root root 105000424 2012-05-03 19:23 update-cm-7.2.0-RC1-olympus+gapps-repack-signed.zip
-rw-r--r-- 1 root root 104987732 2012-05-03 19:20 update-cm-7.2.0-RC1-olympus+gapps-repack.zip
-rw------- 1 robert robert 104999357 2012-05-01 20:10 update-cm-7.2.0-RC1-olympus+gapps.zip​
Then I transfer the re-signed zip to sdcard/Download, reboot to CWM and install.
Test Results
I do some preliminary testing by attempting to boot CM9 from Joker's CM9 1.0GHz v4 boot image file:
[email protected]:~/Desktop# fastboot boot cm9-1.0-atrixv4-boot.img
downloading 'boot.img'...
OKAY [ 0.204s]
booting...
OKAY [ 0.002s]
finished. total time: 0.206s​
Success. Now I try CM7...
[email protected]:~/Desktop# fastboot boot update-cm-7.2.0-RC1-olympus+gapps-repack.img
downloading 'boot.img'...
OKAY [ 0.182s]
booting...
OKAY [ 0.002s]
finished. total time: 0.185s​
And to my delight, CM7 boots
Finally I install Script Manager and push my custom boot-rom.sh to sdcard/Boot. This script offers four options: Current ROM (default), CM9, CM7 or CWM recovery. Rebooting to the other ROM is just a few keystrokes away, though I must configure Script Manager to run boot-rom.sh as superuser (press SU button on configuration screen).
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Elapsed times…
Execution of boot-rom.sh on CM7 to CM9 welcome screen: 44 sec.
Execution of boot-rom.sh on CM9 to CM7 welcome screen: 45 sec.
Conclusions and Thoughts
My Atrix dual boot capability offers an efficient means to circumvent instabilities in CM9 by providing a stable CM7 ROM to run from my sdcard. Of course there are limitations here in that a stock recovery won't recognize my CM7 build. But I'm fine with that since I probably won't patch.
I think it would be kind of interesting to push identical ROMs on emmc and sdcard and compare performance. I heard from a fellow engineer that Class 16 cards are now available.
It would also be interesting to explore refinements like multiple-boot from emmc and various forms of automation.
This is a work in progress and I appreciate your constructive feedback.
YouTube video (3:38) showing reboots from one ROM to the other: http://www.youtube.com/watch?v=31TPyAguQ60
Credits
jokersax11 @ xda, ghost_og @ xda,
Photon Dev Team, Atrix Dev Team
Koush
Other credits embedded in this post
Holy. ****.
Sent from my MB860 using XDA
Wow thanks for the info. I wanted to give this a try but I had a question. If I partition my sdcard to the specs you provided, can I flash your resigned cm7 zip and it would flash it to my sdcard. If that is possible, could you post the modified cm7?
Wow....waiting is coming.......
Something you could look into is moving the apps to SD and let each rom build its own dalvik cache. Then you can keep your apps between both builds
Sent from my MB855 using XDA
I think you better get into developing roms, because it sounds like you have an amazing amount of knowledge with this technology. Something I can only hope to achieve, lol.
I think you should make a full length 45 min youtube clip to explain everything, but I know that's not gonna happen, so see how much you can cram into 5 minutes! lol
Nice job man, outstanding progression!
Blur ROM with WebTop and CM9
Is it possible to switch between Blur based ROM with WebTop and CM9?
#!/system/bin/sh
mount -o remount,rw /dev/block/mmcblk0p1 /system//挂载/system为可写
busybox md5sum -cs /system/boot/md5 && CHANGE=0 || CHANGE=1//判断boot.img是否更新
echo $CHANGE
if [ "$CHANGE" = "1" ]
then
cat /dev/block/mmcblk0p5 > /data/boot1.img
busybox md5sum /system/build.prop > /system/boot/md5
echo "Creat new boot done!"
fi
if [ -e /data/boot2.img ]//判断另外的系统是否更新boot.img
then
busybox mv /data/boot2.img /system/boot/boot2.img
echo "Backup new boot done!"
fi
cat /system/boot/boot2.img > /dev/block/mmcblk0p5
fdisk /dev/block/mmcblk0 < /system/bin/fdisk1.sh
///////////////////同fixuid
mkdir /data/lib
chmod 0777 /data/lib
cat /data/system/packages.xml | grep 'package name="'| awk -F"\"" '{print $2}' > /data/packages.list
awk -F" " '{print "rm /data/data/"$1"/lib"}' /data/packages.list > /data/cx.sh
cat /system/bin/noshare|while read fname
do
echo "rm $fname-2/lib" >>/data/cx.sh
done
awk -F" " '{print "mkdir /data/lib/"$1}' /data/packages.list >> /data/cx.sh
awk -F" " '{print "mv /data/data/"$1"/lib/ /data/lib/"$1"/"}' /data/packages.list >> /data/cx.sh
busybox chown -R 1000.1000 /data/lib
awk -F" " '{print "rm -R /data/data/"$1"/lib"}' /data/packages.list >> /data/cx.sh
cat /system/bin/noshare|while read fname
do
echo "rm -R $fname-2/lib" >>/data/cx.sh
done
chmod 0777 /data/cx.sh
/data/cx.sh
////////////////////////////////////////////////////移动第二系统数据为主数据
cat /system/bin/noshare|while read fname
do
mv $fname "$fname-1"
mv "$fname-2" $fname
done
cat /data/noshare|while read fname//移动不需要共享的数据
do
mv $fname "$fname-1"
mv "$fname-2" $fname
done
echo "Move data done!"
/////////////////////////同fixuid
awk -F" " '{print "ln -s /data/lib/"$1" /data/data/"$1"/lib"}' /data/packages.list > /data/cx.sh
cat /data/system/packages.xml | grep 'package name=\"'| awk -F"\"" '{print $2" "$18}' | awk -F" " '{print "busybox chown -R "$2"."$2" /data/data/"$1}' >> /data/cx.sh
chmod 0777 /data/cx.sh
/data/cx.sh
echo "Move UID done!"
reboot
kingme__hu said:
#!/system/bin/sh
mount -o remount,rw /dev/block/mmcblk0p1 /system//挂载/system为可写
busybox md5sum -cs /system/boot/md5 && CHANGE=0 || CHANGE=1//判断boot.img是否更新
echo $CHANGE
if [ "$CHANGE" = "1" ]
then
cat /dev/block/mmcblk0p5 > /data/boot1.img
busybox md5sum /system/build.prop > /system/boot/md5
echo "Creat new boot done!"
fi
if [ -e /data/boot2.img ]//判断另外的系统是否更新boot.img
then
busybox mv /data/boot2.img /system/boot/boot2.img
echo "Backup new boot done!"
fi
cat /system/boot/boot2.img > /dev/block/mmcblk0p5
fdisk /dev/block/mmcblk0 < /system/bin/fdisk1.sh
///////////////////同fixuid
mkdir /data/lib
chmod 0777 /data/lib
cat /data/system/packages.xml | grep 'package name="'| awk -F"\"" '{print $2}' > /data/packages.list
awk -F" " '{print "rm /data/data/"$1"/lib"}' /data/packages.list > /data/cx.sh
cat /system/bin/noshare|while read fname
do
echo "rm $fname-2/lib" >>/data/cx.sh
done
awk -F" " '{print "mkdir /data/lib/"$1}' /data/packages.list >> /data/cx.sh
awk -F" " '{print "mv /data/data/"$1"/lib/ /data/lib/"$1"/"}' /data/packages.list >> /data/cx.sh
busybox chown -R 1000.1000 /data/lib
awk -F" " '{print "rm -R /data/data/"$1"/lib"}' /data/packages.list >> /data/cx.sh
cat /system/bin/noshare|while read fname
do
echo "rm -R $fname-2/lib" >>/data/cx.sh
done
chmod 0777 /data/cx.sh
/data/cx.sh
////////////////////////////////////////////////////移动第二系统数据为主数据
cat /system/bin/noshare|while read fname
do
mv $fname "$fname-1"
mv "$fname-2" $fname
done
cat /data/noshare|while read fname//移动不需要共享的数据
do
mv $fname "$fname-1"
mv "$fname-2" $fname
done
echo "Move data done!"
/////////////////////////同fixuid
awk -F" " '{print "ln -s /data/lib/"$1" /data/data/"$1"/lib"}' /data/packages.list > /data/cx.sh
cat /data/system/packages.xml | grep 'package name=\"'| awk -F"\"" '{print $2" "$18}' | awk -F" " '{print "busybox chown -R "$2"."$2" /data/data/"$1}' >> /data/cx.sh
chmod 0777 /data/cx.sh
/data/cx.sh
echo "Move UID done!"
reboot
Click to expand...
Click to collapse
What's this? I don't... I... can't comprehend...
Anyone able to make an auto script to help beginners and confused people like me? I can't follow through half of the OP's instructions.... not used to using SDK and terminal/ADB.
Woooow!! This is epic dude! I could have a Blur rom on my sd and a custom rom on my internal, to keep webtop functionality when i want! A Windows guide would be prettt awesome!
Sent from my MB860 using XDA
Amazing!
This is amazing!! Thanks a lot for your work!
This could make things MUCH easier for me when testing both CM9 and CM7 Neutrino.
I hope this project matures by the time my exams finish, like as Jokersax11 said, the ability to save dalvik cache would be awesome.
Massive thumbs up from me here
This really is some fantastic development! I am beyond impressed. You my friend should join the league of developer jedi's.
Fantastic work!
Now, if this could only somehow be transformed into a zip...LOL
J-Roc said:
This really is some fantastic development! I am beyond impressed. You my friend should join the league of developer jedi's.
Fantastic work!
Now, if this could only somehow be transformed into a zip...LOL
Click to expand...
Click to collapse
+1 for the ZIP and making this easier to use for the Ordinary good people like Some of Us
Amazing work ! Keep up
Thanks to your guide I've made it to cloning to sdcard all with windows. Will post back with tutorial if I can finish the job. Thank you for your amazing work!
Maybe you can work together with BootManager dev to support Atrix...
Dude, you're awesome. I think this is the final little push I needed to get me computer set up to dual boot Ubuntu and windows definitely going to be worth it now. Thanks for the work
KH_Lionheart said:
Dude, you're awesome. I think this is the final little push I needed to get me computer set up to dual boot Ubuntu and windows definitely going to be worth it now. Thanks for the work
Click to expand...
Click to collapse
You are quite welcome!
YouTube video (3:38) demonstrating reboot from one ROM to the other: http://www.youtube.com/watch?v=31TPyAguQ60
Sweet!
Seeing as how you had this on the back burner, I am SO glad you got those kernel building issues squashed. Awesome job man!
J-Roc said:
This really is some fantastic development! I am beyond impressed. You my friend should join the league of developer jedi's.
Fantastic work!
Now, if this could only somehow be transformed into a zip...LOL
Click to expand...
Click to collapse
tasadar said:
+1 for the ZIP and making this easier to use for the Ordinary good people like Some of Us
Amazing work ! Keep up
Click to expand...
Click to collapse
Here's the problem: I needed GApps on CM7 to provide the tools needed to support my experiment. However, Google has requested that copyrighted material be removed from CM7. So while I was able to streamline the integration of GApps with CM7, I could not provide the ROM, only the procedure. See http://forum.xda-developers.com/showthread.php?p=25588129#post25588129.
IDK, maybe Google will soften up a bit...?

[HELP] broken lcd + after working with adb doesnt boot

Hey xda-community,
might be a long text to read but i want to make it as detailed as possible :/.
I have an i9070 with broken lsd (+touch not working) and pattern lock.
i booted into recoverymode (TWRP) and removed the pattern lock via adb shell ("rm /data/system/gesture.key").
i wanted to use [email protected] so i tried to activate USB Debugging via adb shell.
in the internet i found a method and tried it right away
i had to pull /system/build.prop
add the line "persist.service.adb.enable=1" in the file
and after that i had to push it back, but i couln't.
So i searched to mount /system r/w ..... (prob for the false device ,_, )
i tried the 1st command and forgot the 4 in ext4, so i typed it like this in the adb shell:
# mount -o rw,remount -t ext /dev/block/mmcblk0p8 /system
# mount -o rw,remount -t ext4 /dev/block/mmcblk0p8 /system
after that i was able to push the build.prob back, and used
# mount -o ro,remount -t ext /dev/block/mmcblk0p8 /system
# mount -o ro,remount -t ext4 /dev/block/mmcblk0p8 /system
afterwards.
Rebooted it and it stuck while booting prob.
So i tried the push back the original build.prop. (thought it might be the cause)
Still not booting..
I ended trying all commands without any order:
# mount -o ro,remount -t ext /dev/block/mmcblk0p3 /system
# mount -o rw,remount -t ext /dev/block/mmcblk0p3 /system
# mount -o ro,remount -t ext4 /dev/block/mmcblk0p3 /system
# mount -o rw,remount -t ext4 /dev/block/mmcblk0p3 /system
# mount -o ro,remount -t ext /dev/block/mmcblk0p8 /system
# mount -o rw,remount -t ext /dev/block/mmcblk0p8 /system
# mount -o ro,remount -t ext4 /dev/block/mmcblk0p8 /system
# mount -o rw,remount -t ext4 /dev/block/mmcblk0p8 /system
chmod 755 system
chmod 777 system
i used also mount..../mmcblk0p3 instead of mmcblk0p8 because after using "mount" it showed behind the /system mmcblk0p3 ...
i messed too much around as a newbie :crying:
I am still able to use adb in recovery mode but cant acces the internal storage.
Would be nice if someone could help me
Ty if you read the whole text .. ^^

Categories

Resources