diff options
Diffstat (limited to 'install')
-rwxr-xr-x | install | 18 |
1 files changed, 18 insertions, 0 deletions
@@ -726,12 +726,30 @@ def mount_in_bootenv(): call(['mount', '-F' , 'fd', '-', rootdir + '/dev/fd'], stdout=PIPE, stderr=PIPE) call(['mount', '-F' , 'proc', '-', rootdir + '/proc'], stdout=PIPE, stderr=PIPE) +def set_root_password(): + entry1 = Entry(width=30, password=1, returnExit=0) + entry2 = Entry(width=30, password=1, returnExit=1) + passwd = None + while not passwd: + choice, entries = EntryWindow(screen, title='Set root password', + text='Enter the root password. The password is not shown, you have to type it twice.', + prompts=[('Password', entry1), ('Confirm', entry2)], + allowCancel=0, width=40, entryWidth=30, buttons=['Ok']) + if entries[0] == entries[1]: + passwd = entries[0] + else: + ButtonChoiceWindow(screen, title='Error', + text='Entries do not match. Try again.', buttons=['Ok']) + chpasswd_cmd = Popen(['chpasswd', '-R', rootdir], stderr=PIPE, stdout=PIPE, stdin=PIPE) + chpasswd_cmd.communicate(input='root:'+passwd) + def configure_bootenv(): write_vfstab() mount_in_bootenv() in_bootenv(['/sbin/devfsadm']) configure_packages() configure_network() + set_root_password() create_bootarchive() |