<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "http://bugs.gentoo.org/bugzilla.dtd">

<bugzilla version="2.22.7"
          urlbase="http://bugs.gentoo.org/"
          maintainer="bugzilla@gentoo.org"
>

    <bug>
          <bug_id>130855</bug_id>
          
          <creation_ts>2006-04-22 10:04 0000</creation_ts>
          <short_desc>app-emulation/domi attempts to use in-use loop device</short_desc>
          <delta_ts>2006-05-19 05:08:43 0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>Gentoo Linux</product>
          <component>Ebuilds</component>
          <version>2006.0</version>
          <rep_platform>All</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>marduk@gentoo.org</reporter>
          <assigned_to>chrb@gentoo.org</assigned_to>
          <cc>Mark@JumpingBean.co.za</cc>

      

      
          <long_desc isprivate="0">
            <who>marduk@gentoo.org</who>
            <bug_when>2006-04-22 10:04:13 0000</bug_when>
            <thetext>If domi is run on a system where a loopback device is in use, at least on a udev system.  It looks for /dev/loop[n] where losetup prints /dev/loop/[n].  domi thinks the device is not use and tries to set it up but gets an error.

A small patch which follows appears to fix the situation. It follows

--- /tmp/domi.orig      2006-04-22 12:02:25.000000000 -0500
+++ /usr/bin/domi       2006-04-22 11:40:44.000000000 -0500
@@ -260,7 +260,7 @@
                        count=&quot;${DOMI_DISK_SIZE}&quot;
        fi
        for i in $(seq 0 63); do
-               DOMI_DISK_DEV=&quot;/dev/loop${i}&quot;
+               DOMI_DISK_DEV=&quot;/dev/loop/${i}&quot;
                if losetup -a | grep -q &quot;${DOMI_DISK_DEV}:&quot;; then
                        continue
                fi</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>chrb@gentoo.org</who>
            <bug_when>2006-04-22 11:13:22 0000</bug_when>
            <thetext>I assume from your gentoo.org address you have access to cvs. Feel free to add this patch yourself, and add yourself as a maintainer if you&apos;re interested in fixing future bugs. Thanks.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>marduk@gentoo.org</who>
            <bug_when>2006-05-03 08:34:31 0000</bug_when>
            <thetext>I&apos;m in the infra group.  I&apos;m not an ebuild maintainer and, honestly, I don&apos;t really have the time right now to be one.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>Mark@JumpingBean.co.za</who>
            <bug_when>2006-05-11 12:06:09 0000</bug_when>
            <thetext>Hi all,

I am looking for help on runnung domi to install a fedora domainU. I have the following in my domi.conf


#!/bin/bash
#This script is generated by http://bugs.gentoo.org/show_bug.cgi?id=112407 and the domi.man file
#domi - xen domain installer /etc/domi.conf
#domi is a shell script which sets up virtual machines.  It creates
#virtual disks using either LVM or image files and installs a linux
#distribution on the newly created disk.
#
#domi reads the configuration from /etc/domi.conf and the config file
#passed on the command line.  Then goes ahead and sets up the virtual
#disk without asking further questions, so be careful.
#The config files are simply sourced.  Thus the syntax for setting the
#config options is the usual shell variable style, i.e. VAR=&quot;value&quot;,
#hashmark works for comments and so on.
############################################
#DOMI_NAME=&quot;myexample&quot;  # Required
DOMI_NAME=&quot;fedora&quot;

##Name of the virtual machine.
#Distribution to install.  Valid choices are suse, fedora, debian and gentoo.
#DOMI_DISTRO=&quot;gentoo&quot; #  Required.
DOMI_DISTRO=&quot;fedora&quot;

#DOMI_CACHE Location where downloaded files are cached.
#Default: /var/cache/domi
DOMI_CACHE=&quot;/var/cache/domi&quot;

#DOMI_FSTYPE File system to use
#Default: ext2
DOMI_FSTYPE=&quot;ext2&quot;

#DOMI_PASSWD Initial root password
#Default: root
DOMI_PASSWD=&quot;secret&quot;

#DOMI_VDISK
#Name of the virtual disk (inside the vm).  &quot;xvda&quot; should do just
#fine with all modern, udev-based distros which create the device
#nodes automatically.  In case of trouble you can try &quot;hda&quot; instead.
#Default: xvda
DOMI_VDISK=&quot;xvda&quot;

#DOMI_XEN_CONF
#Recommended.
#If specified the script writes a initial Xen config file to the given
#location.
#DOMI_XEN_CONF=&quot;/etc/xen/auto/myexample-startscript&quot;
DOMI_XEN_CONF=&quot;/etc/xen/auto/domi_script &quot;

#DOMI_XEN_KERNEL Xen kernel (for the Xen config file).
#Default: /boot/vmlinuz-xen
#DOMI_XEN_KERNEL=&quot;/path/to/the/DomU-kernel&quot;
DOMI_XEN_KERNEL=&quot;/boot/vmlinuz-2.6-xen&quot;

#DOMI_XEN_MEMORY
#Main memory (for the Xen config file, in megabytes).
#Default: 128
DOMI_XEN_MEMORY=&quot;900&quot;

#DOMI_DISK_VG
#LVM volume group to use for storage.  If specied the script will
#create a volume with DOMI_NAME in that volume group and use it to
#setup the virtual disk.
#Recommended.
#DOMI_DISK_VG=&quot;volg-md9&quot;# without a &quot;/&quot;
DOMI_DISK_VG=&quot;volgroup01 &quot;

#DOMI_DISK_FILE
#If you don&apos;t use LVM you can specify an image file to use for the
#virtual disk.  Setting either DOMI_DISK_VG or DOMI_DISK_FILE is
#required.
#DOMI_DISK_FILE=&quot;/path/to/my/myexample.file&quot;
#DOMI_DISK_FILE=&quot;&quot;

#DOMI_DISK_SPARSE
#Set this to some non-empty value to make domi use sparse file for the
#disk images.  Has no effect if you use LVM.

#DOMI_DISK_SIZE
#Default: 4096
#Size of the virtual disk, in megabytes.
DOMI_DISK_SIZE=&quot;4096&quot;

#DOMI_SWAP_SIZE
#Default: 256
#Size of the swap partition, in megabytes.
DOMI_SWAP_SIZE=&quot;256&quot;

#DOMI_ROOT_SIZE
#Default: DOMI_DISK_SIZE - DOMI_SWAP_SIZE
#Size if the root filesystem, in megabytes

#DOMI_HOOK_POST
#Custom postinstall script to run.




And in a /home/mark/domi.conf


FEDORA_REPO=http://download.fedora.redhat.com/pub/fedora/linux/core/5/i386/os
FEDORA_GROUP=base



When I run domi /home/mark/domi.conf I just get

###
### fedora: initialization (i386)
###

###
### fedora: setup disk (lvm volume /dev/volgroup01 /fedora)
###
  Logical volume &quot;fedora&quot; already exists in volume group &quot;volgroup01&quot;

###
### fedora: cleanup: virtual disk
###

###
### fedora: cleanup: remove tmp files


It completes in about 3 seconds. From what I understand domi should download the the fedora packages and create a domU. What am I missing?
</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>Mark@JumpingBean.co.za</who>
            <bug_when>2006-05-11 13:45:18 0000</bug_when>
            <thetext>found one problem. I had a space in the volumegroup variable name. i.e &quot;/dev/volgroup01 &quot;. This called the script to fail. I now get as far as the following.

### fedora: setup disk (lvm volume /dev/volgroup01/fedora)
###
  Logical volume &quot;fedora&quot; successfully removed
  Logical volume &quot;fedora&quot; created
Disk geometry for /dev/mapper/volgroup01-fedora: 0kB - 4295MB
Disk label type: msdos
Number  Start   End     Size    Type      File system  Flags
1       1kB     4026MB  4026MB  primary                boot
2       4026MB  4294MB  268MB   primary
add map volgroup01-fedora-part1 : 0 7863281 linear /dev/mapper/volgroup01-fedora 1
add map volgroup01-fedora-part2 : 0 523437 linear /dev/mapper/volgroup01-fedora 7863282

###
### fedora: setup root fs and swap
###
Setting up swapspace version 1, size = 267993 kB
LABEL=fedora-swap, UUID=8975dae0-7cd6-4fb8-8030-8b8d745f0bb1

###
### fedora: copy saved yum cache [/var/cache/domi/fedora-pub-fedora-linux-core-5-i386-os]
###
which: no yum in (/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/bin:/usr/i686-pc-linux-gnu/gcc-bin/3.4.5:/opt/sun-jdk-1.5.0.06/bin:/opt/sun-jdk-1.5.0.06/jre/bin:/usr/qt/3/bin:/usr/kde/3.4/sbin:/usr/kde/3.4/bin)
error: yum not found

###
### fedora: save yum cache [/var/cache/domi/fedora-pub-fedora-linux-core-5-i386-os]
###

###
### fedora: cleanup: virtual disk
###
/dev/mapper/volgroup01-fedora-part1 umounted
del devmap : volgroup01-fedora-part1
del devmap : volgroup01-fedora-part2

###
### fedora: cleanup: remove tmp files
###



Do I need to download these files manually or should the script do it for me?</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>Mark@JumpingBean.co.za</who>
            <bug_when>2006-05-11 13:51:41 0000</bug_when>
            <thetext>ok  --- looks like it need yum installed but I cant find it in the ebuilds :(</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>chrb@gentoo.org</who>
            <bug_when>2006-05-19 05:08:43 0000</bug_when>
            <thetext>marduk - I&apos;ve applied the patch as a sed line in the ebuild.

Mark - looks like it needs yum - please open another bug (building suse may also require kpartx and y2pmsh). I haven&apos;t got time to write ebuilds for those, so if you do please attach them to the new bug report. Thanks.</thetext>
          </long_desc>
      
    </bug>

</bugzilla>