Merge pull request #187 from rephorm/nofloppy-dev

Blacklist floppy module to speed up boot by several seconds.
This commit is contained in:
Anders Ingemann 2015-01-24 22:32:14 +01:00
commit e1e1150a04
2 changed files with 17 additions and 2 deletions

View file

@ -7,16 +7,28 @@ from bootstrapvz.base.fs import partitionmaps
import os.path
class UpdateInitramfs(Task):
description = 'Updating initramfs'
phase = phases.system_modification
@classmethod
def run(cls, info):
from ..tools import log_check_call
log_check_call(['chroot', info.root, 'update-initramfs', '-u'])
class BlackListModules(Task):
description = 'Blacklisting kernel modules'
phase = phases.system_modification
successors = [UpdateInitramfs]
@classmethod
def run(cls, info):
blacklist_path = os.path.join(info.root, 'etc/modprobe.d/blacklist.conf')
with open(blacklist_path, 'a') as blacklist:
blacklist.write(('# disable pc speaker\n'
'blacklist pcspkr'))
blacklist.write(('# disable pc speaker and floppy\n'
'blacklist pcspkr\n'
'blacklist floppy\n'))
class DisableGetTTYs(Task):

View file

@ -7,6 +7,7 @@ import tasks.initd
import tasks.host
import tasks.packages
from bootstrapvz.common.tasks import apt
from bootstrapvz.common.tasks import boot
from bootstrapvz.common.tasks import loopback
from bootstrapvz.common.tasks import initd
from bootstrapvz.common.tasks import ssh
@ -43,6 +44,8 @@ def resolve_tasks(taskset, manifest):
initd.AddExpandRoot,
tasks.initd.AdjustExpandRootDev,
initd.InstallInitScripts,
boot.BlackListModules,
boot.UpdateInitramfs,
ssh.AddSSHKeyGeneration,
ssh.DisableSSHPasswordAuthentication,
tasks.apt.CleanGoogleRepositoriesAndKeys,