Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions usr/lib/live-installer/installer.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,17 @@ def set_error_hook(self, errorhook):

def setup_user(self):
print(" --> Adding new user")
options = []
if self.setup.ecryptfs:
# ecryptfs looks for the /sys mount point in /etc/mtab.. which doesn't exist during the installation.
# it defaults to /sys anyway, so we just need to create an empty /etc/mtab file at this stage.
self.do_run_in_chroot('touch /etc/mtab')
self.do_run_in_chroot('modprobe ecryptfs')
self.do_run_in_chroot('adduser --disabled-password --encrypt-home --gecos "{real_name}" {username}'.format(real_name=self.setup.real_name.replace('"', r'\"'), username=self.setup.username))
else:
self.do_run_in_chroot('adduser --disabled-password --gecos "{real_name}" {username}'.format(real_name=self.setup.real_name.replace('"', r'\"'), username=self.setup.username))
options += ["--encrypt-home"]
if self.setup.oem_mode:
# Use a different UID for internal oem user, so that the final user can use FIRST_UID (1000).
options += ["--firstuid", "2000"]
self.do_run_in_chroot('adduser --disabled-password {options} --gecos "{real_name}" {username}'.format(options=" ".join(options), real_name=self.setup.real_name.replace('"', r'\"'), username=self.setup.username))
for group in 'adm audio bluetooth cdrom dialout dip fax floppy fuse lpadmin netdev plugdev powerdev sambashare scanner sudo tape users vboxusers video'.split():
self.do_run_in_chroot("adduser {user} {group}".format(user=self.setup.username, group=group))

Expand Down