mirror of
https://github.com/kevingruesser/bootstrap-vz.git
synced 2025-08-22 09:50:37 +00:00
EC2 provider: added ENA driver (installing with +
enhanced_networking set to simple)
This commit is contained in:
parent
89eedae5fc
commit
07c66e9030
3 changed files with 43 additions and 2 deletions
|
@ -68,6 +68,9 @@ def resolve_tasks(taskset, manifest):
|
||||||
tasks.tuning.BlackListModules,
|
tasks.tuning.BlackListModules,
|
||||||
boot.BlackListModules,
|
boot.BlackListModules,
|
||||||
boot.DisableGetTTYs,
|
boot.DisableGetTTYs,
|
||||||
|
tasks.boot.AddXenGrubConsoleOutputDevice,
|
||||||
|
grub.WriteGrubConfig,
|
||||||
|
tasks.boot.UpdateGrubConfig,
|
||||||
initd.AddExpandRoot,
|
initd.AddExpandRoot,
|
||||||
initd.RemoveHWClock,
|
initd.RemoveHWClock,
|
||||||
initd.InstallInitScripts,
|
initd.InstallInitScripts,
|
||||||
|
@ -133,6 +136,7 @@ def resolve_tasks(taskset, manifest):
|
||||||
if manifest.provider.get('enhanced_networking', None) == 'simple':
|
if manifest.provider.get('enhanced_networking', None) == 'simple':
|
||||||
taskset.update([kernel.AddDKMSPackages,
|
taskset.update([kernel.AddDKMSPackages,
|
||||||
tasks.network.InstallEnhancedNetworking,
|
tasks.network.InstallEnhancedNetworking,
|
||||||
|
tasks.network.InstallENANetworking,
|
||||||
kernel.UpdateInitramfs])
|
kernel.UpdateInitramfs])
|
||||||
|
|
||||||
taskset.update([filesystem.Format,
|
taskset.update([filesystem.Format,
|
||||||
|
|
|
@ -125,6 +125,7 @@ class RegisterAMI(Task):
|
||||||
|
|
||||||
if info.manifest.provider.get('enhanced_networking', None) == 'simple':
|
if info.manifest.provider.get('enhanced_networking', None) == 'simple':
|
||||||
registration_params['SriovNetSupport'] = 'simple'
|
registration_params['SriovNetSupport'] = 'simple'
|
||||||
|
registration_params['EnaSupport'] = True
|
||||||
|
|
||||||
info._ec2['image'] = info._ec2['connection'].register_image(**registration_params)
|
info._ec2['image'] = info._ec2['connection'].register_image(**registration_params)
|
||||||
|
|
||||||
|
|
|
@ -101,7 +101,8 @@ class InstallEnhancedNetworking(Task):
|
||||||
log_check_call(['tar', '--ungzip',
|
log_check_call(['tar', '--ungzip',
|
||||||
'--extract',
|
'--extract',
|
||||||
'--file', archive,
|
'--file', archive,
|
||||||
'--directory', os.path.join(info.root, 'usr', 'src')])
|
'--directory', os.path.join(info.root, 'usr',
|
||||||
|
'src')])
|
||||||
|
|
||||||
with open(os.path.join(module_path, 'dkms.conf'), 'w') as dkms_conf:
|
with open(os.path.join(module_path, 'dkms.conf'), 'w') as dkms_conf:
|
||||||
dkms_conf.write("""PACKAGE_NAME="ixgbevf"
|
dkms_conf.write("""PACKAGE_NAME="ixgbevf"
|
||||||
|
@ -118,4 +119,39 @@ AUTOINSTALL="yes"
|
||||||
for task in ['add', 'build', 'install']:
|
for task in ['add', 'build', 'install']:
|
||||||
# Invoke DKMS task using specified kernel module (-m) and version (-v)
|
# Invoke DKMS task using specified kernel module (-m) and version (-v)
|
||||||
log_check_call(['chroot', info.root,
|
log_check_call(['chroot', info.root,
|
||||||
'dkms', task, '-m', 'ixgbevf', '-v', version, '-k', info.kernel_version])
|
'dkms', task, '-m', 'ixgbevf', '-v', version, '-k',
|
||||||
|
info.kernel_version])
|
||||||
|
|
||||||
|
|
||||||
|
class InstallENANetworking(Task):
|
||||||
|
description = '***** Installing ENA networking kernel driver using DKMS'
|
||||||
|
phase = phases.system_modification
|
||||||
|
successors = [kernel.UpdateInitramfs]
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def run(cls, info):
|
||||||
|
version = '1.0.0'
|
||||||
|
drivers_url = 'https://github.com/amzn/amzn-drivers'
|
||||||
|
module_path = os.path.join(info.root, 'usr', 'src',
|
||||||
|
'amzn-drivers-%s' % (version))
|
||||||
|
|
||||||
|
from bootstrapvz.common.tools import log_check_call
|
||||||
|
log_check_call(['git', 'clone', drivers_url, module_path])
|
||||||
|
|
||||||
|
with open(os.path.join(module_path, 'dkms.conf'), 'w') as dkms_conf:
|
||||||
|
dkms_conf.write("""PACKAGE_NAME="ena"
|
||||||
|
PACKAGE_VERSION="%s"
|
||||||
|
CLEAN="make -C kernel/linux/ena clean"
|
||||||
|
MAKE="make -C kernel/linux/ena/ BUILD_KERNEL=${kernelver}"
|
||||||
|
BUILT_MODULE_NAME[0]="ena"
|
||||||
|
BUILT_MODULE_LOCATION="kernel/linux/ena"
|
||||||
|
DEST_MODULE_LOCATION[0]="/updates"
|
||||||
|
DEST_MODULE_NAME[0]="ena"
|
||||||
|
AUTOINSTALL="yes"
|
||||||
|
""" % (version))
|
||||||
|
|
||||||
|
for task in ['add', 'build', 'install']:
|
||||||
|
# Invoke DKMS task using specified kernel module (-m) and version (-v)
|
||||||
|
log_check_call(['chroot', info.root,
|
||||||
|
'dkms', task, '-m', 'amzn-drivers', '-v', version,
|
||||||
|
'-k', info.kernel_version])
|
||||||
|
|
Loading…
Add table
Reference in a new issue