Dingux (Dingoo Linux) > Development
How to manage software packages with ipkg in Dingux
batman52:
How to manage software packages with ipkg in Dingux
There have been discussions about this topic in the early days of dingux (when it still booted hooked to the usb). Some time is past since then and it seems that we all have forgotten. Anyway, since I am a bit tired of reconfiguring menus and copying files into the right directories, I feel like it would be of great benefit having a working package manager.
I was quite astonished when randomly browsing the rootfs I noticed that WE ALREADY HAVE IPKG into our standard dingux distro. So what I will explain here is how to configure it, in order to make it usable to easy install applications. I have to say that the most difficult part of the whole job I made was finding documentation about ipkg, which seems atm unsupported.
Here is where you can learn the basic working of ipkg.
http://handhelds.org/moin/moin.cgi/Ipkg
The main issue we have to deal with, is that ipkg is configured to to work on the root directory, that as we all know is read-only in dingux. In order to prevent this, I have moved the working "root" directory of ipkg to /usr/local/ creating an ipkg.conf file and putting it in /usr/local/etc.
Following the example that I found browsing the ipkg code (no official docs found on how to write this file), I also created two directories where ipkg is supposed to do something.
Here is my ipkg.conf:
--- Code: ---# Must have one or more source entries of the form:
#
# src <src-name> <source-url>
#
# and one or more destination entries of the form:
#
# dest <dest-name> <target-path>
#
# where <src-name> and <dest-names> are identifiers that
# should match [a-zA-Z0-9._-]+, <source-url> should be a
# URL that points to a directory containing a Familiar
# Packages file, and <target-path> should be a directory
# that exists on the target system.
src custom-package ftp://localhost/ipkg
#src familiar-unstable http://familiar.handhelds.org/familiar/feeds/unstable/packages/armv4l
dest root /usr/local/
dest ram /usr/local/apps/ipkg/ram
dest ext /usr/local/apps/ipkg/ext
--- End code ---
In order to correctly install a .ipk file therefore, one can type from the shell:
--- Code: ---ipkg-cl -f /usr/local/etc/ipkg.conf -d root install myPackage.ipk
--- End code ---
This command can usefully be included into a script that can be called from dmenu, in order to create an "install package" entry.
--- Code: ---#!/bin/sh
ipkg-cl -f /usr/local/etc/ipkg.conf -d root install $1
--- End code ---
Ok, so now we could install every .ipk package we want, if only said package would exist...
In order to create packages, developers have to download and install ipkg-utils from here:
http://handhelds.org/download/packages/ipkg-utils/
Once the package is correctly installed into your linux (or cygwin) machine you can create .ipk packages from a directory tree using the ipkg-build tool.
The structure of the directory is described here:
http://handhelds.org/moin/moin.cgi/BuildingIpkgs
In addition, I created a demo package that installs a script (install.sh) that allows to install other ipk packages, and adds the relative entry to the Base theme of dmenu (and eventually removes it when the package is removed). In attachment, the archive (.zip) that contains the example directory tree, and the .ipk package that results (I had to rename them as .pdf to match requirements of the allowed filetypes).
EDIT:
I report here the little code snippets i wrote to modify dmenu config files, that are supposed to be used as guidelines. The first is called postinst and will be executed by ipkg after it will have copied the files.
--- Code: ---#!/bin/sh
CFG=/usr/local/dmenu/themes/Base/menu_system.cfg
TMP=/usr/local/dmenu/themes/Base/menu_system.tmp
BAK=/usr/local/dmenu/themes/Base/menu_system.bak
sed '$i \
MenuItem Install\
{\
Icon = "/usr/local/dmenu/themes/Base/res/install.png"\
Name = " install"\
Executable = "/usr/local/dmenu/scripts/install.sh"\
WorkDir = "/usr/local/"\
Selector = yes\
}\
' $CFG > $TMP
mv $CFG $BAK
mv $TMP $CFG
# is there a more clever way to remove the installed .ipk file?
rm $PKG_ROOT/install_0.1_mipsel.ipk
# this is needed to avoid filesystem corruption if dingoo isn't shut down properly
sync
exit 0
--- End code ---
This second one is called postrm, and will be executed by ipkg after the package is removed.
--- Code: ---#!/bin/sh
CFG=/usr/local/dmenu/themes/Base/menu_system.cfg
TMP=/usr/local/dmenu/themes/Base/menu_system.tmp
BAK=/usr/local/dmenu/themes/Base/menu_system.bak
sed '/MenuItem Install/,/}/ d' $CFG > $TMP
mv $CFG $BAK
mv $TMP $CFG
# this is needed to avoid filesystem corruption if dingoo isn't shut down properly
sync
exit 0
--- End code ---
Both those scripts have to go under the CONTROL subdirectory of the directory tree.
SUMMARY
Main Features:
- A list of the installed packages can be obtained by typing:
--- Code: ---ipkg-cl list
--- End code ---
- An installed package can be removed by typing:
--- Code: ---ipkg-cl remove pkgName
--- End code ---
Future developments:
-It would be great if someone wrote a gui app to remove an installed package
-*In theory* ipkg should allow to install packages from a remote (aka web) repository, but since I wasn't able to download anything with wget, I suppose that ipkg won't work too. Probabilly the host pc has to be configured as a proxy or something. I hope that someone can explain how to reach the internet from our dingux boxes ;-).
EDIT: zear told me how to get in touch with the WWW (thanks zear! ;-) )... still hadn't time to try, but I assume it will work flawlessly since many have reported using. Instructions here:
http://boards.dingoonity.org/dingux-general/connect-to-the-dingoo-with-telnet/
BTW: an internet install GUI would also be nice!
athlon4011:
:o :o :o :o
this would be amazing if we could fully adopt this. I know toddler's packages help everyone, but this would make it very simple for anyone to update said application or install a new one. Even possibly update the rootfs and a appropriate zimage. Cant test it right now cuz im at work, but im interested in seeing this fully adopted. A lot of people won't get this. but if anyone could make a screenplay or play by play screen shot. This would help others put their hands in to help.
Goon:
Do want!
Connecting to the internet and downloading the latest packages would be amazingly awesome!
Will definitely try and wrap my head around the package manager, hopefully someone can make a GUI for it!
bmg002:
That link you posted (http://boards.dingoonity.org/dingux-general/connect-to-the-dingoo-with-telnet/) doesn't allow you to go on the internet. It allows a telnet/ftp connection between your PC and your dingux. Although, I believe in windows you could bridge your two ethernet controllers (real and dingux) and you should be able to have internet access through your dingux. Linux should have a similar method, but I have not played with it enough to find out. And with windows you get 5 minute max (from my exp) then the connection seems to die. Dingux is still stable and windows is still stable, but the communication between the two seems to die.
The Gh0ce_>0
remax:
Same for me
Navigation
[0] Message Index
[#] Next page
Go to full version