mirror of
https://github.com/kevingruesser/bootstrap-vz.git
synced 2025-08-24 07:26:29 +00:00

Add UpdateInitramfs task which is needed for this to take effect. Enable both tasks for GCE. Console output before ===================== [ 1.877142] sd 0:0:1:0: [sda] Attached SCSI disk [ 1.880163] sd 0:0:1:0: Attached scsi generic sg0 type 0 [ 2.684132] tsc: Refined TSC clocksource calibration: 2500.000 MHz [ 4.824081] floppy0: no floppy controllers found [ 5.103671] work still pending Begin: Loading essential drivers ... done. Begin: Running /scripts/init-premount ... done. Begin: Mounting root file system ... Begin: Running /scripts/local-top ... done. Begin: Running /scripts/local-premount ... done. [ 5.313107] EXT4-fs (sda1): mounted filesystem with ordered data mode. Opts: (null) ... [ 7.751955] alg: No test for crc32 (crc32-pclmul) [ 10.728078] floppy0: no floppy controllers found [ 11.006680] work still pending [....] Activating swap... done [ 11.258954] EXT4-fs (sda1): re-mounted. Opts: (null) Console output after ==================== [ 1.829785] sd 0:0:1:0: [sda] Attached SCSI disk [ 1.832806] sd 0:0:1:0: Attached scsi generic sg0 type 0 Begin: Loading essential drivers ... done. Begin: Running /scripts/init-premount ... done. Begin: Mounting root file system ... Begin: Running /scripts/local-top ... done. Begin: Running /scripts/local-premount ... done. [ 1.969862] EXT4-fs (sda1): mounted filesystem with ordered data mode. Opts: (null) ... [ 2.878920] alg: No test for crc32 (crc32-pclmul) [....] Activating swap... done [ 2.986642] EXT4-fs (sda1): re-mounted. Opts: (null) Delint. Delint
68 lines
2.2 KiB
Python
68 lines
2.2 KiB
Python
from bootstrapvz.common import task_groups
|
|
import tasks.apt
|
|
import tasks.boot
|
|
import tasks.configuration
|
|
import tasks.image
|
|
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
|
|
from bootstrapvz.common.tasks import volume
|
|
|
|
|
|
def initialize():
|
|
pass
|
|
|
|
|
|
def validate_manifest(data, validator, error):
|
|
import os.path
|
|
schema_path = os.path.normpath(os.path.join(os.path.dirname(__file__), 'manifest-schema.yml'))
|
|
validator(data, schema_path)
|
|
|
|
|
|
def resolve_tasks(taskset, manifest):
|
|
taskset.update(task_groups.get_standard_groups(manifest))
|
|
|
|
taskset.update([apt.AddBackports,
|
|
loopback.AddRequiredCommands,
|
|
loopback.Create,
|
|
tasks.apt.SetPackageRepositories,
|
|
tasks.apt.ImportGoogleKey,
|
|
tasks.packages.DefaultPackages,
|
|
tasks.packages.ReleasePackages,
|
|
tasks.packages.GooglePackages,
|
|
|
|
tasks.configuration.GatherReleaseInformation,
|
|
|
|
tasks.host.DisableIPv6,
|
|
tasks.host.InstallHostnameHook,
|
|
tasks.boot.ConfigureGrub,
|
|
initd.AddExpandRoot,
|
|
tasks.initd.AdjustExpandRootDev,
|
|
initd.InstallInitScripts,
|
|
boot.BlackListModules,
|
|
boot.UpdateInitramfs,
|
|
ssh.AddSSHKeyGeneration,
|
|
ssh.DisableSSHPasswordAuthentication,
|
|
tasks.apt.CleanGoogleRepositoriesAndKeys,
|
|
|
|
loopback.MoveImage,
|
|
tasks.image.CreateTarball,
|
|
volume.Delete,
|
|
])
|
|
|
|
if manifest.volume['partitions']['type'] != 'none':
|
|
taskset.add(initd.AdjustExpandRootScript)
|
|
|
|
if 'gcs_destination' in manifest.image:
|
|
taskset.add(tasks.image.UploadImage)
|
|
if 'gce_project' in manifest.image:
|
|
taskset.add(tasks.image.RegisterImage)
|
|
|
|
|
|
def resolve_rollback_tasks(taskset, manifest, completed, counter_task):
|
|
taskset.update(task_groups.get_standard_rollback_tasks(completed))
|