[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: How to correctly pass filename to dchroot



hi,

I recently installed Debian on a new 64 bit laptop. As I also like to
run OpenOffice, I installed a 32 bit chroot. With a simple 'dchroot -d
oowriter', I can now start Writer.

I'd like to be able to simply click a file on my Gnome desktop. It's
easy to tell Gnome to run 'dchroot -d oowriter', but I cannot tell it
how to pass the filename. The problem is that, if I have a file with
name 'test test.doc', I can open it by running 'dchroot -d oowriter
"test\ test.doc'. The following methods don't work:
dchroot -d oowriter test test.doc
dchroot -d oowriter test\ test.doc
dchroot -d oowriter "test test.doc"

I expect that I'm not the only one with this problem, so how did others
solve it? Or should I be asking aroung on a Gnome list?
i'd recommend bind mounting the filesystem/directory where these files are located to your chroot (example if it is home directory):
put the following line to your /etc/fstab (modify to fit your setup)
/home   /var/chroot/ia32/home none  bind        0 0

then files should be accessible in chroot. for the parameter passing, follow the instructions in the amd64 howto:

create a script called e.g. do_chroot in your /usr/local/bin (modify accordigly)

------------------------
#!/bin/bash
# execute application from chroot in a way that is transparent to the user

ARGS=""
for i in "$@" ; do
  ARGS="$ARGS '$i'"
done

exec dchroot -c ia32 -d -q "`basename $0`" "$ARGS"
------------------------

now, create symlinks in /usr/local/bin for all programs you execute from the chroot, i.e.

ln -s do_chroot oowriter
ln -s do_chroot oocalc

put /usr/local/bin to your path. now, executing oowriter filename should do the trick. you should now be able to set it up in gnome or whatever you want...

regards,

--
Lubos
_@_"



Reply to: