[DEV] EFS Autobackup script for ROM Developers & Users - Nexus S Android Development

I have created a autobackup script for the EFS partition that contains information for your IMEI number.
I am addressing all ROM Developers to include this script in their ROM's!
What does this script do? It creates efs_autobackup folder on your SDCard and then tars the whole EFS partition into efs-backup.tar.gz file. Once this file is created, you can safely copy it to your PC. The script also looks for that file on reboot and if the file exists, it won't create another one.
What are the benefits of the tar file?
It keeps the permissions information for your EFS partition, so that when you want to restore your EFS partition, you only need to extract that file with the RootExplorer to your EFS partition and overwrite the old files. It sets the permissions automatically for you, so you don't need to mess or handle that yourself.
Please Developers, include this in your ROM so that users that forget to backup their EFS partition, don't have to regret that.
INSTRUCTIONS:​
For Users:
If you are on ROM that don't have this script integrated - you can flash the attached zip file in your Recovery to integrate the script.
For Developers:
Either take the file from the attached zip or create 01efstar file (very important to name it with 01 prefix, since it runs as first when the Phone starts, otherwise it won't work) in the /system/etc/init.d folder with this content:
Code:
#!/system/bin/sh
# EFS Autobackup script for Samsung Nexus S
# By Brainmaster
mount /dev/block/platform/s3c-sdhci.0/by-name/media /sdcard
if [ ! -f /sdcard/efs_autobackup/efs-backup.tar.gz ];
then
mkdir /mnt/sdcard/efs_autobackup
busybox tar zcvf /sdcard/efs_autobackup/efs-backup.tar.gz /efs
fi
umount /sdcard

Reserved 1.

What a good idea.

Should I implement this on the radio zip file too?

window7 said:
Should I implement this on the radio zip file too?
Click to expand...
Click to collapse
No, this is ROM based. If the ROM don't support the scripts, then it won't work.
BUT, I am working on a version that can do this directly in the recovery (undependable from ROM) - then you can integrate it in every Radio flash file.

Well done,good job !
Sent from my Nexus S using XDA App

brainmaster said:
No, this is ROM based. If the ROM don't support the scripts, then it won't work.
BUT, I am working on a version that can do this directly in the recovery (undependable from ROM) - then you can integrate it in every Radio flash file.
Click to expand...
Click to collapse
you only have to modify the updater-swcript? easy as a pie!
Sent from my Nexus S using XDA Premium App

i hope ur miui rom has this or else should i flash it?

Borky_16 said:
you only have to modify the updater-swcript? easy as a pie!
Sent from my Nexus S using XDA Premium App
Click to expand...
Click to collapse
Not so easy to mount the efs partition through the updater-script.
ancilary said:
i hope ur miui rom has this or else should i flash it?
Click to expand...
Click to collapse
From the next release on. If you want you can flash the script now.

yeah i dunno, first i made my own script and put into etc/init.d (running netarchy 1.3.9 which obv supports init.d scripts) - no dice. so i removed that file and flashed the zip and still getting no backup on sd.
ideas?

brainmaster said:
Not so easy to mount the efs partition through the updater-script.
Click to expand...
Click to collapse
oh that is right! :O forgot about it

Script successfully injected into my current installation of CM nightly, and successfully executed on reboot.
Uploaded the resulting file to Dropbox -- where I know I'll never lose it!
Two thumbs up!

I will include this script in my next rom update. I believe every dev should do the same.
Sent from my Google Nexus S using XDA Premium App

Good idea to put this into every ROM. Some people probably are not aware of the danger and if anything happens at least they can find the backup files on their sdcard. Maybe one should also add a small text file as an explanation what this backup is good for, so they do not accidentally delete it. Maybe you could also change the backup file on the sdcard to read-only.
Btw, you can also make a simple backup image with 'dd if=/dev/block/mtdblock6 of=efs.img'.
And for the record: I wondered why the /efs partition is mounted read-write and thought it might be a good idea change this to read-only. Problem was, without write access to /efs the SIM card would not unlock anymore. So not a good idea.

Just got my phone back from Regenersis with the IMEI restored! Shows that it can be done!

Ezekeel said:
Good idea to put this into every ROM. Some people probably are not aware of the danger and if anything happens at least they can find the backup files on their sdcard. Maybe one should also add a small text file as an explanation what this backup is good for, so they do not accidentally delete it. Maybe you could also change the backup file on the sdcard to read-only.
Btw, you can also make a simple backup image with 'dd if=/dev/block/mtdblock6 of=efs.img'.
And for the record: I wondered why the /efs partition is mounted read-write and thought it might be a good idea change this to read-only. Problem was, without write access to /efs the SIM card would not unlock anymore. So not a good idea.
Click to expand...
Click to collapse
Actually it should be as follows seeing as we get a read-only error;
dd if=/dev/block/mtdblock6 of=/mnt/sdcard/efs.img
Sent from my Nexus S using XDA Premium App

atrixboy said:
Actually it should be as follows seeing as we get a read-only error;
dd if=/Dec/block/mtdblock6 of=/months/sdcard/efs.img
Sent from my Nexus S using XDA Premium App
Click to expand...
Click to collapse
Please, IF you want to use the option to make efs.img (I don't know why would you like to do that, because tar is easier to extract and keeps the permissions), THEN you need right command.
You misspelled allot.
Code:
dd if=/dev/block/mtdblock6 of=/sdcard/efs.img

Yea I realised that after I hit post. I agree rfs is much nicer and cleaner to deal with.
dd if=/dev/block/mtdblock6 of=/mnt/sdcard/efs.img
Or efs.rfs. however you prefer. Rfs being the more logical
Sent from my Nexus S using XDA Premium App

brainmaster said:
Please, IF you want to use the option to make efs.img (I don't know why would you like to do that ...)
Click to expand...
Click to collapse
Because mtd6 contains more than the visible files mounted on /efs, such as the wimax keys.
My question is how to restore the partition without having to worry about this:
Dees_Troy said:
Using dd on mtd devices is a bad idea when it comes time to restore. It's a quick path to a brick. It tends to inadvertently mark blocks as bad.
Click to expand...
Click to collapse

Maximilian Mary said:
Because mtd6 contains more than the visible files mounted on /efs, such as the wimax keys.
My question is how to restore the partition without having to worry about this:
Click to expand...
Click to collapse
Darn. I did not know that.
Turns out one should use nanddump and nandwrite from mtd-utils (http://git.infradead.org/mtd-utils.git). Maybe someone can compile a version for Android. That would be quite useful.

Related

[Q] Overwrote playlogos1!

As I was following the guide to improve the galaxy's quadrant score, I messed on one of the lines and overwrote the playlogos1 file that was meant to be renamed to playlogosnow.
I'm currently running JM5; do I need a file from the same version or can I take it from something like froyo which I found?
Or will this require me to reflash, and is it safe to do so without the file?
you need this file only to play the startup animation. if you don't care for the animation you can just delete it or replace it with a script (as you did, i suspect?!).
anyway, you can take this file from any firmware to replace your's...
Ah damn. Just to be on the safe side as I had no idea of the file's importance, I've just finished reflashing the firmware to restore it.
Thanks anyway.
SYUNIXT said:
Ah damn. Just to be on the safe side as I had no idea of the file's importance, I've just finished reflashing the firmware to restore it.
Thanks anyway.
Click to expand...
Click to collapse
you'r welcome ... if you want to do the fix again:
the playlogos1 file ist just the binary that play's the animation. it will be started with root-permissions, so you can replace it to run custom commands as root. in our case we want it to
*) make the loop device and set it up
*) mount the ext2.data file
to make the fix permanent.
mine looks like (you have to make the ext2.data file, format it, copy the data and relink before!!!!):
busybox mknod /dev/loop0 b 7 0
busybox losetup /dev/loop0 /data/ext2.data
busybox mount -t ext2 -o noatime,nodiratime /dev/loop0 /data/ext2.data_mp
and if you want your sgs to play the startup animation. you have to rename playlogos1 to something else and start it from the script...got it?
but again, if the file is not there (eg. you deleted it) nothing bad will happen, you will just not see the animation. the sound will still play and everything else will be fine
Can anyone provide me with the playlogos1 file, or somewhere that I can get it? I updated my rom and it somehow was erased.
ayinyesh said:
Can anyone provide me with the playlogos1 file, or somewhere that I can get it? I updated my rom and it somehow was erased.
Click to expand...
Click to collapse
Try OCLF from the market - it used to have a restore playlogo script.
http://www.youtube.com/comment?lc=8KNWgMta4EvqAcKfdwk-z2flON7mZ3RxQDynukPTSjk
Fix boot screen after one click lag fix:
1: Download playlogosnow megaupload. com/?d=M1N9RFMM
2: place the file on your internal sd.
3: replace (copy past) the file using a root manager in /system/bin
4: reboot
Should have posted this in Q&A....
jodue said:
you need this file only to play the startup animation. if you don't care for the animation you can just delete it or replace it with a script (as you did, i suspect?!).
anyway, you can take this file from any firmware to replace your's...
Click to expand...
Click to collapse
You better not advice people to brick their phones. Missing playlogo1 causes your sgs wont boot because it freezes trying to load playlogos1. Thanks for the advice, now i have bricked phone.

[Q] Hashcode's SafeStrap and the XT883

hey guys, before submitting a bug to Hash i wanted to ask here if anyone tested this yet and made the same experience as i did: SafeStrap 1.08 is not fully compatible with the XT883.
Backups are not working because \system can't be mounted.
anyone can confirm this?
It's a known issue. If you're feeling brave, you can try my modified (and slightly older, now) version of SafeStrap that'll nandroid backup my ME863, and will probably nandroid backup your XT883 as well.
http://forum.xda-developers.com/showpost.php?p=20976390&postcount=294
i tried it, backups working fine now, thanks a lot!
Sent from my XT883 using XDA App
I'm using the xt883 radio.img and a tweaked build.prop on the xt862 and can't back-up using SafeStrap.
TBBle said:
It's a known issue. If you're feeling brave, you can try my modified (and slightly older, now) version of SafeStrap that'll nandroid backup my ME863, and will probably nandroid backup your XT883 as well.
http://forum.xda-developers.com/showpost.php?p=20976390&postcount=294
Click to expand...
Click to collapse
So, I was trying to swap out my 2nd-init.zip recovery file with the one from the thread you posted. I'm trying to use file browsers to move the altered 2nd-init.zip file into /etc/safestrap and it won't work no matter the app I use. Is there a particular app/method I should be using here for this last step?
Thanks. Forgive the noob.
Originally Posted by TBBle
It's a known issue. If you're feeling brave, you can try my modified (and slightly older, now) version of SafeStrap that'll nandroid backup my ME863, and will probably nandroid backup your XT883 as well.
http://forum.xda-developers.com/showpost.php?p=20976390&postcount=294
Click to expand...
Click to collapse
So, I was trying to swap out my 2nd-init.zip recovery file with the one from the thread you posted. I'm trying to use file browsers to move the altered 2nd-init.zip file into /etc/safestrap and it won't work no matter the app I use. Is there a particular app/method I should be using here for this last step?
Thanks. Forgive the noob.
Click to expand...
Click to collapse
you need to place the recovery file into the original 2nd-init.zip. backup the original file and check the permissions of the new file. you need to do this after succesful installation of the recovery of course
Sent from my XT883 using XDA App
eis0r said:
you need to place the recovery file into the original 2nd-init.zip. backup the original file and check the permissions of the new file. you need to do this after succesful installation of the recovery of course
Sent from my XT883 using XDA App
Click to expand...
Click to collapse
I copied the 2nd-init.zip to my computer and unzipped it just fine. I put the tweaked recovery file in the folder and rezipped it. I just can't get it back into the /etc/Safestrap folder because root browser says it failed. I checked permissions on every folder in the path (including /system) and user has write permissions on each one, so I don't see how that could be a problem. I'm not allowed, for some reason, to make any changes to /etc/Safestrap except I can extract the 2nd-init.zip to my SD card, which is how I got the copy I tweaked and am now trying to replace back on the device.
If anyone can tell me what they did to put the tweaked 2nd-init.zip back into /etc/Safestrap, that would be helpful.
Thanks.
Sent while mobile using Tapatalk.
try renaming the original 2nd-init.zip to 2nd-init.org. then copy the modified 2nd-init.zip from your sdcard to etc/safestrap
Sent from my XT883 using XDA App
eis0r said:
try renaming the original 2nd-init.zip to 2nd-init.org. then copy the modified 2nd-init.zip from your sdcard to etc/safestrap
Sent from my XT883 using XDA App
Click to expand...
Click to collapse
Well, just tried it using Root Browser and Script Manager, both of which I find to be very capable file browsers, and it didn't work. It's just not letting me make any changes to the folder /etc/Safestrap. It allowed me to extract the 2nd-init.zip out of that folder, but won't allow me to zip or unzip anything into it. I'll keep playing with it and update if anything changes.
Otherwise, I'll just wait till I no longer need the xt883 radio.img to back up and flash ROMs.
Sent while mobile using Tapatalk.
BenSWoodruff said:
Well, just tried it using Root Browser and Script Manager, both of which I find to be very capable file browsers, and it didn't work. It's just not letting me make any changes to the folder /etc/Safestrap. It allowed me to extract the 2nd-init.zip out of that folder, but won't allow me to zip or unzip anything into it. I'll keep playing with it and update if anything changes.
Otherwise, I'll just wait till I no longer need the xt883 radio.img to back up and flash ROMs.
Sent while mobile using Tapatalk.
Click to expand...
Click to collapse
/etc is a symlink to /system/etc which is read only. In a terminal emulator run the command:
busybox mount -o remount,rw /system
Then try moving the files to /etc /safestrap
Sent from my XT860 using xda premium
Endoroid said:
/etc is a symlink to /system/etc which is read only. In a terminal emulator run the command:
busybox mount -o remount,rw /system
Then try moving the files to /etc /safestrap
Sent from my XT860 using xda premium
Click to expand...
Click to collapse
Sweet, thanks, I'll try it right now! Will I need to change it back when I'm done? Hopefully, this will get me a nice shiny back up finally
Sent while mobile using Tapatalk.
Ok, so I got Root Browser to move the original 2nd-init.zip to my sd card and placed the tweaked one in /system/etc/Safestrap successfully, but then Safestrap wouldn't get past the splash screen. I swapped back to the original one and it still wouldn't boot into recovery. Just the splash screen with option to start system or press menu button to go into recovery. I pressed menu and the screen stayed black both times.
Oh well, I'm not in a hurry to flash ROMs or get a backup, so I uninstalled Safestrap for now and will try again when I no longer need the xt883 radio.img.
Sent while mobile using Tapatalk.
BenSWoodruff said:
Ok, so I got Root Browser to move the original 2nd-init.zip to my sd card and placed the tweaked one in /system/etc/Safestrap successfully, but then Safestrap wouldn't get past the splash screen. I swapped back to the original one and it still wouldn't boot into recovery. Just the splash screen with option to start system or press menu button to go into recovery. I pressed menu and the screen stayed black both times.
Oh well, I'm not in a hurry to flash ROMs or get a backup, so I uninstalled Safestrap for now and will try again when I no longer need the xt883 radio.img.
Sent while mobile using Tapatalk.
Click to expand...
Click to collapse
You don't NEED to change it back, it will automatically on next boot, if you felt the need run the same command but switch rw to ro.
As for your problem with safestrap I can't help you with that
Sent from my XT860 using xda premium
It's all good, thanks for the help. I can wait
Sent while mobile using Tapatalk.

[WEBTOP][Bell][Mod] SimpleTop 07/05/2012

Here is what I have done for my personal webtop so far.
Download
To install:
Make a partition on a SDCard, formatted ext3, so that the first partition is FAT, second partition is EXT3.(2GB should be fine, YEMV)
Extract contents of osh2.tar.bz2 to this ext3 partition.
Make a backup of /osh/ubuntu.sh
Overwrite /osh/ubuntu.sh with the one on the root of the SDCard's EXT3 partition.
Backup your /data/home/adas folder.
Remove /data/home/adas, leaving just /data/home.
Reboot the phone.
You will need Linux to extract the tar properly and create the SDCard partitions.
You do not need to be unlocked or have a different kernel, you just need to replace ubuntu.sh, so rooted, temp root, whatever. I created everything from a stock Bell phone. Android 2.3.6. If anything doesn't work, just replace ubuntu.sh with the original file or just remove your sdcard.
Cheers!
edit: changed link
what has been modified:
fuse based smbnetfs installed, stock kernel can access windows shares and play video using motorola hd media center.
open office installed, gimp, some games
lxde set up, theme preconfigured.
No need for dependencies to be fixed or webtop to sd apps run, has zero errors and sudo apt-get dist-upgrade has completed without errors several times so adding extra sources and doing dist-upgrade won't cause errors.
Replaced firefox 7 with 8, rest is Bell webtop.
Been installing and playing with it for a while now, can't recall all the mods.
Yes, you can put the tarball on the phone and extract it to the sdcard that way, you just need to mount the partition. I keep a copy in internal memory to be able to restore when I install/uninstall something I shouldn't.
EDIT:
If you use xarchiver from another webtop to untar the archive, you may need more than 2GB.
Can you put the .tar file on the phone and extract there? I ask because I only have access to Windows machines. Creating the partitions on the sdcard is easy with MiniTool Partition on Windows.
I am can't downloading this file, webserver says: "This file is no longer available."
How has this webtop been modified?
Ramble via webtop:
My approach is to avoid established scripts for fixing dependencies and apps for moving webtop to sd card. Not that I have anything against those, but they were developed using ATT phones and might miss some compatibility with Bell.
One key difference for getting going from scratch is that I installed a standard armel busybox from the busybox site, that avoided a lot of errors when installing debs. Not sure where the busybox comes from in apps2sd but it is not as up to date and results in more errors with missing command line options.
I also didn't want to change/replace the contents of the phone too much so I could easily revert to stock, there is this ICS rumour..
This is what I did:
Starting off I updated the sources.list to be jaunty and just worked through the errors by installing debs manually. lxterminal was installed via deb and tomoyo was disabled by renaming the init and start files. Basically, I did a force install via deb file of some rootfs package contents, coreutils, cpio, dbus, dhcp, gpgv, grep, udev. All references to -mot versions were stripped of the -mot suffix so they could be more easily upgraded. I left the references to ~mot and -motorola in the versions of packages, not sure why, just did. Eventually I got to a place where synaptic was installed and I had no errors. Saved the state in a tarball and kept experimenting with installing things.
I really wanted a home folder elsewhere than /data/home but there are too many hard references to it in webtop for stability, I found a lot in scripts but I suspect they are in binaries as well. You can rbind once in webtop but you need it to have stuff in there during boot, not mix and match configs.
I tried an external hard drive, but there is a fundamental flaw in that logic, they only turn on once you open the lid of the lapdock, so you can't have boot files on it.
I copied the firefox-8.0 from ATT, deleted firefox-7, updated the soft links to point to the 8 version, redid profile.zip to have xda be the home page and adblock installed already, tossed in .xdg-bookmarks to add Network to pcmanfm. I originally had all the home folder stuff in profile.zip but some part of the scripts mess with settings and not everything was carrying over.
So, I did a tarball of my home dir's dot files and put it in /osh2/home/adas so when I do a factory reset and adas is wiped it restores my config. Tip: removing the entire adas folder gives you the same effect for webtop as a factory reset. Reboot and you are back to where you were.
I tried all the window managers, avant/awn anything is annoying when it shifts items left and right when an app opened or closed. I was able to have the stock awn working with a cairo menu, but it still shifted things left and right and was slow. I tried recompiling awn on the phone to get the option to just have launchers but there is this tendency for anything new you compile to require a new libc6. Xfce is cool, menu looked odd though, went with lxde, easy enough to switch if you want. Note: Compiz anything is a waste of time.
I have removed the stock webtop theme and replaced it with clearlooks and murrine window decoration. lxpanel is transparent via manual hack of the config file, the gui for changing things always sets alpha to 0, bug into the prefs app.
I could go on and on, but I like what I have done so far, thought I would pass it along. The main bit for me is not having to install a new kernel or wipe existing partitions, make a lot of phone mods, a pure stock phone can have a custom webtop, just needs to be rooted to copy one file over. Also, I like being able to watch tv shows on my lapdock, worth the price of admission right there for me.
Oh, size is around 1.4GB untarred, so it's a least a 2GB ext3 partition. I have an option in there for using mmcblk1p3 for var if you want to copy var over there formatted with smaller clusters. There are a few flags to control things, if you didn't want to remove your sdcard, touch /osh/no_osh2 and reboot the phone to disable. /osh/var_ownp enables the mounting and use of a third partition on the sdcard dedicated to /var. Use that one carefully, commit to it before installing a lot of things, having a mix and match could break the custom webtop.
Cheers!
Thanks for putting this up, I'd like to give it a try but am having difficulties, possibly cause i'm running Nochatrix (ATT 2.3.6).
When you say 'extract properly' to the EXT3 partition, what command would you use? Should extracting first then copying over work? Because I tried that, and it didn't!
Cheers
It has to be linux, either on the phone or on a pc so that tar -xvf will keep the ownership and file permissions.
VMware Player
CaelanT said:
Can you put the .tar file on the phone and extract there? I ask because I only have access to Windows machines. Creating the partitions on the sdcard is easy with MiniTool Partition on Windows.
Click to expand...
Click to collapse
Download VMware Player and the free copy of linux.. now you can run Linux.. :highfive:
https://my.vmware.com/web/vmware/evalcenter?p=player
NFHimself said:
... so that tar -xvf will keep the ownership and file permissions.
Click to expand...
Click to collapse
That's it, thanks. I was over-complicating things, putting in unnecessary arguments and trying to copy it over using -C. In the end I just copied the tar to the EXT3 and just unpacked it there.
Anyways, it works great! Everything ive quickly tried works nicely, openoffice, synaptic, Gnometris , etc, it's clean and quick, just what I was after.
can make a .zip CWM flashable file???
---------- Post added at 08:37 PM ---------- Previous post was at 08:37 PM ----------
jpinoy said:
Download VMware Player and the free copy of linux.. now you can run Linux.. :highfive:
https://my.vmware.com/web/vmware/evalcenter?p=player
Click to expand...
Click to collapse
where can i find Linux OS??
It work on stock 2.3.4?
It work on stock 2.3.4?
Click to expand...
Click to collapse
I haven't tested it, the webtop is from Bell's 2.3.6, probably not a large difference, but can't say for sure.
Can you make a CWM zip?
Click to expand...
Click to collapse
Yes, I can.
Cheers!
Chimpdaddy;[URL="tel:28700385" said:
28700385[/URL]]That's it, thanks. I was over-complicating things, putting in unnecessary arguments and trying to copy it over using -C. In the end I just copied the tar to the EXT3 and just unpacked it there.
Anyways, it works great! Everything ive quickly tried works nicely, openoffice, synaptic, Gnometris , etc, it's clean and quick, just what I was after.
Click to expand...
Click to collapse
Glad you like it!
Cheers!
I'd love to give this one a try. I'm using Webtop2SD right now. Can someone give a more detailed step-by-step instruction please?
Chimpdaddy;[URL="tel:28700385" said:
28700385[/URL]]That's it, thanks. I was over-complicating things, putting in unnecessary arguments and trying to copy it over using -C. In the end I just copied the tar to the EXT3 and just unpacked it there.
Anyways, it works great! Everything ive quickly tried works nicely, openoffice, synaptic, Gnometris , etc, it's clean and quick, just what I was after.
Click to expand...
Click to collapse
qaplus;[URL="tel:28824484" said:
28824484[/URL]]I'd love to give this one a try. I'm using Webtop2SD right now. Can someone give a more detailed step-by-step instruction please?
Click to expand...
Click to collapse
This does not use webtop2sd, so you would need to uninstall that first as it would likely cause problems.
Not sure how detailed you need instructions.
Cheers!
NFHimself said:
I haven't tested it, the webtop is from Bell's 2.3.6, probably not a large difference, but can't say for sure.
Yes, I can.
Cheers!
Click to expand...
Click to collapse
Thanks, but not seeing any zip on OP .....
I have limited experience with linux. What I got:
1. AT&T Atrix on 2.4.6.
2. Webtop2SD created ext3 partition on SD card.
What I plan to do:
1. Wipe ext3 partiion and copy the SimpleTop tar file to it
2. Log into Webtop ( boot from the Webtop partition from the internal sd card)
3. backup .sh and adas folder
4. untar simpletop in the ext3 partition
5. copy the new .sh file.
Will these steps work? I feel it's bit dangerous to do this on the phone. But how can I do this on a windows computer?
Thanks for any suggestions.
qaplus said:
I have limited experience with linux. What I got:
1. AT&T Atrix on 2.4.6.
2. Webtop2SD created ext3 partition on SD card.
What I plan to do:
1. Wipe ext3 partiion and copy the SimpleTop tar file to it
2. Log into Webtop ( boot from the Webtop partition from the internal sd card)
3. backup .sh and adas folder
4. untar simpletop in the ext3 partition
5. copy the new .sh file.
Will these steps work? I feel it's bit dangerous to do this on the phone. But how can I do this on a windows computer?
Thanks for any suggestions.
Click to expand...
Click to collapse
That is pretty much it. Just remember to be super user and include -p if using tar for backup. Tar -cvpjf /sdcard/ADAS.tar.bz2 . for example. Also, you don't want to be in webtop2sd mode if you are doing this but from a rooted webtop on the the phone itself. Or you could do it all from an adb shell.
Cheers!
Sent from my MB860 using xda premium
NFHimself said:
That is pretty much it. Just remember to be super user and include -p if using tar for backup. Tar -cvpjf /sdcard/ADAS.tar.bz2 . for example. Also, you don't want to be in webtop2sd mode if you are doing this but from a rooted webtop on the the phone itself. Or you could do it all from an adb shell.
Cheers!
Sent from my MB860 using xda premium
Click to expand...
Click to collapse
I haven't used adb before. Can you list the commands in adb to install this? Thanks.
qaplus said:
I haven't used adb before. Can you list the commands in adb to install this? Thanks.
Click to expand...
Click to collapse
ADB is just a way to get a remote shell going over usb, so the commands are linux shell commands.
I would do something like this:
(Blank ext3 partition on sdcard, second partition)
adb shell
$ shsu
# mkdir /mnt/asec/osh2
# mount -t ext3 /dev/block/mmcblk1p2 /mnt/asec/osh2
# cd /mnt/asec/osh2
# tar -xvf /sdcard/osh2.tar.bz2
# cp /osh/ubuntu.sh /sdcard/
# cp ubuntu.sh /osh/
# cd /data/home
# tar -cvpjf /sdcard/adas.tar.bz2 .
# rm -r /adas
# sync
# umount /mnt/asec/osh2
# reboot
Cheers!

[HowTo] [for cooks] preload partition / how and why you should use it!

Hi folks,
an other very short tutorial for the people (cooks), who do not know how to use the preload (hidden) partition and symlink system apps to it.
Some basics on preload-partition and why you should use it:
We have the so called 'hidden/preload partition' (mmcblk0p12) on our device. Besides the system partition with around 840 mb space, this hidden partition has additional 500 mb...this 500 mb were thought from sammy in the beginning mainly for their own crap like gamehub apps or learning hub and so on. But as system partition is on the edge right now with jelly bean they also use it for placing system apps inside --> the reason is that 840 mb in system is far to less for all files!
Usually most cooks just transfered system apps to data partition (located on your usb storage) to get out of this mess. This method with using hidden partition just gives great opportunity to keep your system partition smaller and you can transfer apps to it which you can not move to data! Your device will probably also perform faster with less space used inside system-partition. Our kernel dev Phil also made it possible now to backup/restore preload-partition within nandroid on his newer CWM-recoveries --> so now you can do a full backup/restore including this preload-partition....before it was not possible!
How to symlink system-apps to preload-partition:
just take the app 'Notepad++' (google for it) on your PC/Laptop, open it, create a new file and put the following inside ('nameofapp.apk' is just an example for any app you wanna symlink):
Link: /preload/symlink/system/app/nameofapp.apk
Click to expand...
Click to collapse
save and close as 'nameofapp.apk' --> this is the one to put inside /system/app to symlink to the original one you put inside /preload/symlink/system/app.
Now do this steps with every system app you wanna symlink...
This is the manual way to this, though I know scripts can be used to do these steps automatically... But this way you at least get a basic understanding how it works!
I won't tell you how to push apps to preload-partition inside CWM-flashable ROM in general, cause this is basic knowledge when you wanna cook a ROM - but you could download any ROM already using this method and look inside 'META-INF\com\google\android\updater-script' and you will know how to do this.
Thanks for the guide mate. I'm sure this will help a lot of us out
In dsixda's Kitchen the symlinks are automatically generated with a few lines of code in updater-script.
I'll will try to extract them when continuing to work with my Rom/Tutorial, so non-kitchen-builders can user it in their updater-scripts.
Have to say: it's very nice that you share your knowledge and experience with us, eybee. Thanks for that.
Thanks for the knowledge.
You're the man..
Sent from my GT-N7000 using Tapatalk 2
Hey eybee. Nice guide.
One question. I'm using dsixda kitchen to build a rom but the zipaligning falls over when it reaches the nameofapk.apk text file. Anyway round this?
Sent from my GT-N7000 using xda premium
maskerwsk said:
Hey eybee. Nice guide.
One question. I'm using dsixda kitchen to build a rom but the zipaligning falls over when it reaches the nameofapk.apk text file. Anyway round this?
Sent from my GT-N7000 using xda premium
Click to expand...
Click to collapse
What do you mean by "nameofapk.apk"?
Maps.apk? (Then I know what you mean).
eybee won't give explanations for that because he doesn't use the kitchen.
ThaiDai said:
What do you mean by "nameofapk.apk"?
Maps.apk? (Then I know what you mean).
eybee won't give explanations for that because he doesn't use the kitchen.
Click to expand...
Click to collapse
yeah for example i moved MusicPlayer.apk to preload and created notepad++ file for MusicPlayer.apk which i put in system/app.
but when zipaligning apks in kitchen, when it reached the system/app/MusicPlayer.apk it fails
maskerwsk said:
yeah for example i moved MusicPlayer.apk to preload and created notepad++ file for MusicPlayer.apk which i put in system/app.
but when zipaligning apks in kitchen, when it reached the system/app/MusicPlayer.apk it fails
Click to expand...
Click to collapse
of course i fails...you can not zipalign a symlink
just zipalign before, when all apps are still in /system/app and move to /preload afterwards
eybee1970 said:
of course i fails...you can not zipalign a symlink
just zipalign before, when all apps are still in /system/app and move to /preload afterwards
Click to expand...
Click to collapse
The problem is explained in the kitchen itself. You get a warning to move all apps first before de-odexing.
But I didn't get any mistake like this when zipaligning - I think the related script checks if there are symlinks. I move the apps before the de-odexing step in the Advanced options but not when zipaligning. So maybe he has some other problems.
ThaiDai said:
The problem is explained in the kitchen itself. You get a warning to move all apps first before de-odexing.
But I didn't get any mistake like this when zipaligning - I think the related script checks if there are symlinks. I move the apps before the de-odexing step in the Advanced options but not when zipaligning. So maybe he has some other problems.
Click to expand...
Click to collapse
As explained: he is trying to zopalign the symlink in /system/app which of course fails (it is just a link named .apk!)...the original app he already moved to preload
eybee1970 said:
of course i fails...you can not zipalign a symlink
just zipalign before, when all apps are still in /system/app and move to /preload afterwards
Click to expand...
Click to collapse
Awesome. Thats what I was after
Sent from my GT-N7000 using xda premium
This is excellent! We can now take control of an extra 500mb that Samsung thought we would never have access to
Sent from my GT-N7000 using xda app-developers app
shoey63 said:
This is excellent! We can now take control of an extra 500mb that Samsung thought we would never have access to
Sent from my GT-N7000 using xda app-developers app
Click to expand...
Click to collapse
this partition is well known since Galaxy S2 (paulobrien was talking about it back in Aug 2011)....but was not really needed til now
eybee1970 said:
As explained: he is trying to zopalign the symlink in /system/app which of course fails (it is just a link named .apk!)...the original app he already moved to preload
Click to expand...
Click to collapse
Using a simple more powerfull line in update script
Code:
symlink("/preload/symlink/system/app", "/system/app");
this symlinks the whole folder to system/app so all that is in preload is also visible and active in a linked system/app folder.
This removes the whole functionality of the /system/app folder though but you have a very fast and clean system saves a lot of typing/ copypasting though
Robbie Hood said:
Using a simple more powerfull line in update script
Code:
symlink("/preload/symlink/system/app", "/system/app");
this symlinks the whole folder to system/app so all that is in preload is also visible and active in a linked system/app folder.
This removes the whole functionality of the /system/app folder though but you have a very fast and clean system
Click to expand...
Click to collapse
yes, I saw in your script already
eybee1970 said:
yes, I saw in your script already
Click to expand...
Click to collapse
Always finding ways to improve :highfive:
So there is NO /system/app folder in my rom
@RobbieHood. How would you do in user space? Using linux commands in terminal for example?
Sent from my GT-N7000 using xda app-developers app
Robbie Hood said:
Always finding ways to improve :highfive:
So there is NO /system/app folder in my rom
Click to expand...
Click to collapse
for all: but there will be one after installation, but just containing symlinks...
eybee1970 said:
for all: but there will be one after installation, but just containing symlinks...
Click to expand...
Click to collapse
well not exactly
The folder is linked so when you open it via /system/app or any browser you are virtually in /preload/symlink/system/app with the real apks
its somewhat the same principle as the sdcard on galaxy s3 which is linked to /data/media and does not have its own partition
Robbie Hood said:
well not exactly
The folder is linked so when you open it via /system/app or any browser you are virtually in /preload/symlink/system/app with the real apks
its somewhat the same principle as the sdcard on galaxy s3 which is linked to /data/media and does not have its own partition
Click to expand...
Click to collapse
Ok...this is the correct way to say it
Just did not want anybody coming in here then and say "hey, when i open with Root Explorer i still can see /system/app and all apps inside..."

File structure help (0 folder)

Looking for a definitive answer here, as I have searched and read and I still have yet to find an answer so please don't tell me to go search or read such and such thread. Thanks.
So I have gone from 4.1 to 4.3 and back and forth several times and my question is how to handle the file structure change. I understand that a new emulated file structure is located at data/media/0 but should I copy my old data there? Is there anyway to prevent the multiple user file structure? I tried pushing a layout_version file and changing permissions but when I flashed a 4.3 Rom it still created a 0 folder.
Sent from my HTCONE using Tapatalk
Konfuzion said:
Looking for a definitive answer here, as I have searched and read and I still have yet to find an answer so please don't tell me to go search or read such and such thread. Thanks.
So I have gone from 4.1 to 4.3 and back and forth several times and my question is how to handle the file structure change. I understand that a new emulated file structure is located at data/media/0 but should I copy my old data there? Is there anyway to prevent the multiple user file structure? I tried pushing a layout_version file and changing permissions but when I flashed a 4.3 Rom it still created a 0 folder.
Sent from my HTCONE using Tapatalk
Click to expand...
Click to collapse
The actual location when viewed with a root file manager has been here on 4.1.2:
/data/media
Once you flash a 4.3 ROM, the actual location gets changed (and all the files moved) to here:
/data/media/0
The problems arise if the version of your custom recovery is not compatible with a 4.3 ROM. If it is not and you keep flashing 4.3 ROMs you might soon end up in trouble. If, while using the 'older' custom recovery, you continue flashing, your sdcard ends up somewhere around here:
/data/media/0/0/0/0/0/0 (etc.)
with all your files copied to every '0' directory and your symlinks end up the same way, and your device quickly runs out of space
Using a file manager that will show hidden files and folders, copy/move the files in the last '0' directory to:
/data/media/0
Now you can delete all the "extra 0" except for /data/media/0
Reboot
Profit?
Sent from my HTCONE using Tapatalk
elvisypi said:
The actual location when viewed with a root file manager has been here on 4.1.2:
/data/media
Once you flash a 4.3 ROM, the actual location gets changed (and all the files moved) to here:
/data/media/0
The problems arise if the version of your custom recovery is not compatible with a 4.3 ROM. If it is not and you keep flashing 4.3 ROMs you might soon end up in trouble. If, while using the 'older' custom recovery, you continue flashing, your sdcard ends up somewhere around here:
/data/media/0/0/0/0/0/0 (etc.)
with all your files copied to every '0' directory and your symlinks end up the same way, and your device quickly runs out of space
Using a file manager that will show hidden files and folders, copy/move the files in the last '0' directory to:
/data/media/0
Now you can delete all the "extra 0" except for /data/media/0
Reboot
Profit?
Sent from my HTCONE using Tapatalk
Click to expand...
Click to collapse
Thank you, I understand all that. What I don't get is should I copy all over my old data (backups and so on) into the /data/media/0 folder?
Sent from my HTCONE using Tapatalk
Konfuzion said:
Thank you, I understand all that. What I don't get is should I copy all over my old data (backups and so on) into the /data/media/0 folder?
Sent from my HTCONE using Tapatalk
Click to expand...
Click to collapse
Yes that's what I said
Sent from my HTCONE using Tapatalk
Konfuzion said:
Thank you, I understand all that. What I don't get is should I copy all over my old data (backups and so on) into the /data/media/0 folder?
Sent from my HTCONE using Tapatalk
Click to expand...
Click to collapse
I personally only do it on an as-needed basis, but it really depends on your usage. Before switching b/t 4.1 and 4.3+ ROMs, I make sure to copy/paste my SMS backup and/or MyBackup (rerware) backups to the appropriate file structure I am moving to. The apps themselves will only look in their current file structure when you try to restore. Of course in order to copy/paste the backups, you have to allow root access in ES File Explorer or whatever you use. TWRP backups can stay in the /0 structure just fine, as it will always look there in recovery.
Music and pics can be a challenge since they take up a lot of space, and replicating them in two different file structures will eat up a lot of storage. I don't store a lot of media on my phone, though, so I'm not sure the best way to address that. It's easy enough to find pics through file explorer, but I'm sure music playing apps only look in one folder or structure by default.
For most other apps, they will store their settings in each structure without taking up too much space, so it's fine to leave them as-is. Whenever you restore a Nandroid it's going to overwrite them again anyway.
Not sure if I have helped, but just sharing my experience.

Categories

Resources