View Single Post
Posts: 946 | Thanked: 1,650 times | Joined on Oct 2009 @ Germany
#688
Hi, I wrote the following script to install ipk packages on the /opt partition
(I have described how to resize it to 27GB on http://wiki.maemo.org/Repartitioning_the_flash).
install rootsh, preenv, binutils and tar-gnu and
as root, copy the script to /usr/sbin/ipkinstall
Code:
chmod +x /usr/sbin/ipkinstall
usage: call it with some arbitrary shortcut name and the ipk file location
Code:
root
ipkinstall foo /home/user/MyDocs/foo-1.0.ipk
the script
Code:
#!/bin/sh
# ipk installation script by titan v0.2
# requires the packages rootsh, preenv, binutils and tar-gnu
# packages are installed on eMMC in /home/user/games
# example: ipkinst foo /home/user/MyDocs/foo-1.0.ipk
if test $# -ne 2; then
  echo $0 name ipk-file
  exit 1
fi
if test "`id -u`" -ne 0; then
  echo error: $0 must be run as root
  exit 1
fi
name=$1
pkg=$2
dest=/home/user/games
mkdir -p $dest/$name
ar p $pkg data.tar.gz | gtar xz -C $dest/$name
mv $dest/$name/usr/palm/applications/*/* $dest/$name 
rm -rf $dest/$name/usr
exe=`grep "main" $dest/$name/appinfo.json | awk '{print $2;}' | sed 's/[ ",]//g'`
chmod +x $dest/$name/$exe
chown -R user.users $dest/$name/
export PREENV_ROOT=/opt/preenv
. $PREENV_ROOT/env.sh
exec sh -c "desktopgen $dest/$name/appinfo.json"

Last edited by titan; 2010-11-18 at 14:16. Reason: v0.2
 

The Following 2 Users Say Thank You to titan For This Useful Post: