yashsingh1/xdaforums huggingface dataset:
[G1 Android Development] Ohsaka:
We encountered a problem with the Biffmod ROM where people's ext partition was not getting mounted properly.

In this patch file...

I changed:

# set property with exit code in case an error occurs
setprop cm.e2fsck.errors $e2fsckExitCode;
if [ "$e2fsckExitCode" = 0 ];
then

to

if [ "$e2fsckExitCode" = 0 -o "$e2fsckExitCode" = 1 ];

Because "1" is still a valid successful return code. It just means that errors were successfully corrected on the filesystem.

The exit code returned by e2fsck is the sum of the following conditions:
0 - No errors
1 - File system errors corrected

Not sure why people are suddenly having filesystem problems that need to be corrected... Maybe their sdcards are starting to get worn out...
[G1 Android Development] NLJ:
Hi!

Nice finding Ohsaka!

As to why people started to have FS problems:

1. for some time e2fsck was missing from CM builds and FS simply wasn't tested (if there were severe errors mount would refuse to act) and then exit code wasn't properly checked - both problems have been already dealt with

2. during reboot or shutdown sometimes sd-ext is not properly unmounted and on next reboot this causes problems. It would be interesting to find and fix this issue, tho ATM I don't have idea where to start (apart from logcating shutdown process =o)
[G1 Android Development] sparksco:
What version of biffmod, the new one that is using the firstboot.sh method?
[G1 Android Development] NLJ:
I'd say that each and every one BiffMod version (as well as any other ROM that uses Firerat's AIO patch one way or another).

BTW the code can be simplified to:

if [ $e2fsckExitCode -gt 1 ] ;
[G1 Android Development] sparksco:
oh wow thanks, but I haven't had any problems with mounting after using the patches in roms :P
[G1 Android Development] ac.phan:
so I did a reformat on my sdcard, repartitioned, and reinstalled the ROM to get a fresh start. For a while the patch was working beautifully. Then once when my phone died and after rebooting it up... all my apps were gone again. I thought I would do another reboot because that helped originally, but nothing. So I am not sure if it is still something with the patch I am doing wrong or it is something in the ROM itself. any suggestions?
[G1 Android Development] yokonunz:
i plan to upgrade to cm6. i have many apps on sd-ext. if i want to restore then i have just to run the a2sd command on the first boot and i am ok? (also with market updates?)

in poor words.. how to enable app2sd in cm6 in /sd-ext
[G1 Android Development] Cwix:
I am having something similar to the above. I have installed the 0914 nightly of CM with Pershoots(?) custom kernel. (before I did all this I reformatted my sd card using Amon Ra 1.7) Once I ran "sh fr-patch140.txt a2sd sdext lwp lsd fixp", everything worked as it should, moved the files to the sdcard and life was good.

I rebooted my phone just for grins and when it was done I noticed that all my apps were missing. I checked the sd-ext directory and found nothing couldn't tell you why though. I rebooted again hoping that I didn't fubar something and wham they are back.

This will happen without fail if all is well and I reboot my apps are missing, reboot again and everything is back.

I'll post logcats if someone will tell me how to get one during bootup/shutdown.
[G1 Android Development] rsfaze:
nvm for now ;)
[G1 Android Development] Ohsaka:
Look at my post like eight posts up... It explains whats causing and the fix for the disappearing apps problem. Post #562.
[G1 Android Development] Firerat:
yeap, good spot :)

here is a fix

su
mount -o rw,remount /system
sed s/\"\$e2fsckExitCode\"\ =\ 0/\"\$e2fsckExitCode\"\ -lt\ 2/ /system/etc/init.d/05mountsd -i

you can also fix the patch file, replace /system/etc/init.d/05mountsd with /sdcard/fr-patch140.txt don't forget the -i on the end
[G1 Android Development] Firerat:
needs to be -lt 2, as we want to do stuff if its 0 or 1, the script exits if condition is not true
[G1 Android Development] Firerat:
the 05mountsd exitcode 'fix' I submitted to cm's git got merged, so I'll submit a new patch to include this fix

( when repo finally syncs, I've left it way too long :)
[G1 Android Development] Firerat:
http://review.cyanogenmod.com/#change,1727

Change I3e4646fd: e2fsck returns exit 1 if filesystem is repaired
credits: Ohsaka and NLJ of xda
http://goo.gl/SJNk
Change-Id:
I3e4646fde8ea22bf01b352e41a7bda0b9901c65d
Owner	Firerat
Project	CyanogenMod/android_vendor_cyanogen
Branch	froyo
Topic
Uploaded	Sep 20, 2010 3:44 AM
Updated	Sep 20, 2010 3:44 AM
Status	Review in Progress

Permalink
e2fsck returns exit 1 if filesystem is repaired
credits: Ohsaka and NLJ of xda
http://goo.gl/SJNk

@Ohsaka, many thanks for the spot

I guess I should actually get round to fixing my patch
[G1 Android Development] Firerat:
in the past I've seen an init service start a shutdown script, which basically stopped services and unmounted filesystems,, just had a quick look and it doesn't seem to be that way now.

Its still a little odd, as I've never had any corruption problems with ext ( apart from when my sdcard failed )

this is even after sudden powerloss due to phone drop and battery flying out :D

anyway, I think its worth looking into as it does seem to be a significant problem, well at least a handfull seem to be having problems
[G1 Android Development] Cwix:
Thank you sir!
[G1 Android Development] NLJ:
Yep! Sorry for that =o)

(i've took that line from 'my' mountsd which is tiny bit different - once again sorry for confusion and glad that 05mountsd is fully integrated with CM =o)))
[G1 Android Development] sparksco:
Not sure but could this be causing the problem in the updater-script?

symlink("/data/app", "/system/app", "/data/system-framework",

spacesp "/system/framework");
[G1 Android Development] sparksco:
The following "mount -o rw,remount /system" showed a failed message, but the following worked for me to remount: mount -o remount, rw /system

Just a fyi
[G1 Android Development] Firerat:
not sure I understand

dc2x has little to do with flashing to NoneDanger

Speedysilwady's thread [HOW-TO] Make ANY ROM fit on Stock/Any SPL *Updated 3/28/10* has all you need for flashing NoneDanger
[G1 Android Development] cb7tuner93:
??

How about having Cyanogen implementing this into his next update??
[G1 Android Development] zim2dive:
EDIT: removed to avoid mucking up the thread.
[G1 Android Development] Firerat:
@zim2dive

what the rubber duck are you on about

this has nothing to do with flashing anything to NoneDanger

a zim2dive-proof guide is impossible, buy an iphone
[G1 Android Development] Firerat:
:(

since uploading v1.3 I've flashed test4, and the -r option isn't working...

anyone still on test3 confirm its not working?
[G1 Android Development] zim2dive:
I guess that means no :) (and, no thanks on the iPhone)

At the same time.. why not add the code from http://xdaforums.com/showpost.php?p=6361087&postcount=1596 (or a newer/better version) into the script? At that point, wouldn't steps 2 & 4

be using features of your script?
[G1 Android Development] Firerat:
Arrrghhggg

this script has *nothing* to do with flashing on NoneDanger

if you want to flash CM5 on NoneDanger

http://xdaforums.com/showthread.php?p=6425475#post6425475
[G1 Android Development] dangambino:
Re: [PATCH] Firerat 'all in one' patch file [ v1.3 - 2010-05-12 ]

Great job firerat. With all the issues with lwp on first Gen. devices, I do enjoy them

-------------------------------------

Sent via the XDA Tapatalk App
[G1 Android Development] zim2dive:
Apologies. I thought you were bundling up all your code snippets from the CM5 thread, into one script, and so I thought the NoneDanger snippets would be in there too. I was incorrect.
[G1 Android Development] Firerat:
this will take all the pain out of it

FR-cm5test4-AnySPL-signed_S.zip

cm5test4 for any spl

i.e.

Danger/mt3g and NoneDanger

nothing taken away, I just replaced the updater-script and added my own shell script to detect danger and make the right links
[G1 Android Development] shawn1224:
-r option working fine on test3

I also zipaligned test 3 before applying v1.3 patch and whoa nelly LWP is beasting :D

I'm getting zero lag with seeds of life ... unheard of
[G1 Android Development] kaizasoshi:
sorry for the noob question...but do I just flash this zip and all the scripts will be implemented?
[G1 Android Development] MaddBlazed:
Firerat

Thank You for making a patch file like this for a super noob like me. (probably many others out there just like me)

I see you always posting on CyanMod 5's page and not get Thanked enough.
[G1 Android Development] apreichner:
So Firerat, why do Live Wallpapers perform better on software-3D than on hardware acceleration? It doesn't make a lot of sense to me...
[G1 Android Development] Firerat:
simple answer

because they do

better answer

lwp are backported from phones with higher hardware specs, its the gpu on our 32(a/b)s which can not cope.
[G1 Android Development] Firerat:
lol, sorry my bad

that zip has nothing to do with the scripts in the op

it is test4 which I have patch to be AnySPL ( so it can be flashed on NoneDanger/Danger/MT3G )

my patch is here

http://goo.gl/Ms8q

edit:current patch for installing cm5 on NoneDanger is here
[G1 Android Development] bm6788:
Sorry for my noobness Firerat but what are run parts? And how do you reverse swap after you put it on?
[G1 Android Development] Firerat:
run-parts just runs all scripts in a directory

CM5 , you have no problem

to reverse swap

su
sh /sdcard/fr-patch132.txt swap rev
[G1 Android Development] bm6788:
Thanks for the quick reply... just two more question for you Firerat. Why is it that when i enable swap and then try to turn it off i get a bunch of FC's? I even when running fix permissions. And how do you set the swap size and swapness using your script?
[G1 Android Development] bigdbag:
Firerat your contributions as well as your seemingly 24/7 online status are always much appreciated.

No homo but I just ran across this pic on reddit and thought of you ;):

EDIT: Oh snaps I just realized I'm a senior member now woot.
[G1 Android Development] sparksco:
I found this very interesting, thanks for the fix!

#!/system/bin/sh
#
# mount ext[234] partition from sd card

BB="logwrapper busybox";
# Firerat - make mount point
if [ ! -d /sd-ext ];
then
$BB mount -o rw,remount /
install -m 774 -o 1000 -g 1000 -d /sd-ext
$BB mount -o ro,remount /
fi

if [ "$SD_EXT_DIRECTORY" = "" ];
then
SD_EXT_DIRECTORY=/sd-ext;
fi;

# IConrad01's fix for CM6
# http://forum.cyanogenmod.com/topic/2636-froyo-a2sdext/page__view__findpost__p__26124
#
MMC=/dev/block/mmcblk0
if [ ! -b "$MMC" ];
then
mknod ${MMC} b 179 0
chmod 600 ${MMC}
for i in 1 2 3;do
mknod ${MMC}p${i} b 179 $i
chmod 600 ${MMC}p${i}
done
fi

# find first linux partition on SD card
# wait for the device to settle
COUNT=6;
until [ -b "$MMC" ] || [ $COUNT -lt 1 ];
do
sleep 1;
COUNT=$((COUNT-1));
done;

if [ -b "$MMC" ];
then
FDISK="busybox fdisk"
PARTITION=`$FDISK -l $MMC | awk '/^\// && $5 == 83 {print $1;exit;}'`

if [ -b "$PARTITION" ];
then
log -p i -t mountsd "Checking filesystems..";

# fsck the sdcard filesystem first
if [ `which e2fsck` ];
then
e2fsck -pv $PARTITION;
e2fsckExitCode=$?
else
echo "e2fsck not found, assuming fs ok.."
e2fsckExitCode=0
fi
# set property with exit code in case an error occurs
setprop cm.e2fsck.errors $e2fsckExitCode;
if [ "$e2fsckExitCode" -lt 2 ];
then

# mount and set perms
$BB mount -o noatime,nodiratime -t auto $PARTITION $SD_EXT_DIRECTORY;
if [ "$?" = 0 ];
then
$BB chown 1000:1000 $SD_EXT_DIRECTORY;
$BB chmod 771 $SD_EXT_DIRECTORY;
log -p i -t mountsd "$SD_EXT_DIRECTORY successfully mounted";
else
log -p e -t mountsd "Unable to mount filesystem for $SD_EXT_DIRECTORY!";
fi
else
log -p e -t mountsd "Unable to repair filesystem, disabling apps2sd";
fi
fi
fi
[G1 Android Development] Firerat:
you have a custom ROM yes?

remove mount from /system/bin,

the system will then use the busybox mount ( in /system/xbin ) and not toolbox's

just remove the toolbox symlink from the updater script, while your at it remove some of the other lame toolbox utils, see cm's updater-script, its well thought out

you could also check out my very old ROMs, I had as much busybox as I could ;)
[G1 Android Development] Firerat:
meh, no real reason to use that kind of symlink trickery if you use CustomMTD, just spec the system size
[G1 Android Development] sparksco:
Thanks for the quick response, wans't sure if that was necessary to add, I believe it works fine without adding that system link as well, I will remove and try it out.
[G1 Android Development] sparksco:
lol, I was going to just start adding the 05mountsd script to the init.d on my custom roms, but it looks like it's already going to be there soon, very nice work

Edit: Repo sync and compiling from source takes forever on my computer lol
[G1 Android Development] Firerat:
it has been for a couple of days..

unfortunately it does seem that we still have the no block device on boot problem, so until that gets resolved you may still need to add your own
[G1 Android Development] tnpapadakos:
where's the script to increase my system space size again? mt3g has a 90MB size, i want to increase it
[G1 Android Development] sauudmir:
Hey i have a recovery problem ... i had it corrupted and flashed it using fastboot and droid explorer it didn't did anything except a blank screen in recovery and then i just flashed it using terminal and it says

Mtd: Read error at 0x00000000 (Out of memory)

Now i remember u told me once when i had this error running ur script

mount -o rw,remount /system

rm /system/build.prop

but it also needs a flash after this command ... my prob is i don't have the recovery and backup , is there anyother command i can run to free up memory space to flash recovery? coz if i use this once i loose everything :(
[G1 Android Development] Firerat:
you remember incorrectly, you are getting it all mixed up

removing build.prop ensures that 'old' gapps are not backedup/restored

this is the script to flash recovery

http://forum.cyanogenmod.com/topic/...to-recovery/page__st__40__p__21996#entry21996
[G1 Android Development] sparksco:
I noticed that too, it works better if I just add the line to the bottom of the firstboot.sh to create it in the init.d instead of having it there to start, and of course removing the 05mountsd that comes with the stock rom.

Edit: Everything seems to be working fine on the rom, I wiped and flashed rom but didn't wipe my ext partition. All of my apps show in the drawer and the market, freakin awsome! The only app that has fc'd on me so far is SetCpu that I had to reinstall. Other than that it works great! Also I did confirm that the 05mountsd is in the init.d, hope this helps!
[G1 Android Development] revolution48:
How do i undo the LWP fix it made it more laggy
[G1 Android Development] ZilverZurfarn:
By restoring the Nandroid backup you of course made before starting your experiment?
[G1 Android Development] deuse:
Delete

I am now having problems when using a2sd!

It asks if I want to move data to sd I say yes then it trys to move apps to ad

and all I get is "failure [INSTALL_FAILED_INSUFFICIENT_STORAGR]

Availble space on

/data = 0.8 /sd-ext 647

I got 32 for swop and 756 for apps and this is on a 4GIG class 6 sdcard.

what am I doing wrong?
[G1 Android Development] raven_raven:
There's better way than backing up nandroid. In terminal type:

$ su
# sh /sdcard/fr-patch140.txt rev lwp

This will undo lwp fix.
[G1 Android Development] sebx_g1:
Hello , I wonder if dc2x option is usable , when I set it up --- after booting phone all my widgets are frozen for about 6 min :-( . Is any why to avoid this feature ( I have 8gb Samsung class 6 sdcard) . Is my card too slow for dalvik - cache on sd-ext ?
[G1 Android Development] vermaekansh:
may b this has already been answered but i wanna know how much swapiness is suitable and recommended for G1 2.2 CM6
[G1 Android Development] ZilverZurfarn:
Yes it has:

http://xdaforums.com/showpost.php?p=8397178&postcount=4048

At the end of the day, it's trial and error IMO. Try a few different settings, and see what you experience as best.
[G1 Android Development] atlmatt:
I keep getting a error of not enough system memory

What sucks is i had it working, but went to a different rom, I thought I needed t re apply the script and from there all hell

I am running teamfenix again, and tried to go back to CM to get it to work and sae error.

GRRRRRR I am frustrated tonight. Ill try any ideas tomorrow..
[G1 Android Development] bl4cklabel:
When I run the a2sd in the latest cm nightly It returns a Read only file system error.

I'm not a newbie I'm running as root.

What could be the problem here?

Should I try and reflash?
[G1 Android Development] sparksco:
su
mount -o remount, rw /system

Then run the a2sd, all from terminal of course
[G1 Android Development] vermaekansh:
erase system -w

dose anyone have a command to erase system through terminal or through console in recovery..?
[G1 Android Development] sparksco:
It's impossible to erase system in terminal emulator, because it's running off the system. There is a flashable zip file on my post as well as biffmod's post that will wipe system, data, and cache in recovery
[G1 Android Development] Firerat:
actually , you also need to

rm /system/etc/init.d/05mountsd

then re-run the script

http://review.cyanogenmod.com/#change,1814
[G1 Android Development] Firerat:
or just

mount /system
rm /system/* -r

in recovery

you can also wipe system via fastboot

fastboot erase system

and to wipe data, replace system with data, cache.. cache

or

fastboot erase system -w

to wipe them all
[G1 Android Development] cdis:
Hi, I'm run sh fr-patch140.txt sdext with adb shell, it's shown:

===============
Danger detected
===============
write: No space left on device
==============================================================
/system/etc/init.d/20userinit patched to check in /data/local/
changes will take effect on next boot
==============================================================

My phone is T-Mobile G1, Recovery is RA-dream 1.7, and ROM is CM 6.1.

Please help me.
[G1 Android Development] Firerat:
my guess is you don't have an ext partition and /data is full
[G1 Android Development] wuziq:
yo, got a question about using JIT with dc2x.

correct me if i'm wrong, but i understand that with dc2x, the dalvik cache gets stored on the ext partition of the sd card.

if you enable JIT, does all the machine code (compiled by JIT) then get "permanently" stored onto the ext partition?

e.g., i run gmail, JIT recompiles gmail into my phone's native machine code, stores that code into dalvik cache on the ext partition; then subsequent runs of gmail will execute that machine code from dalvik cache. is that correct?
[G1 Android Development] anon_az:
I wanted to chime in and say thanks to Firerat, this script has transformed my phone's behavior! Thanks a ton for putting so much effort into this project, it's great!
[G1 Android Development] wuziq:
upon further thought this makes no f'ing sense. nm. pretty sure machine code still has to be loaded into memory in order to run :o
[G1 Android Development] theguilfoyle:
Hey whats up Firerat? First off, thanks a million for all your work its really great stuff. I have spent hours reading forums. So implementing "read before type" per your request, this will be my first post. It took me a while to implement fr-patch140.txt to run correctly. I usually don't have many questions, but I am really stumped here. I am running cm6, tiny gapps, stock cm6 kernel, 32mb swap ext3, 512 Mb ext, and a fat 32 remainder flashed using amon's recovery 1.6.2. My phone currently shows an internal memory of 331 Mb, only 3 post gapps apps are installed (tether, etc). I also moved dalv cache to sdext. Currently there is nothing important on my phone, so if need be I can erase and re flash. I have already done so several times in the last week. My phone is really running smoothly, I feel as tho there is some sort of swap or something working in the background. My apps and home pages load faster than they did before, not sure why. Anyways on a separate note, my questions:

#1. When I run a df -h it appears as tho I may have too many blocks listed? This is comparing this screen ones others have posted.

#2. running #free, you can see there is no swap...

#3. I can not for the life of me seem to be able to mount and implement a 32mb swap, as you can see from the different commands I have tried. What am I doing wrong here?

#4. Many of the commands you see listed in the terminal file are not working? apkmanager.sh command does work correctly

#5. Is it wise to have dalvik cache running from sd card, does it matter, or would it be faster on phone internal?

#6. What is the point of having 331 Mb of memory on the phone? How can it be utilized or how will it be utilized.

#7. Everytime I reboot, it resets my swappiness back to 60, I always set it to 30 or 40 but who even knows if it is taking effect.

#8. I was running a brainfuct kernel before I started the swap2ext project on my hero, can I run that kernel with this patch?

Any info you can give me will be greatly appreciated. I know you are busy, but when you have a minute. Thanks
[G1 Android Development] Firerat:
swapon: /dev/block/mmcblk0p3: Function not implemented

your kernel doesn't support swap, or at least it doesn't automatically load kernel modules.

This is a fail on the part of the kernel dev

this little script would include all the module dependency map files

make -j4
INSTALL_MOD_PATH=$PWD/../out/system make modules_install
find ../out/system -type l -exec rm {} \;
find ../out/system -name wlan.ko -exec mv {} ../out/system/lib/modules/ \;
find arch/arm/ -name zImage -exec install -D {} ../out/kernel/zImage \;

e.g

ls ../out/system/lib/modules/2.6.34.4-cyanogenmod/
kernel modules.ccwmap modules.isapnpmap modules.symbols
modules.alias modules.dep modules.ofmap modules.symbols.bin
modules.alias.bin modules.dep.bin modules.order modules.usbmap
modules.builtin modules.ieee1394map modules.pcimap
modules.builtin.bin modules.inputmap modules.seriomap

couple that with Koush's AnyKernel ( I've attached the base I use, basically unzip that into the ../out directory , you can then zip and sign the contents of ../out and you have a fully working flashable kernel * )

* well when I say fully working, it won't have its own ramdisk, Koush's AnyKernel uses the currently installed ramdisk

moving on to a2sd and dalvik-cache bind, errm you don't need them since you have plenty of space on data
[G1 Android Development] bagbones:
Hello,

i use your script with a cyanogen nightly builds (219) on my N1 .

All is perfect, but i moved /data/data on sd-ext and some performance issues appears and i'd like to revert, how can i do it ?

Really thanks for your work.
[G1 Android Development] Firerat:
in recovery

mount -a
cp -a /sd-ext/data/* /data/data/
sed s/databind=y/databind=n/ -i /sd-ext/userinit.d/10data2sdext-binds

hmm, maybe I should add an easy undo feature to the datadata bind
[G1 Android Development] bagbones:
thank you :)
[G1 Android Development] sparksco:
2.2 OTA?

Just a quickie question. Would it be very hard to try and port a automatic (Not Stand Alone) apps2ext patch for 2.2 ota? Basically what I'm asking is, would it be very difficult to implement a apps2ext patch for 2.2 ota? I'm not very good at writing scripts from scratch, but it would be nice to see some development on this for the g1.

Edit: Never mind, apparently Cyanogen has already included the source code in the new nightlies for 6.1.0 alpha. So like he said, no need to mess around haha.
[G1 Android Development] karlo1700:
im new at this so i dont understand how to "install" this patch on my phone
[G1 Android Development] sparksco:
maybe you should start by reading the OP first :rolleyes: