mirror of
https://github.com/kevingruesser/bootstrap-vz.git
synced 2025-08-24 07:26:29 +00:00
fix root auth and grub settings
This commit is contained in:
parent
6be6879db7
commit
ac6870e37d
3 changed files with 10 additions and 12 deletions
|
@ -17,13 +17,13 @@ GRUB_DEVICE=/dev/sda1
|
||||||
|
|
||||||
|
|
||||||
cat << EOF
|
cat << EOF
|
||||||
set default ${GRUB_DEFAULT}
|
set default=${GRUB_DEFAULT}
|
||||||
set timeout ${GRUB_TIMEOUT}
|
set timeout=${GRUB_TIMEOUT}
|
||||||
insmod part_msdos
|
insmod part_msdos
|
||||||
insmod ext2
|
insmod ext2
|
||||||
insmod gettext
|
insmod gettext
|
||||||
set menu_color_normal=cyan/blue
|
set menu_color_normal=cyan/blue
|
||||||
set meu_color_highlight=white/blue
|
set menu_color_highlight=white/blue
|
||||||
set root='(hd0,msdos1)'
|
set root='(hd0,msdos1)'
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
|
@ -40,10 +40,10 @@ linux_entry ()
|
||||||
title="$(gettext_quoted "%s, with Linux %s")"
|
title="$(gettext_quoted "%s, with Linux %s")"
|
||||||
|
|
||||||
cat << EOF
|
cat << EOF
|
||||||
menuentry 'Debian GNU/Linux, ${version}' --class debian --class gnu-linux --class os {
|
menuentry 'Debian GNU/Linux for OpenNebula, ${version}' --class debian --class gnu-linux --class os {
|
||||||
insmod part_msdos
|
insmod part_msdos
|
||||||
insmod ext2
|
insmod ext2
|
||||||
set timeout ${GRUB_TIMEOUT}
|
set timeout=${GRUB_TIMEOUT}
|
||||||
set root='(hd0,msdos1)'
|
set root='(hd0,msdos1)'
|
||||||
echo 'Loading Linux ${version}'
|
echo 'Loading Linux ${version}'
|
||||||
linux ${rel_dirname}/${basename} root=${GRUB_DEVICE} ro ${args}
|
linux ${rel_dirname}/${basename} root=${GRUB_DEVICE} ro ${args}
|
||||||
|
|
|
@ -30,16 +30,14 @@ class ConfigureGrub(Task):
|
||||||
# 'GRUB_HIDDEN_TIMEOUT=true')
|
# 'GRUB_HIDDEN_TIMEOUT=true')
|
||||||
|
|
||||||
from common.tools import log_check_call
|
from common.tools import log_check_call
|
||||||
log_check_call(['/usr/sbin/chroot', info.root, '/usr/sbin/update-grub'])
|
#log_check_call(['/usr/sbin/chroot', info.root, '/usr/sbin/update-grub'])
|
||||||
log_check_call(['/usr/sbin/chroot', info.root, 'cat', '/boot/grub/grub.cfg'])
|
#log_check_call(['/usr/sbin/chroot', info.root, 'cat', '/boot/grub/grub.cfg'])
|
||||||
log_check_call(['/usr/sbin/chroot', info.root, 'cat', '/boot/grub/device.map'])
|
#log_check_call(['/usr/sbin/chroot', info.root, 'cat', '/boot/grub/device.map'])
|
||||||
log_check_call(['/usr/sbin/chroot', info.root, 'ln', '-s', '/boot/grub/grub.cfg', '/boot/grub/menu.lst'])
|
log_check_call(['/usr/sbin/chroot', info.root, 'ln', '-s', '/boot/grub/grub.cfg', '/boot/grub/menu.lst'])
|
||||||
|
|
||||||
log_check_call(['/usr/sbin/chroot', info.root, 'update-initramfs', '-u'])
|
log_check_call(['/usr/sbin/chroot', info.root, 'update-initramfs', '-u'])
|
||||||
log_check_call(['/usr/sbin/chroot', info.root, 'ls', '-l', '/boot/'])
|
|
||||||
#sed_i(info.root+'/boot/grub/device.map','/dev/sda','/dev/mapper/loop0p1;')
|
|
||||||
log_check_call(['grub-install', '--boot-directory='+info.root+"/boot/", '/dev/loop0'])
|
log_check_call(['grub-install', '--boot-directory='+info.root+"/boot/", '/dev/loop0'])
|
||||||
#sed_i(info.root+'/boot/grub/device.map','/dev/mapper/loop0p1;','/dev/sda')
|
log_check_call(['/usr/sbin/chroot', info.root, '/usr/sbin/update-grub'])
|
||||||
|
|
||||||
class BlackListModules(Task):
|
class BlackListModules(Task):
|
||||||
description = 'Blacklisting kernel modules'
|
description = 'Blacklisting kernel modules'
|
||||||
|
|
|
@ -18,7 +18,7 @@ class SetRootPassword(Task):
|
||||||
def run(self, info):
|
def run(self, info):
|
||||||
from common.tools import log_check_call
|
from common.tools import log_check_call
|
||||||
if info.manifest.credentials['root']:
|
if info.manifest.credentials['root']:
|
||||||
log_check_call(['/usr/sbin/chpasswd'], 'root:'+info.manifest.credentials['root'])
|
log_check_call(['/usr/sbin/chroot', info.root, '/usr/sbin/chpasswd'], 'root:'+info.manifest.credentials['root'])
|
||||||
|
|
||||||
class DisableSSHPasswordAuthentication(Task):
|
class DisableSSHPasswordAuthentication(Task):
|
||||||
description = 'Disabling SSH password authentication'
|
description = 'Disabling SSH password authentication'
|
||||||
|
|
Loading…
Add table
Reference in a new issue