View Single Post
Old 02-01-2012, 05:04 PM   #1
Nyoxi
Connoisseur
Nyoxi can talk all four legs off a donkey... then persuade it to go for a walk.Nyoxi can talk all four legs off a donkey... then persuade it to go for a walk.Nyoxi can talk all four legs off a donkey... then persuade it to go for a walk.Nyoxi can talk all four legs off a donkey... then persuade it to go for a walk.Nyoxi can talk all four legs off a donkey... then persuade it to go for a walk.Nyoxi can talk all four legs off a donkey... then persuade it to go for a walk.Nyoxi can talk all four legs off a donkey... then persuade it to go for a walk.Nyoxi can talk all four legs off a donkey... then persuade it to go for a walk.Nyoxi can talk all four legs off a donkey... then persuade it to go for a walk.Nyoxi can talk all four legs off a donkey... then persuade it to go for a walk.Nyoxi can talk all four legs off a donkey... then persuade it to go for a walk.
 
Posts: 55
Karma: 124493
Join Date: Jan 2012
Device: Kindle Touch
opkg, opkg GUI and plans on package repository for Kindle Touch

Hi everyone! I have a big plan but little time and things don't go as fast as I would like them to. That's why I decided to make this post so you know what it's easier to track how the things are going.

Note at the beginning: I have Kindle Touch and so what I did and what I'm interested in considers KT. But even though you're interested in other Kindles keep reading as this might be interesting for you too.

Long story short: I would like to see a working package manager on kindle and have package repository that could be used also by non-geeks to install hacks/apps/games/etc. I was thinking that user would just use jailbreak to drop in the package manager and later install packages with the manager (either downloaded by wifi or uploaded on kindle from computer).

Now I realize that this is in fact a long run and will take some time to achieve. But I was quite surprised that there's no such initiative been going on (or considered). So I have decided to start working on that (I am expecting your comments about this "vision" of mine).

Now first things first. What you need to consider before you can even start something like this:
  1. a package manager
  2. GUI frontend that could be easily operated with the "limited" input capabilities of Kindles
  3. a place where to install the packages
  4. a common way of launching the installed applications

ad 1)

I am well aware that people are using the update feature of Kindles' to install stuff. I don't like this option for several reasons:
  • you need one .bin to install something and .bin to uninstall
  • the forced restarts after update are annoying and could be avoided in many cases
  • tracking installed files with shell scripts seems old-fashioned and is prone to errors
  • file conflicts or package conflicts are hard to handle
  • gamble with developer keys

and you could find more. Opposed to that with package management system you don't have this issues, more over you get:
  • dependency tracking
  • you see what is in the repository and what you can install (no need to search the forums)
  • easily install packages from net (thorough wifi)
  • easy updates from net (through wifi)

For small devices it should be OK to have something lightweight. People here have already played with ipkg (simple debian like package manager) from optware. The ipkg developement has been discontinued but there is also it's fork opkg that can be considered a successor.

I have compiled it to a package (see the end of the post for the links) and also have statically linked version that I use to bootstrap the packaging system). And it works (you can e.g. install stuff from optware repositories with it). No problem there except for one thing. Now it is set to store it's files in /var/local (the only writable partition besides /mnt/us). Sadly this now seems like a poor choice as KT bricks when the partition gets full (can't find the thread about it now). But this will get solved by addressing the point 3).

Now you may ask why bother with opkg, why not use the available ipkg and optware. There are known issues with the ipkg solution (like wrong wget arguments) and as I have already said it's been discontinued. As for the optware, it is good for geeks and you can install whatever you know if you know what you're doing (I did that too). But sooner or later you will run into problems like missing files that are expected to exist in the system (remember that the packages were meant for different system) or wrong versions of the existing files. So in a long run it's not an option.

From now on I'll try to be more brief.

ad 2)

I have started on this and made Gtk+2 frontend to the opkg. You can find the pre-alpha version in links below. There are still flaws to be addressed, but the concept works.

If you would want to try on KT you will also need a few hacks to gtkrc (because it's poorly set up) that I can't find at the moment. I will add this later.

ad 3)

Now this is a tricky one. My first idea is do mount rw/ro during install and put files on the root partition (but it seems a little dirty). The only writable partitions are /var/local and /mnt/us and there's not much space on /var/local. As for /mnt/us it's FAT which means:
  • no permissions
  • no symlinks
and I hate the idea that the files could be accessed after connecting the device to the computer:
  • user or some application may (accidentaly) screw something up
  • if you have it for your own purposes it's ok, but if we want it to be common approach used by all users it's a potential security hole and therefor bad practice.

A loop device placed in /mnt/us and mounted on /opt is an option. It solves the first problem, but the issue with potential security hole remains. So what I want to try is use a FS encryption. Further more nueva suggested using an overlay filesystem on root and I find this idea reather interesting.

ad 4)

Unlike with other Kindles where there seem to be tons of different ways to launch apps this seems quite simple for KT. To my knowledge there's just one (yifanlu's) launcher, is that correct? From what I have read about it so far I like the design so I'll try to make a package for this soon too.

So for me the next steps are:
  1. check the overlay kernel module
  2. check the encryption
  3. prepare tools to create the loop FS (that would also allow changing it's size)
  4. finish the GUI
  5. check Openembed as a possible platform
  6. make more packages

If anyone is willing to give a helping hand don't hesitate.

I am personally interested only in Kindle Touch (because that's what I have) but in my wild imagination I don't see a reason why this couldn't work for all kindles. (You can distinguish packages by architecture field if necessary.) What more, maybe even a OS replacement for different kinds of readers (not just Kindles). But let's not get too excited yet.

If you managed to read all this you are either very interested or very opposed and want to tell me something really ugly. So now is the time to relieve the tension by leaving a comment.

Links:

Statically compiled version of opkg is here:
http://nyoxi.net/files/kindle/opkg-bootstrap.tar.bz2
EDIT: But don't use that, I suggest you use the attached installer for opkg and overlay (for writable root filesystem).

My packages are here (not much there yet):
http://nyoxi.net/files/kindle/packages/

The opkg GUI sources and build scripts for packages are here:
http://hg.nyoxi.net/

EDIT: I have attached archive with opkg & root fs overlay (see this thread https://www.mobileread.com/forums/sho...d.php?t=170261). To install just unpack it into userstore (under boostrap directory) and run runme.sh.
If you have already installed opkg with my original script you should do the following to remove it first:
Code:
mntroot rw
opkg-cl remove '*'
opkg-cl remove --force-remove '*'
opkg-cl remove --force-removal-of-essential-packages '*'
rm -fr /var/local/opkg /usr/lib/opkg/
mntroot ro
That will uninstall all the packages you have already installed and remove the opkg itself. After each opkg-cl you should check for lines "Not deleting modified conffile <some_file>" and if you modified that file on purpose then store the files somewhere so you can put them back on the overlay. Either way you should remove the files from the real root filesytem.

When the runme.sh has finished you have to restart the device. After that run opkg-cl update and you're ready to rock&roll again. Edit /etc/opkg/opkg.conf to your liking, now it contains the nslu2 Optware repository.
Attached Files
File Type: bz2 bootstrap.tar.bz2 (1.07 MB, 298 views)

Last edited by Nyoxi; 03-11-2012 at 10:14 PM. Reason: removing the big warning
Nyoxi is offline   Reply With Quote