From: Michael Tremer Date: Sun, 14 Sep 2008 20:06:25 +0000 (+0000) Subject: Installer can now extract the new image format. X-Git-Tag: v3.0-alpha1~695 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=32ab3b8564fe594048bd568d0081f3be7a0b614b;p=ipfire-3.x.git Installer can now extract the new image format. --- diff --git a/lfs/images b/lfs/images index 5060538c8..991d997b7 100644 --- a/lfs/images +++ b/lfs/images @@ -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 diff --git a/src/pomona/src/constants.py b/src/pomona/src/constants.py index 2512811f7..3cf9447fd 100644 --- a/src/pomona/src/constants.py +++ b/src/pomona/src/constants.py @@ -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,) diff --git a/src/pomona/src/pakfireinstall.py b/src/pomona/src/pakfireinstall.py index c395a26dd..c49aea9f4 100644 --- a/src/pomona/src/pakfireinstall.py +++ b/src/pomona/src/pakfireinstall.py @@ -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):