Useful things to throw into froyo.user.conf - Touch Pro2, Tilt 2 Android General

I've been building a list of commands that gets executed into froyo.user.conf. Use this as a reference, as I won't be responsible for your Rhodium exploding.
# Dealing with incomplete swapfile support in userinit.sh
swapon /sdcard/swapfile
# busybox /bin/sh is 10000x better than what's in /system
mount --bind /bin/sh /system/bin/sh
# I use F22's b1home setup, not only do I get needed symbols, it doesn't do idiotic stuff like define SMS to GRAVE, then redefine GRAVE to 0x03 (Ctrl-C) in the kcm file - read my post below on how to do this
mkdir -p /init.etc/keymaps/custom
cp -a /sdcard/*.kcm* /sdcard/*.kl /init.etc/keymaps/custom
# Create /data/local if it doesn't exist, then symlink bin to /sdcard/bin if that doesn't exist
mkdir -p /data/local
[ -e /data/local/bin ] || ln -s /sdcard/bin /data/local/bin
There is now a file that is called /sdcard/local.prop that gets copied on boot. Anything related to setprop can be set there, ie. I have:
dalvik.vm.execution-mode = int:jit
dalvik.vm.heapsize = 32m
ro.cdma.home.operator.alpha seems unnecessary now, but you must still have a valid eri.xml (again residing in /sdcard) to get the system to show you the provider.
-- Starfox
---
This is for legacy FRX06 or earlier, kept as reference:
# Readahead for /sdcard as per hyc
echo 2048 > /sys/devices/virtual/bdi/179:0/read_ahead_kb
# Dealing with incomplete swapfile support in userinit.sh, I use a 32mb file
swapon /sdcard/swapfile
# CDMA stuff, /etc gets rebuilt on every boot for now
echo "ro.cdma.home.operator.alpha = Sprint" >> /etc/default.prop
echo "ro.cdma.home.operator.numeric = 31000" >> /etc/default.prop
# CDMA stuff since I keep the Sprint SIM in & changing dalvik to jit
sed -e 's/default_network = 0/default_network = 4/' -e 's/vm.execution-mode = int:fast/vm.execution-mode = int:jit/' /system/build.prop > /sdcard/build.prop
# Bigger heapsize
echo "dalvik.vm.heapsize = 32m" >> /sdcard/build.prop
# /system/build.prop is mounted from /tmp, bindmount mine instead
umount -f /system/build.prop; mount --bind /sdcard/build.prop /system/build.prop
# GPS (0,0) fix
umount -f /system/lib/libhardware_legacy.so; mount --bind /sdcard/libhardware_legacy.so /system/lib/libhardware_legacy.so
# Using hyc RIL
mount --bind /sdcard/libhtcgeneric-ril.so /lib/froyo/libhtcgeneric-ril.so
# hyc's injection RIL lib
mount --bind /sdcard/libril.so /system/lib/libril.so
# Use /bin/sh (Busybox) over statically compiled sh, esp. for arrow key support
mount --bind /bin/sh /system/bin/sh
# I keep eri.xml and serialno in /sdcard/conf, and an empty dir called local
cp -a /sdcard/conf/* /data
# Term emu puts /data/local/bin in path first, I keep some binaries in /sdcard/bin, need to /data/local first
ln -s /sdcard/bin /data/local/bin

Nice. May want to note that the GPS 0,0 fix requires a fixed library.
Two sources for this:
1) Use the one on my testing thread
2) Extract it from system.ext2 of FRX06 (It may be difficult to do this with a running system due to the bindmounts. Although I see you're effectively unmounting the existing bindmount prior to mounting the new one - I should try this weekend to see if that is enough to get the fix to work with FRX06.)
2) is preferable as it's the official release, although it should be identical to mine.

Thanks alot for doing this.
Any chance you could attach the files you are showing to replace in some of your commands? Like some I see are 'build.prop', 'libhardware_legacy.so', 'libhtcgeneric-ril.so' and 'libril.so'.
Or possibly link to the original thread/post you got this from?

where do we put these in froyo.user.conf

anish88 said:
where do we put these in froyo.user.conf
Click to expand...
Click to collapse
Most go in CustomCommands...

Starfox said:
I've been building a list of commands that gets executed into froyo.user.conf. Use this as a reference, as I won't be responsible for your Rhodium exploding.
Click to expand...
Click to collapse
I hope to see most of these already incorporated in the next release...
# Readahead for /sdcard as per hyc
echo 2048 > /sys/devices/virtual/bdi/179:0/read_ahead_kb
Click to expand...
Click to collapse
I've requested this readahead patch to be merged.
# Dealing with incomplete swapfile support in userinit.sh, I use a 32mb file
swapon /sdcard/swapfile
Click to expand...
Click to collapse
Current Android system_server is too stupid to work well with swap. And I think our low_memory_killer settings need to be tweaked to work well with it. I haven't spent any time investigating but it definitely slows down too much. I would recommend against using swap for now.
# CDMA stuff, /etc gets rebuilt on every boot for now
echo "ro.cdma.home.operator.alpha = Sprint" >> /etc/default.prop
echo "ro.cdma.home.operator.numeric = 31000" >> /etc/default.prop
# CDMA stuff since I keep the Sprint SIM in & changing dalvik to jit
sed -e 's/default_network = 0/default_network = 4/' -e 's/vm.execution-mode = int:fast/vm.execution-mode = int:jit/' /system/build.prop > /sdcard/build.prop
Click to expand...
Click to collapse
CDMA stuff is going to be automated in next ril. No more manual prop settings needed.
# Bigger heapsize
echo "dalvik.vm.heapsize = 32m" >> /sdcard/build.prop
Click to expand...
Click to collapse
Good idea.
# GPS (0,0) fix
umount -f /system/lib/libhardware_legacy.so; mount --bind /sdcard/libhardware_legacy.so /system/lib/libhardware_legacy.so
# Using hyc RIL
mount --bind /sdcard/libhtcgeneric-ril.so /lib/froyo/libhtcgeneric-ril.so
Click to expand...
Click to collapse
These should no longer be needed when my rootfs requests are merged.
# hyc's injection RIL lib
mount --bind /sdcard/libril.so /system/lib/libril.so
Click to expand...
Click to collapse
I've requested that this be merged too.
# I keep eri.xml and serialno in /sdcard/conf, and an empty dir called local
cp -a /sdcard/conf/* /data
Click to expand...
Click to collapse
New system image will have a nicer default eri.xml ...

Does this look right? It's hard tell because it's all a jumble in notepad. I highlighted the two items I added in red.
Code:
# General parameters
general{
renice=1 # Run the renice script to inprove call answering
}
#compcache related parameters
compcache{
compcache_en=1 # enable(1) or disable(0)20 compcache
cc_disksize=100 # Ram swap disksize - any number between 1 to 98 should
work; default is 1/4 of the RAM (24)
cc_memlimit=64 # Limit the memory usage for backing swap (cc .5x known issue-defaults to
15% of total RAM)
cc_backingswap_en=0 # enable(1) or disable(0) backing swap
cc_backingswap=/dev/block/mmcblk0p4 # pointing to
the backingswap partition device, swap
}
#create swap file for compcache or linux swap
swap_file{
swap_file_en=0 # set to 1 to
create swap file
# set to 0 to del the swap file
linux_swap_file_size=32 # swap file size in MB
linux_swap_file=/sdcard/swapfile # pointing to the swap file location ( must be /system/sd/)
}
#Linux swap parameters
#
# linux
swap can only be enabled if cc_backingswap_en is set to "0"
#
linux_swap{
linux_swap_en=0 # enable(1) or disable(0) linux swap
linux_swap_partition=/dev/block/mmcblk0p4 # swap partition device
}
#virtual memory
sys_vm{
sys_vm_en=1 # enable(1) or disable(0)
virtual memory configurations
swappiness=0 # default 60
page_cluster=0 # default 3, (0 since CM3.9.6+)
laptop_mode=5 #
default 0
dirty_expire_centisecs=3000 # default 3000
dirty_writeback_centisecs=1500 # default 500
dirty_background_ratio=3 #
default 5
dirty_ratio=5 # default 10
vfs_cache_pressure=200 # default 100 (tendency of the kernel to reclaim cache memory)
overcommit_memory=1 # default 0 (0=Heuristic 1=Always overcommit 2=Don't overcommit)
overcommit_ratio=80 # default 50 (% of
Physical+Virtual memory to allow allocation)
}
# custom shell commands, these commands run last
custom_shells{
chmod 777
/etc/dbus.conf
#echo 2 > /sys/devices/platform/msm_hsusb/usb_function_switch
rm -f /sdcard/fsck*.rec
modprobe ipv6
mount --bind
/sdcard/Android/libhtcgeneric-ril.so /lib/froyo/libhtcgeneric-ril.so
[COLOR=Red]# Bigger heapsize
echo "dalvik.vm.heapsize = 32m" >> /sdcard/build.prop# /system/build.prop is mounted from /tmp, bindmount mine instead
umount -f /system/build.prop; mount --bind /sdcard/build.prop /system/build.prop[/COLOR]#echo "Hello!!!" # example
#echo "You can create
your own commands here" # example
}

Avatar28 said:
Does this look right? It's hard tell because it's all a jumble in notepad. I highlighted the two items I added in red.
Click to expand...
Click to collapse
Looks fine - use Notepad++ if you're on Windows.

arrrghhh said:
Looks fine - use Notepad++ if you're on Windows.
Click to expand...
Click to collapse
Hmm, you're right. MUCH better.

System wouldn't boot into Android at first. Just went black when it should load the animated xdandroid splash screen. Finally realized that I wasn't thinking and needed to copy the build.prop file from the system folder to the SD card before I could call it. Oops.

would anyone care to provide some info on what each command does? benefits?

manny05 said:
would anyone care to provide some info on what each command does? benefits?
Click to expand...
Click to collapse
He's commented each line... if you're not sure then don't use it. highlandsun also went thru them pretty thoroughly.

I think the only thing that isn't in the category of "soon to be obsolete" or "explained by highlandsun" is the vm.heapsize tweak
I believe that vm.heapsize sets the maximum amount of memory a single app can use. As a result, it can sometimes fix applications that claim to be running out of memory when there is plenty of system RAM. (Traffic features in Google Maps are one thing that frequently breaks with the default setting of 12-16M)

Entropy512 said:
I think the only thing that isn't in the category of "soon to be obsolete" or "explained by highlandsun" is the vm.heapsize tweak
I believe that vm.heapsize sets the maximum amount of memory a single app can use. As a result, it can sometimes fix applications that claim to be running out of memory when there is plenty of system RAM. (Traffic features in Google Maps are one thing that frequently breaks with the default setting of 12-16M)
Click to expand...
Click to collapse
how much memory do you think an app needs? i mean how would i know what to set it to.

manny05 said:
how much memory do you think an app needs? i mean how would i know what to set it to.
Click to expand...
Click to collapse
If you read the OP, that value seems good. AFAIK the default is 12, in the OP it's set to 32.

manny05 said:
how much memory do you think an app needs? i mean how would i know what to set it to.
Click to expand...
Click to collapse
Most of the Android forums I've read seem to recommend 32m - which seems to be more than enough for any app I am aware of. I think the majority of cooked Android ROMs for other devices use that value.

Added support for bluetooth:
sed -e "s% /system/bin/hciattach % /data/local/bin/brcm_patchram_plus -r --enable_hci %" -e "s%-n -s 115200 /dev/ttyHS1 texas 115200 flow%--enable_lpm --baudrate 4000000 --patchram /sdcard/BCM4325.hcd /dev/ttyHS1%" -i /etc/init.rc
This of course assumes you have patchram and the hcd files in their respective place.
-- Starfox

Starfox said:
# Bigger heapsize
echo "dalvik.vm.heapsize = 32m" >> /sdcard/build.prop
Click to expand...
Click to collapse
If this heapsize line is all I want to use from the thread, should I omit the ">> /sdcard/build.prop"? This stuff is all over my head, but I'm thinking that portion might refer to other commands I'm not using and a file I might not have. Any illumination would be appreciated.
___________________
The following two commands from elsewhere (as pulled from manekineko's custom conf) enable droidwall. This seemed like a good thread for them to be in.
modprobe xt_owner
modprobe ipt_REJECT
Click to expand...
Click to collapse

For those using F22's rootfs with the new keymaps and would like to use it over the somewhat braindead one residing in FRX07, these commands will help you keep the mappings:
1) While using F22's rootfs with the correct physkeyboard, copy raph_navi_pad.* and microp-keypad.* from /etc/keymaps to /sdcard
2) Rename raph_navi_pad.kl to qwerty.kl
3) Switch over to FRX07, and add these lines to froyo.user.conf
cp -a /sdcard/*.kcm.bin /sdcard/*.kl /init.etc/keymaps/default
4) Then go to startup.txt, and delete any reference to physkeyboard=
This prevents the init from overwriting "our" keymaps with theirs, as keylayout processing occurs after parsing froyo.user.conf. The init copies whatever is in /init.etc/keymaps/default to the proper place in /system/usr/key*, then checks /init.etc/keymaps/$physkeyboard/ exist, then does the same for that directory.
If you want to preserve the default keymaps directory for some reason, you could also do:
mkdir -p /init.etc/keymaps/custom
cp -a /sdcard/*.kcm.bin /sdcard/*.kl /init.etc/keymaps/custom
And use physkeyboard=custom for steps 3 and 4.
Now time for a rant:
Really why even bother defining a key to GRAVE (microp*.kl) then defining GRAVE as 0x03 (aka Ctrl-C) in the .kcm file. You can see the generated .kcm.bin has that included, by hd microp*.kcm.bin, at the bottom. Also why take away a useable SYM popup with 0x09 (aka Ctrl-I or TAB), again in the .kcm file.
Also, the choice of b1home vs b4home. IMHO Android is too unstable to lose ENDCALL. I can recall a number of times the system became unusable with an active phone call. Relying on touch screen interaction to end a call, on a what is still an unstable port, is quite idiotic. Not to mention you lose that nice end button feature in Spare Parts. You still need the same keypress to get to the dialer with either (as pressing takes you to either the home or contact list, and another to go to dialer).
-- Starfox

Updated post for FRX07, first and last post has been edited.
-- Starfox

Related

[WIP] [DEV] [HOWTO] Ubuntu on Nook Color! UPDATE 1/5/11

DISCLAIMER: You know the risks, bricking, breaking etc. I'm not, nor is anyone else responsible if something goes wrong with your device, especially should it turn into a cave troll and bludgeon someone to death.
You will have to be rooted for this to work.
Update 1/5/11
Changed the install and loader scripts re-compressed and uploaded, new download link. Stream lined the installation process (removed 5 steps)
Update 1/4/11
reflect changes to ubuntu.sh and bootubuntu scripts and streamlining the process. Added screenshots
_________________________
I was over at nexusonehacks.net and looking at the ubuntu on nexus one hack and was thinking that this could be ported to the nook color. The idea is to run ubuntu from an img on the sd card.
The following is a modified version of the "how to" orginally posted here
http://nexusonehacks.net/nexus-one-hacks/how-to-install-ubuntu-on-your-nexus-oneandroid/
Credits
The guys at NexusOneHacks
xda user munday who has modified the scripts to work for the nook color
Devs at XDA Developer for the Ubuntu ARM image for HTC HD2
Saurik (Jay Freeman) for the Debian G1 script, which was hacked for Ubuntu on Nexus One! and then re-hacked for the Nook Color by munday
Here we go:
1) Go download the ubuntu file here: http://www.megaupload.com/?d=67BU4Y3T
2) Extract the contents using 7zip http://www.7-zip.org/download.html
3) Copy the extracted folder "ubuntu" to the root of your SD card
4) Unmount the nook from your pc, go into the app NookColor Tools (if you don't have it download it here courtesy of Ben 74 and click All Settings->Development then uncheck Auto Mount. This will prevent the SD card from being mounted automatically when plugged into the PC
5) Plug the Nook back into your pc and open a command line then navigate to your android sdk folder ie C:\android-sdk or wherever you have it and type
Code:
adb devices
Hit enter and make sure that the nook color comes up (should be the SN of your Nook)
Note: This can also be done from terminal emulator instead of adb...but it is kind of a pain
6) Now we want to go into the command line on the nook so type
Code:
adb shell
Hit enter and this should bring up a "#" sign.
7) Type
Code:
su
hit enter (I do this just as a force of habit)
8) Now we navigate to the ubuntu folder we just copied to our sd card by entering
Code:
cd /sdcard/ubuntu
hit enter. To confirm you are where you want to be you can type
Code:
ls
and it should list the contents of the ubuntu folder.
9) Run the setup script ubuntu.sh by entering the following:
Code:
sh ./ubuntu.sh
hit enter
10) Now type
Code:
bootubuntu
and hit enter
11) So now we have ubuntu command line up and running which should look like:
Code:
[email protected]:/#
We will need to get some packages to run a gui and then connect to it via VNC client. So we need to update a few things first. Type:
Code:
apt-get update
then
Code:
apt-get install tightvncserver
now we need the gui elements so enter this:
Code:
apt-get install lxde
12) Type the following:
Code:
export USER=root
vncserver -geometry 1024×600
this sets the resolution...you can change it to play around, but the native resolution for the nook is 1024x600. This is also where you will set the password for your vnc server...make sure to remember it
13) Next, we are going to add the following to /root/.vnc/xstartup file using cat command: (hit enter after each line and ignore the fact that it looks like it does it twice)
Code:
cat > /root/.vnc/xstartup
#!/bin/sh
xrdb $HOME/.Xresources
xsetroot -solid grey
icewm &
lxsession
After hitting enter after the last line press "Ctrl+D" twice then press enter
14) We need the vnc server to start every time we start ubuntu, type this:
Code:
cat > front
export USER=root
cd /
rm -r -f tmp
mkdir tmp
cd /
vncserver -geometry 1024×600
Same as before, hit enter after each line then after hitting enter for the last line press "Ctrl+D" twice then press enter.
15) Enter this
Code:
cat front /root/.bashrc > temp
Then
Code:
cp temp /root/.bashrc
16) Now on the nook open up your vnc viewer app (android vnc viewer or PocketCloud...or whatever you use)
Use the following settings:
Host Address: 127.0.0.1 (some don't require this)
Password: the password you set up in step 16
Port: 5901
Save and then click connect and you should be up and running on ubuntu! To leave ubuntu type exit from adb. This should kill ubuntu. Exit adb and then you can disconnect the nook from your pc.
To start ubuntu from the nook open up a terminal emulater and type:
Code:
bootubuntu
Hit enter, this should bring up the [email protected], hhen press "Home" key and open up your vnc app. Now you are ready to rock your Linux tablet!
You could also use gscript lite to automate the process of starting ubuntu so you don't have to type it in the terminal everytime. You can get gscript lite from the market or download the file I have attached.
It does seem a little laggy..just a little...for now anyway
To exit ubuntu: Disconnect the vnc client then hold the "Home" key (I use button savior which brings up a nice little task manager) and click the Terminal emulator when it pops up under running tasks. Once you are back in the terminal you can type:
Code:
exit
to shut down ubuntu.
Enjoy and make sure you thank munday and the guys at nexusonehacks and all the devs who helped make it possible.
-devastator
EDIT:
I noticed that after rebooting the nook would hang at the "Future of reading" screen....if this happens turn the device off remove the sd card the turn the nook back on. It should boot fine. After it's finished you can return the sd card and mount it. This is strange and I'm looking into it. I'm not sure if this is limited to me or if it is universal to all nooks. It also still fails at shutting ubuntu down for some reason. I'm still looking into this.g into this.
I got it going, just needed a few "busybox"-es here and there . It needs some work, right now to get X you have to use VNC.
It's sluggish but a bit more work might just yield something a bit more usable. I'll play more tomorrow night.
Here's my scripts:
ubuntu.sh
Code:
mount -o remount,rw /dev/block/mmcblk0p5 /system
busybox modprobe ext2
rm -f /data/local/bin/fsrw
rm -f /data/local/bin/bootubuntu
rm -f /data/local/bin/unionfs
rm -f /data/local/bin/installer.sh
rm -f /data/local/bin/mountonly
mkdir /data/local/mnt
#busybox clear
rm /system/bin/fsrw
rm /system/bin/bootubuntu
rm /system/bin/unionfs
rm -/system/bin/mountonly
busybox cp -f fsrw /system/bin
busybox cp -f bootubuntu /system/bin
busybox cp -f unionfs /system/bin
busybox cp -f mountonly /system/bin
cd /sdcard/ubuntu
busybox chmod 4777 *
cd /system/bin/
busybox chmod 4777 *
cd /
#busybox clear
echo " "
echo "Ubuntu Chroot Bootloader v0.1"
echo "Ubuntu Bootloader is now installed!"
echo "This process does NOT damage Android OS!"
echo " "
echo "Original Installer by Charan Singh"
echo "Modified for Ubuntu Chroot by Max Lee at NexusOneHacks.net"
echo " "
echo "To enter the Debian Linux console just type 'bootubuntu'"
bootubuntu
Code:
mount -o remount,rw /dev/block/mmcblk0p5 /system
export kit=/sdcard/ubuntu
export bin=/system/bin
export mnt=/data/local/mnt
export PATH=$bin:/usr/bin:/usr/sbin:/bin:$PATH
export TERM=linux
export HOME=/root
busybox mknod /dev/loop2 b 7 0
mount -o loop,noatime -t ext2 $kit/ubuntu.img $mnt
mount -t devpts devpts $mnt/dev/pts
mount -t proc proc $mnt/proc
mount -t sysfs sysfs $mnt/sys
busybox sysctl -w net.ipv4.ip_forward=1
echo "Setting /etc/resolv.conf to Google Open DNS 8.8.8.8 and 8.8.4.4"
echo "nameserver 8.8.8.8" > $mnt/etc/resolv.conf
echo "nameserver 8.8.4.4" >> $mnt/etc/resolv.conf
echo "Setting localhost on /etc/hosts "
echo "127.0.0.1 localhost" > $mnt/etc/hosts
echo "READY TO ROCK AND ROLL BABY! "
echo "Brought to you by NexusOneHacks.net and the open source community! "
echo " "
busybox chroot $mnt /bin/bash
#After exit command is executed clear it all up
echo " "
echo "Shutting down Ubuntu"
umount $mnt/dev/pts
umount $mnt/proc
umount $mnt/sys
umount $mnt
Then just followed the instructions at nexusonehacks.
note: to run bootubuntu i had to use sh and the use the full path:
Code:
# sh /system/bin/bootubuntu
other note: I was using adb not a term app on the nook.
Obligatory video
I can't post links yet so check: youtube.com/watch?v=TnXfZ6aagn8 for a really boring video
EDIT: switched the names, DOH!
I also had to use sh and the full path also. Thanks for the update on the script...gonna try it in the morning (it's 2am here) will also see if I can help to get it running smoother. What class SD card are you using? I imagine a class 4 or higher would yeild better results as far as responsiveness goes.
The sd is a class 2 that came in one of my dev phones. I'll pick up a faster one tomorrow after work and test it out.
It's just about 3am here now, we must be in the same time zone.
I'm going to bed now, but first here's a modded version of the script you had originally posted that also works now.
bootubuntu
Code:
#!/bin/sh
mount -o remount,rw /dev/block/mmcblk0p5 /system
export kit=/sdcard/ubuntu
export bin=/system/bin
busybox [ ! -d /data/local/ubuntu ] && mkdir /data/local/ubuntu
export mnt=/data/local/ubuntu
export PATH=$bin:/usr/bin:/usr/sbin:/bin:$PATH
export TERM=linux
export HOME=/root
busybox mknod /dev/loop1 b 7 0
busybox losetup /dev/block/loop1 /sdcard/ubuntu/ubuntu.img
mount -t ext2 /dev/block/loop1 /data/local/ubuntu
#mount -o loop,noatime -t ext2 $kit/ubuntu.img $mnt
mount -t devpts devpts $mnt/dev/pts
mount -t proc proc $mnt/proc
mount -t sysfs sysfs $mnt/sys
busybox sysctl -w net.ipv4.ip_forward=1
echo "Setting /etc/resolv.conf to Google Open DNS 8.8.8.8 and 8.8.4.4"
echo "nameserver 8.8.8.8" > $mnt/etc/resolv.conf
echo "nameserver 8.8.4.4" >> $mnt/etc/resolv.conf
echo "Setting localhost on /etc/hosts "
echo "127.0.0.1 localhost" > $mnt/etc/hosts
echo "READY TO ROCK AND ROLL BABY! "
echo "Brought to you by NexusOneHacks.net and the open source community! "
echo " "
busybox chroot $mnt /bin/bash
#After exit command is executed clear it all up
echo " "
echo "Shutting down Ubuntu"
umount $mnt/dev/pts
umount $mnt/proc
umount $mnt/sys
umount $mnt
busybox losetup -d /dev/loop1
#unregistering the loopback device just seems to die. need to fix or remove.
I'll look at the N1 formus tomorrow too and see if they have made progress in getting X to run fast or without need for VNC.
Nice work, I am addicted in seeing the crazy crap people are doing everyday.
Couldn't sleep so I'm messing around with it now...I'm using a class 4 and have it up and running. It does seem to be a little laggy, but I don't have a class 2 to compare it to. Let me know what you find out, I'll keep playing with it also to see if I can get it to be more responsive...but we are definately on our way to having a great little linux tablet in addition to android. You should also be able to use this for other builds of linux also by just changing out the .img file to a flavor of your choosing. I'm excited
I have also updated the OP with the how to and credits. Really appreciate your help munday.
I noticed that after rebooting the nook would hang at the "Future of reading" screen....if this happens turn the device off remove the sd card the turn the nook back on. It should boot fine. After it's finished you can return the sd card and mount it. This is strange and I'm looking into it. I'm not sure if this is limited to me or if it is universal to all nooks.
Edit:
Running into some strange occurrences...it appears that when you type exit from the terminal to kill ubuntu, I believe ubuntu stays running...anyway, I'm going to bed and will work on it more tomorrow.
devastatorx said:
You should also be able to use this for other builds of linux also by just changing out the .img file to a flavor of your choosing. I'm excited
Click to expand...
Click to collapse
Are there any increased risks with changing the version you use?
Well, you will want to make sure that the build supports ARM based devices.
munday said:
Then just followed the instructions at nexusonehacks.
note: to run bootubuntu i had to use sh and the use the full path:
Code:
# sh /system/bin/bootubuntu
Click to expand...
Click to collapse
I fixed this, the scripts were backwards, I have updated the OP to reflect the changes and bootubuntu now works
devastatorx said:
I fixed this, the scripts were backwards, I have updated the OP to reflect the changes and bootubuntu now works
Click to expand...
Click to collapse
sweet, i can't wait to get home to play more!!!
I've tried running ubuntu.sh from the terminal emulator (With su) and from ADB, and have not had success with either.
The readout is:
Code:
': File existste '/system/bin
': File existste '/system/bin
': File existste '/system/bin
: not found
: not found
cd: can't cd to /sdcard/ubuntu
: not found
: No such file or directory
: not found
cd: can't cd to /system/bin
: not found
: No such file or directory
: not found
cd: can't cd to /
: not found
: not found
Ubuntu Chroot Bootloader v0.1
Ubuntu Bootloader is now installed!
etc., etc.
Is there a problem with how I copied the script? I assume the first part about the file existing is due to this being the third or fourth time I've tried running the script (Unsuccessfully), but I've no idea how to interpret the rest.
Thanks
munday said:
sweet, i can't wait to get home to play more!!!
Click to expand...
Click to collapse
I sent you a message
Link3737 said:
I've tried running ubuntu.sh from the terminal emulator (With su) and from ADB, and have not had success with either.
The readout is:
Code:
': File existste '/system/bin
': File existste '/system/bin
': File existste '/system/bin
: not found
: not found
cd: can't cd to /sdcard/ubuntu
: not found
: No such file or directory
: not found
cd: can't cd to /system/bin
: not found
: No such file or directory
: not found
cd: can't cd to /
: not found
: not found
Ubuntu Chroot Bootloader v0.1
Ubuntu Bootloader is now installed!
etc., etc.
Is there a problem with how I copied the script? I assume the first part about the file existing is due to this being the third or fourth time I've tried running the script (Unsuccessfully), but I've no idea how to interpret the rest.
Thanks
Click to expand...
Click to collapse
Try using these, just unrar and then copy them in your ubuntu folder, if it asks to overwrite just click yes...also you have autmounting of the sd card turnned off in nook color tools settings right?
Yeah, it must have been an error on my end. Using the updated scripts you posted worked like a charm.
Thanks!
Link3737 said:
Yeah, it must have been an error on my end. Using the updated scripts you posted worked like a charm.
Thanks!
Click to expand...
Click to collapse
Good to hear!
I'm currently working on making this a port to the SD card so that with the sd card in it boots into ubuntu from power off, and with the sd card out it boots to android then you replace the sd and use it for storage like normal. It will also run a lot snappier....well that's the idea anyway.
devastatorx said:
Good to hear!
I'm currently working on making this a port to the SD card so that with the sd card in it boots into android from power off, and with the sd card out it boots to android then you replace the sd and use it for storage like normal. It will also run a lot snappier....well that's the idea anyway.
Click to expand...
Click to collapse
Booting from SD in the same fashion as Nookie Froyo? That sounds like it would give a huge performance boost over the current method, I can't wait to see what you come up with.
This should be acheivable using the method mentioned in this topic:
http://forum.xda-developers.com/showthread.php?t=873243 thanks to clockworx.
Currently looking into this
devastatorx said:
This should be acheivable using the method mentioned in this topic:
http://forum.xda-developers.com/showthread.php?t=873243 thanks to clockworx.
Currently looking into this
Click to expand...
Click to collapse
I was thinking the exact same thing, the nook seems to like booting from sd, so we should be able to set up the partitions like the foryo sd and edit the init.rc and env.txt to boot ubuntu instead of android. Just a theory though. It's my plan for tonight anyway.
munday said:
I was thinking the exact same thing, the nook seems to like booting from sd, so we should be able to set up the partitions like the foryo sd and edit the init.rc and env.txt to boot ubuntu instead of android. Just a theory though. It's my plan for tonight anyway.
Click to expand...
Click to collapse
I also stumbled across this: http://androix.org/ Which talks about a native android xserver which does a way with the vnc aspect altogether. I downloaded and attempted to install but I get the error "There is a problem parsing the package" and I haven't had any luck plus there isn't much documentation.
Let me know how it goes munday, I'll be working on the same thing later (have to take the fiance out for dinner)
question
I was just curious, after installing ubuntu can we install flash as we would had we booted linux from netbook?

[Q] Has anybody know how to root GT-I9001

Hi,
Is there some way to root I9001 now or I have to wait.
Firmware I9001XXKE8
Android 2.3.3
Kernel 2.6.35.7
I tried several methods (Superoneclick 1.7, 1.9.1, Gingerbreak 1.2) available for I9000 but nothing positive.
If someone can guide me in this process will be very appreciated.
Go here for step by step instructions: http://androidhogger.com/how-to-root-samsung-galaxy-s2-heres-the-tutorial.html.
Hi,
It is guide for I9100 but I have I9001 it is completely different hardware, so I doubt that the same guide can be applied to I9001.
Any news on rooting? Have you sucseeded?
No, still waiting, but it starts to sell to mass in Russia so soon will get news.
Since yesterday the new 2.3.4 firmware is out:
http://netload.in/datei5X4ZyAkNkO/I9001XXKP4_v2.3.4.rar.htm
(edit: maybe its not 2.3.4 ... samfirmware write 2.3.3)
... but we wait still for the root...
SPOOKY
afaik 2.3.x cannot be rooted. only 2.2.x
sweetnsour said:
afaik 2.3.x cannot be rooted. only 2.2.x
Click to expand...
Click to collapse
Say what? Ofcourse 2.3.x can be rooted. We just have to get more attention to the 9001 so that the rom builders actively start devving this device.
Any one knows how to root this device?
Sent from my GT-I9001 using XDA Premium App
I'm looking for a solution as well, please don't make me use Touchwiz..
Have tried to look into ways to root this phone. It looks like it'll need to be root in similar way to i9100. So guess will need to wait for dev to come up with a special kernel for rooting.
İ hope they they ll come up with new karnel as soon.as possible
Sent from my GT-I9001 using Tapatalk
sweetnsour said:
afaik 2.3.x cannot be rooted. only 2.2.x
Click to expand...
Click to collapse
Here http://forum.xda-developers.com/archive/index.php/t-1136781.html is afaik 2.3.3 rotted. I think there is a posibility to root I9001.
I hope so ....! Did u try this method?
Sent from my GT-I9001 using Tapatalk
westcrip said:
I hope so ....! Did u try this method?
Sent from my GT-I9001 using Tapatalk
Click to expand...
Click to collapse
Nope but I will try in this weekend. I found how to restore phone when you brick it (if something happen) , and it's not so hard. That's why I will use different method to root it. I just wonder if one of brick is avilable or more. I only know how to unbrick by this method http://www.youtube.com/watch?v=2qB4RNoXTd8 . Its very simple just install software downoladed from http://www.samfirmware.com/WEBPROTECT-i9001.htm our software is in the middle I9001XXKF8 ##. Odin as well recognize my phone.
I have managed it to root the i9001. So far it is very complicated, and the detailed guide as well as the analysis of SMD archives is only in German available:
http://www.android-hilfe.de/samsung...g-galaxy-s-plus-i9001-rooten.html#post1911955
As always: You are responsible for your Phone! If someone bricks his device using this guide, I am not responsible for that! Bad Luck, I have warned you! Its a dangerous job! You really shouldn't do it.
In short:
- extract the PDA SMD File
- mount system.ext4
- copy su binary and Superuser.apk into the mounted image
- adjust the file permissions (especially the suid bit for su)
- umount system.ext4
- repack the PDA SMD.
I have created two Linux bash scripts for extracting and packing SMD Archives. Warning: I'm not very experienced in bash scripting. If someone is here who is capable of making a nice script of it, feel free! The scripts are working, that's all so far. They won't win a price in a beauty contest.
First the extract.sh:
Code:
#!/bin/bash
base=0
length=1
while (( length > 0 ))
do
# calculate Length
let "skip = base + 18"
length=`hexdump -e '"%d"' -s ${skip} -n 2 ${1}`
let "length = length * 65536"
let "skip = base + 16"
length2=`hexdump -e '"%d"' -s ${skip} -n 2 ${1}`
let "length += length2"
let "length = length / 512" # Number of 512-Byte blocks
# calculate offset
let "skip = base + 22"
offset=`hexdump -e '"%d"' -s ${skip} -n 2 ${1}`
let "offset = offset * 65536"
let "skip = base + 20"
offset2=`hexdump -e '"%d"' -s ${skip} -n 2 ${1}`
let "offset += offset2"
let "offset = offset / 512" # Number of 512-Byte blocks
# save header in case of first loop
if (( base == 0 ))
then
dd if=${1} bs=512 of=header count=${offset}
fi
# extract filename
let "skip = base + 32"
filename=`dd if=${1} skip=${skip} count=16 bs=1 2>/dev/null`
# and finally: extract image
if (( length > 0 ))
then
echo "Length: ${length}"
echo "Offset: ${offset}"
echo "Filename: ${filename}"
dd if=${1} bs=512 of=${filename} skip=${offset} count=${length} 2>/dev/null
fi
# next header
let "base += 64"
done
Syntax: ./extract.sh Archive.smd
The script will extract the archive and create a lot of local files (system.ext, boot.img and so on). Well, the content of the Archive obviously.
Root the system.ext4:
I have used the newest su and Superuser.apk from here (3.0-beta4 at the moment. Newer ones should be ok):
http://goo-inside.me/superuser
The steps for rooting a system.ext4:
Code:
mkdir system
sudo mount -o loop system.ext4 system
sudo cp su system/xbin/
sudo chown 0.0 system/xbin/su
sudo chmod 4755 system/xbin/su
sudo cp Superuser.apk system/app/
sudo chown 0.0 system/app/Superuser.apk
sudo chmod 644 system/app/Superuser.apk
sudo umount system
And the pack.sh. Note: The pack.sh so far expects an existing "header" file created from an extract action and all files to be added into the archive. The resulting archive will have the same contents, as the starting archive (of course with a modified system.ext4). MD5 Checksums in the archive are calculated automatically.
Code:
#!/bin/bash
base=16
length=0
filename=dummy
# save the beginning
dd if=header of=newheader bs=1 count=16 2>/dev/null
# First create the MD5 checksums of all included (and maybe modified) files and generate the new header
while [ ! -z "${filename}" ]
do
# Length, offset, etc. is unchanged, just copy it.
let "skip = base"
dd if=header of=newheadertmp bs=1 skip=${skip} count=32 2>/dev/null
cat newheadertmp >> newheader
rm newheadertmp
# extract filename
let "skip = base + 16"
filename=`dd if=header skip=${skip} count=16 bs=1 2>/dev/null`
if [ ! -z "${filename}" ]
then
echo "creating MD5Sum of: ${filename}"
checksum=`md5sum ${filename} | tr '[a-z]' '[A-Z]'`
echo -n ${checksum:0:32} >> newheader
fi
# next header
let "base += 64"
done
# save the rest of the old header.
filesize=$(stat -c%s header)
let "base -= 32"
let "size = filesize - base"
dd if=header of=newheadertmp bs=1 skip=${base} count=${size} 2>/dev/null
cat newheadertmp >> newheader
rm newheadertmp
# the new header is the first content of the new archive.
cat newheader > ${1}
# now add all files to the archive.
filename=dummy
base=16
while [ ! -z "${filename}" ]
do
# extract filename
let "skip = base + 16"
filename=`dd if=header skip=${skip} count=16 bs=1 2>/dev/null`
if [ ! -z "${filename}" ]
then
echo "Adding: ${filename}"
cat ${filename} >> ${1}
fi
# next header
let "base += 64"
done
rm newheader
Syntax: ./pack.sh Archive.smd
Flash the resulting .smd files using Odin Multi Downloader an be happy about a rooted SGS Plus.
Note: The procedure has been tested with European KF6 and KP4 firmware. the scripts are capable of extracting and packing other SMD Archives as well, like Modem or CSC SMDs. But you don't need it for rooting (but maybe for debranding or customizing ROMs).
I'm thinking about an simpler root method like a modified kernel with a "magic" initramfs (like CF Root is working). This would make rooting of course much easier. But I have to investigate a lot of things handling boot.imgs.
Nice one RiverSource! Let's hope this is the start of more to come (ie. easier root, custom roms..).
Hello,
ok, next step for rooting the SGS Plus: The FMROOT (hehe). FMROOT is the original untouched Samsung Kernel with a modified init.rc. The init.rc calls a script which places the su binary and the Superuser.apk into the /system partition.
As always: You are responsible for your Phone! If someone bricks his device using this guide, I am not responsible for that! Bad Luck, I have warned you! Its a dangerous job! You really shouldn't do it.
Howto:
Download the appropriate file for your firmware.
Extract it
There should be 2 Files: AriesVE.ops and FMROOT_?????.smd
Use Odin Multi Downloader
Put "AriesVE.ops" in OPS
Put "FMROOT_?????.smd" in PDA
Flash. Wait 5 Seconds. Phone reboots. Phone is rooted. Normally without loosing data or settings.
Please ask here, if your Firmware is not available. It should be possible to create an appropriate FMROOT Kernel.
Credits:
astuermer for pointing me to the correct su and Superuser binaries.
Chainfire here from XDA Developers. My script is based on the CF-Root
Paul from Madaco. I had a closer look into his "superboot".
Lots and Lots of Custom ROM Developers for i9000 and i9100. I have learned a lot about Android Images on Samsung phones from them.
For the developers: the FMBOOT Script called by init.rc:
Code:
mount -o rw,remount -t ext4 /dev/block/mmcblk0p15 /system
rm /system/xbin/su
rm /system/bin/su
mkdir /system/xbin
cat /fmboot/su > /system/xbin/su
chmod 4755 /system/xbin/su
cat /fmboot/Superuser.apk > /system/app/Superuser.apk
mount -o ro,remount -t ext4 /dev/block/mmcblk0p15 /system
And the calling code inside the init.rc:
Code:
start fmboot
class_start default
## Daemon processes to be run by init.
##
service fmboot /system/bin/sh /fmboot/fmboot.sh
user root
group root
oneshot
If someone is interested, I can post a howto on modifying boot.imgs for SGS Plus. Don't hesitate to ask. BTW, i have also coded a script which is capable of generating SMD archives with any content (not based on a previous SMD archive). I can also post it, if someone is interested.
I think, I will optimize the script in the future. Checking if the phone is already rooted and skip the thing for example. Or adding busybox. Are there any additional ideas?
Thank you very [email protected]@@@ Come on!
THX, THX,..
It works, rooted..!!

[Request] Dev Help Pretty Please!

Ok I'm on the OTA 2.3.4 from a fresh unlocked 4.1.83 no problems what soever and I'm looking to make a few mods when I saw the link posted for the 2.3.4 HDMI Mirror over at
http://forum.xda-developers.com/showthread.php?t=1169457
I went ahead and ran
adb shell
su
mount -o remount,rw /dev/block/mmcblk0p12 /system
sed -ie s/ro.hdmi.mirror.enable=false/ro.hdmi.mirror.enable=true/g /system/build.prop
mount -o remount,ro /dev/block/mmcblk0p12 /system
cd /etc/init.d
cp startXServer.sh startXServer.bak
(head -n 40 startXServer.bak; echo "if [ ! -e /var/run/noWebtop ]; then"; tail -n 12 startXServer.bak; echo "fi") > startXServer.sh
restart your phone
I read through the command and seemed pretty safe and was excited because the post listed the HDMI Mirror as being in "landscape" mode. Hell yeah right! Well it wasn't, it was the same portrait so I was looking to revert back. Go change the build.prop back for the ro.hdmi.mirror to equal false. No big deal that's easy enough with root explorer. Read through the commands and saw that the startXServer.sh was cp to startXServer.bak. Easy enough just delete the startXServer.sh and rename startXServer.bak to .sh.
Well there is the problem. When i ran the commands the first time didn't work so i went into the build.prop and did a manual change. Then re-ran the bottom half. It seems doing that I over wrote the .bak agan and now both files are exactly the same and have no way of reverting. I have the system, boot, and webtop backed up with an .img but that didn't fix my entertainment center when I plug in an HDMI to the TV. The original commands did a back-up so I didn't double back-up the file.lol
I was wondering if a dev that has a little more command line knowledge, maybe the orginal contents of startXServer.sh, or the actual file could help me out with the revert back and a working entertainment center. The current contents are
if [ ! -e /var/run/noWebtop ]
fi
I'm pretty sure that's the problem, unless someone else sees something I'm missing.
**Edit**
This was solved under the Q&A Section from a earlier post yesterday afternoon. Mods please close if necessary. In case any one needs it see below. I just rewrote the startXServer.sh to contain the following.
#!/bin/sh
#
# startX.sh
#
# This script starts the X server
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
NAME=startX
DESC="OSH X Server"
. /lib/lsb/init-functions
#umask 002
log_begin_msg "Starting $DESC: $NAME"
rm -f /tmp/serverauth.*
rm -f /tmp/.X0-lock
rm -fr /tmp/.X11-unix
rm -fr /tmp/.ICE-unix
if [ ! -e /home/adas/.tag_master_reset_ls ]; then
/usr/local/sbin/update-language.pl "en_US.UTF-8"
echo 1 > /home/adas/.tag_master_reset_ls
fi
. /etc/environment
export PATH
export LANG
export DISPLAY
export LD_LIBRARY_PATH
export USER=adas
export HOME=/home/$USER
# new way of starting
if [ $1 = "webtop" ]
then
sudo -u adas -i /usr/bin/startx -- -nolisten tcp -layout HDMI vt2 &
else
sudo -u adas -i /usr/bin/startx /usr/local/bin/xnull -- -nolisten tcp -layout HDMI vt2 &
fi

[REF] Useful init.d scripts

In the process of trying to improve my kernel, I've found that some of the potential improvements available for various kernels are sysfs tweaks that can be achieved in init.d - Some of these are things I was semi-aware of but didn't have the time to play around with until recently.
I'm going to start an archive of various scripts, categorized by "safe", "should be OK", and "dangerous but high payoff".
This post will link to individual posts in the thread, each with their own script.
For short scripts, I will simply put them here as code that can be copied and pasted, allowing for easier review and discussion. For longer scripts, I will attach them. I have started including downloadable versions of each script to avoid CR/LF issues. It is not possible to upload an attachment without an extension - before installing any attached scripts, you must remove the .txt extension
To install a script:
Put the contents into a file. I suggest an editor that can save in UNIX format (different linefeeds than DOS...)
Save the file - Save it without any extension. e.g. "governor_ondemand", not "governor_ondemand.sh"
Push the file as follows:
Code:
adb remount
adb push <file> /system/etc/init.d/<file>
adb chmod 755 /system/etc/init.d/<file>
The current script list:
Setting a CPU governor on boot
Remount all partitions with noatime
Disable per-file fsync()
Tweak I/O scheduler
Increase ext4 commit interval
Filesystem cache settings
Enabling AFTR (Exynos Only)
GPU Clock/Voltage Control (Exynos Only)
Setting a CPU governor on boot
This one's simple, and mainly for ROM developers. It sets the CPU governor as desired upon bootup. Most users will just use SetCPU instead.
Safety category: SAFE
Code:
#!/sbin/sh
log "Changing governor to ondemand"
echo "ondemand" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
Replace "ondemand" with the supported governor of your choice
Remount all partitions with noatime
One feature of ext4 is an "access time" attribute per file, aka atime. This attribute is not useful to very many people (mainly, I think, those doing security audits of sensitive systems). Updating the access time can slow filesystem access down.
The following script (Credit goes to gokhanmoral of SiyahKernel for this one) will remount all partitions with noatime set.
Safety category: SAFE
Code:
#!/sbin/sh
for k in $(/sbin/busybox mount | /sbin/busybox grep relatime | /sbin/busybox cut -d " " -f3)
do
sync
/sbin/busybox mount -o remount,noatime $k
done
Edit: garyd9 has pointed out that this may not actually be very beneficial - /data is already mounted noatime, doesn't matter on /system since that's read-only.
Enabling AFTR
AFTR is a deep-idle state supported by Exynos CPUs - it turns out that it is disabled by default. This script enables it. Credit to gokhanmoral of SiyahKernel for discovering this.
It is somewhat disconcerting that this feature is disabled by default and prints out a lot of debugging info by default. It may have issues. As a result,
Safety Category: SHOULD BE OK
Code:
#!/sbin/sh
log "Enabling AFTR"
echo "3" > /sys/module/cpuidle/parameters/enable_mask
Note that AFTR will cause your dmesg log to be spammed quite a bit by default. Daily Driver 12/8/2011 and newer have a fix for this, as do newer SiyahKernel releases.
This script is OBSOLETE on Daily Driver 1/29/2012 and later releases. AFTR is enabled by default on them.
Disable per-file fsync()
This capability is currently only supported in my kernel and (I think) knzo's void series for the I9100. It is based on patches from Andrea Righi (arighi). It disables per-file sync(), so that even if an application asks for data to be immediately flushed to disk, it won't be. This is most obvious with sqlite - this achieves the same goals as the modded sqlite you see in some tweaks, but in a runtime-controllable fashion.
However, this means that in a crash, you are much more likely to have unwritten database data. This can do things like cause a database to become corrupt, leading to force close loops. I had it happen all the time on xdandroid due to the way xdandroid handled filesystem writes on loop mounts.
Safety category: DANGEROUS (but potentially high payoff in database I/O workloads - this one is good for around 600 points of Quadrant epeen, for example)
Code:
#!/sbin/sh
log "Disabling per-file fsync()"
echo "1" > /sys/module/sync/parameters/fsync_disabled
Tweak I/O scheduler
This changes filesystem I/O scheduler parameters, and also changes the I/O scheduler if desired. This was included in many Infuse kernels, and is currently included in Daily Driver - However, as I believe that the user should have as much control as possible, this script will be removed from DD in favor of living "outside the kernel" where it should be within 1-2 releases.
While I discovered it in the Infuse community, its origin appears to be Bonsai.
Right now it defaults to BFQ. Change the "SCHEDULER=bfq" line to noop, deadline, or cfq as desired.
Safety category: SAFE (After all, it's been in DD almost since the beginning)
Code:
#!/sbin/sh
#
# Copyright (C) 2011 Free Software Foundation, Inc.
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU Library General Public License as published
# by the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU Library General Public
# License along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
# USA.
#
# License GPLv2+: GNU GPL version 2 or later <http://gnu.org/licenses/gpl.html>
#
#################################
# BonsaiROM
#################################
MMC=`ls -d /sys/block/mmc*`
SCHEDULER=bfq
# Optimize non-rotating storage;
log "INIT.scheduler BEGIN:setting scheduler parameters for $SCHEDULER"
case "$SCHEDULER" in
noop)
for i in $MMC; do
echo "noop" > $i/queue/scheduler
done
;;
deadline)
for i in $MMC; do
echo "deadline" > $i/queue/scheduler
echo 80 > $i/queue/iosched/read_expire # untested
echo 1 > $i/queue/iosched/fifo_batch # untested
echo 1 > $i/queue/iosched/front_merges # untested
done
;;
cfq)
for i in $MMC; do
echo "cfq" > $i/queue/scheduler
echo "0" > $i/queue/rotational
echo "1" > $i/queue/iosched/back_seek_penalty
echo "1" > $i/queue/iosched/low_latency
echo "3" > $i/queue/iosched/slice_idle
echo "4096" > $i/queue/read_ahead_kb # default: 128; (recomended: 128)
echo 1000000000 > $i/queue/iosched/back_seek_max
echo "16" > $i/queue/iosched/quantum # default: 4 (recomended: 16)
echo "2048" > $i/queue/nr_requests # default:128 (recomended: 2048)
done
echo "0" > /proc/sys/kernel/sched_child_runs_first
;;
bfq)
for i in $MMC; do
echo "bfq" > $i/queue/scheduler
echo "0" > $i/queue/rotational
echo "1" > $i/queue/iosched/back_seek_penalty
echo "3" > $i/queue/iosched/slice_idle
echo "2048" > $i/queue/read_ahead_kb # default: 128
echo 1000000000 > $i/queue/iosched/back_seek_max
echo "16" > $i/queue/iosched/quantum # default: 4 (recomended: 16)
echo "2048" > $i/queue/nr_requests # default:128 (recomended: 2048)
done
;;
*)
log "INIT.scheduler ERROR:failed to set parameters for unknown scheduler: $SCHEDULER"
exit -1;
;;
esac
log "INIT.scheduler END:setting $SCHEDULER scheduler parameters"
Increase ext4 commit interval
This script increases the ext4 commit interval to 20 seconds (Default: 5) - by delaying journal writes longer, it can help performance, but lengthens the window during which a crash will cause unwritten data to be lost.
Credit goes to gokhanmoral of SiyahKernel for this one
Safety category: SHOULD BE OK
Code:
#!/sbin/sh
log "Increasing ext4 commit interval to 20 seconds
for k in $(/sbin/busybox mount | /sbin/busybox grep ext4 | /sbin/busybox cut -d " " -f3)
do
sync
/sbin/busybox mount -o remount,commit=20 $k
done
Filesystem cache settings
This one will be an external link. There are choices - battery-optimized or performance-optimized.
http://www.android-devs.com/?p=31
Safety category: SAFE
Excellent write up, thanks for sharing. Just a note, I think you typoed post #4 from post #2 (the code part).
Ken
Entropy512 said:
One feature of ext4 is an "access time" attribute per file, aka atime. This attribute is not useful to very many people (mainly, I think, those doing security audits of sensitive systems). Updating the access time can slow filesystem access down.
The following script (Credit goes to gokhanmoral of SiyahKernel for this one) will remount all partitions with noatime set.
Safety category: SAFE
Code:
#!/sbin/sh
for k in $(/sbin/busybox mount | /sbin/busybox grep relatime | /sbin/busybox cut -d " " -f3)
do
sync
/sbin/busybox mount -o remount,noatime $k
done
Click to expand...
Click to collapse
Thank you soo much for this script, Entropy!
ran it and noticed within moments ....
guys in the forum just a heads up ... in case you hadn't thought of it ... for ease of managing these scripts, you can download rom toolbox pro and enter a script (i think they're here for us to copy straight in to Terminal() + save new scripts etc etc. very convenient
Entropy512 said:
One feature of ext4 is an "access time" attribute per file, aka atime....
Click to expand...
Click to collapse
I'm surprised this is not off by default in Android. noatime is one of the first things recommended to turn off on file-operation-busy unix servers...
*redundancy edit*
Entropy512 said:
AFTR is a deep-idle state supported by our CPU....
Code:
#!/sbin/sh
log "Changing governor to ondemand"
echo "ondemand" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
...
Click to expand...
Click to collapse
the code above changes governor... is this a typo?
---------- Post added at 10:56 PM ---------- Previous post was at 10:47 PM ----------
Entropy512 said:
This script increases the ext4 commit interval to 20 seconds (Default: 5)
Click to expand...
Click to collapse
I wonder if anyone has confirmed real-life benefit of this? I mean it's a phone on (essentially) SSD drive with relatively little disk IO (especially on write) right?. It's not like we run Oracle on spindles where postponing commit longer may present kernel a chance to optimize/re-order IO operations with disks for better performance (but unsafer)....
vladm7 said:
I'm surprised this is not off by default in Android. noatime is one of the first things recommended to turn off on file-operation-busy unix servers...
Click to expand...
Click to collapse
Surprising
You can use terminal but.pretty sure They are for scripts in system/etc/init.d
You can use script manager if.your kernel does not support init.d
Amplified said:
Thank you soo much for this script, Entropy!
ran it and noticed within moments ....
guys in the forum just a heads up ... in case you hadn't thought of it ... for ease of managing these scripts, you can download rom toolbox pro and enter a script (i think they're here for us to copy straight in to Terminal() + save new scripts etc etc. very convenient
Click to expand...
Click to collapse
Sent from my SAMSUNG-SGH-I777 using xda premium
Entropy512 said:
This changes filesystem I/O scheduler parameters, and also changes the I/O scheduler if desired. This was included in many Infuse kernels, and is currently included in Daily Driver - However, as I believe that the user should have as much control as possible, this script will be removed from DD in favor of living "outside the kernel" where it should be within 1-2 releases.
While I discovered it in the Infuse community, its origin appears to be Bonsai.
Right now it defaults to BFQ. Change the "SCHEDULER=bfq" line to noop, deadline, or cfq as desired.
Safety category: SAFE (After all, it's been in DD almost since the beginning)
Code:
#!/sbin/sh
#
# Copyright (C) 2011 Free Software Foundation, Inc.
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU Library General Public License as published
# by the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU Library General Public
# License along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
# USA.
#
# License GPLv2+: GNU GPL version 2 or later <http://gnu.org/licenses/gpl.html>
#
#################################
# BonsaiROM
#################################
MMC=`ls -d /sys/block/mmc*`
SCHEDULER=bfq
# Optimize non-rotating storage;
log "INIT.scheduler BEGIN:setting scheduler parameters for $SCHEDULER"
case "$SCHEDULER" in
noop)
for i in $MMC; do
echo "noop" > $i/queue/scheduler
done
;;
deadline)
for i in $MMC; do
echo "deadline" > $i/queue/scheduler
echo 80 > $i/queue/iosched/read_expire # untested
echo 1 > $i/queue/iosched/fifo_batch # untested
echo 1 > $i/queue/iosched/front_merges # untested
done
;;
cfq)
for i in $MMC; do
echo "cfq" > $i/queue/scheduler
echo "0" > $i/queue/rotational
echo "1" > $i/queue/iosched/back_seek_penalty
echo "1" > $i/queue/iosched/low_latency
echo "3" > $i/queue/iosched/slice_idle
echo "4096" > $i/queue/read_ahead_kb # default: 128; (recomended: 128)
echo 1000000000 > $i/queue/iosched/back_seek_max
echo "16" > $i/queue/iosched/quantum # default: 4 (recomended: 16)
echo "2048" > $i/queue/nr_requests # default:128 (recomended: 2048)
done
echo "0" > /proc/sys/kernel/sched_child_runs_first
;;
bfq)
for i in $MMC; do
echo "bfq" > $i/queue/scheduler
echo "0" > $i/queue/rotational
echo "1" > $i/queue/iosched/back_seek_penalty
echo "3" > $i/queue/iosched/slice_idle
echo "2048" > $i/queue/read_ahead_kb # default: 128
echo 1000000000 > $i/queue/iosched/back_seek_max
echo "16" > $i/queue/iosched/quantum # default: 4 (recomended: 16)
echo "2048" > $i/queue/nr_requests # default:128 (recomended: 2048)
done
;;
*)
log "INIT.scheduler ERROR:failed to set parameters for unknown scheduler: $SCHEDULER"
exit -1;
;;
esac
log "INIT.scheduler END:setting $SCHEDULER scheduler parameters"
Click to expand...
Click to collapse
Installed this script verbatim, swapped bfq with the code noop (after a bit of reading up on these commands (within "Scheduler=bfq)) ~ and was unable to sucessfully run the script. Was wondering what else i should try to set scheduler to noop
*edit*
seperate mod, same useful init.d script thread oirigin
Also ~ after getting adb working i started attempting to tackle the sysctl.conf but after all a few hours of reading i have a couple of questions before i proceed to create this file / adb push it to my phone.
these are the only qs i have:
- Possible to create a file using windows? I assume possible, next q is how to create a *.conf file on a windows PC (at this hour i am not thinking outside of the box lol)
- once i create the sysctl.conf file, if i understand the process properly, i will simply add the codei chose into the file and then adb push the file to my phone which leads to couple sub questions (trying to learn - haters make like bee with no stinger): Should I simply cut / paste snipets of this code in whatever order ?
have it on my mind to complete this mod including new file - dev help is greatly appreciated.
Amplified said:
Surprising
Click to expand...
Click to collapse
well, yeah: i777 is my first Android.
Disabling atime is a widely used (safe) tuning in unix-servers world to increase performance of operations with the file system.
So, yes, I find it odd that Sammy didn't have that off by default in their ROMs.
Or am I missing the point of irony?
vladm7 said:
the code above changes governor... is this a typo?
Click to expand...
Click to collapse
I'll fix it tonight, that one's a copypasta error
vladm7 said:
I wonder if anyone has confirmed real-life benefit of this? I mean it's a phone on (essentially) SSD drive with relatively little disk IO (especially on write) right?. It's not like we run Oracle on spindles where postponing commit longer may present kernel a chance to optimize/re-order IO operations with disks for better performance (but unsafer)....
Click to expand...
Click to collapse
I haven't poked at that one much. It depends partly on if the phone will enter deep sleep with uncommitted data. It may only be good for benchmark epeen
As to scripts in /system/etc/init.d not running:
They must be executable (chmod 755 is recommended)
They must not have a .sh extension - for some reason run-parts won't run them if they do (annoying...)
If created in Windows there might be line-ending issues (CR vs CR/LF)
a couple of small scripts to remount in RW/RO
I know, this is not directly related to kernel params tuning, but I think not worth a new thread.
Since I often mess in terminal, and need to remount /system in RW mode, I wrote those two small scripts to save some extra typing.
Remounts given file system in RW, /system by default. Save as /system/xbin/rw and then chmod +rx /system/xbin/rw:
Code:
#!/sbin/sh
disk=/system
if [ -n "$1" ]; then
if [ $(busybox grep -c $1 /proc/mounts) -gt 0 ]; then
disk="$1"
else
echo "Can't find '$1' mount"
exit
fi
fi
echo "Remounting '$disk' in Read-Write access mode"
busybox mount -o rw,remount $disk
Save as /system/xbin/ro. Remounts given file system in RO, /system by default:
Code:
#!/sbin/sh
disk=/system
if [ -n "$1" ]; then
if [ $(busybox grep -c $1 /proc/mounts) -gt 0 ]; then
disk="$1"
else
echo "Can't find '$1' mount"
exit
fi
fi
echo "Remounting '$disk' in Read-Only access mode"
busybox mount -o ro,remount $disk
Entropy,
Can you attach these scripts please.

[Q] USB networking. I want to VNC over usb from Ubuntu 12.04,[ working over wifi]

Well the script should be working, it is 'ettin.sh' now. To get VNC to work on separate device just change 'eth0' to 'wlan0' or whatever other interface you know how to configure, like usb maybe, in the 'init.sh' script that resides in ~/ on the images you can download from http://linuxonandroid.org/downloads/. Cool. If anyone can help with the usb configuring that would be cool.
Also on the different roms your storage might be different so just change that to what suites your environment,
BAD NEWS, After my first launch and exiting the VNC on my laptop (Ubuntu) My phones home button and a few other functions stopped working, a reboot remounts the root and system partitions and it goes back to normal essentially, I haven't noticed any adverse affects after the reboot.
Good luck.
EDIT: If you can't help me, you probably shouldn't attempt any of this.
I want to connect to backtrack over usb from Ubuntu on my laptop instead of from my phone. Is there a good way of doing this?
The thing is, I didn't chroot, I mounted the image, copied the contents of '/etc/*' and '/sbin/*' to the '*/etc' '*/sbin' dirs of the mounted image. and then mounted it's (the image's) contents to Androids rootfs '/' then I set up a little script to set up the environment and execute '/bin/bash -i init.sh' and again reset PATH to include /system/*.
Then in the init.sh script I want to set up a way to 'vnc' through' usb to backt4acks desktop. How would I do this?
EDIT: I started this script blelow, its not complete, feel free to use it however you like.
If anyone is good with bash I need help with loops in Bash or shell, ksh, or ash. So if you change it at all share those changes here. I haven't tested any of the loops, I wrote this here and need to do some reading on shell scripting, peace out.
Just NOTE that I would not execute this script yet, it is NOT YET COMPLETE.
I will be making minor changes as I learn and test things out, Also this was inspired by the autobootscrip (sp?) that the Linux on Android Installer app uses.
mintberrycrunch revision
I need a little help with the mounting part, "is there anybody out there?"
EDIT: Maybe escape '\' characters...
Maybe this will work? 'if [ ! -d "/$d" -a "$d" \!= "dev" -o "$d \!= "mnt" ]; then ' I want it to test whether the directory does not already exists in / and if it is not named dev or named mnt then mount it. Do you think this is a decent way to do it? Any suggestions?
Sorry, I still haven't tested this script yet, so if you brave and see any changes that will make it work I am not resposible. But it is getting close to when I will run it for the first time. The difference between this and the one I wrote for Kali is this should be a one stop shop so to speak for getting into a non chroot enviroment where you can access Bt's tools from Android directly. Apperently about a year ago someone was trying something similar called "debian installer" or something, I haven't tried it out so maybe that actually works, idk, I am happy with this.
LOL
LMFAO!
I just realized I don't think I needed to worry about testing if the variable $d was named 'dev' or 'mnt' because they should get skipped by already being mounted. If not I guess if it works as is, may be extra precaution.
Done! Almost ;{)-
Uhmm.... hope you can see the screenshot...
its over wifi though, I had to edit the init.sh script just eth0 to wlan0 in 2 lines, duh! where is eth0 on phone?
Check out the filesystem
Bada bing, bada doom, dare ya goes`a for ya.
V-0.021
This should support args, if your using different image or location such as external sdcard or want to mount to a different location
Notes: 'ettin.sh' [/IMAGE/LOCATION] [IMAGENAME] [MOUNT/POINT]'
1) Don't add a trailing forward slash for image location, the first argument. Doing so may conflict with the script.
2) Don't add suffix to image name ( second argument), the script uses a wild card period wild card syntax to account for .iso, .raw, or .img aswell as version numbers, so if its backtrack-v-r5.img all you need is 'backtrack'.
3) Default mount is "/data/local/mnt"
for example:
Code:
ettin.sh /storage/extSdCard/ubuntufolder ubuntu /mnt/myLinux
That ^^^ will use a ubuntu image on the external sdcard and mount it to a folder called "myLinux" within the "/mnt" directory.
The script below...
Code:
#!/system/bin/sh
# ettin.sh v-0.021, "Two heads are better than one."
# Written by 'Edge-Case' @ 'forum.xda-developers.com'
# This version is attempting to use symbolic linking to correct some issues.
## The purpose of ettin.sh is to merge a Linux system with Android
## hopefully allowing both systems to run in synch with each other.
## It is probably best to be ran on devices with multi-core processors.
##"""Notes on Backtrack and Kali Linux Distributions:
##"""1) Postgresql needs to be configured in order for metasploit to connect to
##""" the database. This might be possible within the script. Perhaps
##""" it is simply a matter of configuring SSH? I don't know.
##"""2) The Kernel needs to be patched to allow for packet injection and
##""" monitor mode for an external 'wi-fi' card as the factory hardware
##""" does not support monitor mode, at least on Samsung Galaxy SIII.
#########
# Prep ##
#########
mount -wo remount systemfs /system
mount -wo remount rootfs /
imloc=${1:-"/storage/sdcard0/backtrack"}
imname=${2:-"backtrack"}
subset=${3:-"/data/local/mnt"}
#Check for root!
if [ ! -d "$subset" ]; then mkdir "$subset"; fi
busybox mount -wo loop ${imloc}*/${imname}*.* ${subset}
check_mnt="`echo $?`"
if [ ${check_mnt} != 0 ]; then echo "Something is wrong with mounting, check the situation!" && exit; fi
##################################################
# Copy contents of special directories to image ##
##################################################
if [ ! -f "${imloc}/success.txt" ] ; then cp -ai /sbin/* ${subset}/sbin && echo "Files have been copied on `date`." > ${imloc}/success.txt; fi
if [ -e "/root/*" ]; then cp ai /root/* ${subset}/root; fi
######################################################
# Make directories needed and mount the file-system ##
######################################################
cd ${subset}
for d in `ls` ; do if [ ! -d "/${d}" ] ; then mkdir /${d} && busybox mount --rbind ${subset}/${d} /${d} ; fi ; done
busybox mount --rbind ${subset}/root /root
busybox mount --rbind ${subset}/sbin /sbin
busybox cp -rspi ${subset}/etc/* /etc # We'll try making symbolic links from the image to Android's /etc instead.
# Add any directories as needed.
###############################
# be safe before we continue ##
###############################
mount -ro remount systemfs /system
mount -ro remount rootfs /
######################################
# continue building the environment ##
######################################
export PATH="/system/bin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/system/xbin:/usr/games"
export TERM=linux
export HOME="/root"
#################################
# further down the rabbit hole ##
#################################
/bin/bash -i ~/init.sh
Pretty happy with it now, so far. Touch FIXED
Well, I am tethered from my phone to my laptop, running ubuntu, this is how I am on the internet, so my phone is doing that...
I ran 'ettin.sh /storage/sdcard0/ubuntu ubuntu' using V-0.022 and only had two files that needed overwriting.
The touch is working....check
adb is working...check
Everything is mounted ...check
Apps like browser and dsploit are working on the phone as usual...check
'apt-get update && apt-get upgrade'....check (over adb, no chroot, as [email protected] using bin/bash)
'which nmap' .....check ("
[email protected]:~# which nmap
/usr/bin/nmap
")
Well **** ya'll looks like this might work... I am now going to consider modifying a stock rom to support users and login that meshes with debian and its "shadow" file etc etc, also I need to work out permissions and enviroment variables...
I'm happy...
Also for pentesting distro's "modifying Android kernel" tutorials would be nice, anybody able to point me to one?

Categories

Resources