197
197
LOG.warn("Couldn't determine default kernel for release")
200
util.apt_update(target)
201
out, err = in_chroot(['apt-cache', 'search', package], capture=True)
203
if (len(out.strip()) > 0 and
204
not util.has_pkg_installed(package, target)):
205
util.install_packages([package], target=target)
200
if util.has_pkg_available(package, target):
201
if util.has_pkg_installed(package, target):
202
LOG.debug("Kernel package '%s' already installed", package)
204
LOG.debug("installing kernel package '%s'", package)
205
util.install_packages([package], target=target)
207
LOG.warn("Tried to install kernel %s but package not found."
209
207
if kernel_fallback is not None:
208
LOG.info("Kernel package '%s' not available. "
209
"Installing fallback package '%s'.",
210
package, kernel_fallback)
210
211
util.install_packages([kernel_fallback], target=target)
213
LOG.warn("Kernel package '%s' not available and no fallback."
214
" System may not boot.", package)
213
217
def apply_debconf_selections(cfg, target):