728x90 - FREE Samsung Flip Cover with purchase of the Galaxy S III
AndroidMixer • View topic - [root] opkg/dpkg for your phone

AndroidMixer

Android Forums, Help, Tips and Tricks
It is currently Sun May 19, 2013 4:35 pm

All times are UTC - 5 hours [ DST ]




Post new topic Reply to topic  [ 16 posts ]  Go to page 1, 2  Next
Author Message
Unread postPosted: Sun Oct 17, 2010 4:11 pm 
Offline

Joined: Wed Oct 13, 2010 6:49 pm
Posts: 169
This is bleeding-edge stuff, so please don't try it if you're new to Android system development. Android already has an excellent package manager for user apps (apk's). What I propose here is a package manager for the operating system itself.

Why? Read on, or read my blog post ;-)

Some of you who have used Debian (or Debian-like Linux distributions such as Ubuntu) might know about dpkg/apt, a framework for installing packages and keeping them up to date. dpkg maintains information about everything you have installed on the system, and apt takes care of fetching packages from the Internet and other sources. It's one of the most awesome (imho) package managers ever.

opkg is similar to dpkg -- in fact, opkg is compatible with some dpkg packages (otherwise known as deb's). The difference is that it's tiny. I have built a statically-linked version of opkg for my phone that is just 746KB. It could potentially be used to keep Android systems up to date without periodically reflashing the whole ROM.

I have cooked up an installer an example package for the adventurous fellows here who have root and would like to try. It works well on my G1, but YMMV, so be sure to backup before you start. When you have done that, head over to http://dl.dropbox.com/u/1213413/android-opkg/index.htm for files and instructions. Unless you want to build opkg yourself, there's no need to read further.

If you want to do it yourself, just grab the latest code off SVN and cross-compile. I already had a full Debian-based development environment on my phone, so I didn't bother with cross-compiling. The last line generates a static build, so we end up with a self-contained binary that does not depend on any shared libraries. You might also want to edit libopkg/opkg_conf.h and change OPKG_CONF_DEFAULT_TMP_DIR_BASE to "/cache/tmp" instead of "/tmp".
Code:
LDFLAGS=-static ./autogen.sh --enable-sha256=no --enable-openssl=no --enable-ssl-curl=no --enable-gpg=no --enable-curl=no --with-opkglibdir=/cache/usr/lib --with-opkgetcdir=/cache/etc
make clean
make
gcc -Ilibopkg -g -O2 -static -o opkg-cl src/opkg-cl.o libopkg/.libs/libopkg.a libbb/.libs/libbb.a

_________________
my blog


Last edited by inportb on Mon Oct 18, 2010 6:07 am, edited 4 times in total.

Top
 Profile  
 
Unread postPosted: Sun Oct 17, 2010 4:51 pm 
Offline
Site Admin
User avatar

Joined: Thu Aug 05, 2010 6:13 pm
Posts: 3088
Location: Northville,MI
Interesting stuff, can't wait to see what you come up with. :-)

Sent from my SGH-T959 using Tapatalk


Top
 Profile  
 
Unread postPosted: Sun Oct 17, 2010 6:14 pm 
Offline

Joined: Wed Oct 13, 2010 6:49 pm
Posts: 169
Alright, so it's been uploaded to http://dl.dropbox.com/u/1213413/android-opkg/index.htm
It works for me, but I can't stress this enough: backup!

Also, this is only the beginning. There are no packages for our phones as of now, except for my example. But that doesn't mean we couldn't make some ourselves ;-)

_________________
my blog


Top
 Profile  
 
Unread postPosted: Mon Oct 18, 2010 11:04 am 
Offline
User avatar

Joined: Thu Aug 05, 2010 8:45 pm
Posts: 500
This is really cool stuff, have you talked with cyanogen or any of his team about it? or are you going at it alone?


Top
 Profile  
 
Unread postPosted: Tue Oct 19, 2010 12:25 pm 
Offline

Joined: Wed Oct 13, 2010 6:49 pm
Posts: 169
I'm going at this alone because there's not much interest at the moment, and it'd take a lot more time for it to get into CyanogenMod -- it's an extra 746KB that needs to be justified. On the other hand, I plan to build some packages in my spare time, and see if I could get more people to build their repositories using it. It's somewhat of a developer-driven tool -- if developers ship their apps/hacks/enhancements using Opkg, end-users would install Opkg.

And now for something slightly more fun... I now have a repository :D
I also wrote something up on how easy it is to make packages and publish them in repositories.

To add my repository feed, just do
Code:
echo "src/gz inportb-android-froyo http://repo.inportb.com/android/froyo" > /cache/etc/opkg/inportb.conf


Once you have done that, you can then do your familiar
Code:
opkg update
opkg install opkg-hello


To test the new package, do
Code:
opkg-hello


To get the latest versions of everything, you'd
Code:
opkg upgrade


And to remove it, simply
Code:
opkg remove opkg-hello


... just as you'd do on Debian/Ubuntu. It's a pretty boring feed at this point, but it does simplify the process of downloading, installing, and updating.

_________________
my blog


Top
 Profile  
 
Unread postPosted: Tue Oct 19, 2010 1:27 pm 
Offline

Joined: Fri Sep 24, 2010 10:28 pm
Posts: 139
DEFINITELY liking this. can't wait to just be able to do the equivilent of sudo apt-get update --yes; sudo apt-get upgrade --yes; sudo apt-get dist-upgrade --yes; sudo apt-get autoclean --yes.

_________________
@ado
Get Dropbox!


Top
 Profile  
 
Unread postPosted: Tue Oct 19, 2010 9:57 pm 
Offline

Joined: Wed Oct 13, 2010 6:49 pm
Posts: 169
Now all we need is a GUI front-end a la Cydia. Oh, and it was just tested successfully on a Hero (it works on my G1).

_________________
my blog


Top
 Profile  
 
Unread postPosted: Thu Oct 21, 2010 1:52 am 
Offline

Joined: Wed Oct 13, 2010 6:49 pm
Posts: 169
So... I just packaged the latest gapps for hdpi and mdpi, full and tiny... and installed. There seems to be some problems with the latest gapps, but the installation worked alright. There are two metapackages that pull in the rest as dependencies -- gapps-full and gapps-tiny. Whether you get hdpi apps or mdpi apps depends on your preferred architectures -- the idea is that you set up your preferences once, and the rest is automatic.

Users of mdpi devices should save the following as /cache/etc/opkg/arch.conf:
Code:
arch all 1
arch any 6
arch noarch 11
arch arm 16
arch armel 21
arch apk 26
arch apkmdpi 31


Users of hdpi devices should save the following as /cache/etc/opkg/arch.conf:
Code:
arch all 1
arch any 6
arch noarch 11
arch arm 16
arch armel 21
arch apk 26
arch apkmdpi 31
arch apkhdpi 36


You can see the current package feed at the repository. But... I would wait until the next gapps release before installing.

_________________
my blog


Last edited by inportb on Tue Nov 02, 2010 7:47 pm, edited 1 time in total.

Top
 Profile  
 
Unread postPosted: Tue Nov 02, 2010 7:45 pm 
Offline

Joined: Wed Oct 13, 2010 6:49 pm
Posts: 169
If you're interested in building Opkg yourself, I have some advice for you. At any rate, it worked for at least one person, but there may be additional steps depending on your device and ROM. My experience shows that there are no problems with CM6 on a G1 :D

_________________
my blog


Top
 Profile  
 
Unread postPosted: Tue Nov 02, 2010 7:55 pm 
Offline

Joined: Fri Sep 24, 2010 10:28 pm
Posts: 139
how difficult would it be to get something like synaptic going?

_________________
@ado
Get Dropbox!


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 16 posts ]  Go to page 1, 2  Next

All times are UTC - 5 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 13 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
970x90 - ZTE Avid 4G, $50 off
cron
Powered by phpBB® Forum Software © phpBB Group

phpBB SEO