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

sbuild --chroot-mode=autopkgtest: How to get an interactive shell?



A while ago, I reported #948705 against sbuild, where
--build-failed-commands '%SBUILD_SHELL' just hung on input.

I looked into this again, and my suspicion is that the autopkgtest
maintainers might more be suited to solve this.

Issue
-----

The issue, I think, is quite simple:

    --finished-build-commands '%SBUILD_SHELL'

is supposed to execute a shell within the target environment. However,
when using --chroot-mode=autopkgtest, the build just hangs on input.


Initial analysis
-----------------

By default, %SBUILD_SHELL expands to

    bash -i </dev/tty >/dev/tty 2>/dev/tty

Running sbuild in -D mode, this command is executed as

    /home/christian/tmp/autopkgtest-qemu.p2nl2yly/runcmd env
LANG=en_US.utf8 LC_ALL=C.UTF-8 SHELL=/bin/sh LC_TIME=de_AT.UTF-8
APT_CONFIG=/var/lib/sbuild/apt.conf HOME=/sbuild-nonexistent sh -c cd
/<<BUILDDIR>> && exec "$@" exec /bin/sh -c bash -i </dev/tty >/dev/tty
2>/dev/tty

So $TMP/autopkgtest-qemu.xxxxxxxx/runcmd is used to execute commands in
the guest.

Now if I understand this correctly, runcmd is a helper that, at first
glance, was designed for one-shot commands, rather than interactive
commands, so no matter what I feed to --finished-build-commands, it's
not possible to get interactive shell.

Do you concur on my initial assessment? If so, what possible solutions
do you see to this?


Christian



Reply to: