Lets do one more and see what might go wrong.
I will do debians
file
(
apt-get install file inside debian if you don't have it)
(mount the ext.3 if it isn't already)
[root@kindle bin]#
mount -o loop=/dev/loop/debian,noatime -t ext3 /mnt/base-us/debian.ext3 /mnt/debian
okay good to go
[root@kindle bin]#
filechecker /mnt/debian/usr/bin/file
Quote:
copying /mnt/debian/usr/bin/file to /mnt/us/export/file/bin/file
Searching 937 user libs, 85 libs, 17 extended dirs
Export complete at /mnt/us/export/file ensure you run file like: cd /mnt/us/export/file/bin; LD_LIBRARY_PATH=../lib:$LD_LIBRARY_PATH ./file
|
let's test it
[root@kindle bin]#
cd /mnt/us/export/file/bin; LD_LIBRARY_PATH=../lib:$LD_LIBRARY_PATH ./file ./file
Quote:
/etc/magic, 0: Warning: using regular magic file `/usr/share/misc/magic'
file: could not find any magic files!
|
ro ro! it don't work!!!
let's just hack the resources on to the root (they are tiny)
[root@kindle bin]#
mntroot rw
[root@kindle bin]#
mkdir -p /usr/share/misc/magic/
[root@kindle bin]#
cp /mnt/debian/usr/share/misc/magic.mgc /usr/share/misc/magic.mgc
[root@kindle bin]#
mntroot ro
and test it again
[root@kindle bin]#
cd /mnt/us/export/file/bin; LD_LIBRARY_PATH=../lib:$LD_LIBRARY_PATH ./file ./file
Quote:
./file: ELF 32-bit LSB executable, ARM, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.26, BuildID[sha1]=0xb47ce3b5fc4138f5cc958deeeabeab1b1bb782a5, stripped
|
sweet. so yeah - that is the kind of thing that might go wrong.
not
too tricky all in.
no doubt there will be cases where walking the required resource tree would be nice. parse a strace log maybe? : D
sed would have been a better solution for accessing the resources on the FAT drive.
patching the file binary to accept the new location
Anyways - hope this helps other forgetful developers.
HOW DO I MAKE INSTALL???
on my system (where my PATH includes /mnt/us/usr/bin and /mnt/us/usr/lib
by default) to do a "make install" I would just
[root@kindle bin]#
cp -r /mnt/us/export/file/* /mnt/us/usr/
where file is the name of the exported application. You could do something similar