From 3f376fa5137d73df681cc5eaaa9b5e4206d57fce Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Mon, 18 Jan 2016 17:06:36 +0000 Subject: [PATCH] p2v: virt-p2v-make-disk: Use a more robust way to get the latest kernel version. Fedora/i686 does not have a package called 'kernel', so the command 'rpm -q kernel' fails. In any case the method used wasn't exactly very robust. The new method is based on how febootstrap used to do this. This updates commit d723b352f8c10fb5244f17889cf68e13dd85c037. --- p2v/virt-p2v-make-disk.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/p2v/virt-p2v-make-disk.in b/p2v/virt-p2v-make-disk.in index c73bfd34b..2430027d1 100644 --- a/p2v/virt-p2v-make-disk.in +++ b/p2v/virt-p2v-make-disk.in @@ -113,8 +113,8 @@ EOF cat > $tmpdir/post-install <<'EOF' #!/bin/bash # Rebuild the initramfs. -version=` rpm -q kernel | sort -rV | head -1 | sed 's/kernel-//' ` -dracut -f --kver $version +latest_version="$(cd /lib/modules; ls -1vr | head -1)" +dracut -f --kver $latest_version EOF # Double quotes because we want $tmpdir to be expanded: extra_args="