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 d723b352f8.
This commit is contained in:
Richard W.M. Jones
2016-01-18 17:06:36 +00:00
parent 4a7b32a7e2
commit 3f376fa513

View File

@@ -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="