[Uludag-commits] r15097 - in trunk/yali/yali: . gui

uludag-commits at pardus.org.tr uludag-commits at pardus.org.tr
23 Ağu 2007 Per 14:34:47 EEST


Author: gokmen.goksel
Date: Thu Aug 23 14:34:46 2007
New Revision: 15097

Modified:
   trunk/yali/yali/bootloader.py
   trunk/yali/yali/gui/ScrGoodbye.py
   trunk/yali/yali/users.py
Log:
Let's install the f. bootloader..

Modified: trunk/yali/yali/bootloader.py
=================================================================
--- trunk/yali/yali/bootloader.py	(original)
+++ trunk/yali/yali/bootloader.py	Thu Aug 23 14:34:46 2007
@@ -88,12 +88,12 @@
     def write_grub_conf(self, install_root_path,install_dev):
         if not install_dev.startswith("/dev/"):
             install_dev = "/dev/%s" % install_dev
-        
+
         if install_root_path.startswith(install_dev):
             _grb = "hd0"
         else:
             _grb = "hd1"
-        
+
         # some paths has own directories like (/dev/cciss/c0d0p1)
         # it removes /dev/ and gets the device.
         install_root = install_root_path[5:]
@@ -164,7 +164,7 @@
 
         if not install_dev:
             install_dev = self._find_hd0()
-        
+
         dev_str = str(os.path.basename(install_dev))
         ctx.debugger.log("in bootloader.py :: %s --- vs. --- %s " % (dev_str,win_dev))
         if win_dev == dev_str:
@@ -182,7 +182,7 @@
     def install_grub(self, grub_install_root=None):
         # grub installation is always hd0 (http://liste.pardus.org.tr/gelistirici/2007-March/005725.html)
         # if not explicitly defined...
-        
+
         if not grub_install_root.startswith("/dev/"):
             grub_install_root = "/dev/%s" % grub_install_root
 

Modified: trunk/yali/yali/gui/ScrGoodbye.py
=================================================================
--- trunk/yali/yali/gui/ScrGoodbye.py	(original)
+++ trunk/yali/yali/gui/ScrGoodbye.py	Thu Aug 23 14:34:46 2007
@@ -21,6 +21,8 @@
 import yali.users
 import yali.localeutils
 import yali.postinstall
+import yali.bootloader
+import yali.storage
 from yali.gui.ScreenWidget import ScreenWidget
 from yali.gui.YaliDialog import WarningDialog
 import yali.gui.context as ctx
@@ -77,13 +79,12 @@
         self.processPendingActions()
 
     def execute(self):
-
+        self.installBootloader()
         ctx.screens.disableNext()
 
         self.info.show()
         self.info.setAlignment(QLabel.AlignCenter)
 
-
         try:
             ctx.debugger.log("Trying to umount %s" % (ctx.consts.target_dir + "/home"))
             yali.sysutils.umount(ctx.consts.target_dir + "/home")
@@ -131,6 +132,33 @@
         yali.postinstall.migrate_xorg_conf(ctx.installData.keyData.X)
         ctx.debugger.log("xorg.conf merged.")
 
+    def installBootloader(self):
+        ctx.debugger.log("Bootloader is installing...")
+        loader = yali.bootloader.BootLoader()
+        root_part_req = ctx.partrequests.searchPartTypeAndReqType(parttype.root,
+                                                                  request.mountRequestType)
+        _ins_part = root_part_req.partition().getPath()
+        loader.write_grub_conf(_ins_part,ctx.installData.bootLoaderDev)
+
+        # Check for windows partitions.
+        for d in yali.storage.devices:
+            for p in d.getPartitions():
+                fs = p.getFSName()
+                if fs in ("ntfs", "fat32"):
+                    if is_windows_boot(p.getPath(), fs):
+                        win_fs = fs
+                        win_dev = basename(p.getDevicePath())
+                        win_root = basename(p.getPath())
+                        loader.grub_conf_append_win(ctx.installData.bootLoaderDev,
+                                                    win_dev,
+                                                    win_root,
+                                                    win_fs)
+                        continue
+
+        # finally install it
+        loader.install_grub(install_dev)
+        ctx.debugger.log("Bootloader installed.")
+
 class RebootWidget(QWidget):
 
     def __init__(self, *args):

Modified: trunk/yali/yali/users.py
=================================================================
--- trunk/yali/yali/users.py	(original)
+++ trunk/yali/yali/users.py	Thu Aug 23 14:34:46 2007
@@ -96,7 +96,6 @@
                                             {'username': self.username, \
                                              'shadowedpasswd': self.__getShadowed()})
 
-        
         user_home_dir = os.path.join(consts.target_dir, 'home', self.username)
 
         if not os.path.exists(user_home_dir):


Uludag-commits mesaj listesiyle ilgili daha fazla bilgi