The Basics of The Palm Pre Linux

Written by:you should add it manually. Detailed instructions can
Alexandr Dodatko,be found here:
Junior Software Developer of Device TeamI've put the fixed version of this script into the
Apriorit Inc.attachments to this article. It lets user to change disk
Table of contentfor installation and also is free from the limitations for
Introductionthe emulator.
1. SDK InstallationTo start the fixed script you shoud get it on the
2. Start to work with Linuxdevice using the wget command. To organize file
3. Program Installationexchange with the device you can install ftp server
4. System foldes reviewon your computer or other computer in your local
4.1 Standard system directoriesnetwork.
4.2 Specific Directories of Web OSAfter entering the command wget ftp://192.168.0.60
5. Work with FTP on the Palm Preoptware-bootstrap-edited.shthe file will be uploaded
5.1. Data exchage procedureto the device ???? to the current directory (ip adress
5.2 Work with console client ncftpshould be of the computer with ftp server of cause).
ReferrencesDON'T use symbol names of the machines (for
Introductionexample wget ftp://my_computer_name
Palm company released ( the new smartphoneoptware-bootstrap-edited.sh
managed by GNU Linux based operating system. This 
product becomes more and more popular due to the) as far as Web OS won't be able to convert them
cute GUI, well-documented SDK and easy start onto the address correctly.
the development. But nevertheless many low-levelSo, we have executed the script and installed a lot
features of this system is poorly documented.of useful programs. Now we have package manager
This article will be useful for those who start workingand so we'll be able to install all missing programs. To
with the console interface of GNU Linux generally anddo it, use the following command: ipkg-opt install
Palm Web OS in particular. It may be useful also for<parckage name>.
the developers who need more capabilities than MojoFor example ipkg-opt install file
SDK provides to solve their task.The list of the packages can be browsed by the
In this article we'll consider such questions:command ipkg-opt listor by following the link:
1. SDK installation and configuration.Developers and enthusiasts may want to install gcc
2. Accessing Linux using "novacom" utility. Basic Linuxcompiler, gdb debugger, make utility, python
commands.interpreter and other great things. The presence of
3. Installation of additional utilities (sudo, packagethese utilities allows program installation by means of
manager etc.). Configuration of the virtual machinebuilding from the source texts.
(virtualbox). Install\remove packages.4. System foldes review
4. Short description of the system files andLet's start from the folders that are common for all
directories specific for Palm Pre.Linux systems.
5. Work with FTP on Palm Pre, review of some files4.1 Standard system directories
content.1. /bin, /lib, /home,
This article is some kind of review.These are folders for standard utilities from Linux
1. SDK Installationpackage, shared libraries (Windows *.dll analogues)
I used emulator from the Palm Mojo SDK package toand user files correspondingly.
research the features of Web OS.2. /mnt, /media, /lost+found
You can download it from the official site:The access points to the external data storages
Or use this link (no registration):(floppies, hard disks, optical disks) are stored in these
Choose the platform you need on the downloaddirectories. In the Palm memory card (micro sd) can
page (Fig.1) and then follow the instuctions on thebe mounted to this directory. And there is nothing
site and in Install Wizard. It's better to install Javainteresting there on the emulator.
first, thenVirtualBox, and thenSDK. Such orderNote: The lost+found directory is specific for the
decrease the possibility of errors.extX (ext1, ext2, ext3, ext4) file systems.
3. /dev
Figure 1: Choosing platformDevice files are stored here.
During the installation the virtual machine for Palm/dev/hd[a..z][1..N] – logical partitions of hard disk
Web OS will be created. You don't have to create it/dev/hda1 – root file directory
manually./dev/hdc – bootloader
2. Start to work with Linux/dev/hdb – the section we created earlier or the
To start work with Web OS Linux start thephysical data storage of the real device – 8GB
emulator. You can use either the shortcut created by(~7GB user available)ttyN – console devices.null
installation program (fig.2) or VirtualBox– «black hole», eating all information that is
interface(fig.3).entered into it.
4.2 Specific Directories of Web OS
Figure 2: Start with shortcut1. /var/luna/data/dbdata/
There are databases used by high-level applications
Figure 3: Start from Virtualboxof Web OS.
If verything is ok then you'll see the EmulatorBases PalmDatabase.db3 and
window (fig.4). We'll need the Internet connection forPalmAccountDatabase.db3 is in sqlite format. There
the further work. It should be configured only in theare data of such applications as mail accounts, notes,
host system (in our case it's Windows) .calendar, chat, memo stored in them.
You can check ff there is Internet on EmulatorThey can be browsed by any sqlite viewer (see [9]).
simply starting Web Browser. To do it chooseI would like to advise this one
Programs (right bottom icon) => Web. After thatWe will discuss how to exchange files with Palm Pre
try to open some site just like on the computer.in the next section.
Search something for example (fig.5).2. /var/luna/data/mediadb.db3
The data about the locations of images, music,
Figure 4: Palm Emulatormovies etc. are stored here. After analysis I can say
that these data are stored in the directories: /media
Figure 5: Palm Web Browserinternal/, /usr/palm/ and their subdirectories.
Now we should use the novacom.exe utility to3. /var/luna/data/emails
connect to the device. To get the full informationThe text of email messages is stored in this directory
about this program options enter novacom.exe --helpin html and ascii formats.
The command novacom.exe -t open tty://opens the4. /usr/share/dbus-1/system-services
Linux terminal window.Here you can find Java services (or, if yo like,
deamons). Using them the application developed with
Figure 6: Linux Consolethe usage of Mojo SDK can get access to the
Note: like in the usual Linux, more than one terminallow-level components of the system.
can be opened in Web OS.5. /usr/lib/luna/java
First lets browse the file system. ls command is usedHere java library files (*.jar) are stored, they are
for this. After entering it we see the content of theused by services.
current directory (root by default).5. Work with FTP on the Palm Pre
5.1. Data exchage procedure
Figure 7: Results of the ls commandWell, now we know what and where is situated. But
To distinguish files from directories we an use optionit's not very convenient to research file content
ls -Fdirectly on Palm Pre. So we have a task of getting
files from the device.
Figure 8: Results of the ls -F commandOne of the methods is FTP protocol. And so you
Directories now have / symbol at the end. So as youshould:
see we have only three files in the root directory:1. Install FTP server (for example this one ) to the
wget, log.txt, md5sums.one of the computers in the local network you work
When using ls -F some other symbols can occur atin (for example on your own one).
the end of the file names.2. Install the FTP client on your computer. It can be
Sufficsthe plugin for Far Manager or Total Commander, or it
Meaningcan be separated application – for example
@FileZilla ftp client ( ).
Symbol link3. Install FTP client to the Palm Pre:ipkg-opt install
*ncftp
Executable file4. Use ncftp to transmit data to the server (it will be
/described later).
Directory5. Get data from FTP server to your computer.
=5.2 Work with console client ncftp
SocketTo connect to the server enter ncftp <url>.
You can see the examples by entering commands: lsOr ncftpopen <url>
-F /bin ls -F /tmpRemember that <url> = ftp://<Ip Address>
More detailed information about the file systemsymbol names are not allowed
element type can be obtained by means of file utility.<url> = <bookmark name>
This utility is disabled in Palm Web OS by default.When the connection is established the current local
Later we'll consider how to install it.directory is «frozen». Instead of working with the
To browse the file content use the command catdirectory all commands of navigation in the file
<filename>.system are translated in the commands of the FTP
For example, cat md5sumsand processed by the server.
To obtain the full information about the command
enter <command> --help, or search the InternetFigure 9: Server navigation with ncftp
with keywords "man <command>". You can alsoNow, after you choosed the necessary remote
read the help in the full Linux version entering "mandirectory data exchange can be performed: put
<command>".<filename>get <filename>
I propose reader to learn also such commands as rmYou can also use some mask instead of the
(remove files\directories), mkdir (make directory),argument. For example, put *.txt
touch(create file), cp (copy), pwd (get current path).
3. Program InstallationFigure 10: Transmission of the several files using the
The process of the program installation for Linux is amask
bit different from this process in Windows. UnlikeTo send the directory use the command put -R
other systems Linux has repositories. Repository can<dir_name>
be considered as the database that contains
program, libraries, and relations between them. ThereFigure 11: Sending the directory with ncftp
is some special software that manages repositoriesNcftp also supports such commands as mkdir, rm,
and install software on the local computer. Suchrmdir, pwd.
software is called “package manager”. TheThe same commands but with l- prefix are used to
package manager compares software versions onnavigate in the local file system: for example lmkdir,
the computer and in the repository, downloadlls, lpwd etc.
software, resolve conflicts between packages. MoreYou can find the full list of the commands on the
information about package managers can be found inofficial program site:
the articles [4],[5],[6],[7].Download scripts sources.
By default, Palm Web OS does not have a packageReferrences:
manager. To install it use the guide
The script optware-bootstrap.sh performs the1.
following:2.
1. Formats /dev/hdb for its needs3.
2. Installs package manager ipkg-opt4.
3. Creates the list of repositories /opt/etc/ipkg5.
optware.conf6.
4. Installs the sudo program, creates the user with7.
the root (administrator) rights8.
5. Installs ssh, sftp server.9.
In the original script some of the mentioned actions10.
cannot be performed on the emulator (for example11.
(4)). It's also required to have /dev/hdb device. By12.
default, there is no such device on the emulator so