diff --git a/bootstrapvz/common/tasks/boot.py b/bootstrapvz/common/tasks/boot.py index c0a4d4d..1749603 100644 --- a/bootstrapvz/common/tasks/boot.py +++ b/bootstrapvz/common/tasks/boot.py @@ -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): diff --git a/bootstrapvz/providers/gce/__init__.py b/bootstrapvz/providers/gce/__init__.py index 88477a8..4988ce8 100644 --- a/bootstrapvz/providers/gce/__init__.py +++ b/bootstrapvz/providers/gce/__init__.py @@ -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,