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 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): class BlackListModules(Task):
description = 'Blacklisting kernel modules' description = 'Blacklisting kernel modules'
phase = phases.system_modification phase = phases.system_modification
successors = [UpdateInitramfs]
@classmethod @classmethod
def run(cls, info): def run(cls, info):
blacklist_path = os.path.join(info.root, 'etc/modprobe.d/blacklist.conf') blacklist_path = os.path.join(info.root, 'etc/modprobe.d/blacklist.conf')
with open(blacklist_path, 'a') as blacklist: with open(blacklist_path, 'a') as blacklist:
blacklist.write(('# disable pc speaker\n' blacklist.write(('# disable pc speaker and floppy\n'
'blacklist pcspkr')) 'blacklist pcspkr\n'
'blacklist floppy\n'))
class DisableGetTTYs(Task): class DisableGetTTYs(Task):

View file

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