[script] [init.d] aNu_d2sd - data to sdcard - Samsung Galaxy Mini

Features:
- Move only 3rd-party-apps/user-apps and its data to sdcard
- System-apps data (contacs,sms etc) are pretty much intact in-case of sdcard failure or removed so your phone is not rendered useless
- Install as many apps as you like (limited by your /sd-ext size), your internal data usage will remain around 40~45mb
Mechanism in general:
- mount /sd-ext
- copy selected /data directories ( app, data, dalvik-cache etc) to /sd-ext
- bind /data directories to /sd-ext directories ( not the /data it self )
- create new directories for system-apps-data in /data
- move system-apps-data to new directories in /data and sysmlink it
Requirement:
- Init.d supported rom
- Busybox
- primary linux formated 2nd partition on sdcard
- Root: only needed if not using recovery flashable zip
Installation:
- DWYOR, remember to backup first
- NOT WORKING with device already running similar init.d script ( but it might work if its only using bind mounts ),
- disable or remove it ( mountext, mountsd, ad2sd etc), then wipe if necessary
- flash the zip from CWM/Stock recovery mode
or
- manually put it in /system/etc/init.d
- set permission: 0750
- set owner: root group: shell
Important:
- Will effectively work after the second boot.
- DO NOT remove sd-card while system is running
- Curently TESTED only on mini and young with stock gb, possibly working on any device/version
Example script usage:
Called in mountext script (modified cm7 script):
Filename: 05mountext
Code:
#!/system/bin/sh
#
# mount sd-ext partition in sdcard
# mod: use aNu_d2sd functions library script
#
# anuneanu
logI="log -p i -t mountext"
logE="log -p e -t mountext"
E2FSCK=`which e2fsck`
[ `which busybox` = "" ] && exit || BB=`which busybox`
[ "$SD_EXT_DIRECTORY" = "" ] && SD_EXT_DIRECTORY="/sd-ext"
# call aNu_d2sd function library script
. "/system/etc/init.d/99aNu_d2sd"
# find sd-ext partition
for MMC_NUM in `seq 0 9`; do
MMC_TYPE=`cat /sys/block/mmcblk$MMC_NUM/device/type`
if [ "$MMC_TYPE" = "SD" ]; then
SD_EXT_PART=/dev/block/mmcblk${MMC_NUM}p2
break
fi
done
# mount sd-ext if a valid partition was found
if [ -b "$SD_EXT_PART" ]; then
# check sd-ext filesystem
if [ -x "$E2FSCK" ]; then
$logI "checking $SD_EXT_PART for errors..."
$E2FSCK -p $SD_EXT_PART
e2fsk_exitcode=$?
else
$logE "executable e2fsck not found, assuming no filesystem errors"
e2fsk_exitcode=0
fi
# mount sd-ext partition
if [ $e2fsk_exitcode -le 2 ]; then
if [ $($BB grep -c ext4 /proc/filesystems) -ne 0 ]; then
mount_opt="-t ext4 -o noauto_da_alloc,data=ordered,commit=15,barrier=1,nouser_xattr,errors=continue,noatime,nodiratime,nosuid,nodev"
else
mount_opt="-t auto -o nosuid,nodev"
fi
$BB mount $mount_opt $SD_EXT_PART $SD_EXT_DIRECTORY
if [ $? -eq 0 ]; then
$BB chown 1000:1000 $SD_EXT_DIRECTORY
$BB chmod 0771 $SD_EXT_DIRECTORY
$logI "$SD_EXT_DIRECTORY successfully mounted"
aNu_d2sd "/data/app* /data/data /data/dalvik-cache /data/local"
else
$logE "unable to mount filesystem for $SD_EXT_DIRECTORY!"
no_sdext=1
fi
else
$logE "e2fsck returned error $e2fsk_exitcode"
$logE "unable to repair ext partition...not mounting"
no_sdext=1
fi
else
$logI "linux partition not found on sdcard"
no_sdext=1
fi
aNu_d2sd_restore $no_sdext
$BB sync
exit
Download:
Flashable zip :
updated (22-03-2013) : View attachment aNu_d2sd.zip
Source
Any response would be much appreciated, thanks

Pertamax..!!
Testing..Testing..

fendytrancers89 said:
Pertamax..!!
Testing..Testing..
Click to expand...
Click to collapse
there is typo in function file line 27 column 56, preventing it from creating system dalvik-cache.
the download file has been updated, please grab the new one.

Related

help please: set up swap w/o a2sd [pretty stumped at this point]

im trying to set up a linux_swap partition, but i dont want to use apps2sd, nor do i want to use cache2sd.
can someone point me in the right direction?
kchau said:
im trying to set up a linux_swap partition, but i dont want to use apps2sd, nor do i want to use cache2sd.
can someone point me in the right direction?
Click to expand...
Click to collapse
Just create the linux-swap partition and not the ext partition.
will i have to wipe?
and what is the recommended size?
supremeteam256 said:
Just create the linux-swap partition and not the ext partition.
Click to expand...
Click to collapse
Does that work now? I know it depends on how you are doing it, but assuming a build with auto apps2sd, the script just looks at partition number and will screw up if you do that. I think cyanogen has made adjustments in his experimental line.
im running cyanogen 4.0.4. will it work?
kchau said:
im running cyanogen 4.0.4. will it work?
Click to expand...
Click to collapse
if the script does that couldnt you create a 1mb ext2/3/4?
You also need to edit the user.conf file.
linux_swap_en=1 # enable(1) or disable(0) linux swap
linux_swap_partition=/dev/block/mmcblk0p2 # swap partition device
The usual setting is mmcblk0p3 but you need to set it to mmcblk0p2 because your linus swap part is going to be 2 instead of 3
This is for swap only with no compcache
#compcache related parameters
compcache{
compcache_en=0 # enable(1) or disable(0) compcache
cc_disksize=32 # Ram swap disksize - any number between 1 to 95 should work
cc_memlimit=18 # Limite the memory usage when backing swap is used
cc_backingswap_en=0 # enable or disable backing swap
cc_backingswap=/dev/block/mmcblk0p2 # pointing to the backingswap partition device
cc_swappiness=60 # default 60
}
#Linux swap parameters
#
# linux swap can only be enabled if cc_backingswap_en is set to "0"
#
linux_swap{
linux_swap_en=1 # enable(1) or disable(0) linux swap
linux_swap_partition=/dev/block/mmcblk0p2 # swap partition device
swappiness=60 # default 60
}
will compcache improve speed while running background applications?
so do i have to create an ext3 partition to put the userconf in there?
wait, where do i put the user.conf file then?
i read around and i think im supposed to put the user.conf file into /system/sd
i also enabled compcache. let me know if that is not advised.
with a 64mb swap
#compcache related parameters
compcache{
compcache_en=1 # enable(1) or disable(0) compcache
cc_disksize=70 # Ram swap disksize - any number between 1 to 95 should work
cc_memlimit=18 # Limite the memory usage when backing swap is used
cc_backingswap_en=0 # enable or disable backing swap
cc_backingswap=/dev/block/mmcblk0p2 # pointing to the backingswap partition device
cc_swappiness=60 # default 60
}
#Linux swap parameters
#
# linux swap can only be enabled if cc_backingswap_en is set to "0"
#
linux_swap{
linux_swap_en=1 # enable(1) or disable(0) linux swap
linux_swap_partition=/dev/block/mmcblk0p2 # swap partition device
swappiness=60 # default 60
}
i have an issue with a boot loop at th eandroid screen now
ok, so, if i dont boot with the sd card inserted, it boots, but then i get to the home screen and it says none of my apps are installed.
so i go to recovery, remove the user.conf file. and same thing
so i restore, and boot with the sd card in. same thing, bootloop.
and now im restoring, but not booting with sd card.
what happened? was i not supposed to enable compcache? or keep the cc_disksize at 32?
so, ive been following this thread
http://forum.xda-developers.com/showthread.php?p=4379172
with this a2sd, it doesnt boot:
Code:
#!/system/bin/sh
#
# Apps2SD using symlinks and bind mounts
# [email protected] (cyanogen)
#
echo "--- Welcome to Android/CyanogenMod!";
sysctl -p
# execute any postinstall script then kill it
if [ -e /data/firstboot.sh ];
then
echo "--- Executing firstboot.sh";
/system/bin/sh /data/firstboot.sh;
rm -f /data/firstboot.sh;
fi;
if [ -e /dev/block/mmcblk0p2 ];
then
echo "--- Checking ext filesystems";
# fsck the sdcard filesystem first
e2fsck -y /dev/block/mmcblk0p4;
# set property with exit code in case an error occurs
setprop cm.e2fsck.errors $?;
# mount and set perms
busybox mount -o noatime,nodiratime -t auto /dev/block/mmcblk0p4 /system/sd;
busybox chown 1000:1000 /system/sd;
busybox chmod 771 /system/sd;
# clean up any old symlinks, create data directories
for i in dalvik-cache data;
do
if [ -h /data/$i ];
then
rm /data/$i;
fi;
if [ ! -d /data/$i ];
then
mkdir /data/$i;
busybox chown 1000:1000 /data/$i;
busybox chmod 771 /data/$i;
fi;
done;
# don't allow /data/data on sd because of upgrade issues - move it if possible
if [ -d /system/sd/data ];
then
busybox cp -a /system/sd/data/* /data/data/;
busybox rm -rf /system/sd/data;
fi;
# move apps and dalvik cache from internal memory to sdcard
for i in app app-private dalvik-cache;
do
if [ ! -d /system/sd/$i ];
then
mkdir /system/sd/$i;
fi
busybox chown 1000:1000 /system/sd/$i;
busybox chmod 771 /system/sd/$i
if [ -d /data/$i ] && [ ! -h /data/$i ];
then
busybox cp -a /data/$i/* /system/sd/$i/;
busybox rm -f /data/$i/*;
fi;
done;
# symlink app dirs - they must be on the same filesystem
for i in app app-private;
do
if [ -d /data/$i ] && [ ! -h /data/$i ];
then
busybox rm -rf /data/$i;
busybox ln -s /system/sd/$i /data/$i;
fi;
done;
# bind mount dalvik-cache so we can still boot without the sdcard
busybox mount -o bind /system/sd/dalvik-cache /data/dalvik-cache;
busybox chown 1000:1000 /data/dalvik-cache;
busybox chmod 771 /data/dalvik-cache;
# clean up old whiteouts
for i in local misc property system tombstones data;
do
if [ -h /system/sd/$i ]; then rm -f /system/sd/$i; fi
done;
# please don't put odex files in the app directory people!
# it causes dexopt to crash when switching builds!
busybox rm -f /system/sd/app/*.odex
# call a userinit.sh script if it's present on the sdcard
# otherwise just enable compcache with no backing swap
if [ -e /system/sd/userinit.sh ];
then
echo "--- Executing userinit.sh"
busybox chmod +x /system/sd/userinit.sh
/system/bin/sh /system/sd/userinit.sh;
else
modprobe ramzswap;
/system/bin/rzscontrol /dev/block/ramzswap0 --init
swapon /dev/block/ramzswap0
fi
setprop cm.a2sd.active 1;
echo "+++ Apps-to-SD successfully enabled";
else
# replace symlinks with directories so we can boot without sd
for i in app app-private;
do
if [ -h /data/$i ];
then
rm -f /data/$i;
mkdir /data/$i;
busybox chown 1000:1000 /data/$i;
busybox chmod 771 /data/$i;
fi;
done;
modprobe ramzswap;
/system/bin/rzscontrol /dev/block/ramzswap0 --init
swapon /dev/block/ramzswap0
setprop cm.a2sd.active 0;
fi;
sync;
setprop cm.filesystem.ready 1;
with this a2sd, no swap shows up when i go adb shell free:
Code:
#!/system/bin/sh
#
# Apps2SD using symlinks and bind mounts
# [email protected] (cyanogen)
#
echo "--- Welcome to Android/CyanogenMod!";
sysctl -p
# execute any postinstall script then kill it
if [ -e /data/firstboot.sh ];
then
echo "--- Executing firstboot.sh";
/system/bin/sh /data/firstboot.sh;
rm -f /data/firstboot.sh;
fi;
if [ -e /dev/block/mmcblk0p2 ];
then
echo "--- Checking ext filesystems";
# fsck the sdcard filesystem first
e2fsck -y /dev/block/mmcblk0p2;
# set property with exit code in case an error occurs
setprop cm.e2fsck.errors $?;
# mount and set perms
busybox mount -o noatime,nodiratime -t auto /dev/block/mmcblk0p2 /system/sd;
busybox chown 1000:1000 /system/sd;
busybox chmod 771 /system/sd;
fi;
sync;
setprop cm.filesystem.ready 1;
and with the default a2sd, no boot.
and this is my user.conf
Code:
# General parameters
general{
apps2sd=0 # this is useless here, require a modified a2sd script
media2sd=0 # moves the medias to sd if /system/sd/media exists
}
#compcache related parameters
compcache{
compcache_en=1 # enable(1) or disable(0) compcache
cc_disksize=70 # Ram swap disksize - any number between 1 to 95 should work
cc_memlimit=18 # Limit the memory usage for backing swap (cc .5x known issue-defaults to 15% of total RAM)
cc_backingswap_en=0 # enable(1) or disable(0) backing swap
cc_backingswap=/dev/block/mmcblk0p2 # pointing to the backingswap partition device
cc_swappiness=60 # default 60
}
#Linux swap parameters
#
# linux swap can only be enabled if cc_backingswap_en is set to "0"
#
linux_swap{
linux_swap_en=1 # enable(1) or disable(0) linux swap
linux_swap_partition=/dev/block/mmcblk0p2 # swap partition device
swappiness=60 # default 60
}
partition 1 is my fat32 which is whatever 8 gigs minus 64
partition 2 is 64 megs of linux_swap
WOW,
You have completely over complicated this. remove the user.conf file from every location you put it in, remove all partitions and leave it with none, boot in recovery and wipe, then reflash cyan 4.0.4. reboot. everything should be normal with no swap and it should ask you if you want to format the sd card. when you get it working normal post back here.
my whole point is not to wipe, and i dont want a2sd.
wiping and doing what you said above will enable a2sd.
what part of my previous post would enable apps2sd?
if you don't want to wipe, then at least do everything else i posted
ok, i removed all the user.conf and repartitioned my sdcard
now what?
reflash cyan 4.0.4 and boot so it will format the card
what is the make, size, and class of your sdcard?
why no apps2sd?

[Solved]Help to mount SDcard

Hi I built a little script to mount my SDcard @ startup of the phone and install some apps.
here it is:
Code:
sleep 2
busybox mount > /data/mount.txt
busybox ls /dev/block/vold >> /data/mount.txt
busybox mount -t vfat -o rw,dirsync,nosuid,nodev,noexec,uid=1000,gid=1015,fmask=0702,dmask=0702,allow_utime=0020,shortname=mixed,utf8 /dev/block/vold/179:1 /sdcard >> /data/mount.txt
busybox mount >> /data/mount.txt
sleep 3
echo "APPS installation"
if [ -e /sdcard/Apps-install/install.txt ];
then
echo "found file" > /sdcard/Apps-install/install.txt
cd /sdcard/Apps-install
ls *.apk > ./apps.txt
for line in $(cat apps.txt); do install -c -D /sdcard/Apps-install/"$line" /data/app >> /sdcard/Apps-install/install.txt; done
echo "ok" >> /sdcard/Apps-install/install.txt
else
echo "file not found" > /sdcard/Apps-install/install.txt
fi;
sleep 2
echo "Finish"
if [ -e /data/firstboot.sh ];
then
busybox rm -f /data/firstboot.sh;
busybox rm -f /sdcard/Apps-install/apps.txt;
fi;
echo "Restart"
sleep 1
reboot
I'm sure that the code is well executed (as is have data in /data/mount.txt) but the mount of the SD and so every work related to the SD
What is strange is that script work if i execute it after the phone has completely started.
Can someone help please.
Bye
Herc.8)
A Little up for a little help
Hi,
I still need help,
thx by advance
Bye
Herc. 8)
Ok finally found bye myself.
I changed the device: /dev/block/vold/179:1 for /dev/block/mmcblk0p1
That's all.
Bye
Herc. 8)

[Gen9] Developement organization

Hi
Archos G9 devices are quite new so we should create some developement guidelines/standards to avoid total mess.
This thread is meant to be the place to create those, feel free to contribute.
1. Firmware file name- archos.ext4/squashfs/img
as propposed by letama (source) and agreed by suduru_petru (source)
2. Firmware updating
letama in his builds added a mechanism to painlessly update system image: new image is called [...].update, kernel initrd deletes "old" file and renames new one- there is no need to boot or install stock firmware.
My opinion- this should be the standard but subject is to be discussed
However updating/downgrading firmware may cause problems so-
3. Recovering from problems (bootloop, FC's etc)
This subject is to be discussed.
Archos G9 has specific system structure and "non-standard" Recovery. For now the only way to fix app FC's or a bootloop is to wipe data (Reset Android option in recovery) but this deletes all system data. Better solution is to wipe dalvik-cache- this deletes some files used by system but they are rebuilt during boot- but there is no way to do it now.
After talking with letama we've come to an idea: kernel init looks for .update files and
-if it's archos.ext4/squashfs/img.update kernel updates system image
-if it has another but predefined name- .update file is a shell script that is executed
This would give us a substitute for a "standard" recovery. Best way would be to use external SD-card for this task but first we have to check if there are any problematic cards (seems that letama has such card)
Please post your opinions/ideas/suggestions but keep in mind that this is not a system/app feature request topic
And if you have a better idea for the topic title- let me know
My idea how .update files should be handled:
during boot check if external sd card is present
1)yes- check for .update files
a)archos.[...].update present- delete current system image from /data/media, copy new one, delete archos.[...].update files from card AND from /data/media
b) .update script file present- run script, delete script .update from sd AND /data/media
2) no- check /data/media for .update files
a)archos.[...].update- delete current system image, rename update file
b).update script- run script and delete .update file
Notes:
-both types of .update files should be handled if found- when updating firmware wiping dalvik-cache (rm -r -f /data/dalvik-cache) is always advised and this can be done using a script since we don't have a "standard" recovery
-using external sd as the first choice- if adb can't be accessed (no PC, no USB cable, bootloop etc) there is no way to access internal storage
gen_scheisskopf said:
My idea how .update files should be handled:
during boot check if external sd card is present
1)yes- check for .update files
a)archos.[...].update present- delete current system image from /data/media, copy new one, delete archos.[...].update files from card AND from /data/media
b) .update script file present- run script, delete script .update from sd AND /data/media
2) no- check /data/media for .update files
a)archos.[...].update- delete current system image, rename update file
b).update script- run script and delete .update file
Notes:
-both types of .update files should be handled if found- when updating firmware wiping dalvik-cache (rm -r -f /data/dalvik-cache) is always advised and this can be done using a script since we don't have a "standard" recovery
-using external sd as the first choice- if adb can't be accessed (no PC, no USB cable, bootloop etc) there is no way to access internal storage
Click to expand...
Click to collapse
First...Thanks @gen_scheisskopf for your idea....ofcourse is very important for us to have a standard "language".....and you are rigt ( is also my opinion ) - is very unpleasant to take it from zero for an future update or custom rom , considering that many users have installed many custom applications ( games, contacts-data, calendar-data and other personalizated-data....or other stuff).
I hope that together , we'll found the right way for this inconvenience ......and what you began is a necessary and welcome environment to improve programming and use.
Without portability not succeed to have its own development !
I hope in a close collaboration among you especially as you have one of the best developers (Thanks @LeTama) .. but I hope to help us and other developers ....See you soon ! and you started a great job anyway !
Problems like bootloop or FC's can occur even if firmware wasn't changed but there is no *easy* way to fix this yet- so we should make one
One more thing from my side- [email protected] image should be mounted RO by default:
-system RO is a standard (also in official firmware)
-nobody can do any harm to system by accident- any changes will require remounting RW first and no app does this by itself
-all root apps that can make changes to system (TitaniumBackup, RootExplorer, Abslute Root Tools, SUFBS etc) will function properly for remounting RO/RW
gen_scheisskopf said:
-system RO is a standard (also in official firmware)
Click to expand...
Click to collapse
Agreed, it would be nice. However, Archos has not the android standard way of managing partitions, they don't mount a /system partition on top of initrd , they mount a root partition that contains a system directory and chroot it. In short, we mount /dev/loop0 on /new-sys then chroot /new-sys, we don't /dev/block/mmcblkp1 on /system.
More, /dev/loop0 is becoming /dev/block/loop0 when android is booted, so it's a bit tricky to remount r/w after that. I think most root applications are confused with this layout and can't remount properly, that's why I left default to r/w in my build.
It would be good to test it a bit more with few root apps to see if some are working, I didn't do much tests.
I understand.
How about "ln -s /dev/block/loop0 /"? This can be done in init.rc (both kernel initrd and in system image init), not sure if this will work properly
Another idea about .update files- possibly safer way would be to add a predefined set of scripts to initrd- like it's done in recovery- and to use .update files with a different names (like wipe-dalivik.update).
letama said:
It would be good to test it a bit more with few root apps to see if some are working, I didn't do much tests.
Click to expand...
Click to collapse
TitaniumBackup has problems with integrating updated apps into rom- device rebooted during Maps.apk processing (2nd of 4) and now Market is missing from /system/app
Can't say however what caused this- system img file location (loop0) or RW by default. Ext4 is not the cause, I've used ext2 and ext4 for /system on the other device before and there was no problem.
EDIT:
TB restored Market from backup straight to /system/app and it seems that manual integration works fine. Maybe that was just a system error.
Dalvik-cache wipe in init:
Code:
# Do updates if need
if [ -e /data/media/archos.ext4.update ] ; then
rm /data/media/archos.ext4
mv /data/media/archos.ext4.update /data/media/archos.ext4
[B]rm -r /data/dalvik-cache[/B]
fi
if [ -e /data/media/archos.squashfs.update ] ; then
rm /data/media/archos.squashfs
mv /data/media/archos.squashfs.update /data/media/archos.squashfs
[B]rm -r /data/dalvik-cache[/B]
fi
[B]if [ -e /data/media/wipe-dalvik.update ] ; then
rm -r /data/dalvik-cache
rm /data/media/wipe-dalvik.update
fi[/B]
-when archos.ext4/squashfs.update file is found dalvik-cache wipe is mandatory
-file /data/media/wipe-dalvik.update also triggers wipe (and dalvik-wipe.update file is removed
Tested, works fine
gen_scheisskopf said:
Dalvik-cache wipe in init:
Code:
# Do updates if need
if [ -e /data/media/archos.ext4.update ] ; then
rm /data/media/archos.ext4
mv /data/media/archos.ext4.update /data/media/archos.ext4
[B]rm -r /data/dalvik-cache[/B]
fi
if [ -e /data/media/archos.squashfs.update ] ; then
rm /data/media/archos.squashfs
mv /data/media/archos.squashfs.update /data/media/archos.squashfs
[B]rm -r /data/dalvik-cache[/B]
fi
[B]if [ -e /data/media/wipe-dalvik.update ] ; then
rm -r /data/dalvik-cache
rm /data/media/wipe-dalvik.update
fi[/B]
-when archos.ext4/squashfs.update file is found dalvik-cache wipe is mandatory
-file /data/media/wipe-dalvik.update also triggers wipe (and dalvik-wipe.update file is removed
Tested, works fine
Click to expand...
Click to collapse
Thanks...good job !
Another test, possibly will work for HDD models:
Code:
mount_p data
mount_p storage_`$GET_INFO p` #this should return product name and use correct storage mountpoint
#Check if system image is present, if not- copy from storage
if [ ! -e /data/local/archos.ext4 ] ; then
cp /mnt/storage/archos.ext4.update /data/local/archos.ext4
fi
# Do updates if need
if [ -e /mnt/storge/archos.ext4.update ] && [ -e /mnt/storage/system.update] ; then
rm /data/local/archos.ext4
cp /mnt/storage/archos.ext4.update /data/local/archos.ext4
rm /mnt/storage/system.update
rm -r /data/dalvik-cache
fi
if [ -e /mnt/storage/archos.squashfs.update ] && [ -e /mnt/storage/system.update ] ; then
rm /data/local/archos.squashfs
cp /mnt/storage/archos.squashfs.update /data/local/archos.squashfs
rm /mnt/storage/system.update
rm -r /data/dalvik-cache
fi
if [ -e /mnt/storage/wipe-dalvik.update ] ; then
rm -r /data/dalvik-cache
rm /storage/wipe-dalvik.update
fi
umount_p storage_`$GET_INFO p`
# Now boot
if [ -e /data/local/archos.ext4 ] ; then
$LOSETUP `get_mount_info d rfsext4` /data/local/archos.ext4 || log_and_die "Mounting system partition failed"
mount_p rfsext4 || log_and_reboot "Mounting system partition failed"
umount_p rawfs
rootfs_path=`get_mount_info p rfsext4`
umount_pseudo_fs
log "SWITCHING TO REAL ROOT"
exec switch_root $rootfs_path /init
fi
$LOSETUP `get_mount_info d rootfs` /data/loacl/archos.squashfs || log_and_die "Mounting system partition failed"
mount_p rootfs || log_and_reboot "Mounting system partition failed"
umount_p rawfs
rootfs_path=`get_mount_info p rootfs`
umount_pseudo_fs
log "SWITCHING TO REAL ROOT"
exec switch_root $rootfs_path /init
Changes
-system image file is mounted from /data/local (not /data/media)
-archos.ext4.update file is preserved on storage (/data/media or hdd) in case of data wipe- init copies it to the right place if file is not present
-updating firmware requires two files- archos.ext4.update and system.update- second one is an empty file, it is removed after system update (archos.ext4.update is not removed)
-I did not add checking for archos.squashfs file
Prequisites
-minimum 512 MB free on /data for hdd models- they have much smaller /data- about 1.5GB
This works fine on 16GB model- file is copied without any problem and possibly will work on HDD models too- I've sent test version to philmein (he was willing to test)
Android does not touch /data/local/archos.ext4 file (/data/local belongs to shell, not system so it's a safe place)
Other thoughts:
-maybe we drop archos.squashfs support?
-archos.ext4 can be made smaller- 191 MB is free so 400 MB should be more than enough
-maybe add mounting official system file (.squashfs.secure) if there is no custom one present and no archos.ext4.update on storage?
-other possible location can be /data/customization but I didn't test it
Hi @gen_scheisskopf...
I think ( not sure ...) , that until we find a way for mount proper HDD into initramfs , we can't load any files system ( .ext4, .squashfs, .update ) for Archos HDD !
Your test it's work great because for flash 8/16G , @letama modified initramfs
for mounting (.ext4, .squashfs ) -proper !
I believe the solution to root version Archos HDD,is just find a solution to change something in initramfs for a proper mount , after that I do not think it matters where you are place the files system ( /data/media, /data/local , /data/customization - is the same way )
Still believe that /data/media was not chosen at random - when we connect the tablet to the computer we see just Internal Storage ( ..or + SD Card), which is equal to /data/media/....you don't need root, you don't need any other app for look into Internal Storage....
surdu_petru said:
Hi @gen_scheisskopf...
I think ( not sure ...) , that until we find a way for mount proper HDD into initramfs , we can't load any files system ( .ext4, .squashfs, .update ) for Archos HDD !
Click to expand...
Click to collapse
All proper mountpoints are stored in /etc/mountpoints- init reads device name and uses correct mount. The only thing that possibly can be required is
Code:
wait_blk_device storage_$DEVICENAME
(I'm not sure if it's wait_blk_device, will check)
surdu_petru said:
Your test it's work great because for flash 8/16G , @letama modified initramfs
for mounting (.ext4, .squashfs ) -proper !
I believe the solution to root version Archos HDD,is just find a solution to change something in initramfs for a proper mount , after that I do not think it matters where you are place the files system ( /data/media, /data/local , /data/customization - is the same way )
Still believe that /data/media was not chosen at random - when we connect the tablet to the computer we see just Internal Storage ( ..or + SD Card), which is equal to /data/media/....you don't need root, you don't need any other app for look into Internal Storage....
Click to expand...
Click to collapse
Problem is that after android boots all mountpoints change.
Using /data/media may not work- on HDD there may be problems with mounts if /data/media belongs to hdd.
I've chosen /data/local not by mistake:
-android does not touch files placed there (as they may be vendor specific)
-/data/local is chmoded to shell while most of other /data folders are chmoded to root
-running system form HDD may decrease battery life greatly while /data/local is for sure flash memory
-modified initrd check for required files/updates on storage (/mnt/storage) and does not delete possibly necessary archos.ext4.update file (in case of data wipe) so copying those files doesn't change at all- just drag'n'drop on PC
It seems that modified init works for HDD models but more tests are required: http://forum.xda-developers.com/showpost.php?p=22309411&postcount=72
Modified part of init:
Code:
mount_p data
mount_p storage
#Check if system image is present, if not- copy from storage
if [ ! -e /data/local/archos.ext4 ] && [ ! -e /mnt/storage/archos.ext4.update] ; then
cp /mnt/storage/archos.ext4.backup /data/local/archos.ext4
rm -r /data/dalvik-cache
fi
# Do updates if need
if [ -e /mnt/storage/archos.ext4.update ] ; then
rm /data/local/archos.ext4
cp /mnt/storage/archos.ext4.update /data/local/archos.ext4
mv /mnt/storage/archos.ext4.update /mnt/storage/archos.ext4.backup
rm -r /data/dalvik-cache
fi
if [ -e /mnt/sdcard/wipe-dalvik.update ] ; then
rm -r /data/dalvik-cache
rm /mnt/sdcard/wipe-dalvik.update
fi
umount_p storage
# Now boot
if [ -e /data/local/archos.ext4 ] ; then
$LOSETUP `get_mount_info d rfsext4` /data/local/archos.ext4 || log_and_die "Mounting system partition failed"
mount_p rfsext4 || log_and_reboot "Mounting system partition failed"
umount_p rawfs
rootfs_path=`get_mount_info p rfsext4`
umount_pseudo_fs
log "SWITCHING TO REAL ROOT"
exec switch_root $rootfs_path /init
fi
$LOSETUP `get_mount_info d rootfs` /data/local/archos.squashfs || log_and_die "Mounting system partition failed"
mount_p rootfs || log_and_reboot "Mounting system partition failed"
umount_p rawfs
rootfs_path=`get_mount_info p rootfs`
umount_pseudo_fs
log "SWITCHING TO REAL ROOT"
exec switch_root $rootfs_path /init
Changes:
-support only for archos.ext4
-after update a backup file is created in case of data wipe (archos.ext4.backup)
Works on flash model, to be tested on HDD models:
http://dl.dropbox.com/u/14106051/archos/kernel_hdd_test7.zip
EDIT:
As it was just reported- G9 80 HDD does not have SD card slot so earlier idea to use external SD has to be dropped.
Backup & restore of archos.ext4 without wiping data (in case something went wrong with merging changes into the system).
Code:
#backup & restore of system image
if [ -e /mnt/storage/backup.update ] ; then
rm /mnt/storage/archos.ext4.backup
cp /data/local/archos.ext4 /mnt/storage/archos.ext4.backup
fi
if [ -e /mnt/storage/restore.update ] ; then
rm /data/local/archos.ext4
cp /mnt/storage/archos.ext4.backup /data/local/archos.ext4
rm -r /data/dalvik-cache
fi
umount_p storage[...]

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...?

Use internal sdcard as dalvik-cache

As I cannot use the internal sdcard with CM11, I've made a small script which mounts the internal sdcard as /data/dalik-cache to get more free space for apps & app-data.
WARNING: Only for users who are familiar with adb as you can probably brick your device!
Installation is a bit tricky, maybe someone makes an installer. All steps are done over adb
First format the internal sdcard with ext4: mke2fs -t ext4 /dev/block/mmcblk0p23
Copy script below to /data/local/userinit.sh (e.g. adb push userinit.sh /data/local/userinit.sh)
chmod 755 /data/local/userinit.sh
Reboot and let dalvik cache recreate. After this happend, reboot into recovery, wipe dalvik-cache and enjoy the 200MB more free space in data for apps.
Code:
#!/system/bin/sh
busybox mount -t ext4 -o noatime,nodiratime,nosuid,nodev /dev/block/mmcblk0p23 /data/dalvik-cache;
mountext=`busybox mount | egrep 'ext2|ext3|ext4'`;
if [ -n "$mountext" ];
then
busybox chown 1000:1000 /data/dalvik-cache;
busybox chmod 771 /data/dalvik-cache;
fi;
sync;
Awesome... I just needed it for assigning block on dalvik in my beta app. Works great!

Categories

Resources