[KERNEL] [2 GB DATA] [ICS] [TWRP] [SD-EXT] Hefe Hook Kernel [2013/12/23] - Samsung Galaxy S (4G Model)

First off, this is an ICS kernel that is intended for use with ICS ROMs. If you aren't using a ROM that is substantially similar to TeamAcid's CM9, then you may want to reconsider before you flash this.
This kernel is the same as the current TeamAcid CM9 kernel. Now that @FBis251 poked me about it, there is a version that also includes the "Hefe Kernel of Darkness" patch to turn off the touch-key backlight after it is touched.
If it's not all that different from the TeamAcid kernel, why would I want to flash this?
It's got TWRP
You can reliably mount /sd-ext or...
...move /data to your microSD, never worry about running out of app & data space, and speed your boot time
It allows you to get to the file system early in the boot process, to be able to change things that ordinarily you couldn't without creating a custom initramfs. This lets you, for example, create /sd-ext and mount something there, or get even wilder and do something completely untested like replacing /data entirely
TWRP can backup and restore /sd-ext
You hate the touch-key backlight
You want to be able to load the FUSE kernel module
How does it work?
When the SGS4G boots, it has a filesystem in the compressed boot/recovery image. It mounts that as the root file system, starts things running, and then all but that root filesystem sort of disappears as Android starts taking over. What happens and what is in that root file system is pretty much locked down unless you're going to create your own boot images. You can't edit a file on your running system and change that behavior. So....
The boot scripts in this build look for /system/etc/init-on-fs.sh right after /system gets mounted, but before much else happens. If it is executable, it will run the script. This means that you can make most of the changes to the environment or process you might reasonably want!
The "interesting" section of init.herring.rc is shown in the hidden text
Code:
on fs
exec /system/bin/logwrapper /system/xbin/echo "init.herring.rc: on fs enter"
# We chown/chmod /efs because mount is run as root + defaults
mkdir /efs 0775 radio radio
chown radio radio /efs
# Mount /system rw first to give the filesystem a chance to save a checkpoint
mkdir /radio 0775 radio radio
mount yaffs2 [email protected] /radio
chmod 0775 /radio
chmod 0775 /radio/modem.bin
chown radio radio /radio
chown radio radio /radio/modem.bin
mount yaffs2 [email protected] /efs
mount yaffs2 [email protected] /system
mount yaffs2 [email protected] /data
mount yaffs2 [email protected] /cache
exec /system/bin/logwrapper /system/etc/init-on-fs.sh
chmod 770 /efs/bluetooth
chmod 770 /efs/imei
mkdir /gps 771 gps system
chown gps system /gps
[...]
My init-on-fs.sh
Lists the mounts already in place (from the "stock" init commands)
Creates /sd-ext
Mounts the second partition of the microSD on /sd-ext
Lists the mounts, which should now include /sd-ext
and looks like this:
Code:
#!/system/bin/sh
/system/xbin/busybox mount
/system/xbin/busybox mkdir /sd-ext
/system/xbin/busybox mount -t ext4 /dev/block/mmcblk0p2 /sd-ext
/system/xbin/busybox mount
Since it's running under logwrapper the output goes to the logs and can be seen with logcat or the like.
Since this script runs before any "working" directories get set up and before any processes start running, if you're adventurous, you could even change the mounting of /data and just use microSD storage. I haven't gotten that adventurous yet, as TitaniumBackup seems to be very reliable in moving app data to the microSD partition.
Do I need to repartition my microSD and use /sd-ext?
Nope, you can just enjoy TWRP if you want.
How do I install it?
Download the current version from the next post. Push to your device and flash with your recovery.
init-on-fs.sh does not have an installer and is not distributed. Create it in /system/etc and make sure it's executable.
I have a question...
Check the FAQ right after the Downloads.
If you still have questions, especially if they are about how to use the Hefe Hook or how to configure your phone for 2 GB of /data, please use the Q&A thread.
.

Downloads
kernel-hefehook-kod-2013-12-23-111936.zip
Changes:
Properly incorporates "Hefe Kernel of Darkness" changes
Otherwise the same as kernel-hefehook-2013-12-18-084851.zip
2.6.35.7-Hefe-Hook-KoD-ICS-00184-g807d04b #1 PREEMPT Mon Dec 23 11:17:49 PST 2013
kernel-hefehook-kod-2013-12-19-171937.zip
Note: long-press of the touchpad doesn't work in this version. Please use a later version
Changes:
Incorporates "Hefe Kernel of Darkness" changes
Otherwise the same as kernel-hefehook-2013-12-18-084851.zip
As before, this is a hack to turn off the touchpad backlight as soon as it comes on.
2.6.35.7-Hefe-Hook-KoD-ICS-00176-gb430787 #1 PREEMPT Thu Dec 19 17:19:10 PST 2013
kernel-hefehook-2013-12-18-084851.zip
Changes:
TWRP fstab adjusted to be able to manage and backup mmc0p3 (potentially as /data)
fuse.ko available (~680 kB so not built into kernel)
2.6.35.7-Hefe-Hook-ICS-00171-g79fe663 #1 PREEMPT Wed Dec 18 08:47:03 PST 2013
Kernel code equivalent to 674765731f093fdb5f4a2416b03cf2c6c2c98e67 in TeamAcid's repository
with FUSE enabled as a module in the kernel build
Code:
diff --git a/arch/arm/configs/cyanogen_galaxys4gmtd_defconfig b/arch/arm/configs/cyanogen_galaxys4gmtd_defconfig
index 22303ee..5e44f0b 100644
--- a/arch/arm/configs/cyanogen_galaxys4gmtd_defconfig
+++ b/arch/arm/configs/cyanogen_galaxys4gmtd_defconfig
@@ -1,7 +1,7 @@
#
# Automatically generated make config: don't edit
# Linux kernel version: 2.6.35.7
-# Sun Aug 12 20:38:04 2012
+# Wed Dec 18 07:54:02 2013
#
CONFIG_ARM=y
CONFIG_HAVE_PWM=y
@@ -38,7 +38,7 @@ CONFIG_BROKEN_ON_SMP=y
CONFIG_LOCK_KERNEL=y
CONFIG_INIT_ENV_ARG_LIMIT=32
CONFIG_CROSS_COMPILE=""
-CONFIG_LOCALVERSION="-cyanogenmod-ICS"
+CONFIG_LOCALVERSION="-Hefe-Hook-ICS"
CONFIG_LOCALVERSION_AUTO=y
CONFIG_HAVE_KERNEL_GZIP=y
CONFIG_HAVE_KERNEL_LZMA=y
@@ -1900,7 +1900,8 @@ CONFIG_INOTIFY_USER=y
# CONFIG_QUOTA is not set
# CONFIG_AUTOFS_FS is not set
# CONFIG_AUTOFS4_FS is not set
-# CONFIG_FUSE_FS is not set
+CONFIG_FUSE_FS=m
+# CONFIG_CUSE is not set
CONFIG_GENERIC_ACL=y
#
kernel-hefehook-2013-12-12-231320.zip
Changes:
Initial public release
2.6.35.7-Hefe-Hook-ICS-00170-g6a2c60a [email protected]#1 Thu Dec 12 23:11:25 PST 2013
Kernel code equivalent to 674765731f093fdb5f4a2416b03cf2c6c2c98e67 in TeamAcid's repository
MD5 (kernel-hefehook-2013-12-12-231320.zip) = 0bb3950af5a09e1e0364a467c79fceb0
MD5 (kernel-hefehook-2013-12-18-084851.zip) = 38e76dc0d5dc5ae795b3d2ec57183d92
MD5 (kernel-hefehook-kod-2013-12-19-171937.zip) = 06f4ca9535d1baa88b8cc70984dbc661
MD5 (kernel-hefehook-kod-2013-12-23-111936.zip) = 9b638c335ecbcfdd998658b9d6346e63

FAQ
Why doesn't long-press-Home work? ("Darkness" version only)
Because I derped in the merge. I'm checking a version now and should have it up before Christmas.
Do I need to partition my microSD? Do I need to use /sd-ext?
Only if you want to use /sd-ext. You can enjoy TWRP without partitioning your microSD or using a boot-time script.
Will this work without init-on-fs.sh?
Yes
Will you give me instructions on how to replace /data completely with my microSD?
No, I haven't tried it yet myself
No, I need to make sure you can back it up and restore it under recovery
Yes, though first let me get rsync posted and some clear instructions worked out.
How do I format my microSD?
For my init-on-fs.sh script to work, you need your microSD formatted with the "old style" MBR partitioning scheme. My script looks for an ext4 partition as the second partition.
I do all my partitioning on Ubuntu or FreeBSD. You can boot Ubuntu on your Windows machine without overwriting anything ("Try Ubuntu"). I don't trust any Windows program to create a reliable Linux file system.
How do I ask about something else?
Please use the Q&A Thread.

Building
Build using the CM9 "ics" branch using the generally available instructions
Kernel source is on github. Hefe-Hook and Hefe-Hook-KoD are the two branches of interest. Both should be clearly tagged at each release.
galaxys4gmtd.xml:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<manifest>
<remove-project name="CyanogenMod/android_vendor_cm" />
<project path="vendor/cm" name="teamacid/android_vendor_cm" revision="ics" />
<project path="packages/apps/SamsungServiceMode" name="CyanogenMod/android_packages_apps_SamsungServiceMode" revision="ics" />
<project path="packages/apps/CMFileManager" name="teamacid/android_packages_apps_CMFileManager" revision="ics" />
<project path="device/samsung/galaxys4gmtd" name="teamacid/android_device_samsung_galaxys4gmtd" revision="ics" />
<project path="vendor/samsung" name="teamacid/proprietary_vendor_samsung" revision="ics" />
<project path="kernel/samsung/galaxys4gmtd" name="jeffsf/android_kernel_galaxys4gmtd" revision="Hefe-Hook-KoD" />
</manifest>
<!--
teamacid's CM9 local_manifest.xml
=================================
vi: ts=4:sw=4:et:noai
-->
twrp.xml:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<manifest>
<remove-project name="CyanogenMod/android_bootable_recovery" />
<project path="bootable/recovery" name="TeamWin/Team-Win-Recovery-Project" revision="twrp2.5" />
</manifest>
<!--
teamacid's TWRP local_manifest.xml
======================================
vi: ts=4:sw=4:et:noai
-->
TWRP is from the "twrp2.5" branch with the following commits reverted in git
35a35a67663127e42c8048ca0dc7465068a5606f
516e4e23721e4e5aa0a349ab8f27c22a81665880
Note that the "twrp2.5" branch is, at this time, pointing to the same commit as the "ics" branch.
The "twrp2.7" branch is heavily laden with selinux code for later Android releases and appears to have left ICS in the dust.
Changes to to the initramfs are self-documenting and visible in the distributed code.

Ooooo.... look! FIRST!

"My /data's bigger than your /data. Nah nah ne nah nah..."
Code:
localhost / # df -h /data
df -h /data
Filesystem Size Used Available Use% Mounted on
/dev/block/mmcblk0p3 5.6G 2.0G 3.4G 37% /data
localhost / # du -h /mnt/secure/asec
du -h /mnt/secure/asec
16.0K /mnt/secure/asec
It also boots in a minute, with all apps present and ready. No more three or four minutes until everything was read, mounted, and all off SD for all the "external storage" apps.
I'll probably remount the MTD partition as /data/dalvik-cache since my earlier check suggested that the internal flash was faster than the external ext4 for tiny, random reads.

Would you add FUSE (Filesystem in Userspace Linux kernel module) please to the kernel? I would like to try Paragon NTFS driver that said it even works in boot and recovery.
I tried the app, but it complained about the kernel not supporting fuse. I am using hefe kernel on AOKP-ICS.

Let me look at the config. It shouldn't be a problem. Nice to know that people are still interested in a solid ICS experience.
Posted from my SGS4G, thanks to Team Acid development

I really appreciate that you are continually working on development for this device, especially in this area
Sent from my SGH-T959V using Tapatalk 2

Rebel_X said:
Would you add FUSE ...
Click to expand...
Click to collapse
Today's build has the fuse.ko module built and available. I didn't build it into the kernel as it looked to be pretty large (~680 kB on disk) and I'm not sure something that many users would need. If it doesn't automatically load when you start your app, you may need to manually load it (or have it done in a start-up script).
Code:
localhost / # lsmod
lsmod
Module Size Used by Not tainted
bcm4329 213497 0
localhost / # insmod /system/lib/modules/fuse.ko
insmod /system/lib/modules/fuse.ko
localhost / # lsmod
lsmod
Module Size Used by Not tainted
fuse 58977 0
bcm4329 213497 0
Let me know if you have any issues or need help in getting it to load automatically for you.
I'm also curious about the use case. I just haven't run across a need or good use for FUSE on my phone. I have used it for ssh-based file systems in the past and it was pretty slick for that.

As this application of the Hefe Hook kernel is likely to generate more questions that "just an ICS kernel" would have, please use the Q&A Thread.
So, you want to have a nice, big, fast data partition so you don't have to worry about running out of space, or wait for all your apps to be mounted, one-by-one, off your SD. You want to be able to try a new ROM without worrying about your data at all as well, eh?
Oh, you're not on Team Acid CM9 or a similar ICS ROM? You can read along, but I don't know of any other SGS4G ROMs with a boot image / kernel that lets you do this the same way.
OK, all that said, breathe deeply and consider that you might lose all your data if things go awry. Breathe easier in that there are some great backup tools out there!
For this to work well, you'll need a good microSD. One that is at least "Class 10" and from a reputable manufacturer is highly recommended. I've had good luck with SanDisk and Transcend. I'm currently using the SanDisk Ultra 64 GB microSDXC Class 10 UHS-1 Memory Card 30MB/s with Adapter SDSDQU-064G-AFFP-A
Today's prices are not as bad as they were a year ago:
16 GB - $13
32 GB - $22
64 GB - $47
These 64 GB cards work just fine in my experience, being able to address all 64 GB in our phones.
These instructions assume that you have a blank card in your hands and aren't going to mess with the one you are presently using in your phone. You'll have to juggle a bit if you are going to "reuse" your current card.
Format your new card
First, we need to prepare that new card. I suggest four partitions, though you can get away with just the first three.
1) "sdcard" -- FAT
2) "sd-ext" -- ext4
3) "data" -- ext4
4) (spare) -- ext4
Here is how I think about partition sizes:
3) "data" -- 2 GB seems reasonable. I'm using about 1 GB and it would probably double if I installed the apps I've pulled off over the time I've had the phone since I didn't have enough space
4) (spare) -- 6 GB -- Why? I can do two full-image, uncompressed backups of 2 GB of data and 1 GB of internal storage. I can use rsync to very, very quickly do a backup as it only had to copy the added/changed files, not the whole thing. (More later on this.)
2) "sd-ext" -- 1 GB -- What do I do with this? All my apps and data are already on the microSD. I need something here so that scripts that grab the second partition don't grab our data partition. It could be smaller, but I figure I've got 1 GB in my pocket in case I fill everything else up.
1) "sdcard" -- 64 GB - 9 GB = 54 GB left. If you have a 16 GB card, it would be 7 GB, pretty tight, and I'd probably sneak some off of sd-ext and the fourth parition. Well, no, I'd spend a couple more dollars and at least buy a 32 GB card.
I do all of my partitioning on machine running Ubuntu. If you run Windows, you can boot into Ubuntu and run it without installing it.
Apologies here that there aren't a lot of details here yet on how to run the disk tool on Ubuntu. I wanted to get this up sooner than later.
Format the drive with a Master Boot Record (MBR) partition table
Add partitions (my 64 GB sizes shown):
1) FAT, 54 GB, "SD64-2-sdcard"
2) ext4, 1 GB, "SD64-2-sd-ext"
3) ext4, 2 GB, "SD64-2-data"
4) ext4, 6 GB (the remainder), "SD64-2-p4"
I name the partitions so that they are easier to manage on desktop machines. Unfortunately, I don't see the kernel picking up the names on the phone. My naming convention is the "SD64-2" identifies a chip -- a SanDisk 64 GB chip that I've scrawled the number "2" on with a marker. I've got a bunch of them and can't remember which is which without marking them.
Now, put that "new" chip somewhere safe, not in the phone!
You've still got your "old" microSD in the phone.
Power it off, remove your SIM card.
Boot it up and plug it in to your computer, if it isn't already. You don't want to run out of battery half-way through something important. Some things are easier through adb than on the phone. You do have adb up and running on your computer, right?
Get Backups
1) Turn off WiFi (yes, really -- you don't want anything changing your data after you've backed it up)
2) Backup with TitaniumBackup
2) Reboot to recovery
3) Run a full backup in recovery
4) Remove your day-to-day microSD
Get your information over to the "new" microSD
There are a lot of ways to do this, the easiest is probably to get both the old and the new chip mounted on a Linux machine and use rsync, along the lines of
Code:
rsync -avihP /media/jeff/SD64-1-sdcard/ /media/jeff/SD64-2-sdcard/
rsync -avihP /media/jeff/SD64-2-sd-ext/ /media/jeff/SD64-2-sd-ext/
Be careful with the trailing slashes! Especially if they are missing on the source, you'll get a very different result. The "-a" option is the important one, "-vihP" are all about getting some verbose output that supposedly a human can read as it is copying everything.
Grab a beer, cup of coffee, whatever. There is no magic if you are copying over a bunch of GB from one chip to another, especially over USB.
You now have a copy of your old card on your new card, with the new card having the right partitions.
You can run it again to convince yourself that the two have the same files. I do it myself. If it doesn't copy anything, it should be all good. It is a lot faster when you don't have anything to copy!
Put away your old card somewhere safe. Really. Take it out of your computer.
Get utilities on microSD
Before you take the new chip install a couple things. I use the 4th partition for this as "scratch" space. You want a copy of rsync for your phone, Hefe Hook kernel (2103-12-18 or later), and a version of init-on-fs.sh that mounts your microSD for /data (instead of the internal flash). Do not push init-on-fs.sh to the phone yet!
Get your old /data onto the new card
5) Put the new microSD in your phone. Leave the SIM out!
6) Boot to recovery -- I do this by having the phone connected and hitting "return" on
Code:
adb reboot recovery
as soon as I see the Team Acid logo ger replaced my the CyanogenMod boot animation. If it gets to be running, don't panic! No SIM, no WiFi remember? You won't get calls, SMS, push updates, new mail, nothin' Just reboot into recovery and continue.
7) Fire up adb shell, mount the partitions, and get rsync available
Code:
mount -a
cp /mmc0p4/rsync /system/xbin/
chmod 755 /system/xbin/rsync
8) Copy over your /data to the new partition!
Code:
rsync -avihP /data/ /mmc0p3/
Same warnings on trailing slashes, as well as making yourself confident that everything was copied over by running the rsync command twice.
9) Install init-on-fs.sh that will mount your microSD as /data
Code:
cp /mmc0p4/init-on-fs.sh /system/etc/
chmod 755 /system/etc/init-on-fs.sh
My /system/etc/init-on-fs.sh is chatty, but works for me:
Code:
#!/system/bin/sh
/system/xbin/busybox mount
/system/xbin/echo
/system/xbin/busybox mkdir /sd-ext
/system/xbin/busybox mount -t ext4 -o noatime /dev/block/mmcblk0p2 /sd-ext
/system/xbin/echo
/system/xbin/busybox mount
/system/xbin/echo
/system/xbin/busybox umount /data
/system/xbin/busybox mount -t ext4 -o noatime /dev/block/mmcblk0p3 /data
/system/xbin/echo
/system/xbin/busybox mount
10) Reboot to Android
Woo hoo!! Check your system space, you should have a bunch of free space on internal now!
Get everything "internal"
You want your stuff off "android secure" since the way that it works is that Android creates a file that is a filesystem for each and every app you've moved to SD. At boot time, it reads the file, mounts it, checks the filesystem, then "hooks up" the app inside. It can take a couple minutes for this to complete! Putting them on "internal" storage does away with that. They are "just there" like your internal apps used to be. That means you get all the widgets and everything too.
(No, I don't know how to turn off notifications when you move the XDA app to "internal" -- the settings don't seem to do anything.)
Don't rush this. You want to be able to get back to /data on the internal flash later if you need to. We haven't erased /data -- it is a handy "backup" there right now.
This assumes you have TitaniumBackup, perhaps Pro is required. If you don't own it already, I think it is a solid product. If you use something else to manage your apps and backups, take this as an outline.
This looks like a lot to do -- but if you ever have to restore to your internal storage, you'll know what you already had on SD so you can restore it there!
11) Mark your on-SD apps -- this is a pretty-well hidden feature, so stick with me
Launch TiB
One it gets going and "all application information has been loaded"
Go to the Backup/Restore tab
Click on "Click to edit filters"
Clear any existing filter and set
Filter by type: User
Filter by location: External
Click the green checkmark in the top right
It should return to the list of apps, all your on-SD apps should be shown
Click on "Click to edit filters" again
Click on the "Create label..." button
Enter a name, "Apps on SD, December 2013" or whatever makes sense to you
Click on "Add/Remove elements..." button
Click on "Select shown elm." button
You should now see only the "filtered" elements
Click the green checkmark in the top right
Click the "Save" button on label dialog
Click the green checkmark in the top right
You should see your on-SD apps tagged. Phew!!
12) Move all your on-SD apps and data to internal storage
Click the grey checkmark in the top right
You should see the Batch actions screen
Run "Move user apps to internal memory"
Run "Move app data to internal memory" (if you have it)
13) Kick back -- you've done it
I'd reboot to recovery at this point and backup your new data partition. The partions you will want to backup now are labeled
boot (mtd)
recovery (mtd)
system (mtd)
efs (mtd) -- once in a while is fine
cache (mtd) -- can skip, it's cache after all
Android Secure -- should be 0 MB, if so, can skip
sd-ext (p2) -- backup if you have important stuff here
data (p3) -- <== this is all your stuff now!
You can skip "userdata (mtd)" now as it is your "old" internal data partition.
You should also see that TWRP will let you put your backup on your choice of partitions on your microSD:
sdcard (p1)
sd-ext (p2)
mmc0p4

WhyTF is this guy not RC/RD already!?!?

Hey I flashed this on an sgs4g and your darkness patch didn't seem to work, this is on the Dec 18 build.

bhundven said:
WhyTF is this guy not RC/RD already!?!?
Click to expand...
Click to collapse
will put in a nomination when I get home if it's ok with Jeff for RC.
sent from within the white knight

FBis251 said:
Hey I flashed this on an sgs4g and your darkness patch didn't seem to work, this is on the Dec 18 build.
Click to expand...
Click to collapse
I'll take that as a polite request to dust off the cobwebs, patch the current kernel sources, and provide a "Darkness" version with the touch-key backlight turn-off hack
@FBis251 -- it's been checked and is up now -- I had forgotten how nice it is not to have the lights on all the time!
Amusingly, my look at the CM10 and CM11 sources look like they do what my kernel hack does, but in the Android layer.

jeffsf said:
I'll take that as a polite request to dust off the cobwebs, patch the current kernel sources, and provide a "Darkness" version with the touch-key backlight turn-off hack
@FBis251 -- it's been checked and is up now -- I had forgotten how nice it is not to have the lights on all the time!
Amusingly, my look at the CM10 and CM11 sources look like they do what my kernel hack does, but in the Android layer.
Click to expand...
Click to collapse
Ah I misread the OP, I thought I had read "This includes the kernel of darkness patch" but you said that this wasn't derived from the kernel of darkness .
Thanks for the update, flashing it now.
EDIT
Everything's working as expected, thanks again!

moved to Q&A thread (sorry, I need to get glasses).

I'm going to respond to you in the Q&A thread, if you don't mind.
I'll also make links to it a little more evident once I get back with you.

Bumping this thread to verify that this procedure works well with Team Acid AOKP (milestone 6 build 5). Feels smoother than CM9 too.
EDIT
Since it's a dev thread, I'm gonna post a tip that @bhundven gave me. He said to try using noop as the scheduler for the SD card since it seems to get better performance than deadline or cfq.
You can do this by adding an init.d script under /system/etc/ (or just edit one of the ones that are already there) and add the following:
Code:
echo "noop" > /sys/block/mmcblk0/queue/scheduler

FBis251 said:
Bumping this thread to verify that this procedure works well with Team Acid AOKP (milestone 6 build 5). Feels smoother than CM9 too.
EDIT
Since it's a dev thread, I'm gonna post a tip that @bhundven gave me. He said to try using noop as the scheduler for the SD card since it seems to get better performance than deadline or cfq.
You can do this by adding an init.d script under /system/etc/ (or just edit one of the ones that are already there) and add the following:
Code:
echo "noop" > /sys/block/mmcblk0/queue/scheduler
Click to expand...
Click to collapse
FB...you're the only one who could get away with a bump. haha So glad to see you are still around, even if its just lurking around back in the shadows. you're one of 4 who helped me get to where I am with Android from day 1. I love this phone! Thanks. (I know this is off topica sn a dev thread I apologize in advance)

Related

Need help with vold.conf for cupcake apps to sd

I am trying to work with haykuro to get apps on sd for his cupcake roms, but I ran into a problem. They replaced mountd with vold, and there is no known documentation on how to format the config file. This does not seem to be the same vold that is used on SUN or other unix operating systems. If anyone has any useful info, please share it with me so I can look into this further.
Maybe this will get you started...
*EDIT* didnt read your post correctly... Didnt see that it was not related to the Sun version.
Darkrift,
Maybe the vold.conf in the android system is similar to the vold.conf in my Solaris 10 Sparc Server.....
Code:
> > For Solaris 8, you have to fake a change on the vold.conf
> > configuration file, otherwise the HUP signal is ignored:
> >
> > touch /etc/vold.conf
> > + pkill −HUP vold
>
> I stopped vold & commented out the one /etc/vold.conf line:
> # use rmdisk drive /dev/rdsk/c*s2 dev_rmdisk.so rmdisk%d
If you want vold to automatically mount an usb mass
storage device on a reboot (or a re−start of vold, or the above
mentioned touch / SIGHUP sequence), you have to make sure to remove
the comment character from the "use rmdisk" line in /etc/vold.conf.
Study some of the Sun Solaris docs I have listed below and maybe you will find the right recipe you are looking for...
Sun Solaris USB Flash Drive Mount Command
Solaris 10 - System Administration Guide - Devices and File Systems
Hope this helps...
I'm on Gtalk as AndroidSamurai if you have any questions.
While I'm at it, this is the command to mount a floppy in Solaris...
Code:
mount -f pcfs /dev/diskette /mnt
/mnt is the mount point
Here is what is currently in the file:
Code:
## vold configuration file for Sapphire
volume_sdcard {
## This is the direct uevent device path to the SD slot on the device
media_path /devices/platform/msm_sdcc.2/mmc_host/mmc1
emu_media_path /devices/platform/goldfish_mmc.0/mmc_host/mmc0
media_type mmc
mount_point /sdcard
ums_path /devices/platform/usb_mass_storage/lun0
}
I tried adding:
Code:
volume_apps {
## This is the direct uevent device path to the SD slot on the device
media_path /dev/block/mmcblk0p2
media_type mmc
mount_point /system/sd
}
with no luck. And yes, I tried doing the media_path in the same format as the first one, which also did nothing.
Would the "mount_point" not be "/sdcard"?
I cannot work the terminal on my G1 bc of the keymapping error preventing me from using "/"...
Would it not be:
Code:
media_path /dev/block/mmcblk0p1
seeing that a fat partition(vfat) would be "p0" ?
Have you tried looking at "vold/mmc.c and vold/mmc.h" ?
Also try looking at the following:
Code:
vold/volmgr_ext3.c
vold/volmgr_ext3.h
vold/volmgr_vfat.c
vold/volmgr_vfat.h
If you would please e-mail me the vold.conf in a zip archive so I can play around with it a little...
Sorry, my resources are a little bare at the current time due to a surge knocking out all my equipment.
Email Me
or find me on GTalk under androidsamurai.....
No, i am trying to add apps to sd, which go in /system/sd/app. this would mount my second partition (ext2) /system/sd
Let me also state that the top part is working. that is what loads the sdcard to /sdcard. what I am trying to do is load the second partition to /system/sd by adding a *second* block to the file, which is not working.
Hi Darkrift,
I don't have a second partition on my sd card nor have I installed any of the cupcake builds so I can't test my thoughts myself but thought I'd share them with you...
Have you tried browsing to the directory referenced by the original vold.conf? I was just wondering how this structure compares to a device using a partitioned sd card? Maybe a comparison would give us some clues as to how the new volume manager works.
Mine looks like this:
sys/devices/platform/msm_sdcc.2/mmc_host:mmc1/mmc1:d516
With no other similarly name directories below the msm_sdcc.2 level.
Why don't we use Fat32 partition as extra memory? why can't we run application from a Fat32 partition?
#1 FAT32 doesn't support case-sensitivity, and that is enabled on the internal FS's
#2 extfs is way better than FAT
#2 FAT sucks
@wellsie: I think the problem is the name I am giving it "volume_apps {
" but if i change it to volume_sdcard { like the first one, it adds those config options to teh top block. Also I have tried adding all different versions of the media path (in /dev, in /system/devices and more) with no luck.
@funbacon: Joushou's ideas make sense, but neither of those are the reason. Each application installed on the G1 has an owner, group and set permissions. That is part of the "sandbox" that keeps apps from accessing each others files. Fat has no permissions, so an app on fat would not be able to have the needed permissions to be used.
Oh yeah, permissions aswell
I have been too long in unix, so i just expect that to be there
But i believe that fits under the "FAT sucks" category
I agree with that one
C'mon. I know someone has gotta have some ideas or maybe know how to browse the source and figure stuff out more than I could. I tried checking out the source but its fairly foreign to me. I know a little scripting, but not much as far as coding goes. I really would like to help get apps-to-sd working in cupcake but this is a major stumbling block for that.
I just want to say that even i am not proficient on this type of stuff i voluntere to test whatever setup you come up with.
I really apreciate your work on this as this is the only reason I have not moved to haykuros or anybodys cupcake build.
So thanks tanks to every body for pitching in.
oh by the way, If you set it up i will donate to the cause!!!!!
I'll try and look at the code over the weekend...family time comes first though so it may have to wait until next week when I'm at work ;-)
I think the main problem is the naming convention for a new "block". sdcard is already in use, and adding a second one just adds to the first one. I think there might be "sdcard2" or something else that it is expecting. I tried just naming it whatever I wanted hoping that would work but it didnt seem to.
im with carlos im not a good with all that code stuff, but im down to test whatever u come out with,
also for i heard haykuyo is coming out with a fix for the physical keyboard soon
If you are speaking about "Keyboard Fix" in the terms of the Keyboard Mapping being messed up, then chack out the first post of the Sapphire/Magic G1 Port thread... Keyboard mapping has been fixed.
I honestly cannot believe that Google hasn't had any hits on the android site about this problem yet...
Instead of partitioning, maybe we can try this other method for apps to sdcard.
http://forum.xda-developers.com/showpost.php?p=3402719&postcount=683
http://forum.xda-developers.com/showpost.php?p=3402947&postcount=687
This method creates an ext2 filesystem object as a file under the fat32 filesystem so there would be no need to partition.
I'm doing my taxes today, but if I get a chance to play around with it, I'll try to implement this tomorrow. Looks pretty straightforward.
well, nobody would know about this problem unless they are breaking the rules. A, having a rom which we should not have, and B, making changes to the OS and "hacking" it to read apps somewhere its not supposed to. Android should not have 2 partitions, so this is not something they would even answer.

Ext4 fs?

Just a quick thought - I was trying to figure out if I might get somewhat better filesystem performance out of ext4 rather than ext3 for the user data partition. As a first pass, I compiled a kernel with ext4 enabled, and tried to change my boot partition init.rc to mount /data as an ext4 partition rather than an ext3 - my understanding is they should be mount-compatible even without repartitioning.
The result of this was a bootloop. Had to reflash back to a working boot.img. Didn't do anything bad to my /data partition though.
Any ideas why this might be happening? Is there a way to grab dmesg from a boot looping kernel on Android?
I've found the following procedures to be helpful in debugging custom kernels.
First, remove the fbcon.c patch in the kernel source (you can just edit the one line that gets modified and uncomment it):
Code:
nano drivers/video/console/fbcon.c
Search for "navy", then uncomment the line:
Code:
update_screen(vc);
Rebuild your kernel. Now you'll have the ability to get a framebuffer console, if your kernel command line arguments are correct. You have to supply custom kernel command line arguments when using mk-boot-img. I use the following when using mk-boot-image:
Code:
mkbootimg --kernel zImage --ramdisk initrd.gz --cmdline "[email protected] [email protected] vmalloc=192M video=tegrafb console=tty0,115200 fbcon=rotate:1 fbcon=font:VGA8x8 usbcore.old_scheme_first=1 cpuid=200102 devicetype=1002 btmac=9c5ed6131a00 tegraboot=nand mtdparts=tegra_nand:[email protected](misc),[email protected](recovery),[email protected](boot),[email protected](system),[email protected](cache),[email protected](bootbmp),[email protected](logodata)" -o boot.img
The important part there is changing the console parameter from the default ttyS0 to tty0.
I make separate boot images when debugging - one that executes a shell in the initial ramdisk, and one that doesn't. To get a shell in the initrd, which you'll want to do in this case to figure out your mount issue, is change the above mkbootimg --cmdline parameter:
Code:
mkbootimg --kernel zImage --ramdisk initrd.gz --cmdline "break=top [email protected] [email protected] vmalloc=192M video=tegrafb console=tty0,115200 fbcon=rotate:1 fbcon=font:VGA8x8 usbcore.old_scheme_first=1 cpuid=200102 devicetype=1002 btmac=9c5ed6131a00 tegraboot=nand mtdparts=tegra_nand:[email protected](misc),[email protected](recovery),[email protected](boot),[email protected](system),[email protected](cache),[email protected](bootbmp),[email protected](logodata)" -o boot.img
Notice the "break=top". This will give you a command shell before anything in initrc has been executed. You could also use "break=bottom" or "break=init" to get you to different spots in initrc.
Hope that helps! Happy hacking!
Oh, and I forgot to mention that a usb keyboard is very handy after you get a shell
jersacct said:
I've found the following procedures to be helpful in debugging custom kernels.
First, remove the fbcon.c patch in the kernel source (you can just edit the one line that gets modified and uncomment it):
Code:
nano drivers/video/console/fbcon.c
Search for "navy", then uncomment the line:
Code:
update_screen(vc);
Rebuild your kernel. Now you'll have the ability to get a framebuffer console, if your kernel command line arguments are correct. You have to supply custom kernel command line arguments when using mk-boot-img. I use the following when using mk-boot-image:
Code:
mkbootimg --kernel zImage --ramdisk initrd.gz --cmdline "[email protected] [email protected] vmalloc=192M video=tegrafb console=tty0,115200 fbcon=rotate:1 fbcon=font:VGA8x8 usbcore.old_scheme_first=1 cpuid=200102 devicetype=1002 btmac=9c5ed6131a00 tegraboot=nand mtdparts=tegra_nand:[email protected](misc),[email protected](recovery),[email protected](boot),[email protected](system),153728[email protected](cache),[email protected](bootbmp),[email protected](logodata)" -o boot.img
The important part there is changing the console parameter from the default ttyS0 to tty0.
I make separate boot images when debugging - one that executes a shell in the initial ramdisk, and one that doesn't. To get a shell in the initrd, which you'll want to do in this case to figure out your mount issue, is change the above mkbootimg --cmdline parameter:
Code:
mkbootimg --kernel zImage --ramdisk initrd.gz --cmdline "break=top [email protected] [email protected] vmalloc=192M video=tegrafb console=tty0,115200 fbcon=rotate:1 fbcon=font:VGA8x8 usbcore.old_scheme_first=1 cpuid=200102 devicetype=1002 btmac=9c5ed6131a00 tegraboot=nand mtdparts=tegra_nand:[email protected](misc),[email protected](recovery),[email protected](boot),[email protected](system),[email protected](cache),[email protected](bootbmp),[email protected](logodata)" -o boot.img
Notice the "break=top". This will give you a command shell before anything in initrc has been executed. You could also use "break=bottom" or "break=init" to get you to different spots in initrc.
Hope that helps! Happy hacking!
Click to expand...
Click to collapse
Hey jersacct, so I've tried this (recompiled with your suggested patch, then made new boot image with the last set of params you mentioned) and I absolutely see the framebuffer scrolling by rapidly right after the Viewsonic Birds display. However, I never get the break into console - the FB scrolls by very quickly, then I get the GTabDevs boot image for about 2 seconds, then I boot loop again.
Any ideas? I have tried both the break=top and break=init variants of that mkbootimg command line with no success.
EDIT: I tried with a known-good ramdisk image too. The boot.img boots fine, but again I never get dropped to console.
Hmm, I suspected the issue might be that the default config has a pesky setting called CONFIG_CMDLINE="" that could be force-overriding any command line passed to the kernel from the boot image. Tried again with that line commented out, and still didn't have any luck getting the break= command to do anything.
I could probably try forcing the command line from CONFIG_CMDLINE but not sure why that would be different from passing it in mkbootimg...
EDIT: nope, I tried that too. Doesn't make a difference. So I assume it's receiving the CMDLINE just fine. For some reason break=top isn't giving me a console. I also tried it with my USB keyboard already plugged in to see if that was making a difference with the input devices, and still no console.
Still no luck on the debug console. At my wit's end on that. All I can say is that on a regular boot with ext3 mounting my /data partition I see that the partition is dirty and the first mount attempt fails. Second attempt seems to succeed. Says I need to fsck my data partition - which I'd do, but our busybox doesn't seem to support fsck.
Anybody know where I can find a busybox binary that properly supports fsck for ext2/3 and also has mkfs.ext4? I know the Archos guys seem to have one and that's an ARM v9 device so it should work, but I'm having trouble finding it (I even downloaded the "SDE" firmware from the Archos site).
I think the reason the ext4 driver is probably just that it's dirty, though I can't confirm that without the damned debug console.
If I can get an up-to-date busybox on here, I suspect this will just start working magically, without further ado. Ideas are appreciated, either on busybox binaries or on getting the initramdisk console stuff that jersacct posted to work.
These guys can help you:
http://forum.xda-developers.com/showthread.php?t=895599
And it makes a HUUUUGE difference...
rcgabriel said:
Still no luck on the debug console. At my wit's end on that. All I can say is that on a regular boot with ext3 mounting my /data partition I see that the partition is dirty and the first mount attempt fails. Second attempt seems to succeed. Says I need to fsck my data partition - which I'd do, but our busybox doesn't seem to support fsck.
Anybody know where I can find a busybox binary that properly supports fsck for ext2/3 and also has mkfs.ext4? I know the Archos guys seem to have one and that's an ARM v9 device so it should work, but I'm having trouble finding it (I even downloaded the "SDE" firmware from the Archos site).
I think the reason the ext4 driver is probably just that it's dirty, though I can't confirm that without the damned debug console.
If I can get an up-to-date busybox on here, I suspect this will just start working magically, without further ado. Ideas are appreciated, either on busybox binaries or on getting the initramdisk console stuff that jersacct posted to work.
Click to expand...
Click to collapse
You know, I didn't think to mention that I was using the Karmic ramdisk image - I bet our stock ramdisk image doesn't have breakpoints setup in initrc. You can grab a copy of a stock initrd image here:
http://www.retardedrobot.com/karmic-initrd-orig.gz
Then just use it instead of the stock ramdisk image when using mkbootimg. Please note, I hardcoded mine to get root to work off the SD card. I think this is an unmodified initrd, so it may work straight out of the box (and boot android if allowed). You might have problems with it though, and may need to unpack it, edit some scripts (for mounting root, etc) and repackage it.
Hope that helps.
stanglx said:
These guys can help you:
http://forum.xda-developers.com/showthread.php?t=895599
And it makes a HUUUUGE difference...
Click to expand...
Click to collapse
Yeah, I've seen the thread before.
I think I was just exhausted and bleary eyed earlier and completely frustrated.
Now that I'm a little more clear-headed, things are much easier.
I've snagged the busybox build out of the Archos initramfs. It indeed does all the ext4 stuff.
jersacct said:
You know, I didn't think to mention that I was using the Karmic ramdisk image - I bet our stock ramdisk image doesn't have breakpoints setup in initrc. You can grab a copy of a stock initrd image here:
http://www.retardedrobot.com/karmic-initrd-orig.gz
Then just use it instead of the stock ramdisk image when using mkbootimg. Please note, I hardcoded mine to get root to work off the SD card. I think this is an unmodified initrd, so it may work straight out of the box (and boot android if allowed). You might have problems with it though, and may need to unpack it, edit some scripts (for mounting root, etc) and repackage it.
Hope that helps.
Click to expand...
Click to collapse
Ahh, this explains why it doesn't work. Thanks so much, I'll take a crack, but hopefully I can clean up my /data partition into a proper ext4 partition with busybox and get it mounting now. I'll see tomorrow, too tired tonight.
Ba...ZING! Finally got ext4 driver working properly. Figured out what was causing the bootloops before, I think - or at least localized the issue.
Running an e2fsck and disabling inandop.sh seems to have done the trick. I think one of the checks in inandop.sh was triggering a reboot. My init.rd now successfully mounts /data as an ext4 partition, mount reports the partition as ext4.
What I need to do now is try to clean up inandop.sh so it properly uses the right binaries to set up the partition as a true ext4. Currently just mounting an ext3 partition with the ext4 driver.
So far no significant performance boost in Quadrant, it's within 50 points of where it was before. But I'm not done yet.
rcgabriel said:
Ba...ZING! Finally got ext4 driver working properly. Figured out what was causing the bootloops before, I think - or at least localized the issue.
Running an e2fsck and disabling inandop.sh seems to have done the trick. I think one of the checks in inandop.sh was triggering a reboot. My init.rd now successfully mounts /data as an ext4 partition, mount reports the partition as ext4.
What I need to do now is try to clean up inandop.sh so it properly uses the right binaries to set up the partition as a true ext4. Currently just mounting an ext3 partition with the ext4 driver.
So far no significant performance boost in Quadrant, it's within 50 points of where it was before. But I'm not done yet.
Click to expand...
Click to collapse
will it incorporate in the future Vegan release? I know we have to do complete format, and goto ext4?
Will love if we can get ext4.
Are you using internal or external (sd card) for the test? The internel storage is very very slow compared to most class 4 sd cards.
rcgabriel said:
Ba...ZING! Finally got ext4 driver working properly. Figured out what was causing the bootloops before, I think - or at least localized the issue.
Running an e2fsck and disabling inandop.sh seems to have done the trick. I think one of the checks in inandop.sh was triggering a reboot. My init.rd now successfully mounts /data as an ext4 partition, mount reports the partition as ext4.
What I need to do now is try to clean up inandop.sh so it properly uses the right binaries to set up the partition as a true ext4. Currently just mounting an ext3 partition with the ext4 driver.
So far no significant performance boost in Quadrant, it's within 50 points of where it was before. But I'm not done yet.
Click to expand...
Click to collapse
One would think that Viewsonic will atleast put class 4.. It does appear to be slow at times when you use SDCard for cache to browse..
stanglx said:
Are you using internal or external (sd card) for the test? The internel storage is very very slow compared to most class 4 sd cards.
Click to expand...
Click to collapse
Using internal SD card. I don't have an extra microSD handy here, just the one in my Nexus One, which is 16GB class 2 so probably too slow to be useful for that.
Still I'm fairly convinced that I should be able to get better results with the internal SD card.
Take a look.. See if your getting the same results with ext4..
Here is the output of a test:
http://forum.xda-developers.com/showpost.php?p=10239762&postcount=2
As you can see a Class
rcgabriel said:
Using internal SD card. I don't have an extra microSD handy here, just the one in my Nexus One, which is 16GB class 2 so probably too slow to be useful for that.
Still I'm fairly convinced that I should be able to get better results with the internal SD card.
Click to expand...
Click to collapse
stanglx said:
Take a look.. See if your getting the same results with ext4..
Here is the output of a test:
http://forum.xda-developers.com/showpost.php?p=10239762&postcount=2
As you can see a Class
Click to expand...
Click to collapse
I'll do more testing later, but right now I've managed to bootloop my G Tablet and I don't have my USB cable here, it's at the office (snow day today). I can boot to recovery but it seems like ClockworkMod recovery 0.8 doesn't want to mount my external MicroSD card from my N1 to copy over a working update.zip to re-flash.
So unless I find another USB cable lying around the apartment somewhere, my G Tablet is out of commission until Monday or until I hit the nearest Radio Shack this weekend.
Status update: I am waiting on a class 6 SD card from Newegg so I can try more stuff out and perfect this without continually screwing up my internal SD card and having to repartition, reformat, etc.
In the meantime, I have tried adapting Chenglu's data2loop method to use an ext4 filesystem in the loop device files rather than an ext2 filesystem as he uses, using a kernel with ext4 enabled.
The good - I'm getting even higher Quadrant benchmarks than with the baseline data2loop. Up to around 3470, averaging around 3400 with a couple of runs. I was, with the same kernel and Chenglu's data2loop patch, getting in the 3200s to 3300s, so the difference seemed somewhat significant to me.
Unfortunately, it seems to puke out every time I reboot. The data must get screwed up somehow in the /data/ext4 files, and my G Tab goes schizo and won't even finish the bootup process - screen flickers from the "Vegan" logo during boot, and then screen shuts off. Have to hard shut-down then hard reboot to recovery and wipe data to get things working again.
The /misc/inandop.log file seems to report that data-to-loop was successfully enabled, so I'm not sure exactly why it's puking out in such epic fashion. Have to work more on this later.
Most likely experiencing some corruption in the cache.... add the sync command to the mount and see if that helps stability using the loopback device.... Also when you create the file system are you using
mkfs.ext4 -O ^huge_file ....
I have read you need to turn off huge_file as it causes some issues (dont remember where I read it though)
rcgabriel said:
Status update: I am waiting on a class 6 SD card from Newegg so I can try more stuff out and perfect this without continually screwing up my internal SD card and having to repartition, reformat, etc.
In the meantime, I have tried adapting Chenglu's data2loop method to use an ext4 filesystem in the loop device files rather than an ext2 filesystem as he uses, using a kernel with ext4 enabled.
The good - I'm getting even higher Quadrant benchmarks than with the baseline data2loop. Up to around 3470, averaging around 3400 with a couple of runs. I was, with the same kernel and Chenglu's data2loop patch, getting in the 3200s to 3300s, so the difference seemed somewhat significant to me.
Unfortunately, it seems to puke out every time I reboot. The data must get screwed up somehow in the /data/ext4 files, and my G Tab goes schizo and won't even finish the bootup process - screen flickers from the "Vegan" logo during boot, and then screen shuts off. Have to hard shut-down then hard reboot to recovery and wipe data to get things working again.
The /misc/inandop.log file seems to report that data-to-loop was successfully enabled, so I'm not sure exactly why it's puking out in such epic fashion. Have to work more on this later.
Click to expand...
Click to collapse
So just to update this thread, I did get ext4 working stably on the /data partition. The trick is doing everything from recovery mode - making the ext4 filesystem via adb push and adb shell, then flashing an update.zip from recovery that packages a kernel that supports ext4 with a ramdisk/init.rc that mounts /data as ext4 and skips the inandop.sh step entirely since that was the source of bootloops (stock inandop.sh expects /data to be ext3 and pukes if it's not).
You can see my detailed instructions over here: http://forum.xda-developers.com/showpost.php?p=10489732&postcount=23
The bad news is really no significant performance bump from ext4 in the standard 2gig partition. But I expect it to be stable as hell. Still need to experiment more with ways to speed things up (safely).

[Q&A] Mounts2SD - Storage & Memory Management

Mounts2SD - Storage & Memory Management
The Opening Post (OP) has been moved to a new DevDB Section
This Thread has been assigned as an Q&A.
You should see a new pane above where you can navigate this project.
About dalvik-cache? It remains in phone memory?
Hi I cant understand How to use it ! any guide ?!
denzel09 said:
About dalvik-cache? It remains in phone memory?
Click to expand...
Click to collapse
dalvik-cache remains, so does all of the app related data. Only the APK's is moved.
Taki2011 said:
Hi I cant understand How to use it ! any guide ?!
Click to expand...
Click to collapse
First of all you need a custom rom. If you have a stock rom it will not work since you need a rom that will allow custom scripts during boot.
You will also need to know how to use ADB (An android tool for communicating with your phone. It is used to enter the android shell and also to transfer files to and from the phone, among other things).
And last, you will need at least 2 or 3 partitions on your sdcard (Otherwise it's a waste of time, although the script is build to adapt for these scenarios). One as a regular fat32 sdcard partition, one for the sd-ext and one for the cache. (Use ext2 for the last two. ext3 will eat your card to fast)
Here is the steps (You need to have ADB working on your computer).
Copy/Paste the script content into a file editor and safe the file with the name "99mounts2sd"
Plug your phone to your computer using a usb cable (Select charge only on your phone))
Open a terminal on your computer (In windows use "run" and type "cmd")
Type in shell: "adb shell mount -o remount,rw /system"
Type in shell: "adb push <path to script> /system/etc/init.d/"
Type in shell: "adb shell chmod a+x /system/etc/init.d/99mounts2sd"
Reboot your phone
The first time you boot your phone using the script it will take some time, because the script needs to copy all of your APK's from internal storage to the sd-ext partition.
The script has been rewritten. Better checks and more options has been added.
Great script
Sent from my GT-S5570 using Tapatalk
It didn't work for me, I made the files made sure they were in the right place and rebooted but booted normally. No delay on first boot and still seems to not be using the other two partitions on my sd card. i used cwm4 to partiton my SD card and it is partitioned correctly (3 partitons). I see the script says "log" I don't know where the log is stored or how to view it. Thanks.
To see the log, type in the terminal: "logcat | grep mounts2sd". Download a terminal or use ADB.
Also run the command "df -h" to see what is mounted where.
Sent from my HTC Desire using xda premium
thanks for the share.
#7 @dyehya
It seams that logcat has a very limited lifetime. In order to get the log info, you would have to get it during boot.
Instead I have updated the script to do this itself. Update your script and config file content with the new above code.
In the config file set VAR_DEBUG="yes" and reboot your phone. Now enter a terminal and type "cat /var/mounts2sd.log | grep mounts2sd" which will show you all the messages from the script, and possible errors, if any.
I am not sure what is going on in boot. I just saw your replies and haven't had a chance to update the script and mess with the phone. I do know that when I was playing with it before it kept using the busybox minimal that was in the kernel loaded in sbin I tried copying your version of busybox into bin and xbin (and now reverted back) but it would still use the one in sbin. What I would really like to do and would recommend is you design the script where you can put busybox in a certain location and the script will use that version over any other versions. I am still learning with all this and despite being able to create the files throw them in the correct places I don't know the code well enough to do this myself. Thanks again for all your help.
Ok i have changed the script so that it now forces the usage of /system/xbin/busybox or /system/bin/busybox and ignores /sbin/busybox
Place a full busybox version in one of the system bin folders, update the script and see what happends.
Otherwise paste a copy of "df -h" and "cat /data/mounts2sd.log | grep mounts2sd" here so that I can see what it does during boot.
Thanks for this. Just flashed the ICS beta 0.1 with your a2sd embedded. Just a suggestion, I added $CMD_CHMOD 777 $CMD_BUSYBOX at line 260, just after the affectation of CMD_BUSYBOX.
For now, it seems to work very well !
virus2013 said:
Thanks for this. Just flashed the ICS beta 0.1 with your a2sd embedded. Just a suggestion, I added $CMD_CHMOD 777 $CMD_BUSYBOX at line 260, just after the affectation of CMD_BUSYBOX.
For now, it seems to work very well !
Click to expand...
Click to collapse
That I don't get? $CMD_CHMOD is undefined at line 260 and why use busybox to change permissions on itself?
dk_zero-cool said:
That I don't get? $CMD_CHMOD is undefined at line 260 and why use busybox to change permissions on itself?
Click to expand...
Click to collapse
Sorry, I'm tired... :-\
In fact, I just wanna be sure that the busybox in /system/bin was executable as I pushed it into the rom zip. And as chmod was already used upper, I was thinking it could be a good idea. However, I'm not a script writer! ;-)
Sent from my Desire running ICS
Hello Cool,
trying ICS with your script. Here is the output of logcat an df -h command:
Code:
# cat /data/mounts2sd.log | grep mounts2sd
cat /data/mounts2sd.log | grep mounts2sd
12-14 13:05:12.905 V/mounts2sd( 96): Initiating Mounts2SD (v:1.1.1)...
12-14 13:05:12.985 V/mounts2sd( 101): Including configuration file...
12-14 13:05:14.897 V/mounts2sd( 212): Searching for sdcard...
12-14 13:05:15.277 V/mounts2sd( 231): Searching for sd-ext partition (/dev/block/mmcblk0p2)...
12-14 13:05:16.198 V/mounts2sd( 254): sd-ext partition was mounted successfully...
12-14 13:05:16.728 V/mounts2sd( 278): Moving /data/app to /sd-ext/app...
12-14 13:05:17.049 V/mounts2sd( 297): Moving /data/app-private to /sd-ext/app-private...
12-14 13:05:17.209 V/mounts2sd( 305): Searching for the sd-cache partition (/dev/block/mmcblk0p3)...
12-14 13:05:18.050 V/mounts2sd( 326): sd-cache was mounted successfully...
12-14 13:05:18.280 V/mounts2sd( 335): A device is already mounted at /cache. Umounting it...
12-14 13:05:18.420 V/mounts2sd( 341): Moving /cache to /sd-cache...
12-14 13:05:18.440 V/mounts2sd( 342): Done!
df -h
Filesystem Size Used Available Use% Mounted on
tmpfs 202.9M 32.0K 202.9M 0% /dev
tmpfs 202.9M 0 202.9M 0% /mnt/asec
tmpfs 202.9M 0 202.9M 0% /mnt/obb
/dev/block/mtdblock3 250.0M 165.0M 85.0M 66% /system
/dev/block/mtdblock5 147.6M 62.4M 85.2M 42% /data
/dev/block/mmcblk0p2 960.7M 1.2M 959.4M 0% /sd-ext
/dev/block/mmcblk0p2 960.7M 1.2M 959.4M 0% /data/app
/dev/block/mmcblk0p2 960.7M 1.2M 959.4M 0% /data/app-private
/dev/block/mmcblk0p3 295.9M 168.0K 295.8M 0% /sd-cache
/dev/block/mmcblk0p3 295.9M 168.0K 295.8M 0% /cache
/dev/block/vold/179:1
6.2G 4.6G 1.6G 75% /mnt/sdcard
/dev/block/vold/179:1
6.2G 4.6G 1.6G 75% /mnt/secure/asec
This looks good, can you please confirm?
Also, why is /data not on ext partition but on phone memory?
Thanks for the script though!
Cheers, keep up the good work.
jukyO said:
This looks good, can you please confirm?
Also, why is /data not on ext partition but on phone memory?
Thanks for the script though!
Cheers, keep up the good work.
Click to expand...
Click to collapse
That looks as it should.
The whole /data is not moved to the /sd-ext for that simple reason that there are no hboot out there with 0mb /data.
I have options in my script to move both the .apk files (The applications) and the dalvik-cache which are the biggest things in the /data partition. If I moved everything to sd-ext, there would be nothing using the remaining space available on the internal data which is a waste of good space. It's like having an extra room in your house that is not used for anything at all. If we have to have it, we might as well use it
BTW:
You don't have dalvik-cache aktivated. So if you ever need more space on /data, activate it in /system/etc/mounts2sd.conf
dk_zero-cool said:
BTW:
You don't have dalvik-cache aktivated. So if you ever need more space on /data, activate it in /system/etc/mounts2sd.conf
Click to expand...
Click to collapse
Could you provide an example mounts2sd.conf file, so that all settings could be established at first boot. This would make it much easier when updating ROMS.
uzi2 said:
Could you provide an example mounts2sd.conf file, so that all settings could be established at first boot. This would make it much easier when updating ROMS.
Click to expand...
Click to collapse
You don't need a .conf file now - it's not used. You simply install the zip and then use the m2sd commands in terminal to make changes (see instructions in OP - type m2sd help for more info)
uzi2 said:
Could you provide an example mounts2sd.conf file, so that all settings could be established at first boot. This would make it much easier when updating ROMS.
Click to expand...
Click to collapse
The config files is deprecated and replaced with the "m2sd" command, as said above. Settings is saved to /data/.m2sd which means that it keeps your settings when you flash new ROM's as long as you don't wipe data.

FIX: extsd2internalsd broken after Verizon 4.1.2 OTA

Loong time lurker, first time poster. I couldn't post a reply in the development forum, obviously. Maybe someone can link to this in relevant threads over in development.
This is a guide for those who are/were using the extsd2internal to swap storage which no longer works after the 4.1.2 OTA or want to do take advantage of this mod: http://forum.xda-developers.com/showthread.php?t=1849860 OR it MIGHT work for other ROMs which want to use this method for the Galaxy S3.
After the OTA, and getting back up and running, I could not get the script to work correctly with this error: "no such file or directory" and doing some sleuthing, it seems Verizon (in their infinite wisdom) changed the mounts, or maybe it did this because gremlins/gnomes, maybe because Vzw/Samsung knows about the swapping method, who knows. Anyways, here is the fix that worked for me:
PreReqs:
Stock ROM 4.1.2 OTA
Rooted (duh)
BusyBox
SManager ads
Terminal Emulator
Root Explorer in R/W mode
extsd2internalsd mod installed/script in the correct place!
BACKUPS!! Make a nandroid backup before you do ANY tinkering people, and copy it to a safe place like your computer.
Let me be clear, for the love of bits and bytes, do not just keep one copy on the sdcard in the phone!!
1) To find the /dev/block/vold for the external sd card, open Terminal Emulator and run this command. Grant it root access when prompted:
Code:
su ls /dev/block/vold
Write down or make a note of the numbers. (For me there were only 2, 179:32 and 179:33) Now run these commands:
Code:
adb shell
cat /proc/mounts
There will be a whole lot of text that shows up, you are looking for "/dev/block/vold/179:xx" and in the same line there is "/storage/extSDCard"
Alternate method, after you are in shell run command and look for mmcblk1p1:
Code:
cat /proc/partitions
The number in the "minor" column, that's the new number!
Double-check that the blocks are right for the sd card's partition size.
Note: I tried using mmcblk1 and it didn't work, then tried mmcblk1p1 and VIOLA! Yay, trial and error.
2) In SManager, edit the extsd2internal script, and replace the 179:97 to 179:*new number* (again, for me it was 179:33)
3) Reboot or just "run" the script in SManger and wait a few moments, then check Settings>Storage.
Here is what my script looks like:
Code:
#!/system/bin/sh
#extsd2internalsd is a modification that allows to switch internal sd to external sd and viceversa. With this you can use default internal sd only for app storage #and the external sd to store all apps resource and all others stuff. The resut is a very big increase of installable apps on gs3
#All credits to Mattiadj of xda forum for the idea and script and to mike1986 for the cmw zip.
#xda thread url at http://forum.xda-developers.com/showthread.php?t=1772234
#Script Modified for U.S. Galaxy S3s by Zedomax at GalaxyS3Root.com to be compatible when sdcard is not inserted.
busybox mount -o remount,rw /
busybox mount -t vfat -o umask=0000 /dev/block/vold/179:33 /mnt/sdcard
busybox mount -t exfat -o umask=0000 /dev/block/vold/179:33 /mnt/sdcard
if busybox mount | busybox grep vold/179:33; then
busybox mount -o bind /data/media /mnt/extSdCard
fi
If this didn't work for you, I am a complete n00b, so I will do my best, but don't expect much.
Things to double check:
Permissions on the extsd2interal script in Root Explorer should have all the boxes checked EXCEPT the last 3 at the bottom.
SManager script should be set to "Su" and "Boot"
OTA Headaches? Use this guide to keep root and boot unlocked worked PERFECTLY: http://forum.xda-developers.com/showthread.php?t=2186574#8 I did a nandroid restore to pre-OTA since it borked the first go-around, and then used this method.
Take home message: MAKE BACKUPS!
Credits / Current Build of this mod:
http://forum.xda-developers.com/showthread.php?t=1772234
This mod does work, and just replacing the old with the new (still have to add it in SManager) will get the job done. The new script is significantly different, and I am sure there are reasons, but without a changelog...
Forum Community: Created the thread here because I couldn't find another thread specific to this environment with all the relevant information in one place. If anyone has seen any errors of my ways, please, please reply with what's up.

[HOWTO] Dual-boot Android ROMs, e.g. CROMI-X and CM

Tired of backup, wipe, flash, backup, wipe, restore, ... just to try a different ROM?
Today we will cook a nice tasty dual-boot for the TF700T. You will have two separate environments with different ROMs, apps and data that share only the common Linux kernel binary.
Difficulty: medium. No programming skills required, but not for noobs.
Ingredients
1 TF700T running a rooted stock-based ROM with busybox and a kernel with preinit support (hint: -that kernels work fine )
1 PC running Linux with a microSD card reader
1 fast microSD card with at least 4 GB
1 CyanogenMod 10.2 nightly ZIP (should also work for other ROMs - post your results)
1 seasoned chef
Time required: about 30 to 45 minutes.
Directions
Preheat oven to 220 degree celsius ... oops, wrong recipe.
If done right, the internal ROM and its data are perfectly safe. But I assume you have a backup nevertheless - don't blame me if anything goes wrong.
Prepare the microSD card
Insert microSD card into PC card reader. Using gparted, create and format 3 primary partitions:
p1: fat32, this will be your external sdcard as before.
p2: ext4, this will become /data
p3: ext4, this will become /system
Make sure to align the partitions to MiB, or even better multiples of 4 MiB. This may improve I/O performance.
In most cases you can simply shrink the existing FAT32 partition and then create the remaining ext4 partitions.
Partition 3 should be 700 to 800 MB - anything bigger is a waste of space, and anything smaller than 500 MB might cause problems.
Partition 2 will be your whole "internal storage" for the second operating system, so size it according to your storage needs for apps, app data and the emulated /sdcard.
I am using a Samsung 16 GB card with the following partition sizes:
p1: ~ 8 GB
p2: ~ 6 GB
p3: ~ 800 MB
Prepare the new ROM
Before installing the second ROM to the microSD card, the ZIP file must be slightly modified. I assume you know how to unpack and repack a ZIP file and how to use a text editor - if not, find a tutorial elsewhere. .
Note: This step can now be automated, see http://forum.xda-developers.com/showpost.php?p=47333729&postcount=31
To do it manually:
First, extract boot.blob and set it aside for later. Then carefully remove it from the ZIP. Second, find META-INF/com/google/android/updater-script and modify it:
Replace all occurrences of mmcblk0p1 with mmcblk1p3. I had 3 occurrences in CM's updater-script - make sure you modify all of them, otherwise your internal ROM might not survive the installation. This change will redirect the installation to the external microSD card. Finally, remove the line that says package_extract_file("boot.blob", ...) near the end - it would overwrite the kernel and we don't want that.
Now we need to add the WiFi modules. These are compiled directly into the CM kernel, but separate modules in the stock kernel.
Get the kernel modules from your running ROM - they are in /system/lib/modules (e.g. using adb pull /system/lib/modules), and copy at least these two into the ZIP into /system/lib/modules:
cfg80211.ko
bcmdhd.ko (note: for TF300, I think you need bcmdhd_29.ko instead)
Finally, repack the ZIP, mount the first partition of your microSD card and copy the ZIP file there.
Extract the ramdisk files
Note: This step can now be automated, see http://forum.xda-developers.com/showpost.php?p=47333729&postcount=31
To do it manually:
Here comes the tricky part. You need to extract the ramdisk from the boot.blob you saved from the ZIP file in the previous step.
To do that, you need tools that may not be in every household, but should be easy to find using your favorite search engine. In case you have trouble finding and/or compiling them, you can find the result of this step in post #2.
First we need to unpack the blob (https://github.com/AndroidRoot/BlobTools):
Code:
blobunpack boot.blob
This will create boob.blob.LNX. This is the boot image, from which we need to extract the ramdisk (https://github.com/huaixzk/unpackbootimg):
Code:
unpackbootimg -i boot.blob.LNX
This will create several files, we are interested in boot.blob.LNX-ramdisk.gz - copy this one to your tablet, e.g. into /sdcard. For example:
Code:
adb push boot.blob.LNX-ramdisk.gz /sdcard/
Prepare the preinit script and the ramdisk files
Note: This step can now be automated, see http://forum.xda-developers.com/showpost.php?p=47333729&postcount=31
To do it manually:
On the tablet, open a shell in a terminal app or use adb shell and become root (su). Run the following commands:
Code:
mount -o remount,rw /system
cd /system
mkdir boot
cd boot
mkdir rootfs_cm
cd rootfs_cm
gzip -d -c /sdcard/boot.blob.LNX-ramdisk.gz | cpio -i
The first line makes /system writable until the next reboot. The next few lines are self-explanatory. The last line uncompresses the ramdisk image we created in the previous step and extracts the contained files. We are doing this on the tablet itself to preserve the file permissions.
Now modify the file fstab.cardhu (one of the files just extracted).
Replace mmcblk0p1 with mmcblk1p3 and mmcblk0p8 with mmcblk1p2.
mmcblk0p2 can stay as it is, it's the /cache partition that is only used to communicate with the recovery.
Next we need to make sure the WiFi modules that we added are loaded at boot time. Edit init.cardhu.rc and find the "on boot" line. Add below (indentation is important):
Code:
insmod /system/lib/modules/cfg80211.ko
insmod /system/lib/modules/bcmdhd.ko
Near the end of init.cardhu.rc is another reference to mmcblk0p8 that needs to be modified to mmcblk1p2 - near "service setup_fs".
Finally create the file /system/boot/preinit with the following content:
Code:
#!/system/bin/sh
# preinit: only /sys and /system are mounted (ro), / is still rw
PATH=/sbin:/system/bin:/system/xbin
# auto-detect rom2sd
if [ -d /sys/block/mmcblk1/mmcblk1p3 ]; then
echo "\nsystem/boot/preinit: mmcblk1p3 detected, setting up for ROM2SD.\n"
cp -a /system/boot/rootfs_cm/* /
fi
Make sure to make it executable:
Code:
chmod 744 /system/boot/preinit
This script is run by the kernel before the real Android init. It. detects if a microSD card with 3 partitions is inserted, and if yes, it copies the files for the CM root filesystem into the ramdisk. The following Android boot procedure will then mount /system and /data to the partitions on the microSD card and the whole operating system will run from the microSD card. If no card is inserted, nothing is modified and the normal internal ROM is started.
Flashing the ROM
Insert your microSD card into the tablet, boot to TWRP and flash your modified ZIP as usual - but disable signature checking because we didn't sign the modified ZIP.
Recovery
The recovery doesn't know about the external ROM, so you can't use the recovery to backup or restore its system or data. I prefer using the PC for that anyway.
Booting
To boot from internal storage, make sure the microSD card is not inserted when you start the tablet (you can insert it as soon as the boot animation appears). To boot from the microSD card, make sure it is inserted before you turn the tablet on.
That's all. Add more microSD cards for triple-boot, quad-boot, etc.
Notes
My kernel currently has not enabled SELINUX in the config, but CM appears to work anyway.
Update: -that6 enables SELinux.
Shortcut
In case you don't want to extract the CM ramdisk from the blob yourself (or you have trouble finding/compiling the tools to do so), you can try using mine - from my unofficial build of cm-10.2-20131024: View attachment boot.blob.LNX-ramdisk.gz
Automated solution
See http://forum.xda-developers.com/showpost.php?p=47333729&postcount=31
(reserved for additions)
_that said:
Tired of backup, wipe, flash, backup, wipe, restore, ... just to try a different ROM?
Today we will cook a nice tasty dual-boot for the TF700T. You will have two separate environments with different ROMs, apps and data that share only the common Linux kernel binary.
Difficulty: medium. No programming skills required, but not for noobs.
Ingredients
1 TF700T running a rooted stock-based ROM with busybox and a kernel with preinit support (hint: -that kernels work fine )
1 PC running Linux with a microSD card reader
1 fast microSD card with at least 4 GB
1 CyanogenMod 10.2 nightly ZIP (should also work for other ROMs - post your results)
1 seasoned chef
Time required: about 30 to 45 minutes.
Directions
Preheat oven to 220 degree celsius ... oops, wrong recipe.
If done right, the internal ROM and its data are perfectly safe. But I assume you have a backup nevertheless - don't blame me if anything goes wrong.
Prepare the microSD card
Insert microSD card into PC card reader. Using gparted, create and format 3 primary partitions:
p1: fat32, this will be your external sdcard as before.
p2: ext4, this will become /data
p3: ext4, this will become /system
Make sure to align the partitions to MiB, or even better multiples of 4 MiB. This may improve I/O performance.
In most cases you can simply shrink the existing FAT32 partition and then create the remaining ext4 partitions.
Partition 3 should be 700 to 800 MB - anything bigger is a waste of space, and anything smaller than 500 MB might cause problems.
Partition 2 will be your whole "internal storage" for the second operating system, so size it according to your storage needs for apps, app data and the emulated /sdcard.
I am using a Samsung 16 GB card with the following partition sizes:
p1: ~ 8 GB
p2: ~ 6 GB
p3: ~ 800 MB
Prepare the new ROM
Before installing the second ROM to the microSD card, the ZIP file must be slightly modified. I assume you know how to unpack and repack a ZIP file and how to use a text editor - if not, find a tutorial elsewhere. .
First, extract boot.blob and set it aside for later. Then carefully remove it from the ZIP. Second, find META-INF/com/google/android/updater-script and modify it:
Replace all occurrences of mmcblk0p1 with mmcblk1p3. I had 3 occurrences in CM's updater-script - make sure you modify all of them, otherwise your internal ROM might not survive the installation. This change will redirect the installation to the external microSD card. Finally, remove the line that says package_extract_file("boot.blob", ...) near the end - it would overwrite the kernel and we don't want that.
Now we need to add the WiFi modules. These are compiled directly into the CM kernel, but separate modules in the stock kernel.
Get the kernel modules from your running ROM - they are in /system/lib/modules (e.g. using adb pull /system/lib/modules), and copy at least these two into the ZIP into /system/lib/modules:
cfg80211.ko
bcmdhd.ko
Finally, repack the ZIP, mount the first partition of your microSD card and copy the ZIP file there.
Extract the ramdisk files
Here comes the tricky part. You need to extract the ramdisk from the boot.blob you saved from the ZIP file in the previous step.
To do that, you need tools that may not be in every household, but should be easy to find using your favorite search engine.
First we need to unpack the blob (https://github.com/AndroidRoot/BlobTools):
Code:
blobunpack boot.blob
This will create boob.blob.LNX. This is the boot image, from which we need to extract the ramdisk (https://github.com/huaixzk/unpackbootimg):
Code:
unpackbootimg -i boot.blob.LNX
This will create several files, we are interested in boot.blob.LNX-ramdisk.gz - copy this one to your tablet, e.g. into /sdcard. For example:
Code:
adb push boot.blob.LNX-ramdisk.gz /sdcard/
Prepare the preinit script and the ramdisk files
On the tablet, open a shell in a terminal app or use adb shell and become root (su). Run the following commands:
Code:
mount -o remount,rw /system
cd /system
mkdir boot
cd boot
mkdir rootfs_cm
cd rootfs_cm
gzip -d -c /sdcard/boot.blob.LNX-ramdisk.gz | cpio -i
The first line makes /system writable until the next reboot. The next few lines are self-explanatory. The last line uncompresses the ramdisk image we created in the previous step and extracts the contained files. We are doing this on the tablet itself to preserve the file permissions.
Now modify the file fstab.cardhu (one of the files just extracted).
Replace mmcblk0p1 with mmcblk1p3 and mmcblk0p8 with mmcblk1p2.
mmcblk0p2 can stay as it is, it's the /cache partition that is only used to communicate with the recovery.
Next we need to make sure the WiFi modules that we added are loaded at boot time. Edit init.cardhu.rc and find the "on boot" line. Add below (indentation is important):
Code:
insmod /system/lib/modules/cfg80211.ko
insmod /system/lib/modules/bcmdhd.ko
Near the end of init.cardhu.rc is another reference to mmcblk0p8 that needs to be modified to mmcblk1p2 - near "service setup_fs".
Finally create the file /system/boot/preinit with the following content:
Code:
#!/system/bin/sh
# preinit: only /sys and /system are mounted (ro), / is still rw
PATH=/sbin:/system/bin:/system/xbin
# auto-detect rom2sd
if [ -d /sys/block/mmcblk1/mmcblk1p3 ]; then
echo "\nsystem/boot/preinit: mmcblk1p3 detected, setting up for ROM2SD.\n"
cp -a /system/boot/rootfs_cm/* /
fi
Make sure to make it executable:
Code:
chmod 744 /system/boot/preinit
This script is run by the kernel before the real Android init. It. detects if a microSD card with 3 partitions is inserted, and if yes, it copies the files for the CM root filesystem into the ramdisk. The following Android boot procedure will then mount /system and /data to the partitions on the microSD card and the whole operating system will run from the microSD card. If no card is inserted, nothing is modified and the normal internal ROM is started.
Flashing the ROM
Insert your microSD card into the tablet, boot to TWRP and flash your modified ZIP as usual - but disable signature checking because we didn't sign the modified ZIP.
Recovery
The recovery doesn't know about the external ROM, so you can't use the recovery to backup or restore its system or data. I prefer using the PC for that anyway.
Booting
To boot from internal storage, make sure the microSD card is not inserted when you start the tablet (you can insert it as soon as the boot animation appears). To boot from the microSD card, make sure it is inserted before you turn the tablet on.
That's all. Add more microSD cards for triple-boot, quad-boot, etc.
Click to expand...
Click to collapse
It is a nice detail instruction for new users like me. I really like it a lot and I can use some information from your post for my system2sd... However, maybe I misread your post. I don't see any information about repack the blob when you are done modifying the fstab.cardhu. I know a little bit of ramdisk and can get around it but that information will help the first time users... Just my opinion and thanks for sharing a valuable information to us...
LetMeKnow said:
However, maybe I misread your post. I don't see any information about repack the blob when you are done modifying the fstab.cardhu.
Click to expand...
Click to collapse
That's because you don't need to repack the blob or reflash the kernel - I wanted to simplify the procedure, so I added preinit support to the kernel's ramdisk a few months ago. You just put some files in /system/boot and the kernel will run your preinit script that modifies the ramdisk at boot time.
Just remember that if you reflash your internal ROM, you have to recreate the /system/boot stuff.
_that said:
That's because you don't need to repack the blob or reflash the kernel - I wanted to simplify the procedure, so I added preinit support to the kernel's ramdisk a few months ago. You just put some files in /system/boot and the kernel will run your preinit script that modifies the ramdisk at boot time.
Just remember that if you reflash your internal ROM, you have to recreate the /system/boot stuff.
Click to expand...
Click to collapse
Oop, I forgot that you use it in your boot folder... It is my bad.. I will give it a try when I am done with my system2sd testing and will ask more questions on the way.. Thanks for the information...
Cheers,
LMK
_that said:
Notes
My kernel currently has not enabled SELINUX in the config, but CM appears to work anyway.
(reserved for additions)
Click to expand...
Click to collapse
You should be fine until I enforce SELINUX. But I haven't finished the policies yet. Still have some issues to iron out with that. Have about 90% of them done, I think.. lol
Just out of curiosity, will this only work with primary partitions?
johnlgalt said:
Just out of curiosity, will this only work with primary partitions?
Click to expand...
Click to collapse
It should also work with logical partitions if you modify the partition numbers accordingly. And please remove the full quote of my guide from your post, we should not emulate an Outlook-style mess in the forum.
Sent from my ASUS Transformer Pad TF700T using Tapatalk 4
_that said:
It should also work with logical partitions if you modify the partition numbers accordingly. And please remove the full quote of my guide from your post, we should not emulate an Outlook-style mess in the forum.
Sent from my ASUS Transformer Pad TF700T using Tapatalk 4
Click to expand...
Click to collapse
Yeah, I quoted it that way b/c I was asking specifically about that part - but it that part works I suppose the rest would too, huh? :silly:
Wow
Thx for this, easy cheesey, Great work, Love the dual boot!!!!
_that said:
Tired of backup, wipe, flash, backup, wipe, restore, ... just to try a different ROM?
Today we will cook a nice tasty dual-boot for the TF700T. You will have two separate environments with different ROMs, apps and data that share only the common Linux kernel binary.
Click to expand...
Click to collapse
Is there any chance *someone with the required skills* could port bootmanager to our device?
BootManager
it would be the best, considering that your method uses the same load-from-sdcard thing.
Just curious thats all.
kali113 said:
Is there any chance *someone with the required skills* could port bootmanager to our device?
BootManager
it would be the best, considering that your method uses the same load-from-sdcard thing.
Just curious thats all.
Click to expand...
Click to collapse
Looks like commercial software, so ask the devs of that app.
Here is an experimental flashable zip file that redirects the TWRP recovery to the ROM2SD environment. It doesn't really install anything to storage, it just reconfigures the device nodes so that the recovery is tricked into accessing the system and data partitions on the microSD card instead of internal storage.
It works so well that after "installing" this, a following ROM install that unmounts and formats /system and installs itself to /system on mmcblk0p1 will actually be installed on the microSD card, so you don't need to replace the partition names in the updater-script any longer (but you still need to comment out the blob flashing line for now or reflash my kernel after the ROM).
It also works so well that after "installing" this, you don't see your internal /sdcard any longer, so put whatever you want to flash on the first partition of the external microSD card.
"Installing" the script again will undo its actions, so you can toggle back and forth between external and internal storage.
Warning: I tested this only once, and the script does not have any error handling - if the inserted microSD is not prepared for ROM2SD, behavior is undefined - most likely the recovery will complain that it can't mount system or data. Use this at your own risk and make sure you have backed up all valuable data and your ROM, just in case.
View attachment dev-rom2sd.zip
The script also contains a nice example how to output text from a shell script to the recovery console. It shows a list of device nodes so you can see what the script did (the device numbers of mmcblk0p1 and mmcblk1p3 are identical).
Can I follow this guide to have paranoid rom on internal and cromi-x rom on microsd?
vnphatbuddha said:
Can I follow this guide to have paranoid rom on internal and cromi-x rom on microsd?
Click to expand...
Click to collapse
I've never tried PA but it may work if you use my kernel and modify the preinit script accordingly (my kernel contains a stock-compatible ramdisk, so you need to copy the PA ramdisk to / if the microSD is *not* inserted).
_that said:
I've never tried PA but it may work if you use my kernel and modify the preinit script accordingly (my kernel contains a stock-compatible ramdisk, so you need to copy the PA ramdisk to / if the microSD is *not* inserted).
Click to expand...
Click to collapse
sorry for such a noob question but how do you compile the zips from the git links to an executable? Or does the bloobtool and unpackbootimg able to run from its extracted zips? slightly new to this...
vnphatbuddha said:
sorry for such a noob question but how do you compile the zips from the git links to an executable? Or does the bloobtool and unpackbootimg able to run from its extracted zips? slightly new to this...
Click to expand...
Click to collapse
You need to compile the blobtools on git. extract the .zip and run blobunpack on the .blob then abootimg -x on the boot.img.to repack: abootimg --create *new-bootimg* - k *zImage* -r *ramdisk*, then repack the .blob
and/or
follow this tutorial from the blob master himself http://forum.xda-developers.com/showpost.php?p=36925180
JoinTheRealms said:
You need to compile the blobtools on git. extract the .zip and run blobunpack on the .blob then abootimg -x on the boot.img.to repack: abootimg --create *new-bootimg* - k *zImage* -r *ramdisk*, then repack the .blob
and/or
follow this tutorial from the blob master himself http://forum.xda-developers.com/showpost.php?p=36925180
Click to expand...
Click to collapse
The problem I'm having is that I do not know how to use git to compile. What are the commands and do I input it in the top search bar of the site?
vnphatbuddha said:
The problem I'm having is that I do not know how to use git to compile. What are the commands and do I input it in the top search bar of the site?
Click to expand...
Click to collapse
You don't use git to compile, you use it to manage the source code.
To compile the source code, you need the appropriate development tools installed (I think it's called "build-essential" on Debian-like distributions) and run "make" in the directory with the extracted source code.
_that said:
You don't use git to compile, you use it to manage the source code.
To compile the source code, you need the appropriate development tools installed (I think it's called "build-essential" on Debian-like distributions) and run "make" in the directory with the extracted source code.
Click to expand...
Click to collapse
Wow this is too complicated to compile, having to setup and run debian on usb. Guess I can't try out rom2sd

Categories

Resources