#!/usr/bin/env xdg-open [Desktop Entry] Encoding=UTF-8 Name=OpenOffice GenericName=OpenOffice Exec=ubuntu openoffice.org Icon=ooo-gulls X-Osso-Type=application/x-executable X-HildonDesk-ShowInToolbar=true Terminal=true Type=Application StartupNotify=true
| The Following User Says Thank You to deny_winarto For This Useful Post: | ||
| The Following User Says Thank You to juandp77 For This Useful Post: | ||
#!/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
#!/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 "$@"
~ $ 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 ~ $
sudo nano /usr/bin/ubuntu
if [ "x$UBUNTUIMG" = "x" ] ; then UBUNTUIMG="`ls -1 /media/mmc1/ubuntu*.img* | head -1`" fi if [ "x$UBUNTUCHROOT" = "x" ] ; then UBUNTUCHROOT="/.ubuntu" fi if [ ! -d "$UBUNTUCHROOT" ] ; then sudo mkdir $UBUNTUCHROOT fi sudo qchroot $UBUNTUIMG $UBUNTUCHROOT "$@"
sudo chmod +x /usr/bin/ubuntu
| The Following User Says Thank You to juandp77 For This Useful Post: | ||
sudo nano /usr/bin/ubuntu
if [ "x$UBUNTUIMG" = "x" ] ; then UBUNTUIMG="`ls -1 /media/mmc1/ubuntu*.img* | head -1`" fi if [ "x$UBUNTUCHROOT" = "x" ] ; then UBUNTUCHROOT="/.ubuntu" fi if [ ! -d "$UBUNTUCHROOT" ] ; then sudo mkdir $UBUNTUCHROOT fi sudo qchroot $UBUNTUIMG $UBUNTUCHROOT "$@"
sudo chmod +x /usr/bin/ubuntu
