<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>rwhitby.net &#187; WebOS Internals</title>
	<atom:link href="http://www.rwhitby.net/blog/category/webos-internals/feed" rel="self" type="application/rss+xml" />
	<link>http://www.rwhitby.net</link>
	<description>The Internet Presence of Rod Whitby</description>
	<lastBuildDate>Wed, 14 Oct 2009 01:58:05 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>The Definitive Analysis of Palm Pre App Install Limits and the Palm App Catalog Hanging</title>
		<link>http://www.rwhitby.net/blog/webos-internals/palm-pre-app-install-limits.html</link>
		<comments>http://www.rwhitby.net/blog/webos-internals/palm-pre-app-install-limits.html#comments</comments>
		<pubDate>Mon, 12 Oct 2009 09:08:39 +0000</pubDate>
		<dc:creator>Rod Whitby</dc:creator>
				<category><![CDATA[WebOS Internals]]></category>

		<guid isPermaLink="false">http://www.rwhitby.net/?p=98</guid>
		<description><![CDATA[After the Preware 0.9.4 release, which included Applications, Themes, and Patches, and offers over 670 homebrew packages for installation, we (webos-internals.org)  started getting reports of the Palm App Catalog &#8220;hanging&#8221; the user interface for 30 seconds or more when the installation of a new application is initiated, but only when the Package Manager Service (the [...]]]></description>
			<content:encoded><![CDATA[<p>After the Preware 0.9.4 release, which included Applications, Themes, and Patches, and offers over 670 homebrew packages for installation, we (webos-internals.org)  started getting reports of the Palm App Catalog &#8220;hanging&#8221; the user interface for 30 seconds or more when the installation of a new application is initiated, but only when the Package Manager Service (the service which does all the Linux-level work for the Preware front-end) was installed.</p>
<p>After some analysis, I found that disabling all the feeds in Preware reduced the &#8220;hang&#8221; from more than 30 seconds to less than a second.</p>
<p>Looking through the output of &#8216;dbus-util &#8211;capture&#8217; showed that the &#8220;hang&#8221; was during the call to the queryInstallCapacity method of the com.palm.appinstaller service, the routine that the Palm App Catalog application uses to determine whether there is enough space to install a new application from the Palm App Catalog.  Yes, this is the method which is at the heart of the dreaded &#8220;Too many applications&#8221; errors that people are seeing when they have a number of homebrew applications installed and try to install a new application from the Palm App Catalog.</p>
<p>Watching the output of &#8216;ps -ef&#8217; during calls to this method (you can call it manually using luna-send) showed that palm was calling &#8220;ipkg -o /var list&#8221;.  Curious.  Why would you want to know the *complete* list of all *available* applications when determining whether there is room to install one known new application.  I suspect that Palm should be calling &#8220;ipkg -o /var list_installed&#8221; instead (which just lists the installed applications).  Note that Palm doesn&#8217;t use feeds the way that Preware does, so for Palm&#8217;s official use of ipkg, list and list_installed would return the same thing in their testing, but list_installed is definitely what they should be using to determine the size of installed applications.</p>
<p>The plot thickens when you use strace (which Palm conveniently includes in the official firmware image) on the running LunaSysMgr process.</p>
<p>It seems that LunaSysMgr calls &#8220;ipkg -o /var list&#8221; to get a list of installed packages (the probably intend to just get the list of installed packages, but when you have Preware installed and have feed configuration files in /var/etc/ipkg/*.conf, it actually returns a list of all *available packages).</p>
<p>LunaSysMgr then does an execve of &#8220;/usr/bin/du -s /var/usr/palm/applications/<em>package&#8221;</em> for each package in that list.  (BTW Palm, you seem to have a bug in the logic of that code, cause it&#8217;s running du on random garbage strings after the end of the real package list)</p>
<p>Yes, that&#8217;s right.  A call to queryInstallCapacity spawns a new program (&#8221;du&#8221;) once for each package returned by &#8220;ipkg -o /var list&#8221;.  No wonder the UI hangs for 30 seconds or more!</p>
<p>A single &#8220;du -s /var/usr/palm/applications/*&#8221; would be a far more efficient way to get exactly the same information, but again, Palm would not see this difference in testing because they do not support the third-party Preware application usage of ipkg feeds.</p>
<p>You can imagine that this behaviour is probably related to the app install limit that many people are experiencing too.  Unfortunately, I&#8217;ll have to reduce my /var partition size down from it&#8217;s current 2GB size (courtesy of the WebOS Internals Meta-Doctor) to be able to investigate this one.</p>
<p>Now the webos-internals.org developers need to develop a new method of installing homebrew applications so that this bug in Palm&#8217;s appInstaller service is not triggered.</p>
<p><span style="text-decoration: line-through;">In the meantime, the work-around is to go into the Preware Preferences screen, hit the &#8220;Feeds&#8221; button in the top-right corner, and disable all the feeds while you use the Palm App Catalog application in another card.  No need to exit the Feeds screen, just toggle all the button to &#8220;Off&#8221;, and then toggle them back to &#8220;On&#8221; when you&#8217;re finished with the App Catalog.</span></p>
<p>For the solution to this problem, see Update #2, below.</p>
<p>I&#8217;ve created a <a href="http://forums.precentral.net/web-os-development/208903-definitive-analysis-app-install-limits-app-catalog-hanging.html">thread on PreCentral</a> where this issue can be discussed.  As I uncover more information, I&#8217;ll publish my finding here.</p>
<p>Update #1: I&#8217;ve now webOS Doctored my Pre in the name of science, and have tested the limits of installing applications.</p>
<p>If you run &#8220;du -s /var/usr/palm/applications/*&#8221;, and add up all the numbers in the first column, then as soon as you hit the 62367 1K blocks limit of the addition of the sizes reported by that &#8220;du&#8221; command and the size of the app you with to install, you will get the dreaded &#8220;Sorry, Not Enough Memory&#8221; error from the Palm App Catalog application (and any other installer, like fileCoaster or PreLoad, which uses the palm appInstaller API).  It doesn&#8217;t matter whether you have 192MB free in your /var partition, it will max out at just under 64MB of application usage.</p>
<p>Update #2: I have now created a Linux Application called &#8220;<a href="http://forums.precentral.net/homebrew-apps/208909-fair-dinkum-app-limit-remove-arbitrary-limit-app-installation.html">Fair Dinkum App Limit</a>&#8221; (org.webosinternals.fairdinkum), which removes both the &#8220;hang&#8221; and the arbitrary application limit.  You can find it in Preware.  Just install it (no need to even run anything &#8211; if it is installed, it&#8217;s working), and you&#8217;re ready to install more applications than you can poke a stick at &#8230;</p>
<p>Fair Dinkum App Limit works by simply putting a couple of wrapper scripts in /usr/local/bin, which returns a size of zero when du is called, and returns the output of &#8220;ipkg -o /var list_installed&#8221; when &#8220;ipkg -o /var list&#8221; is called.  In the future, the wrappers will be made much more sophisticated than they are right now to prevent operation outside of the specific cases where they need to fool LunaSysMgr, and to also include a safety buffer so that users do not fill the /var partition.  This is a tactical response to a problem that people using homebrew applications are experiencing.  Hopefully, Palm will provide the long term solution for limits on application installation in a release in the near future.</p>
<p>Notes for Palm, if you happen to read this:</p>
<p>1) We fully appreciate that the usage of the ipkg database in /var for homebrew applications is a choice that the homebrew community has made, and is not supported by Palm.</p>
<p>2) We fully agree that the use of &#8220;ipkg -o /var list&#8221; instead of &#8220;ipkg -o /var list_installed&#8221; would work perfectly fine for the way that Palm is officially using the ipkg database in /var/usr/lib/ipkg, but we contend that the &#8220;list&#8221; and &#8220;list_installed&#8221; commands have clear intended usage, and the one to find the list of installed applications for checking available disk space should be &#8220;list_installed&#8221;.</p>
<p>3) We fully realise that the initial version of the FairDinkum scripts are unsafe.  Returning a zero value for du is a temporary solution while we work out how to achieve the same result safely.  The intention is to only return false values when du is being called from LunaSysMgr, and to make sure that a safety buffer is kept so that users do not fill the /var partition.</p>
<p>4) I would be very happy to discuss these issues with anyone at Palm (Chuq and Google both have my email address), and would hope that we can together architect a solution for supporting homebrew application installation which does not require these work-arounds.</p>
<p>5) We have designed these work-arounds in a way which does not collide with Palm OTA Updates, and in a way that we can update them automatically using the Preware installer application, and in a way that we can cause them to self-remove when Palm releases a long term solution.</p>
<p>Update #3:</p>
<p>It seems that there is yet another limit on application installation imposed by LunaSysMgr.  Once the used space on /var crosses around 60%, LunaSysMgr will once again refuse to install applications.</p>
<p>I&#8217;m going to need to webOS Doctor my Pre yet again (to reallocate 2GB to /var) to determine whether this limit is a fixed percentage, or a fixed number of blocks.</p>
<p>Update #4:</p>
<p>The limit is 102400 free blocks.  Mystery solved.  That also means the Fair Dinkum App Limit cannot cause your /var to be filled.</p>
<p>Update #5:</p>
<p>Thanks to Carl Thompson, an improved version of Fair Dinkum App Limit which does not alter the operation of &#8216;du&#8217; has been released.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rwhitby.net/blog/webos-internals/palm-pre-app-install-limits.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The WebOS Internals Meta-Doctor</title>
		<link>http://www.rwhitby.net/blog/webos-internals/meta-doctor.html</link>
		<comments>http://www.rwhitby.net/blog/webos-internals/meta-doctor.html#comments</comments>
		<pubDate>Tue, 06 Oct 2009 12:17:17 +0000</pubDate>
		<dc:creator>Rod Whitby</dc:creator>
				<category><![CDATA[WebOS Internals]]></category>

		<guid isPermaLink="false">http://www.rwhitby.net/?p=91</guid>
		<description><![CDATA[Palm supplies Palm Pre owners with this wonderful recovery tool called the webOS Doctor.  Part of the charter of the WebOS Internals project is to ensure that anything we (or anyone following instructions we publish or installing packages we develop) do can always be reverted using the webOS Doctor.
Usually, a Palm Pre is required to [...]]]></description>
			<content:encoded><![CDATA[<p>Palm supplies Palm Pre owners with this wonderful recovery tool called the webOS Doctor.  Part of the charter of the WebOS Internals project is to ensure that anything we (or anyone following instructions we publish or installing packages we develop) do can always be reverted using the webOS Doctor.</p>
<p>Usually, a Palm Pre is required to be activated on the Sprint network before it can be used.  This is not possible for a Palm Pre in Australia.</p>
<p>So we need to allow the Pre to be used without activation, and there are a number of information sources showing how this can be done.  There are also some dubious sites that redistribute modified versions of the webOS Doctor (which is a clear violation of copyright law, since it contains proprietary Palm software).  Note that WebOS Internals is always careful to comply with all copyright laws (copyright law is the foundation upon which open source licenses are based).</p>
<p>So we need a way for a Pre owner (who has the right to use the webOS Doctor on their own Pre) to modify the webOS Doctor that is specific to their particular version of the Palm Pre before using it to flash that modified firmware onto their Pre.</p>
<p>That&#8217;s where the WebOS Internals &#8220;Meta-Doctor&#8221; comes into play.</p>
<p>I have created a tool which will download, unpack, patch, and repack a webOS Doctor image, applying a number of transformations along the way to:</p>
<ol>
<li>Bypass the need for activation</li>
<li>Enable Palm Profile access</li>
<li>Set developer mode on by default</li>
<li>Increase the size of the /var partition to 2GB</li>
</ol>
<p>You can find this tool in the WebOS Internals source code repository at http://git.webos-internals.org/?p=tools/meta-doctor.git</p>
<p>Do not redistribute modified versions of the webOS Doctor created using this tool &#8211; it is for end-user use only.</p>
<p>I&#8217;ve created a <a href="http://forums.precentral.net/web-os-development/207472-webos-internals-meta-doctor.html">forum thread on PreCentral</a> for discussion about this tool.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rwhitby.net/blog/webos-internals/meta-doctor.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Palm Pre GPS doesn&#8217;t like my hemisphere</title>
		<link>http://www.rwhitby.net/blog/webos-internals/palm-pre-gps-error.html</link>
		<comments>http://www.rwhitby.net/blog/webos-internals/palm-pre-gps-error.html#comments</comments>
		<pubDate>Tue, 06 Oct 2009 11:53:30 +0000</pubDate>
		<dc:creator>Rod Whitby</dc:creator>
				<category><![CDATA[WebOS Internals]]></category>

		<guid isPermaLink="false">http://www.rwhitby.net/?p=86</guid>
		<description><![CDATA[It seems the Palm Pre GPS was never tested in the southern hemisphere &#8211; my new Pre&#8217;s GPS reports Lat: 394.6, Long: 138.6
24926.609       PUB     call    460             :1.26   com.palm.location       //getCurrentPosition  «string=“{}”, string=“com.sfmpllc.sendmylocation 1058”»
24926.641       PRV     call [...]]]></description>
			<content:encoded><![CDATA[<p>It seems the Palm Pre GPS was never tested in the southern hemisphere &#8211; my new Pre&#8217;s GPS reports Lat: 394.6, Long: 138.6</p>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">24926.609       PUB     call    460             :1.26   com.palm.location       //getCurrentPosition  «string=“{}”, string=“com.sfmpllc.sendmylocation 1058”»</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">24926.641       PRV     call    238             :1.68   com.palm.phone  /com/palm/phone/tel_getradiotype      «»</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">24926.661       PRV     return  238     0.020   :1.26   :1.68           «string=“success”, string=“CDMA”»</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">24926.751       PRV     call    239             :1.68   com.palm.phone  /com/palm/phone/tel_getbsinfo «»</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">24926.786       PUB     call    461             com.palm.luna   org.freedesktop.DBus    /org/freedesktop/DBus/AddMatch        «string=“interface=org.freedesktop.DBus,member=NameOwnerChanged,arg0=com.palm.location”»</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">24926.920       PUB     return  460             com.palm.location       com.palm.luna        «string=“{&#8221;errorCode&#8221;:0,&#8221;timestamp&#8221;:1.254820510841E12,&#8221;latitude&#8221;:394.593215,&#8221;longitude&#8221;:138.681593,&#8221;horizAccuracy&#8221;:150,&#8221;heading&#8221;:0,&#8221;velocity&#8221;:0,&#8221;altitude&#8221;:0,&#8221;vertAccuracy&#8221;:0}”»</div>
<blockquote><p>24926.609       PUB     call    460             :1.26   com.palm.location       //getCurrentPosition  «string=“{}”, string=“com.sfmpllc.sendmylocation 1058”»</p>
<p>24926.920       PUB     return  460             com.palm.location       com.palm.luna        «string=“{&#8221;errorCode&#8221;:0,&#8221;timestamp&#8221;:1.254820510841E12,&#8221;latitude&#8221;:394.xxxxxx,&#8221;longitude&#8221;:138.xxxxxx,&#8221;horizAccuracy&#8221;:150,&#8221;heading&#8221;:0,&#8221;velocity&#8221;:0,&#8221;altitude&#8221;:0,&#8221;vertAccuracy&#8221;:0}”»</p></blockquote>
<p>The latitude value should be 34.6 degrees South (or -34.6 degrees).</p>
<p>That would explain why Google Maps isn&#8217;t working.</p>
<p>Now I need to work out how to replace the Coordinates java class in /usr/lib/luna/java/location.jar, so that the getLatitude method returns a number between -90 and +90 &#8230;</p>
<p>I wonder how many WebOS applications will then barf on a negative latitude value &#8230;</p>
<p>The <a href="http://forums.precentral.net/palm-pre/207473-palm-pre-gps-does-not-work-southern-hemisphere.html">PreCentral thread</a> has more information on other GPS tweaks.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rwhitby.net/blog/webos-internals/palm-pre-gps-error.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Palm Pre lands in Australia</title>
		<link>http://www.rwhitby.net/blog/webos-internals/palm-pre-lands-in-australia.html</link>
		<comments>http://www.rwhitby.net/blog/webos-internals/palm-pre-lands-in-australia.html#comments</comments>
		<pubDate>Tue, 06 Oct 2009 11:13:15 +0000</pubDate>
		<dc:creator>Rod Whitby</dc:creator>
				<category><![CDATA[WebOS Internals]]></category>

		<guid isPermaLink="false">http://www.rwhitby.net/?p=80</guid>
		<description><![CDATA[Thanks to the generosity of the PreCentral and WebOS Internals communities, I am now the proud owner of a Palm Pre.
There is just one catch  - since I live in Australia (which uses a proper cellular communications standard), the CDMA Palm Pre that I was able to import from the USA will never work as [...]]]></description>
			<content:encoded><![CDATA[<p>Thanks to the <a title="generosity" href="http://forums.precentral.net/palm-general-chat/202126-rwhitby-needs-pre.html">generosity</a> of the <a title="PreCentral" href="http://precentral.net">PreCentral</a> and <a title="WebOS Internals" href="http://webos-internals.org/">WebOS Internals</a> communities, I am now the proud owner of a <a title="Palm Pre" href="http://www.palm.com/us/products/phones/pre/">Palm Pre</a>.</p>
<p>There is just one catch  - since I live in Australia (which uses a <a title="proper cellular communications standard" href="http://en.wikipedia.org/wiki/GSM">proper cellular communications standard</a>), the CDMA Palm Pre that I was able to import from the USA will never work as a phone here (yes, I knew this before I purchased it).  I plan to also purchase an unlocked GSM/UMTS Pre when one becomes available (maybe I&#8217;ll buy a German one and then swap the two keyboards).</p>
<p>After founding the <a title="WebOS internals" href="http://webos-internals.org">WebOS Internals</a> project, and using the Pre Emulator in the development of <a title="Preware" href="http://www.webos-internals.org/wiki/Application:Preware">Preware</a>, it is great to have a real device to get the full Pre experience.</p>
<p>If you want to keep up to date with the activities of the WebOS Internals group, just follow <a href="http://twitter.com/webosinternals">@webosinternals</a> on Twitter.  You can also find a list of articles about WebOS Internals in our <a title="Press Room" href="http://www.webos-internals.org/wiki/Press_Room">Press_Room</a>.  We hang out in the #webos-internals IRC channel on Freenode, and have a <a href="http://groups.google.com/group/webos-internals-announce">webos-internals-announce</a> Google group.</p>
<p>I still use my trusty old Treo 650 as my daily phone, which allows me to not have to worry about reflashing the Pre to try out things, as I don&#8217;t keep any real personal data on it.</p>
<p>I guess this also closes the OpenMoko chapter of my open source development activities.  I was involved with OpenMoko from the very start, but always said that an OpenMoko device with a hardware keyboard was my preferred form factor, and the Pre seems to satisfy that personal hardware form factor preference whilst still being open enough on the software side to attract my interest.  I wish those who are continuing the OpenMoko path the best of success.</p>
<p>I&#8217;ll document my experiences with the Pre in subsequent posts &#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rwhitby.net/blog/webos-internals/palm-pre-lands-in-australia.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
