-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain_installer.py
47 lines (44 loc) · 1.43 KB
/
main_installer.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
from installer import *
from storage import *
from bootstrap import *
from chroot import *
from user import *
from bool_confirmation import *
import os
global version
def start_installer():
installer = Installer()
#swct = Shall we continue to
swct_devices = bool_confirmation("Would you like to continue to drive options? [Y/y or N/n] ")
storage = Storage()
if swct_devices is True:
storage.storage_devices()
else:
print("Installation is aborted. Exiting...")
exit()
dbs_ask = bool_confirmation("Should we start the bootstrap? [Y/y or N/n] ")
if dbs_ask is True:
debootstrap = Bootstrap(storage.swap_partition, storage.efi_partition, storage.root_partition)
debootstrap.start()
version = debootstrap.ubuntu_version
else:
print("Exiting...")
exit()
chroot_ask = bool_confirmation("Would you like to continue through chroot? [Y/y or N/n] ")
if chroot_ask is True:
chroot = Chroot(storage.swap_partition, version)
chroot.work()
else:
print("Exiting...")
exit()
user_ask = bool_confirmation("Would you like to create a user in this install? [Y/y or N/n] ")
if user_ask is True:
user = User(storage.efi_partition)
user.create()
else:
print("Exiting...")
os.system("umount -a")
os.system("rm -r /mnt/ubuntu-installer")
print('')
print('')
print('Thank You! Enjoy!')