[HOWTO] Install Sugar Learning Platform on a low-cost tablet - Upgrading, Modifying and Unlocking

Hi there,
so this is a guide how to install the Sugar Learning Platform ( http://www.sugarlabs.org/ ), which might be known from the OLPC project ( http://one.laptop.org/ ) on a low cost tablet using Android. In this example I used the Zync Z930 ( http://www.zync.in/index.php/our-products/tablet-phablets/zync-z930-detail ), but generally spoken it should be possible on every tablet / device running Android.
Software requirements
Complete Linux Installer ( https://play.google.com/store/apps/...linuxonandroid&feature=search_result&hl=en_GB )
android-vnc-viewer ( https://play.google.com/store/apps/details?id=android.androidVNC&feature=search_result&hl=en_GB )
Android Terminal Emulator ( https://play.google.com/store/apps/details?id=jackpal.androidterm&feature=search_result&hl=en_GB )
All the software above should be free of cost (at least at the time this is written). Technically we will have running a special Fedora-ARM-Image in a chroot environment on the top of Android. But you will need root rights for this, so be aware of warranty conditions and other things as it might harm your device and make it unusable.
To root your device, you must find a method that works for your device. Many devices can be rooted according to that method , for my device I used simply adb commands as described by arunal_123 in this thread: http://forum.xda-developers.com/showthread.php?t=2093663
I did not use the files he offered as I had my own, but I think this should not change a thing. However, be aware what rooting means and if you do not know it, DO NOT DO IT.
OK, so I expect you to have downloaded the 3 applications I suggested, now that we have a rooted device, let us start the real work!
First, download the Fedora-Image file from here As you can read, this is an ALPHA version, and in fact there are some bugs, however, it should work for us, so do not worry.
Now I expect that you have the image file at /user/home/fedora.img
First you might want to enlarge the image file to allow us to install all the applications we want. You can do that like this. I used method 1. If you face some trouble that the mount-point does not exist, feel free to create it by yourself manually like that as root on terminal (I expect you to run a GNU/Linux on your computer, if you do not have one, just load down an image of for example Ubuntu and put it on your USB drive ( http://www.ubuntu.com/download/help/try-ubuntu-before-you-install )):
mkdir /media/fedoranew
OK, now that you have enlarged your image file (maybe to 2GB), let´s proceed.
Open the terminal app and type su. Now there should be a # instead of a $. If this does not work, you have not successfully rooted your device, go back to step one, if you face trouble, make a specific thread for your device, but search on the forum before. Now you can already start up fedora using the following command:
Code:
sh /data/data/com.zpwebsites.linuxonandroid/files/bootscript.sh /mnt/sdcard/fedora/fedora.img
(your image file would be on your sd-card in the folder fedora named fedora.img, on some devices the real extern sdcard might be available under ext_sd instead of sdcard).
Now some errors will popup, let us ignore them right now. So we are in fedora right now, but without graphical view. First, we can update all the stuff by using yum. Just type yum update (that might take some time, take a cup of coffee or realize that you should repaint your wall again)
Alright, so now let us install the programs we need, that is the tightvnc-server and the sugar-desktop, therefore type
Code:
yum install tightvnc-server
yum groupinstall sugar-desktop
yum install sugar-emulator
OK, now we must change the xstartup file of our vnc-server to use our own version. I actually prefer the nano-editor (you can install it with yum install nano, but vi is pre-installed, to use it, type: vi /home/fedora/.vnc/xstartup In the case it does not exist, just recreate the user fedora by deleting it by userdel fedora, also erase all files by rm -r /home/fedora and create it again by adduser fedora, just ignore any warnings. Now you should change the file like that:
Code:
#!/bin/sh
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
x-terminal-emulator -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
dbus-launch --session sugar &
Right now if you would try to start it, you would find various errors in the logfile in /home/fedora/.vnc, that is due to some strange rights for some folders and some missing devices. So here is how to fix this issue:
Code:
chmod 666 /dev/null
chmod 777 /tmp
yum install MAKEDEV
cd /dev
MAKEDEV tty
MAKEDEV pts
So now you should have all devices and sufficient permissions, but you might not have a vnc-user-password for fedora, so change to the user and make a dummy start of the vnc-server
Code:
su - fedora
vncserver
...and choose your favorite password.
Alright, go back to root via exit and shut the hole thing down via exit again.
So start Fedora again by pressing the Vol-Up button and w on the terminal, press enter.
OK, now we should have a more or less graphical interface, so start android-vnc-viewer, use the following settings:
Code:
Port-Number: 5900
Username: fedora
Password: <your_choice>
24bit colours
And connect....
Now you should see some terminal, type
Code:
sugar-emulator
Wait a second and sugar should power up. Now you should be able to start activities and also install new ones.
Enjoy Sugar on your tablet and tell me about your experiences and problems.
I just wrote this hole post out of my memory, so probability is high I forgot something, just tell me about your issues and I will update the guide.
Happy hacking!

Sugar Learning Platform on Inexpensive Chinese Tablet
I was very happy to find a post on this topic. I have a couple of Yeahpad Pillbox7 inexpensive Chinese tablets, which I purchased specifically because they are the only thing I can afford and my 4 year old twin boy and girl need a real learning computer.
I believe this topic is of the highest importance as successful implementation means making the original goal of the $100 Sugar computer a reality to the individual user who doesn't necessarily need the specifications of the XO machine.
I have been as detailed as I can be - perhaps painfully so - because I don't know what I am missing that could make the difference in turning this from a lengthy set of failed directions and notes into a functional demonstration project that proves that it is possible to reach this goal, which has been more than a decade in the making, albeit by taking some shortcuts with the lofty hardware goals and in this case running in a virtual environment which hampers performance and functionality.
If you want to start reading where following your directions starts to go haywire then skip to the dotted line of astrixs "* * * * * * * * *" and the heading in capital letters that says, "YUM UPDATE, INSTALLING TIGHTVNC-SERVER, SUGAR-DESKTOP, & SUGAR EMULATOR - RESULTING UNFOUND FILE DEPENDENCIES NOT AT ANY MIRROR"
The specifications of the Yeahpad Pillbox7 are about identical to the machine you used.
SPECIFICATIONS ON THE YEAHPAD PILLBOX7
Android Ice Cream Sandwich
Allwinner A13 CPU and Mali-400 GPU - which is ARM Cortex-A8 architecture
512 Mb RAM
4 GB internal memory
7" capacitive touch screen
some kind of wifi - supposedly 802.11n
I have a 16GB miniSDHC card I am using with a microSD adapter
I have a USB hub and have connected a mouse and keyboard to make the work easier.
PREVIOUS EXPERIENCE RELEVANT TO THIS ENDEAVOUR
I have been using the Linux On Android / Complete Linux Installer app with Terminal Emulator app and Android VNC Viewer app all from the Play store.I have successfully chroot virtualized a very basic Debian with XFCE, and also Ubuntu 12 with LXDE with these tools.
I also have been spending some time on the Linux on Android IRC channel and have Zac the creator of the app on my FaceBook page. Zac has been helpful and is very curious as to how this project goes.
My device the Yeahpad Pillbox7 is pre-rooted and only requires a "su" at terminal to get the "#" prompt.
Despite any details that indicate otherwise, I am a complete Android noob and my experience in linux is just as a distro-hopping enthusiast with no professional experience and almost no understanding. Nonetheless I try to enjoy what I do with these consumer devices and my emphasis has always been on the lower end economically, saving old machines often when there is not any funds for a new one, and for about 5 years now also getting ahold of consumer devices from China at the lowest price that can be had new and trying to modify the stock "computer" into something useful. This is my third attempt to do so in that category.
This type of chroot linux virtualization has shown the most promise as of late in the absence of driver availabilty for installing linux natively on a category of device where the manufacturers, the components they use, and the architecture has been in constant flux - but at this point in the market they are all aiming for Android v4 and up with Play store access. Since these devices are small, they seem to lend themselves to the application of young children, and also since the largest percentage of very poor users without access are young children, the application of a learning environment that emphasizes classical computer literacy with such allegories as turtle graphics to teach programming at a young age is a worthwhile lofty goal for the community to apply to the flood of inexpensive tablet computers coming our way now.
ALPHA VS BETA VERSION OF FEDORA CORE IMAGE FOR LINUX ON ANDROID
Perhaps this is where I went wrong I am using the BETA version of the Linux on Android Fedora Core image. It wasn't available when you wrote this post. Perhaps I was mistaken in thinking that the BETA would be the better image to start with. I will go back and do it with the ALPHA version next, which is per your instructions, and I will post my results again. Anyhow I took the Fedora Core image for Linux on Android and I unzipped it using 7zip, I verified the md5sum using fileverifier++ and I put on the miniSDHC card under a folder called /fedora/ and the file I named fedora.img. So I put it at /fedora/fedora.img on the miniSDHC card.
CONFIGURING MY PC TO BE ABLE TO DO IMAGE PREPARATION
I downloaded a the alternate version of xubuntu 12.04.b for 64 bit. Did an md5sum check and burned it to a CD-ROM. Then after updating the VirtualBox install on the PC I have access to is an Acer Aspire 5733-6838 which runs Windows 7 Home Premium SP1 on an Intel Core i5 with 4GB of DDR3 RAM - I installed the Xubuntu as a Guest OS on VirtualBox successfully and applied all the latest updates. Then I also installed Guest Additions and made the Drag'n;Drop and Clipboard functions bi-directional because I like being able to copy and paste in and out of my host OS while I do my work. I was able to mount the 16GB miniSDHC card onto the Guest Xubuntu OS using the USB Devices options on the VirtualBox control bar.
I did all that (installing Xubuntu) because the Linux I've been virtualizing and enjoying lately, Mageia2, did not execute the "cp -r fedoraold/* fedoranew" command which I derived from the 'expand the image directions' you referenced without generating a plethora of "cp: cannot create symbolic link" errors!
EXPANDING THE FEDORA IMAGE TO 2GB
Having switched to Xubuntu 12.04b 64bit alternate - I was able to execute the directions derived from
the directions from the linuxonandroid resource you referenced (I am not allowed to post outside links because I am a new xda forum member)
and enlarge the fedora image file to 2GB. I used these commands from terminal:
dd if=/dev/zero of=fedoranew.img bs=1M count=0 seek=2048
mke2fs -F fedoranew.img
so then I created two folders on the miniSDHC card at /fedora/ one called "fedoraold" and one called "fedorabang"
and then mounted the folders from the terminal using these commands
sudo mount -o loop fedora.img fedoraold
sudo mount -o loop fedoranew.img fedorabang
then I did the copy to the larger 2GB image file using this command from the terminal:
sudo cp -r fedoraold/* fedorabang
and finally I unmounted the folders using these terminal commands
sudo umount fedoraold
sudo umount fedorabang[/B]
I then shut down xubuntu and used the remove usb device icon from the Windows 7 taskbar to get a safe to remove the SDCard message.
I removed the miniSDHC card from the microSD adapter and inserted it into the Yeahpad Pillbox7 while powered off.
TRYING TO MODIFY THE FEDORA IMAGE ON THE TABLET TO RUN SUGAR LEARNING PLATFORM USING LINUX ON ANDROID AND ANDROID VNC VIEWER
I already have Linux on Android / Terminal Emulator / and Android VNC Viewer Apps installed on the Android Tablet.
Using File Manager I see that the newly made image is at: mnt/extsd/fedora/fedoranew.img
So after confirming that the bootscript.sh file is where it is supposed to be I use this command from the terminal to launch Linux on Android with the 2GB FedoraCore image
sh /data/data/com.zpwebsites.linuxonandroid/files/bootscript.sh /mnt/extsd/fedroa/fedoranew.img
I take the advice to ignore the errors, I've seen them before on LinuxOnAndroid during successful launches of other images.
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
YUM UPDATE, INSTALLING TIGHTVNC-SERVER, SUGAR-DESKTOP, & SUGAR EMULATOR - RESULTING UNFOUND FILE DEPENDENCIES NOT AT ANY MIRROR
So I continue by trying to get all the current updates for fedora using the terminal command:
yum update
At the Transaction summary - I also respond with: "y" and [ENTER].
This is where I ran into my first set of snags - summarizing the errors Yum couldn't find these files:
bind-license-9.9.2-5.P1.fc17.noarch.rpm
dosfstools-3.0.14-1.fc17.armv5tel.rpm
selinux-policy-3.10.0-167.fc17.noarch.rpm
bind-libs-9.9.2-5.P1.fc17.armv5tel.rpm
dnsmasq-2.65-4.fc17.armv5tel.rpm
coreutils-8.15-9.fc17.armv5tel.rpm
libsss_sudo-1.8.6-1.fc17.armv5tel.rpm
iproute-3.3.0-5.fc17.armv5tel.rpm
bind-utils-9.9.2-5.P1.fc17.arm5tel.rpm
bash-4.2.39-2.fc17.arm5tel.rpm
bind-libs-lite-9.9.2-5.P1.fc17.armv5tel.rpm
selinux-policy-targeted-3.10.0-167.fc17.noarch.rpm
at any of these mirror sites:
apparently I can't post these here because I am a new xda forum member
I tried "yum update" more than once and ran into the identical set up errors, so I continued on hoping that substitute files were found, or that none of those files were essential.
So I conintued to try and install the programs your post says that I need, starting with tightvnc-server, so I use the terminal command:
yum install tightvnc-server
At the Transaction summary - I also respond with: "y" and [ENTER].
This is a summary of the files that Yum couldn't find from the errors:
perl-PathTools-3.33-221.fc17.armv5tel.rpm
perl-Pod-simple-3.16-221.fc17.noarch.rpm
perl-macros-5.14.3-221.fc17.armv5tel.rpm
perl-libs-5.14.3-221.fc17.armv5tel.rpm
perl-Pod-Escapes-1.04-221.fc17.noarch.rpm
perl-Module-Pluggable-3.90-221.fc17.noarch.rpm
perl-5.14.3-221.fc17.armv5tel.rpm
gnutls-2.12.20-4.fc17.armv5tel.rpm
I believe that Yum had tried all the mirror sites listed earlier.
As before, I have nothing else to go on, so I hope that either substitute files were found, or that none of those files were essential.
So I continue to try and install the progams your post says that I need, the next one being the sugar-desktop, so I use the terminal command:
yum groupinstall sugar-desktop
At the Transaction summary - I also respond with: "y" and [ENTER].
This is a summary of the files that Yum couldn't find from the errors:
libarchive-3.0.4-2.fc17.armv5tel.rpm
libproxy-0.4.10-1.fc17.armv5tel.rpm
gnutls-2.12.20-4.fc17.armv5tel.rpm (see above - already not found before)
I believe that Yum had tried all the mirror sites listed earlier.
As before, I have nothing else to go on, so I hope that either substitute files were found, or that none of those files were essential.
So I continue to try and install the programs your post says that I need, the next one being the sugar-emulator, so I use the terminal command:
yum install sugar-emulator
At the Transaction summary - I also respond with: "y" and [ENTER].
This is a summary of the files that Yum couldn't find from the errors:
libproxy-0.4.10-1.fc17.armv5tel.rpm (see above - already not found before)
gnutls-2.12.20-4.fc17.armv5tel.rpm (see above - already not found before)
I believe that Yum had tried all the mirror sites listed earlier.
As before, I have nothing else to go on, so I hope that either substitute files were found, or that none of those files were essential.
All in all from I read that there were 22 .rpm files missing that were not found at any of the relevant mirrors between the general yum update (12 missing files) and dependencies from tightvnc-server, sugar-desktop, and sugar-emulator (10 more missing files)
CUSTOMIZING THE XSTARTUP FILE AT /home/fedora/.vnc/xstartup FOR OUR PURPOSES
So I continud on with the instruction in your post, next on the agenda is an xstartup file for vnc-server.
You describe it as changing the xstartup file - I could used the "ls -a" command on the directory /home/fedora/ and could not find a directory called .vnc and could not find an existing file at /home/fedora/.vnc/xstartup
I too don't seem to have the talent for the vi editor so I take your suggestion and install nano using this terminal command:
yum install nano
At the Transaction summary - I also respond with: "y" and [ENTER].
There were some other files starting with "." that I found in the /home/fedora/ directory - I looked at them with the text editor and I didn't see any information that I could figure was specific to this use instance - but I am no expert. So I did the following strictly on your instructions advice.
It said if I could not find the xstartup file in existance to do the following from the terminal command line, ignoring any warnings.
userdel fedora
rm -r /home/fedora
adduser fedora
I tried the least destructive choices it gave me upon the "rm -r /home/fedora command" but it did not result in a .vnc directory or xtartup file that I could detect when completing the instructions to the "adduser fedora" command - so I repeated the commands but answered the resulting question with removal of even the /home/fedora directory. nonetheless all of that failed in creating a .vnc directory that I could detect (using the 'ls -a' command) or of an xstartup file.
So I went ahead and ad libbed the following from the terminal because otherwise anything I were to write in nano for /home/fedora/.vnc/xstartup would not save for lack of a directory for it to go in.
mkdir /home/fedora/.vnc
For some reason even after I execute the make directory command, "ls -a" from the /home/fedora/ directory still doesn't show it, but I can cd into, /home/fedora/.vnc/
From there I simply followed the directions and from the terminal:
nano /home/fedora/.vnc/xstartup
And from there entered the script given and saved it with ctrl-o and/or ctrl-x nano commands:
#!/bin/sh
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
x-terminal-emulator -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
dbus-launch --session sugar &
ADDITIONAL PERMISSIONS AND MISSING DEVICES
So refering to your instructions once again: it says that I need to execute the following to give certain rights and take care of missing devices. So from the terminal:
chmod 666 /dev/null
chmod 777 /tmp
yum install MAKEDEV
At the Transaction summary - I also respond with: "y" and [ENTER].
Terminal responds "Complete!"
cd /dev
MAKEDEV tty
Then I enter according to your instructions
MAKEDEV pts
And the terminal responds:
don't know how to make device "pts"
So I do some research into the "Makedev" command - I can't post this url here because I am a new xda forum member.
Granted the page I find is not from the same flavor of linux but I don't see a "pts" option and it seems perhaps this is a typo.
So I need to guess what you were trying to accomplish. I decide on the following terminal command:
MAKEDEV pty
And at least there are no errors - but was it what you intended - I have no clue? also was there any reason for the Makedev command to be capitalized either when asking yum to install it or in its usage. Again I am a noob so I have no clue.
VNC-USER-PASSWORD AND DUMMY START OF VNC-SERVER AND OTHER FINISHING TOUCHES (unresolved)
From the terminal the next command in your directions gives no problems:
su - fedora
The result is the changed the prompt from [[email protected] dev]# to [[email protected] ~]$
but the next command:
vncserver
is unrecognized or any variants I try "vnc-server" "tightvnc-server" and I look for anything promising in the /bin/ and /sbin/ directories but fail to find anything.
So the part about 'choosing my favorite password' which I know I will need to use the Android VNC Viewer app to see the graphical install of the sugar learning platform, is sadly not a reality. This is confusing to me as I know the command must be available somehow as everytime one tries to launch the Linux On Android app it is a question on the user dialog, something like "start the vnc-server (y/n)" or some words along those lines, so I know there is a command to do this available.
So to shut everything down requires from the terminal:
exit
and then also again from the terminal:
exit
I am equally perplexed by the whole set of directions instructing to press "Vol-Up" button and w on the terminal.
I try it. and the Vol-Up button does register some symbol in the terminal, and I follow it with the letter "w" on the terminal and enter.
and also I try to do the two actions in conjunction, but nothing I do with those directions seems to restart Fedora that I can tell.
Can you explain that part of the directions in more detail?
I try various combinations of things I know to try but I Android VNC Viewer is failing to connect even if there is something to connect with for lack of a password
that I have not been able to set or already know. Also even after getting Linux on Android to launch the fedoranew.img that has been modified it the terminal is not
responsive on the command line to:
sugar-emulator (does nothing)
AN INVITATION TO ALL THOSE WHO KNOW BETTER AS TO WHAT I CAN OR SHOULD TRY TO DO TO MAKE THE SUGAR LEARNING PLATFORM WORK WITH LINUX ON ANDROID AND ANDROID VNC VIEWER.
I have not been able to enjoy Sugar on the Yeahpad Pillbox7 tablet,
and I am taking you up on your offer to tell you about my experiences and problems.
I know you said you wrote the post out of memory but if you could do it again taking notes while you do it so that others can try to get the same result, please comment on what you think I am doing right or wrong, or if you can remember more that might be helpful - then the world will owe you a debt as there in is in my humble opinion many many people who don't even know that they need this information yet.

OK, so what I think is that this image is somehow messed up as these unresolved dependencies indicate - in my opinion - some mis-configured setup.
Maybe the fastest solution might be to try the alpha-Image I used - if you still face trouble, please feel free to describe it as precisely and well as you did this time.
Good luck

I am about to repeat the process with the ALPHA image but..
I am about to repeat the process with the ALPHA image. But...it would help if you made comment on more than the dependency problems...
These three areas in your instructions and my comments are areas I am particularly curious about and think your input would be valuable in.
1)
For instance it would be helpful to know about what you think about what you think about my comments with the strange behavior around the /home/fedora/.vnc/xstartup file and the del and add of the fedora user.
Wouldn't it be better just to add the .vnc folder and xtartup file and doesn't the lack of a .vnc folder at all seem to indicate a step that wasn't documented?
2)
Please examine what I wrote about the MAKEDEV command. Was I correct about the typo?
3)
Please enlighten me further about your instructions regarding "Vol-up" and "w" - I can't find any information anywhere that gives me a clue about what you were trying to do there. I wasn't able to reproduce the result you got - maybe if I understood more I will be able to replicate what you were trying to do there and or find another way to do it.
Thanks so much in advance... I appreciate your interest in this topic!

For instance it would be helpful to know about what you think about what you think about my comments with the strange behavior around the /home/fedora/.vnc/xstartup file and the del and add of the fedora user.
Wouldn't it be better just to add the .vnc folder and xtartup file and doesn't the lack of a .vnc folder at all seem to indicate a step that wasn't documented?
Click to expand...
Click to collapse
As I understood you, yum install tightvnc-server fails due to unresolved dependencies. Therefore, no such folder will be created as the program is not installed. That is also why you will not get such a folder after recreating the user.
Please examine what I wrote about the MAKEDEV command. Was I correct about the typo?
Click to expand...
Click to collapse
It might be the case that it was in fact pty, not pts, I am not sure about that anymore. You can check for the success by changing into the /dev directory ( cd /dev ) and then list all entries of pty ( ls pty* ) to see whether the device was created successfully.
Please enlighten me further about your instructions regarding "Vol-up" and "w" - I can't find any information anywhere that gives me a clue about what you were trying to do there. I wasn't able to reproduce the result you got - maybe if I understood more I will be able to replicate what you were trying to do there and or find another way to do it.
Click to expand...
Click to collapse
This is only for convenience so that you do not have to write the hole command again. So when you are in the terminal emulator, by default, you should be able to go up in your bash history by pressing "Vol-up" and "w", similar to the "arrow-up" on your PC.
I hope I could help you, good luck.

Thank you.
Thank you, those are some very useful replies!
I will be sure to post the results of my next binge of effort on this project.

Related

[MOD] HULU Flash Hack - Flashex 2.05(5/2/12) Auto Hex-edit libflashplayer.so

FLASHEX 2.05 (unified release 4)(Release Date: 5/2/2012)
Description
Flashex is designed to allow people using an Android device to watch hulu and some other restricted sites with Adobe Flash Player and a properly configured web browser as if it was a Windows PC. Dolphin HD Stock Browser(choose "request desktop site" in menu each time) is a good choice but any browser that allows you to act as Desktop via settings should work.
Note: Dolphin HD has some issues with full screen video at the moment so I have switched over to useing the stock browser and selecting "request desktop site" from the upper right-hand menu for now this works and has good full screen performance on FlexReaper and Stock ICS 4.0.3.
How it works
The script will look for libflashplayer.so then attempt to create a copy, edit the copy, and copy the edited version back. It stores the edited copy, and writes it over the default file each time it's run. It will check the version of the current libflashplayer.so file each time before it copies the edited version over. If libflashplayer.so's version has been upgraded or downgraded it will make a new copy, edit, write it back and store the new one to use each time. I suggest using Script Manager to run the script at boot once you run it the first time manually to make the first edited copy.
What's New in Version 2.05?
-Added a few more checks for libflashplayer.so to help improve troubleshooting and configuring on different ROMs and to eliminate the possibility of a hang if libflashplayer.so is not readable.
(Still waiting on feed back and/or -x mode debug output reports. feel free post them or better yet PM them to me)
What's New in Version 2.04?
-Added support for Custom BusyBox from CynogenMod (BusyBox 1.19.4-cm9) when testing the Busybox version
What's New in Version 2.03?
-Added checks to verify Busybox location, permisssions, and version to verify compatability and inform the user if they need to update/reinstall busybox or make a configuration change.
-Various minor refinements.
-Can now safely be test run on ANY device since it will verify the location of all required elements prior to performing any task.
NOTE: This doesnt mean it will enable hulu on an old 500mhz 2.2 device, just that it should be safe to use to modify Adobe Flash on any device capable of properly running it.(If your Adobe Flash is installed in a diffrent location you will need to configure the script to point it's install directory, or put a copy of your libflashplayer.so file into the Flashex2 directory and name it AND_libflashplayer.so and copy the resulting WIN_libflashplayer.so back by hand if you prefer.)
What was new in Version 2.02?
-Fixed various typoes in output messages
-Added a fix for people having issues with strings, grep etc returning as not found when /system/xbin is either not in the users default $PATH or is too low in the list to get used.
What was new in Version 2.01?
-Many minor bug fixes
-Scripts have been unified into a single script.
-Made some changes to how version checking is done
-Script is safer, more reliable, and easier to use over all.(at least IMO hehe)
-Automatic re-edit of edited source file, when either an upgrade or downgrade is detected. This allows the script to be run at boot via Script Manager, or other while still leaving, Adobe Flash to auto update.
-Script is now a single executable file that will both hex edit Adobe Flash(each update), and copy the edited file over to /data when needed.
-Improved version detection
-Improved output messages
Some notes on running during bootup
Once you have decompressed the Flashex2 folder and flashex.sh script to /mnt/sdcard/Flashex2 you will be able to run it automatically at boot via Script Manager if you wish. I currently have been using it this way. I have tested it performing the hexedit during a boot up. It works fine.
Known Limitation
Note: This only applies to auto-running the script via Script Manager, Cron, what ever It takes about 2 minutes with a Tegra 2 to complete the hexedit of the file.
Because of this when booting after an update to libflashplayer.so it will be editing the file for a min or two after your home screen shows. You will want to wait 3 min or so to be safe before you try to use Adobe Flash. This will ONLY happen when the version changes. Since Adobe Flash isn't changed that often it's not a big deal.
The rest of the time, it will be the same version so it will just take a few seconds to copy the file over. This allows you to just watch when you like even right after a system boot.
Install Instructions
Quick Directions:
Download file, unzip/extract the Flashex2 folder and it's contents, copy it to the sdcard to end up with /mnt/sdcard/Flashex2/flashex.sh. Run flashex.sh as root. Set web browser to Desktop. Enjoy watching hulu.
Full Directions:
When using Flashex205.zip via a File Manager like Astro for example.
1) Either download Flashex204b.zip directly to your tablet, or copy it to a micro SD card via PC.(note: you could unzip the contents in Windows if you prefer)
2) Save, Copy or Move Flashex205.zip to /mnt/sdcard/ It has a folder inside already of the correct name.
3) Open Flashex205.zip, then copy/paste the whole folder to /mnt/sdcard/
Note: After you do this you should have a folder named Flashex2 on your internal sdcard example: /mnt/sdcard/Flashex2
4) Inside the Flashex2 folder from the zipfile is flashex.sh
5) run flashex.sh either via terminal emulator or with an app like Script Manager.
The script "can" be run without root, BUT it will only make the hexedited file. It MUST be run as root if you also want the script to install the edited file so you can watch hulu. You can also copy the file by hand.
When using flashex205.tar.gz via a terminal emulator do the following.
1) Either download the file directly to your tablet, or copy it to a micro SD card.
2) Copy or Move the file to /mnt/sdcard/
example(copy): cp /mnt/external_sd/flashex205.tar.gz /mnt/sdcard/
example(move): mv /mnt/external_sd/flashex205.tar.gz /mnt/sdcard/
3) unzip and untar the Flashex folder and flashex.sh script from flashex205.tar.gz
gzip -d /mnt/sdcard/flashex205.tar.gz
tar -xvf /mnt/sdcard/flashex205.tar
Note: If you get an error saying not found. Your trying to install it in a diffrent location then it's currently configured you can probably figure out how to make it work easy enough. Just remember to set the path to the script inside the script it's self so it knows where make/read the edited file.
4) Now change working directories and run the script.
cd /mnt/sdcard/Flashex2
5) Run the script(su is optional, but running as root it wont copy the edited file over)
su
sh flashex.sh
Note: I suggest using sh before the script name though it's not nessesary if the path to sh at the top of the script matches yours.
Confirmed Compatable Device List(Make sure you are rooted if you want to use the script to install the modified file)
Acer Iconia A100, A200, A500 HC or ICS, FlexReaper ------ Use Latest Version
Samsung Galaxy S 4G rooted modified Gingerbread 2.3 --- Use Latest Version
Samsung Galaxy Nexus LTE ----------------------------------- Use Latest Version
Asus Eepad Transformer Prime ------------------------------- Use Version 2.2 or Latest Version
Motorola Droid Razr ------------------------------------------- Use Latest Version
HTC EVO 3D --------------------------------------------------- Use Latest Version
HTC EVO 4G running mikg v11 ------------------------------- Use Latest Version
Note: Any Device that is compatable with Adobe Flash and capable of playing hulu videos(500 Mhz or better ARM7 CPU 256 MB ram, Android 2.2 or better) that has been rooted and has busybox installed should be compatable
If you are attempting to use a Busybox older then v1.18.1 You will have to change a value at the top of the script before attempting to run it since I'm not sure how old of versions are 100% compatible.
===============================================
ATTN: SUPPORT, QUESTIONS, COMMENTS
If you need help getting it to work for your device and cant post in this section you can follow this
->SUPPORT LINK HERE
You can PM me or you can also try me on Twitter
Legal Info
Flashex205.sh was made by NoSudo for personal use
anyone may use it or change it but I retain creative
licence for my work. You should only take credit for your
changes.
I take no reponsablility for anyone elses actions. If you break
something or violate any rules it's on you.
If you wish to try and make money on it or use it for any comercial
venture I expect to be contacted and informed so I may negociate
an acceptable for profit licence with compensation.
This software is FREE and yours to enjoy, give away, edit, use for Non-Profit purposes ONLY.
A NOTE ON VERSIONS!
I recommend the use of the latest version Flashex204.sh. If you have old versions installed. MAKE SURE YOU RUN THE RIGHT ONE. It's up you to reconfigure Script Manager etc. so don't forget or it will keep running the old one.
ALSO Please remember to hit that Thanks button if you find my script useful.
I have been doing a little version testing.
I can confirm that flashex v2.01 does edit other versions so far I have tested it with. I just tested with 11.1.115.7 and it works fine via xxd. Im going to test on Android with Busybox's hexdump next.
I can also confirm that it works on 11.1.111.8 since my tablet just auto-updated. I simply ran the script and updated my hexed version from 11.1.111.7 to 11.1.111.8 as designed.
Just tried the new version and still a no go. See the pic for the full error.
Ran with terminal emulator, gscript, and root explorer. Same error for all.
And you have the .so file from the old version thread.
.so path: /data/data/com.adobe.flashplayer/lib/libflashplayer.so
ICS Leak .012.
busybox 1.19.3
Joecascio2000 said:
Just tried the new version and still a no go. See the pic for the full error.
Ran with terminal emulator, gscript, and root explorer. Same error for all.
And you have the .so file from the old version thread.
.so path: /data/data/com.adobe.flashplayer/lib/libflashplayer.so
ICS Leak .012.
busybox 1.19.3
Click to expand...
Click to collapse
Weard here is the output I got running a test edit. I used the same 2.01 script just modified so it doesn't write to my adobe flash. Kind of sandbox I guess. As you can see it reads and edits it fine. I'll look some more.
Command: '/mnt/sdcard/FLASHEX2_vtest/flashex_vtest.sh'
-------------
Out: $ exec sh '/mnt/sdcard/FLASHEX2_vtest/flashex_vtest.sh'
=================================================
Source Files Doesn't Exist
Destination File: /mnt/sdcard/FLASHEX2_vtest/DST/libflashplayer.so
Destination Ver: Adobe Flash says AND(Androiud) v1111157
Detected READ access for /mnt/sdcard/FLASHEX2_vtest/DST/libflashplayer.so
Created /mnt/sdcard/FLASHEX2_vtest/cache Sucessfully... Checking...
/mnt/sdcard/FLASHEX2_vtest/DST/libflashplayer.so preparing to copy and edit file........
Copy: /mnt/sdcard/FLASHEX2_vtest/cache/libflashplayer_PREMOD looks good =================================================
Preparing to create a hexdump.........
Dont panic...This could take over a minute on a Tegra 2..
Its Converting an 8MB or so Binary on a little tablet...Just wait its fine Created a hexdump of /mnt/sdcard/FLASHEX2_vtest/cache/libflashplayer_PREMOD
=================================================
Preparing to edit /mnt/sdcard/FLASHEX2_vtest/cache/libflashplayer_HEXDUMP..
This might take a minute too.... /mnt/sdcard/FLASHEX2_vtest/cache/libflashplayer_HEXDUMP has been edited... =================================================
Converting /mnt/sdcard/FLASHEX2_vtest/cache/libflashplayer_EDITED to binary...
Binary File: /mnt/sdcard/FLASHEX2_vtest/WIN_libflashplayer.so created...
Checking Binary file /mnt/sdcard/FLASHEX2_vtest/WIN_libflashplayer.so... =================================================
HEXEDIT SUCCESSFUL File: /mnt/sdcard/FLASHEX2_vtest/WIN_libflashplayer.so now reads as Version: WIN 11,1,115,7
Sent from my A100 using XDA
I'm at a bit of a loss as to why it's not working for you Joecascio2000. I'm still looking into it.
I can confirm if I copy your libflashplayer.so v 11.1.115.7 to my device and run the script on it. I AM able to edit the file and get a good binary at the end. I was able to run it via Terminal IDE, Terminal Emulator, and Script Manager.
Going by the error your getting I would say the issue could be related to Busybox. I know you say you have 1.19.3(same as mine)
what happens if you try this from a Terminal
strings /data/data/com.adobe.flashplayer/lib/libflashplayer.so | grep "AND 1[0-2],[0-9]*"
You should get back a list of strings out of the binary, and one of them should say something like "AND 11,1,115,7"
If that doesnt return the correct line, what does this return
strings /data/data/com.adobe.flashplayer/lib/libflashplayer.so | grep "AND 1"
This should return "AND 11,1,115,7" if it doesn't then I would take a closer look at your strings, and grep binaries which would indicate a possible issue with your copy of Busybox or maybe your $PATH as it could effect what version gets used when running a shell command.
I still feel very confused by it working on my device and not on yours with the same file. However I also feel confident that since it works on my A100 we can get it working on yours too without much hassle. We just need to figure out what the deal is.
NoSudo said:
Sent from my A100 using XDA
Click to expand...
Click to collapse
Yeah so weird. I just tried it again after uninstalling flash and re-installing it. Same error. Maybe I'm executing it wrong. This is what I put:
su
sh /mnt/sdcard/Flashex2/flashex201.sh
It does seem to work, just give me an error with the .so file.
EDIT: and both string lines return "no such file or director". I just copy and pasted them in, maybe I did something wrong?...maybe its busybox...?
I just copy and pasted them in, maybe I did something wrong?
Click to expand...
Click to collapse
copy and past of the strings command above should work yes. You can even just run the following
strings /data/data/com.adobe.flashplayer/lib/libflashplayer.so
If that give you bad command or something then you have an issue with either Busybox or your $PATH
$PATH is a special variable that unix/linux/android uses to store the locations of programs like grep, strings, etc. It specifies various directories commands are stored in. If the directory strings is stored in IS NOT in your path the script will not be able to access the command, so I can't say at this point which issue it in fact is, but I'm 99% sure it's one of those two things at this point.
That error is kinda old and can be erroneous. I'll look at that area a little closer later and see.
If you rerun the script after a successful edit it will tell you if it was successful BTW. If /data/data/com.adobe.flashplayer/lib/libflashplayer.so is already edited and is the same version as the WIN_libflashplayer.so Source file it will just print out a message that displays the actual version string from inside both files. The output will look somthing like this
Source File: /2.01FLASHEX_Dev/Lib_Version_Testing/WIN_libflashplayer.so
Source Ver: Adobe Flash says WIN(Windows) v1111157
Destination File: /2.01FLASHEX_Dev/Lib_Version_Testing/DST/libflashplayer.so
Destination Ver: Adobe Flash says WIN(Windows) v1111157
=================================================
It looks like you dont need make any further changes at this time.
Make sure you have set your browser to Desktop in settings(try Dolphin HD)
a
Joecascio2000 said:
Yeah so weird. I just tried it again after uninstalling flash and re-installing it. Same error. Maybe I'm executing it wrong. This is what I put:
su
sh /mnt/sdcard/Flashex2/flashex201.sh
It does seem to work, just give me an error with the .so file.
EDIT: and both string lines return "no such file or director". I just copy and pasted them in, maybe I did something wrong?...maybe its busybox...?
Click to expand...
Click to collapse
It could be. If you don't have a "strings" command the script wont work for you in it's current state. I made extensive use of strings to read info out of the binary files for version checking and to confirm the edit.
The error you got is something you could get from no strings command. It could also just be that the location "strings" is installed if it IS NOT in your $PATH for your ENV this would be a simple fix, in fact I'm tempted to add a PATH="" export PATH line back into the script just in case of stuff like this. I had removed it thinking it overkill.
Two diffrent folks seem to have a Busybox installer available via play.google.com. I use the one from J Rummy because it's only 1.99 for the Pro version instead of 4.99 and so far it has all the features I want and even has 1.19.4 available currently. It sounds like you may just need to figure out the location of the strings command and make sure that directory is exported as part of your $PATH. Let me know if would like assistance figuring this out.
NoSudo said:
It could be. If you don't have a "strings" command the script wont work for you in it's current state. I made extensive use of strings to read info out of the binary files for version checking and to confirm the edit.
The error you got is something you could get from no strings command. It could also just be that the location "strings" is installed if it IS NOT in your $PATH for your ENV this would be a simple fix, in fact I'm tempted to add a PATH="" export PATH line back into the script just in case of stuff like this. I had removed it thinking it overkill.
Two diffrent folks seem to have a Busybox installer available via play.google.com. I use the one from J Rummy because it's only 1.99 for the Pro version instead of 4.99 and so far it has all the features I want and even has 1.19.4 available currently. It sounds like you may just need to figure out the location of the strings command and make sure that directory is exported as part of your $PATH. Let me know if would like assistance figuring this out.
Click to expand...
Click to collapse
When I open terminal emulator the first line reads:
[email protected]:/ $ export PATH=/data/local/bin: $PATH
Also, I can't update busybox because for my current root method 1.19.3 is required.
Joecascio2000 said:
When I open terminal emulator the first line reads:
[email protected]:/ $ export PATH=/data/local/bin: $PATH
Also, I can't update busybox because for my current root method 1.19.3 is required.
Click to expand...
Click to collapse
You don't need a newer version of Busybox I'm running the same version.
it's your $PATH I will post an updated version that includes an Export PATH line to resolve after I eat some dinner.
for now you can copy/paste this into a terminal before running the script. Im guessing if you run that, then the script it will work
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/system/sbin:/system/xbin:/system/bin:/data/local/bin:/vendor/bin; export PATH
Darn...still isn't working. Lol my tab hates me. See the pic I think its a little different.
here's a link the one below is a little low res: http://i.imgur.com/uP9ZR.png
Joecascio2000 said:
Darn...still isn't working. Lol my tab hates me. See the pic I think its a little different.
here's a link the one below is a little low res: http://i.imgur.com/uP9ZR.png
Click to expand...
Click to collapse
It looks like you might still be missing the strings command. Because it doesnt look like anything is getting passed to grep. It looks like strings didnt run, so grep tried to look for the search expression as a file name.
what do you get if you type
ls -la /system/xbin/strings
or even just
ls -la /system/xbin
I show a symbolic link for /system/xbin/strings that points to Busybox. If it's in another location with your version of Busybox you just need to make sure the strings command is located in the path you use.
If you dont have a strings command at all for some reason since you have the same version of Busybox 1.19.3 you should be able to just make a Symbolic Link in /system/xbin(or what ever space you are configured to use) called strings that points to busybox. All those buxybox commands are symlinks to the same binary file in reality.
NoSudo said:
It looks like you might still be missing the strings command. Because it doesnt look like anything is getting passed to grep. It looks like strings didnt run, so grep tried to look for the search expression as a file name.
what do you get if you type
ls -la /system/xbin/strings
or even just
ls -la /system/xbin
I show a symbolic link for /system/xbin/strings that points to Busybox. If it's in another location with your version of Busybox you just need to make sure the strings command is located in the path you use.
If you dont have a strings command at all for some reason since you have the same version of Busybox 1.19.3 you should be able to just make a Symbolic Link in /system/xbin(or what ever space you are configured to use) called strings that points to busybox. All those buxybox commands are symlinks to the same binary file in reality.
Click to expand...
Click to collapse
Both commands showed: not found, however, I looked in /system/xbin/ and busybox and strings are in that folder. Also, right under strings is ( -> busybox )
Joecascio2000 said:
Both commands showed: not found, however, I looked in /system/xbin/ and busybox and strings are in that folder. Also, right under strings is ( -> busybox )
Click to expand...
Click to collapse
Yep the
strings --> busybox
is the way strings and the other Busybox commands look the
"--> Busybox" is to show what it links to, but the name is still strings. It's sorta like a shortcut in windows in a way.
Anyway that means you should be able to use strings try copy/paste this before you run the script in the same terminal.
PATH=$PATH:/system/xbin; export PATH
that take what ever you currently have for a $PATH and add /system/xbin to it
you can view your $PATH by typing
echo $PATH
Either way if your Busybox is properly installed into /system/xbin this should return a few lines out the binary. Just to confirm it's a working command on your system.
/system/xbin/strings /data/data/com.adobe.flashplayer/lib/libflashplayer.so | grep "AND"
I will come up with an up date to check for the location of Busybox and use hard paths for the commands, later in the week. That should avoid this issue coming up in the future.
First off thank you for helping with my pain-in-the-you-know-what tablet.
But sadly still a no go. I did get some more info though: http://i.imgur.com/oVxBz.png
It showed AND 11,1,115,7.
I think it's either the way I'm putting in the commands or the way my tab is rooted.
Joecascio2000 said:
First off thank you for helping with my pain-in-the-you-know-what tablet.
But sadly still a no go. I did get some more info though: http://i.imgur.com/oVxBz.png
It showed AND 11,1,115,7.
I think it's either the way I'm putting in the commands or the way my tab is rooted.
Click to expand...
Click to collapse
First off, Your very welcome. I actually enjoy this kinda stuff as long as I have time.
Next, Since it DID respond with AND 11,1,115,7 I am sure you CAN use the script, once updated. I will be working on an update this weekend. I may have a revised version made today, if I get an extra hour to dedicate to make the changes.
The issue seems to be, for what ever reason your device is having an issue with /system/xbin not being in your PATH or PATH and ENV not working as it should, BUT since /system/xbin/busybox and the symlink /system/xbin/strings both work when you type the full path, it's not a big deal.
I'm also going to try to write in a feature to test the location and version of Busybox and make sure it lists "strings" as a defined function, so the script can identify and resolve the issue when possible.
Updated Version should resolve any issues with the script not being able to use strings, grep etc on some systems.
Also check here for information on configuring Terminal Emulator to work correctly with Busybox. This I belive would get the old script working for those that had issues also for what it's worth.
NoSudo said:
Updated Version should resolve any issues with the script not being able to use strings, grep etc on some systems.
Also check here for information on configuring Terminal Emulator to work correctly with Busybox. This I belive would get the old script working for those that had issues also for what it's worth.
Click to expand...
Click to collapse
This is with the new version 2.02 and after configuring Terminal Emulator:
http://i.imgur.com/Rb458.png
Joecascio2000 said:
This is with the new version 2.02 and after configuring Terminal Emulator:
http://i.imgur.com/Rb458.png
Click to expand...
Click to collapse
Man I am at a total loss as to what your system is doing. That just doesn't make any sense at all. Are you running the script or Copy/Pasting lines into Terminal? What Busybox are you running anyway, not the version where did you get it? It seems totally defective honestly.
The script should work fine for you at this point TBH. Heck it works for me on my Linux PC too when I change the paths, and swap out xxd for hexdump and change the pattern format.
At this point I can only conclude that either you have a bad version of Busybox or you are doing something wrong.
Here is an example of what I mean
BUSYBOXPATH="/system/xbin"
if [ -e "$BUSYBOXPATH/busybox" ]&&[ -e "$BUSYBOXPATH/grep" ]; then
echo "Found BusyBox in $BUSYBOXPATH"
BSYBX_VER=`$BUSYBOXPATH/busybox | $BUSYBOXPATH/grep "BusyBox v"`
echo "Version: $BSYBX_VER"
else
echo "Unable to confirm location of BusyBox, please configure the script"
exit 3
fi
This statement says if /system/xbin/busybox and /system/xbin/busybox exist to echo "Found" etc.
Your output has those lines, so those commands HAVE to exist in those locations or it would respond with
Unable to confirm location of BusyBox, please configure the script.
However the script is unable to read the Version line off busybox because busybox isnt spitting out anything or maybe it's been modified and no longder displays the correct response. Again even a Desktop PC with Linux on it get's this response from Busybox.
What happens when you just type
/system/xbin/busybox
Do you get anything?
You should get something like;
$ busybox
BusyBox v1.19.3 (2011-11-22 01:37:10 MST) multi-call binary
Copyright (C) 1998-2011 Erik Andersen, Rob Landley, Denys Vlasenko
and others. Licensed under GPLv2.
See source distribution for full notice.
Usage: busybox [function] [arguments]...
or: function [arguments]...
BusyBox is a multi-call binary that combines many common Unix
utilities into a single executable. Most people will create a
link to busybox for each function they wish to use and BusyBox
will act like whatever it was invoked as!
Currently defined functions:
[, [[, addgroup, adduser, adjtimex, ar, arping, ash, awk,
basename, brctl, bunzip2, bzcat, bzip2, cal, cat, chgrp,
chmod, chown, chroot, chvt, clear, cmp, cp, cpio, crond,
crontab, cut, date, dc, dd, deallocvt, delgroup, deluser,
df, dirname, dmesg, dos2unix, dpkg, dpkg-deb, du, dumpkmap,
echo, ed, egrep, eject, env, expand, expr, false, fbset,
fdflush, fdisk, fgrep, find, fold, free, freeramdisk, fsck.minix,
ftpget, ftpput, getopt, getty, grep, gunzip, gzip, halt,
head, hexdump, hostid, hostname, httpd, hwclock, id, ifconfig,
ifdown, ifup, init, ip, ipcalc, kill, killall, klogd, last,
length, less, linuxrc, ln, loadfont, loadkmap, logger, login,
logname, logread, losetup, ls, lzmacat, makedevs, md5sum,
mdev, mesg, microcom, mkdir, mkfifo, mkfs.minix, mknod,
mkswap, mktemp, more, mount, mt, mv, nameif, nc, netstat,
nslookup, od, openvt, passwd, patch, pidof, ping, ping6,
pivot_root, poweroff, printf, ps, pwd, rdate, readlink,
realpath, reboot, renice, reset, rm, rmdir, route, rpm,
rpm2cpio, run-parts, sed, setkeycodes, sh, sha1sum, sleep,
sort, start-stop-daemon, static-sh, strings, stty, su, sulogin,
swapoff, swapon, sync, syslogd, tac, tail, tar, tee, telnet,
telnetd, test, tftp, time, top, touch, tr, traceroute, true,
tty, udhcpc, umount, uname, uncompress, unexpand, uniq,
unix2dos, unlzma, unzip, uptime, usleep, uudecode, uuencode,
vconfig, vi, vlock, watch, watchdog, wc, wget, which, who,
whoami, xargs, yes, zcat
Note: Busybox in Android will have a slightly diffrent list of functions but the version line etc is the same.
NoSudo said:
Man I am at a total loss as to what your system is doing. That just doesn't make any sense at all. Are you running the script or Copy/Pasting lines into Terminal? What Busybox are you running anyway, not the version where did you get it? It seems totally defective honestly.
The script should work fine for you at this point TBH. Heck it works for me on my Linux PC too when I change the paths, and swap out xxd for hexdump and change the pattern format.
At this point I can only conclude that either you have a bad version of Busybox or you are doing something wrong.
Click to expand...
Click to collapse
The command I'm using is
Su
Sh /mnt/sdcard/flashex2/flashex202.sh
I think it might be my version of busybox. I think its a modified version because rooting ICS on the a100 was a difficult process. It also says not to update busybox because root will be broken.
Sent from my A100 using XDA Premium HD app

Xperia on Ubuntu (Udev rules, Flashtool, ADB&Fastboot)

This is a thread written to try and get poor MilkyJoePD up and running with his Ubuntu build, but it should be of help to anyone.
First of all, what you need:
1) Any version of Ubuntu from 10.04 onwards, with superuser access. The upcoming LTS Ubuntu 12.04 will be a great idea when it comes out, as it'll be maintained for 5 years (so the instructions to install it there will be valid for all that time).
2) Your Xperia Play (or any Xperia phone actually).
3) A Micro USB cable to connect it.
4) An open mind about terminal emulators. They're useful because they allow you to do things quickly and cleanly, if you just know their syntax.
What will we be doing in this thread: we'll set up our Xperia Play so that it gets recognized properly by Ubuntu. In addition, we'll set up ADB and Flashtool, which are programs with which our Xperia Play can interact. Lastly, we'll cover how to summon the "adb" and "fastboot" commands from any point in the terminal, by adding them to the $PATH variable.
Setting up the Xperia phone: udev rules
Android devices don't need specific drivers to work in Linux: you can plug an Android phone and it will be recognised as a flash drive. However, if we want deeper levels of interaction, such as the ones which ADB, Fastboot and Flashtool provide, we have to set up udev rules. Long story short, udev rules allow us to give the proper permissions that these modes require without having to function as superuser the whole time (an undesirable state of things in Ubuntu). Much more about them can be found here for the curious minds out there.
But let's not get lost. We want to set up udev rules, so we'll do it. First of all, we need to know the following: a device connected while it functions normally is not "seen" as the same device when it's connected in the Flash or Fastboot modes. In order to identify it, we can run "lsusb" which lists all of the ports, and connected devices, in our computer.
So, let's connect a Xperia phone which is turned on. We don't have to mount the sdcard as a flash drive, just plug it in. Once you have done that, open a terminal and type
Code:
lsusb
It will list you a boatload of devices, but only one of them is relevant to you right now:
Code:
Bus 00x Device 00y: ID 0fce:aaaa Sony Ericsson blah blah
The device is identified with two alphanumeric chains. The first one is the vendor ID, and the second one is the Product ID, which are the identificators we're going to use for the udev rules later on.
Let's switch off our phone, and plug it in "Flash" mode (hold the Back button while you connect it). Run "lsusb" again in the terminal again, and you'll find:
Code:
Bus 00x Device 00y: ID 0fce:bbbb Sony Ericsson blah blah
The Vendor ID is the same (0fce) for all Sony Ericsson devices, but the Product ID is different, as you can see. This is consistent with the idea that it's identified as "another" device.
The last part would be plugging the phone in Fastboot mode, holding the Search key while we plug the phone. Typing "lsusb" in the terminal again will give us:
Code:
Bus 00x Device 00y: ID 0fce:cccc Sony Ericsson blah blah
Which is, as we know already, a different Product ID.
Now that we have the device ID needed for the udev rules, we can write them. The most expedite way is to write in that lovely terminal:
Code:
sudo gedit /etc/udev/rules.d/99-android.rules
That means, we'll use the standard text editor (gedit) to create the file 99-android.rules in the /etc/udev/rules.d folder. If we visit said folder we'll find other udev rules created already, but they're not interesting for our task. Notice that we ask for superuser permissions with "sudo" as we need them to write or modify udev rules. Once we have put our password we'll find an empty text file. And now we just copy-paste the following syntax:
Code:
SUBSYSTEMS==”usb”, ATTRS{idVendor}==”0fce″, ATTRS{idProduct}==”aaaa″, MODE=”0666″
SUBSYSTEMS==”usb”, ATTRS{idVendor}==”0fce″, ATTRS{idProduct}==”bbbb″, MODE=”0666″
SUBSYSTEMS==”usb”, ATTRS{idVendor}==”0fce″, ATTRS{idProduct}==”cccc″, MODE=”0666″
In human language, this means "Give the devices that are connected through USB and which have the mentioned ID codes the permissions 0666 (read/write access), which need root access".
Once we've filled the gaps, we just save the file. After we close it, we have to type in the terminal "sudo restart udev" and we've taken care of that part. Rebooting the computer has the same effect, but it's a bit of overkill, really.
Flashtool
With the udev rules fixed, we can go to the next step, which would be using Flashtool. It is necessary to mention that unlike the Windows version, Flashtool doesn't need any installation of any kind in Linux, you just run the program (the file called Flashtool) and you're set. You have to download the Flashtool folder, uncompress it and run the program. The folder is compressed in .7z format: Ubuntu doesn't manage 7z packages "out of the box", but that's no problem: go to your terminal, type:
Code:
sudo apt-get install p7zip-full
and that should take care of it. If you're not familiar with that command, "apt-get install" is the way to install packages from your existing repositories in Debian/Ubuntu; installing software in Ubuntu requires superuser access, as I'm sure you know. p7zip-full is a package which adds 7zip support to the archive manager of Ubuntu.
I won't cover how to use Flashtool, since I already did so in this post. While I made the tutorial for an older version of Flashtool, the base functions are exactly the same as before.
Optional: ADB and Fastboot; setting them in $PATH
OK, now we're going to the stronger stuff: if you want to do a bit more than restoring official ROMs and flashing kernels you'll do well in using the ADB and Fastboot programs. They're part of the platform tools of the Android SDK. You can download the latest Android SDK here: http://developer.android.com/sdk/index.html
Once you've downloaded and uncompressed the Linux version of the SDK, go to the "tools" folder and run the "android" file (you need to mark it as executable first, in the properties). That file is the Android SDK Manager. Once it's running, you only need to install the SDK Platform Tools package. The rest are not necessary for our purposes.
Once you install the package, you'll notice that the folder where you unpacked the SDK is bigger. You'll find there the "platform-tools" folder, which contains adb and fastboot. You can run them from a terminal, but that requires you to have your terminal running in the exact folder where your /<Path/to/SDK> directory lies. This can get old really quickly if you use ADB and/or Fastboot frequently, so we'll do a trick that will allow us to summon them from any folder: we'll add them to our PATH variable.
In order to do this, we need to open a new terminal. It will start in our home directory. There is a file called .bashrc in our home folder that we need to tweak, so let's go to it. You don't see it normally, as it's hidden. All files which begin with a . in Linux will be hidden by default. You can see them in Nautilus by pressing Ctrl+H, and in a terminal by typing "ls -a". At any rate, this file is hidden because you usually don't need to touch it, but we'll do it here.
In our terminal, we write
Code:
gedit .bashrc
Again, gedit is the standard text editor in Ubuntu.
We see a lot of stuff we don't need to touch. We just need to go to the final line, after the word "fi" and write below:
Code:
# ADB and Fastboot direct link (this is a comment, so we remember what we did)
PATH=$PATH:/home/Path/to/SDK/platform-tools/
export PATH
We save the modified file, close any terminal we had left open, and now we can use adb and fastboot directly from any folder. Just connect your device with debug mode on for example, and type "adb devices": you should see the ADB identificator of your device.
And with that, I cover the installation guide of Xperia phones in the Ubuntu environment. I hope it's useful to everyone, particularly to MilkyJoePD who has inspired me to write it. If I've missed something I should have mentioned, by all means say it.
Haven't used Ubuntu for a while but I'm taking note of this for later. Thank you for the info.
Sent from a Galaxy far, far away
don't forget to install de dependencies:
Code:
sudo apt-get install libusb-1.0
on 64 systems, you need 32bits libraries, so run:
Code:
sudo apt-get install ia32-libs
With the news of Sony not releasing ICS, I decided to try again to get fastboot working.
While installing the dependencies, I get this:
W: Duplicate sources.list entry cdrom://Ubuntu 11.10 _Oneiric Ocelot_ - Release i386 (20111012)/ oneiric/main i386 Packages (/var/lib/apt/lists/Ubuntu%2011.10%20%5fOneiric%20Ocelot%5f%20-%20Release%20i386%20(20111012)_dists_oneiric_main_binary-i386_Packages)
W: Duplicate sources.list entry cdrom://Ubuntu 11.10 _Oneiric Ocelot_ - Release i386 (20111012)/ oneiric/restricted i386 Packages (/var/lib/apt/lists/Ubuntu%2011.10%20%5fOneiric%20Ocelot%5f%20-%20Release%20i386%20(20111012)_dists_oneiric_restricted_binary-i386_Packages)
W: You may want to run apt-get update to correct these problems
Where do I go from here?
Remove CD-ROM reference from sources
Edit your sources and comment-out / turn off the references for the installation disk (CDROM/DVD). It should be the first thing you turn of after any install anyway. In my humble opinion.
Then run
sudo apt-get update
sudo apt-get -f install
this should resolve any pending issues and get you running.
skeltonh said:
Edit your sources and comment-out / turn off the references for the installation disk (CDROM/DVD).
Click to expand...
Click to collapse
How do I do that?
Sent from my R800i using XDA
Or can somebody can tell me what it means so I can Google it?
Sent from my R800i using XDA
I have a problem, when I try to use fastboot even in the platform-tools folder it says:
fastboot: command not found
On what OS? If it's Linux, you have to add a Dotslash to execute the file.
Swypesation
I have created udev rules as said above, but flashtool still says 'Add udev rules'.
What I am missing here. I'm using Ubuntu 12.04.
Any help is appreciated.
You must start flashtool with root acces
is rooting ur play a wise decission?
wat is better 4 my play, ics or gingerbreadman?
where/what is the search key on a mini pro?
Thanks
Big Thanks for this Tutorial Logesman. :good: Just wanted to add that I think...anyone having trouble installing SDK + Manager has to install Java JDK first. Yes, I got stuck at installing SDK.:silly: I tried to run android file in tools folder (as executable) which opens manager.
From Terminal:
sudo apt-get install openjdk-7-jdk openjdk-7-jre
i am unable to run "adb devices" command in ubuntu 12.04.. please help :crying:
roopz said:
i am unable to run "adb devices" command in ubuntu 12.04.. please help :crying:
Click to expand...
Click to collapse
I am having same problem on 12.04! I did everything in this thread afaik, and the ubuntu forums. I could really use some help , because I also have problems with adb.
Sent from my R800i using xda premium
install windows might be easier.
Sent from my Xperia Play using Tapatalk 2
roopz said:
i am unable to run "adb devices" command in ubuntu 12.04.. please help :crying:
Click to expand...
Click to collapse
cyrusalmighty said:
I am having same problem on 12.04! I did everything in this thread afaik, and the ubuntu forums. I could really use some help , because I also have problems with adb.
Sent from my R800i using xda premium
Click to expand...
Click to collapse
Have you tried running adb as root? (After a week of testing 12.04, I left to go back to 10.04, a much better release, imo)
Pax
Sent from my R800x using Tapatalk 2
IE-coRe said:
I have a problem, when I try to use fastboot even in the platform-tools folder it says:
fastboot: command not found
Click to expand...
Click to collapse
seems like you didn't path the fastboot command correctly, try check back again at your .bashrc
roopz said:
i am unable to run "adb devices" command in ubuntu 12.04.. please help :crying:
Click to expand...
Click to collapse
same case as the above
cyrusalmighty said:
I am having same problem on 12.04! I did everything in this thread afaik, and the ubuntu forums. I could really use some help , because I also have problems with adb.
Sent from my R800i using xda premium
Click to expand...
Click to collapse
would you mind telling what does the error says?

[TOOLS] [LINUX, MAC, WINDOWS] Knives & Forks

Hello guys and girls. I'm gonna describe a little tool called Knives & forks and why it's so awesome. It's made by a user called DieHappy, so all credit to him! Source post: http://forums.acsyndicate.net/showthread.php?5008
Need I say once more that this isn't my work?
Before we start, I'd like to say I take no responsibility if something bad happens!
What is this, you say?
It is a set of tools for everyone, all operating systems and devices. It is a toolkit written in Python to work for Linux, Mac OS X and Windows.
Well, what does it actually do?!
Easy there. DieHappy started working on this not so long ago, so the features are limited. Right now, he focuses on making sure this program offers a stable base for all known android devices. It sets up correct ADB and Fastboot drivers and also makes the need of an android sdk useless if you only use the drivers. No need to set up an environmental path to the sdk or to navigate to a folder to use ADB, you can use ADB from ANYWHERE! Just open up cmd/a terminal and type adb and bam, it works.
How to support this project?
I don't really offer assistance to this as my knowledge is limited, but I can probably give you answers to most questions. Check out the original thread here for more help.
How to reply to this thread?
Ask anything, or write anything about this program here. Do not clutter the original thread over at ascyndicate forums.
Ok, how do I go about installing this?
First off, make sure you know how to decompress archives (namely zip or rar archives). Try 7-zip. Also, make sure you know the process of creating and renaming folders.
Download current version: 12.02.04
Mac OS X
This was tested on Mac OS X 10.7.2. Please report your success or any errors you have running this on other versions, but report them on the source thread, no use in reporting this here.
Unzip to "/Users/INSERT-YOUR-USERNAME-HERE/knives-and-forks/"
NOTE: REPLACE "INSERT-YOUR-USERNAME-HERE" WITH YOUR COMPUTER USERNAME.
FOR EXAMPLE, I WOULD UNZIP THE FILE TO: "/Users/DieHappy/knives-and-forks/"
NOTE: MAKE SURE THE DIRECTORY NAME IS SIMPLY "knives-and-forks".
DO NOT INCLUDE THE VERSION NUMBER IN THE FILE NAME FOR THE .ZIP FILE YOU DOWNLOADED.
Open Finder to "/Users/INSERT-YOUR-USERNAME-HERE/knives-and-forks/"
Double-Click "/Users/INSERT-YOUR-USERNAME-HERE/knives-and-forks/Knives-and-Forks-Mac.app"
You should see the Knives and Forks Main Menu in the Terminal window.
Linux
This was tested on Ubuntu 11.10 and Xubuntu 11.10. Please report your success or any errors you have running this on other versions or Linux distros.
Unzip to "/home/INSERT-YOUR-USERNAME-HERE/knives-and-forks/"
NOTE: REPLACE "INSERT-YOUR-USERNAME-HERE" WITH YOUR COMPUTER USERNAME.
FOR EXAMPLE, I WOULD UNZIP THE FILE TO: "/home/DieHappy/knives-and-forks/"
NOTE: MAKE SURE THE DIRECTORY NAME IS SIMPLY "knives-and-forks".
DO NOT INCLUDE THE VERSION NUMBER IN THE FILE NAME FOR THE .ZIP FILE YOU DOWNLOADED.
Open Terminal
Change the permissions to executable for "Knives-and-Forks-Linux.sh" by typing this into the Terminal window, then pressing [ENTER]:
Code:
chmod +x ~/knives-and-forks/Knives-and-Forks-Linux.sh
NOTE: "~" is a shortcut so you don't have to type "/home/INSERT-YOUR-USERNAME-HERE/"
Change to the "knives-and-forks" dir by typing the following in the Terminal window, then pressing [ENTER]:
Code:
cd ~/knives-and-forks
Run "Knives-and-Forks.sh" by typing the following in the Terminal window, then pressing [ENTER]:
Code:
[B]./[/B]Knives-and-Forks-Linux.sh
NOTE: DON'T FORGET TO TYPE "./" BEFORE THE FILE NAME.
THIS TELLS LINUX TO RUN THE SCRIPT IN THE CURRENT DIRECTORY.
TYPING JUST THE FOLLOWING WOULD RESULT IN AN ERROR:
Code:
Knives-and-Forks-Linux.sh
You should see the Knives and Forks Main Menu in a new Terminal window.
Windows
This was tested on Winows 7 Pro x64. Please report your success or any errors you have running this on other versions.
Unzip to your user profile directory
-- Vista, 7, Server 2008, Server 2008 R2: "c:\Users\INSERT-YOUR-USERNAME-HERE\knives-and-forks\"
-- 2000, XP, Server 2003: "c:\Documents & Settings\INSERT-YOUR-USERNAME-HERE\knives-and-forks\"
NOTE: REPLACE "INSERT-YOUR-USERNAME-HERE" WITH YOUR COMPUTER USERNAME.
FOR EXAMPLE, IN WINDOWS 7 I WOULD UNZIP THE FILE TO: "c:\Users\DieHappy\knives-and-forks\"
NOTE: MAKE SURE THE DIRECTORY NAME IS SIMPLY "knives-and-forks".
DO NOT INCLUDE THE VERSION NUMBER IN THE FILE NAME FOR THE .ZIP FILE YOU DOWNLOADED.
Run "c:\Users\INSERT-YOUR-USERNAME-HERE\knives-and-forks\Knives-and-Forks-Windows.cmd"
Python will automatically be downloaded and installed for you.
Once python is installed, you should see the Knives and Forks Main Menu in the command prompt window.
Ok, installed it, now what?
You should be able to open up your terminal application (or command prompt) and run some adb commands. In the future we will be automating adb commands for you, but for now you can try rebooting your device via adb by opening up a terminal (or command prompt) window, then typing the following, then pressing [ENTER]:
Code:
adb reboot
NOTE: AT THIS STAGE, YOU SHOULD ONLY NEED TO RUN THE KNIVES & FORKS SCRIPT ONCE TO INSTALL DRIVERS AND GET ADB WORKING. ONCE SETUP IS COMPLETE, YOU CAN RUN ADB COMMANDS AS SOON AS YOU OPEN UP YOUR TERMINAL/COMMAND PROMPT WINDOW.
If everything worked, your Android device should reboot. For further reading on what you can do with adb you can read THIS PAGE.
Code:
[B]**** 12.02.04 ****[/B]
- LINUX CHANGES:
-- "python2" is now called by "Knives-and-Forks-Linux.sh" instead of "python" on Arch.
- This prevents starting the script with Python 3, which results in errors.
-- Changes to "scripts/linux/install-adb-linux.sh":
- "su" will be used if "sudo" is not installed, or user doesn't have permissions to use it.
- Added 32-bit libs for more 64-bit distros:
- Arch (new in this release)
- CentOS (new in this release)
- Debian
- Fedora (new in this release)
- Ubuntu, Kubuntu, Xubuntu
- Added Debian version of '/etc/udev/rules.d/99-android.rules'
- Added '/lib/udev/rules.d/92-permissions.rules' for Debian.
This should fix permissions, allowing adb to run without sudo or su.
- WINDOWS CHANGES:
-- Fixed a couple of missing quotes which were breaking things under Windows XP
- "%userprofile%" was coming back as "c:\documents" instead of
"c:\documents and settings\username" in a couple of places
-- "c:\python27" is now the only directory where we look for python.exe
- It is faster to download and install Python to "c:\Python27" than it is to search for it
elsewhere.
- This will also prevent issues where Python 3 was installed instead of Python 2, since the
script currently gives errors under Python 3.
-- Updated amd64 and x86 versions of setx.exe for updating system PATH on XP/VISTA/7
-- PATH is updated with adb.exe location after Python is installed.
-- The computer will now reboot after updating the PATH, to make sure it will be updated before
running the main program.
[B]
**** 12.01.27 ****[/B]
- GENERAL CHANGES:
-- After adb is installed, adb will reset the android device by running "adb reboot" instead of
displaying a list of attached devices with "adb devices".
adb was occasionally reporting no devices were attached, when they infact were. When this happened
"adb reboot" still worked, so it is a better test to see if adb is setup properly.
-- Friendlier messages during adb install and testing
-- Added a startup check to make sure the script is running from the correct directory
-- Removed empty Project directory, as it is not being used yet.
- LINUX CHANGES:
-- Added support for "lxterminal" and "urxvt" in "Knifes-and-Forks-Linux.sh"
-- Changed idVendors for Linux udev rules to lowercase instead of uppercase.
- WINDOWS CHANGES:
-- Startup script searches for python in "C:\Program Files (x86)" then "C:\Program Files" and
"c:\" last.
-- Drivers should now install even if the language is not English
-- Added drivers for Casio C771 G'zOne Commando
-- Added LG drivers
-- Replaced setx.exe
[B]**** 12.01.25 ****[/B]
- Replaced "Knives-and-Forks-Mac.sh" with "Knives-and-Forks-Mac.app".
Starting the script on a Mac should now be as simple as double-clicking the new .app file.
[B]**** 12.01.24 ****[/B]
- Fixed a typo which caused the script to crash when viewing the credits screen.
- Smarter python fix for Windows users.
-- "C:\" and all sub-directories are searched for python.exe.
-- If python is not not found, it will be downloaded from python.org and installed to c:\python27.
-- If python is found (in "C:\python27", "c:\python", "c:\xyz123", "c:\program files\python27" or
in any directory with any name anywhere on drive c:) the main menu script will launch.
- Added changelog.txt to the release .zip file.
[B]
**** 12.01.23 ****[/B]
- Minor update to fix Python installation for Windows users, which was causing the script not to launch.
[B]
**** 12.01.22 ****[/B]
(FIRST PUBLIC RELEASE)
- Added option to install adb & fastboot for Linux, Windows, Mac
- Added Linux drivers for:
-- ACER
-- ASUS
-- DELL
-- FOXCONN
-- GARMIN-ASUS
-- Google
-- Hisense
-- HTC
-- HUAWEI
-- K-TOUCH
-- KT Tech
-- KYOCERA
-- LENEVO
-- LG
-- MOTOROLA
-- NEC
-- NOOK
-- NVIDIA
-- OTGV
-- PANTECH
-- PEGATRON
-- PHILIPS
-- PMC-SIERRA
-- QUALCOMM
-- SK TELESYS
-- SAMSUNG
-- SHARP
-- SONY ERICSSON
-- TOSHIBA
-- ZTE
- Added Mac drivers for:
-- Nothing. According to Google, "It just works." Let me know if they are right.
- Added a custom Windows installer with drivers for:
-- GOOGLE
-- HTC
-- HUAWEI
-- SAMSUNG
is it useful to you guys? I mean, you don't ever have to hassle with having bad drivers as these always work. And you never need to hassle with ADB and/or fastboot commands as this sets up environmental values and other stuff so you can access the adb and fastboot commands from wherever you are, i.e. no need to navigate to a certain folder.
*bump*
Thanks man. Did some googling just now and found tools for my linux mint debian edition. Any new on this tools mate?Perhaps new features for next release.
Mac OSX 10.6.8, nothing happens on double click on .app file
Can You Mirror?
Theshawty said:
*bump*
Click to expand...
Click to collapse
I have tried 4 a wk. It seems the site is down. Could you please attach the latest version here or mirror it mega? I would greatly appreciate it. I just wanted to try this out and "round out" my toolkits. Thank you for your time and help.

[GUIDE][17 JAN]Debian shell, LXDE, and more, all on /data partition

Please rate this thread whether good or bad, I like feedback as this is my first in depth guide I have written. Thanks!
I know there are apps that make it as easy as a download and a button press to install linux on an Android phone, but I had hardly any room on my 8GB SD card, and I wanted to have a safe, reliable, and fast installation (my cards class 4). Also, this creates a lightweight and customisable installation, as all you start off with is the Debian shell, which is a 50MB download.
This guide will take you through downloading the app, to installing Debian in the loop file on your phone, to installing a VNC server and getting a GUI (in this case LXDE) up and running. So, without further ado....
PREREQUISITES
Your phone
Free space on /data/ , I would recommend at least 768MB for this. Unfortunately....
No apps to sd script... I'm not sure on this, prior to setting this up, I installed an a2sd script and my Debian shell would not work. Coincidence? You try it. I don't know.
I would have thought a lightweight ROM would help. This works fine for me, and I'm running Andromadus CM10.1 build 10. I don't know how Sense (which imo is pretty heavy) compares to Android 4.2.1, but I reckon AOSP is a good bet for any version of Android.
Terminal Emulator
Your brain. Of course, don't be afraid to ask questions, I'm sure I'll miss something
The recognition that I take NO RESPONSIBILITY AT ALL for cracked screens, disappearing keyboards, or gravitational collapses of the Vision's awesomeness creating a black hole and / or supernova which obliterates Earth and the Milky Way, although would look spectacular. Please bear in mind that this could genuinely mess up your device pretty bad, although only really badly if you try... yes, you can brick your phone or wipe EVERYTHING. So make a Nandroid. But once again, I'm the one that's laughing.
Click to expand...
Click to collapse
INSTALLING AND SETTING UP THE APP
Download Linux Installer STANDARD from the Play Store, or the ADVANCED version if you wish to contribute to the devs/ although you only need the STANDARD version for this.
I would suggest reading through their own guide first, although be aware this only covers getting a Debian shell up and running. Especially the bit towards the end which tells you how to muck up your device.
Anyway, the bit where you install the shell is here. I'll take you through what I suggest now, though.
Open the app
Menu > Setup
Install in a block device = [TICK]
Use loop file = [TICK]
Preferred distribution = Debian (Ubuntu doesn't work, according to the devs.)
Distribution version = I use Stable, I would've thought any Squeeze variant will do.
CPU architecture = armel by default, Don't change this.
Hostname = This is used for VNC. Default is fine.
Domain name = This is used for VNC. Default is fine.
Chroot point = /data/local/mnt/Linux . DO NOT USE /data/data/ EVER.
Name of chroot launcher script = linuxchroot . This is the command used to start the Debian shell
Server = blank by default. Don't know what this is used for, but is not important to us.
IP Version = IPv4 by default. I don't see any need to change this.
Loop file = /data/local/tmp/Linux.loop . DO NOT USE /data/data/ EVER.
File Size = 768MB . This is what I use, it's enough for VNC server, LXDE, C++ compiler, but not much else. I would not recommend any less.
Maximum loop dev = errrm. I don't know what this does. I've seen people use 32. Default is 8. I've tried both, and can't tell the difference. Stick to 8 to be safe.
Ext version = Default. This is checked automagically
Console refresh latency = Default (10). I don't know what this does.
Choose start panel = Default (Installer). This is just the screen the app starts on. Installer is easier.
Bind Android = [TICK] if needed, [BLANK] for safety. This means you can access your whole phone, that is, all the directories, root, sd card, of your phone, from your Linux installation. Could be useful, but probablyt not worth risking if you won't use it.
Send debug logs = [TICK] Default
Screen always on = [TICK] Default
Use embedded Busybox = [TICK] Default
Allow write to /system = [TICK] I suggest using this, I got problems with this disabled
Allow remount with dev/exec = [TICK] Once again, I'm not sure, I've seen people use it, but it's not essential
Click to expand...
Click to collapse
CREATING AND MOUNTING YOUR LINUX.LOOP, AND INSTALLING DEBIAN INTO IT
I think the original instructions are fine for this. I'll quote them here just in case you can't find them (red text is my input)
click create target loop (takes 2mn to write 500M on class 4 card)
click format target loop (50s)
click mount loop
click install distribution in loop. Installation should take between 15 and 50 mn depending on your Internet connection speed, and phone specifications (Flash and CPU speed). Installation process will temporally disable screen saver so that the phone will stay awake, and Internet connection will not be automatically disabled or put in sleep mode.
click Update launcher script.
You can now connect to your phone using any local console, via ConnectBot or adb shell You won't do this, instead open up Terminal emulator.
type su into the console
type linuxchroot in this console
you are now in a standard GNU/Debian environment, created via debootstrap. Network is already configured; you shall type aptitude update, then you can install any package you want.
Read messages carefully, and read the full tutorial on our website. URL is given in the About pop-up
Well done, you're running Debian shell on your Vision yay!
Click to expand...
Click to collapse
INSTALLING A VNC SERVER, X.ORG AND LXDE
This is the fun bit. We can now get LXDE up and running and access it via VNC (Don't worry, still on the phone... you'll see )
First, install android-vnc-viewer
Open up terminal emulator
Type su to be superuser
Type linuxchroot
This is what got me confused. I couldn't use apt-get, I got all sorts of errors. In order to fix these, WHENEVER YOU WANT TO INSTALL ANYTHING, type the following:
Code:
export PATH=$PATH:/usr/local/sbin:/usr/sbin:/sbin
Now you can install your vnc server:
Code:
apt-get install tightvncserver
and now the X Windows System (this is needed for the GUI)
Code:
apt-get install xorg
and now LXDE.
The minimum set of elements, without recommended apps like file manager (this is lightest, but not particularly useful:
Code:
aptitude install --without-recommends lxde-core
The minimum set of elements (I suggest using this):
Code:
apt-get install lxde-core
A complete set of elements:
Code:
apt-get install lxde
A complete Debian LXDE desktop environment (Don't use this, it'll be heavy and you'll use up all your space (unless you had much more than 768MB))
Code:
apt-get install task-lxde-desktop
Unfortunately, you cannot use the LXDE desktop just yet. We need to set up the VNC server.
Code:
vncserver
This will start up an X-Windows session and create a vnc startup file. Type in your password (if you're a n00b, be aware that you won't be able to see stars or anything). You don't need the second password it asks for.
Now kill the VNC session:
Code:
vncserver -kill :1
Now we need to set up the VNC startup file:
Code:
cd /root/.vnc/
nano xstartup
Use the trackpad to navigate, type as normal.
Comment out etc/X11/xsession :
Code:
#etc/X11/xsession
At the bottom, add the lines to start up LXDE:
Code:
startlxde &
lxsession
Now save the file: Hold down vol-down, then y, then o .
Exit nano: Hold down vol-down, then y, then x .
Now we need to edit the .bashrc file:
Code:
cd /root
nano .bashrc
After all the comments, add the following lines:
Code:
export USER=root
cd /
rm -r -f tmp
mkdir tmp
cd /
vncserver -geometry 800x480
If you know how to use VNC on a tablet, just change vncserver -geometry to that resolution:
Code:
vncserver -geometry heightxwidth
Now save the file: Hold down vol-down, then y, then o .
Exit nano: Hold down vol-down, then y, then x .
Type exit to exit the Debian Shell. Close terminal emulator, and reboot.
Click to expand...
Click to collapse
RUNNING OUR NEWLY INSTALLED LXDE GUI
Now we've rebooted, open terminal emulator and run the Debian shell as normal (linuxchroot).
This time, you'll see some text about the X server running. If not, something's gone wrong.
Leave terminal emulator running, and go and open android-vnc-server from your app drawer.
Set up the app as follows:
Nickname = whateveryouwant
Remeber the password you entered before, when we were running the shell? No? D'oh!
Address = localhost
Port = 5901
Click connect... yay ! You should have LXDE up and running, if not, go over this guide, and if you think you've done everything, either hate on me or send me a useful PM outlining your problem.
Click to expand...
Click to collapse
SETTING UP TERMINAL EMULATOR
I've written a really quick script which asks you whether yo want to start linuxchroot upon opening Terminal Emulator. It's really small and quick, I've attached the actual script, here's how you set it up:
Download the attached "startup.txt" script, and put it on the root of your SD card ( /sdcard/startup )
Rename it to "startup" (without the quotes, and no extension, basically just get rid of the ".txt" bit on the end)
Open Terminal Emulator, and type the following:
Code:
su
mount -o rw,remount /system
cp /sdcard/startup /system/xbin/
chmod 700 /system/xbin/startup
chown root.root /system/xbin/startup
Now open Terminal Emulator preferences, scroll down to "Initial command" and set it as follows:
Code:
su
startup
Restart Terminal Emulator
You should be greeted with "Start linuxchroot?" and some options, Yes or No
Type 1 to say yes, this executes linuxchroot, starting the Debian shell
Type 2 to say no, this exits the script and does not mount Debian, allowing you to use Terminal Emulator as normal
I like this arrangement, as it means I don't have to type "linuxchroot" to start it every time or to auto start it and have to exit when I don't want to use it. It's especially quick if you use SuperSU, I find this generally faster than ChainsDD's "normal" Superuser, so su is executed instantly and you can quickly type "1" or "2" and you're off!
Click to expand...
Click to collapse
OTHER IDEAS
compile C++ programs:
Code:
export PATH=$PATH:/usr/local/sbin:/usr/sbin:/sbin
apt-get install g++
Write your program, save as program.cc
Code:
g++ -o program program.cc
./program
Click to expand...
Click to collapse
Thanks for reading, I hope this helped !
Very nice. I will be trying this later.
About how much memory is being used (with and without LXDE session started)?
Thanks for your efforts.
pepar0 said:
Very nice. I will be trying this later.
About how much memory is being used (with and without LXDE session started)?
Thanks for your efforts.
Click to expand...
Click to collapse
Hi, sorry for the late reply.
TBH I don't think much memory is used at all really, to put it into perspective I've still got 140MB of RAM free whilst running this.
I haven't actually tested memory usage, but I expect you'd need over 100MB free RAM if you're planning on running LXDE. I have tried this in various situations however, and I would not recommend running zeppelinrox's V6 SUpercharger, or any other memory management script. This is because they meddle with VM heap sizes and minfrees and other RAM stuff, and ideally you should use the default 128MMB VM Heap size. This means you can use up a whole 128MB of RAM just for Linux (I don't know how processes are spread though, so you may be using more).
If you're running Sense, I'd be interested to know which version and how well this runs. If your using AOSP (CyanogenMod, AOKP, anything like that) you should be fine, as this works perfectly on Andromadus CM10.1 build 11, which is JB4.2, and presumably the heaviest version of Android.
Hope this helps, and I'd encourage you to try this, it's really cool once it's set up, even if it's not particularly useful to you
It's stuck for me right after I create the loop file. It asks me to tap the "format loop target" button but it's nowhere to be found. I'm only presented with the create target loop one.
crestofawave said:
It's stuck for me right after I create the loop file. It asks me to tap the "format loop target" button but it's nowhere to be found. I'm only presented with the create target loop one.
Click to expand...
Click to collapse
That sounds odd. Not to sound patronising, but this is all I can think of:
Have you got enough space on /data ?
Did you enable write to /system ?
Perhaps there was a Superuser error?
Have you left it long enough to finish? If it says "please wait" at the top, it's still doing it's thing. I expect this is the most likely cause, as the app doesn't make it very clear when it's finished an operation.
D'you mind sending a screenshot before and after creating the loop file, if the problem persists? Thanks, hope you sort it out
Maybe we should use Lubuntu? It takes 100-120mb at startup and it have pretty good configured LXDE and other *candy's* for touch installable.
And how about E17? it's more lightweight than LXDE. Look to Bodhi Linux *maybe we should use ARM vertion?*. It based on ububntu and It have a touch vertion too.
sergeikaspd said:
Maybe we should use Lubuntu? It takes 100-120mb at startup and it have pretty good configured LXDE and other *candy's* for touch installable.
And how about E17? it's more lightweight than LXDE. Look to Bodhi Linux *maybe we should use ARM vertion?*. It based on ububntu and It have a touch vertion too.
Click to expand...
Click to collapse
I do not know of any apps that allow you to install Lubuntu, although if you knew how you could get the IMG and do it yourself. I wrote this guide because it allows you to start from the ground up, with a simple Debian shell to installing whatever GUI and apps you want, or no GUI at all and just some terminal apps (if you can call them that).
Tat means you could install Gnome if you were so inclined, or any other window manager, desktop suite or anything, really. If you had room you could get the Android SDK. Just cause I used LXDE in my example doesn't mean you have to. Just install E17 or whatever you want and in the vnc startup file just tell it to run that instead of LXDE.
Hi!
I'm trying to install Debian Squeeze using your guide but with "linux.loop" file being on the SD-Card (I have like 100 MB free space on /data). When I clicked "Mount loop", Linux Installer after a few seconds just crashed. Then I turned it on again - I was able to start the installation anyway and now I'm installing it.
Was that crash something that could make Debian not working?

Use your Samsung Captivate Glide as a Debian "Chatter" Phone.

Debian “Chatter” Phone
Screenshot: http://www.mediafire.com/view/ljgv724r57tnx5y/2015-11-03-104935_480x800_scrot.png
Debian. Not run as a tack on, not emulated, not on top of Android, but standalone. That's my goal. That's what I've been working on. Turning an old Glide into a computer. After some careful thought, I figured some other people might be interested in that too, so I thought I'd post it here. Perhaps we can even work together to get it finished.
Why Debian “Chatter”? Well, all Debian versions are given a name from a toy in the Pixar film Toy Story. Chatter happens to be the toy telephone in Toy Story 3. I put Chatter in quotes because it actually is not an official release. Technically, at least at the moment, I am using Debian Jessie. Since becoming a release of Debian would be nearly impossible to spearhead from the ground level, it would most likely become an offshoot of Debian.
What I have done so far is utilize the internal “sdcard” partition as the root file system for Debian Jessie.
What's working:
- Standard Linux functions (mostly)
- Boot up to the X server (XFCE window manager currently)
- Screen, orientation and display
- Physical keyboard (Only the qwerty part)
- Touch-screen as a touch pad to move the mouse pointer
- Battery indication including if it is charging or not
- Audio with ALSA.
- Volume buttons
- Front soft keys
Flashing instructions if your Captivate Glide already has TWRP.
http://www.mediafire.com/download/z9fzrw68rio8sq9/recoveryTWRP.img
1. Download my TWRP backup, and put under the /TWRP/BACKUPS/<SERIALNUMBER>/ folder.
https://www.mediafire.com/folder/9vifxpouh9voc/2015-10-20
2. Restore the image through the Restore function in TWRP.
3. Download my tar.gz file to your computer and extract it.
http://www.mediafire.com/download/716x1oxcglythhk/20151102.tar.gz
Or,
http://www.mediafire.com/download/88r6sr3u33bs532/20151106.tar.gz
4. Put your phone into the TWRP recovery, and choose the Mount option and select “sdcard”
5. Place the extracted contents of the dated folder onto the sdcard partition, but not the dated folder itself, just what is in it.
6. Reboot your phone into the ODIN download mode.
7. Download my 2ndboot.img file and i927.pit file.
http://www.mediafire.com/download/mudjm3j3304vt77/2nboot.img
http://www.mediafire.com/download/793j89i277rggpa/i927.pit
8. Using Heimdall-frontend, select the pit file, and flash the LNX partition with the 2ndboot.img file.
9. Reboot and Linux on!
Flashing instructions if your Captivate Glide already has Clockworkmod.
http://www.mediafire.com/download/f64i073d65e0ug1/recoverycwm.img
1. Download my copy of Bio360Rom.zip and move it to your phones sdcard.
http://www.mediafire.com/download/1u2v6aac19fzh97/Bio360ROM.zip
2. Reboot into recovery mode (Clockworkmod) and install the Bio360Rom.zip
3. Reboot your phone into the ODIN download mode.
4. Download my 2ndboot.img file, my recovery.img file, and i927.pit file.
http://www.mediafire.com/download/mudjm3j3304vt77/2nboot.img
http://www.mediafire.com/download/z9fzrw68rio8sq9/recoveryTWRP.img
http://www.mediafire.com/download/793j89i277rggpa/i927.pit
5. Using Heimdall-frontend, select the pit file, and flash the LNX partition with the 2ndboot.img file.
6. Again using Heimdall-frontend, select the pit file, and flash the SOS partition with the recovery.img file.
7. Put your phone into the TWRP recovery, and choose the Mount option and select “sdcard”
8. Download my tar.gz file to your computer and extract it. Place the extracted contents of the dated folder onto the sdcard partition, but not the dated folder itself, just what is in it.
http://www.mediafire.com/download/716x1oxcglythhk/20151102.tar.gz
Or,
http://www.mediafire.com/download/88r6sr3u33bs532/20151106.tar.gz
9. Reboot and Linux on!
Optional instructions:
If you want to, head over to the Debian Jessie download page and download the arm version of the DVD's 1 and/or 2. In the following posts I describe how you can rip these cd's to set up a personal repository, one that you can strictly control all of the packages, which may be useful at this time.
Changelog:
Code:
Changelog - Debian "Chatter" using Canium Kernel
20151106
- Added shutdown.sh and reboot.sh to launcher for *better* handling of shutdown.
20151102
- Mapped soft keys: search - xfce-appfinder
- Mapped soft keys: back - xfce-next workspace
- Mapped soft keys: home - xfce showdesktop
- Mapped soft keys: menu - xfce-showmenu
- Mapped volume up/down to amixer Master +/- 5db.
- Added "event2" to xorg.conf. Volume buttons and power button are recognized and can now be mapped to an action.
- Added "event7" to xorg.conf. front soft keys are recognized and can now be mapped to an action.
- Enabled xfce splash screen (like a boot animation.) Also enabled text update of status during start of xfce.
20151101
- Edited xfce panel and options for display of information.
20151020-2
- Moved entire system off of sdcard and onto mmcblk0p4, the "internal sdcard" of the phone.
20151020
- Due to errors with Pulseaudio, removed pavucontrol/pulseaudio. Installed all Alsa controls.
- Installed LXMusic/xmms2 for mp3 player.
- Mixer and alsa mixer can properly set volume to path SPK_HP (the speaker or headphone) and adjust the volume. However, it will mute after a few moments of inactivity. A work in progress.
20151019 Continuing the current fork of Cranium Kernel.
- Udevd is not working due to lack of devtmpfs support in kernel. Added mdev support for hotplug items by editing init.stage2 with:
/sbin/busybox echo /sbin/busybox mdev > /proc/sys/kernel/hotplug
20151018
- Backed up entire system, forking to other kernels. This backup will remain with all that is done so far. The fork has a seperate changelog.
20151016
- Enabled usb0 as a network interface in /etc/network/interfaces, can start with ~# ifup usb0.
-On receiving computer, ensure that you insmod "mii.ko" and "usbnet.ko" if not already built into your kernel. -cannot figure out how to attach to it!
^-- I now realize that I would need to recompile my desktop computer kernel to support this endevour. This would distract from the process at hand. Scrapped.
- Added second armhf dvd from Debian Jessie to my local repository, and edited /etc/apt/sources to match.
20151015
- Edited xbattbar.sh script to accurately reflect if the phone is plugged in or not. - Put into 20151014 folder.
20151014
- Needed battery indicator. Added xbattbar as it is the only battery indicator with user scriptable inputs.
- Wrote script for xbattbar to work, now accurately reflects battery capacity.
- Put xbattbar in .xsession and removed xclock from .xsession
20151013
- Added XFCE4 and set as default for root in /root/.xsession file with xclock on startup for fun.
20151010
- Added local repository under folder /repo/all
- Used dpkg-scan to create Packages.gz
- Added local repository to /etc/apt/sources.list
20151008
- Added Keyboard to xorg.conf, some keys work, some do not.
20151005
- Added touchscreen to xorg.conf as "corepointer", works to move mouse.
20150924
- Created new initramfs.cpio.gz
- Created new_boot.img
- Copied another init script and init.stage2 script onto sdcard and edited for my purposes.
- Originally booted to Linux, then started Android, and Android was what you saw.
- Edited init and init.stage2 script so that it now boots Linux, and you see Linux. Android is running in chroot env. but cannot start fully due to /dev/graphics/fb0 is in use.
20150921
- Started with debootstrap base image of Debian Jessie
- Added openssh, vnc, lxde, jwm, and some other programs through emulator.
- Broke down Biorom kernel and initramfs. Using Cranium Kernel.
As for me, I plan to keep working on this project, if you are interested in working on this project as well, please feel free to work on it! You can work independently or with me on this if you would like. You are welcome to post here, or to contact me through XDA's message service. Please see the next posts on what still needs to be done (which is a lot).
The current passwords are:
root = root
trondroid = trondroid
me = me
Enjoy!
Thanks to these people for their time and knowledge!
As with any project, it starts somewhere, and I want to thank the following individuals for their prior work that I used as the basis of this project. These individuals may not know that their tools were used here, but I would like to thank them for posting their knowledge and or files or programs for people like me to be able to read and use:
XDA developer bubor – Seriously, this person has a lot of great material on this site. I borrowed their TWRP recovery.img.
XDA developer mdubb2341 - I used this person's Bio360Rom as the chrooted Android environment, due to it's small size and resource requirements (e.g. no zRam).
Mikael Q Kuisma - http://whiteboard.ping.se/Android/Debian – This guy helped tremendously with the breakdown of the boot.img and hijacking init to do what I want instead. He explains how to start Linux then Android, and use your Android phone with Linux underneath.
Eryk Wdowiak - http://www.wdowiak.me/anX11phone/ - This gentleman had some great material on starting Linux after starting Android and running Linux on top of Android.
Ivan Davidov - http://minimal.linux-bg.org/ - The tutorials on setting up minimalistic Linux environments and boot script examples were priceless.
To do list
Phone specific things to do: (Wow this is a big list!)
GPS – I have put FoxtrotGPS and gpsd in the image. I know that /dev/ttyHS0 is the GPS output, but it appears that the GPS is of course off, because it has not been started yet. I either need to echo the appropriate digits into the /sys files, or tell the chrooted Android to turn it on. I also found that it relies on gpsd, and uses standard output to it, which is a huge plus for a Linux phone.
Phone calls/text messaging/radio control – I have not even started on that. My goal was to run a chrooted Android environment and “tell it” from Debian to make a phone call or send and receive messages.
Bluetooth – The module for the bluetooth is already loaded, and I have put the bluez and other bluetooth tools on the phone, I just cannot figure out how to connect to it. It may be powered off also.
Wifi – The modules for this are in the /android/lib/modules directory, but once I insmod them, it does not appear as a connection. I believe that I need to do some sort of mknod to create a node or socket to connect to it, or have the chrooted Android turn it on.
Camera – I have not even looked at this yet.
Accelerometer/compass - I have not even looked at this yet.
Slide switch – I am hoping to use xranr and event input to rotate the screen and change the resolution if you slide out the keyboard.
Code:
Available devices:
/dev/input/event0: STMPE_keypad – The physical keyboard.
/dev/input/event1: mpu-accel
/dev/input/event2: sec_key – Physical keys – Volume +/- and power.
/dev/input/event3: sec_touchscreen – The touchscreen input.
/dev/input/event4: proximity_sensor – Sensor that turns off the screen when your face is against it.
/dev/input/event5: light_sensor – Ambient light sensor to control screen brightness and keyboard lights.
/dev/input/event6: HALL – Opening the slide out keyboard.
/dev/input/event7: sec_touchkey – front face soft keys - home, back, search, menu.
/dev/input/event8: compass_sensor
Linux specific things to do: (Wow, this is also a big list!)
lspci – lspci does not work, which hampers the ability to figure out control of some of the devices. This is a problem (I think) with the kernel / arm hardware and the way the arm ARCH is set up. It uses AMBA.
lsusb - Fixed!
- I also got an OTG cable and can plug stuff in and see it show up with lsusb!
Audio – Pulse audio fails, so I replaced it with alsa. While alsa does work, it has the uniqe problem of turning off the path to device when there is no sound playing. Currently, if you want to listen to music, you open a music player, start the music, open the alsa volume mixer, set the path to SPK_HP, and adjust the volume as desired. Once the song or play list is done, pressing play again will yield no sound until you go to the volume mixer and choose SPK_HP again.
Init – Systemd is the standard init for Debian Jessie, but it causes too many problems on the phone. It either needs to be redone, or replaced. Currently, I am using the rc.local script to start some selected services, as a userspace init, so to speak.
Dbus – dbus can be started after you enter the X window environment, e.g. after the chrooted Android is done starting. I don't know that it is working properly.
Graphics – Currently Debian is just drawing straight to the frame buffer, it would be nice to get the nVidia drivers working for 3d acceleration.
Chrooted Android specific problems: (Not as big of a list.)
ADB – Fixed, ADB now works to connect to the chrooted Android from your computer using ADB as usual.
AM – The activity manager cannot start because we have stolen /dev/graphics/fb0 for the Debian x-server, so you cannot access the AM. If the AM can get up and running, then it would be possible to script orders to it, such as make phone calls, start wifi, etc.
SurfaceFlinger - SF is waiting for the /dev/graphics/fb0 to become available. It would be beneficial to have it "start" without it, perhaps to a virtual frame buffer, which requires a new kernel, or user-space tools like xvfb.
If you have any ideas or thoughts on how to do these things, or if you would like to tackle one of these projects, please let me know! I'd be happy to post your work and let everyone know that you came up with the solution!
Optional Instructions
Optional instructions:
If you want to, head over to the Debian Jessie download page and download the arm version of the DVD's 1 and/or 2. In this post I describe how you can rip these cd's to set up a personal repository, one that you can strictly control all of the packages, which may be useful at this time.
Here are the links for the DVD's:
http://cdimage.debian.org/debian-cd/8.2.0/armhf/iso-dvd/debian-8.2.0-armhf-DVD-1.iso
http://cdimage.debian.org/debian-cd/8.2.0/armhf/iso-dvd/debian-update-8.2.0-armhf-DVD-1.iso
Then, on your computer:
Code:
~$ cd {to your download directory}
~$ mkdir disk1
~$ mkdir disk2
~$ sudo mount ./debian-8.2.0-armhf-DVD-1.iso ./disk1
~$ sudo mount ./debian-update-8.2.0-armhf-DVD-1.iso ./disk2
~$ mkdir repo1
~$ mkdir repo2
~$ cd disk1
~$ find . -name *deb -exec mv '{}' ../repo1/ \;
~$ cd ..
~$ cd disk2
~$ find . -name *deb -exec mv '{}' ../repo2/ \;
~$ cd ..
~$ sudo umount ./disk1
~$ sudo umount ./disk2
~$ rmdir ./disk1
~$ rmdir ./disk2
~$ cd repo1
~$ sudo dpkg-scanpackages . /dev/null | gzip -9c > Packages.gz
~$ cd ..
~$ cd repo2
~$ sudo dpkg-scanpackages . /dev/null | gzip -9c > Packages.gz
~$ cd ..
Now you can copy those files to your external sdcard, mount it and add these custom repositories to your /etc/apt/sources.list.
Enjoy!
Really great to see that! Please continue working on this I like the idea maybe I participate instead of trying to port ubuntu touch...
In the meanwhile keep up your work and thanks for sharing!
-----
Sent from my SGH-I927 using XDA Android mobile app
Thanks!
xdajog said:
Really great to see that! Please continue working on this I like the idea maybe I participate instead of trying to port ubuntu touch...
In the meanwhile keep up your work and thanks for sharing!
-----
Sent from my SGH-I927 using XDA Android mobile app
Click to expand...
Click to collapse
Thanks xdajog!
I also tried to port Ubuntu Touch, but the recovery drive is too big for the standard size. I broke down the recovery image and tried to shrink it, I could make it smaller, but I could not get it small enough. Then I attempted to change the pit and re-partition, but ended up having to recover the phone. That is when I started working on this project.
I appreciate the encouragement, and I will be posting more soon! I hope
20151102 update.
Just a quick post on the updates. The first post has been updated with new links to the new files, and the change log gives the basics. Here is a little more detail:
Essentially I was able to add support for the /dev/input/event7 (soft keys) and /dev/input/event2 (the physical buttons).
Now the front soft keys work:
Menu - essentially the right click menu of whatever the mouse pointer is on.
Home - clears the desktop, pressing this again will reveal all of your windows again.
Back - I used this as the switch between desktops.
Search - This now brings up the xfce app finder.
The volume keys now are bound with "amixer set Master 5dB+" or "amixer set Master 5dB-" to adjust the volume.
20151106 update.
Just a few things added in this update:
Created new shutdown.sh and reboot.sh scripts and linked them to a launcher menu on the panel. It was needed to make sure the system is properly shut down, including the chrooted android system.
Also purged and re-installed lsusb, and now it works. After plugging anything into the OTG cable, they will show up on lsusb and things like a mouse are added as /dev/input/event8.
Several failed attempts, but much was learned about the GPS, particularly the use of gpsd. I can now link gpsd to the GPS, however I still need to turn power for the GPS on. However, the Activity Manager for Android is not up and running because Surface Flinger fails to start due to /dev/graphics/fb0 or fb1 being in use by the X server for Debian.
20151109 update.
One of the principle problems with the phone setup was the lack of udev support, which is very important in Debian Jessie.
The problem with udev was the lack of "devtmpfs" file system support in the kernels for the Samsung i927.
So after *many* painful attempts, I was able to load a computer with Ubuntu 12.04, download all of the source code, and compile a custom kernel for the i927. This kernel includes devtmpfs and a few other Linux related things.
The output of uname -a:
Code:
Linux localhost 3.1.10 #2 SMP PREEMPT Mon Nov 9 11:25:41 AKST 2015 armv7l GNU/Linux
And after remaking a boot image, I flashed it to the phone, and to my surprise, this time it worked! Perhaps tomorrow I can update the top post with the new boot image.
It caught me by surprise also because it re-arranged the order of /dev/input/event#'s moving the touchscreen to 1, where before it was 2, but that was easily overcome by editing /etc/X11/xorg.conf.
I do not know that my new kernel is "better" overall, but it is more "useful" as it includes the devtmpfs support needed to continue with this project.
New Kernel.
Still having trouble fine tuning the kernel to be just right, which is why I have not updated the top post with this information yet, but for those interested, here it is.
The new kernel:
http://www.mediafire.com/download/orkbt7kcx16z0or/20151110ALUboot.img
Flash the boot.img with Odin to the LNX partition.
Edit the xorg.conf file /etc/X11/xorg.conf with the following. The reason for this is that the new kernel has a different order of "events" for device inputs.
Code:
Section "ServerLayout"
Identifier "Layout0"
Screen "Screen0"
InputDevice "touchscreen" "CorePointer"
InputDevice "keyboard"
InputDevice "mediakeys"
InputDevice "frontkeys"
EndSection
Section "Monitor"
Identifier "Monitor0"
ModelName "Monitor Model"
DisplaySize 800 480
EndSection
Section "InputDevice"
Identifier "touchscreen"
Driver "evdrv"
Option "Device" "/dev/input/event2"
Driver "multitouch"
EndSection
Section "InputDevice"
Identifier "keyboard"
Driver "evdev"
Option "Device" "/dev/input/event0"
Option "CoreKeyboard"
Option "XkbRules" "xorg"
Option "XkbModel" "pc105"
Option "XkbLayout" "us"
EndSection
Section "InputDevice"
Identifier "keyboard"
Driver "evdev"
Option "Device" "/dev/input/event8"
Option "XkbRules" "xorg"
Option "XkbModel" "pc105"
Option "XkbLayout" "us"
EndSection
Section "InputDevice"
Identifier "mediakeys"
Driver "evdev"
Option "Device" "/dev/input/event3"
EndSection
Section "InputDevice"
Identifier "frontkeys"
Driver "evdev"
Option "Device" "/dev/input/event7"
EndSection
Section "Device"
Identifier "Card0"
Driver "fbdev"
Option "fbdev" "/dev/graphics/fb0"
Option "Rotate" "left"
Option "VertRefresh" "60"
EndSection
Section "Screen"
Identifier "Screen0"
Device "Card0"
DefaultDepth 16
SubSection "Display"
Depth 16
EndSubSection
EndSection
Otherwise, your touchscreen will not function.
Phone is broken.
Unfortunately, my spare Captivate Glide finally bit the dust. :crying:
Regardless of what rom/software I put on it, it cannot sustain itself for more than a minute or so before it simply stops working. The screen turns grainy, gets lines through it, and then it reboots itself. Perhaps if I get another phone or motherboard I can continue working on this further.
AlaskaLinuxUser said:
Unfortunately, my spare Captivate Glide finally bit the dust. :crying:
Regardless of what rom/software I put on it, it cannot sustain itself for more than a minute or so before it simply stops working. The screen turns grainy, gets lines through it, and then it reboots itself. Perhaps if I get another phone or motherboard I can continue working on this further.
Click to expand...
Click to collapse
bad news. Nevertheless thanks for all your work!
The problem you describing may because of the power button. There is a known issue which is also with my dev phone (and others out there). Whenever I press it after the phone booted up it will crash the same way then yours. To be able to develop I avoid using the power button to do so I use the highest display timeout value and if I need to wake up the phone I use an adb command to do so.
.
tim241 said:
Any idea how to port this to an other device?
Click to expand...
Click to collapse
Tim241, sorry, I didn't watch this forum anymore, but I will be glad too if you want to ask questions.
Yes, I can tell you how to port this to another device, but I cannot guarantee success. What device do you wish to port it too?
Also, everything I did I wrote in my blog, which is in my signature. I will gladly answer questions here or there.
-AlaskaLinuxUser https://thealaskalinuxuser.wordpress.com/
tim241 said:
my device is the Samsung Galaxy Core 2 SM-G355HN
Click to expand...
Click to collapse
Okay, so the next thing we need are some ROMs to break down the boot image from. What ROMs are available for your phone?
Older is better, stock or custom is okay.
Preferably Android 2.3.* is best because it uses the least amount of processing power and ram.
Android 4.4+ will not work as well, as you will not be able to " hold " onto the screen. It is okay that it is older Android, since you will not actually see the Android part, you are just using it to initialize firmware, etc.
What we will do, as I can explain in more detail as we go along, is break down the boot image and make our own init script that will start Debian Linux. Then Debian will be the boss. Debian will start Android, but Debian will control the screen and inputs.
-AlaskaLinuxUser https://thealaskalinuxuser.wordpress.com/
tim241 said:
we only have cyanogenmod 11 :-/ here http://forum.xda-developers.com/gal...cyanogenmod-11-samsung-galaxy-core-2-t3308697
Click to expand...
Click to collapse
Bummer. So, we can still proceed, but we may have screen trouble with 4.4. Do you want to continue?
-AlaskaLinuxUser https://thealaskalinuxuser.wordpress.com
Great attitude! Let's try!
tim241 said:
We can try
Click to expand...
Click to collapse
Okay, so first things first, STEP 1: downloads!
Download these things:
http://www.mediafire.com/download/zl80gh0t310trla/unpack-bootimg.pl
http://www.mediafire.com/download/xdmd278n17gm58h/unmkbootimg
http://www.mediafire.com/download/byf0tw4ga2mqtw0/repack-bootimg.pl
http://www.mediafire.com/download/7cmi548pzetc6c4/mkbootimg
And download CM11, if you have not already.
I am using Linux, Ubuntu 14.04. I did this previously from Debian Wheezy, so any Linux should work. You can also use a VM, virtualbox, etc. if you are on a Windows computer.
STEP 2: Unzip!
Go ahead and unzip the CM11 that you downloaded. Preferably in its very own folder. For my work, I made a folder called "playground" in my home directory to play around in. I will reference the "playground" meaning the main folder with everything in it. Now, in the playground, make a new folder called "bootimage". In the playground folder, copy the boot.img file to the bootimage folder.
STEP 3: Tools setup!
Copy the downloaded above tools into a new folder called "tools" in the playground folder. Open a terminal here and give these files executable permissions and copy them again to the bootimage folder:
Code:
$ cd ~/playground/tools
$ chmod 777 ./*
$ cp ./ ../bootimage
We copy this twice so we have backups of the tools in case we delete them accidentally.
STEP 4: Unpack the boot image!
Open a terminal and go to the bootimage folder, and start typing:
Code:
$ cd ~/playground/bootimage
$ ./unmkbootimg ./bootimage
You will see some output in the terminal that looks *kind of* like this:
Code:
$ ./unmkbootimg ./boot.img
unmkbootimg version 1.2 - Mikael Q Kuisma <[email protected]>
Kernel size 2992704
Kernel address 0x10008000
Ramdisk size 2196028
Ramdisk address 0x11000000
Secondary size 0
Secondary address 0x10f00000
Kernel tags address 0x10000100
Flash page size 2048
Board name is ""
Command line ""
This image is built using standard mkbootimg
Extracting kernel to file zImage ...
Extracting root filesystem to file initramfs.cpio.gz ...
All done.
---------------
To recompile this image, use:
mkbootimg --kernel zImage --ramdisk initramfs.cpio.gz -o new_boot.img
---------------
Whatever it says, copy and paste it, hand type it, screenshot, whatever it takes, write the output down, because this is the key to re-making your boot image! I recommend that you post the output here on XDA so we can look at it together.
Then, unpack it like so:
Code:
$ ./unpack-bootimg.pl ./boot.img
You should see something *like* this:
Code:
$ ./unpack-bootimg.pl ./boot.img
kernel written to ./boot.img-kernel.gz
ramdisk written to ./boot.img-ramdisk.cpio.gz
7607 blocks
extracted ramdisk contents to directory ./boot.img-ramdisk/
You will now have folders and files to play with. After you report back the outcome of this, we will make our init script and continue on.
Good luck! I will wait for your reply!
tim241 said:
Also I need to warn you about the disk space from the device(galaxy core 2 SM-G355HN):
http://www.gsmarena.com/samsung_galaxy_core_ii-6331.php.
Click to expand...
Click to collapse
Great! Good work.
Now for today's steps:
#1. Download:
Debian system (WARNING - this is almost 700 mb!)
http://www.mediafire.com/download/88r6sr3u33bs532/20151106.tar.gz
Very tiny busybox (1.06 mb)
http://www.mediafire.com/download/4uhu93prdtlqdmr/busybox
NOTE: These files will get you started. Later, you can build your own busybox and Linux root file system if you want, these worked for me, so I think it is best to start by using a known working source.
#2. Partition sdcard:
I use a computer to do this, but there are many phone tools available also. You can later transfer all of this internally, and do this without an sdcard, but this is the best way to get started, as you learn, you can move it all to the phone.
So, my computer has an sdcard slot, you may use an adapter, or use your phone, it really doesn't matter. The sizes here are a suggestion, but you will need 2 partitions on the card. I am using an 8 GB card as my example.
Partition Type Size Notes
1 fat32/vfat 2 GB (or more if your card is bigger)
2 ext4 6 GB (or the remainder)
Now, the first partition will be "seen" by Android. The second partition will not typically be seen by Android.
#3. Unzip the Debian system.
First, make a folder in your playgroup folder called sdcard. (~/playgroup/sdcard)
Right clicking on it will most likely work, depending on your distro, but if you use the terminal, the command unzip should do it. When you unzip the file, it may error after completing the task, that is usually okay. It is a difference in zip endings for Linux/Windows. All the 97151 files should be there, you can right click on the folder to verify. It will be in a folder called 20151106, in that folder, you will see a bunch of folders, such as android, proc, lib, etc, and so on. Copy all of those files to your ~/playgroup/sdcard folder.
Now you have a basic Debian Linux system with an XFCE desktop and a user all ready to go. We will need to change a few things that are specific to your phone though, to make this work right.
#4. Copy the original boot stuff to your sdcard folder.
In that ~/playgroup/sdcard folder, is a folder called android (~/playgroup/sdcard/android). This folder currently contains all of the ramdisk for the Cranium Kernel on an i927. You will go ahead and delete everything in the ~/playgroup/sdcard/android folder. It is useless to you.
When you broke down your boot.img file, you were given a new folder called "./boot.img-ramdisk/" this is the contents of your ramdisk for your kernel. Copy all of the files in the boot.img-ramdisk folder to the android folder. Make sure you copy, not move, you will need the other copy for modification shortly.
#5. Gather some information.
Install CM11 to your phone, if you have not already done so. Insert your sdcard. Turn on your phone. Once done, we need to get some information from it. Install a terminal app and give it root permission, or use adb shell from you computer, either way works. Now gather the following information:
Code:
$ su
# mount
.....info you need.....
Write down, copy, or screenshot all of this information.
Code:
$ su
# ls /dev
.....info you need.....
# ls /dev/input
.....info you need.....
# ls /dev/graphic <-----(or graphics depending on your phone)
.....info you need.....
Write down, copy, or screenshot all of this information. You may need some of it later.
WHY:
We will need the partition details and the framebuffer details.
Turn off your phone and remove the sdcard.
#6. Make some changes to init.stage2 file.
There should be a file called init.stage2 in the etc folder: ~/playgroup/sdcard/etc/init.stage2
Open that file with a text editor. Line 43 should say this:
Code:
export FRAMEBUFFER=/dev/graphics/fb1
Change the last part "fb1" to be the earliest fb you wrote down from step 5: "# ls /dev/graphic". So if you have an fb0, put that here. If it starts at fb1, put that here. save the file. You can close that now.
WHY:
Currently, it was set to the framebuffer I was using. We need the framebuffer (screen) for your phone.
#7. Edit your rc.local file.
Open the ~/playgroup/sdcard/etc/rc.local file.
NOTE: There is also an ~/playgroup/sdcard/etc/init.d/rc.local file, that is not the file you want.
It should say:
Code:
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
# Start the ssh client, in the event you need it.
/etc/init.d/hostname.sh start
/etc/init.d/ssh start
# Clean up bad crash before starting x server.
# /sbin/busybox mkdir -p /tmp/.X11-unix/remove
# /sbin/busybox rmdir /tmp/.X11-unix/remove
# /sbin/busybox rmdir /tmp/.X11-unix/
# Start the x server, warning, if the touchscreen or keypad doesn't work
# then you cannot escape without killing power!
/usr/bin/startx &
#export USER=root
#vncserver :5000
exit 0
At this time, change it to say:
Code:
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
# Start the ssh client, in the event you need it.
/etc/init.d/hostname.sh start
/etc/init.d/ssh start
# Clean up bad crash before starting x server.
# /sbin/busybox mkdir -p /tmp/.X11-unix/remove
# /sbin/busybox rmdir /tmp/.X11-unix/remove
# /sbin/busybox rmdir /tmp/.X11-unix/
# Start the x server, warning, if the touchscreen or keypad doesn't work
# then you cannot escape without killing power!
#/usr/bin/startx &
#export USER=root
#vncserver :5000
exit 0
Save the file, and you may now close that window.
WHY:
Currently, it was set to start the openssh server, then the x server. We want to only start the ssh server so we can get the proper information for the x server. We will change this file back later when we have the information.
#8. Put Debian Linux on the sdcard's second partition:
Here is where things will differ for you and me. I don't know where your card will mount, your system may auto-mount your sdcard when you put it in, but here is what you need to do:
-Mount the second partition to /mnt, or figure out where it is mounted.
Code:
$ cd ~/playgroup/sdcard/
$ sudo su
<enter your password>
# cp -Rav ./* /mnt
# sync
# exit
$ exit
WHY:
If you drag and drop, some files will not copy right. We need all files to have the proper permissions and the proper file attributes.
Now you can unmount the partitions and remove the sdcard from the computer/adapter.
#9. Prep your new boot image.
Okay, here is where rubber meets the road. Follow close, because this is really important.
The
Code:
<---
are my comments, don't type those (obviously).
Code:
$ cd ~/playgroup/bootimage/boot.img-ramdisk/ <---to get to the right place.
$ rm -rf * <---to empty out the ramdisk
$ mkdir data
$ mkdir dev
$ mkdir mnt
$ mkdir proc
$ mkdir sbin
$ mkdir sys
$ mkdir system
$ touch init
$ mkdir ./mnt/root
WHY:
This makes the empty directory that you need. Most of this will be populated when the phone starts by busybox.
Remember that busybox file you downloaded? copy it into the sbin folder. THis busybox will actually be the heart and soul of your computer/phone during startup. The Kernel will only interface with it at first.
Now open the init file with gedit or some other text editor, and fill it in with this:
Code:
#!/sbin/busybox sh
# initramfs pre-boot init script
# Mount the /proc and /sys filesystems
/sbin/busybox mount -t proc none /proc
/sbin/busybox mount -t sysfs none /sys
/sbin/busybox mount -t tmpfs none /dev
# System needs a few cycles here
/sbin/busybox sleep 1
# Populate /dev
/sbin/busybox mdev -s
# Mount the root filesystem, second partition on micro SDcard
/sbin/busybox mount -t ext4 -o noatime,nodiratime,errors=panic /dev/mmcblk1p2 /mnt/root
# Clean up
/sbin/busybox umount /proc
/sbin/busybox umount /sys
/sbin/busybox umount /dev
# Transfer root to SDcard
exec /sbin/busybox switch_root /mnt/root /etc/init
Save the file and close it. Now, this only works if your step 5: "ls /dev" has /dev/mmcblk1p1 and /dev/mmcblk1p2, and no higher /dev/mmcblk1p* numbers. There should also be a bunch of /dev/mmcblk0p* numbers, that is okay, that is your phone's internal storage. This should be correct, but if you do not have that in step 5, then let me know and we will look at your output from step 5.
Code:
$ cd ~/playgroup/bootimage
$ rm initramfs.cpio.gz
$ cd ./boot.img-ramdisk/
$ sudo su
<enter your password>
# chmod a+x ./init
# chmod a+x ./sbin/busybox
# find . | cpio --quiet -H newc -o | gzip > ../initramfs.cpio.gz
# cd ..
# mkbootimg --kernel zImage --ramdisk initramfs.cpio.gz --base 0x0 --cmdline 'console=ttyS1,115200n8 androidboot.selinux=permissive' -o new_boot.img
-With heimdall, heimdall-frontend, or Odin, flash the new_boot.img to the boot partition of your phone. Make sure you already have your prepared sdcard in your phone. If it auto rebooted, proceed to step 10. If not, power off when done, then power on and go to the next step.
#10. Reboot your phone.
So, make sure your prepared sdcard is in the phone. Your phone probably rebooted when you flashed the new boot image. For the most part, if this worked, boot up will look normal. If it did not work. It should not have booted. CM11 will start and you will have no idea that anything is different. However, if it booted, there is a difference now, there are a few easy ways to see it.
Install an ssh app on your phone from the playstore or with adb. Remember in step 7, we left the openssh server running. This is your ticket "in" to the Linux that is actually in charge of your phone.
open-ssh is installed and running, so using the ssh app, set it for: [email protected]
username is trondroid, password is trondroid
If successful, it should log into the command line of your Debian Linux powered phone! A couple things to remember:
root user has a password of root.
me has a password of me.
trondroid has a password of trondroid. trondroid also has sudo permission.
If you turn on the WiFi in CM11, and your computer is on the same network, you can run this in your computer's terminal to access the phone:
ssh [email protected] (ipaddress of phone, get from settings menu)
Debian actually is CM11's boss. Debian can delete/move/modify anything in CM11's world. BE CAREFUL! This is the ultimate root! You can even resize CM11's partitions from here. SO BE CAREFUL!
Apt-get works to download any Debian programs you want. We will get into the graphical stuff next time.
Congratulations! You made it work. Now we just have to set up the buttons, keys, xorg.config, and sound for the Debian part, which we will do next. Let me know how it went, and if you have any trouble! Play around and have fun! You are IN!
Part 3 of 3. The final instructions.
Well, I don't know what happened to Tim, but for any interested (probably not many, but for any who are) here are the final instructions.
If you are still with me, then you have already set up your phone to first boot Debian Linux, and then Linux will start Android in a chroot environment. Your phone is actually already running Debian Linux, just with Android being run and displayed on the screen. At any moment, you can actually stop or kill Android. At this point, you also have the power to mess Andriod up, so do be careful!
If you just tuned in, I recommend that you go back to the previous posts, as there is a lot of critical information you need.
Right now, you should be able SSH into your own Linux from the Android gui by using any ssh app to yourself as the local host, since our SSH deamon is running. What we want, though, is for your screen to display the Linux screen, instead of the Android that is running in a chroot environment.
A key part of all of this, is that Android, other than through services like SSH, does not know that Debian Linux exists and it does not have any control over the Linux system or functions. One problem with this is that Android may occaisionally crash due to memory problems, if your Linux environment is using too much RAM. Ironically, if you SSH into your Linux environment, you can use ps aux, or top to see all of Android's running processes. Your Linux environment is now the ultimate root, because even Android doesn't know it exists. You can log anything from Android and save it, you can stop any Android process. You have complete control over your Android system.
However, before making the "plunge" to a Linux only phone, you need a few details. The easiest way to get these is to do some research on your phone. Through SSH, run the ls command in your /dev folder, and look for "input"
Code:
$ cd /dev
$ ls |grep input
/dev/input
/dev/input/event7
/dev/input/event6
/dev/input/event5
/dev/input/event4
/dev/input/event3
/dev/input/event1
/dev/input/event0
/dev/input/event2
On my Samsung Captivate Glide, these are all the available inputs. But what are they? Well, there are several tools to check this. The easiest way, however, is to SSH into Linux, start x11vnc in Linux, and use an app like bvncfree in Android to bring up a visual screen to work with. How you need to do this is a bit tough to describe, because it is so dependent upon your phone and setup. However, if you are using my files, the user trondroid should have a shell script in the home folder for starting jwm in this fashion.
Another way is to start the XserverXDSL app in Android, and then startx in Linux through SSH. That should get you to the same place.
Once you have established a "visual" screen, you now should open up a terminal in your Linux screen. Remember, all input commands that you input right now are from the Android app you are using. That means the "mouse", "click", and "keyboard" are all virtual. You need to set up your real screen as a mouse, for motion and clicking. You also need to set up your physical buttons from your phone, and your keyboard if you have one. With your terminal open, use evtest, like so:
Code:
$ sudo evtest
No device specified, trying to scan all of /dev/input/event*
Available devices:
/dev/input/event0: STMPE_keypad
/dev/input/event1: mpu-accel
/dev/input/event2: sec_key
/dev/input/event3: sec_touchscreen
/dev/input/event4: proximity_sensor
/dev/input/event5: light_sensor
/dev/input/event6: HALL
/dev/input/event7: sec_touchkey
/dev/input/event8: compass_sensor
This even works on your home computer. For instance, here is my laptop:
Code:
$ sudo evtest
No device specified, trying to scan all of /dev/input/event*
Available devices:
/dev/input/event0: Sleep Button
/dev/input/event1: Lid Switch
/dev/input/event2: Power Button
/dev/input/event3: AT Translated Set 2 keyboard
/dev/input/event4: Logitech USB Optical Mouse
/dev/input/event5: SynPS/2 Synaptics TouchPad
/dev/input/event6: Video Bus
/dev/input/event7: ST LIS3LV02DL Accelerometer
/dev/input/event8: HDA ATI SB Mic
/dev/input/event9: HDA ATI SB Line
/dev/input/event10: HDA ATI SB Headphone
/dev/input/event11: HP WMI hotkeys
Select the device event number [0-11]:
But we will focus on the phone. Great! Now we know what event is what input! For instance, event3 is the touchscreen. Now we have something to work with. In my case, event0 is the physical keyboard, but those are rare these days.
You can also test those inputs, by choosing a number for the device, and then using that function. Here you can see me test the "menu key" on the keyboard:
Code:
Menu Key on keyboard
Event: time 25170.575766, type 4 (EV_MSC), code 4 (MSC_SCAN), value 8b
Event: time 25170.575844, type 1 (EV_KEY), code 139 (KEY_MENU), value 0
Event: time 25170.575854, -------------- EV_SYN ------------
Another great tool is called xev, again, open up a terminal and use it like this:
Code:
$ xev
ButtonRelease event, serial 33, synthetic NO, window 0x1e00001,
root 0x26f, subw 0x0, time 156984900, (175,123), root:(228,195),
state 0x100, button 1, same_screen YES
MotionNotify event, serial 33, synthetic NO, window 0x1e00001,
root 0x26f, subw 0x0, time 156985076, (177,123), root:(230,195),
state 0x0, is_hint 0, same_screen YES
There is also xinput, here is an output from my computer:
Code:
$ xinput test-xi2
⎡ Virtual core pointer id=2 [master pointer (3)]
⎜ ↳ Virtual core XTEST pointer id=4 [slave pointer (2)]
⎜ ↳ Logitech USB Optical Mouse id=9 [slave pointer (2)]
⎜ ↳ SynPS/2 Synaptics TouchPad id=11 [slave pointer (2)]
⎣ Virtual core keyboard id=3 [master keyboard (2)]
↳ Virtual core XTEST keyboard id=5 [slave keyboard (3)]
↳ Power Button id=6 [slave keyboard (3)]
↳ Video Bus id=7 [slave keyboard (3)]
↳ Sleep Button id=8 [slave keyboard (3)]
↳ AT Translated Set 2 keyboard id=10 [slave keyboard (3)]
↳ HP WMI hotkeys id=12 [slave keyboard (3)]
EVENT type 13 (RawKeyPress)
device: 3 (10)
detail: 54
valuators:
cEVENT type 14 (RawKeyRelease)
device: 3 (10)
detail: 54
valuators:
EVENT type 13 (RawKeyPress)
device: 3 (10)
detail: 40
valuators:
The overall idea, though, is that you need to open up an x session, so you can then see what x inputs are matched to which event. Once you have all of this information, you can edit the /etc/X11/xorg.conf file to match. Here is the one I made for the Samsung Captivate Glide:
Code:
Section "ServerLayout"
Identifier "Layout0"
Screen "Screen0"
InputDevice "touchscreen" "CorePointer"
InputDevice "keyboard"
InputDevice "mediakeys"
InputDevice "frontkeys"
EndSection
Section "Monitor"
Identifier "Monitor0"
ModelName "Monitor Model"
DisplaySize 800 480
EndSection
Section "InputDevice"
Identifier "touchscreen"
Driver "evdrv"
Option "Device" "/dev/input/event3"
Driver "multitouch"
EndSection
Section "InputDevice"
Identifier "keyboard"
Driver "evdev"
Option "Device" "/dev/input/event0"
Option "CoreKeyboard"
Option "XkbRules" "xorg"
Option "XkbModel" "pc105"
Option "XkbLayout" "us"
EndSection
Section "InputDevice"
Identifier "keyboard"
Driver "evdev"
Option "Device" "/dev/input/event8"
Option "XkbRules" "xorg"
Option "XkbModel" "pc105"
Option "XkbLayout" "us"
EndSection
Section "InputDevice"
Identifier "mediakeys"
Driver "evdev"
Option "Device" "/dev/input/event2"
EndSection
Section "InputDevice"
Identifier "frontkeys"
Driver "evdev"
Option "Device" "/dev/input/event7"
EndSection
Section "Device"
Identifier "Card0"
Driver "fbdev"
Option "fbdev" "/dev/graphics/fb0"
Option "Rotate" "left"
Option "VertRefresh" "60"
EndSection
Section "Screen"
Identifier "Screen0"
Device "Card0"
DefaultDepth 16
SubSection "Display"
Depth 16
EndSubSection
EndSection
Notice how you must declare a screen, a monitor, and then the card that controls it. /dev/graphics/fb0 is the framebuffer that you got the other day, if you were following along with these posts. You will also notice, that for each section, a driver is declared. The drivers used here are generic drivers. You may have different hardware, and use different drivers. So, if one doesn't work, google the xorg.conf section and the word drivers to see some of the different drivers available. You may even need proprietary drivers specific for your device. Like I said though, these generic drivers worked great for me. So I would try those first.
Once you have your drivers and xorg.conf file all set, it is time to take the plung. Be sure to back up your system first. Remember, TWRP or CWM are your freinds, as they work outside of all of the other work you are doing. So you can always start over or go back to something else.
Now, go back to your /etc/rc.local file. It should say:
Code:
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
# Start the ssh client, in the event you need it.
/etc/init.d/hostname.sh start
/etc/init.d/ssh start
# Clean up bad crash before starting x server.
# /sbin/busybox mkdir -p /tmp/.X11-unix/remove
# /sbin/busybox rmdir /tmp/.X11-unix/remove
# /sbin/busybox rmdir /tmp/.X11-unix/
# Start the x server, warning, if the touchscreen or keypad doesn't work
# then you cannot escape without killing power!
#/usr/bin/startx &
#export USER=root
#vncserver :5000
exit 0
And change the last part to say this:
Code:
# Start the x server, warning, if the touchscreen or keypad doesn't work
# then you cannot escape without killing power!
/usr/bin/startx &
#export USER=root
#vncserver :5000
exit 0
Now you have told it to startx on the next startup. If all goes well, reboot your phone, and you should see the XFCE desktop. If not, then you need to figure out how to edit the xorg.conf file to make it work right. You may also need to uncomment the lines about rmdir /tmp/.X11-unix, and the other lines like it, if your xserver ever crashes.
I have noticed several variants, especially on Android 4.4 and newer, that it will startx, but also start Android. You will see one normally, and then a small, pink version of the other overlayed on part of the screen. Almost like a picture in picture TV, but very dificult to understand or use. In these cases, you may need to add a command to kill surfaceflinger, or stop zygote to get Android to "clear out". You actually could just skip Android altogether, but having the chrooted Android is great for playing with making phone calls, etc, as I do not know how to do that from Linux yet.
If you made this work then you do have some pretty good Linux skills, if I may be so bold. This is not an easy task, and not for the faint of heart. So great job! Now it is up to you to improve upon this and make it useful. Who knows, you might be giving Ubuntu Touch a run for the money!
tim241 said:
Sorry, I needed to remove linux because I needed space for windows. Sorry , maybe I will take some time later to redo everything
Click to expand...
Click to collapse
No problem! I just hadn't heard from you in a while.
AlaskaLinuxUser said:
No problem! I just hadn't heard from you in a while.
Click to expand...
Click to collapse
Hey uh, I tried following your instructions but I'm stuck on step 9.
From what I can tell from a ton of debugging, it gets stuck at this line.
Code:
/sbin/busybox mount -t ext4 -o noatime,nodiratime,errors=panic /dev/mmcblk1p2 /mnt/root
It seems to be unable to mount it, I've no idea why though because I have no way of seeing any results aside from 'phone boots up' or 'phone loops' which makes debugging a bit hard heh.
Mounting it in Android and recovery (TWRP) works just fine so I'm pretty certain that '/dev/mmcblk1p2' is the right address and I've tried to mount the fat32 partition of the sd card so I could redirect the output of the mount command to a file but mounting the fat32 partition fails as well.
Maybe it's the population of /dev that's failing?
Code:
/sbin/busybox mdev -s
I tried manually creating the node as well to see if that'd help fix anything
Code:
/sbin/busybox mknod /dev/logs b 179 33
Alas, it didn't work for unknown reasons or of course, mdev and mknod could have worked but the mount failed for other unknown reasons. No idea and as far as I can think, no way of figuring it out to my knowledge.
P.s
My phone is the HTC One m8, earliest Android version I could find was 4.4, Cyanogenmod 11. 64 GB class 10 micro SD Card
P.p.s
Thank you for making such a comprehensive guide!
p.p.p.s
It's 12:26am and I'm so very very tired. I spent at about 9 hours on this wow

Categories

Resources