addition for adding the universe feed to ubuntu for python-rpm that is crucially...
[build.git] / lbuild-initvm.sh
index 886bff1..45fdb8d 100755 (executable)
@@ -384,9 +384,6 @@ EOF
     mknod -m 600 ${dev_path}/initctl p
     mknod -m 666 ${dev_path}/ptmx c 5 2
 
-    #echo "setting root passwd to $root_password"
-    #echo "root:$root_password" | chroot $rootfs_path chpasswd
-
     if [ "$(echo $fcdistro | cut -d"f" -f2)" -le "14" ]; then
        fedora_configure_init
     else
@@ -723,6 +720,14 @@ function devel_or_vtest_tools () {
            chroot $rootfs_path rpm -aq > $rootfs_path/init-lxc.rpms
            ;;
        debootstrap)
+           # for ubuntu
+           if grep -iq ubuntu /vservers/$vserver/rootfs/etc/lsb-release 2> /dev/null; then
+               # on ubuntu, at this point we end up with a single feed in /etc/apt/sources.list
+               # we need at least to add the 'universe' feed for python-rpm
+               ( cd /vservers/$vserver/rootfs/etc/apt ; head -1 sources.list | sed -e s,main,universe, > sources.list.d/universe.list )
+               # also adding a link to updates sounds about right
+               ( cd /vservers/$vserver/rootfs/etc/apt ; head -1 sources.list | sed -e 's, main,-updates main,' > sources.list.d/updates.list )
+           fi
            chroot $rootfs_path apt-get update
            for package in $packages ; do
                # close stdin in an attempt to avoid this hanging
@@ -1026,7 +1031,6 @@ function main () {
     config_path=$path/$lxc
     cache_base=/var/cache/lxc/fedora/$arch
     cache=$cache_base/$release
-    root_password=root
     
     # check whether the rootfs directory is created to know if the container exists
     # bacause /var/lib/lxc/$lxc is already created while putting $lxc.timestamp