PDA

View Full Version : Howto (RFC) : Autorun apps packaged into iso files


pipeline
06-08-2008, 04:48 PM
Current Version 1.07 (Fixed issue with /var/tmp) - Download Here :
http://wardenclyffetower.com/MaemoFiles/isoapps/isomount-wct-1.0.7.all.deb

If you need or want to use the iso containers/appliances functionality, then you also need penguinbait's cdrom driver mirrored here (http://wardenclyffetower.com/MaemoFiles/isoapps/cdrom.deb) for iso9660 filesystem support. (Eventually i would like to convert all of the appliances to ext2 but for now there are still quite a few iso9660 appliances)

The latest 1.06 version has added an appliance browser which you can use to download/install and run appliances. You can still use dbus-switchboard and/or set up personal menu shortcuts, but this will act as easy way to find/download/extract/run appliances.

IsoMount is a package for using both ISO and EXT2 filesystems (stored as .iso and .ext2 files) as containers, autorun appliances, and for advanced filesystem grafting/access features.

Containers :
In the latest version, if you attempt to 'run' an iso or ext2 file which does not have any autorun scripts emedded within them, then it is assumed to just be a container (and not an appliance). If you have python installed then it will automatically mount the filesystem and put up a python window informing you of the mount. The files will stay mounted until you shutdown the python window so just minimize the notice until you are finished accessing your files and then shut down the notice window and the filesystem will be unmounted. Your files are also available from File Manager under Documents/iso or Documents/ext2. This is symlink to /mnt/ext2 (for users who prefer accessing the mountpoint directly).

Currently i have packaged a starter 'container' which is a 10 meg ext2 filesytem you can download. For users who are able to untar files the file is only 11k but for users working entirely from filemanager i also have the full uncompressed 10meg ext2 file you can download.

Note : please rename the ext2 file to something meaningful -before- mounting the container... otherwise if you download another container it might not be able to distinguish between them without a reboot.

Uncompressed 10 meg container :
http://wardenclyffetower.com/MaemoFiles/isoapps/ext2/empty-ext2-filesystems/empty-userfs-10meg.ext2

Compressed 10 meg container (11k) :
http://wardenclyffetower.com/MaemoFiles/isoapps/ext2/empty-ext2-filesystems/empty-userfs-10meg.ext2.tar.gz

Container concept works for iso files too so if you download an iso file which is not an appliance, and 'run' it then it will mount it under Documents/iso (in filemanager) or /mnt/iso from other file managers. You can also create iso containers using my build of isomaster (http://wardenclyffetower.com/MaemoFiles/utils/isomaster-1.3-rev11.all.deb), but they are read-only filesystems from file manager. Advanced users could download any of the various sized empty ext2 filesystems (http://wardenclyffetower.com/MaemoFiles/isoapps/ext2/empty-ext2-filesystems/) and just add a directory with 'user' permissions so that files can be stored there from file manager as user.

Ext2 Appliances :
Ext2 Appliances work pretty much as they did before, but have additional checking to prevent multiple appliances from being run at the same time and interfering with each other. There is also the capability to utilize a new script in root of filesystem called autorun-user.sh which is a script that will run (as user) without a chroot. You could either use this instead of of autorun.sh (if you dont need chroot and want to run using the internal fs+mount), or in conjunction with the autorun.sh script (chroot).

Ext2Graft Appliances :
A new type of appliance called an ext2graft has been added. These files should be similar to ext2 appliance except allow two new scripts to run. init.sh files stored in root of filesystem will be run as root before any autorun commands are executed, and shutdown.sh will be run as root after any autorun scripts have completed. This would allow setting up and tearing down symlinks or any other commands which need to see or change the internal fs + mount. Mostly this is intended to allow symlink/grafting your program temporarily into the existing filesystem but could also be used by themselves. Since this kind of capability (if used irresponsibly) could potentially mess with normally protected files, you need to trust the author much like you would if installing a .deb (which also has root permissions)... therefore these files have an .ext2graft extension and the ext2graft command forces you to confirm you want to run these appliances with a maemo confirm box. Currently no ext2graft appliances exist other than a sample one (four rivers game grafted to run without chroot (http://wardenclyffetower.com/MaemoFiles/isoapps/grafts/four-rivers-1meg.ext2graft.tar.gz)).

So its expected you would use dbus-switchboard (http://www.internettablettalk.com/forums/showthread.php?t=17757&highlight=dbus-switchboard) (for file manager launching) or emelFM2. Dbus-switchboard and emelfm2 do not yet support the .ext2graft extension but will be updated soon. You could also execute the core scripts :
ext2run, isorun, ext2graft along with optional utilty scripts ext2mount, ext2drop, ext2bmount, ext2bdrop, isomount, and isodrop. I only intend to add ext2graft to dbus-switchboard (as 'ext2graft %params2%') and emelfm2 (as 'ext2graft %f') since you can access containers with ext2run.


The iso appliances i created (a while back) are still available here :
http://wardenclyffetower.com/MaemoFiles/isoapps/iso/

Current 'AutoRunnable' iso's include :
quake1 demo
quake2 demo
hexen2 demo
descent2 demo
gtk-gnutella
duke3d demo (ukki)
warzone2100 (ukki)
jagged alliance 2 demo (ukki)
pingus (arnim)
freera full game (linman)
freecivsdl (bundyo)
freeabuse (bundyo)
qt-textedit (free) : wysiwyg htm editor for 810 users, bt kbd, or xkbd users (no scim support)
qt-findfiles (free) : search for files or for text within files (for 810, btkbd, or xkbd users)
qt-sqllite-dbview (free) : browse and query sqlite databases (for 810, btkbd, or xkbd users)

And the ext2 appliances are still here :
http://wardenclyffetower.com/MaemoFiles/isoapps/ext2/

Current Autorunnable Ext2 Images
BosWars
AbiWord (from Debian repo)
four-rivers (mahjong)
enigma
widelands
Battle of Wesnoth (all expansions; no music)
Beneath a Steel Sky (w/ScummVM)
Flight of the Amazon Queen (w/ScummVM)
Lure of the Temptress(w/ScummVM)

Hopefully this will clean up the internal filesystem for many new users or just make it easy to 'bolt' on your existing iso's after a fresh flash.

The whole project dir is here :
http://wardenclyffetower.com/MaemoFiles/isoapps/

And when i make new iso 'appliances' i'll put them there (usually when apps are 'done')

pipeline
06-08-2008, 05:47 PM
(Post no longer needed)

thecubed
06-08-2008, 06:45 PM
This is a great idea, but just out of curiosity, why not something compressed like the .MO files used in Slax?

I really like the idea of not having to clutter up the package manager with one-time applications, and also not having to worry about using up the internal memory.

Maybe someone with more PyGTK experience than me could whip up a simple GUI for this? (I'd try, but I don't know enough Python yet... still learning...)

This looks to be much better than the current process of making DEB files, and a lot more professional to not have to worry about dependencies with chroot-- it's just like .APP files in OSX !

Awesome job, pipeline!

pipeline
06-08-2008, 07:28 PM
Sounds like that would be better. This solution of mine really just lets penguinbaits cdrom (iso9660) file system driver do all the heavy lifting work with slinging around the file system though.

Sounds like MO files use SquashFS which i dont think we have a driver compiled for maemo yet. It also supports unionfs which qwerty compiled which would be better than chroot for most situations other than debian/kde apps.

Definately worth looking into though since the iso's are not compressed on fat like they are on internal filesystem.

I added some more of my apps to the iso directory. I now have 'autorunnable' iso files for :
quake
quake2
hexen2
gtk-gnutella
descent2

The zipped versions are just zipped up copies of the iso... you dont need both... now if only we had squashfs i wouldnt need both :)

I'm kind of new to linux filesystems so if theres a simpler solution like just mounting a tar.gz somehow with execute permissions, let me know.

thecubed
06-08-2008, 08:18 PM
I wonder how hard it would be to compile a maemo version of the SquashFS driver...

Just building off your idea:
Currently, we have this mess of dependencies for programs in Linux (not complaining, every OS is like this)-- DEB files solve a large amount of this problem, but they sometimes have version problems (just look at all the Canola2 python and ecore problems).
Imagine a user who wishes to download an application like Canola2 just downloading a single file that contains all the dependencies and support libraries contained in a compressed filesystem that can then be chrooted to (although there might be some problems with that still in maemo) --- the user never needs to worry about a single dependency again!

This is amazing! I sure do hope this picks up some (more) steam soon!

I actually don't know about mounting a tar.gz, I don't think they are designed for random access (just like old tape archivesl)

Does anyone else have any ideas?

pipeline
06-08-2008, 08:46 PM
Thanks for ideas... yea the downside of that is redundancy... if everyone did that we'd have duplicate libs in many iso files. In reality dependencies dont add up to that much though (above whats already in firmware)... and i'd rather duplicate a little on mmc than keep 1 copy in internal fs.

I doubt big projects like canola would use this, and i think that uses python which would be a lot to duplicate. In a compressed filesystem maybe though ... plus the fact it would be on mmc. I think this would be best for apps with big data files (like games) or maybe system utilities (automated essentials packs).

And if i get time i would really like to reverse engineer qole's openoffice chroot install to lift just the relevant libs/binaries/data to make a slim portable openoffice appliance.

Benson
06-09-2008, 10:15 AM
I'm curious; why did you go with ISO9660 instead of, say, ext2? Not saying it's bad; it's just not the choice that seemed obvious to me.

pipeline
06-09-2008, 11:22 AM
Well i have graphical app for constructing iso files, plus it works with existing iso's. ext2 is not compressed right? I'm also not sure how one would go about backing up directory to ext2 image... would you need an entire ext2 partition to dd?

I would think compressed filesystem would be only alternative with benefits, but if i figure out other filesystem options like ext2 i could add support if it would be useful... i just can't think of a good use case.

Benson
06-09-2008, 12:40 PM
Well, no big benefits like compression from ext2, but it's still a little better for handling wierd file names and such than ISO9660+RockRidge... I'm not sure if char & block special files exist in RockRidge? But that's not likely an issue.

But it does permit writing settings, etc. back directly.

For creating a filesystem, I don't know of a mkproto.ext2, but you can just du, add maybe 5% to grow (or a definite size, for games, to allow for dropping retail data files in...), mke2fs, and cp -a; that should do it.

pipeline
12-28-2008, 08:42 PM
I updated this to version 1.0.3.

I now support autorunnable chroot environments and side by side ext2 mounting (for copying between ext2 images).

I will eventually update emelfm2 to support the additional ext2bmount and ext2bdrop commands but if you want to use them you can edit filetype and add those two commands :
Ext2bMount sudo ext2bmount %f
Ext2bDrop sudo ext2bdrop

I've got a couple ext2 autorunnable appliances now at :
http://wardenclyffetower.com/MaemoFiles/isoapps/ext2/

So basically that allows me to make autorunnable apps for programs which need files in specific locations... the downside is that i need to add extra files (duplicate) so that all dependencies are met.

For those who want to build your own images, i've got some starter empty filesystems which i use, and one which is loaded with minimal amount of files needed to chroot into it. You can copy all files from the loaded 12meg image to any empty filesystem image using side by side mounting. These development images are here :
http://wardenclyffetower.com/MaemoFiles/misc/

If you do attempt to make your own images, rename it immediately after extracting it becuase when you mount a file it remembers the file name and remounting a different image with the same filename might not work. Also unmount (ext2drop) the image and reboot before deleting to ensure disk space is recovered on your mmc.

qole
01-13-2009, 05:27 PM
pipeline: I think we should work together to turn my chroot scripts in Easy Debian into a generic ext2 image chroot appliance launcher. You definitely want the latest version of my package, since it has that cool turbo loop stuff in it, and I definitely want to move towards your isorun / ext2run system. I'm thinking of trying out qwerty12's recent zenity package as the GUI frontend.

AHA. I have the solution. I should break apart my Easy Debian package into an easy-chroot package and easy-debian package. The easy-chroot package has a very generic chroot script that is designed to be wrapped by other scripts, and the easy-debian package has the Debian chroot-specific stuff in it, including the Debian image downloader, LXDE window manager, and all of that stuff. Then you (and others) can depend on the easy-chroot package and wrap it in your own scripts... Sounds like a plan?

EDIT: So I figure it would work to issue a command like "sudo ezchroot filename.ext2 (or /dev/partition) /mountpoint command param param param" to run as root (replacing the "debian" command), or "ezchroot-user ..." to run as user (replacing the "debbie" command). Then the debian and debbie commands could simply wrap these commands and add some debian-specific tweaks. That would allow me to make new packages like Easy Ubuntu and you could use easy-chroot as a dependency to do the heavy lifting for ext2 chroot running.

Lord Raiden
01-13-2009, 05:59 PM
lol. This sounds interesting. I've been trying to come up with a way to use grub to mount and boot isos from a pendrive to save me on having to burn every iso I get when testing Linux distros, so this is somewhat similar.

pipeline
01-13-2009, 06:55 PM
pipeline: I think we should work together to turn my chroot scripts in Easy Debian into a generic ext2 image chroot appliance launcher. You definitely want the latest version of my package, since it has that cool turbo loop stuff in it, and I definitely want to move towards your isorun / ext2run system. I'm thinking of trying out qwerty12's recent zenity package as the GUI frontend.

Yea definately... i had thought about using zenity within the appliances but you're thinking of using it as frontend for managing the chroot? That sounds interesting too.

Basically i have my 'ext2run' command which calls :
- ext2mount
- ext2chroot /autorun.sh $2 $3 $4 $5 $6
- ext2drop (unmount.. important for reuse of mountpoint)

additionally i added an 'alternate' mountpoint for simple side-by-side mount for copying between (useful when authoring the ext2 images)... those are ext2bmount and ext2bdrop

With 'most' of my appliances, a 1-at-a-time restriction for 'running' them is tolerable, but long term it might be neat to have up to... say 4... mountpoints and a rollover capability in script. Chroot apps dont know the difference, but would make for a tricky mount script.


AHA. I have the solution. I should break apart my Easy Debian package into an easy-chroot package and easy-debian package. The easy-chroot package has a very generic chroot script that is designed to be wrapped by other scripts, and the easy-debian package has the Debian chroot-specific stuff in it, including the Debian image downloader, LXDE window manager, and all of that stuff. Then you (and others) can depend on the easy-chroot package and wrap it in your own scripts... Sounds like a plan?

hmm would you be able to replace my package entirely? if so i wouldn't need to add as a dependency at all :) I do kind of need the independent mount/run/drop commands and at least 2 mountpoints in order to create the images i make though... after all how i can i rip off more of your debian apps if i cant access the destination ext! :D

Any thoughts on how easy that would be to integrate into your scripts?

pipeline
01-18-2009, 10:19 PM
I updated my isomount package with a minor enhancement to symlink /var/tmp and /var/lib/dbus.

This is mostly so that the ext2 abiword appliance can be used for opening email attachments or web links (of document files).

The /var/lib/dbus directory was needed for accessing machine-id file from leafpad within an appliance (my mono dev appliance).

pipeline
02-21-2009, 10:13 AM
I have updated my isomount package to version 1.05 with alot of features, most of which add 'potential' for creating much more powerful/useful appliances but i have not yet created any significant appliances which use the new capabilities.

Full description of the overhaul i made is in first post, along with download link.

So for end users, the main addition is the addition of container mode, where if you do an ext2run or isorun from file manager (using dbus-switchboard), on a filesystem with no autorun scripts embedded, then it will mount as a container, showing a python window/notice which you leave running until your done accessing the files, then you close the notice window to unmount. Container files are also symlinked to be accessible from file manager's Documents/iso and Documents/ext folder. Currently i have a starter 10meg ext2 container which can be download from first post.

pipeline
02-22-2009, 08:24 PM
I have made a new appliance which is pretty cool, so i thought i'd post here.

Its a simple appliance, a graphic novel / comic called Out of the Box ( http://brendancahill.com )

Its wonderfully flash animated, and uses widescreen format. The resolution is 640x360 but i have reworked it to scale perfectly.

You can download the 32meg appliance here (its not compressed) and it consists of 14 chapters :
http://wardenclyffetower.com/MaemoFiles/isoapps/ext2/OutsideTheBox-GraphicNovel-32meg.ext2

It requires the latest 1.05 version of isomount and it just launches an index webpage in a browser linking to swf files.

Pushwall
03-08-2009, 09:33 PM
Hey pipeline thanks for the appliance browser in version 1.06. It makes downloading and running these appliances so much easier. Also thanks for adding the graphic novel too. Very nice stuff indeed! :cool:

pipeline
03-08-2009, 10:50 PM
Thanks, the app browser will download a new appliance list, so if i add an appliance you will see it listed when you next run it.

The graphic novel was pretty cool, the author is really talented artist and made good use of flash animation. i only wish i had a whole library of those animated flash graphic novels to choose from... really suits the tablet.

qole
03-09-2009, 08:09 PM
pipeline:

We need an appliance that packages up Bundyo's Biggest Document Viewer app (http://www.internettablettalk.com/forums/showthread.php?t=21703) and lets you keep it on your SD card.

Please! We really need a way to see MS Office documents on the tablet. In something other than plain text.

If you don't do it, I will! ;)

pipeline
03-10-2009, 08:09 AM
well i trid making a quick appliance out of it but the user interface seems slow and unstable when i run the office. As soon as I start typing in a new document, it crashes and then detects it own crash and tries to backup the sample file.

Since all im doing is mounting the fs, and symlinking the usr/lib/openoffice branch im guessing thats just how it runs within maemo os?

Is there another bin to try to use as the default? (couldn't find your treb command) Or maybe i can just try to use its convert to pdf functionality like i do antiword? I'll try that convert to pdf later.

This could either be :
- debian minimal chroot (debian libs)
- maemo minimal chroot (maemo libs)
- something like what i did (for simplicity), a graft (my term) where the filesystem is mounted and you symlink any directories which need to be in particular places. My latest isomount supports this and i build symlink in the init.sh and teardown in the shutdown.sh (both run as root), and run the modified owo.sh in autorun-user.sh which runs as user

qole
03-10-2009, 12:18 PM
pipeline: I was just thinking of using it as a document viewer (as Bundyo intended), not as an office suite. You use it to make a PDF of your MS Office document and then view it with something like Evince or the built-in PDF viewer.

EDIT: Here's the "treb" command that pretty much does the same thing, just slower: Ubuntu treb (https://launchpad.net/ubuntu/jaunty/armel/treb/0.18-0ubuntu1)