mirror of
https://github.com/kevingruesser/bootstrap-vz.git
synced 2025-08-24 07:26:29 +00:00
Fix linux-headers
package version detection
The `uname -r` command returns the version of the running kernel running on the host machine, as the chroot environment doesn't load a new one. This prevents the proper version of the `linux-headers-*` package from being added when the target has a different kernel version or architecure. This closes #121.
This commit is contained in:
parent
881ea41a1a
commit
89a74a33c8
1 changed files with 5 additions and 5 deletions
|
@ -27,11 +27,11 @@ class AddGuestAdditionsPackages(Task):
|
|||
info.packages.add('bzip2')
|
||||
info.packages.add('build-essential')
|
||||
info.packages.add('dkms')
|
||||
|
||||
from bootstrapvz.common.tools import log_check_call
|
||||
[kernel_version] = log_check_call(['chroot', info.root,
|
||||
'uname', '-r'])
|
||||
kernel_headers_pkg = 'linux-headers-' + kernel_version
|
||||
kernel_headers_pkg = 'linux-headers-'
|
||||
if info.manifest.system['architecture'] == 'i386':
|
||||
kernel_headers_pkg += '686-pae'
|
||||
else:
|
||||
kernel_headers_pkg += 'amd64'
|
||||
info.packages.add(kernel_headers_pkg)
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue