webOS Nation Forums >  webOS Developers >  webOS Development > Command Line Linux on a WebOS phone
Command Line Linux on a WebOS phone
  Reply
Like Tree2Likes
  • 1 Post By connorberry
  • 1 Post By Jason Robitaille

 
Thread Tools Display Modes
Old 08/09/2011, 06:30 PM   #1 (permalink)
Member
 
Posts: 1
I've just recently gone through the process of enabling access to the Linux command line on my HP Veer so that I could enable use of my phone to ssh into servers I support.

I've written up the process below. (It's also on my web site at connorberry.posterous.com, but I can't include a direct link since this is my first post)

Hopefully it is useful. If anyone has suggestions on improving it the documentation or process, I'd be happy to include them.

Command Line Linux on a WebOS Phone
------------------------------------------------------------

(Or how to install Nethack on your phone)

The WebOS (HP/Palm) phones are some of the most interesting phones to me as a technology guy (geek). They, more than iPhone or even Android allow you to have easy, supported (or at least not hindered) near ultimate control over your phone. More particularly, underneath WebOS, is a real Linux system. Once you enable it, there's even a package management system similar to apt-get.

And while the actual setup of access the Linux command line was relatively simple, there were a few places where steps were harder that they should be. So this is my attempt to write down what I did to get it working.

Note: The Preware documentation is excellent. Kudos to the WebOS Internals team for their efforts. It's worth the $.99 to get it. And it supports the the WebOS Internals project.

However, to get to a real Linux command line experience on your WebOS phone, you need to go a few steps further than what the Preware documentation talks about.

So I'll start where that document leaves off. Now, as I've only had a WebOS phone for a few days, I may well not know the best way to accomplish this - I'm just going to share what worked for me. Hopefully if there are better ways, someone can respond and I'll try to update these instructions.

Step 0. Preliminaries:

Follow the instructions in the Preware Homebrew Documentation. (It really is worth the $.99 in the App Catalogue)
Once you have downloaded WebOS Quick Install and installed Preware on your phone, go on to the next step.

Step 1. Go to Preware, install "Bourne Again Shell"

Note 1: the best way to find something in Preware is to swipe back until you see the "List of Everything", choose that and then start typing. That will search for the package you want.

Note 2: I'm not sure that it's necessary to install Bash, it seems like I read that there is a default version of sh installed. However, I had already installed Bash before I realized this, so to maintain the integrity of these instructions, I'm including this. Plus, bash is a better shell for interactive use than sh.

Step 2. Install a terminal app.
To get to the command line, you will need a terminal app of some kind. This is the most annoying part of the instructions currently. This part shouldn't be as hard as it it.

Unfortunately, the most talked about terminal app "Terminal" apparently no longer works on the current versions of WebOS, and so has been removed from Preware. Xterm is the other terminal that is talked about online. However, I was not able to get it to work when I tried (some library wasn't found). Also, I don't know how to invoke xterm from WebOS without having a terminal present. So, there's a little bit of a chicken and egg problem.

So, that leaves us with 2 choices, Terminus and SDLTerminal. I very much suggest SDLTerminal at this point, but I'm going to go through the process to get both up and running.

1. Terminus
Terminus is available in Preware. However it may not come up successfully out of the box. (If it looks like just a blank screen, the you will need the below instructions) Also, I haven't been able to find any list of keybindings for things like ESC, Ctrl, and various symbols necessary for Unix like |, <,>, etc. In addition, it's font size is tiny to the point of miniscule on the HP Veer's small screen.

However, here is what you have to do to get it to be minimally viable (unfortunately I don't know how to get it to be more than that).

1. Install "Internalz Pro" from Preware.
2. Open Internalz Pro and go to preferences.
3. Under the "Text Editor" section change the "Newline format" to "Linux".
4. Using Internals Pro, navigate to /var/palm/data
5. Open the file "jailusers"
6. Find any lines that have "terminus" in them.
7. Delete every line with "terminus" in it except for the one that ends in "jail_native-palm.conf"
8. Save the file

Terminus should now come up and display a shell prompt (rather than just blank screen with a cursor).
However, as I mentioned before, it's font size is tiny, and I can't tell how to create special characters, so its utility for me was minimal.

Therefore I started looking at SDLTerminal.

While I vastly prefer the experience of SDLTerminal, installing it is a hassle. Here are the steps it took to get it on the phone.

Note: while SDLTerminal is listed in Preware, I (and others it appears) have had trouble downloading it from there. For me the download just sat there spinning each time I tried to download it.

The solution at this point is to search PreCentral for SDLTerminal. The first thread that comes up is the one you want.
You will need to have register with PreCentral if you haven't already to be able to download the file you need. Registering with PreCentral was it's own hassle. If I'm able later I'll try to find a link to the page that *actually* let me register.

1. Find the top thread on PreCentral for SDLTerminal
2. Go to the first post on that thread

Note: You should copy down the keybindings from that post somewhere, as they are necessary for effective command line use on Linux

3. Download that file to your computer
4. Unzip that file, there will be a .ipk file inside.
5. Make sure your phone is in "developer mode"
(refer to the Preware Homebrew Documentation mentioned earlier)
6. Connect your phone back to your computer, choose "just charge".
7. Open WebOS Quick Install (used earlier to install Preware)
8. Choose the .ipk file that was in the zip file
(I believe you use the "+" button in Quick Install and browse)
9. Click "Install" in Quick Install

At this point SDLTerminal should be on your phone. You can disconnect your phone from your computer, close Quick Install, and turn off developer mode on your phone if you want to.

SDL Terminal should come up and you should see a usable shell prompt. Try a few Linux commands like pwd or ls.

Now for the rest of the Linux system.

Go back to Preware and install "Optware Advanced Linux Command Line Installer"

This will install a command line package manager similar to apt-get. In this case it is called ipkg-opt on the command line.

Note: you may also need to install "Optware Bootstrap" but I think it may have been installed automatically when I installed the above package.

Run "ipkg-opt list" to get a list of packages available for install.
(You probably want to do "ipkg-opt list | less" since SDLTerminal doesn't appear to support scrolling at this time.)

At this point you should be able to install anything you want.

For example,
ipkg-opt install nethack

I installed openssh, inetutils, and yes, nethack. Now I can ssh into my web servers to edit config files or restart webservers from my phone if I need to. Although the experience would be a bit constrained, I could even write programs on or from the phone if I wanted to.
connorberry is offline   Reply With Quote
Liked by ursula likes this.
Thanked By: ursula
Old 08/09/2011, 07:32 PM   #2 (permalink)
Legend
 
Jason Robitaille's Avatar
 
Posts: 3,855
You can also use the Linux Commandline option in WOSQI. Far easier to setup, but requires a computer
__________________
If you've liked my software, please consider to towards future development.

Developer of many apps such as: WebOS Quick Install, WebOS Theme Builder, Ipk Packager, Unified Diff Creator, Internalz Pro, ComicShelf HD, LED Torch, over 70 patches and more.

@JayCanuck @CanuckCoding Facebook
Jason Robitaille is offline   Reply With Quote
Old 08/23/2011, 05:36 AM   #3 (permalink)
Member
 
Posts: 1
I followed your instruction exactly. everything seems to be fine, just that SDL terminal won't open for whatever reason. Any recommendations?

[QUOTE=connorberry;3061019]I've just recently gone through the process of enabling access to the Linux command line on my HP Veer so that I could enable use of my phone to ssh into servers I support.
qqzj is offline   Reply With Quote
Old 08/23/2011, 05:42 AM   #4 (permalink)
Member
 
Posts: 915
I'm curious. Did the OP not use Xecutah to launch XTerm?
FenrirWolf is offline   Reply With Quote
Old 08/23/2011, 09:36 AM   #5 (permalink)
Developer
 
rwhitby's Avatar
 
Posts: 10,568
Quote:
Originally Posted by connorberry View Post
Step 2. Install a terminal app.
To get to the command line, you will need a terminal app of some kind. This is the most annoying part of the instructions currently. This part shouldn't be as hard as it it.

Unfortunately, the most talked about terminal app "Terminal" apparently no longer works on the current versions of WebOS, and so has been removed from Preware. Xterm is the other terminal that is talked about online. However, I was not able to get it to work when I tried (some library wasn't found). Also, I don't know how to invoke xterm from WebOS without having a terminal present. So, there's a little bit of a chicken and egg problem.
Or just install Xecutah from the Preware testing feeds.

-- Rod
__________________
WebOS Internals and Preware Founder and Developer
You may wish to donate by Paypal to donations @ webos-internals.org if you find our work useful.
All donations go back into development.
www.webos-internals.org twitter.com/webosinternals facebook.com/webosinternals
rwhitby is online now   Reply With Quote
Old 10/03/2011, 08:59 AM   #6 (permalink)
Member
 
vasekvi's Avatar
 
Posts: 1,209
ok I have read the rules from testing.preware.org and from what I see you have to first be able to access the linux command line on the device before being able to enable the testing feeds. I am using an AT&T pre3.
__________________
-



Vent Mounted Touchstone for Pre3 DIY!
vasekvi is offline   Reply With Quote
Old 10/03/2011, 05:17 PM   #7 (permalink)
Developer
 
rwhitby's Avatar
 
Posts: 10,568
Quote:
Originally Posted by vasekvi View Post
ok I have read the rules from testing.preware.org and from what I see you have to first be able to access the linux command line on the device before being able to enable the testing feeds. I am using an AT&T pre3.
That is correct.

-- Rod
__________________
WebOS Internals and Preware Founder and Developer
You may wish to donate by Paypal to donations @ webos-internals.org if you find our work useful.
All donations go back into development.
www.webos-internals.org twitter.com/webosinternals facebook.com/webosinternals
rwhitby is online now   Reply With Quote
Old 10/12/2011, 11:42 AM   #8 (permalink)
Member
 
Posts: 33
when I enter ipkh-opt list it just says "successfully terminated" without listing any programs. Maybe I havent entered any repository?

Edit: Strange..after I restarted xecutah, I was able to make a ipkg-opt update...and now it lists everything for me...

Last edited by 2nd_Street; 10/12/2011 at 11:48 AM.
2nd_Street is offline   Reply With Quote
Old 11/07/2011, 05:35 AM   #9 (permalink)
Member
 
Posts: 511
Thankyou very much for this it was very detailed and helpful!
ursula is offline   Reply With Quote
Old 11/10/2011, 04:43 AM   #10 (permalink)
Member
 
Posts: 178
I can't seem to change the compcache from 10mb in govanah, how are you guys adjusting it, also i can't cd into /opt/sbin/ just gives me the error that i can't do it, any idea what that is?
mcbeaven is offline   Reply With Quote
Old 11/10/2011, 04:57 AM   #11 (permalink)
Legend
 
Jason Robitaille's Avatar
 
Posts: 3,855
Just heads-up that I've created a visual step-by-step tutorial on how to use the Linux Commandline option in WOSQI, which is currently the easiest way to get such access (given you have a computer on hand), in the current version of the official WOSQI Homebrew Guide app.
__________________
If you've liked my software, please consider to towards future development.

Developer of many apps such as: WebOS Quick Install, WebOS Theme Builder, Ipk Packager, Unified Diff Creator, Internalz Pro, ComicShelf HD, LED Torch, over 70 patches and more.

@JayCanuck @CanuckCoding Facebook
Jason Robitaille is offline   Reply With Quote
Liked by Unclevanya likes this.
Old 11/10/2011, 02:18 PM   #12 (permalink)
Member
 
vasekvi's Avatar
 
Posts: 1,209
Quote:
Originally Posted by Jason Robitaille View Post
Just heads-up that I've created a visual step-by-step tutorial on how to use the Linux Commandline option in WOSQI, which is currently the easiest way to get such access (given you have a computer on hand), in the current version of the official WOSQI Homebrew Guide app.
If I had a like or thank you button available in forums id use it.

-- Sent from my Palm Pre3 using Forums
__________________
-



Vent Mounted Touchstone for Pre3 DIY!
vasekvi is offline   Reply With Quote
Old 11/10/2011, 02:50 PM   #13 (permalink)
Member
 
UncleVanya's Avatar
 
Posts: 1,501
Terminal still shows in Preware for me - but I'm using 1.4.5.1 - so I'm not sure it's accurate to say that Terminal was removed from Preware as much as it is accurate to say Terminal isn't an option for webOS 2.x or higher.
UncleVanya is offline   Reply With Quote
Old 11/10/2011, 03:45 PM   #14 (permalink)
Developer
 
rwhitby's Avatar
 
Posts: 10,568
Xecutah continues to be available for all webOS devices and all webOS versions ...

-- Rod
rwhitby is online now   Reply With Quote
Old 11/10/2011, 05:21 PM   #15 (permalink)
Member
 
UncleVanya's Avatar
 
Posts: 1,501
Quote:
Originally Posted by rwhitby View Post
Xecutah continues to be available for all webOS devices and all webOS versions ...

Feeling dense... I installed Xecutah and the required packages (Xterm and XServer) and when I run it I get a typical looking Xterm window with a nice "mouse" X in the middle that I can drag around. However I can't seem to figure out how to start a command line of any type from within this environment.
UncleVanya is offline   Reply With Quote
Old 11/10/2011, 05:53 PM   #16 (permalink)
Developer
 
rwhitby's Avatar
 
Posts: 10,568
You should see an XTerm window appear. If not, please raise a bug report in the xecutah thread with full details.

-- Rod
rwhitby is online now   Reply With Quote
Reply

 

Thread Tools
Display Modes



 


Content Relevant URLs by vBSEO 3.6.0