Re: small fix for Debian AMD64 HowTo
Bob Proulx wrote: > Sebastian Kuegler wrote: >> exec dchroot -c ia32 -d "$(basename $0) $@ >>^ >> So the command with arguments gets passed into the chroot, rather than be >> interpreted as arguments of the dchroot program. > > I am sure you meant to include the final " on the end of that line. Yes, typo. :> > Actually the problem is the additional interpretation by 'su' in the > chroot. So it is the 'su' command that is seeing the option. > > There is a subtle difference between "$@" and "$*". The first quotes > all arguments individually and the second groups them all together. > Normally shell scripts should use "$@" to preserve arguments exactly > when passing them allong in wrappers. But due to a deficiency in > dchroot this does not work. > > I am thinking the following is really what you were trying to say. > But actually I don't like it. I would rather see dchroot improved > intead. Of course, fixing dchroot would be nicer. Having this worked around in the meantime is also a good thing (tm) of course. > exec dchroot -c ia32 -d "$(basename $0) $*" Works, indeed. The following (suggested to me in private email) does also work: exec dchroot -c ia32 -d "$(basename $0)" -- "$@" Thanks for the suggestions! > Bob sebas -- http://vizZzion.org == Your conscience never stops you from doing anything. It just stops you from enjoying it.
small fix for Debian AMD64 HowTo
Hi, I just followed the AMD64 howto [1] on installing a chroot ia32 environment, which lead me with a working setup. Thanks for this. However, there's one minor problem I had: The script do_chroot as suggested on the webpage didn't work for me when a command was given with paramters. I could fix this by changing exec dchroot -c ia32 -d "$(basename $0)" "$@" ^^^ to: exec dchroot -c ia32 -d "$(basename $0) $@ ^ So the command with arguments gets passed into the chroot, rather than be interpreted as arguments of the dchroot program. Maybe someone can fix this minor problem of an otherwise really helpful howto. (Is this the good place to post this, btw? :-)) [1] https://alioth.debian.org/docman/view.php/30192/21/debian-amd64-howto.html Cheers, -- sebas - - - - - - - - - - - http://vizZzion.org == Do you guys know what you're doing, or are you just hacking?