Skip to content

Commit

Permalink
p2v: virt-p2v-make-disk: Use a more robust way to get the latest kern…
Browse files Browse the repository at this point in the history
…el 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 d723b35.
  • Loading branch information
rwmjones committed Jan 18, 2016
1 parent 4a7b32a commit 3f376fa
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions p2v/virt-p2v-make-disk.in
Expand Up @@ -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="
Expand Down

0 comments on commit 3f376fa

Please sign in to comment.