def _install_linux_partitions(self, msg, step, steps, weights):
   if self._cfg.is_test:
     for p in self._cfg.linux_partitions:
       if self._installation == 'cancelled': return step
       d = p[0]
       self._update_progressbar(msg + "\n - {0}".format(d), step, steps)
       w = weights[d]
       sleep(w)
       step += w
     return step
   else:
     rootmp = sltl.getMountPoint("/dev/{0}".format(self._cfg.main_partition))
     for p in self._cfg.linux_partitions:
       if self._installation == 'cancelled': return step
       d = p[0]
       self._update_progressbar(msg + "\n - {0}".format(d), step, steps)
       full_dev = "/dev/{0}".format(d)
       fs = p[1]
       mp = p[2]
       sltl.umountDevice(full_dev, deleteMountPoint = False)
       if fs != 'none':
         label = sltl.getFsLabel(d)
         if not label:
           label = os.path.basename(p[2])
           if len(label) > 12:
             label = None # for not having problems
         sltl.makeFs(d, fs, label = label, force = True)
       sltl.mountDevice(full_dev, mountPoint = "{root}/{mp}".format(root = rootmp, mp = mp))
       step += weights[d]
     return step
 def _install_main_partition(self):
   if self._cfg.is_test:
     sleep(1)
   else:
     d = "/dev/{0}".format(self._cfg.main_partition)
     sltl.umountDevice(d, deleteMountPoint = False)
     if self._cfg.main_format != 'none':
       label = sltl.getFsLabel(d)
       if not label:
         label = 'Salix'
       sltl.makeFs(self._cfg.main_partition, self._cfg.main_format, label = label, force = True)
     sltl.mountDevice(d, fsType = self._cfg.main_format)
Example #3
0
 def _umountAll(self, mountPoint):
   self.__debug("umountAll")
   if mountPoint:
     self.__debug("umounting main mount point " + mountPoint)
     self._unbindProcSysDev(mountPoint)
     if self._bootInBootMounted:
       self.__debut("/boot mounted in " + mountPoint + ", so umount it")
       sltl.execCall("chroot {mp} /sbin/umount /boot".format(mp = mountPoint))
     if mountPoint != '/':
       self.__debug("umain mount point ≠ '/' → umount " + mountPoint)
       sltl.umountDevice(mountPoint)
   self._bootInBootMounted = False
   self._procInBootMounted = False
Example #4
0
 def _umountAll(self, mountPoint, mountPointList):
   self.__debug("umountAll")
   if mountPoint:
     for mp in self._bootsMounted:
       self.__debug("umounting " + unicode(mp))
       sltl.umountDevice(mp, deleteMountPoint = False)
     self._bootsMounted = []
     if mountPointList:
       self.__debug("umount other mount points: " + unicode(mountPointList))
       for mp in mountPointList.values():
         if mp == mountPoint:
           continue # skip it, will be unmounted just next
         self.__debug("umount " + unicode(mp))
         sltl.umountDevice(mp)
     if mountPoint != '/':
       self.__debug("main mount point ≠ '/' → umount " + mountPoint)
       sltl.umountDevice(mountPoint)