Compare commits

..

1 Commits

3 changed files with 10 additions and 2 deletions

View File

@@ -2,6 +2,6 @@ set timeout=5
terminal_output console terminal_output console
menuentry "Ubuntu Server Live Image" { menuentry "Ubuntu Server Live Image" {
linux /casper/vmlinuz.efi boot=casper root=LABEL=ISOIMAGE $KERNEL_ARGS linux /casper/vmlinuz.efi boot=casper root=LABEL=ISOIMAGE nomodeset $KERNEL_ARGS
initrd /casper/initrd.lz initrd /casper/initrd.lz
} }

View File

@@ -2,6 +2,6 @@ set timeout=5
terminal_output console terminal_output console
menuentry "Ubuntu Server Live Image" { menuentry "Ubuntu Server Live Image" {
linux /casper/vmlinuz.efi boot=casper iso-scan/filename=${iso_path} $KERNEL_ARGS linux /casper/vmlinuz.efi boot=casper iso-scan/filename=${iso_path} nomodeset $KERNEL_ARGS
initrd /casper/initrd.lz initrd /casper/initrd.lz
} }

View File

@@ -26,6 +26,10 @@ parser.add_argument(
dest='username', dest='username',
action='store', action='store',
required=True) required=True)
parser.add_argument(
'--groups',
dest='groups',
action='store')
FLAGS = parser.parse_args() FLAGS = parser.parse_args()
@@ -38,6 +42,10 @@ def main():
with open(os.path.join(FLAGS.chroot_path, 'etc', 'sudoers.d', FLAGS.username), 'w') as fh: with open(os.path.join(FLAGS.chroot_path, 'etc', 'sudoers.d', FLAGS.username), 'w') as fh:
fh.write('%s\tALL=(ALL) NOPASSWD: ALL\n' % FLAGS.username) fh.write('%s\tALL=(ALL) NOPASSWD: ALL\n' % FLAGS.username)
if FLAGS.groups:
for group in FLAGS.groups.split(","):
module.ExecChroot('adduser', FLAGS.username, group)
if FLAGS.authorized_keys_file: if FLAGS.authorized_keys_file:
dest_dir = os.path.join(FLAGS.chroot_path, 'home', FLAGS.username, '.ssh') dest_dir = os.path.join(FLAGS.chroot_path, 'home', FLAGS.username, '.ssh')
dest_path = os.path.join(dest_dir, 'authorized_keys') dest_path = os.path.join(dest_dir, 'authorized_keys')