Help - Search - Members - Calendar
Full Version: Install To Sd Or Cf - Ipkg Preinst/postinst
OESF Portables Forum > General Forums > General Discussion
dhns
Dear all hardcore developers,
I am trying to use the ipk preinst/postinst scripts to verify the file system type before allowing to install (I need to install some symbolic links).

What I could not yet find out is how a script can differentiate if it is being installed to
* Internal Flash
* CF Card
* SD Card
by the Qtopia installer.

The variable $PKG_ROOT is set to / for the internal flash, but it is /home/tmp/ipkg/inst for both others. And there is no other environment variable in a preinst/postinst script telling the real device path.

Any help and ideas are appreciated (besides forcing all users dry.gif to install a better/different ipkg loader first).

Many thanks,
-- hns
lardman
Well, if you're using postinst, you will know the path of your files, so choose one (file) and look for it on all of the storage mediums it could be installed on (which isn't many on the Sharp ROMs).

What are you planning to do with the scripts? Symbolic links you say - what for?


Si
dhns
QUOTE(lardman @ Apr 13 2005, 11:19 AM)
Well, if you're using postinst, you will know the path of your files, so choose one (file) and look for it on all of the storage mediums it could be installed on (which isn't many on the Sharp ROMs).

That is a good idea! Have to think about. find / -name "myfile" -print would even traverse all the /mnt points... And would need just some seconds on a slow medium which ould by ok.

Unfortunately, installation is going to PKG_ROOT=/home/tmp/ipkg/inst first in internal flash until everything is ok, including the postinst scripts are completed.

So it seems not to work as intended. What I could do is to have two installers - one to select the destination and the second one to finally install sad.gif
QUOTE
What are you planning to do with the scripts? Symbolic links you say - what for?

I am installing a package that uses internally some symbolic links (dynamic libraries) - that I don't want to change to hard links or create copies of the files.
And the other thing is that I need some links from the root file system into the installed package.
And the last thing is that I have some suid root executables - which not all file systems can handle.

-- hns
lardman
QUOTE
I am installing a package that uses internally some symbolic links (dynamic libraries) - that I don't want to change to hard links or create copies of the files.


Yuo can include symlinks in the data.tar.gz - just make sure they are relative, not absolute.

QUOTE
And the other thing is that I need some links from the root file system into the installed package.
And the last thing is that I have some suid root executables - which not all file systems can handle.


You should be able to handle both of these once you find out where it's been installed with the looking-for-a-file method I reckon.

Have you looked inside the ipkg script? You may find that the -d switch info is contained in a variable which is available to the scripts. Then again, it might not be.


Si
dhns
QUOTE(lardman @ Apr 13 2005, 11:53 AM)
Yuo can include symlinks in the data.tar.gz - just make sure they are relative, not absolute.

That already works - as long as the file system supports it.
QUOTE
You should be able to handle both of these once you find out where it's been installed with the looking-for-a-file method I reckon.

That is done by chown & chmod in the postinst - but it needs to know the installation location.

Just a final - simple Idea. I could check if an SD card is inserted, check if it is capable of symbolic links and then install the links there.

-- hns
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2019 Invision Power Services, Inc.