Related
Hi all,
First, sorry for my english since english is not my mother language.
I've brought Archos 70 IT 250GB last week, and start to study all about it from the internet to make it faster faster and faster...
Gathering all information from XDA, ArchosFans, Mobile01, HKEPC...etc.
Almost all archos owner is flash 8GB version, and they totally wrote the guide for flash version, HDD version are roughly mentioned....
But its okay for that, because ROOT, SDE, Flash AOS...all is same in both hardware version, but one thing only is different, the SWAP part!
8GB flash version have internal 8GB memory and able to insert SD card, so they can play a lot about SWAP, EXT4, Class 6, 8, 10...bra bra bra
How about HDD version....my little poor A70H !?
Click to expand...
Click to collapse
I think is enough for my speak...main part coming..
From my own test, SWAP is works and faster than put the file onto the HDD.
--Step1--
Download the SWAP file from below, thanks marclh1992
http://forum.xda-developers.com/showthread.php?t=872697
--Step2--
Unzip the file to the desktop, and choose the suitable swapXXX for your Archos 70 IT, I use swap256 for demo.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
--Step3--
put the SWAP file into the root of your Archos
--Step4--
Download 'GScript Lite' from Market, and install RootExplorer from !?
--Step5--
Open RootExplorer, and point to your HDD as '/mnt/storage'
--Step6--
Long click on the SWAP file and choose 'copy'
--Step7--
point to the internal memory as '/data' and paste it
**this folder is your whole internal memory (have 1.6G spaces) that you store apps data here, don't touch anything unless you know what it is!!
--Step8--
jobs done with RootExplorer, now open GScript Lite
--Step9--
Type below code to Enable SWAP:
Code:
cd /data
swapon swap256
free
or
type this for Disable SWAP:
Code:
cd /data
swapoff swap256
free
then press save, then click on it, RUN!
*Or you can download my gscript to run it
--Step10--
Work done! Now you can see you have a lot of swap ram.
This trick will not affect you HDD at all time, you no need to Disable the SWAP to mount your HDD to your PC anymore!!
--extra Step--
Add auto-run script
http://forum.xda-developers.com/showpost.php?p=11669637&postcount=11
by Leo
SWAP 2596
Tested, work like a charme.
did you try with swap bigger than 256?
cocto said:
Is it needed with the new Updates 2.1.08?
did you try with swap bigger than 256?
Click to expand...
Click to collapse
yes, I've downloaded all 3 swap files and tried by myself.
but I've choose 256 since Android System seems will not use SWAP until it feels free RAM is close to zero...
LeoNg628 said:
yes, I've downloaded all 3 swap files and tried by myself.
but I've choose 256 since Android System seems will not use SWAP until it feels free RAM is close to zero...
Click to expand...
Click to collapse
If I understand correctly, thats fairly normal for Linux.
However, I have put the 512 file onto mine for the swap (I don't use many apps on the Archos, I use an Android phone so use apps on there mostly, so the internal memory is free to use here instead) and it does seem to fly.
Thanks for the guide!!
LeoNg628 said:
yes, I've downloaded all 3 swap files and tried by myself.
but I've choose 256 since Android System seems will not use SWAP until it feels free RAM is close to zero...
Click to expand...
Click to collapse
you can change swappiness behavior by increasing or decreasing the value (60 in the example below) to more or less:
in terminal (or in a startscript to make it permanent)
# sysctl -w vm.swappiness=60
sets it to 60
to see what you have currently set, do command
# cat /proc/sys/vm/swappiness
higher values: the kernel swaps out memory pages earlier
best to test the optimal value by loading a lot of memory sucker programms like flash .... and see how the swap is used
more for example here: http://www.cyberciti.biz/faq/linux-kernel-tuning-virtual-memory-subsystem/
Thank you for this guide!
Seems like i have to enable the swap file each time i reboot, is that correct?
woti23 said:
you can change swappiness behavior by increasing or decreasing the value (60 in the example below) to more or less:
in terminal (or in a startscript to make it permanent)
# sysctl -w vm.swappiness=60
sets it to 60
to see what you have currently set, do command
# cat /proc/sys/vm/swappiness
higher values: the kernel swaps out memory pages earlier
best to test the optimal value by loading a lot of memory sucker programms like flash .... and see how the swap is used
more for example here: http://www.cyberciti.biz/faq/linux-kernel-tuning-virtual-memory-subsystem/
Click to expand...
Click to collapse
I've just use this to change:
echo 60 > /proc/sys/vm/swappiness
-NRG- said:
Thank you for this guide!
Seems like i have to enable the swap file each time i reboot, is that correct?
Click to expand...
Click to collapse
yup, need re-swap every time when you boot up the device
A question about the swap.
What is the maximum swap usage you have seen?
wdl1908 said:
A question about the swap.
What is the maximum swap usage you have seen?
Click to expand...
Click to collapse
I've set swappiness to 60 and use autokiller memory optimizer to set Optimum(40 50 60), usually the devices will use up to 60MB into swap, if I playing music and web surfing, the devices will use up to 90MB into swap.
Has anyone found a way to keep it permanent or load it at startup?
I can't get it to work with init.d, looks like init.d isn't working on oc kernal.
autostart doesn't seem to work either...
I will be verry thankfull if anyone would be able to provide a solution!
EDIT : After a lot of trial and error >
SOLVED!: (CAUTION I AM NOT RESPONSIBLE IF ANYTHING STOPS WORKING, ON YOUR OWN RISK)
Create a file in /data/opt/autostart.sh
Edit "autostart.sh" and add swapon /data/swap256 (asuming you placed a 256mb swap file in the /data directory)
Goto /etc/init
Edit init.A70H.rc for Hardisk based A70 (for 8gb use init.A70S.rc)
Scroll down (botom) to "service omx_pm /system/bin/OMXPolicyManager"
Type directly below this line:
"service enable_swap /system/bin/sh /data/opt/autostart.sh
Done, reboot en use terminal/gscript command "free" to check if swap file is enabled, now swapfile is permanent and enabled each time you boot!
-NRG- said:
Has anyone found a way to keep it permanent or load it at startup?
I can't get it to work with init.d, looks like init.d isn't working on oc kernal.
autostart doesn't seem to work either...
I will be verry thankfull if anyone would be able to provide a solution!
EDIT : After a lot of trial and error >
SOLVED!: (CAUTION I AM NOT RESPONSIBLE IF ANYTHING STOPS WORKING, ON YOUR OWN RISK)
Create a file in /data/opt/autostart.sh
Edit "autostart.sh" and add swapon /data/swap256 (asuming you placed a 256mb swap file in the /data directory)
Goto /etc/init
Edit init.A70H.rc for Hardisk based A70 (for 8gb use init.A70S.rc)
Scroll down (botom) to "service omx_pm /system/bin/OMXPolicyManager"
Type directly below this line:
"service enable_swap /system/bin/sh /data/opt/autostart.sh
Done, reboot en use terminal/gscript command "free" to check if swap file is enabled, now swapfile is permanent and enabled each time you boot!
Click to expand...
Click to collapse
Nice trick!
But is it a "must" to create 'autostart.sh'? can I create another sh file and just change to location in lower part?
LeoNg628 said:
Nice trick!
But is it a "must" to create 'autostart.sh'? can I create another sh file and just change to location in lower part?
Click to expand...
Click to collapse
Yes that should work fine. You can also add other optimizations like setting the swapiness and such in the "autostart.sh" (or whatever you like to call it) file.
I'm currently testing out some optimizations from the galaxy tab, will report back soon.
I also saw a setting usb_charging = no in the "init.A70H.rc" file, i wonder if anyone tried changing it to yes?
I'm a little bit scared to change it since i'm not sure it might do damage..
-NRG- said:
Yes that should work fine. You can also add other optimizations like setting the swapiness and such in the "autostart.sh" (or whatever you like to call it) file.
I'm currently testing out some optimizations from the galaxy tab, will report back soon.
I also saw a setting usb_charging = no in the "init.A70H.rc" file, i wonder if anyone tried changing it to yes?
I'm a little bit scared to change it since i'm not sure it might do damage..
Click to expand...
Click to collapse
Nice! Waiting your great news from Galaxy Tab, but what setting from it have you saw?
usb charging is not work on my 70H, it just show up usb charging on MSC mount screen but not really charging..
*can I add multiple line in the SH file? and what is 'enable_swap' stand for? is it internal function from froyo?
double post...please del..
LeoNg628 said:
Nice! Waiting your great news from Galaxy Tab, but what setting from it have you saw?
usb charging is not work on my 70H, it just show up usb charging on MSC mount screen but not really charging..
*can I add multiple line in the SH file? and what is 'enable_swap' stand for? is it internal function from froyo?
Click to expand...
Click to collapse
Yes, you can add multiple lines in the SH file.
"Enable_swap" was just a name i gave to the service, might as well be "optimize_performance" or whatever name you like so you easily recognize it.
The following settings from the galaxy tab i'm testing, came from a topic in the galaxy tab section. I came across it while searching for solutions.
Code:
# Lower the amount of unwritten write cache to reduce lags when a huge write is required.
# DEF 20
echo_ "10" "/proc/sys/vm" "/dirty_ratio"
# Increase minimum free memory, in theory this should make the kernel less likely to suddenly run out of memory.
# DEF 3102
echo_ "4096" "/proc/sys/vm" "/min_free_kbytes"
# Increase tendency of kernel to keep block-cache to help with slower RFS filesystem.
# DEF 100
echo_ "1000" "/proc/sys/vm" "/vfs_cache_pressure"
# Increase the write flush timeouts to save some battery life.
# DEF 250
echo_ "2000" "/proc/sys/vm" "/dirty_writeback_centisecs"
# DEF 200
echo_ "1000" "/proc/sys/vm" "/dirty_expire_centisecs"
# Make the task scheduler more 'fair' when multiple tasks are running,
# which improves user-interface and application responsiveness.
# DEF 10000000
echo_ "20000000" "/proc/sys/kernel" "/sched_latency_ns"
# DEF 2000000
echo_ "2000000" "/proc/sys/kernel" "/sched_wakeup_granularity_ns"
# DEF 1000000
echo_ "1000000" "/proc/sys/kernel" "/sched_min_granularity_ns"
The defaults are from the galaxy tab, not the archos.
Format should be in the sh or gscript : echo 1000000 > /proc/sys/kernel/shed_min_granularity_ns
To check current setting: cat /proc/sys/kernel/shed_min_granularity_ns
-NRG- said:
Yes, you can add multiple lines in the SH file.
"Enable_swap" was just a name i gave to the service, might as well be "optimize_performance" or whatever name you like so you easily recognize it.
The following settings from the galaxy tab i'm testing, came from a topic in the galaxy tab section. I came across it while searching for solutions.
Code:
# Lower the amount of unwritten write cache to reduce lags when a huge write is required.
# DEF 20
echo_ "10" "/proc/sys/vm" "/dirty_ratio"
# Increase minimum free memory, in theory this should make the kernel less likely to suddenly run out of memory.
# DEF 3102
echo_ "4096" "/proc/sys/vm" "/min_free_kbytes"
# Increase tendency of kernel to keep block-cache to help with slower RFS filesystem.
# DEF 100
echo_ "1000" "/proc/sys/vm" "/vfs_cache_pressure"
# Increase the write flush timeouts to save some battery life.
# DEF 250
echo_ "2000" "/proc/sys/vm" "/dirty_writeback_centisecs"
# DEF 200
echo_ "1000" "/proc/sys/vm" "/dirty_expire_centisecs"
# Make the task scheduler more 'fair' when multiple tasks are running,
# which improves user-interface and application responsiveness.
# DEF 10000000
echo_ "20000000" "/proc/sys/kernel" "/sched_latency_ns"
# DEF 2000000
echo_ "2000000" "/proc/sys/kernel" "/sched_wakeup_granularity_ns"
# DEF 1000000
echo_ "1000000" "/proc/sys/kernel" "/sched_min_granularity_ns"
The defaults are from the galaxy tab, not the archos.
Format should be in the sh or gscript : echo 1000000 > /proc/sys/kernel/shed_min_granularity_ns
To check current setting: cat /proc/sys/kernel/shed_min_granularity_ns
Click to expand...
Click to collapse
it almost same setting in my A70H....but it didn't have sched_XXX in vm folder.
Do you know what happen if I turn on Laptop-mode in proc/sys/vm/laptop-mode?
Thx=]
to -NRG-:
the auto script is work!! Thanks!
I've putted an "enableswap.sh" into /data, then edit the A70H.rc to add "service enable_swap /system/bin/sh /data/swap256"
the body of sh file:
swapon /data/swap256
echo 60 > /proc/sys/vm/swappiness
-NRG- said:
Yes, you can add multiple lines in the SH file.
"Enable_swap" was just a name i gave to the service, might as well be "optimize_performance" or whatever name you like so you easily recognize it.
....
Click to expand...
Click to collapse
-NRG-, have you find any side effect after doing this?
my archos seems a little laggy after add that line..
Mugetsu is a package for Urushi (SE Ray) comprised of:
Custom kernel
Patched libsqlite.so
/sd-ext tools
Even though it's a single package, I've split everything between 3 posts according to the above schematic.
Clicking on each one will take you to its own dedicated section.
I have reserved a last post for instructions on how to port this over to other XPERIA 2011 devices.
Mugetsu is mainly a custom kernel based on FXP's source up until 3/11. The credit of every work prior to this date, as well as providing the wlan source needed to compile wireless modules, belongs to FXP team. I've just tweaked and messed a bit in order to optimize performance, internet speed, battery and memory management, while keeping it as light as possible.
Currently working for:
CyanogenMOD 7 (lastly tested with FXP045)
SEMC 4.0.2.A.0.42 *
MIUI (lastly tested with MIUI 1.10.21)
* wifi is broken since I'm unable to compile wlan modules for stock
Features\Changelog:
Code:
[I]version two[/I]:
- Increased OC support up to 2.0 Ghz.
- [URL="https://market.android.com/details?id=com.skvalex.callrecorder"]Added support for voice calls recording[/URL]. (experimental)
- Further optimizations to Deadline I/O Scheduler.
- Lowmemorykiller.c parameters tuned.
[I]version one[/I]:
- Bumped version to 2.6.32.18
- Overclock support up to 1.6 Ghz
- Tiny RCU (+ optimizations)
- SLQB memory allocator
- Many new CPU freq governors (+ optimizations)
- Many new I/O schedulers (+ optimizations)
- Bumped BFQ to last version
- Support for CPU unaligned access
- Veno TCP Congestion control *
- Stochastic Fair Blue network scheduler *
- Bumped jHash to last version *
- Improved RWSEM algorithm
- Improved CRC32 algorithm
- Disabled swappiness
- Increased Config_HZ
- Increased data transfer rate
- Sysctl and lmk tweaking
- Stripped of unnecessary crap. So you have an idea, stock kernel has 3.2 MB, FXP has 3.0 and this one has 2.6 MB.
* huge internet/market page loading boost
CM version is updated to the latest build so it has wifi, haptic feedback and vibration working.
SEMC has an insecure boot.img so it can be rooted with SuperOneClick and I've also added CWM recovery.
Available modules:
Code:
- TUN
- CIFS
- Powersave governor *
- Performance governor *
- Logcat
* since powersave lowers cpu max frequency to same value as the min frequency and performance the other way around, these just seem kind of irrelevant when you have cpu sliders; however, I've included them as a module for advanced users
For activating a module, run this command on terminal: insmod /system/lib/<module.ko>
You may want to add afterwards a line to a init.d for automatic insmod.
Available governors:
Code:
- Ondemand
- Conservative
- Interactive
- InteractiveX
- Smartass2 *
- Smoothass
- BrazillianWax
- SavagedZen
- MinMax
- Scary
* default
For choosing the governor use CM settings > performance, SetCPU, ROM Toolbox or any other app.
More information: http://forum.xda-developers.com/showpost.php?p=17131902&postcount=1
Available I/O schedulers:
Code:
- Noop
- BFQ
- CFQ
- Deadline *
- Simple
- VR
- Anticipatory
* default
For choosing the I/O scheduler use No-Frills app or the following command:
echo "scheduler-name" > /sys/block/mmcblk0/queue/scheduler (cat this path for the names)
More information: http://forum.xda-developers.com/showpost.php?p=17131914&postcount=2
Download (SE Ray only):
v1: SEMC 4.2.0.A.0.42 - 414c02bb24712eec04e92d1ec858c9f0 || CM/FXP - c058878d24f90871ee808e18c3f6b8f1 || MIUI - (check in MIUI thread)
v2: removed for giving wifi problems to some people.
Instructions:
Download the package.
[CM7] Copy the package to your microSD card.
Extract boot.img from it.
Boot your phone into fastboot mode: turn off, plug USB cable while holding vol+ (blue light).
Use fastboot tools to flash the kernel: fastboot -i 0xfce flash boot boot.img
Unplug cable, turn on phone.
[CM7] Keep hitting vol- while the phone is booting to get into CWM.
[CM7] Flash the package in CWM (flash zip from sdcard).
[CM7] Reboot.
[CM7-Optional] Read about /sd-ext tools.
I'll try to update it as frequently as I'm able to but don't be expecting much, I don't have much spare time and this is only a hobby for me; I'm not a computer engineer, I do this mainly for myself and to keep the brain sharp and always learning.
If you go back to another kernel (boot.img) you may find yourself without wireless if you're using CM.
In this case, just flash this in CWM, no wipe required: http://www.multiupload.com/LIX7E96BGX
I have patched the libsqlite.so present in /system/lib/ in order to disable the sync feature for a higher write efficiency. So basically this will return more I/O performance while observable gains should be through a faster opening/closing of applications.
Currently working for:
CyanogenMOD 7 (lastly tested with FXP045)
It is already included in the package that you flash on kernel section instructions.
More information: http://forum.xda-developers.com/showthread.php?t=903507
My past devices always had ext3 native filesystem (eMMc devices), instead of XPERIA's yaffs2 (MTD devices). I usually upgraded these to ext4, removed journalism and with proper mount flags I have found its I/O performance much better than yaffs2 or anything else.
However, in MTD as far as I know there's no such way to format it to ext4 but there's a way around: move applications, data and dalvik-cache to a partition in microSD card called /sd-ext and have it formatted as ext4. Like for the patched libsqlite.so, a higher I/O performance equals to gains in overall smoothness.
Currently working for:
CyanogenMOD 7 (lastly tested with FXP045) *
* even though it's possible in theory for SEMC ROM I will not describe it here
Unfortunately there seems to be no official support for /sd-ext and CWM recovery on CM doesn't have the option to partition the sdcard so we have to find another way to create the /sd-ext partition and force the mount.
Requirements:
Mugetsu package already flashed through CWM (it has essential binaries)
MicroSD card of, at least, class 6 (higher the class, better the performance)
S2E application by Oleg Krikun which can be downloaded from the market
Terminal application (already included on CM but can be downloaded from the market) or ADB
Make sure to backup your microSD card contents as it will be fully wiped.
Instructions:
Navigate to settings > storage and unmount the microSD.
Open terminal/ADB shell and run these commands:
su (allow superuser access so the symbol turns # if it isn't already)
parted /dev/block/mmcblk0
print
Take note of the size of microSD card (in my case is 7937 MB), now remove the existing partitions:
rm 1
[Optional]rm 2 (remove n partitions until when you run the print command you won't have any)
Now we create the partitions. Let's go with a 512 MB /sd-ext and the rest for storage (FAT32). Now you'll need to write that (total space - 512 MB) - in my case 7425:
mkpartfs primary fat32 0 7425
mkpartfs primary ext2 7425 7937
Remember to change these values according to your own microSD card storage capacity; if you mess up, go to point 6 and repeat.
Now, we upgrade ext2 to ext3 and then to ext4, but first, exit parted with:
quit
Now back on to terminal/adb shell, run these commands to force ext3 and ext4 upgrade:
mount -o remount,rw /system
echo "" > /system/etc/mtab
tune2fs -j /dev/block/mmcblk0p2
tune2fs -O extents,uninit_bg,dir_index /dev/block/mmcblk0p2
e2fsck -fpDC0 /dev/block/mmcblk0p2
The crucial part now, we need to force the mount of /sd-ext so S2E can recognize it and take it from there:
mount -t ext4 /dev/block/mmcblk0p2 /sd-ext
After this open S2E and choose to move everything to the microSD card. You may need to enable advanced menu in S2E settings in order to be able to move data (reboot was required in my case); also make sure to enable "mount sd-ext as ext4 without journaling" and "set read buffer". If you run into problems with S2E recognizing the /sd-ext (everything is disabled) you need to mount it with the command above. You can check if it's mounted with the following command: "mount".
This way your applications as well as application data will be moved to /sd-ext, thus improving overall snappiness through a greater I/O performance. If on the opposite, you notice any sluggishness is because your microSD card isn't fast enough (slower than yaffs2). I recommend microSD cards who bench at least 8 MB on write test in the SDtools application.
Every time you plug and enable USB connection you'll also see that the new partition gets mounted and can be accessed.
Given the similarity and common core source between all XPERIA 2011 devices, this kernel can be easily ported to others such as Arc and Neo, as well as the patched libsqlite (it needs to be compiled for each device though) and /sd-ext tools. At least for CM7 it will work, this much I can guarantee.
I could release a version for these other devices but since I don't have one for more objective testing and debugging and I really don't have the time to follow the many threads I'd have to create, it's best if I go at this in another way which I'll now describe.
If you wish to port this to your device, make sure that:
You have a linux distro and you're familiar with it.
You know your way around kernels and android.
You have a device to which you want to port to.
You have time and you're active.
Anyone interested who meet the above criteria can contact me through PM, Google+, Twitter or whatever. I'll build everything you need at first for testing purposes and if it returns satisfying results I'll guide you through the rest in order to set it up. In exchange I only ask for you to keep the name and add a link to the original thread (this one).
hi, can i give you a suggestion? there's a way to improve wifi signal? my lg optimus one is much more better than ray.
Have you an idea?
powerfull kernel!
I successfully install it in _semc_ variant. trying to enter to recovery show many text strings (warnigs or what else) but show menu.
in normal mode all ok. there are many modern governeur variants. wifi just not turned on, say 'error' (not hang or reboot as official fxp))).
all other described features of kernel explode my brain)). I will read next times your links for understanding all features.
knzo, can you embed external cards support into kernel? (OTG) or this hard? as in Doomlords' arc kernel.
Thanks for your work!
Sadly SEMC's version has broken wifi (which can be seen in #2 post).
The reason for this is because:
1. FXP wlan source can compile SEMC modules but they don't work.
2. SEMC wlan source can't compile modules.
From what I gather it seems SEMC sources need to be cleaned but I haven't had the time to take a good look at it, it doesn't seem that easy to do.
Anyway, I'm going to study an Arc version for release, then I can take a look at that.
coolkaas said:
knzo, can you embed external cards support into kernel? (OTG) or this hard? as in Doomlords' arc kernel.
Click to expand...
Click to collapse
knzo said:
My past devices always had ext3 native filesystem (eMMc devices), instead of XPERIA's yaffs2 (MTD devices). I usually upgraded these to ext4, removed journalism and with proper mount flags I have found its I/O performance much better than yaffs2 or anything else.
However, in MTD as far as I know there's no such way to format it to ext4 but there's a way around: move applications, data and dalvik-cache to a partition in microSD card called /sd-ext and have it formatted as ext4. Like for the patched libsqlite.so, a higher I/O performance equals to gains in overall smoothness.
Currently working for:
CyanogenMOD 7 (lastly tested with FXP045) *
* even though it's possible in theory for SEMC ROM I will not describe it here
Unfortunately there seems to be no official support for /sd-ext and CWM recovery on CM doesn't have the option to partition the sdcard so we have to find another way to create the /sd-ext partition and force the mount.
Requirements:
Mugetsu package already flashed through CWM (it has essential binaries)
MicroSD card of, at least, class 6 (higher the class, better the performance)
S2E application by Oleg Krikun which can be downloaded from the market
Terminal application (already included on CM but can be downloaded from the market) or ADB
Make sure to backup your microSD card contents as it will be fully wiped.
Instructions:
Navigate to settings > storage and unmount the microSD.
Open terminal/ADB shell and run these commands:
su (allow superuser access so the symbol turns # if it isn't already)
parted /dev/block/mmcblk0
print
Take note of the size of microSD card (in my case is 7937 MB), now remove the existing partitions:
rm 1
[Optional]rm 2 (remove n partitions until when you run the print command you won't have any)
Now we create the partitions. Let's go with a 512 MB /sd-ext and the rest for storage (FAT32). Now you'll need to write that (total space - 512 MB) - in my case 7425:
mkpartfs primary fat32 0 7425
mkpartfs primary ext2 7425 7937
Remember to change these values according to your own microSD card storage capacity; if you mess up, go to point 6 and repeat.
Now, we upgrade ext2 to ext3 and then to ext4, but first, exit parted with:
quit
Now back on to terminal/adb shell, run these commands to force ext3 and ext4 upgrade:
mount -o remount,rw /system
echo "" > /system/etc/mtab
tune2fs -j /dev/block/mmcblk0p2
tune2fs -O extents,uninit_bg,dir_index /dev/block/mmcblk0p2
e2fsck -fpDC0 /dev/block/mmcblk0p2
The crucial part now, we need to force the mount of /sd-ext so S2E can recognize it and take it from there:
mount -t ext4 /dev/block/mmcblk0p2 /sd-ext
After this open S2E and choose to move everything to the microSD card. You may need to enable advanced menu in S2E settings in order to be able to move data (reboot was required in my case); also make sure to enable "mount sd-ext as ext4 without journaling" and "set read buffer". If you run into problems with S2E recognizing the /sd-ext (everything is disabled) you need to mount it with the command above. You can check if it's mounted with the following command: "mount".
This way your applications as well as application data will be moved to /sd-ext, thus improving overall snappiness through a greater I/O performance. If on the opposite, you notice any sluggishness is because your microSD card isn't fast enough (slower than yaffs2). I recommend microSD cards who bench at least 8 MB on write test in the SDtools application.
Every time you plug and enable USB connection you'll also see that the new partition gets mounted and can be accessed.
Click to expand...
Click to collapse
Thx for your efforts, if u have time take a look on dooms latest modified cwm in arc thread, it has ext support, app2sd in arc android thread is working for ray, I use it now with an ext4 partition but cwm in cm does not recognize it.
funiewski said:
Thx for your efforts, if u have time take a look on dooms latest modified cwm in arc thread, it has ext support
Click to expand...
Click to collapse
Ext and sd-ext support are 2 different things. This kernel also has ext support.
knzo said:
Ext and sd-ext support are 2 different things. This kernel also has ext support.
Click to expand...
Click to collapse
sorry for my bad and incorrect english, if I understand it correct dooms modified cwm had sd-ext support, link:
http://forum.xda-developers.com/showthread.php?t=1172885
first post
here is app2sd witch use sd-ext:
http://forum.xda-developers.com/showthread.php?t=1201902
once more, thx for your work it is highly appreciated
Hm, he says only support for backup/restore when the really handy thing would be partition sdcard support. If CWM had this option then most steps on post #4 would be redundant. However, it would still need to have its mount forced so S2E can recognise it! But this could also be easily added to the RAMdisk.
Added MIUI support.
Just pulled this one:
Could you please add the ability to use the accelerometer by other applications when the screen is locked?
Please
working flawlessly so far, thx for urs hard work
Working like a charm with Cm7 FXP45 Thank you so much and keep up the good work
I found this app on the Market: https://market.android.com/details?id=com.skvalex.callrecorder&hl=en
Requires the kernel with 2-way call recording patch and ROOT permissions:
Click to expand...
Click to collapse
Does your kernel has this patch?
veimus said:
I found this app on the Market: https://market.android.com/details?id=com.skvalex.callrecorder&hl=en
Does your kernel has this patch?
Click to expand...
Click to collapse
I'll try to add support for that today.
Sent from my ST18i using XDA App
***Disclaimer: I am NOT responsible for what you flash on your tablet or damage caused by what you flash on your tablet.
Credits: Koush and TeamDRH
Kernel developers, you may use this zip file as a template for your kernel installs. It will extract the current boot.img, unpack it, combine ramdisk with your zImage and flash it. It should make your kernels a lot easier to distribute among different roms and the users will be able to flash a new kernel without waiting for us to repackage it.
Usage:
Add your zImage into the /kernel folder of the zip
Add your wifi module into the /system/lib/modules/ folder of the zip.
Profit
I have tested this by flashing Motley's 2.5.8 on my AOKP build and it worked flawlessly.
Enjoy!
Download
jermaine151 said:
***Disclaimer: I am NOT responsible for what you flash on your tablet or damage caused by what you flash on your tablet.
Credits: Koush and TeamDRH
Kernel developers, you may use this zip file as a template for your kernel installs. It will extract the current boot.img, unpack it, combine ramdisk with your zImage and flash it. It should make your kernels a lot easier to distribute among different roms and the users will be able to flash a new kernel without waiting for us to repackage it.
Usage:
Add your zImage into the /kernel folder of the zip
Add your wifi module into the /system/lib/modules/ folder of the zip.
Profit
I have tested this by flashing Motley's 2.5.8 on my AOKP build and it worked flawless.
Enjoy!
Click to expand...
Click to collapse
Awesome, way to go Jermaine! Been thinking about doing this too, but never got around to it. Great work. I will definitely use this as a secondary CWM zip for users so they can try it with other ROMs. I will also be coming out with a version of the kernel that removes all the Asus power mode stuff (conditional compile) so you can just run a plain vanilla kernel without that stuff. Should be better for you I think. Let me know what you think.
_motley said:
Awesome, way to go Jermaine! Been thinking about doing this too, but never got around to it. Great work. I will definitely use this as a secondary CWM zip for users so they can try it with other ROMs. I will also be coming out with a version of the kernel that removes all the Asus power mode stuff (conditional compile) so you can just run a plain vanilla kernel without that stuff. Should be better for you I think. Let me know what you think.
Click to expand...
Click to collapse
That sounds awesome Motley! Thank you.
Hi Jermaine, I think the zip file got truncated by XDA after the upload. Has been happening to me to. Can you link it again? Thanks!
_motley said:
Hi Jermaine, I think the zip file got truncated by XDA after the upload. Has been happening to me to. Can you link it again? Thanks!
Click to expand...
Click to collapse
I'll upload it to my host. I have to wait a bit because my computer is building right now. Should be up in 15-20 mins.
Edit: Nevermind. My build crashed. LOL. Link is posted.
Sent from my Galaxy Nexus using Tapatalk 2
jermaine151 said:
I'll upload it to my host. I have to wait a bit because my computer is building right now. Should be up in 15-20 mins.
Edit: Nevermind. My build crashed. LOL. Link is posted.
Sent from my Galaxy Nexus using Tapatalk 2
Click to expand...
Click to collapse
Thank you sir!
_motley said:
Thank you sir!
Click to expand...
Click to collapse
You're welcome!
Any chance of someone cooking up a EOS compatible version of motley's 2.5? I switched from aokp for a minute so I could play with cornerstone. I'd really like the 1.8 though?
Sent from my TF201
using XDA
I haven't ran this rom, so I can't say for sure. I can't find anywhere where they state which kernel they are using, since it isn't stated I am assuming it is stock.
That said, my guess is that you can do the following. If you try it, let us know how it works. The ROM has to have init.d support...not sure if it does,
1) Do a backup in CWM so you can restore your boot.img quickly if necessary.
2) Flash the zip in this thread that Jermaine posted. The beauty of AnyKernel is that it just takes the zImage (kernel) and tucks it inside the resident initramfs (aka ramdisk) without making any changes to it, and then also copies in the wifi module. While it is called AnyKernel, Jermaine and I would probably call it AnyROM LOL...since this method will allow kernel devs to stop creating specific installs for each ROM.
3) Make sure it runs ok, if not go to step 6
4) go to /system/etc/init.d (if it doesn't already exist, the rom doesn't likely support init.d). Check with the ROM dev and ask him to add it.
5) create a script file "51_oc" within the init.d folder that sets the OC mode stuff. If "51" is taken, use another number else. Make sure the script file permissions are set to allow "Execute".
filename: /system/etc/init.d/51_oc
file contents:
Code:
#!/bin/sh -x
#This is 1.8 Performance mode - motley kernel Habanero
echo 5 > /sys/module/cpu_tegra/parameters/system_mode
echo 1350 /sys/kernel/tegra_cap/core_cap_level
echo 0 > /sys/kernel/tegra_cap/core_cap_state
echo 0 > /sys/devices/platform/tegra_grhost/enable_3d_scaling
echo 10 > /sys/module/cpu_tegra3/parameters/mp_overhead
echo 9999999 > /sys/module/cpu_tegra/parameters/pwr_cap_limit_1
echo 9999999 > /sys/module/cpu_tegra/parameters/pwr_cap_limit_2
echo 9999999 > /sys/module/cpu_tegra/parameters/pwr_cap_limit_3
echo 9999999 > /sys/module/cpu_tegra/parameters/pwr_cap_limit_4
setprop power.saving.mode 1
setprop persist.tegra.NV_FPSLIMIT 0
setprop persist.sys.NV_FPSLIMIT 0
setprop persist.sys.NV_POWERMODE 0
6) If it doesn't work, just restore your boot.img (selective restore) from the CWM backup or flash the rom again without a data wipe to get back where you are right now.
First, thanks for anykernel for tfp. It has advantages over supplying the ramdisk as well.
Although i don't dev, it seems to me that using anykernel isn't touching ramdisk except kernel. Because of that, be it a dev or a user, cannot change ramdisk contents through a cwm zip, but must do so either by doing it from src, or by unpacking/repacking that ramdisk, eventually sharing it. Am i correct?
Thanks.
bk201doesntexist said:
First, thanks for anykernel for tfp. It has advantages over supplying the ramdisk as well.
Although i don't dev, it seems to me that using anykernel isn't touching ramdisk except kernel. Because of that, be it a dev or a user, cannot change ramdisk contents through a cwm zip, but must do so either by doing it from src, or by unpacking/repacking that ramdisk, eventually sharing it. Am i correct?
Thanks.
Click to expand...
Click to collapse
I'm not positive that I completely understand what you're asking but this doesn't mess with the ramdisk. It extracts the current kernel and ramdisk from the device. Then it separates the 2. Then it combines the untouched ramdisk with the new kernel and flashes them back to the device.
Great !!
I thought that that would be the solution to deal with different kernel ramdisks.
The only point people need to know is that as this doesn't modify ramdisk, but just update the zImage file, if the initial ramdisk doesn't have init.d support, it won't add it.
We had to clarify this on my phone's forum, as some people complained about 'bugs' that were in fact just a correct behavior of AnyKernel.
Thanks Jermaine!
jermaine151 said:
I'm not positive that I completely understand what you're asking but this doesn't mess with the ramdisk. It extracts the current kernel and ramdisk from the device. Then it separates the 2. Then it combines the untouched ramdisk with the new kernel and flashes them back to the device.
Click to expand...
Click to collapse
If one would like, or need, to provide ramdisk tweaks, apart from the kernel (zImage) one cannot use anykernel to do it. Instead, one would need to release the whole ramdisk. Sorry i wasnt able to get this clearer.
bk201doesntexist said:
If one would like, or need, to provide ramdisk tweaks, apart from the kernel (zImage) one cannot use anykernel to do it. Instead, one would need to release the whole ramdisk. Sorry i wasnt able to get this clearer.
Click to expand...
Click to collapse
You can use AnyKernel as a starting point and then manipulate the ramdisk while it's in /tmp before combining it with the new zImage and flashing it. I did this type of thing with my Ext4All mod on the Droid Incredible. You can download one of my scripts from here and disect it:
http://forum.xda-developers.com/showthread.php?t=1315372
Edit: Here'a snippet of how I use sed to manipulate the ramdisk and change the mounting parameters:
#extract ramdisk
mkdir /tmp/ramdisk
cd /tmp/ramdisk
gunzip -c ../boot.img-ramdisk.gz |cpio -i
#edit file
sed -i '/mount ext3 mmcblk0p1/c mount ext4 mmcblk0p1 /data nosuid nodev noatime nodiratime data=writeback noauto_da_alloc' init.inc.rc
sed -i '/mount ext3 mmcblk0p2/c mount ext4 mmcblk0p2 /cache nosuid nodev noatime nodiratime data=writeback noauto_da_alloc' init.inc.rc
sed -i '/mount ext3 \/dev\/block\/mmcblk0p1/c mount ext4 /dev/block/mmcblk0p1 /data wait nosuid nodev noatime nodiratime data=writeback noauto_da_alloc' init.inc.rc
sed -i '/mount ext3 \/dev\/block\/mmcblk0p2/c mount ext4 /dev/block/mmcblk0p2 /cache wait nosuid nodev noatime nodiratime data=writeback noauto_da_alloc' init.inc.rc
#build new ramdisk
find . | cpio -o -H newc | gzip > ../newramdisk.cpio.gz
CWM recovery is powerful and has a lot of these editing tools built in and can be ran via a script while in recovery. There isn't much that you can't do.
Nice jermaine, thank you very much.
I had a feeling this was possible, Anykernel is indeed powerful. Would you agree to edit first post with this "template"? It's a great resource, imo.
bk201doesntexist said:
Nice jermaine, thank you very much.
I had a feeling this was possible, Anykernel is indeed powerful. Would you agree to edit first post with this "template"? It's a great resource, imo.
Click to expand...
Click to collapse
You're welcome. This isn't really a part of AnyKernel. It's just what you can do with extra scripts in recovery flashable zips. The goal for this AnyKernel thread is so that when Motley, Shaky, etc., release a kernel, if they put it in AnyKernel, we don't have to have separate versions for every rom.
jermaine151 said:
You're welcome. This isn't really a part of AnyKernel. It's just what you can do with extra scripts in recovery flashable zips. The goal for this AnyKernel thread is so that when Motley, Shaky, etc., release a kernel, if they put it in AnyKernel, we don't have to have separate versions for every rom.
Click to expand...
Click to collapse
I'll keep that in mind and do some research. Having these tools here, with root, it's actually genious. Thanks again!
_motley said:
I haven't ran this rom, so I can't say for sure. I can't find anywhere where they state which kernel they are using, since it isn't stated I am assuming it is stock.
That said, my guess is that you can do the following. If you try it, let us know how it works. The ROM has to have init.d support...not sure if it does,
1) Do a backup in CWM so you can restore your boot.img quickly if necessary.
2) Flash the zip in this thread that Jermaine posted. The beauty of AnyKernel is that it just takes the zImage (kernel) and tucks it inside the resident initramfs (aka ramdisk) without making any changes to it, and then also copies in the wifi module. While it is called AnyKernel, Jermaine and I would probably call it AnyROM LOL...since this method will allow kernel devs to stop creating specific installs for each ROM.
3) Make sure it runs ok, if not go to step 6
4) go to /system/etc/init.d (if it doesn't already exist, the rom doesn't likely support init.d). Check with the ROM dev and ask him to add it.
5) create a script file "51_oc" within the init.d folder that sets the OC mode stuff. If "51" is taken, use another number else. Make sure the script file permissions are set to allow "Execute".
filename: /system/etc/init.d/51_oc
file contents:
Code:
#!/bin/sh -x
#This is 1.8 Performance mode - motley kernel Habanero
echo 5 > /sys/module/cpu_tegra/parameters/system_mode
echo 1350 /sys/kernel/tegra_cap/core_cap_level
echo 0 > /sys/kernel/tegra_cap/core_cap_state
echo 0 > /sys/devices/platform/tegra_grhost/enable_3d_scaling
echo 10 > /sys/module/cpu_tegra3/parameters/mp_overhead
echo 9999999 > /sys/module/cpu_tegra/parameters/pwr_cap_limit_1
echo 9999999 > /sys/module/cpu_tegra/parameters/pwr_cap_limit_2
echo 9999999 > /sys/module/cpu_tegra/parameters/pwr_cap_limit_3
echo 9999999 > /sys/module/cpu_tegra/parameters/pwr_cap_limit_4
setprop power.saving.mode 1
setprop persist.tegra.NV_FPSLIMIT 0
setprop persist.sys.NV_FPSLIMIT 0
setprop persist.sys.NV_POWERMODE 0
6) If it doesn't work, just restore your boot.img (selective restore) from the CWM backup or flash the rom again without a data wipe to get back where you are right now.
Click to expand...
Click to collapse
Motley thanks for trying to help me out. I really want to get the hang of this because I love 1.8 (curtiousy of you) but I want to try some other roms. Unless I'm misreading I don't see the part in your instructions where it deals with the kernel I want to flash. Say for instance I want to use your 1.8 kernel on cm9. After I flash cm9, what do I do before flashing the anykernel zip? It jermaines OP it says remove copy zImage of the kernel you want to use into the anykernel zip. However, if I look in the zip of your kernel, all that exist's is the blob file and some scripts. This is the first device I've ever had where blob files have even been mentioned so I don't know how to get the zImage out of it. Also when dealing with kernels for my nookcolor and touchpad it's always been a uImage, what the difference? I know its alot of questions but I really appreciate the help.
Sent from my EPAD using XDA
newellj79 said:
Motley thanks for trying to help me out. I really want to get the hang of this because I love 1.8 (curtiousy of you) but I want to try some other roms. Unless I'm misreading I don't see the part in your instructions where it deals with the kernel I want to flash. Say for instance I want to use your 1.8 kernel on cm9. After I flash cm9, what do I do before flashing the anykernel zip? It jermaines OP it says remove copy zImage of the kernel you want to use into the anykernel zip. However, if I look in the zip of your kernel, all that exist's is the blob file and some scripts. This is the first device I've ever had where blob files have even been mentioned so I don't know how to get the zImage out of it. Also when dealing with kernels for my nookcolor and touchpad it's always been a uImage, what the difference? I know its alot of questions but I really appreciate the help.
Sent from my EPAD using XDA
Click to expand...
Click to collapse
Jermaine's instructions you mention are really for kernel devs, so don't worry about those extra steps unless you want to learn to package stuff up yourself. The CWM kernel install zip he posted in the OP is my 2.5.8 1.8GHz kernel using the AnyKernel method. The boot.img contains two things, a ramdisk (initramfs) + the kernel binary. the ramdisk is the customized part of these ROMs. The AnyKernel method will not alter your ramdisk. It just unpacks/repacks the boot.img and replaces the zImage at flash time. For any ROM, all you need to do is flash the AnyKernel zip (like the one in the OP) and it will give you the zImage (kernel) that the kernel dev has prepared for you.
I also have some other news on this front...and this was a decent segue for this. You may want to try this zip as well (you can try both and see what works better). I am hoping Jermaine will give it a spin and give his input (tickle, poke LOL). Let me know what you guys think.
New beta for non-stock ROMs! Recommended for advanced users and ROM developers until we flush out and identify any issues or improvements that need to be made
View attachment motley_tfp_generic_2.6.1_beta.zip
I have modified the kernel code to conditionally compile based upon a config switch called CONFIG_ASUS_OVERCLOCK_MODES. When turned OFF, this allows me to easily compile and release a version of the same kernel base that is generic without the Asus performance modes (system_mode). This will make the kernel behave like a regular kernel that works properly with SetCPU, No-frills, ROM Control etc. on non-stock ROMs. The generic kernel still runs fine on stock, but the Asus modes no longer will change the CPU frequency, but only set the core_cap_level voltage.
At boot, I still recommend running the following script with init.d or a ROM dev can also integrate into your initramfs init.cardhu.rc somewhere. For example, AOKP may already be good to go with this.
Code:
#!/bin/sh -x
# Generic kernel settings
echo 1300 /sys/kernel/tegra_cap/core_cap_level
echo 0 > /sys/kernel/tegra_cap/core_cap_state
echo 0 > /sys/devices/platform/tegra_grhost/enable_3d_scaling
echo 10 > /sys/module/cpu_tegra3/parameters/mp_overhead
echo 9999999 > /sys/module/cpu_tegra/parameters/pwr_cap_limit_1
echo 9999999 > /sys/module/cpu_tegra/parameters/pwr_cap_limit_2
echo 9999999 > /sys/module/cpu_tegra/parameters/pwr_cap_limit_3
echo 9999999 > /sys/module/cpu_tegra/parameters/pwr_cap_limit_4
setprop power.saving.mode 1
setprop persist.tegra.NV_FPSLIMIT 0
setprop persist.sys.NV_FPSLIMIT 0
setprop persist.sys.NV_POWERMODE 0
Since the frequency defaults to to max (1.8GHz), you may want to set it in the init.cardhu.rc script with something like this. For example: 1.6GHz.
Code:
write /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq 1600000
_motley said:
Jermaine's instructions you mention are really for kernel devs, so don't worry about those extra steps unless you want to learn to package stuff up yourself. The CWM kernel install zip he posted in the OP is my 2.5.8 1.8GHz kernel using the AnyKernel method. The boot.img contains two things, a ramdisk (initramfs) + the kernel binary. the ramdisk is the customized part of these ROMs. The AnyKernel method will not alter your ramdisk. It just unpacks/repacks the boot.img and replaces the zImage at flash time. For any ROM, all you need to do is flash the AnyKernel zip (like the one in the OP) and it will give you the zImage (kernel) that the kernel dev has prepared for you.
I also have some other news on this front...and this was a decent segue for this. You may want to try this zip as well (you can try both and see what works better). I am hoping Jermaine will give it a spin and give his input (tickle, poke LOL). Let me know what you guys think.
New beta for non-stock ROMs! Recommended for advanced users and ROM developers until we flush out and identify any issues or improvements that need to be made
View attachment 1013277
I have modified the kernel code to conditionally compile based upon a config switch called CONFIG_ASUS_OVERCLOCK_MODES. When turned OFF, this allows me to easily compile and release a version of the same kernel base that is generic without the Asus performance modes (system_mode). This will make the kernel behave like a regular kernel that works properly with SetCPU, No-frills, ROM Control etc. on non-stock ROMs. The generic kernel still runs fine on stock, but the Asus modes no longer will change the CPU frequency, but only set the core_cap_level voltage.
At boot, I still recommend running the following script with init.d or a ROM dev can also integrate into your initramfs init.cardhu.rc somewhere. For example, AOKP may already be good to go with this.
Code:
#!/bin/sh -x
# Generic kernel settings
echo 1300 /sys/kernel/tegra_cap/core_cap_level
echo 0 > /sys/kernel/tegra_cap/core_cap_state
echo 0 > /sys/devices/platform/tegra_grhost/enable_3d_scaling
echo 10 > /sys/module/cpu_tegra3/parameters/mp_overhead
echo 9999999 > /sys/module/cpu_tegra/parameters/pwr_cap_limit_1
echo 9999999 > /sys/module/cpu_tegra/parameters/pwr_cap_limit_2
echo 9999999 > /sys/module/cpu_tegra/parameters/pwr_cap_limit_3
echo 9999999 > /sys/module/cpu_tegra/parameters/pwr_cap_limit_4
setprop power.saving.mode 1
setprop persist.tegra.NV_FPSLIMIT 0
setprop persist.sys.NV_FPSLIMIT 0
setprop persist.sys.NV_POWERMODE 0
Since the frequency defaults to to max (1.8GHz), you may want to set it in the init.cardhu.rc script with something like this:
Code:
write /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq 1600000
Click to expand...
Click to collapse
Awesome Motley! Should that last line be:
Code:
write /sys/devices/system/cpu/cpu0/cpufreq/scaling_[color=red]max[/color]_freq 1600000
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)
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.