[HOWTO] Customizing webtop - Atrix 4G General

For sometime now I have been meaning to write-up some of my notes and share some of the things I found can be done with webtop. I have a lapdock that I use it with my Atrix, I also have a HD dock connected to a monitor/keyboard/mouse/speakers.
Much of the following is just documenting the linux programs that are installed on the webtop and how they can be configured. You will need to have a terminal program to do most things covered in this post (not the android terminal program, but either lxterminal or xterm) and a text editor.
I use SystemR89's webtopMod to run a full debian distribution in a chooted jail (http://forum.xda-developers.com/showthread.php?t=1093790), this is not necessary for most of what this post will cover but it does install lxterminal and a lightweight text editor (leafpad) into your webtop.

AWN (the menu at the bottom of the webtop screen)
awn-manager is included in webtop and it allows you add/delete programs from the menu at the bottom of the screen. Before you use awn-manager the first time you will need to type the following command at the terminal prompt:
sudo chmod 777 /usr/share/applications/*​
Then you can just type in awn-manager and click on launchers and start changing/adding/deleting things. Alternatively you can modify the appropriate files manually.
The configuration file that has the list of menu items is:
~/.gconf/apps/avant-window-navigator/window_manager/%gconf.xml​
If you make manual changes to this file you will need to reboot for the changes to take effect (if you use awn-manager all changes take effect immediately).
As you will notice the menu configuration file references “.desktop” files. I am not going to cover the structure of the desktop files, there are a lot of good references out there covering this, just take a look at what is in them, the structure it is pretty straightforward. A number of the desktop files are found here:
/usr/share/applications​
but the ones created by awn-manager will be put here:
~/.config/awn/launchers​
If the program or command will only be run from the awn menu this directory is probably the best place to put the desktop file. If you are going to associate the program with a file type (more on this latter) you may want to put the desktop files in the following directory:
~/.local/share/applications​
any weblinks that you create by using the plus in the right hand side of the bottom awn menu bar will be put here:
~/.config/webtop-icon​
and a good place to stick any custom icons that you are going to be using is here:
~/.config/awn/custom-icons​
the default set of icons that awn-manager accesses are found here
/usr/share/pixmaps/​/usr/share/icons​
to launch an android program in the mobileview window (aka aiw) you will need to use androidlauncher, here are a couple examples of how to do this:
androidlauncher --action "android.intent.action.VIEW" --uri "content://com.android.contacts/contacts"​/usr/local/bin/androidlauncher --action "android.intent.action.MAIN" --cmp "uk.co.nickfines.RealCalc/.Calculator"​
you can look in the desktop files found in the /usr/share/applications directory to see some examples of how to launch various android programs you can also use the android app alogcat from the market to see what command is executed when you launch an android app on your phone.

Nautilus (the file manager)
Nautilus is filemanager used by webtop, it has been significnatly modified by Motorola so don't expect all of the normal features to work. If you look at the entry for the file manager using awn-manager you will see that the following command is used to launch the program:
nautilus --no-desktop --browser /mnt/sdcard​
In webtop the default preferences for nautilus are set up so that you can leave out the -no-desktop and -browser switches if you want. The /mnt/sdcard entry specifies which directory nautilus should start in. You can specify nautilus to start in the root (/) directory, but it won't have root privileges, so it is not a replacement for root explorer (or similar). If gksu was included in webtop you should have been able to run nautilus with root privileges by typing in:
gksu nautilus --no-desktop --browser /​
but when I installed gksu and tried this it did not work.
If you want to have additional directories listed on the left panel in nautilius you can edit the file:
~/.gtk-bookmarks​
You can add some functionallity to nautilus by creating scripts. After you create a script an option to run the script will appear under the files menu and come up when you right click. The scripts files are kept in the following directory:
~/.gnome2/nautilus-scripts​
I have attached a couple of scripts that I use, you can also check out:
http://linux.about.com/library/gnome/blgnome6n13a.htm
http://g-scripts.sourceforge.net/faq.php​
You can view the preferences that are set for nautilus by using:
gconftool-2 -R /apps/nautilus/preferences​
I played around with changing some of the preferences, I tried to turn on an address bar but the bread crumbs disappeared instead, I found that you can enable move-to-trash but it only works for linux filesystems (i.e. it works for your home directory but not for FAT filesystems like sdcard or sdcard-ext, although you might be able to fix this by putting appropriate entries in fstab with uid=1000 in the entry, I wrote a move to trash script instead)
It does not appear that the motorola webtop nautilus directly supports accessing network files, but if you are using a kernel with cifs support (or cifs manager from the market) you can mount network directories and then access them through nautilus.
Nautilus has saved searches built in (ctrl-f), search by name works but search by filetype does not work (you can search by file name, such as mp3, but it you tell it to find all audio files it does nothing). I guess they figured they have their smartfolders for that (Phone Music, Phone Images, Phone Video). By the way if you freeze or remove webtop connector then items will no longer be added to the smartfolders.

pcmanfm (an alternative filemanager in webtop)
There is a lightweight alternative to the nautilus file manager included in webtop called pcmanfm. To launch it with the sdcard directory showing type the following:
pcmanfm --no-desktop /mnt/sdcard​
if you want to launch it with root privileges in the root directory type the following
sudo pcmanfm --no-desktop /​
(I know you should be using gksu instead of sudo, but this works and gksu is not included with webtop).
Some of the nice features of pcmanfm:
It can run with root privileges (see above)
It has an address bar, so you can just type in the directory you want to instead of navigating the directory tree
It has an open terminal window here function built in (tool – open terminal)
There is a bookmarks menu where you can change the directories shown in the left pannel without having to edit ~/.gtk-bookmarks

File associations
If you want a specific application to launch when you double click on an item in the file manager you can change the entries in the following files:
~/.local/share/applications/defaults.list
~/.local/share/applications/mimeapps.list​
To have several “open with” options when you right click on a file you can put several entries on a line. The following is an example of an entry:
image/jpeg=gpicview.desktop;MobileView.desktop;firefox.desktop​
This enrty is telling the file manager to use gpicview.desktop to open the file if you double click on a jpep and to offer the options “open with gpicview”, “open with Mobile View” and “open with firefox” if you were to right click on a jpeg file.
The file manager will use gpicview.desktop that is found in /usr/share/applications/ unless there is a gpicview.desktop file in ~/.local/share/applications/
I have attached the files that I use for
~/.local/share/applications/defaults.list
~/.local/share/applications/mimeapps.list​
You will probably have to edit these file because some of the file associations I have set up launch programs in the chrooted linux environment.

Linux applications included with webtop
Functional and useful linux programs included in webtop
nautilus: file manager
pcmanfm: file manager
firefox: web browser
awn-manager: menu editor
xarchiver: file archive manager (zip/tar)
gpicview: a simple image viewer
epdfview: pdf viewer​
Gnome programs - most of the gnome programs are crippled/semi-functional, but the following two seem to work well:
gnome-dictionary: online dictionary
gnome-screenshot: screenshot/capture utility​
If you look at the "exec" entry in the desktop files located in /usr/share/applications you can see what other programs are included in the webtop distribution.

Swap
I am not certain if the stock atrix kernel has swap support, I am using faux123's kernel, perhaps someone could comment on if the stock kernel's swap support.
I find that I need to set up swap space if I want to use the webtop for anything more than occasional web browsing. Before I enabled swap webtop was regularly warning me that I had low memory (and you can't close the warning message, which is really annoying).
The first thing I tried was using zram for swap (fuax123's kernel supports this). I DO NOT recommend using zram for swap.
BEWARE, ZRAM CAUSES YOUR PHONE TO CRASH REGULARLY​
Next I looked into setting up a swap partition; however, after a little research I found out that the complexity of setting up a swap partition is a waste of time, you can get the same performance using a swapfile. Accordng to Wikipedia (http://en.wikipedia.org/wiki/Paging#Linux):
From a software point of view with the 2.6 Linux kernel, swap files are just as fast[14][15] as swap partitions. The kernel keeps a map of where the swap file exists, and accesses the disk directly, bypassing caching and filesystem overhead.[15] Red Hat recommends using a swap partition.[16] With a swap partition one can choose where on the disk it resides and place it where the disk throughput is highest. The administrative flexibility of swap files can outweigh the other advantages of swap partitions. For example, a swap file can be placed on any drive, can be set to any desired size, and can be added or changed as needed. A swap partition, however, requires that it be set for the entire hard drive, and once the size of a swap partition is set, it can't be changed without using tools to resize the entire drive.​
To create a 512MB swapfile, type the following commands in the terminal:
dd if=/dev/zero of=/sdcard-ext/.swapfile bs=1M count=512
sudo mkswap /sdcard-ext/.swapfile​
This is probably bigger than I need, I don't think I have ever used more than 100MB of swap. I use a "." as the first part of the filename, this makes the file a "hidden" file in linux and therefore the file is less likely to get accidentally deleted or moved.
Next, turn on the swap:
sudo swapon /sdcard-ext/.swapfile​
and make sure it is working:
free​
You will want to add the following line to the file /etc/fstab:
/sdcard-ext/.swapfile swap swap defaults 0 0​
and the following line to /etc/sysctl.conf
vm.swappiness=10​
(you may actually want to try a value less than 10, the lower the value the less the phone will swap)

Running full debian in a chooted jail (webtopMod)
As I mentioned in the first post I use SystemR89's webtopMod to run a full debian distribution in a chooted jail (http://forum.xda-developers.com/showthread.php?t=1093790)
You can install a number of very useful and fully functional linux programs in the chrooted environment and then access them from the awn menu (or if you have the file associations set up properly in defualts.list and mimeapps.list you can launch the files by double clicking on a file in the file manager).
*IMPORTANT* Some of the commands must be executed in the chrooted environment and some must be executed in the non-chrooted environment (i.e. the normal webtop environment). The following instructions tell you which environment you need to use for each command.
Once you have webtopMod installed I would recommend that the first thing you do is open an xterm window in the chrooted environment (click on the penguin and select the proper menu item for xterm) and install synaptic in the chrooted environment:
apt-get install synaptic​
You can then use synaptic to install other linux programs/packages, such as lxterminal, OpenOffice, mtpaint (gimp runs but it is really slow).
I have modified the script that SytemR89 uses to launch the chrooted environment (attached), you can replace the original script by following these steps in the non-chrooted environment:
Save the attached file,
Rename it from linux.txt to linux
Copy it to /usr/sbin
Set the permissions properly (sudo chmod +x /usr/sbin/linux)​
If you want to launch a program in the chrooted environment you can do it by typing the following in the non-chrooted environment:
linux oocalc​
where oocalc is the name of a program that you have installed in the chrooted environment.
A couple of final things, you may want to setup a symlink in the chrooted environment for /sdcard (and sdcard-ext). If I recall correctly, SytemR89 was just mounting /sdcard (and /sdcard-ext) in the chrooted environment and I changed the script to mount /mnt/sdcard instead (why? so that the chrooted directories would be set up the same as the non-chrooted environment). To make a symlink between /mnt/sdcard and /sdcard in the chrooted environment. First launch an xterm window for the chrooted environment, then type in the following commands:
sudo umount /sdcard
sudo umount /mnt/sdcard
sudo mkdir /sdcard
sudo mkdir /mnt/sdcard
sudo ln -s /mnt/sdcard /sdcard
sudo umount /sdcard-ext
sudo umount /mnt/sdcard-ext
sudo mkdir /sdcard-ext
sudo mkdir /mnt/sdcard-ext
sudo ln -s /mnt/sdcard-ext /sdcard-ext​
You may get some errors telling you that something was not mounted or that a directory exists, just ignore the error(s).
Then reboot.
I also created a directory /usbdrive in the chroot'd linux environment and use the following command to mount a usb drive so that the chrooted environment can access it (run this command from the non-chooted environment)
sudo mount -t vfat /dev/block/sda1 /osh/opt/WebTopMOD/root/usbdrive​

Many thanks for posting this, it's an excellent guide.

tamuin said:
I am not certain if the stock atrix kernel has swap support, I am using faux123's kernel, perhaps someone could comment on if the stock kernel's swap support.
I find that I need to set up swap space if I want to use the webtop for anything more than occasional web browsing. Before I enabled swap webtop was regularly warning me that I had low memory (and you can't close the warning message, which is really annoying).
The first thing I tried was using zram for swap (fuax123's kernel supports this). I DO NOT recommend using zram for swap.
BEWARE, ZRAM CAUSES YOUR PHONE TO CRASH REGULARLY​
Next I looked into setting up a swap partition; however, after a little research I found out that the complexity of setting up a swap partition is a waste of time, you can get the same performance using a swapfile. Accordng to Wikipedia (http://en.wikipedia.org/wiki/Paging#Linux):
From a software point of view with the 2.6 Linux kernel, swap files are just as fast[14][15] as swap partitions. The kernel keeps a map of where the swap file exists, and accesses the disk directly, bypassing caching and filesystem overhead.[15] Red Hat recommends using a swap partition.[16] With a swap partition one can choose where on the disk it resides and place it where the disk throughput is highest. The administrative flexibility of swap files can outweigh the other advantages of swap partitions. For example, a swap file can be placed on any drive, can be set to any desired size, and can be added or changed as needed. A swap partition, however, requires that it be set for the entire hard drive, and once the size of a swap partition is set, it can't be changed without using tools to resize the entire drive.​
To create a 512MB swapfile, type the following commands in the terminal:
dd if=/dev/zero of=/sdcard-ext/.swapfile bs=1M count=512
sudo mkswap /sdcard-ext/.swapfile​
This is probably bigger than I need, I don't think I have ever used more than 100MB of swap. I use a "." as the first part of the filename, this makes the file a "hidden" file in linux and therefore the file is less likely to get accidentally deleted or moved.
Next, turn on the swap:
sudo swapon /sdcard-ext/.swapfile​
and make sure it is working:
free​
You will want to add the following line to the file /etc/fstab:
/sdcard-ext/.swapfile swap swap defaults 0 0​
and the following line to /etc/sysctl.conf
vm.swappiness=10​
(you may actually want to try a value less than 10, the lower the value the less the phone will swap)
Click to expand...
Click to collapse
Thanks a lot, I was just starting to configure zram right before reading your post. :good:
Please explain just two things to me:
- Did you automated this to always enable swap? If so, how (init.d scripting)? EDIT: forget about... I didn't realize what changes in /etc/fstab will do...
- You've created the swap file in the external SDCard. Isn't better to create it on EMMC? EDIT: I've created the file on EMMC cause it's much faster and seems to be Ok!!!
Regards...

Related

Android img files

Okay I know this is a very noob question, how do I open android .img files And I have run a number of different search queries and still haven't found the answer.
jimmydafish said:
Okay I know this is a very noob question, how do I open android .img files And I have run a number of different search queries and still haven't found the answer.
Click to expand...
Click to collapse
what do you want to do with the img? dump it or just flash it?
if you got some kind of linux distro installed, just go (in terminal) to the dir where the image file is located, and type "file filename.img" if it returns something like ext2 filesystem, simply do:
mount -o loop filename.img /mnt
and the file will be mounted on /mnt, so you can access it using cd /mnt
if it returns something like VMS Alpha executable, you will have to download unyaffs, and if you want to repackage it later on, mkfs.yaffs2,
to get the file's content, just run unyaffs filename.img, and you will have the file content right in the folder with the img file...
if you don't have a linux distro installed, you can simply get virtualbox, and download the latest ubuntu iso file... mount the file in virtualbox and install ubuntu (it's quite easy)...
oh and incase you need them some basic commands:
Code:
ls - lists current folder content
cd folder - allows you to switch to a specific folder, like if you type ls, and you get the folder android listed just type cd android... if you want to go back to your home folder, type ~/...
sudo command - allows you to run specific commands as superuser (root... you can also just switch to user root by typing sudo su, so you won't need sudo every single time)
rm file / rm -R folder/file - allows you to remove files and with the parameter -R also folders ;)
hope this helped
emulator
What if i want to use the .imgs in the emulator/AVD? Any tips?
Thanks.
tdh_andy said:
What if i want to use the .imgs in the emulator/AVD? Any tips?
Thanks.
Click to expand...
Click to collapse
use mkfs.yaffs2.

CLI Play

One thing that I really love about Android, is the Gnu/Linux system running in the background. I use Linux on all my regular machines where I do most work via my beloved terminal.
Playing in CLI on Android Phones is just as much fun only Android is missing a lot of the toys I'm used to. So I'm making a collection of some of these tools, some found on the Web and some Home made.
Here if the first collection of the things I've collected so far.
Most of it can be found in different places on the Web, but I find it a lot easier to just get it in one place.
http://dl.dropbox.com/u/14234754/XDA_GLOBAL/android_cli_extras.tar.gz
This small Archive contains the fallowing:
Bash 4.1 - This shell is made to become the default shell on your phone regardless if you connect via SSH or local terminal. Also added an bashrc file.
SSH Shell Client
Remount script - Makes it easier to optain RW on /system (HTC Users will need S-Off)
Nano Editor with terminfo not defined, fix
Init Script to set a user defined hostname and update the hosts file
Now, I don't remember where everything comes from. I believe that the Nano Editor is from the MoDaCo Forum (The terminfo fix is placed in the /system/bin/sh script). The Remount Script is from somewhere on this forum. Bash, I don't remember. SSH Client is from the Better Terminal APK (Perhaps an SFTP client would be nice to). The rest is just some small home made shell scripts.
The Hostname can be changed in /system/etc/init.d/05userinit (Make sure that your current ROM does not already has init scripts to alter hostname. Some custom ROMs do)
The bashrc file is placed in /system/etc/bashrc
This location can be changed in /system/bin/sh
The remount script makes it faster and easier to option RW on /system.
Just type "remount rw" in the shell to switch to Read/Write and then "remount ro" to switch back to Read-only. HTC Users needs S-Off in order to write to /system.
In order to copy the files to the /system partition, you need to option Read/Write without the remount script. In the Shell type "mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system". (HTC Users without S-Off will need to do this using ADB in recovery)
If you use the Better Terminal APK for Android, you need to go to settings and make sure that it uses Android Terminal. Otherwise it will use it's own bash which only works when in Better Terminal and also it's full of errors. Also in the option "Command Line" it should be "/system/bin/sh". Make sure that there is NO - at the end, example "/system/bin/sh - ". You might need to remove it twice before it is gone.
(Just in case anyone should wonder. Yes your phone needs to be rooted)
Also if anyone has more fun CLI stuff for android then please bring it

[GUIDE] Customizing ROMs for your needs.

At the request of others, I have decided to write this guide pertaining to ROM customization. I found that in most of the current custom Jelly Bean ROMs for the TF101, that the GPS configuration has been changed, at least compared to the stock Asus ICS ROMs for the TF101 and the stock Asus Jelly Bean ROM for the TF300T, and they are using modified user / group and permissions settings. They all say that it is because those items have changed in Jelly Bean. They are also using a custom /etc/gps.conf file. The problem is that I, along with several others, aren't seeing very good GPS response and some claim not to see any. The ones that do see something, see that the first initialization takes forever and then is likely to not hold a fix, only seeing a few satellites. I made some changes in the ramdisk and /etc/gps.conf file and tested with a few of the Jelly Bean ROMs for the TF101 and found that settings matching the stock Asus settings performed quite well and was asked to share the process that I used. While it would be easier probably to just post the modded kernels for others to reflash, I'll give it a go at explaining what I've done.
1) This guide will require either a working native Linux install or can probably be used with a virtual machine Linux install. I'm using Ubuntu 12.04-x86_64 LTS as Ubuntu is usually used in most of the guides I've found. You may be able to make things work with other Linux flavors, but YMMV. I'm going to assume, at least, a basic knowledge of Linux file systems and the ability to copy and paste to a terminal and follow instructions.
2) You may need to install the Android SDK and at least one platform in order to get a working "adb" command, which will be needed. You may be able to get the "adb" binary from other sources that will work and "adb" will require some setup in udev rules to allow your normal user to access the tab with it. I'm going to assume that you have all of these things in place and working and that "adb" is in your path. If not, then Google is your friend.
3) For good measure, it would help and definitely won't hurt anything to have some build environment files in place. In a terminal, copy and paste the following:
Code:
sudo apt-get install git-core gnupg flex bison gperf build-essential zip curl libc6-dev libncurses5-dev:i386 x11proto-core-dev libx11-dev:i386 libreadline6-dev:i386 libgl1-mesa-glx:i386 libgl1-mesa-dev g++-multilib mingw32 openjdk-6-jdk tofrodos python-markdown libxml2-utils xsltproc zlib1g-dev:i386
Let that install and when it is finished, copy and paste the following:
Code:
sudo ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so.1 /usr/lib/i386-linux-gnu/libGL.so
4) Now we need to grab dsixda's Android Kitchen, which is where some of the magic can happen. Go here to read up on how to use it and to find the download link. While the TF101 isn't specifically supported, there are a lot of things that we can still use it for. Just don't try to build a ROM and flash it with this before you have read dsixda's thread thoroughly or you may wind up with a brick. I'm only going to describe things that I've done and tested and that I know will work. For ease of this guide, I'm going to assume that you read the instructions there and that you unzip the downloaded file to "/home/'yourname'/android/kitchen/".
http://forum.xda-developers.com/showthread.php?t=633246
5) Now we need to build the blob tools used to pack and unpack the .blob files. Here we will download the source code for these tools and build them on the local machine. Go here:
https://github.com/AndroidRoot/BlobTools
6) Download the .zip file and extract to "/home/'yourname'/blob_tools/", where 'yourname' is your home directory name. Then, in a terminal, type "cd ~/blob_tools", without the quotes. Then type "make". When this is finished, type "mkdir ~/bin", if it doesn't already exist, and then type "cp ./blobpack ~/bin/;cp ./blobunpack ~/bin/". Now we need to make sure that "~/bin/" is in our PATH. Type "cat ~/.profile" and make sure that there are lines matching the below there:
Code:
# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then
PATH="$HOME/bin:$PATH"
If not, use an editor like gedit, to add them just before the last line which should say "fi". For basic instructions on the blob tools, see here:
http://forum.xda-developers.com/showthread.php?t=1068548
That should be all for the tools and setup. Now reboot your PC to Linux, for good measure.
I'm going to use as an example, the changes I made for the GPS permissions and settings. Anything else will be up to your own personal study and research and experimentation. I assume no responsibility if you do something mentioned here or not or if you should brick your device.
1) Download the CWM flashable custom ROM of your choice. I'm not going to deal with Asus stock ROMs here because there are extra steps to do to look into those completely. Extract the ROM to a directory under your home directory. You will have to create it, such as "Team_EOS3" or whatever. I'm going to use the graphical file manager Nautilus and the graphical text editor gedit to work with files and directories and to edit files. When using Nautilus be sure to go to the "View" menu and select "Show hidden files". Some work will also be done in a terminal. I use Gnome terminal.
2) For example, I have a folder "K900_AOKP_JB", where I extracted K900's ROM. So if I look at that in Nautilus, I see 2 folders, "META-INF' and "system" and 2 files, "boot.blob" and "boot.img". Most of the custom roms will not have the boot.img file, only the *.blob file. The blob file and the boot.img file should be the same thing. Each contains the compressed kernel image and the initial ramdisk.
3) From a terminal, type, for example, "cd ~/K900_AOKP_JB". Then type, "blobunpack ./boot.blob", substituting the appropriate names for your particular files. In Nautilus, you will see that 1 more file was created, in my case, "boot.blob.LNX". Right click and copy this file to your Kitchen WORKING_DIRECTORY which you should have created from following the kitchen instructions. For me it is "~/android/kitchen /WORKING_091312_142859/", where "~" is shorthand for "/home/'yourname'", i.e. your personal home directory. Right click and delete or move to trash the boot.img file that is there already. Right click the file you just copied, i.e. "boot.blob.LNX" and rename it to "boot.img". Upper and lower case matters, so pay attention.
4) From a terminal, type "cd ~/android/kitchen". Then type "./menu". Choose option "0", then choose option "20", then choose option "w". Follow any instructions that come up. These actions will create a new directory, "~/android/kitchen/BOOT-EXTRACTED/", which is where the kitchen just extracted your renamed blob file (boot.img). Inside, you will see a "boot.img-ramdisk" folder, which contains the ramdisk files and a "zImage" file, which is the compressed kernel.
5) Inside the ramdisk folder, we are going to edit only the "init.ventana.rc" file to change some GPS settings. Open the file with gedit and scroll down to the #GPS section. Change it to read the following:
Code:
# GPS
mkdir /data/gps
chown system system /data/gps
chmod 770 /data/gps
chown root system /dev/ttyHS1
chmod 0664 /dev/ttyHS1
Scroll down to the #GPS init section and change it to read the following:
Code:
# GPS init
write /sys/class/gpio/export 203
write /sys/class/gpio/gpio203/value 0
write /sys/class/gpio/gpio203/direction out
chown root system /sys/class/gpio/gpio203/value
chmod 0664 /sys/class/gpio/gpio203/value
Scroll down to the # Start GPS daemon section and change it to read the following:
Code:
# Start GPS daemon
on boot
service gps-daemon /system/bin/glgps -c /system/etc/gps/gpsconfig.xml
user root
group root
class late_start
Save the file. Right click and delete "init.ventana.rc~", which will only show up if you selected to "Show hidden files" in the "View" menu. In Nautilus move back to your kitchen WORKING directory.
6) In the terminal that should still be running the kitchen menu, choose option "b" to rebuild the boot.img. You can now exit out of the kitchen menu. Back in Nautilus, right click and rename the "boot.img" file to "boot.blob.LNX" or whatever your original extracted blob file was called. Right click and copy to the folder where your ROM was extracted. Choose to replace the original file if asked.
7) In a terminal, type "cd ~/K900_AOKP_JB", substituting "K900_AOKP_JB" with whatever your extracted ROM folder is called. Then type "blobpack ./boot.blob LNX ./boot.blob.LNX", substituting your file names for "boot.blob" and "boot.blob.LNX".
8) In Nautilus, in the folder where your ROM was extracted, double click the "system" folder, then double click the "etc" folder. Then double click the "gps.conf" file. It should open up in gedit, if you were using that before, if not then choose to display it. Change it's contents to read the following:
Code:
#
# IMPORTANT:
# this file is only used by NetworkTimeUpdateService.java
# DO NOT make any GPS related settings here.
#
NTP_SERVER=xtra1.gpsonextra.net
Save and close the "gps.conf" file.
9) In Nautilus, in the folder where your ROM was extracted, left click on the "META-INF", "system" folders and the *.blob and boot.img file, if present, while holding down CTRL key, to highlight all 3 or 4 items. Right click on 1 of the highlighted items and choose "Compress". Rename the file if desired, especially if you have the original zip in that folder by the same name and want to preserve it, and then click "Create". The new zip file, with your custom name, will be created in the same folder after a few seconds. In my case, I chose to name it "K900_AOKP_JB-test.zip".
10) You now have created your own customized version of someone else's ROM, modified for your needs or experimentation. Now it's time to push it to your device. You can use Dropbox, if desired to do this, but the easier way is to use adb. I'm going to assume that you have a working Custom Recovery, preferably one that can read both internal sdcard and external MicroSD and that you have adb setup and working.
11) Plug your charging cable into the computer first and then plug the other end into the TF101.
12) In a terminal, type "cd ~/K900_AOKP_JB", substituting "K900_AOKP_JB" with the folder name where you extracted your ROM and where the new zip file resides. Type "adb devices" and after a second or two, you should see something similar to the following:
Code:
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
List of devices attached
03806245421f9417 device
If you get something looking like that, then adb is working.
13) In the same terminal, type "ls", which will list all the files and folders in your extracted ROM directory (or whatever your current directory is). If your recovery can read only the internal sdcard or both, then you can type "adb push ./K900_AOKP_JB-test.zip /sdcard/Download/", substituting "K900_AOKP_JB-test.zip" with whatever you named your zip file. After a few minutes you should get a confirmation that the transfer completed and can verify that it did with a file manager on the device.
14) If your recovery only reads from the external MicroSD card, then type "adb shell", then type "ls". You will get a list of all files and folders in the root directory of your device's file system. If you are running ICS or older, then you should see a "Removable" directory. If you are running one of the custom JB ROMs, then you may not have the "Removable" folder, but most likely a "storage" folder. For ICS or older, your external MicroSD should be located at "/Removable/MicroSD/". In the latter case, it should be located at "/storage/sdcard1/". In any case, once you have verified where the external card is mounted, then type "exit". Now type either "adb push ./K900_AOKP_JB-test.zip /Removable/MicroSD/" or "adb push ./K900_AOKP_JB-test.zip /storage/sdcard1/", depending on your results from adb shell. After a few minutes you should get a confirmation that the transfer completed and your new zip should now be on the root directory of your external MicroSD card.
15) Now you should be able to reboot to your recovery and flash the zip you created just like you would flash any ROM. Reboot and enjoy, from this example, working as intended GPS.

[Q] How do I install parted command?

I'm trying to wipe and format a microSD card that I have plugged in via OTG and already have it wiped with this;
Code:
dd if=/dev/zero of=/dev/block/sda
Now I'm looking into how to recreate a MBR and partition table and it says to use the parted command, which I'm glad about as I'm familiar with the command from using Ubuntu but it's not installed and I can not find any instructions on how to get it. Can anyone explain how to install it? I know I could just plug the SD card into a computer and do it but I'm having fun doing all this on a tablet. Lol
Bump
Anyone?
I have got the same question, any other solutions?
This is the most complete information I have found yet, but it doesn't work. Either from me messing something up or it not being correct for the Nexus 7 being that it was made two years ago. http://www.droidforums.net/forum/htc-droid-eris/78650-internal-storage-partitions-screwed-up.html
I pushed all six files to /sbin/ with no errors and changed their permissions with no issues but I restart the tablet and none of the six files are in /sbin/
Just for the heck of it I extracted the six files to the SD card in the tablet, CD'd to it and used chmod 0755 on all six files then tried to run it and this is what I get.
Code:
[email protected]:/storage/emulated/legacy/folder # parted
sh: parted: not found
127|[email protected]:/storage/emulated/legacy/folder # ls
e2fsck
mke2fs
parted
resize2fs
sdparted
tune2fs
... how can you NOT find that?
herqulees said:
... how can you NOT find that?
Click to expand...
Click to collapse
Depending on how your PATH env var is set, the current directory might or might not be being searched for program load(s). So indicating the current directory explicitly with a leading "./" such as
$ ./parted
will certainly work (if a read & execute bit set on file, and the filesystem is not mounted -noexec ) .
But...
...if those files are dynamically linked rather than statically linked, and the appropriate link-libraries they reference come up missing during run-time linking it is possible to still see a "not found" message. Sort of a red-herring error message, but there you go.
I just looked in TWRP's /sbin (ramdisk) just now. Don't see parted in there.
[Edit] I do see the string "fdisk" inside the busybox executable though! - maybe boot into recovery and see what
busybox fdisk /dev/block/sda
gets you? (I suppose result depends on whether or not TWRP kernel plumbs the device into place.)
Perhaps the quickest solution is to simply use a PC and media reader to do the partitioning from a PC instead of the N7. You might even want to boot a "Live CD" version of Linux to get at the tools you need. (BTW, I think that Ubuntu's Live CD mounts a fuse FS over the top of the RO DVD/CD, so you can even download and install packages as needed).
I managed to get everything to work by doing this:
1. Using this app https://play.google.com/store/apps/details?id=com.beansoft.mount_system&hl=en I remounted /system as RW
2. Using the CyanogenMod File Manager I copied the parted file to /system/bin (from the root of the SD card)
3. Then using the File Manager still, go to the Properties of the parted file and go to Permissions and under R, W, and X put a check mark in the three boxes bellow each. (I don't know which ones it needs permissions for so I just give it permissions to everything, kinda frowned upon to do but I trust this program so...)
By doing this you can completely stay out of command line, but at the same time you're installing a command line program so you shouldn't be afraid of the command line in the first place. Lol.
Note: After this you can go to a terminal window and type su to get root access then type
Code:
parted /dev/block/sda
you will of opened your external memory card, now use parted as you would normally.

Make ROOT Permanet / System Read and Write to all Android ROMS for Tenderloin

Extracting ramdisk image to change fstab.tenderloin to make system read and write allowing permanent root access using any ROM ever created for the HP Touchpad.
I am using Ubuntu 18.04.1 LTS 64-bit (All the software is open source and free, you can get the packages necessary for your distro)
Create a folder in /home (root) name it hpboot ( on the PC ) all work is done on the PC.
Open the custom ROM zip file and extract boot.img to the created directory hpboot
Open Terminal in the hpboot directory, all the commands needs to be enter there.
Text beginning with –>># are for information only. Do not paste into the Linux terminal window.
–>># The following will extract images from boot.img file located in the hpboot direcory.
–>># Copy and paste each individual line in the Terminal window one by one and wait until each command finish processing.
dumpimage -i boot.img kernel.uImage
dumpimage -i boot.img -p 1 ram
dd if=ram of=ramdisk.img.gz bs=64 skip=1
gunzip ramdisk.img.gz
mkdir ramdisk; cd ramdisk
cpio -i < ../ramdisk.img
–>>#The ramdisk files are uncompress in the hpboot/ramdisk directory
–>>#Open file fstab.tenderloin using (text editor) change mnt_flags of/system ext4 from ro to rw
–>>#Look like this when change from (ro ) read only to ( rw ) read and write.
–>>#<src> <mnt_point> <type> <mnt_flags and options>
–>>#/dev/store/cm-system /system ext4 rw,errors=panic
–>># Save and close the fstab.tenderloin file
–>># The next 3 steps will repack the files into the ramdisk and merge Kernel to create the finish boot image.
find . | cpio --create --format=’newc’ | gzip > ../ramdiskRW.img
cd ~/hpboot
mkimage -A arm -O linux -T ramdisk -C none -a 0x00000000 -n “TENDERLOIN RW SYSTEM RAMDISK” -d ./ramdiskRW.img ./ramdisk.uImage
mkimage -A arm -T multi -C none -n “Tenderloin RW System” -d kernel.uImage:ramdisk.uImage uImage.Android_RW
–>>#Boot the touchpad into TWRP, connect to PC, copy uImage.Android_RW to the external Micro SDCard.
–>>#Select MOUNT and touch Boot, go back, touch Advanced, File Manager, touch external_sd, select uImage.Android_RW, touch Copy File, touch boot, touch select Current Folder.
–>>#You should have free space on your boot for both images. At the boot screen you will have the option of Android (with no permanet ROOT access) and Android_RW (RW System), you need to install SuperSu. You can use any of the two options or delete uImage.Android and then rename uImage.Android_RW to uImage.Android for one boot option.
You do not need to re flash the ROM, you can add this boot file and use it with your current installed working ROM.
The process works for all boot.img created for the HP Touchpad. If you have a ROM and would like to have system read and write access then you can do this.
Hopefully a Linux Guru will create a script for this, which will automate the process to 3 seconds!
I like tinkering with my TP but I am running @Windows 7 on a 32 bit.. any suggestions?
Android is base on Linux OS.
Install vmware player and run ubuntu as a virtual machine, both are free.
--SNIP--
Hopefully a Linux Guru will create a script for this, which will automate the process to 3 seconds!
Click to expand...
Click to collapse
Here's a shell script that automates the process (rename the extension from .txt to .sh). Put the script and boot image file in any directory and type
Code:
./rwcreate.sh
If it doesn't execute, it probably needs its permissions changed.. Right click the file you created, select 'properties'. In the properties window, select "Permissions" and check "allow executing as ..." or type
Code:
chmod +x rwcreate.sh
in a terminal window
Thanks for your help and dedicating your time to make it easier for others.
I made suggestion to the script on correcting an error, on DU forum.
Now is just a click to get it done, but if we were in a perfect computer world, it could be even easier as to connect the HP Touchpad to PC using USB.
Then run the script and everything is complete!
Using adb pull command to get (boot.uImage) from hp boot directory, to PC.
Changes are done as per script.
adb push command new boot.uImage to hp boot directory, all done!
But making it easier, will make it more complicated and having to install more software and confusing!
HP_TOUCHPAD said:
Thanks for your help and dedicating your time to make it easier for others.
I made suggestion to the script on correcting an error, on DU forum.
Now is just a click to get it done, but if we were in a perfect computer world, it could be even easier as to connect the HP Touchpad to PC using USB.
Then run the script and everything is complete!
Using adb pull command to get (boot.uImage) from hp boot directory, to PC.
Changes are done as per script.
adb push command new boot.uImage to hp boot directory, all done!
But making it easier, will make it more complicated and having to install more software and confusing!
Click to expand...
Click to collapse
Done. Thanks.
shumash said:
Done. Thanks.
Click to expand...
Click to collapse
The script on this forum is correct, but in the DU the file was wrong, corrected now.
Thanks for the fix and help!

Categories

Resources