SF.net SVN: morphix: [2378] trunk/morphixinstaller2
[email protected] Tue, 01 Aug 2006 16:33:16 -0700
| Newsgroups | gmane.linux.morphix.cvs |
|---|---|
| Message-ID | <[email protected]> |
Revision: 2378
Author: alextreme
Date: 2006-08-01 16:33:06 -0700 (Tue, 01 Aug 2006)
ViewCVS: http://svn.sourceforge.net/morphix/?rev=2378&view=rev
Log Message:
-----------
* strung together the install and post-install dialog screens. Has very minor chance of working now
Modified Paths:
--------------
trunk/morphixinstaller2/lib_install.py
trunk/morphixinstaller2/morphixinstaller.glade
trunk/morphixinstaller2/morphixinstaller.py
Modified: trunk/morphixinstaller2/lib_install.py
===================================================================
--- trunk/morphixinstaller2/lib_install.py 2006-07-31 15:53:52 UTC (rev 2377)
+++ trunk/morphixinstaller2/lib_install.py 2006-08-01 23:33:06 UTC (rev 2378)
@@ -22,8 +22,9 @@
self.selected_harddisk = ""
self.selected_swap = ""
self.selected_root = ""
- self.root_mountpoint = ""
-
+ self.root_mountpoint = "/mnt/target"
+ self.filesystem_type = "ext3"
+
self.do_debug = 0
if not os.access(self.mkinitrd_path, os.X_OK):
@@ -185,11 +186,11 @@
return partitioners
- def makeSwap(self, swap_partition):
- if swap_partition == "" or swap_partition == "none":
+ def makeSwap(self):
+ if self.swap_partition == "" or self.swap_partition == "none":
return True
- self.executeCommand("mkswap " + swap_partition)
+ self.executeCommand("mkswap " + self.swap_partition)
return True
def makeFilesystem(self, partition, filesystem):
@@ -209,17 +210,19 @@
return False
- def makeRoot(self, root_partition, root_mountpoint, filesystem_type = "ext3"):
+ def makeRoot(self, filesystem_type = "ext3"):
""" Setup the root partition, initialize it using the
chosen filesystem type """
- if root_partition == None:
+ if self.root_partition == None:
return False
- self.executeCommand("umount " + root_partition)
- self.executeCommand("umount " + root_mountpoint)
+ self.filesystem_type = filesystem_type
+
+ self.executeCommand("umount " + self.root_partition)
+ self.executeCommand("umount " + self.root_mountpoint)
# TODO: umount expert partitions
- self.makeFilesystem(root_partition, filesystem_type)
+ self.makeFilesystem(self.root_partition, self.filesystem_type)
# TODO: makeFS expert partitions
return True
@@ -267,34 +270,34 @@
def umountTarget():
return
- def buildRoot(self, root_mountpoint, root_partition, filesystem_type, swap_partition):
+ def buildRoot(self):
""" The main copy-livecd function, call it to start the
installation """
- self.executeCommand("mkdir -p " + root_mountpoint)
- self.mountPartition(root_partition, root_mountpoint)
+ self.executeCommand("mkdir -p " + self.root_mountpoint)
+ self.mountPartition(self.root_partition, self.root_mountpoint)
# TODO: mount extra partitions
dirs = ["/bin", "/etc", "/home", "/lib", "/morphix", "/sbin", "/usr", "/opt", "/var", "/root", "/mnt/mini"]
for dir in dirs:
- self.executeCommand("sh -c \"find " + dir + " -depth | cpio -pdmv --quiet " + root_mountpoint + "\"")
+ self.executeCommand("sh -c \"find " + dir + " -depth | cpio -pdmv --quiet " + self.root_mountpoint + "\"")
- self.executeCommand("sh -c \"cd /MorphixCD && find ./dev -depth | cpio -pdmv --quiet " + root_mountpoint + "\"")
- self.executeCommand("sh -c \"cd /MorphixCD && find ./boot -depth | cpio -pdmv --quiet " + root_mountpoint + "\"")
+ self.executeCommand("sh -c \"cd /MorphixCD && find ./dev -depth | cpio -pdmv --quiet " + self.root_mountpoint + "\"")
+ self.executeCommand("sh -c \"cd /MorphixCD && find ./boot -depth | cpio -pdmv --quiet " + self.root_mountpoint + "\"")
- os.unlink(root_mountpoint + "/etc/hosts")
+ os.unlink(self.root_mountpoint + "/etc/hosts")
dirs = ["/cdrom", "/cdrom1", "/floppy", "/mnt", "/proc", "/sys"]
for dir in dirs:
- os.mkdir(root_mountpoint + "/" + dir)
+ os.mkdir(self.root_mountpoint + "/" + dir)
- self.executeMinimoduleInstallscripts(root_mountpoint)
+ self.executeMinimoduleInstallscripts(self.root_mountpoint)
skip_list ["translucency", "cowloop", "mini_fo", "ide_scsi", "cloop"]
- fd = open(root_mountpoint + "/etc/modules", "w")
+ fd = open(self.root_mountpoint + "/etc/modules", "w")
module_data = self.getContents(self.proc_modules)
modules = module_data.split("\n")
for module in modules:
@@ -305,10 +308,10 @@
fd.write(module_name + "\n")
fd.close()
- fd = open(root_mountpoint + "/etc/fstab", "w")
- fd.write(root_partition + " \t / " + filesystem_type + " \t defaults \t 0 \t 1\n")
- if swap_partition != None:
- fd.write(swap_partition + " \t none \t swap \t sw \t 0 \t 0\n")
+ fd = open(self.root_mountpoint + "/etc/fstab", "w")
+ fd.write(self.root_partition + " \t / " + self.filesystem_type + " \t defaults \t 0 \t 1\n")
+ if self.swap_partition != None:
+ fd.write(self.swap_partition + " \t none \t swap \t sw \t 0 \t 0\n")
# TODO: add expert partitions
@@ -325,7 +328,7 @@
sub_item = fstab_list[i].split()
name = sub_item[1]
if name != "none":
- os.mkdir(root_mountpoint + "/" + name)
+ os.mkdir(self.root_mountpoint + "/" + name)
fd.write(fstab_list[i])
fd.close()
@@ -336,22 +339,22 @@
# Was copyKernel in MI1
- def setupInitrd(self, root_mountpoint):
+ def setupInitrd(self):
""" Create an initrd for booting the current kernel in
/boot/initrd.gz """
- mkinitrd_destination = root_mountpoint + "/boot/initrd.gz"
+ mkinitrd_destination = self.root_mountpoint + "/boot/initrd.gz"
kernel_version = self.getKernelVersion()
self.executeCommand("mkinitrd.yaird -o" + mkinitrd_destination + " " + kernel_version)
return True
- def setupEtcFiles(self, root_mountpoint, hostname):
+ def setupEtcFiles(self, hostname):
""" Setup various files in /etc using the given hostname """
- hosts = open(root_mountpoint + "/etc/hosts", "w")
+ hosts = open(self.root_mountpoint + "/etc/hosts", "w")
if not hosts:
return False
@@ -368,24 +371,24 @@
ff02::3 ip6-allhosts\n")
hosts.close()
- hn = open(root_mountpoint + "/etc/hostname", "w")
+ hn = open(self.root_mountpoint + "/etc/hostname", "w")
hn.write(hostname + "\n")
hn.close()
- mailname = open(root_mountpoint + "/etc/mailname", "w")
+ mailname = open(self.root_mountpoint + "/etc/mailname", "w")
mailname.write(hostname + "\n")
mailname.close()
return
- def setRootPassword(self, root_mountpoint, password):
+ def setRootPassword(self, password):
""" Set the root-user password """
- self.executeCommand("chroot " + root_mountpoint + " sh -c \"echo \\\"root:" + password + "\\\" | chpasswd -m \"")
+ self.executeCommand("chroot " + self.root_mountpoint + " sh -c \"echo \\\"root:" + password + "\\\" | chpasswd -m \"")
return
- def setupHomeDirectory(self, root_mountpoint, username, password):
+ def setupHomeDirectory(self, username, password):
""" Setup the user using the password supplied, add him
to a set of default groups """
@@ -393,23 +396,23 @@
user_groups = "dialout,dip,games,cdrom,video,audio,users"
# Remove morph user
- self.executeCommand("chroot " + root_mountpoint + " sh -c 'deluser morph'")
+ self.executeCommand("chroot " + self.root_mountpoint + " sh -c 'deluser morph'")
# Add the new user-group
- self.executeCommand("chroot " + root_mountpoint + " sh -c 'groupadd " + username + "'")
+ self.executeCommand("chroot " + self.root_mountpoint + " sh -c 'groupadd " + username + "'")
# Add the new user
- self.executeCommand('chroot ' + root_mountpoint + ' sh -c \'useradd -m -k /etc/skel -c "Morphix User" -g ' + username + ' -s /bin/bash ' + username + '\'')
+ self.executeCommand('chroot ' + self.root_mountpoint + ' sh -c \'useradd -m -k /etc/skel -c "Morphix User" -g ' + username + ' -s /bin/bash ' + username + '\'')
# Set the password
- self.executeCommand("chroot " + root_mountpoint + " sh -c 'echo \"" + username + ":" + password + "\" | chpasswd -m '")
+ self.executeCommand("chroot " + self.root_mountpoint + " sh -c 'echo \"" + username + ":" + password + "\" | chpasswd -m '")
# Make really really really sure the users files have the
# right permissions
- self.executeCommand("chroot " + root_mountpoint + " sh -c 'chown -R " + username + "." + username + " /home/" + username + "'")
+ self.executeCommand("chroot " + self.root_mountpoint + " sh -c 'chown -R " + username + "." + username + " /home/" + username + "'")
# Add user to the various groups set
- self.executeCommand("chroot " + root_mountpoint + " sh -c 'usernmod -G " + user_groups + " " + username + "'")
+ self.executeCommand("chroot " + self.root_mountpoint + " sh -c 'usernmod -G " + user_groups + " " + username + "'")
return
def getKernelArguments():
@@ -436,7 +439,7 @@
return k_args
- def setupGrub(self, root_mountpoint, grub_mode):
+ def setupGrub(self, grub_mode):
""" Setup grub using the mode chosen:
1 - install into selected-harddisk MBR
@@ -452,22 +455,22 @@
if grub_mode == 3:
return True
- self.executeCommand("mkdir -p " + root_mountpoint + self.grub_dir)
+ self.executeCommand("mkdir -p " + self.root_mountpoint + self.grub_dir)
# initrd now used by default
initrd = "/boot/initrd.gz"
if grub_mode == 1: # install to MBR
- self.executeCommand("grub-install --no-floppy --root-directory=" + root_mountpoint + "/ /dev/" + self.selected_harddisk)
- self.executeCommand("gengrubmenu2 " + root_mountpoint + "/boot/grub /dev/" + self.selected_harddisk + " " + self.selected_root + " \"" + self.getKernelArguments() + "\" /boot/vmlinuz " + initrd)
+ self.executeCommand("grub-install --no-floppy --root-directory=" + self.root_mountpoint + "/ /dev/" + self.selected_harddisk)
+ self.executeCommand("gengrubmenu2 " + self.root_mountpoint + "/boot/grub /dev/" + self.selected_harddisk + " " + self.selected_root + " \"" + self.getKernelArguments() + "\" /boot/vmlinuz " + initrd)
if grub_mode == 2: # install to rootpartition
- self.executeCommand("grub-install --no-floppy --root-directory=" + root_mountpoint + "/ " + self.selected_root)
- self.executeCommand("gengrubmenu2 " + root_mountpoint + "/boot/grub /dev/" + self.selected_root + " " + self.selected_root + " \"" + self.getKernelArguments() + "\" /boot/vmlinuz " + initrd)
+ self.executeCommand("grub-install --no-floppy --root-directory=" + self.root_mountpoint + "/ " + self.selected_root)
+ self.executeCommand("gengrubmenu2 " + self.root_mountpoint + "/boot/grub /dev/" + self.selected_root + " " + self.selected_root + " \"" + self.getKernelArguments() + "\" /boot/vmlinuz " + initrd)
if grub_mode == 4: #
- self.executeCommand("grub-install --no-floppy --root-directory=" + root_mountpoint + "/ " + self.selected_boot)
- self.executeCommand("gengrubmenu2 " + root_mountpoint + "/boot/grub /dev/" + self.selected_boot + " " + self.selected_root + " \"" + self.getKernelArguments() + "\" /boot/vmlinuz " + initrd)
+ self.executeCommand("grub-install --no-floppy --root-directory=" + self.root_mountpoint + "/ " + self.selected_boot)
+ self.executeCommand("gengrubmenu2 " + self.root_mountpoint + "/boot/grub /dev/" + self.selected_boot + " " + self.selected_root + " \"" + self.getKernelArguments() + "\" /boot/vmlinuz " + initrd)
# grub should now be installed in /boot/grub
@@ -477,7 +480,7 @@
# todo?
return True
- def execPreinstallScript(self, root_mountpoint):
+ def execPreinstallScript(self):
"""
Two scripts are called before the actual install phase:
@@ -486,12 +489,12 @@
"""
if os.access("/morphix/preinst_ext.sh", F_OK):
- self.executeCommand("sh /morphix/preinst_ext.sh " + root_mountpoint)
+ self.executeCommand("sh /morphix/preinst_ext.sh " + self.root_mountpoint)
if os.access("/morphix/preinst.sh", F_OK):
- self.executeCommand("chroot " + root_mountpoint + " sh /morphix/preinst_ext.sh")
+ self.executeCommand("chroot " + self.root_mountpoint + " sh /morphix/preinst_ext.sh")
return True
- def execPostinstallScript(self, root_mountpoint, username):
+ def execPostinstallScript(self, username):
"""
Two scripts are called after the actual install phase:
- /morphix/postinst_ext.sh (executed outside the chroot, with first argument being the username of the created user, second argument being the install directory
@@ -499,9 +502,9 @@
"""
if os.access("/morphix/postinst_ext.sh", F_OK):
- self.executeCommand("sh /morphix/preinst_ext.sh " + username + " " + root_mountpoint)
+ self.executeCommand("sh /morphix/preinst_ext.sh " + username + " " + self.root_mountpoint)
if os.access("/morphix/postinst.sh", F_OK):
- self.executeCommand("chroot " + root_mountpoint + " sh /morphix/preinst_ext.sh " + username)
+ self.executeCommand("chroot " + self.root_mountpoint + " sh /morphix/preinst_ext.sh " + username)
return True
def makeGrubBootfloppy(self):
Modified: trunk/morphixinstaller2/morphixinstaller.glade
===================================================================
--- trunk/morphixinstaller2/morphixinstaller.glade 2006-07-31 15:53:52 UTC (rev 2377)
+++ trunk/morphixinstaller2/morphixinstaller.glade 2006-08-01 23:33:06 UTC (rev 2378)
@@ -1946,7 +1946,7 @@
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
<property name="response_id">-11</property>
- <signal name="clicked" handler="gtk_widget_show" object="HelpDialog" last_modification_time="Mon, 16 Feb 2004 09:34:37 GMT"/>
+ <signal name="clicked" handler="displayHelp" object="HelpDialog" last_modification_time="Tue, 01 Aug 2006 23:30:53 GMT"/>
</widget>
</child>
@@ -1961,7 +1961,7 @@
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
<property name="response_id">-5</property>
- <signal name="clicked" handler="on_buttonOkHost_clicked" object="entryHost" last_modification_time="Fri, 31 Jan 2003 23:02:26 GMT"/>
+ <signal name="clicked" handler="displayEnterRoot" object="entryHost" last_modification_time="Tue, 01 Aug 2006 23:11:15 GMT"/>
</widget>
</child>
</widget>
@@ -2136,7 +2136,7 @@
<property name="has_frame">True</property>
<property name="invisible_char">*</property>
<property name="activates_default">False</property>
- <signal name="activate" handler="on_entryHost_activate" last_modification_time="Mon, 15 Mar 2004 23:45:17 GMT"/>
+ <signal name="activate" handler="displayEnterRoot" last_modification_time="Tue, 01 Aug 2006 23:11:52 GMT"/>
</widget>
<packing>
<property name="padding">0</property>
@@ -2218,13 +2218,14 @@
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
<property name="response_id">-11</property>
- <signal name="clicked" handler="gtk_widget_show" object="HelpDialog" last_modification_time="Mon, 17 Feb 2003 23:23:26 GMT"/>
+ <signal name="clicked" handler="displayHelp" object="HelpDialog" last_modification_time="Tue, 01 Aug 2006 23:31:01 GMT"/>
</widget>
</child>
<child>
<widget class="GtkButton" id="buttonCancelRootPasswd">
<property name="visible">True</property>
+ <property name="sensitive">False</property>
<property name="can_default">True</property>
<property name="can_focus">True</property>
<property name="label">gtk-go-back</property>
@@ -2563,13 +2564,14 @@
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
<property name="response_id">-11</property>
- <signal name="clicked" handler="gtk_widget_show" object="HelpDialog" last_modification_time="Mon, 16 Feb 2004 09:34:57 GMT"/>
+ <signal name="clicked" handler="displayHelp" object="HelpDialog" last_modification_time="Tue, 01 Aug 2006 23:30:31 GMT"/>
</widget>
</child>
<child>
<widget class="GtkButton" id="buttonCancelUser">
<property name="visible">True</property>
+ <property name="sensitive">False</property>
<property name="can_default">True</property>
<property name="can_focus">True</property>
<property name="label">gtk-go-back</property>
@@ -2577,7 +2579,7 @@
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
<property name="response_id">-6</property>
- <signal name="clicked" handler="on_buttonCancelUser_clicked" last_modification_time="Fri, 31 Jan 2003 23:03:24 GMT"/>
+ <signal name="clicked" handler="displayEnterRoot" last_modification_time="Tue, 01 Aug 2006 23:16:48 GMT"/>
</widget>
</child>
@@ -2592,7 +2594,7 @@
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
<property name="response_id">-5</property>
- <signal name="clicked" handler="on_buttonOkUser_clicked" object="vbox36" last_modification_time="Fri, 31 Jan 2003 23:03:13 GMT"/>
+ <signal name="clicked" handler="displaySelectBoot" object="vbox36" last_modification_time="Tue, 01 Aug 2006 23:17:03 GMT"/>
</widget>
</child>
</widget>
@@ -2821,7 +2823,7 @@
<property name="has_frame">True</property>
<property name="invisible_char">*</property>
<property name="activates_default">False</property>
- <signal name="activate" handler="on_entryUserPass2_activate" last_modification_time="Mon, 15 Mar 2004 23:46:49 GMT"/>
+ <signal name="activate" handler="displaySelectBoot" last_modification_time="Tue, 01 Aug 2006 23:17:35 GMT"/>
</widget>
<packing>
<property name="left_attach">1</property>
@@ -2986,13 +2988,14 @@
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
<property name="response_id">-11</property>
- <signal name="clicked" handler="gtk_widget_show" object="HelpDialog" last_modification_time="Mon, 17 Feb 2003 23:23:53 GMT"/>
+ <signal name="clicked" handler="displayHelp" object="HelpDialog" last_modification_time="Tue, 01 Aug 2006 23:30:11 GMT"/>
</widget>
</child>
<child>
<widget class="GtkButton" id="buttonCancelBoot">
<property name="visible">True</property>
+ <property name="sensitive">False</property>
<property name="can_default">True</property>
<property name="can_focus">True</property>
<property name="label">gtk-go-back</property>
@@ -3016,7 +3019,7 @@
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
<property name="response_id">-5</property>
- <signal name="clicked" handler="on_buttonOkBoot_clicked" object="vbox39" last_modification_time="Fri, 31 Jan 2003 23:01:19 GMT"/>
+ <signal name="clicked" handler="displayEndScreen" object="vbox39" last_modification_time="Tue, 01 Aug 2006 23:26:00 GMT"/>
</widget>
</child>
</widget>
@@ -3155,7 +3158,7 @@
<property name="spacing">0</property>
<child>
- <widget class="GtkRadioButton" id="radiobuttonLILO">
+ <widget class="GtkRadioButton" id="radiobuttonG1">
<property name="visible">True</property>
<property name="tooltip" translatable="yes">If you have other operating systems, this might make them unavailable. Take care when using this option</property>
<property name="can_focus">True</property>
@@ -3226,7 +3229,7 @@
<property name="spacing">0</property>
<child>
- <widget class="GtkRadioButton" id="radiobuttonLILO2">
+ <widget class="GtkRadioButton" id="radiobuttonG2">
<property name="visible">True</property>
<property name="tooltip" translatable="yes">Useful when there are multiple operating systems on your PC, but you might have to consult their documentation to make Morphix bootable</property>
<property name="can_focus">True</property>
@@ -3237,7 +3240,7 @@
<property name="active">False</property>
<property name="inconsistent">False</property>
<property name="draw_indicator">True</property>
- <property name="group">radiobuttonLILO</property>
+ <property name="group">radiobuttonG1</property>
</widget>
<packing>
<property name="padding">0</property>
@@ -3254,7 +3257,7 @@
</child>
<child>
- <widget class="GtkRadioButton" id="radiobuttonLILO4">
+ <widget class="GtkRadioButton" id="radiobuttonG4">
<property name="can_focus">True</property>
<property name="label" translatable="yes">Install GRUB on boot partition of the harddisk</property>
<property name="use_underline">True</property>
@@ -3263,7 +3266,7 @@
<property name="active">False</property>
<property name="inconsistent">False</property>
<property name="draw_indicator">True</property>
- <property name="group">radiobuttonLILO</property>
+ <property name="group">radiobuttonG1</property>
</widget>
<packing>
<property name="padding">0</property>
@@ -3273,7 +3276,7 @@
</child>
<child>
- <widget class="GtkRadioButton" id="radiobuttonLILO3">
+ <widget class="GtkRadioButton" id="radiobuttonG3">
<property name="visible">True</property>
<property name="tooltip" translatable="yes">This will not make Morphix bootable. Use this when you already have LILO or GRUB installed, and know how to modify it</property>
<property name="can_focus">True</property>
@@ -3284,7 +3287,7 @@
<property name="active">False</property>
<property name="inconsistent">False</property>
<property name="draw_indicator">True</property>
- <property name="group">radiobuttonLILO</property>
+ <property name="group">radiobuttonG1</property>
</widget>
<packing>
<property name="padding">0</property>
@@ -3327,6 +3330,7 @@
<child>
<widget class="GtkCheckButton" id="checkbuttonBootFloppy">
<property name="visible">True</property>
+ <property name="sensitive">False</property>
<property name="tooltip" translatable="yes">You can download a bootfloppy for the Morphix CD on the website, a rescuedisk will be ready in a later release</property>
<property name="can_focus">True</property>
<property name="label" translatable="yes">Make a boot floppy</property>
Modified: trunk/morphixinstaller2/morphixinstaller.py
===================================================================
--- trunk/morphixinstaller2/morphixinstaller.py 2006-07-31 15:53:52 UTC (rev 2377)
+++ trunk/morphixinstaller2/morphixinstaller.py 2006-08-01 23:33:06 UTC (rev 2378)
@@ -180,8 +180,94 @@
self.installer.selected_root = partition[0]
self.hide(self.SelectRoot, "SelectRoot")
+ self.show(self.DoFilesystem, "DoFilesystem")
+
+ if (self.installer.makeSwap() == False):
+ self.miSignalError("Unable to make swap partition")
+
+ if (self.installer.makeRoot() == False):
+ self.miSignalError("Unable to make root partition")
+
+ self.hide(self.DoFilesystem, "DoFilesystem")
self.show(self.DoInstall, "DoInstall")
+ self.installer.execPreInstallScript()
+
+ if (self.installer.buildRoot() == False):
+ self.miSignalError("Unable to copy and setup filesystem")
+ if (self.installer.setupInitrd() == False):
+ self.miSignalError("Unable to setup initrd")
+
+ self.hide(self.DoInstall, "DoInstall")
+ self.show(self.EnterHost, "EnterHost")
+
+
+ def displayEnterRoot(self, widget):
+ entryHost = self.EnterHost.get_widget("entryHost")
+ hostname = entryHost.get_text()
+ if (hostname == ""):
+ print("Error: invalid hostname chosen, using default")
+ hostname = "MyBox"
+
+ if (self.installer.setupEtcFiles(hostname) == false):
+ miSignalError("Unable to set hostname, aborting")
+
+ self.hide(self.EnterHost, "EnterHost")
+ self.show(self.EnterRoot, "EnterRoot")
+
+ def displayEnterUser(self, widget):
+ entryRoot1 = self.EnterRoot.get_widget("entryRoot1")
+ entryRoot2 = self.EnterRoot.get_widget("entryRoot2")
+
+ if (entryRoot1.get_text() != entryRoot2.get_text()):
+ print("Passwords are not equal")
+ return
+
+ if (self.installer.setRootPassword(entryRoot1.get_text()) == False):
+ miSignalError("Unable to set root password, aborting")
+
+ self.hide(self.EnterRoot, "EnterRoot")
+ self.show(self.EnterUser, "EnterUser")
+
+ def displaySelectBoot(self, widget):
+ entryUser = self.EnterUser.get_widget("entryUser")
+ entryUserPass1 = self.EnterUser.get_widget("entryUserPass1")
+ entryUserPass2 = self.EnterUser.get_widget("entryUserPass2")
+
+ if (entryUserPass1.get_text() != entryUserPass2.get_text()):
+ print("Passwords are not equal")
+ return
+
+ if (self.installer.setupHomeDirectory(entryUser.get_text(), entryUserPass1.get_text()) == false):
+ miSignalError("Unable to set up user and home directory for user")
+ self.installer.execPostInstallScript(entryUser.get_text())
+
+ self.hide(self.EnterUser, "EnterUser")
+ self.show(self.SelectBoot, "SelectBoot")
+
+
+ def displayEndScreen(self, widget):
+ rb1 = self.SelectBoot.get_widget("radioButtonG1")
+ rb2 = self.SelectBoot.get_widget("radioButtonG2")
+ rb3 = self.SelectBoot.get_widget("radioButtonG3")
+ rb4 = self.SelectBoot.get_widget("radioButtonG4")
+
+ mode = 3
+ if rb1.get_active():
+ mode = 1
+ elif rb2.get_active():
+ mode = 2
+ elif rb4.get_active():
+ mode = 4
+
+ self.installer.setupGrub(mode)
+
+ def SignalError(self,error):
+ print("An error occurred:")
+ print(error)
+ print("Aborting install. Please contact the developers with the above error message, the options selected and any system details.")
+ sys.exit()
+
def miSignalQuit(self, widget):
sys.exit()
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV