[Libvirt-cim] [PATCH] cimtest: fix guest images generation

Jincheng Miao jmiao at redhat.com
Fri Aug 9 11:27:26 UTC 2013


----- Original Message -----
> I understand the error I saw wasn't in the area you changed. I don't
> believe my run got to the code you changed and as much as it seems like
> an ACK would be in order, I couldn't test your portion of the change on
> my host.
> 
> John
> 
> 
> FWIW:
> 
> I have a f19 host
> 
> 
> # find /boot | grep vmlinuz
> /boot/.vmlinuz-3.9.11-200.fc18.x86_64.hmac
> /boot/vmlinuz-3.9.6-200.fc18.x86_64
> /boot/.vmlinuz-3.9.6-200.fc18.x86_64.hmac
> /boot/vmlinuz-3.9.11-200.fc18.x86_64
> /boot/vmlinuz-3.9.5-201.fc18.x86_64
> /boot/vmlinuz-3.10.4-300.fc19.x86_64
> /boot/.vmlinuz-3.9.5-201.fc18.x86_64.hmac
> /boot/.vmlinuz-3.10.4-300.fc19.x86_64.hmac
> /boot/vmlinuz-0-rescue-9481a187403f46b38d535cf9ffa1cc20
> 
> 
> # find /boot | grep vmlinuz | egrep -v 'xen|hmac'
> /boot/vmlinuz-3.9.6-200.fc18.x86_64
> /boot/vmlinuz-3.9.11-200.fc18.x86_64
> /boot/vmlinuz-3.9.5-201.fc18.x86_64
> /boot/vmlinuz-3.10.4-300.fc19.x86_64
> /boot/vmlinuz-0-rescue-9481a187403f46b38d535cf9ffa1cc20
> 

well, I think the xmt-makefv.sh do not care about rescue images.
The command should be " find /boot | grep vmlinuz | egrep -v 'xen|hmac|rescue' ".

And I think I can give this patch some modification:

Signed-off-by: Jincheng Miao <jmiao at redhat.com>
---
 suites/libvirt-cim/images/xmt-makefv.sh | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/suites/libvirt-cim/images/xmt-makefv.sh b/suites/libvirt-cim/images/xmt-makefv.sh
index 1cf6a0f..85a340c 100755
--- a/suites/libvirt-cim/images/xmt-makefv.sh
+++ b/suites/libvirt-cim/images/xmt-makefv.sh
@@ -51,7 +51,7 @@ partition() {
     local file=$1
 
     $PARTED $file mklabel msdos
-    $PARTED $file mkpartfs primary ext2 0 $(($SIZE - 1))
+    $PARTED $file mkpart primary ext2 0 $(($SIZE - 1))
 }
 
 mount_partition() {
@@ -62,7 +62,10 @@ mount_partition() {
 
     losetup /dev/$loopdev $file || die "Failed to losetup $file"
     kpartx -a /dev/$loopdev || die "Failed to kpartx $loopdev"
+    sleep 2
+    mke2fs -t ext2 /dev/mapper/${loopdev}p1 >/dev/null 2>&1 || die "Failed to mkfs ${loopdev}p1"
     tune2fs -j /dev/mapper/${loopdev}p1 >/dev/null 2>&1|| die "Failed to add journal"
+    sleep 2
     mount /dev/mapper/${loopdev}p1 $TMPMOUNT || die "Failed to mount ${loopdev}p1"
 
     echo $loopdev 
@@ -86,7 +88,7 @@ copy_in_ramdisk() {
 kernel_path() {
     local prefix=$1
 
-    local image=`find /boot | grep vmlinuz | egrep -v 'xen|hmac' | tail -n1`
+    local image=`find /boot | grep vmlinuz | egrep -v 'xen|hmac|rescue' | tail 
 
     if [ -z $image ]; then
         touch /boot/vmlinuz-$DUMMY_PATH
-- 
1.8.3.1




More information about the Libvirt-cim mailing list