From patchwork Wed Jul 6 06:19:02 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Mendoza-Jonas X-Patchwork-Id: 645123 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3rkrF25k9hz9sBf for ; Wed, 6 Jul 2016 16:19:18 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=mendozajonas.com header.i=@mendozajonas.com header.b=TrJ9OOgM; dkim-atps=neutral Received: from ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3rkrF24VCWzDqrX for ; Wed, 6 Jul 2016 16:19:18 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=mendozajonas.com header.i=@mendozajonas.com header.b=TrJ9OOgM; dkim-atps=neutral X-Original-To: petitboot@lists.ozlabs.org Delivered-To: petitboot@lists.ozlabs.org Received: from mendozajonas.com (mendozajonas.com [188.166.185.233]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3rkrDy0pTNzDqnH for ; Wed, 6 Jul 2016 16:19:13 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=mendozajonas.com header.i=@mendozajonas.com header.b=TrJ9OOgM; dkim-atps=neutral Received: from skellige.ozlabs.ibm.com (unknown [122.99.82.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: sam@mendozajonas.com) by mendozajonas.com (Postfix) with ESMTPSA id 573A2140055; Wed, 6 Jul 2016 14:19:10 +0800 (SGT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mendozajonas.com; s=mail; t=1467785950; bh=XcPgbl5c77ZIvasMFYSsPfGEdOEJmetsEN3YjZhC3WA=; h=From:To:Cc:Subject:Date:From; b=TrJ9OOgMBScz0KhC1lCPlHQ9Z8E5GlVJfrm5QFIML52MYSlzJms21qAjYQbCgC8mZ OlvkhLdN4XU9S+WE5oQ7tAN2SKpziE/yFL/XGaPK9/SgdRCiFxXVPvm5ylREh8ixpW lsW+kzdQXZB6hm5epXX61iO9kw2OMELH7mJq6680= From: Samuel Mendoza-Jonas To: petitboot@lists.ozlabs.org Subject: [PATCH] discover/device-handler: Ignore options without kernel Date: Wed, 6 Jul 2016 16:19:02 +1000 Message-Id: <20160706061902.9520-1-sam@mendozajonas.com> X-Mailer: git-send-email 2.9.0 X-BeenThere: petitboot@lists.ozlabs.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: Petitboot bootloader development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Samuel Mendoza-Jonas MIME-Version: 1.0 Errors-To: petitboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Petitboot" All boot options must at least have a boot image; ignore any options that do not before trying to resolve them. Signed-off-by: Samuel Mendoza-Jonas --- discover/device-handler.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/discover/device-handler.c b/discover/device-handler.c index cd4e3ac..e230e76 100644 --- a/discover/device-handler.c +++ b/discover/device-handler.c @@ -1191,6 +1191,14 @@ void device_handler_discover_context_commit(struct device_handler *handler, list_for_each_entry_safe(&ctx->boot_options, opt, tmp, list) { list_remove(&opt->list); + /* All boot options need at least a kernel image */ + if (!opt->boot_image || !opt->boot_image->url) { + pb_log("boot option %s is missing boot image, ignoring\n", + opt->option->id); + talloc_free(opt); + continue; + } + if (boot_option_resolve(opt, handler)) { pb_log("boot option %s is resolved, " "sending to clients\n",