mirror of
https://github.com/kevingruesser/bootstrap-vz.git
synced 2025-08-22 18:00:35 +00:00
Implemented DisableGetTTYs
This commit is contained in:
parent
8bbf1b3fec
commit
953e324ca3
2 changed files with 17 additions and 1 deletions
|
@ -42,7 +42,8 @@ def tasks(tasklist, manifest):
|
|||
apt.AptUpgrade(),
|
||||
boot.ConfigureGrub(),
|
||||
boot.ModifyFstab(),
|
||||
boot.BlackListModules())
|
||||
boot.BlackListModules(),
|
||||
boot.DisableGetTTYs())
|
||||
|
||||
from common.tasks import TriggerRollback
|
||||
tasklist.add(TriggerRollback())
|
||||
|
|
|
@ -60,3 +60,18 @@ class BlackListModules(Task):
|
|||
blacklist_path = os.path.join(info.root, 'etc/modprobe.d/blacklist.conf')
|
||||
with open(blacklist_path, 'a') as blacklist:
|
||||
blacklist.write(('# disable pc speaker\nblacklist pcspkr'))
|
||||
|
||||
|
||||
class DisableGetTTYs(Task):
|
||||
description = 'Disabling getty processes'
|
||||
phase = phases.system_modification
|
||||
|
||||
def run(self, info):
|
||||
from common.tools import sed_i
|
||||
inittab_path = os.path.join(info.root, 'etc/inittab')
|
||||
tty1 = '1:2345:respawn:/sbin/getty 38400 tty1'
|
||||
sed_i(inittab_path, '^'+tty1, '#'+tty1)
|
||||
ttyx = ':23:respawn:/sbin/getty 38400 tty'
|
||||
for i in range(2, 6):
|
||||
i = str(i)
|
||||
sed_i(inittab_path, '^'+i+ttyx+i, '#'+i+ttyx+i)
|
||||
|
|
Loading…
Add table
Reference in a new issue