View Single Post
Posts: 249 | Thanked: 47 times | Joined on Apr 2010
#247
Originally Posted by juandp77 View Post
@qole: thanks to your image and your instructions i could start building this, so thanks a lot for that, I see this like a proof that we could do amazing things with the n900

@deny_winarto: debbie file its a script that uses debian.img.ext2, it doesn't have anything to do with ubuntu, so if you change it you will be changing debian, not ubuntu. You are having so many troubles, maybe you have your device overloaded with so many things, have you experimented some others issues besides the problems with ubuntu
If i'm not mistaken the "ubuntu" in

exec=ubuntu openoffice.org

points to the "ubuntu" file in /usr/bin?
Which doen't exist when i look for it in filebox

So i created a new ubuntu file using gnu nano in /usr/bin by modifying qole's script a bit

Code:
#!/bin/sh
# Chroots to Debian and runs a shell, or any command-line as non-root.

# By Alan M Bruce (qole), Benson Mitchell and Thomas Perl
#
# GPL licensed; keep code free!

if [ "`whoami`" = "root" ] ; then
  echo "please don't run me as root!"
  exit 9
fi

#Pull in the config, if possible...
[ -f /home/user/.chroot ] && . /home/user/.chroot

#This comes from the config file... If not, fall back on 'user'
#[ "x$DEBUSER" != x ] || DEBUSER=user
DEBUSER=$USER

CHROOTUSER=$DEBUSER

#If display's not given, go to primary display. If it's set, let's not
#mangle it to allow convenient use of USB VGA out, or multiple Xomaps.
[ "x$DISPLAY" != x ] || export DISPLAY=:0.0

#This enables long-hold-to-right-click in all GTK+ apps.
#Maybe we'd be better to add libgtkstylus.so anyway, but for now, we'll
#just leave it if they've got any non-empty GTK_MODULES 
[ "x$GTK_MODULES" != x ] || export GTK_MODULES=libgtkstylus.so

#Note use of su below, so no Debian-side script req'd to drop privileges.
#With no args, use a shell; su will get the right one, with no -c
#With args, just run them as $DEBUSER.

if [ $# = 0 ] ; then
  echo Starting Ubuntu shell... >/dev/stderr
  sudo /sbin/ubuntu su $DEBUSER
else
  # Workaround to allow "debbie" to be used as login shell
  if [ "$1" == "-c" ]; then
    shift
  fi
  echo Starting Ubuntu $* >/dev/stderr
  sudo /sbin/ubuntu su $DEBUSER -c "$*"
fi
And apparently the script also points to an ubuntu (or debian in the original script)file in /sbin which doesn' exist as well. so i created it by modifying the debian script found in the same folder.

Code:
#!/bin/sh
# Sets up (if necessary) for chroot into a Debian 
environment.
# Expects root privileges, does not drop them. 
# Look to /usr/bin/debbie for a friendly wrapper.

# By Alan M Bruce (qole) with help from Benson 
Mitchell and Thomas Perl
#
# GPL licensed; keep code free!

if [ "`whoami`" != "root" ] ; then
  echo "please run me as root!"
  exit 9
fi

#Pull in the config, if possible...
if [ -f "/home/user/.chroot" ] ; then

. /home/user/.chroot

else
  echo "No ~/.chroot file." >/dev/stderr
fi

#This comes from the config file... If not, fall back 
on '/debian'
if [ "x$CHROOT" = "x" ] ; then
  CHROOT=/.ubuntu
  echo "No chroot dir specified; using $CHROOT" 
>/dev/stderr
else
  echo "Chroot dir specified: $CHROOT" >/dev/stderr
fi

#This comes from the config. If not, search for 
ubuntu*.img.ext2
if [ "x$IMGFILE" = "x" ] ; then
  echo "No image file or partition specified." 
>/dev/stderr
  IMGMMC="`ls -1 /home/user/ubuntu*.img* 
/media/mmc1/ubuntu*.img* | head -1`"
  if [ "x$IMGMMC" != x ] ; then
    IMGFILE="$IMGMMC"
  else
    MSG1=`printf "ERROR!\n\nYou have no 
ubuntu.img.ext2 file on your memory cards.\n\nPlease 
use the Debian Image Installer in Extras."`
    if [ ! -f "/usr/bin/gxmessage" ] ; then
      echo $MSG1 >/dev/stderr
    else
      gxmessage -center -alignbuttons center -buttons 
GTK_STOCK_OK:0 -geometry 680x250 -title "MISSING DISK 
IMAGE" "$MSG1"
    fi
    exit 9
  fi
else
  echo "$IMGFILE specified in ~/.chroot" >/dev/stderr
fi

#
#Make the temp dir bigger for OpenOffice etc.
#
#This comes from the config file... 
#If not, fall back to a 6MB /tmp dir
#

[ "x$TMPSIZE" != x ] || TMPSIZE=6M
mount -o remount,size=$TMPSIZE /tmp

#Messy hack to make tap-and-hold work with GTK apps.
export GTK_MODULES=libgtkstylus.so

#Some OpenOffice environment variables
export SAL_USE_VCLPLUGIN="gtk"
export OOO_FORCE_DESKTOP="gnome"
export SAL_NOOPENGL="true"
export OOO_DISABLE_RECOVERY="true"
export 
SAL_DISABLE_SYNCHRONOUS_PRINTER_DETECTION="true"
#export SAL_DISABLE_CUPS="true"

qchroot $IMGFILE $CHROOT "$@"
I tried running it in x-terminal and this is what i got :

Code:
~ $ ubuntu openoffice.org
Starting Ubuntu openoffice.org
/sbin/ubuntu: line 3: environment.: not found
/sbin/ubuntu: line 8: Mitchell: not found
/sbin/ubuntu: line 27: on: not found
Chroot dir specified: /.debian
/sbin/ubuntu: line 37: ubuntu*.img.ext2: not found
No image file or partition specified.
ls: /home/user/ubuntu*.img*: No such file or directory
/sbin/ubuntu: line 60: /media/mmc1/ubuntu-m5-v1.img.ext2: Permission denied
/sbin/ubuntu: line 60: GTK_STOCK_OK:0: not found
~ $ sudo chmod +x /media/mmc1/ubuntu-m5-v1.img.ext2
~ $ ubuntu openoffice.org
Starting Ubuntu openoffice.org
/sbin/ubuntu: line 3: environment.: not found
/sbin/ubuntu: line 8: Mitchell: not found
/sbin/ubuntu: line 27: on: not found
Chroot dir specified: /.debian
/sbin/ubuntu: line 37: ubuntu*.img.ext2: not found
No image file or partition specified.
ls: /home/user/ubuntu*.img*: No such file or directory
/sbin/ubuntu: line 60: /media/mmc1/ubuntu-m5-v1.img.ext2: Permission denied
/sbin/ubuntu: line 60: GTK_STOCK_OK:0: not found
~ $ sudo chmod 777 /media/mmc1/ubuntu-m5-v1.img.ext2
~ $ ubuntu openoffice.org
Starting Ubuntu openoffice.org
/sbin/ubuntu: line 3: environment.: not found
/sbin/ubuntu: line 8: Mitchell: not found
/sbin/ubuntu: line 27: on: not found
Chroot dir specified: /.debian
/sbin/ubuntu: line 37: ubuntu*.img.ext2: not found
No image file or partition specified.
ls: /home/user/ubuntu*.img*: No such file or directory
/sbin/ubuntu: line 60: /media/mmc1/ubuntu-m5-v1.img.ext2: Permission denied
/sbin/ubuntu: line 60: GTK_STOCK_OK:0: not found
~ $
As you can see i also tried to chmod the /media/mmc1/ubuntu-m5-v1.img.ext2:
but i still get permission error, what did i miss here?

Last edited by deny_winarto; 2010-12-14 at 02:06.