Author Topic: Advanced IPK scripts  (Read 2597 times)

lardman

  • Hero Member
  • *****
  • Posts: 4512
    • View Profile
    • http://people.bath.ac.uk/enpsgp/Zaurus/
Advanced IPK scripts
« on: March 04, 2004, 05:07:34 am »
I\'m trying to create a package for the usb-storage module and scripts.

I plan to use the postinst (probably) to decide whether or not to install a certain module (for example if I\'m installing on a machine with a PXA processor it won\'t need the sa1100_bi module.

What\'s the best way to do this? Can I just not install it, or do I have to install it then delete it in the postinst script?

Along the same lines but more complicated, if I needed to replace a script on only one machine how would I do this? Create a copy in the preinst, then have ipkg overwrite it, then copy the copy back over the one ipkg has extracted using the postinst script?

There are obviously ways and means, but is this the way things are done?

Is there a web site which describes this sort of thing (prsumably for debian dpkg).

Another quick one, is there a quick and easy way to differentiate between machines. Processor is probably fairly easy (look in /proc/cpuinfo), what about ROM type, do I just have to find a file which exists on one and not another?

Cheers,


Si
C750 OZ3.5.4 (GPE, 2.6.x kernel)
SL5500 OZ3.5.4 (Opie)
Nokia 770
Serial GPS, WCF-12, Socket Ethernet & BT, Ratoc USB
WinXP, Mandriva

raybert

  • Full Member
  • ***
  • Posts: 233
    • View Profile
Advanced IPK scripts
« Reply #1 on: March 04, 2004, 11:28:31 am »
Might be easier/safer to install the script with an alternate name (e.g. myscript-alt) and then, in postinst, when needed, rename and overwrite the one to be replaced with a single mv.

Google on \"debian-binary\" and you\'ll get lots of hits on ipkg docs.  I\'ve found that most of them though are a bit superficial.

While we\'re on the subject of IPK building, I\'m having a problem with one that someone may be able to help me with.  I\'m trying to make an IPK to update Opera 7 for the cseries devices (replace icons with bigger ones and create the missing symlink that is tripping everyone up).  When I try installing it ipkg gets a segmentation fault and claims that preinst failed.  So I created a simple test IPK to experiment with this and I\'m getting the same problem.  I can\'t see why it\'s happening.  The scripts are all 777 root:root and I double checked that there are no carriage-returns (although I\'m not sure CRs would cause a problem).  My preinst looks like this:

Code: [Select]
#/bin/sh

echo "preinst running..."

echo "preinst" >> /home/zaurus/foopk.log

exit 0


The output from ipkg looks like this:

Code: [Select]
[bivalve]# ipkg install foopk_1.0_arm.ipk

Unpacking foopk...Done.

Configuring foopk...Segmentation fault

//usr/lib/ipkg/info/foopk.preinst failed. Aborting installation of foopk

[bivalve]#


Any ideas?

~ray