kvmx_sudo_run mount ${device}${partition_prefix}2 $WORK/
# Trap $WORK umount
- trap 'if [ -e "$WORK" ]; then umount $WORK/{sys,proc,dev} &> /dev/null; umount $WORK &> /dev/null; rmdir $WORK; fi' INT TERM
+ trap 'if [ -e "$WORK" ]; then umount $WORK/{sys,proc,dev} &> /dev/null; umount $WORK &> /dev/null; rmdir $WORK; fi' INT TERM EXIT
# Non-interactive installation
- APT_INSTALL="LC_ALL=C DEBIAN_FRONTEND=noninteractive kvmx_sudo_run chroot $WORK/ apt-get install -y"
+ #APT_INSTALL="LC_ALL=C DEBIAN_FRONTEND=noninteractive kvmx_sudo_run chroot $WORK/ apt-get install -y"
+ #APT_INSTALL="kvmx_sudo_run LC_ALL=C DEBIAN_FRONTEND=noninteractive chroot $WORK/ apt-get install -y"
+ APT_INSTALL="kvmx_sudo_run chroot $WORK/ /usr/bin/env -- LC_ALL=C DEBIAN_FRONTEND=noninteractive /usr/bin/apt-get install -y"
# Initial system install.
echo "Installing base system..."