[SCRIPT] MySwap v1.0 (SD and NAND) 13/11/2013 - Android Development on Bada

THIS IS A SCRIPT TO HAVE SWAP AND NOT A ROM!
I tested the swap on "CM10.x" by volk204 but there isn't a reason it shouldn't work on other rom versions.
version 1.0 13/11/2013 18:29 GMT+2
I experienced some lag with my wave due to its low ram memory. So after testing a few things i found myself more comfortable with setting up swapfile on sd card(NAND memory); after few minutes this terminal becomes really smooth. (It strangely is faster than setting it up on the phone memory, atleast for me)
The idea is mine, but checking around i found that many other script were made. I got the sleep line to boot part idea from "Defiant07 @ XDA" (http://forum.xda-developers.com/showthread.php?t=2359182). Everything else (as simple it is it's all mine)
Swap is the *nix term for virtual memory, that maybe many are familiar with on windows.
You set up a partition/file and use that as virtual memory. It will be much slower than real ram, but it will be much faster than reloading everything from disk everytime.
Code:
#!/system/bin/sh
# This script was authored by Defiant07 @ XDA. If you use/redistribute it, eve$
# Thanks to zeppelinrox most of all, but also many thanks to dk_zero-cool & gu5$
# Much thanks to pikachu01 @ XDA for permission to use the sysctl tweaks from T$
# Read Karl Marx!
# Nearly entirely modified by skyglow
swapfile="/storage/sdcard0/swapfile"
#swapsize in KB
swapsize=524288
swappiness=90
vfs_cache_pressure=100
dirty_background_ratio=5
dirty_ratio=20
dirty_writeback_centisecs=500
dirty_expire_centisecs=200
while [ ! "`ps | grep -m 1 [a]ndroid`" ]; do sleep 10; done
if [ ! -f "$swapfile" ]; then
dd if=/dev/zero of=$swapfile bs=1024 count=$swapsize
mkswap $swapfile
fi
# sleep 30
# mkswap $swapfile
swapon $swapfile
busybox sysctl -e -w vm.swappiness=$swappiness
busybox sysctl -e -w vm.vfs_cache_pressure=$vfs_cache_pressure
busybox sysctl -e -w vm.dirty_background_ratio=$dirty_background_ratio
busybox sysctl -e -w vm.dirty_ratio=$dirty_ratio
busybox sysctl -e -w vm.dirty_writeback_centisecs=$dirty_writeback_centisecs
busybox sysctl -e -w vm.dirty_expire_centisecs=$dirty_expire_centisecs
exit 0
Requirements
Superuser rights on terminal to change permission and copy this file
Configuration
1) set up "swapfile" field to where you want your swap
2) set up "swapsize" field to an appropriate value in KB! ( i think you should try values over 307200 => 300MB to have performance improvements)
(SD or NAND version)
SD version
size=512 MB
position=sdcard root
NAND version
size=300MB
position=bada application partition
How to install
1) Download the right zip from this page
2) Extract the file from the zip
3) Upload the file in some way on the phone
4) Become superuser
5) move it to "/system/etc/init.d"
6) this file should keep hits name "99myswap"
7) change permissions of "99myswap" to 755
8) change its rights to "root:shell"
9) done, next reboot your swap will be set up automatically
P.S.
How to check if swap is activated:
Open terminal
cat /proc/swaps
Swap filename should be displayed with the right size
[ADDED DEBUG SCRIPT]

Possible problems
1) System hangs on cyanogen loading screen ( rotating circle)
INVESTIGATING
2) Battery charge lasts less.
Any kind of virtual memory use more electrical power to perform write/read on disk (SD). This is a side effect of swap.
3) File format
*NIX file format is LF and not CR-LF (for reference why this happens http://en.wikipedia.org/wiki/Newline#Representations)
You can't edit the file with windows notepad, but use something else such as notepad++ and save it in LF coding.
4) System is slower
Possible causes are:
a) you have applications on the same filesystem where you placed the swap
b) your memory (such as SD card) is too slow. Swap will work, it will just go much slower. Try it with a better sd. I tested it with a class 4 and class 10 sdcard and they both speed up. I don't have any possibility at the moment to test a class 2. (reference http://en.wikipedia.org/wiki/Secure_Digital#Speeds)
5) How to change permissions (thanks Eltjo for copy paste from your answer)
Open terminal
Type: su
Type: cd /system/etc/init.d
Type: chmod 0755 99myswap
Type: chown root:shell 99myswap
6) zRam
On my mobile it's faster if i disable zRam from Settings > Performance > Memory Management > zRam .
Anyway i think outcome may change. Try both solutions.

could be possible to use free nand memory as swap instead of sd card?

cfernr said:
could be possible to use free nand memory as swap instead of sd card?
Click to expand...
Click to collapse
I added the NAND version that installs itself in the bada partition. If you installed the sd version remember to remove the swapfile.

darklight2k2 said:
I added the NAND version that installs itself in the bada partition. If you installed the sd version remember to remove the swapfile.
Click to expand...
Click to collapse
lets try both, thank you very much

no problem.
DEBUG REQUEST
Who had the loading screen on cyanogen circle may tell me which sd card class have?
The following procedure do not install the script, it just will work till reboot.
may them try to upload the script in a generic directory such as /storage/sdcard0 and execute it with
su
cd /storage/sdcard0
sh ./99myswap
I'd like the output of that command and the resulting /proc/swaps
then use the phone, (play/call/charge/reboot)
next boot start the script again please and tell me the resulting /proc/swaps again
Thank you for the help

seems work on my phone.
installed swapfile on nand and ram increased 30mb, but low improvement in real performance.
need to change zram options, but cant find this on my phone, maybe due to language discrepancy. can you explain better?
thank you a lot

I also cannot find zram a options under B.U.X V3.1 (4.3.1 CM10.2) by Tigrouzen

If you don't have the menu for zRam it's disabled by default. To see it you should enable all developer settings.
Settings > About phone > Build number (tap 7 times)
Some more tweaks will unlock.
saltcushy said:
I also cannot find zram a options under B.U.X V3.1 (4.3.1 CM10.2) by Tigrouzen
Click to expand...
Click to collapse
Unfortunally i didn't test that rom yet but i think the procedure above will work.

darklight2k2 said:
If you don't have the menu for zRam it's disabled by default. To see it you should enable all developer settings.
Settings > About phone > Build number (tap 7 times)
Some more tweaks will unlock.
Unfortunally i didn't test that rom yet but i think the procedure above will work.
Click to expand...
Click to collapse
tested and I have to say this is necessary if you want to enjoy a few extra mb in this phone.
I recommend nand swap because everybody have 300-400 unused mb in bada apps partition.
disabling zRAM seems also recommendable.
I hope everybody take care of this script for future ROM releases
*** I will decrease swappiness to 70 or 60, I think it is enough.

darklight2k2 said:
no problem.
DEBUG REQUEST
Who had the loading screen on cyanogen circle may tell me which sd card class have?
The following procedure do not install the script, it just will work till reboot.
may them try to upload the script in a generic directory such as /storage/sdcard0 and execute it with
su
cd /storage/sdcard0
sh ./99myswap
I'd like the output of that command and the resulting /proc/swaps
Thank you for the help
Click to expand...
Click to collapse
i've a samsung class 10 32gb.
i've not run the script with sh command, just copied it to /system/etc/init.d (aplied chmod and chown) and reboot the phone. after that it hangs on CM circle on first boot and have to re-install the rom. wipe data/factory reset didn't help.
best regards

JonasVFC said:
i've a samsung class 10 32gb.
i've not run the script with sh command, just copied it to /system/etc/init.d (aplied chmod and chown) and reboot the phone. after that it hangs on CM circle on first boot and have to re-install the rom. wipe data/factory reset didn't help.
best regards
Click to expand...
Click to collapse
To try to solve it i need to know what happens when executed with the sh command

darklight2k2 said:
To try to solve it i need to know what happens when executed with the sh command
Click to expand...
Click to collapse
after installing the rom again it can boot the first time but hangs on the second like everybody else
running with sh it runs ok

JonasVFC said:
after installing the rom again it can boot the first time but hangs on the second like everybody else
running with sh it runs ok
Click to expand...
Click to collapse
that's why i said not install in the problem request

problem is with chown, just run the chmod 755. didn't run chown command last time and it booted second and third time
edit: nevermind, it hanged again

darklight2k2 said:
that's why i said not install in the problem request
Click to expand...
Click to collapse
i did it with 2 different ways....with a fresh install between and both hang

JonasVFC said:
i did it with 2 different ways....with a fresh install between and both hang
Click to expand...
Click to collapse
You're just posting and posting what happens but not what i asked you to do to five me information.

darklight2k2 said:
You're just posting and posting what happens but not what i asked you to do to five me information.
Click to expand...
Click to collapse
i did what you asked, read again, i ran it with sh: it runs fine!! creates the swapfile and outputs some parameters that are in the script like swapiness and others....

JonasVFC said:
i did what you asked, read again, i ran it with sh: it runs fine!! creates the swapfile and outputs some parameters that are in the script like swapiness and others....
Click to expand...
Click to collapse
Hi, @JonasVFC.
I understand you've been running the Swap version of Android v2.1 Volk204. How do you get it?.
Yo, if I install the file in the directory 99myswap indicating the first page, but I get that the system does not start, stays on constantly CM logo.
A greeting.

chapito said:
Hi, @JonasVFC.
I understand you've been running the Swap version of Android v2.1 Volk204. How do you get it?.
Yo, if I install the file in the directory 99myswap indicating the first page, but I get that the system does not start, stays on constantly CM logo.
A greeting.
Click to expand...
Click to collapse
May you guys try the following attached file please?
when it hangs may you post the logfile created in the phone directory ( you can get it from bada)

Related

[Howto] App2sd Step by Step

This new Turial is not from me credits go to tot31
I'm writing the how to my own way, hope this will more helpful..
How To : App2sd on Xperia X10i mini
Pre Installation.
I'm assuming that you have just fresh install 2.1/1.6 firmware and root your phone before you start the procedure. This is how I did with my phone.
1. Reinstall 2.1 firmware by using Sony Ericsson Update Service.
2. Root the phone by using SuperOneClick ( http://d01.megashares.com/dl/1xcuTic/Super...4-ShortFuse.zip ). More info on SuperOneClick, go here -> http://forum.xda-developers.com/showthread.php?t=803682
Note : Please disable any anti virus especially Kaspersky as it will give false virus alarm and will delete one of the file.
Step 1 : Preparing your micro SD Card.
Please refer to this link ( http://forum.xda-developers.com/wiki/index...rd_partitioning ) on how to prepare your micro sd card. For better performance I would advise that you use a Class 10 card instead of the original card that comes with the phone because the card is only Class 2 card. For more infomation on speed class rating of sd card please go here -> http://en.wikipedia.org/wiki/Secure_Digital
An excerpt taken from wikipedia :-
The following are the ratings of some currently available cards:
* Class 0 - These cards do not specify performance, which includes all legacy cards prior to class specifications.
* Class 2 - Minimum of 2 MB/s performance. Lowest speed for SDHC cards.
* Class 4 - Minimum of 4 MB/s performance.
* Class 6 - Minimum of 6 MB/s performance.
* Class 10 - Minimum of 10 MB/s performance.
Note : The recommended maximum size of ext2 partition is 1.4GB. I've tried 3GB before and ended up with unstable system and eventually crash the phone. So if you're really greedy since you've bought a 16GB or 32GB card to partition the ext2 more than the recommended size and if your phone is unstable, you've been warn.
Step 2 : Download the related files.
1. App2sd : see attachment
2. adb shell : see attachment
Step 3 : Enabling USB Debugging mode on you phone.
Go to Settings -> Applications -> Development -> USB Debugging (check this option).
Step 4 : Installing App2sd.
Create a folder name adb in your pc and extract all the files from adb.zip into this folder.
Connect your phone to your pc and mount the sd card. Extract all the file from app2sd2.1.zip to the root of your sd card. Make sure to unmount the sd card before continue the next step.
In your pc open up a dos terminal box by typing cmd in the Search programs and files box.
Type
cd /adb
then type
adb shell
then type
sh /sdcard/app2sd.sh
you'll be presented by this screen...
+________________________________+
|********************************|
|*Welcome To wolfilein's App2sd *|
|*installing script *|
|********************************|
+--------------------------------+
~this version should be go on any device ~
+___________________+
|********************|
|* Menu *|
|* *|
|*[0] install app2sd*|
|*[1] remove app2sd *|
|*[2] exit *|
|********************|
+--------------------+
[0]
now just press the enter key & wait.
Important : Make sure to set your phone screen timeout to the max because Superuser will ask for your permission to allow this script to run. If your screen goes blank, you can't see this prompt and the installation will fail.
after a while you'll get this..
busybox is /system/bin/busybox
rm failed for /etc/mount_sd.sh, No such file or directory
+________________________________+
|********************************|
| finished going reboot now |
|********************************|
+--------------------------------+
Don't worry, actually it does not fail. I also got the same message and I also thought it failed but when install all the apps and check using Minitool Partition Wizard and Linux Reader for windows, all my applications are installed into my card (see my previous post with screenshot).
The Explanation
If you look through the app2sd.sh script, command rm /etc/mount_sd.sh means remove/delete the mount_sd.sh file from /etc folder, since that file does not exist in the fresh install phone, it gives this error message but continue with other commands..
rm /etc/mount_sd.sh
mv /system/bin/sh /system/bin/sh_bak
cat /sdcard/sh.sh > /system/bin/sh
chmod 777 /system/bin/sh
busybox cp /sdcard/mount_sd.sh /etc/mount_sd.sh
echo "
+________________________________+
|********************************|
| finished going reboot now |
|********************************|
+--------------------------------+
"
sleep 1
reboot
Finally after a reboot, your phone is ready with app2sd. From now on when you install any applications it will save into your sd card.
Disclaimer : Do this at your own risk. I will not responsible if any injuries or damage occur to you or your phone
wolfilein said:
/!\Warning this is for testing only/!\
¯¯ ¯¯
here is the script that "should work on the x10 minni"
i hadn't one so i can't say if it works
install is verry easy just
first make a second ext2 fomratted patition on the sdcard
extract the zip in the root of your sd-card
open an adb shell
and type in
sh /sdcard/app2sd.sh
then press just enter and app2sd will be installed
yout phone will reboot and then say me if it give errors
wolfilein
Click to expand...
Click to collapse
it says the folder do not exist
when said it this??
does the actually work?
i have an idea
can anyone of you guys ceck out wat habens if you add a bootscript to
/system/drm/DxDrm/init_drm.rc
/system/etc/hw_config.sh
anyone check this please
just a question.... do it "should work on the x10 minni PRO" ?? ( device with phisycal qwerty) ?
Sorry for my bad english !!
init.rc
what if i enter contents of drm.sh to init.rc?
check please this out!!
in the init.rc it seems the pregram must be a service
wolfilein said:
i have an idea
can anyone of you guys ceck out wat habens if you add a bootscript to
/system/drm/DxDrm/init_drm.rc
/system/etc/hw_config.sh
anyone check this please
Click to expand...
Click to collapse
init.rc
i'm not comfy editing init.rc.
I'm gonna try Autostart application from market first.
are you ignoring me ??
and you the autostartapp can't start before it's loaded on boot that means that you must first load the apps
hwconfig.sh
there is no hwconfig.sh in etc folder.
2 thing create one
and check if it excuted
and
check this file
/system/drm/DxDrm/init_drm.rc
wolfilein said:
2 thing create one
and check if it excuted
and
check this file
/system/drm/DxDrm/init_drm.rc
Click to expand...
Click to collapse
added code to init_drm.rc
did not work.
trying hw_config.sh
i will try to edit the init.rc
if i succes i will say it
no luck with hw_config.sh
so ive edit my script and i will upload it now on both
x10 an x10 minni this script should work on every android phone
so now your script is good also for x10 mini pro ??
simple way apps2sd
First, you have to make two partitions on your sdcard - Fat32 and ext2 (ext3)
Second, Mount ext2(ext3) on your device
Third, ln -s /system/app/xxx.apk \sdcard\ ext partition\ way you want\xxx.apk
Caution - never try to remove sdcard after this operation - very dangerious for the health of your device.
your way is not so good
and yes it !should! work now buti cannot test it
garbage
MasterKira said:
so now your script is good also for x10 mini pro ??
Click to expand...
Click to collapse
not really, this time it froze my phone on bootup at the SE logo.
I fear i might have to reflash n lose all my settings!

[PRJ] [DATA2SD] Flashable zips for converting any Rom to Data2SD, For N1

Updated April 7th, 2011
All credit to sibere and droidzone and other devs who've developed the Data2SD codes.
Before you do anything with your phone, Pls nanodroid fisrt!!! And flash your phone at YOUR OWN RISK
It's been a while since this post last updated.
In fact, developers of HTC Desire have already create a stable method to implement Data2sd or whatever you call it, which gives you full use of EXT space to install APPs while improving I/O speed at the same time.
The theory is explained here, in case you want to take a further look at it
[DEV][DATA2SD] More space (and more I/O) for your Desire (Updated/EXT4/Flashable ZIP)
And thanks to sibere and droidzone 's great work, now we could make any ROM we like run with Data2sd. here they provide us Flashable ZIP files to make it done
[DATA2SD] Flashable zips for converting any Rom to Data2SD
Updated Instructions and Zips (14/Mar/2011)
I've streamlined the installation procedure so as to make it more generic and compatible with the newer StarBurst zips.
Basic Installation Steps for Data2SD
1. Install your ROM
2. Install the A2SD Killer (specific for your ROM)
3. Next step differs depending on whether you're reflashing your Rom on an existing install, or whether you are installing for the first time.
If you're installing the ROM for the first time:
· Reboot once after running the A2SD Killer
· Setup the timezone, language etc (But not your Google Account/Market)
·Reboot to recovery once again and install the Data2SD Installer
If you're reflashing the ROM (after having installed Data2SD once previously)
·Do not reboot after running the A2SD Killer
·Install the Data2SD Re-Installer right away
·Now reboot.
Click to expand...
Click to collapse
Download Link:
http://hotfile.com/dl/110226722/85a18a8/Data2SDv11.zip.html
http://www.easy-share.com/1914241904/Data2SDv11.zip
Important Notes from droidzone
Fully supports Cyanogen
Fully supports Clockworkmod3.0+ (Edified)
I wanted to consolidate all the flashable zips for Data2SD into one place, so that I will find it easy to update the links as I modify the scripts, and to also help Sibere to point his link to this post from OP, so that he doesnt need to reupload each file as they are modified.
Once again, I must assert that Data2SD is totally Sibere's work with other devs who've developed Data2SD code of their own. In my opinion, however, this is the best!
My contribution is conversion of his excellent code into flashable scripts which may be installed via Recovery. So you dont have to type out the code.
The flashable zip is packed as a package of zip files. Each zip file within the package is seperate flashable zip
There are the following files:
Killer, Installer and Reinstaller files for Sense Roms
A2SDKillerV11_Sense.zip
Data2SDInstallerv1.3_Sense.zip
Data2SDReInstallerv1.3_Sense.zip
Installer and Reinstaller files for AOSP Gingerbread Roms and CM7 nightlies (excluding Cyanogen 6 and MIUI 2.2 , but including Cyanogen 7 nightlies and MIUI 2.3.3 )
A2SDKillerV11_GB.zip
Data2SDInstallerv1.3_GB.zip
Data2SDReInstaller1.3_GB.zip
Installer and Reinstaller files for Cyanogen 6 and MIUI 2.2 (Not for CM7 nightlies or MIUI 2.3.3), which are Older Version
A2SDKillerV9.zip
Data2SDInstaller_cyanogen.zip
data2sd-Reinstall_cyanogen.zip
Whether you are trying this method for Sense or AOSP Roms, the installation procedure is same. Only the file is different.
Click to expand...
Click to collapse
Following droidzone's instruction, I tried these flashable ZIPs with MIUI 1.4.1(Gingerbread 2.3.3)
A2SDKillerV11_GB.zip
Data2SDInstallerv1.3_GB.zip
And it's working just fine. No random reboots, no data or APP lost or system crash after reboot. It's stable and fast!
One more note, you can ignore the previous information below...
————————————————————————————————————————————————————————————————————
updata from
melethron's post, and his update package data2whatever.zip included.
you can buy melethron a beer if you want. All credits to melethron!
I test the script with new install MIUI N1 12.24,
so far no reboot issues, or data corruption.
[DATA2whatever] Flashable All-in-one-Solution for Data2sd (HUGE update (dec 23th))
data2whatever v0.2
Features:
- Supports: Ext2, Ext3, Ext4 (and if kernel supports it: ) btrfs, ReiserFS
- Supports loop device as optional addon (as siberes data2sd)
- Flashable zip for many app2sd ROMs (no long setup required)
- It does a e2fsck (disk check) on every boot and creates a logfile on the sdcard (/sdcard/e2fscklog.txt)
- looks nice if you do a logcat on boot
- no "settings lost on reboot" bug like in my old or siberes script
- changes the scheduler for the sd-card and internal to noop for better performance on sd.
- Nandroid Backup of EXT2/3/4 external with AmonRa 2.0.0.1 or any clockwork recovery.
- Removes the common app2sd scripts on its own
Requirements
- A second partition (same as app2sd - Min 512 mb - 1024mb is highly recommended - max 2048 MB or there will be issues with market) in any format (as long as the kernel supports - ext2/3/4 support is default in most kernels - Ext4 or ReiserFS is recommended).
- An app2sd or non app2sd ROM (data2sd versions wont work) (this SHOULD work with most or at least many ROMs . Roms that are confirmed to work can be found in the post below. Please report to me it it works or not so i can update this thread. If it doesn't work i try to make it compatible asap. )
Installation
1.) Full wipe (at least needed on first installation)
2.) Flash the app2sd Version of the ROM of your choice
3.) DONT REBOOT
4.) If you rebooted then start over at 1.)
5.) flash the attached "data2whatever.zip"
6.) now reboot
ADDITIONAL INFO: Even without "life on the edge" you should watch the first 4 "don't"s of "life on the edge". The normal script use the same disk safety methods as NTFS on Windows or EXT4 on linux. But as you know you shouldnt just switch off the computer because there can still be issues in very rare cases. Reboots with tools like "snqs power menu" is the same as a batterypull (or pulling the ac plug on PC) and this isn't good in general (and this also applies for using it with app2sd). If you want to go to recovery just make a normal shutdown and switch the phone on with "volume down" button pressed.
Optional life-on-the-edge add on
you can find this add on in melethron's original post, and try it on your own risk
This patch has the same effect as sibere's and ownhere's script (loop device - the way ownhere does in v4 doesnt work though). Other than those scripts it this addon doesnt need any repartitioning or other setup (like FAT or a third partition) and can simply be installed or removed with a flashable zip. All you need for this is a normal ext 2/3/4 partition (as above ^^). Ext4 is recommended for this (as above) since it is the fastest of those 3. This patch is more risky than normal ext3/4 considering the possibility of data loss. If you want to use this add-on you should watch the following (this also applys to ownheres and sibere script and is NOT more risky than their scripts):
- DON'T use the reboot of snq's powermenu (or any other reboot app)
- DON'T use anything in the "ROM Manager" that makes it reboot.
- DON'T do adb reboot / abd reboot recovery / adb reboot bootloader
- DON'T pull the battery while the phone is on (this should be obvious)
- DON'T remove the "sync" mount options for the Quadrant "boost" (this is a fake boost anyway)
All of this is like a powerloss for the sd-card and has a high change of data corruption.
From my test with this i give you an estimate what can happen if a powerloss occurs or any of the 5 points above happen:
- 50% general chance of corruption that will be autofixed on boot (not a problem)
- 10% chance of forcecloses after reboot of some apps (this can be fixed by deleting the app data or restoring it with titanium (or other) backup)
- REALLY tiny chance (didnt happen for me in over 40 "simulated" powerlosses) that partition gets corrupted (needs complete repartitioning of the microSD so all data on it will be gone then)
As long as you watch the 5 points above and as long as you don't drop the phone and the battery jumps out this will be safe.
Installation of the addon:
- Flash the "life-on-the-edge.zip" any time after you installed "data2whatever".
Installation of the addon:
- Flash the "life-on-the-edge-UNPATCH.zip" any time after you installed "data2whatever" and the addon. (this will revert back to the normal script)
Personal remark: While this is a improvement over normal ext4 it is not the "holy-grale" of a data2sd lag fix. I'm not using this myself and use a ReiserFS as second partition instead which is more safe and completly feels the same as a "loop" device considering performance.
--------------------------------------------------------------------------------
__________________________________________________________________________________
Dec14 info update:
I uploaded A mod script for CM6.1 stable by Carrol
Carrol changes the script to create a ext4 loop device on EXT4 partition.
Code:
$BUSYBOX mkdir /mnt/asec/extdata
if [ ! -e /data/data2sd.ext.finish ];
then
echo "+++Need create ext4 loopback device for data, please wait... this is 1/5 size of your ext partition"
extsize=`$BUSYBOX df /dev/block/mmcblk0p2|$BUSYBOX grep mmcblk0p2|$BUSYBOX awk '{print $2}'`
datasize=`$BUSYBOX expr $extsize / 5 / 1024`
$BUSYBOX dd if=/dev/zero of=/data/ext4 bs=1048576 count=$datasize
/system/xbin/mkfs.ext4 -b 4096 -m 0 -F -L userdata /data/ext4
/system/bin/tune2fs -o journal_data_writeback /data/ext4
/system/bin/e2fsck /data/ext4
#/system/bin/tune2fs -O ^has_journal /data/ext4
#$BUSYBOX mount -o loop,errors=continue,noatime,nodiratime,nosuid,nodev /data/ext4 /mnt/asec/extdata
$BUSYBOX mount -o loop,barrier=0,nobh,nouser_xattr,errors=continue,noatime,nodiratime,nosuid,nodev /data/ext4 /mnt/asec/extdata
$BUSYBOX chown 1000.1000 /mnt/asec/extdata
$BUSYBOX chmod 771 /mnt/asec/extdata
$BUSYBOX cp -a /data/data /mnt/asec/extdata/
sleep 1
$BUSYBOX umount /mnt/asec/extdata
sleep 1
$BUSYBOX touch /data/data2sd.ext.finish
fi
/system/bin/e2fsck -y -v -f /data/ext4
#$BUSYBOX mount -o loop,sync,errors=continue,noatime,nodiratime,nosuid,nodev /data/ext4 /mnt/asec/extdata
#$BUSYBOX mount -o loop,errors=continue,noatime,nodiratime,nosuid,nodev /data/ext4 /mnt/asec/extdata
$BUSYBOX mount -o loop,barrier=0,nobh,nouser_xattr,errors=continue,noatime,nodiratime,nosuid,nodev /data/ext4 /mnt/asec/extdata
$BUSYBOX chown 1000.1000 /mnt/asec/extdata
$BUSYBOX chmod 771 /mnt/asec/extdata
Note that this script is for CM6.1 stable only, only ONE EXT partition needed on your SDCard, and it will be formated into EXT4, do nanodroid before you try
Also a CM6.1 ROM with Data2Ext by Carrol can be found here
CM6.1 ROM with Data2Ext by Carrol
download: http://rom.anshouji.com/htc/N1/bbs.anshouji.com-N1-data2sd-20101213.zip
________________________________________________________
ownhere Data2Ext script V4
Data2ExtV4
2010/12/12 update V4 script:
/data/:ext4, disable journaling
/data/data:ext4 loopfile on ext4 device, enable journaling on ext4 device, disable journaling on ext4 loopfile, for fast and stable sqlite3 access.
really smooth this time
Click to expand...
Click to collapse
There's a version for Desire, which is here [DATA2EXT] [11/Dec] FULL BENCHMARK, V4, Improve the efficiency of IO
While improving IO efficiency, it moves all userdata to EXT so to avoid insufficient ROM space, cos the whole EXT is recognized as the internal ROM.
with ownhere's v4 script, I got my miui rom working, no data lost or crash after reboot/battery-removed:
1. miui rom 12.03 clean installation(a2sd+ script removed), then flash update.zip of v4 script. working. applying 12.03 to 12.10 and 12.10 to 12.11 ota packages, working.
2. miui rom 12.11 clean installation, flash v4 update.zip, working.
3. miui rom 12.11 with a2sd+ running, 38 apps installed and /data/data moved to ext. The v4 update.zip can still do the job.
However, one problem is that Root explorer couldnot display Chinese filenames of APK , showing only ???. and if install those apks via root explorer, it just reports errors...
Another thing i am not sure of is not knowing how much v4 script could improve when there is only 1 ext partition. According to ownhere, 2 ext partitions are needed to make the best out of his v4 script...
I attached the v4 updtae.zip - Data2ext_update.zip ,in case you might wanna try:
1. BEFORE you try this package, you need to remove the app2ext script(file like 04apps2sd or 01 apps2sd) from /system/etc/init.d, or you would only get bootloop going on and on
2. And of course, Nanodroid...
3. disable signature checking in recovery...
______________________________________________________________________________________________
I tried merging those files into MIUI N1 ROM.
When N1 boots for the 1st time, everything's working just fine.
Now we know the previous script is faking the Quadrant score...
Quadrant bechmark really rocks with I/O scoring 8000+ and a total score @ 3000+
But after reboot, there came some issues:
System config could not be saved;
Home button wouldn't work;
Flight mode and Quiet mode missing in the reboot menu...
Could someone pls help to rewrite the script to fit in N1 ROM?
I think people using N1 would interested in such a script or rom that brings N1 more I/O performance and more space for Apps.
But I have no knowledge of coding, don't know how to fix the issues above.
So I add download link of the script CREATED by ownhere, not by me, hoping someone could make a N1 MOD...
data2ext.zip
data2ext.zip is not a flashable package
Thanks!
mattrb said:
This goes in Q and A.
Also the answer is darktremor. A simple search of the the Nexus One Android Development gets that answer.
Click to expand...
Click to collapse
Sorry, but I don't think Darktremor Apps2SD script could do the job.
Since there is difference between Apps2SD and Data2Ext:
Apps2SD moves
/data/app, /data/app-private and /data/dalvik-cache to EXT
And with some commands /data/data could also be moved to EXT
But Data2Ext moves
/data/app to EXT4
/data/data to a virtual EXT2 device on EXT4, which is the trick to improve IO efficiency working at peak level...
SO I don't know if there is a answer fort this in Q&A...
this comes up after searching
G1 data2sd instruction works for the N1 i suppose ?
http://forum.xda-developers.com/showthread.php?t=527636&highlight=app2sd
**There is NO booting into recovery and wiping of the phone!**
My bad for not being clear on the wipe instructions!
1) (optional) If you are to wipe it (your choice it is not required), then press menu->settings->SD card & phone storage->scroll to bottom of screen and select "Factory data reset". This will wipe the /data partition only removing all apps and settings. BACKUP YOUR /data dir to sd, First or you will need to down load all your apps again to include paid apps!!
2) place data2sd.img in root of SDcard (fat32)
3) terminal in or adb shell in.
4) cp /sdcard/data2sd.sh to /data/local/bin - to copy the script to your user-space
5) chmod 0750 /data/local/bin/data2sd.sh - to make it executable
6) /data/local/bin/data2sd.sh or data2sd.sh may work to run the script
7) once the install is done it should tell you to reboot. If you had the ddms debugger running, you can observer the log as it is working.
8) done. It may boot a little longer if you clean-slate installed and then restored your apps by copying them back into /data/app and /data/app-private which has the affect of reinstalling everything, and thus the boot will take a while if you have alot of apps like I do. Again you can observe this as the Android boots if you have the debugger running.
Click to expand...
Click to collapse
I'm also confused, how does darktremor move all of that to ext? Please explain. I thought darktremor moves apps to ext. If you fail, then you sir are an idiot and gtfo.
A "simple" reread (If that's even enough, maybe 100x more for you) would've told you want he wanted.
Sorry for invading your post jayfallen!!
I for one, am glad you posted this and would like to try it once you get it going.
Try this: http://forum.xda-developers.com/showthread.php?t=853001
I recommend only moving the data of non-essential apps and those apps which DO NOT contain security sensitive data (games, Google Earth, etc. should be fine).
I edited the thread title, and added download link of the script created by ownhere.
someone might wanna take a look, if you're interested in bring your N1 more I/O performance and more space for Apps.
Thanks for everyone replying this thread. I will try your suggestions.
eVil's hd rom~
it's not work on the evil's hd sense?i try that last night~ but it's very hard!!!
i m abt to try this
http://www.miui.com/thread-10723-1-1.html?extra=page=1
wish me luck
the thread @ miui.com was posted by me earlier...
that rom is just experimental, if you don't reboot, everything works fine.
once rebooted, config lost and homebutton lost...
I don't know how to fix, that's why I start this thread @ xda, hoping someone could make it work for N1...
Wow this I want
Not sure if this can help..
Found a post on HiAPK (a Chinese Android discussion forum)
here's the link to the post:
http://www.hiapk.com/bbs/viewthread.php?tid=717815&extra=page=1&filter=type&typeid=211
And here's the link to the ROM:
http://rom.anshouji.com/htc/N1/bbs.anshouji.com-N1-data2sd-20101208.zip
The rom is said to be based on Cyanogen Mod 6.1 Stable, with data2EXT enabled by default.
The attached screenshot comes from a user of the data2Ext rom, note that the internal storage has 0.9GB left.
luciefer said:
it's not work on the evil's hd sense?i try that last night~ but it's very hard!!!
Click to expand...
Click to collapse
That because the current script will only move system/app to ext. There is nothing else in there to tell it to move any other folder, thus failing.
there's been new development...
as houzuoguo mentioned, a CM6.1stable+data2ext mod ROM is out, but there're still some issues
ownhere update his script to V3
http://forum.xda-developers.com/showthread.php?t=859419
1.change loopback device to real partition for powersave and better write performance.
2.disable second partition's journaling.
3.You need 3rd partition for /data/data. But even without the third partition of this script can also work(not stable). My partition settings:second partition:1.5G, thrid partition:0.5G
meanwhile, another new approach is coming out:
http://forum.xda-developers.com/showthread.php?t=868102
NILFS2 - data2nilf2 will be much faster then data2ext and won't have Lags.
whoa
i m glad there are so many new development out everyday
feel so good knowing the n1 is not being left behind
speaking of this is pretty freaking awesome
houzuoguo said:
Not sure if this can help..
Found a post on HiAPK (a Chinese Android discussion forum)
here's the link to the post:
http://www.hiapk.com/bbs/viewthread.php?tid=717815&extra=page=1&filter=type&typeid=211
And here's the link to the ROM:
http://rom.anshouji.com/htc/N1/bbs.anshouji.com-N1-data2sd-20101208.zip
The rom is said to be based on Cyanogen Mod 6.1 Stable, with data2EXT enabled by default.
The attached screenshot comes from a user of the data2Ext rom, note that the internal storage has 0.9GB left.
Click to expand...
Click to collapse
...
That is a huge improvement in IO!
Lets hope this reaches a stable state soon
I wonder why quadrant weighs so much on disk IO for the total score.
Would this be possible on other devices? lets say the g2?
Would someone mind explaining what tangible improvements this makes? Obviously there is an impressive boost in Quadrant scores, but I'm unsure what difference it makes to the actual operation of the device.
bcpk said:
Would someone mind explaining what tangible improvements this makes? Obviously there is an impressive boost in Quadrant scores, but I'm unsure what difference it makes to the actual operation of the device.
Click to expand...
Click to collapse
App2sd u get 512mb for ext3.
Data2ext u get at least 2gb for apps and stuff
Lol. Are u serious. For io scores it cheats. See the script. Fake ext2 for quadrant
truth to be told,they say TTL 2000+ and IO 3000 is the actual scroe...

[HowTo] Archos gen8 firmware 2.3.81-2.4.83+rw iptables and 1GB ext4 data

I just wanted my Archos Gen8 to have the latest stock firmware, root access, iptables support (for Droidwall) and a 1GB ext4 data partition. I will show you how to create this setup yourself. This howto describes all steps for a Linux PC with a working adb connection to the Archos Gen8. I am sure all steps can be done from a Windows PC too, but I cannot help you there: I only speak linux. [edit: Harfainx has written a thread on http://forum.archosfans.com/viewtopic.php?f=76&t=54637 that explains how to do these steps on windows; if you to do this from windows and have iptables and ext4, use my attached kernel and ext4 modifications instead of Harfainx' suggested chulri kernel]
[Archos] = do on tablet
[Linux] = do on PC
[Shell] = do in a terminal on PC
[ADB] = do in a adb shell from PC
[GParted] = do in gparted in PC
[Editor] = do in your favorite text editor on PC
All credits for this procedure go to other people (see end of this post); my only contribution is this write up, and the compilation of the new kernel.
1. Use chulri's root method to obtain root+rw with the latest Archos firmware on your Archos Gen8 (download the proper firmware version, and take care to rename the downloaded firmware file to firmware_archos_android_gen8.aos).
2. Install the matching version of my kernel + initramfs (see links below)
reboot Archos device and hold down "Vol-" button after screen went black
Go to "Recovery Menu" and then "Developer Edition Menu"
choose "Flash Kernel and Initramfs"
connect your Archos device by USB to your computer
upload zImage and initramfs.cpio.gz to your device
safely disconnect the USB connection
press ok on Archos device
reboot
3. Repartition your internal SD card
reboot Archos device and hold down "Vol-" button after screen went black
Go to "Recovery Menu" and then "Repair system” ->"Start USB MSC"
Connect tablet to your linux pc
Resize interal SD card and add an ext4 partition:
[Shell] sudo gparted
[GParted] find Archos device. For me it is found on /dev/sdc
[GParted] select the Archos partition and resize to have 1024MiB at the end left
[GParted] create a new primary partion using all the space you just created, filesystem ext4 and align to MiB
[GParted] apply all selected actions, let it finish and quit gparted.
unplug and reconnect your device so Linux finds it again.
Format the ext4 partition with some nice settings (if your device was on /dev/sdb replace /dev/sdc2 with /dev/sdb2 below):
[Shell] sudo mkfs.ext4 -b 4096 -E stride=64,stripe-width=64 -O extent,^huge_file -m 0 -L data /dev/sdc2
[Shell] sudo tune2fs -c -1 -i 0 -m 1 -O ^huge_file -o journal_data_writeback /dev/sdc2
[Shell] sudo e2fsck /dev/sdc2
press ok on Archos device
reboot
4. Make your new ext4 partition your /data partition
Boot up your Archos and proceed through the startup wizard; do not put too much effort in this because all information you enter now will be lost after this step.
Open options->applications and enable debugging support.
Connect the Archos to your linux PC
[Shell] adb shell
[ADB] su; stop; cp /init.rc /sdcard/
[Shell] adb pull /sdcard/init.rc
Modify init.rc:
[Editor] Open the just downloaded init.rc
[Editor] Replace the "mount ext3 /dev/block/mmcblk0p4 /data noatime nosuid" with "mount ext4 /dev/block/mmcblk1p2 /data rw noatime nosuid nodev barrier=0 data=writeback nobh"
[Editor] save file and close
[Shell] adb push init.rc /sdcard/
[ADB] cp /sdcard/init.rc /init.rc
[ADB] start
reboot
5. Now your device should start up and use your new ext4 partition as /data. In my case after reboot I had to force another reboot (hold on/off for 10sec) for the system to properly boot and come up with the Archos startup wizard again (the previous startup’s data is lost because we have a new /data partition).
6. Enjoy!
All credits for this procedure go to other people; my only contribution is this write up, and the compilation of the new kernel.
Rooting method: chulri
1GB data partition: chulri and wdl1908
Ext4 format flags: Sibere
Proper compilation of iptables and ext4: $aur0n and woti23
Howto compile the kernel yourself
Compiling this kernel yourself is not very hard.
1. Set-up chulri's development enviroment
2. Configure the new kernel
[Shell] cd $ARCHOS
[Shell] make kernel-config
[Config] In Networking support -> Networking options -> Network packet filtering framework (Netfilter)
Core Netfilter Configuration -> Netfilter Xtables support: y; Xtables -> "owner" match support: y
IP: Netfilter Configuration -> IP tables support: y; Packet filtering: y; REJECT target support: y; LOG target support: y
[Config] In Filesystems
The Extended 4 (ext4) filesystem: y
Ext4 extended attributes: y
[Config] save changes and exit
[Shell] make kernel-build
After compilation, locate your kernel zImage and flash it together with chulri's initramfs.cpio.gz (which is also provided in the zip in the first post).
Recommendations to speed up your tablet
Now that you have your Archos Gen8 as you want it, I can recommend two additions to speed up your system.
1. You now have a fast, big ext4 data partition which you should use for all applications:
[Shell] adb shell pm setInstallLocation 1
2. Replace the default Launcher *ANY* launcher but the Archos one. Personally I recommend the Zeam launcher, since it is really lightweight:
Get your copy of zeam, install it, press "home" button and make it default to zeam.
[ADB] su; cd /system/app; mv Launcher2.apk Launcher2.apknot
The last step makes sure that the Archos launcher does not startup anymore, saving your memory. The last steps also removes the default Archos wallpapers, so make a copy of the one you want or get some nice new ones.
Since the device setup of this thread uses unionfs to make changes to the /system, you could also just remove /system/app/Launcher2.apk. To restore it you can remove /mnt/system/unionfs/system/app/.wh.Launcher2.apk. (Thanks to skeeterfood for pointing it out.)
Great work! Thumbs up!
Thanks for this awesome tutorial!!!!!!
Thanks to all the people who work on our Archos Gen8 devices!!!!
is the performance comperable to urukdroid? i really like urukdroid but the mediascanner issue drive me nuts .
Anyway great work and thanks for the tutorial, now a kernel to be able to overclock and it would be awesome
cHarOn99 said:
is the performance comperable to urukdroid? i really like urukdroid but the mediascanner issue drive me nuts .
Anyway great work and thanks for the tutorial, now a kernel to be able to overclock and it would be awesome
Click to expand...
Click to collapse
I don't know if performance is comparable to UrukDroid; I've used Uruk 1.0 for some months but I haven't run any benchmarks. The reason for that is that Quadrant keeps giving errors in fixed landscape mode and I always used fixed landscape because the stock Archos launcher takes for ever to redraw on screen rotation.
Now of course I replaced the Archos launcher with Zeam, and now redraws on screen rotation are very fast. Replacing the Archos launcher in UrukDroid with Zeam would of course give you the same improvement. Anyway, with the configuration described above @800MHz (I could set it at 1GHz but I didn't) I get Quadrant scores of 1810. If you run it on UrukDroid, we can compare.
Definitely my system is booting much faster now than than it did before, but that might just be Zeam.
Right now sibere is making kernels for UrukDroid which give a nice performace improvement; perhaps he is willing to make kernels for stock too, or help me a bit along? Also when I have some more time, I hope to port some of Ardatdat's kernel improvements to the latest firmware kernel. Maybe someone else is working on that already?
WhoDunnit said:
I don't know if performance is comparable to UrukDroid; I've used Uruk 1.0 for some months but I haven't run any benchmarks. The reason for that is that Quadrant keeps giving errors in fixed landscape mode and I always used fixed landscape because the stock Archos launcher takes for ever to redraw on screen rotation.
Now of course I replaced the Archos launcher with Zeam, and now redraws on screen rotation are very fast. Replacing the Archos launcher in UrukDroid with Zeam would of course give you the same improvement. Anyway, with the configuration described above @800MHz (I could set it at 1GHz but I didn't) I get Quadrant scores of 1810. If you run it on UrukDroid, we can compare.
Definitely my system is booting much faster now than than it did before, but that might just be Zeam.
Right now sibere is making kernels for UrukDroid which give a nice performace improvement; perhaps he is willing to make kernels for stock too, or help me a bit along? Also when I have some more time, I hope to port some of Ardatdat's kernel improvements to the latest firmware kernel. Maybe someone else is working on that already?
Click to expand...
Click to collapse
I agree with you, Zeam is the best Launcher for Archos . When installing UrukDroid, my Archos is longer battery life, LCD is more sensitive and it very fast . Another devices, when you increase speed of cpu, battery life is softer .
I don't think Uruk firmware had been cooked with stock kernel, stock kernel's not stability.
thanks for the reply, personally i don't care about quadrant which is the worst benchmark at all , you already answered the question good enough for me, you said booting is faster and general the feel is fast, thats for me a better benchmark result then any syntetic test which gives you results like in the lottery .
I use Golauncher on the A43 and it works also good, i never used the stock launcher .
I think i will try your solution out and look forward to some kernel improvements if you make one, if not then also fine.
Thanks again
i prefer VTL.Launcher. it is based on adw, but better configurable. i remove ALL soft buttons, all panels and the notificationbar. instead i use Button Savior to have HOME/BACK/SEARCH/MENU buttons.
runs pretty smooth and i can use fullscreen.
any launcher goes
Right, that's the beauty of android: Anything can be replaced and modified to your own taste. I modified my recommendations above about replacing the default launcher with Zeam: *ANY* launcher is better that the Archos default one. My only reason for recommending Zeam is because it is lightweight.
Bottom line: replace the launcher with any alternative and you will have a smoother system.
I love open source and, of course, linux(android) and the power of freedom it has. i hope it will never become mainstream as Windows or Mac is.
Thats the reason why i donate as much as i can to oss projects instead buying expensive Windows software.
And thats why i have big respect to all people who made our computerworld a little bit better to use! Call me a idealist, i am proud to be one! If we were no idealists things like Android wouldn´t exist.
OK, enough
back to topic!
WhoDunnit said:
Now that you have your Archos Gen8 as you [*] [ADB] su; cd /system/app; mv Launcher2.apk Launcher2.apknot
[/LIST]
Click to expand...
Click to collapse
Might as well just do:
[ADB] su; cd /system/app; rm Launcher2.apk
since it's really not deleting the file, but instead creating a .wh.Launcher2.apk file in /mnt/system/unionfs/system/app/ that causes unionfs to hide the file. You can always get it back by removing the /mnt/system/unionfs/system/app/.wh.Launcher2.apk file.
-John
Is the ext4 1 gig of data for extra app space?
skeeterfood said:
Might as well just do:
[ADB] su; cd /system/app; rm Launcher2.apk
since it's really not deleting the file, but instead creating a .wh.Launcher2.apk file in /mnt/system/unionfs/system/app/ that causes unionfs to hide the file. You can always get it back by removing the /mnt/system/unionfs/system/app/.wh.Launcher2.apk file.
Click to expand...
Click to collapse
Right, thank you. I added it to the steps to follow.
darren1 said:
Is the ext4 1 gig of data for extra app space?
Click to expand...
Click to collapse
That's the idea: All (non-system) apps and data will be stored in the 1GB ext4 partition.
WhoDunnit said:
That's the idea: All (non-system) apps and data will be stored in the 1GB ext4 partition.
Click to expand...
Click to collapse
Great, thanks.
A70H Compatible?
Thanks for all the work. Looks great and I'm about ready to try it but need to know first, will this work on the A70H (250gb version)?
H_Scrappy said:
Thanks for all the work. Looks great and I'm about ready to try it but need to know first, will this work on the A70H (250gb version)?
Click to expand...
Click to collapse
It's been suggested that you shouldn't perform this operation on the hard-drive versions. Constant app re-writes on the hard-drive could be a cause for early drive failures.
Nice write-up here WhoDunnit. I did a Windows-based write-up last month over at the ArchosFans forum. Now it looks like people have some options for methods to create their partitions on both Linux and Windows. More information is always a good thing
http://forum.archosfans.com/viewtopic.php?f=76&t=54637
Harfainx said:
I I did a Windows-based write-up last month over at the ArchosFans forum. Now it looks like people have some options for methods to create their partitions on both Linux and Windows. More information is always a good thing
http://forum.archosfans.com/viewtopic.php?f=76&t=54637
Click to expand...
Click to collapse
OK, great. I added a link to your thread so people can find answers if they want to do this from windows.

[Linux] Porting native Linux to Galaxy Note9

This thread is about starting native Linux on Samsung Galaxy Note9. This isn't my first attempt to do such thing. The history looks like Galaxy Spica -> Galaxy J1 (2016) -> Galaxy Note9. So I know what I'm doing
Later I'll post instructions how to install and run it.
Note9 isn't my main device, so I won't work on dualboot. If some wants to make it, feel free to build dualboot (kexec) recovery and post it here.
Source code.
Kernel: https://github.com/LONELY-WOLF/crownlte-linux-os
First success
So, here is a first result.
With minor modifications to DECON (framebuffer) my Note9 is able to run Arch Linux form SD card.
So far it has no serial or USB console. I can't find a way to make UART JIG for Type-C Samsungs. USB gadgets are hardcoded and can't be easy changed to CDC ACM. This is not good and makes development harder.
Arch Linux says it started GUI but I don't know what happened to Xorg. It can be on back buffer or on another display (since Note9 has it via Type-C).
This would be awesome for me during pen testing?!
Def following!
Could install it on dualboot?
giorgior.r said:
Could install it on dualboot?
Click to expand...
Click to collapse
Yes, it's possible. As for now kernel is inside phone memory and root FS is on SD card.
There are two ways to install it alongside Android:
Flash Linux kernel as recovery. So when you try to enter recovery it'll boot into Linux. You lose recovery in this case.
Install special dualboot/kexec recovery and start Linux from recovery menu. (If someone will make such recovery for Note9)
All Linux files (except kernel) are on SD card. SD has following partition scheme:
Storage. That's what your Android sees as SD card. FAT32 or exFAT
Apps2SD. Is someone still using it? However this partition can be 1MB in size.
Linux rootfs. That's where Linux "ROM" lives.
So SD is also ready for daily use.
nice, have similar thing based on exynos-linux-stable and debian stretch wifi work but sound and usb not yet for me. how you enabled boot console? also need to swap red and blue channel because they are flipped on 24/32 bit colours
Sisah said:
nice, have similar thing based on exynos-linux-stable and debian stretch wifi work but sound and usb not yet for me. how you enabled boot console? also need to swap red and blue channel because they are flipped on 24/32 bit colours
Click to expand...
Click to collapse
For fbcon you need to patch decon driver. Take a look at my commits on GitHub.
Yes, RGB<->BGR is a common issue. I have it on J120F too. This hack work for J1. But it would be nice to find a source of the problem. I believe decon reports wrong color order.
WARNING! I had to disable fbcon on J1 because it messed up with Xorg.
Still no luck with USB. I try to configure it with configfs, but got error
Code:
Config c/1 of g1 needs at least one function
Looks like Samsung hardcoded something inside USB drivers.
Found out that USB configfs is heavily modified. That's the reason why Linux can't configure USB gadgets properly. Bring back compatibility seems to be a hard task.
ho ho ho... so long time im not play dualboot
sorry i have diferent question, i see on youtube, normal windows 10 work on lumia 950 and 950xl, what its that ?
Ce Doresti said:
ho ho ho... so long time im not play dualboot
sorry i have diferent question, i see on youtube, normal windows 10 work on lumia 950 and 950xl, what its that ?
Click to expand...
Click to collapse
Since I'm a Windows Phone hacker, I can answer your question
That project is very similar to what I do here. Starting from Windows Phone 8, phone OS and desktop one have one (NT) kernel. Just like Android and desktop Linux do. Windows you see on NL950 on YouTube is "Windows for ARM". It looks like desktop but it can't run normal Windows EXEs because of different processor architecture. Maybe it can run desktop .NET applications (I've made proof-of-concept EXE that worked on both Windows Mobile 5.0 and Windows XP) but I'm not sure.
Linux is a better way to get desktop OS on mobile device. Open source nature of most Linux software makes it possible to use almost any program on any processor architecture. Take a look at single board computers (like Raspberry Pi) if you want to see what Linux can do on ARM architecture.
I think win 10 for arm have integrated x86 emulator, so it probably launch nearly anything.
If i can have one more question. How you refreshing screen? Refresh rate is set to 0 and my every attempt to configure screen with fbset result in black screen and hard reset, so i must use infinite loop that send "1" to /sys/class/graphics/fb0/rotate to refresh my screen
-W_O_L_F- said:
Since I'm a Windows Phone hacker, I can answer your question
That project is very similar to what I do here. Starting from Windows Phone 8, phone OS and desktop one have one (NT) kernel. Just like Android and desktop Linux do. Windows you see on NL950 on YouTube is "Windows for ARM". It looks like desktop but it can't run normal Windows EXEs because of different processor architecture. Maybe it can run desktop .NET applications (I've made proof-of-concept EXE that worked on both Windows Mobile 5.0 and Windows XP) but I'm not sure.
Linux is a better way to get desktop OS on mobile device. Open source nature of most Linux software makes it possible to use almost any program on any processor architecture. Take a look at single board computers (like Raspberry Pi) if you want to see what Linux can do on ARM architecture.
Click to expand...
Click to collapse
thank you !
I can see the potential of this project if things go according to your vision.. I will for sure donate you for your amazing effort
Interesting, is it more for the challenge itself or what's your goal?
Linux on Dex works great for me, it's missing a gui if you don't connect it to a display but you could probably trick it to believe that the phone screen is an external display.
Sisah said:
I think win 10 for arm have integrated x86 emulator, so it probably launch nearly anything.
If i can have one more question. How you refreshing screen? Refresh rate is set to 0 and my every attempt to configure screen with fbset result in black screen and hard reset, so i must use infinite loop that send "1" to /sys/class/graphics/fb0/rotate to refresh my screen
Click to expand...
Click to collapse
Since we use the same kernel can you share your work on GitHub too? Also I need all your current work on OS. What image you use? What modifications you made? It's a good idea for me to migrate to the same distro. This can speed up our work.
-W_O_L_F- said:
Since we use the same kernel can you share your work on GitHub too? Also I need all your current work on OS. What image you use? What modifications you made? It's a good idea for me to migrate to the same distro. This can speed up our work.
Click to expand...
Click to collapse
Here is my config files for debian.
https://www.mediafire.com/file/ccziy42yj2bn28x/LINUX.zip
(Include precompiled mtev driver from meefik https://github.com/meefik/xorg-input-mtev
Also it set wacom driver for spen to work
)
kernel .config
https://www.mediafire.com/file/czrct62638xpkhz/.config
And debian install cdrom
https://cdimage.debian.org/debian-cd/current/arm64/iso-cd/
installation was little tricky, need to install linuxdeploy compile kernel with atleast isofs, systemv-ipc, vt console, kernel automounter-v4, fanotify and raid-dm support and put it to recovery.img, then dd it to BOOT partition.
Now download debian-installer.iso, extract ramdisk.gz from him and reboot to modified recovery.
Here mount system, go to terminal, type linuxdeploy shell.
Now we must unpack ramdisk.gz from installer with abootimg or mkbootimg, mount debian-installer.iso to unpacked-ramdisk/cdrom and then we can chroot to installer ramdisk with chroot /unpacked-ramdisk /bin/ash
After that just type
./init
debian-installer-startup
debian-installer
Use sdcard as root partition and install.
After installing base system it probably fail to setup apt, so we must open terminal in setup program then
mount --bind /cdrom /target/media/cdrom (need to create that dir first)
then
chroot /target /bin/bash
apt-cdrom add
apt-get update
Now you can run tasksel and install desktop (kde xfce and gnome work but need lightdm for virtual keyboard on login)
(Here is nice place to copy those config files i posted and run install.sh, but also be sure to install lightdm and onboard keyboard, its not in my pack)
after that type exit few times until you get back to installer where you can finish installation.
Then need to compile kernel make initrd and create boot.img (can be done in linuxdeploy on android)
Also copy /vendor from phone to installed system then wifi start working and we can install from netinst-cd with little less trouble, or install to .img maybe even folder from internal_sdcard, its much faster than booting from memory card
Here is my fresh install of debian stretch and kde, only modification is in lightdm-gtk-greeter.conf, 40-libinput.conf, xorg.conf (not needed much), /usr/share/initramfs-tools/scripts/local (hardcoded root partition and loop .img for boot) and added framebuffer_refresh systemd service. To install just unpack .zip to root of /data (sda25) and flash linux-boot.img to boot partition.
Sound, USB, and 24bit colors are still broken, but maybe still better than linux on dex with some hardware graphics acceleration like panfrost driver it may be better than my pc
Root - 16GB .img after unpack
https://mega.nz/#!zeAA3KzY!vK5g2HtI0H3CD654wx40w14VstT6ktLX6tzNsUMWNoU
Boot.img
https://mega.nz/#!LCQB0QJK!YKTflwPsAJosaxr0Bqlu_9XtfgCFxkgNCmrbyNNaBvM
Login as sisah with password 123456, root password 123456, kde wallet password is set to 123456 too. Made on n960f dual sim.
Sisah said:
Here is my fresh install of debian stretch and kde, only modification is in lightdm-gtk-greeter.conf, 40-libinput.conf, xorg.conf (not needed much), /usr/share/initramfs-tools/scripts/local (hardcoded root partition and loop .img for boot) and added framebuffer_refresh systemd service. To install just unpack .zip to root of /data (sda25) and flash linux-boot.img to boot partition.
Sound, USB, and 24bit colors are still broken, but maybe still better than linux on dex with some hardware graphics acceleration like panfrost driver it may be better than my pc
Root - 16GB .img after unpack
https://mega.nz/#!zeAA3KzY!vK5g2HtI0H3CD654wx40w14VstT6ktLX6tzNsUMWNoU
Boot.img
https://mega.nz/#!LCQB0QJK!YKTflwPsAJosaxr0Bqlu_9XtfgCFxkgNCmrbyNNaBvM
Login as sisah with password 123456, root password 123456, kde wallet password is set to 123456 too. Made on n960f dual sim.
Click to expand...
Click to collapse
Good work
@Sisah
I've managed to get USB to work. Here, take the code:
Code:
#!/bin/bash
mkdir -p /sys/kernel/config/usb_gadget/g1
cd /sys/kernel/config/usb_gadget/g1
echo 0xabcd > idVendor
echo 0x1234 > idProduct
mkdir -p strings/0x409
echo SM-960F > strings/0x409/serialnumber
echo Samsung > strings/0x409/manufacturer
echo Note9 > strings/0x409/product
# Config 1
mkdir -p configs/c.1
echo 120 > configs/c.1/MaxPower
mkdir -p configs/c.1/strings/0x409
echo "ACM" > configs/c.1/strings/0x409/configuration
mkdir functions/acm.GS0
ln -s functions/acm.GS0 configs/c.1
# Config 2
#mkdir -p configs/c.2
#echo 120 > configs/c.2/MaxPower
#mkdir -p configs/c.2/strings/0x409
#echo "RNDIS" > configs/c.2/strings/0x409/configuration
mkdir functions/rndis.usb0 # use default parameters
ln -s functions/rndis.usb0 configs/c.1
echo "acm,rndis" > /sys/class/android_usb/android0/functions
echo 10c00000.dwc3 > UDC
echo 1 > /sys/class/android_usb/android0/enable
# to unbind it: echo "" UDC; sleep 1; rm -rf /sys/kernel/config/usb_gadget/g1
/sbin/agetty -w -L 115200 ttyGS0 linux
exit 0
-W_O_L_F- said:
@Sisah
I've managed to get USB to work. Here, take the code:
Code:
#!/bin/bash
mkdir -p /sys/kernel/config/usb_gadget/g1
cd /sys/kernel/config/usb_gadget/g1
echo 0xabcd > idVendor
echo 0x1234 > idProduct
mkdir -p strings/0x409
echo SM-960F > strings/0x409/serialnumber
echo Samsung > strings/0x409/manufacturer
echo Note9 > strings/0x409/product
# Config 1
mkdir -p configs/c.1
echo 120 > configs/c.1/MaxPower
mkdir -p configs/c.1/strings/0x409
echo "ACM" > configs/c.1/strings/0x409/configuration
mkdir functions/acm.GS0
ln -s functions/acm.GS0 configs/c.1
# Config 2
#mkdir -p configs/c.2
#echo 120 > configs/c.2/MaxPower
#mkdir -p configs/c.2/strings/0x409
#echo "RNDIS" > configs/c.2/strings/0x409/configuration
mkdir functions/rndis.usb0 # use default parameters
ln -s functions/rndis.usb0 configs/c.1
echo "acm,rndis" > /sys/class/android_usb/android0/functions
echo 10c00000.dwc3 > UDC
echo 1 > /sys/class/android_usb/android0/enable
# to unbind it: echo "" UDC; sleep 1; rm -rf /sys/kernel/config/usb_gadget/g1
/sbin/agetty -w -L 115200 ttyGS0 linux
exit 0
Click to expand...
Click to collapse
Nice it enable usb, but still getting errors when i plug otg, and phone reboot if i connect it to pc, its strenge because i installed linux on more phones and otg alwais worked without any configuration.

[KERNEL][CM13] Kernel with ZRAM swap

Hello! After many years without development, today I'm sharing a new kernel with ZRAM and swap support for this device.
The kernel is based upon weritos' Cyanogenmod 13 kernel source code and should work on both rev. 1 and rev. 2 devices.
Installation procedure is as follows:
1. Download the latest TWRP, kernel build and modules.
2. Install the kernel and TWRP from ADB shell (the device must be booted into Android) or a terminal app:
Bash:
su (from a terminal app; not required from ADB shell)
cat </path/to/TWRP_image> > /dev/block/mmcblk0p13
cat </path/to/kernel_image> > /dev/block/mmcblk0p8
reboot recovery
3. Install the kernel modules:
Bash:
mount /dev/block/mmcblk0p21 /system
unzip -o </path/to/modules.zip> -d /system/lib/modules
4. Done! Reboot into Android.
NOTE: The < and > symbols should never be issued within the commands!
Version Information
Status: Beta (Bluetooth, camera recording and screen recording do not work.)
Created: 2021-05-11
Last Updated: 2021-05-12 (Import and enable Ultra KSM driver.)
I still have this device, will this kernel with twrp installed fix the crashing problems in cm 13, thanks for your effort
@Krush206 it's saying can't open zip file on the last step, how to fix??
SerjSX said:
@Krush206 it's saying can't open zip file on the last step, how to fix??
Click to expand...
Click to collapse
fixed it, I was supposed to write:
Code:
unzip -o /sdcard/modules.zip -d /system/lib/modules
instead of:
Code:
unzip -o /storage/emulated/0/modules.zip -d /system/lib/modules
in TWRP terminal.
However, how do I know if it successfully worked?? My phone booted up normally but no sign that shows if it worked 100% or not. @Krush206
not working
Turkish developers said:
I still have this device, will this kernel with twrp installed fix the crashing problems in cm 13, thanks for your effort
Click to expand...
Click to collapse
This is the reason I exported the ZRAM driver to the kernel. However, I have noticed it breaks Wi-Fi, so I will have to fix it for proper testing.
SerjSX said:
However, how do I know if it successfully worked?? My phone booted up normally but no sign that shows if it worked 100% or not.
Click to expand...
Click to collapse
Either install Termux (or a terminal app of your choice) or use ADB and issue the free -m command.
Krush206 said:
This is the reason I exported the ZRAM driver to the kernel. However, I have noticed it breaks Wi-Fi, so I will have to fix it for proper testing.
Either install Termux (or a terminal app of your choice) or use ADB and issue the free -m command.
Click to expand...
Click to collapse
Hi, thanks for your response. Just did i and looks like it worked, 59 total swap, used 58, and free 541.
Are you sure you checked the correct line? The total should be 255 (256), not 59.
can you compile a kernel for overclocking in stock room or cm 11 please our quttro needs it now
overclock kernel pls
Sorry for the delay. The battery of my device has swollen, so I cannot really check whether overclocking is possible or not.
However, though overclocking may be possible, it may cause system instability and crashes.
I could probably have a look at the code and see how to get it done, but I cannot post results and would not recommend overclocking.
The battery in my device was swollen, I found a battery and the best software for this device is 4.1.2. I want to try overclocking for this version. Bide 4.1.2 also does not play hd videos in the original software. Is there a code or a mod for this?
1.5 Ghz overclock pls
any update?
If you two, @Fever070720, @Turkish developers, are still looking into overclocking, please, send the output of the following command:
Code:
cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq

Categories

Resources