def configure_base_system(ns, apt_env, path): prepackages = ns.config.get("pre-packages") if prepackages: log.info("Installing pre-required packages") install_packages(ns, path, prepackages, env=apt_env, extra=["-y", "--force-yes"]) sources = ns.config.get("sources") if sources: log.info("Writing sources.list") sourceslist = generate_sources(sources) write_mounted(ns.mountpoint, "etc/apt/sources.list", sourceslist) log.info("Updating apt") chroot(path, ns.apt_get, "-y", "update", env=apt_env) packages = ns.config.get("packages") if packages: log.info("Installing required packages") install_packages(ns, path, packages, env=apt_env, extra=["-y", "--force-yes"]) log.info("Updating apt") chroot(path, ns.apt_get, "-y", "update", env=apt_env)
def configure_base_system(ns, apt_env, mountpoint): prepackages = ns.config.get("pre-packages") if prepackages: log.info("Installing pre-required packages") install_packages(ns, mountpoint, prepackages, env=apt_env, extra=["-y", "--force-yes"]) sources = ns.config.get("sources") if sources: log.info("Writing sources.list") sourceslist = generate_sources(sources) write_mounted(mountpoint, "etc/apt/sources.list", sourceslist) keys = ns.config.get("keys", []) preferences = ns.config.get("preferences", []) if keys: insert_apt_keys(ns, mountpoint, keys) if preferences: insert_apt_preferences(ns, mountpoint, preferences) if hasattr(ns.preset, 'setup_apt'): ns.preset.setup_apt() log.info("Updating apt") chroot(mountpoint, ns.apt_get, "-y", "update", env=apt_env) packages = ns.config.get("packages") if packages: log.info("Installing required packages") install_packages(ns, mountpoint, packages, env=apt_env, extra=["-y", "--force-yes"]) log.info("Updating apt") chroot(mountpoint, ns.apt_get, "-y", "update", env=apt_env)