02/02/2014, 04:19 PM
The Devil is always in the details
Originally Posted by George Boudouris
My installer for version 0.6.0 consists of a number of things:
- A script to rip apart the OpenMobile .bin distribution file and reorganize it for installation in a different directory structure and as .xz compressed tar files (reduces the size of the IPK by 10M!). The big difference was organizing OpenMobile's use of /opt so that it would safely run when the USB drive is mounted as well as ensuring that the Android /system partition was actually mounted read-only as per Android specs.
- An installer, based on the reorganized .bin file, that first made sure that webos-internals Optware was installed so that ACL could safely use /opt, then installed ACL based upon my reorganization
- A set of patches to the OpenMobile startup script, /opt/omww/bin/start-acl.sh, buried in the .bin file (the .bin file is just a homegrown shar script) to provide support for things such as the TouchPad Go, support for ext4 filesystem if the kernel supported it (ext4 is the Android recommended filesystem), etc. The script patches also dealt with the fact that the BusyBox version of /bin/sh is being used which prohibits the use of certain constructs that OpenMobile had in their scripts.
- A patch to /etc/event.d/start-acl to make sure that ACL was actually installed before trying to start it
- A patch to /opt/omww/bin/mount.sh to enable USB mounting by suspending Android (ACL) processes when the USB is externally mounted
- An uninstaller script
- A background tool - called picsakd - which handled things such as: deleting ACL apps when their corresponding webOS app is deleted, properly triggering uninstall of ACL, license enforcement, etc. Basically, it was a catchall daemon for anything that was not easy to do in a script.
- The package also included an Enyo app, written by PIC, for doing license activation.
To be fair, the actual base of my IPK was just a standard webos-internals IPK ... designed from the beginning to fit within the existing webos-internals GIT structure.
Now from OpenMobile's stated to me point of view, there are a number of problems here:
- OpenMobile really wants to use their .bin file for distribution. Don't ask me why - it slows down the install, increases the size of the IPK, and makes progress notification in Preware a tad more difficult, but it is their code, so ...
- OpenMobile does not want patches to any of their scripts including startup-acl.sh or mount.sh ...
- OpenMobile really wants to prohibit the use of the ext4 filesystem, to the point that they are now carrying an ext3 filesystem buried in their .bin file for the Android /system partition ... in my approach, I created whichever filesystem you could support (either ext3 or ext4) and expanded the tar.xz file into the created filesystem. The only extra thing I had to add to the starutp script was a check - at ACL startup time - to see if your kernel still supported ext4 and, if it did not, rebuild as ext3. Yeah, I was going to clean that up - but OpenMobile's position was to prohibit ext4 support completely.
- OpenMobile did not want to support the Uberkernel. To be fair, I have not looked at the three GPL kernel patches they are carrying, so there may be a technical reason for this - but all of my development had been using the Uberkernel (why would I run anything else?)
- OpenMobile seems concerned that the startup script, startup-acl.sh, provides too much information about how ACL runs - so they are, as of the last IPK I saw, obscuring the code. Now, to be honest - it doesn't take much looking at the process tree, mounts, and /dev to figure out what's happening - but they were worried about it.
To your comment about "It would be interesting to see what directories it modifies so that ACL is installed." - there is not a lot of magic here. They simply build a chroot'ed environment for running Android. This approach is used by a number of open source Android runtime environments attempts I have seen on the net. The tricky thing is that they use quite a few mount points to build the chroot'ed environment (you can easily see this by looking at /proc/mounts). This is a source of complications with start/stop of ACL as well as uninstalling ACL after it has been started. For example, /media/internal - the USB drive for the TouchPad, is mounted into the Android chroot environment ... accidently delete the Android environment without unmounting /media/internal and it makes a bloody mess of your TouchPad. Worse - there are some mount points that cannot be unmounted without rebooting (I'm sure there was a way to fix this and I believe I know what was holding the mount, but it was obscure enough that even lsof didn't show it!).
Now - looking at my old 0.6.0 scripts won't really help you with the new version of ACL being developed by OpenMobile. OpenMobile has moved off of /opt (YEA! - I asked for that back in September), and OpenMobile moved the Android process suspension work out of mount.sh and into their executable code where it always did belong.
To your observation "If it was a simple installer it wouldn't take them 2 month to rewrite it." - there was a wee bit more here than just a simple installer script.