mirror of
https://github.com/kevingruesser/bootstrap-vz.git
synced 2025-08-24 07:26:29 +00:00
Move the udev patch task to boot
Inconsequential commit, but I think it makes more sense, since the task affects what happens when booting
This commit is contained in:
parent
ecf549b65d
commit
d1b63938e9
3 changed files with 18 additions and 22 deletions
|
@ -2,7 +2,6 @@ from bootstrapvz.common import task_groups
|
|||
import tasks.packages
|
||||
import tasks.boot
|
||||
import tasks.image
|
||||
import tasks.udev
|
||||
from bootstrapvz.common.tasks import loopback
|
||||
from bootstrapvz.common.tasks import initd
|
||||
from bootstrapvz.common.tasks import ssh
|
||||
|
@ -25,7 +24,7 @@ def resolve_tasks(taskset, manifest):
|
|||
ssh.AddSSHKeyGeneration,
|
||||
tasks.packages.Waagent,
|
||||
tasks.boot.ConfigureGrub,
|
||||
tasks.udev.PatchUdev,
|
||||
tasks.boot.PatchUdev,
|
||||
tasks.image.ConvertToVhd,
|
||||
])
|
||||
|
||||
|
|
|
@ -1,6 +1,23 @@
|
|||
from bootstrapvz.base import Task
|
||||
from bootstrapvz.common import phases
|
||||
from bootstrapvz.common.tasks import grub
|
||||
from bootstrapvz.common.tasks import kernel
|
||||
import os
|
||||
|
||||
|
||||
class PatchUdev(Task):
|
||||
description = 'Patching udev configuration to remove ROOTDELAY sleep'
|
||||
phase = phases.system_modification
|
||||
successors = [kernel.UpdateInitramfs]
|
||||
|
||||
@classmethod
|
||||
def run(cls, info):
|
||||
from bootstrapvz.common.tools import log_check_call
|
||||
from . import assets
|
||||
# c.f. http://anonscm.debian.org/cgit/pkg-systemd/systemd.git/commit/?id=61e055638cea
|
||||
with open(os.path.join(assets, 'udev.diff')) as diff_file:
|
||||
udev_dir = os.path.join(info.root, 'usr/share/initramfs-tools/scripts/init-top')
|
||||
log_check_call(['patch', '--no-backup-if-mismatch', '-p6', '-d' + udev_dir], stdin=diff_file)
|
||||
|
||||
|
||||
class ConfigureGrub(Task):
|
||||
|
@ -10,7 +27,6 @@ class ConfigureGrub(Task):
|
|||
|
||||
@classmethod
|
||||
def run(cls, info):
|
||||
import os
|
||||
from bootstrapvz.common.tools import sed_i
|
||||
grub_config = os.path.join(info.root, 'etc/default/grub')
|
||||
sed_i(grub_config, r'^(GRUB_CMDLINE_LINUX*=".*)"\s*$', r'\1console=ttyS0 earlyprintk=ttyS0 rootdelay=300"')
|
||||
|
|
|
@ -1,19 +0,0 @@
|
|||
from bootstrapvz.base import Task
|
||||
from bootstrapvz.common import phases
|
||||
from bootstrapvz.common.tasks import kernel
|
||||
from bootstrapvz.common.tools import log_check_call
|
||||
import os.path
|
||||
from . import assets
|
||||
|
||||
|
||||
class PatchUdev(Task):
|
||||
description = 'Patch udev configuration to remove ROOTDELAY sleep'
|
||||
phase = phases.system_modification
|
||||
successors = [kernel.UpdateInitramfs]
|
||||
|
||||
@classmethod
|
||||
def run(cls, info):
|
||||
# c.f. http://anonscm.debian.org/cgit/pkg-systemd/systemd.git/commit/?id=61e055638cea
|
||||
with open(os.path.join(assets, 'udev.diff')) as diff_file:
|
||||
udev_dir = os.path.join(info.root, 'usr/share/initramfs-tools/scripts/init-top')
|
||||
log_check_call(['patch', '--no-backup-if-mismatch', '-p6', '-d' + udev_dir], stdin=diff_file)
|
Loading…
Add table
Reference in a new issue