diff --git a/lwr/apt_udeb.py b/lwr/apt_udeb.py index b93ccf8..ea3b004 100644 --- a/lwr/apt_udeb.py +++ b/lwr/apt_udeb.py @@ -167,6 +167,22 @@ class AptUdebDownloader(object): packages = re.sub(r"/tmp.*pool", "pool", packages) with open(os.path.join(meta_dir, 'Packages'), 'w') as pkgout: pkgout.write(packages) + def download_debs(self, settings, packages): + main_pool = os.path.join(self.destdir, '..', 'pool', 'main') + handler = get_apt_handler(main_pool, + settings['mirror'], + settings['distribution'], + settings['architecture']) + for pkg_name in packages: + logging.debug(pkg_name) + prefix = pkg_name[0] + # destdir is just a base, needs pool/main/[index]/[name] + if pkg_name[:3] == 'lib': + prefix = pkg_name[:4] + pkg_dir = os.path.join(main_pool, prefix) + if not os.path.isdir(pkg_dir): os.makedirs(pkg_dir) + filename = handler.download_package(pkg_name, pkg_dir) + handler.clean_up_apt() # More mess, this time for debs packages = check_output(['apt-ftparchive', '-o', 'Packages::Extensions=.deb', 'packages', os.path.join(self.destdir, '..', 'pool', 'main')]) meta_dir = os.path.normpath(os.path.join(self.destdir, '..', 'dists', self.codename, 'main', 'binary-%s' % (self.architecture,))) diff --git a/lwr/run.py b/lwr/run.py index ca462d0..8cd0ccf 100644 --- a/lwr/run.py +++ b/lwr/run.py @@ -277,6 +277,10 @@ class LiveWrapper(cliapp.Application): # download all udebs in the suite, except exclude_list apt_udeb.download_udebs(exclude_list) + apt_udeb.download_debs(self.settings, + ["gettext-base", "grub-common", "grub-pc", + "grub-pc-bin", "grub2-common", "libfreetype6", "libfuse2", + "libpng16-16", "os-prober", "ucf"]) # FIXME: generate a Release file apt_udeb.clean_up_apt() print("... completed udeb downloads")