Hello, I had some hope that providing live-debconfig in wheezy-backports would make it possible to use the lxc-debconf template shipped in wheezy's lxc with only minor modifications (cf attached debdiff) but the result is far from satisfactory with the user being asked lots of useless questions and the resulting container is not really usable (at least when you pick the default answers to the questions).
I suggest to just stop using lxc-debconf and prepare an update that restores the upstream script, possibly grabbed from a newer lxc to have the required fixes. Cheers, -- Raphaël Hertzog ◈ Debian Developer Discover the Debian Administrator's Handbook: → http://debian-handbook.info/get/
diff -Nru lxc-0.8.0~rc1/debian/changelog lxc-0.8.0~rc1/debian/changelog --- lxc-0.8.0~rc1/debian/changelog 2012-08-22 20:44:12.000000000 +0000 +++ lxc-0.8.0~rc1/debian/changelog 2013-12-16 07:53:55.000000000 +0000 @@ -1,3 +1,11 @@ +lxc (0.8.0~rc1-8+deb7u2) wheezy; urgency=medium + + * Non-maintainer upload. + * Modify lxc-debconf to require wheezy-backports or squeeze-backports-sloppy + since the missing live-debconfig is now available there. Closes: #680469 + + -- Raphaël Hertzog <[email protected]> Mon, 16 Dec 2013 08:51:43 +0100 + lxc (0.8.0~rc1-8+deb7u1) wheezy; urgency=low * Non-maintainer upload. diff -Nru lxc-0.8.0~rc1/debian/local/lxc-debconf lxc-0.8.0~rc1/debian/local/lxc-debconf --- lxc-0.8.0~rc1/debian/local/lxc-debconf 2012-06-30 12:06:33.000000000 +0000 +++ lxc-0.8.0~rc1/debian/local/lxc-debconf 2013-12-16 09:53:20.000000000 +0000 @@ -113,6 +113,10 @@ ${_PARENT_DIST}-backports) echo "deb ${_PARENT_MIRROR_BACKPORTS} ${_PARENT_DIST}-backports ${_PARENT_AREA}" >> "${_ROOTFS}/etc/apt/sources.list.d/debian.list" + if [ "${_PARENT_DIST}" = "squeeze" ]; then + # -sloppy is needed for live-debconfig + echo "deb ${_PARENT_MIRROR_BACKPORTS} ${_PARENT_DIST}-backports-sloppy ${_PARENT_AREA}" >> "${_ROOTFS}/etc/apt/sources.list.d/debian.list" + fi ;; ${_PARENT_DIST}-proposed-updates) @@ -226,54 +230,64 @@ Chroot "${_ROOTFS}" "DEBIAN_FRONTEND=noninteractive DEBIAN_PRIORITY=criticial dpkg-reconfigure tzdata" fi - # Install additional packages - if [ -n "${_PACKAGES}" ] - then - Chroot "${_ROOTFS}" "apt-get --yes install ${_PACKAGES}" - fi - # Install live-config - if ls /usr/share/lxc/packages/live-config*.deb > /dev/null 2>&1 + if ls /usr/share/lxc/packages/live-debconfig*.deb > /dev/null 2>&1 then # Install local live-config package - for _PACKAGE in /usr/share/lxc/packages/live-config-*_*.deb /usr/share/lxc/packages/live-config_*.deb + for _PACKAGE in /usr/share/lxc/packages/live-debconfig-*_*.deb /usr/share/lxc/packages/live-debconfig_*.deb do cp -L ${_PACKAGE} "${_ROOTFS}" - Chroot "${_ROOTFS}" "dpkg -i $(basename ${_ROOTFS}/live-config*.deb)" - rm -f "${_ROOTFS}"/live-config*.deb + Chroot "${_ROOTFS}" "dpkg -i $(basename ${_ROOTFS}/live-debconfig*.deb)" + rm -f "${_ROOTFS}"/live-debconfig*.deb done else # Install remote live-config package - Chroot "${_ROOTFS}" "apt-get install --yes live-config" + Chroot "${_ROOTFS}" "apt-get install --yes live-debconfig" fi - # Initialize live-debconfig debconf database - Chroot "${_ROOTFS}" "live-debconfig --noscripts" - # Preseed live-debconfig if [ -e "${_PRESEED_FILE}" ] then cat "${_PRESEED_FILE}" > "${_ROOTFS}/preseed.cfg" - - Chroot "${_ROOTFS}" "DEBCONF_SYSTEMRC=/var/lib/live/debconfig/systemrc debconf-set-selections preseed.cfg" - - rm -f "${_ROOTFS}/preseed.cfg" fi - # Run live-debconfig - Chroot "${_ROOTFS}" "live-debconfig" - - # Configure user-setup + cat >>"${_ROOTFS}/preseed.cfg" <<END +# multiselect +live-debconfig live-debconfig/components multiselect hostname, ifupdown, util-linux, rsyslog, selinux, openssh-server + +# passwd +live-debconfig live-debconfig/passwd/root-password string ${_ROOT_PASSWORD} +live-debconfig live-debconfig/passwd/root-password-again string ${_ROOT_PASSWORD} + +# ifupdown +live-debconfig live-debconfig/ifupdown/lo-enable boolean false + +# util-linux +live-debconfig live-debconfig/util-linux/hwclockaccess boolean false + +# rsyslog +live-debconfig live-debconfig/rsyslog/imklog boolean false + +# selinux +live-debconfig live-debconfig/selinux/enable boolean false +END + Chroot "${_ROOTFS}" "live-debconfig-set-selections preseed.cfg" + rm -f "${_ROOTFS}/preseed.cfg" -cat > "${_ROOTFS}/preseed.cfg" << EOF -user-setup passwd/root-password string ${_ROOT_PASSWORD} -user-setup passwd/root-password-again string ${_ROOT_PASSWORD} -EOF + # Run live-debconfig (first pass) + Chroot "${_ROOTFS}" "DEBIAN_FRONTEND=${_DEBCONF_FRONTEND:-dialog} DEBIAN_PRIORITY=${_DEBCONF_PRIORITY:-high} live-debconfig" - Chroot "${_ROOTFS}" "debconf-set-selections preseed.cfg" - Chroot "${_ROOTFS}" "/usr/lib/user-setup/user-setup-apply" + # Install additional packages + if [ -n "${_PACKAGES}" ] + then + Chroot "${_ROOTFS}" "apt-get --yes install ${_PACKAGES}" + fi - rm -f "${_ROOTFS}/preseed.cfg" + # Run live-debconfig (second pass) + if [ -x "${_ROOTFS}/bin/live-debconfig" ] + then + Chroot "${_ROOTFS}" "DEBIAN_FRONTEND=noninteractive DEBIAN_PRIORITY=criticial live-debconfig" + fi case "${_ROOT_RANDOM_PASSWORD}" in true) diff -Nru lxc-0.8.0~rc1/debian/local/lxc-debconf.d/03-debconf lxc-0.8.0~rc1/debian/local/lxc-debconf.d/03-debconf --- lxc-0.8.0~rc1/debian/local/lxc-debconf.d/03-debconf 2012-06-30 12:07:18.000000000 +0000 +++ lxc-0.8.0~rc1/debian/local/lxc-debconf.d/03-debconf 2013-12-16 09:07:11.000000000 +0000 @@ -157,6 +157,16 @@ _ARCHIVES="$(echo ${_ARCHIVES} | sed -e 's|, | |g')" + # Force usage of -backports for squeeze/wheezy that don't have + # the required live-debconfig (but where backports has it, see + # #680469) + if ! echo "${_ARCHIVES}" | grep -q "${_DISTRIBUTION}-backports"; then + case "${_DISTRIBUTION}" in + squeeze|wheezy) + _ARCHIVES="${_ARCHIVES} ${_DISTRIBUTION}-backports" + esac + fi + echo "_ARCHIVES=\"${_ARCHIVES}\"" >> "${_TMPDIR}/debconf.default" export _ARCHIVES } @@ -310,7 +320,11 @@ then case "${_MODE}" in debian) - db_set lxc-debconf/mirror-backports http://backports.debian.org/debian-backports/ + if [ "${_DISTRIBUTION}" = "squeeze" ]; then + db_set lxc-debconf/mirror-backports http://backports.debian.org/debian-backports/ + else + db_set lxc-debconf/mirror-backports ${_MIRROR} + fi db_fset lxc-debconf/mirror-backports seen false ;;

