Package: lxc Version: 0.7.5-13 Severity: wishlist Hi, Please see attached files for some minor fixes and feature proposals. Regards
-- System Information: Debian Release: 6.0.3 APT prefers stable APT policy: (500, 'stable') Architecture: amd64 (x86_64) Kernel: Linux 2.6.39-bpo.2-amd64 (SMP w/1 CPU core) Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8) Shell: /bin/sh linked to /bin/dash Versions of packages lxc depends on: ii debconf [debconf-2.0] 1.5.36.1 Debian configuration management sy ii libc6 2.11.2-10 Embedded GNU C Library: Shared lib ii libcap2 1:2.19-3 support for getting/setting POSIX. Versions of packages lxc recommends: ii debootstrap 1.0.26+squeeze1 Bootstrap a basic Debian system ii libcap2-bin 1:2.19-3 basic utility programs for using c Versions of packages lxc suggests: pn lxctl <none> (no description available) -- debconf information: lxc/shutdown: stop lxc/directory: /var/lib/lxc lxc/title: lxc/auto: true
>From 98f999af2ab4efa9378747ff57d7d5baf8c3df19 Mon Sep 17 00:00:00 2001 From: Marcus Osdoba <marcus.osd...@googlemail.com> Date: Sat, 10 Dec 2011 16:16:41 +0100 Subject: [PATCH 1/3] lxc-debconf: add possibility to choose target architecture To: buildr...@busybox.net useful for i386 32bit containers on amd64 hosts old architecture determiniation code is preserved for !amd64 hosts Signed-off-by: Marcus Osdoba <marcus.osd...@googlemail.com> --- debian/local/lxc-debconf | 27 +--------- debian/local/lxc-debconf.d/03-debconf | 61 +++++++++++++++++++++++ debian/local/lxc-debconf.d/03-debconf.templates | 8 +++ 3 files changed, 71 insertions(+), 25 deletions(-) diff --git a/debian/local/lxc-debconf b/debian/local/lxc-debconf index 021fdcf..d76d57f 100755 --- a/debian/local/lxc-debconf +++ b/debian/local/lxc-debconf @@ -389,31 +389,8 @@ Install_system () return 1 fi - # Code taken from debootstrap - if type dpkg > /dev/null 2>&1 && dpkg --print-architecture > /dev/null 2>&1 - then - _ARCHITECTURE="$(dpkg --print-architecture)" - elif type udpkg > /dev/null 2>&1 && udpkg --print-architecture > /dev/null 2>&1 - then - _ARCHITECTURE="$(udpkg --print-architecture)" - else - _ARCHITECTURE="$(arch)" - - case "${arch}" in - 686) - _ARCHITECTURE="i386" - ;; - - x86_64) - _ARCHITECTURE="amd64" - ;; - - ppc) - _ARCHITECTURE="powerpc" - ;; - esac - fi - + # _ARCHITECTURE is choosen in ncurses lxc-debconf script + echo "Checking cache download in ${_CACHE}/${_DISTRIBUTION}_${_ARCHITECTURE}... " if [ ! -e "${_CACHE}/${_DISTRIBUTION}_${_ARCHITECTURE}" ] diff --git a/debian/local/lxc-debconf.d/03-debconf b/debian/local/lxc-debconf.d/03-debconf index d585556..6dcbf1a 100755 --- a/debian/local/lxc-debconf.d/03-debconf +++ b/debian/local/lxc-debconf.d/03-debconf @@ -6,6 +6,66 @@ set -e . /usr/share/debconf/confmodule +Architecture () +{ + # Code taken from debootstrap + if type dpkg > /dev/null 2>&1 && dpkg --print-architecture > /dev/null 2>&1 + then + _autoarch="$(dpkg --print-architecture)" + elif type udpkg > /dev/null 2>&1 && udpkg --print-architecture > /dev/null 2>&1 + then + _autoarch="$(udpkg --print-architecture)" + else + _autoarch="$(arch)" + case "${_autoarch}" in + i686) + _autoarch="i386" + ;; + x86_64) + _autoarch="amd64" + ;; + ppc) + _autoarch="powerpc" + ;; + # FIXME: test sparc and ia64, armel and armhf should be determined via --print-architecture above + esac + fi + + db_get linux-container/architecture + _ARCHITECTURE="${RET}" # select + + if [ "${_autoarch}" = "amd64" ] + then + _choices_long="Intel/AMD 64bit \"amd64\", Intel/AMD 32bit \"i386\"" + _choices_short="amd64, i386" + fi + # armel on armhf? + + if [ -z "${_ARCHITECTURE}" -a -n "${_choices_short}" -a -n "${_choices_long}" ] + then + db_subst linux-container/architecture CHOICES ${_choices_long} + db_subst linux-container/architecture CHOICES_C ${_choices_short} + + db_settitle linux-container/title + db_input high linux-container/architecture || true + db_go + + db_get linux-container/architecture + _ARCHITECTURE="${RET}" # select + else + if [ -z "${_ARCHITECTURE}" ] + then + _ARCHITECTURE=${_autoarch} + else + echo "You have set the _ARCHITECTURE variable before launching this config script. Using your setting: ${_ARCHITECTURE}" + fi + fi + + echo "_ARCHITECTURE=\"${_ARCHITECTURE}\"" >> "${_TMPDIR}/debconf.default" + export _ARCHITECTURE +} + + Distribution () { db_get linux-container/distribution @@ -667,6 +727,7 @@ Internal_options () echo "_LATE_COMMAND=\"${_LATE_COMMAND}\"" >> "${_TMPDIR}/debconf.default" } +Architecture Distribution Parent_distribution diff --git a/debian/local/lxc-debconf.d/03-debconf.templates b/debian/local/lxc-debconf.d/03-debconf.templates index fee8260..ed5c17e 100644 --- a/debian/local/lxc-debconf.d/03-debconf.templates +++ b/debian/local/lxc-debconf.d/03-debconf.templates @@ -2,6 +2,14 @@ Template: linux-container/title Type: title Description: Linux Container (LXC) +Template: linux-container/architecture +Type: select +Default: +Choices-C: ${CHOICES_C} +Choices: ${CHOICES} +Description: Architecture + Architecture. + Template: linux-container/distribution Type: select Default: -- 1.7.2.5
>From cc84330c49fcd95703e401c30bcd5d2f8cb28ec2 Mon Sep 17 00:00:00 2001 From: Marcus Osdoba <marcus.osd...@googlemail.com> Date: Sat, 10 Dec 2011 16:19:55 +0100 Subject: [PATCH 2/3] lxc-debconf: propose a mac address instead of "br0" in mask To: buildr...@busybox.net Signed-off-by: Marcus Osdoba <marcus.osd...@googlemail.com> --- debian/local/lxc-debconf.d/03-debconf | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/debian/local/lxc-debconf.d/03-debconf b/debian/local/lxc-debconf.d/03-debconf index 6dcbf1a..4ea0b90 100755 --- a/debian/local/lxc-debconf.d/03-debconf +++ b/debian/local/lxc-debconf.d/03-debconf @@ -654,7 +654,7 @@ Network () if [ -z "${LINUX_CONTAINER_ETH0_MAC}" ] then # FIXME: do guess the default mac address - db_set linux-container/eth0/mac br0 + db_set linux-container/eth0/mac "00:FF:00:00:00:01" db_fset linux-container/eth0/mac seen false db_settitle linux-container/title -- 1.7.2.5
>From dd9f629fcd673dc55e92273d46e7629a2f5fd529 Mon Sep 17 00:00:00 2001 From: Marcus Osdoba <marcus.osd...@googlemail.com> Date: Sat, 10 Dec 2011 16:25:32 +0100 Subject: [PATCH 3/3] lxc-debconf: use libvirt default network as proposal for network.link To: buildr...@busybox.net just a suggestion: libvirt provides a default network which can be easily started via "virsh net-start default" the container can immediatly connect through virbr0 and use dhcpc this saves some time when setting up networked containers in a new/empty environment libvirt-bin maybe a suggesttion for the pacakge lxc itself anyway, because it provides some further lxc support, too Signed-off-by: Marcus Osdoba <marcus.osd...@googlemail.com> --- debian/local/lxc-debconf.d/03-debconf | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/local/lxc-debconf.d/03-debconf b/debian/local/lxc-debconf.d/03-debconf index 4ea0b90..b13c8d5 100755 --- a/debian/local/lxc-debconf.d/03-debconf +++ b/debian/local/lxc-debconf.d/03-debconf @@ -640,7 +640,7 @@ Network () if [ -z ${LINUX_CONTAINER_ETH0_BRIDGE} ] then # FIXME: do guess the default bridge device - db_set linux-container/eth0/bridge br0 + db_set linux-container/eth0/bridge virbr0 db_fset linux-container/eth0/bridge seen false db_settitle linux-container/title @@ -648,7 +648,7 @@ Network () db_go db_get linux-container/eth0/bridge - LINUX_CONTAINER_ETH0_BRIDGE="${RET:-br0}" + LINUX_CONTAINER_ETH0_BRIDGE="${RET:-virbr0}" fi if [ -z "${LINUX_CONTAINER_ETH0_MAC}" ] -- 1.7.2.5