Here is an update to make the whole do_dchroot process easier.
Code:
#!/bin/sh
args="`echo $0 | perl -e '$_=<>; s/^.*\/(.*?)(32)?$/\1/; print; '`"
for arg; do
args="$args `echo $arg | sed 's|\([^-_a-zA-Z0-9]\)|\\\\\1|g'`"
done
if [ -e /usr/bin/linux32 ]; then
/usr/bin/linux32 /usr/bin/dchroot -d "$args"
else
/usr/bin/dchroot -d "$args"
fi
Because of the change in do_dchroot step five becomes simpler:
- dchroot -d
- sudo apt-get install synaptic
- sudo ln -s /usr/sbin/synaptic /usr/sbin/synaptic32 (DELETE, NO LONGER NEEDED)
- exit
- sudo ln -s /usr/local/bin/do_dchroot /usr/local/bin/synaptic32
- sudo synaptic32
This is a small change to the regex to allow this. This makes one assumption, the 64 bit program is not visible from within the 32bit chroot - which would make sense, after all we just spent all that time making a seperate area for the 32 bit programs! If there is no 32 at the end of the name it will ignore it and try and launch the program in the chroot anyway. The corrected handling of 32 required a non-greedy operator which I don't think seds can do (which is why it now uses perl).
I also added a check for linux32 for those that need to do compiling in the chroot, this should automatically run the chroot with linux32 in front if it exists.
Bookmarks