]> git.ipfire.org Git - ipfire-3.x.git/commitdiff
Installer can now extract the new image format.
authorMichael Tremer <michael.tremer@ipfire.org>
Sun, 14 Sep 2008 20:06:25 +0000 (20:06 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Sun, 14 Sep 2008 20:06:25 +0000 (20:06 +0000)
lfs/images
src/pomona/src/constants.py
src/pomona/src/pakfireinstall.py

index 5060538c879b2db084b744460f162188e0d4e2ce..991d997b71dad3e51819e0348210a0a12a530e35 100644 (file)
@@ -70,6 +70,7 @@ else # cdrom
        fi
 
        cd $(CDROM_DIR)/tmp && mksquashfs * $(CDROM_DIR)/$(SNAME)-$(VERSION).img
+       cd $(CDROM_DIR) && unsquashfs -ls $(SNAME)-$(VERSION).img > $(SNAME)-$(VERSION).ls
 
        cd $(INSTALLER_DIR) && mksquashfs * $(CDROM_DIR)/pomona-$(VERSION).overlay
 
index 2512811f7da3caa5d36d2d8a628eaa3c9b29e3fb..3cf9447fd891842fd197804d05aa952b153ba83a 100644 (file)
@@ -13,6 +13,7 @@ HARDDISK_PATH = "/mnt/target"
 SOURCE_PATH = "/mnt/source"
 INFO_FILE = ".%sinfo" % (sname,)
 IMAGE_FILE = "%s-%s.img" % (sname, version)
+IMAGE_FILE_LS = "%s-%s.ls" % (sname, version)
 
 REQUIRED_FILES = (IMAGE_FILE,)
 
index c395a26dd0739f70fcb43f3d88c1a291b8c44abc..c49aea9f4e3b849d818ea16a3249c48f3ff4cef2 100644 (file)
@@ -118,37 +118,34 @@ class PomonaPakfire:
         pass
 
     def extractFiles(self, cb, intf, id):
+        filename    = os.path.join(SOURCE_PATH, IMAGE_FILE)
+        filename_ls = os.path.join(SOURCE_PATH, IMAGE_FILE_LS)
 
-        BSIZE = 65535 # 64k
+        fd = open(filename_ls, 'r')
+        filesize = 0
+        while fd.readline():
+            filesize += 1
+        fd.close()
+        cb.setSize(filesize)
 
-        filename = "%s/%s" % (SOURCE_PATH, IMAGE_FILE,)
         filesize = int(os.path.getsize(filename))
         log.info("Source file %s has size of %dKB" % (filename, filesize / 1024,))
-        cb.setSize(filesize)
 
-        fd = open(filename, 'rb')
+        command = "unsquashfs -i -f -d %s %s 2>/dev/tty5" % (HARDDISK_PATH, filename,)
 
-        command = \
-                "lzma_sdk d -si -so 2>/dev/tty5 | cpio -i --verbose -d >/dev/tty5 2>&1"
-
-        os.chdir(HARDDISK_PATH)
-
-        extractor = \
-                subprocess.Popen(command, shell=True,
+        extractor = subprocess.Popen(command, shell=True,
                                  stdout=subprocess.PIPE,
                                  stdin=subprocess.PIPE)
 
         cb.callback(CB_START, title=_("Base system"), text=_("Installing base system..."))
 
-        buf = fd.read(BSIZE)
-        tot = len(buf)
-        while len(buf) >  0:
+        buf = extractor.stdout.readline()
+        tot = 0
+        while buf != "":
+            tot += 1
             cb.callback(CB_PROGRESS, amount=tot)
-            extractor.stdin.write(buf)
-            buf = fd.read(BSIZE)
-            tot += len(buf)
+            buf = extractor.stdout.readline()
 
-        fd.close()
         cb.callback(CB_STOP)
 
 class PakfireBackend(PomonaBackend):