From patchwork Thu Mar 30 18:56:23 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Richter X-Patchwork-Id: 745386 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 ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3vvDRB14hPz9s1h for ; Fri, 31 Mar 2017 05:57:58 +1100 (AEDT) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3vvDRB0KykzDqH8 for ; Fri, 31 Mar 2017 05:57:58 +1100 (AEDT) X-Original-To: petitboot@lists.ozlabs.org Delivered-To: petitboot@lists.ozlabs.org Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3vvDR1314RzDqGy for ; Fri, 31 Mar 2017 05:57:49 +1100 (AEDT) Received: from pps.filterd (m0098413.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.20/8.16.0.20) with SMTP id v2UIrfFg030870 for ; Thu, 30 Mar 2017 14:57:36 -0400 Received: from e23smtp05.au.ibm.com (e23smtp05.au.ibm.com [202.81.31.147]) by mx0b-001b2d01.pphosted.com with ESMTP id 29gx8bmyq3-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Thu, 30 Mar 2017 14:57:36 -0400 Received: from localhost by e23smtp05.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 31 Mar 2017 04:57:33 +1000 Received: from d23relay08.au.ibm.com (202.81.31.227) by e23smtp05.au.ibm.com (202.81.31.211) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Fri, 31 Mar 2017 04:57:31 +1000 Received: from d23av01.au.ibm.com (d23av01.au.ibm.com [9.190.234.96]) by d23relay08.au.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v2UIvMZM53411972 for ; Fri, 31 Mar 2017 05:57:30 +1100 Received: from d23av01.au.ibm.com (localhost [127.0.0.1]) by d23av01.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id v2UIuwTB030855 for ; Fri, 31 Mar 2017 05:56:58 +1100 Received: from machine.austin.ibm.com ([9.53.92.247]) by d23av01.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id v2UIusQc030755; Fri, 31 Mar 2017 05:56:57 +1100 From: Eric Richter To: petitboot@lists.ozlabs.org Subject: [PATCH v2 2/3] boot/pb-discover: Use kexec_file config option to determine kexec syscall Date: Thu, 30 Mar 2017 13:56:23 -0500 X-Mailer: git-send-email 2.7.4 In-Reply-To: <1490900184-26327-1-git-send-email-erichte@linux.vnet.ibm.com> References: <1490900184-26327-1-git-send-email-erichte@linux.vnet.ibm.com> X-TM-AS-MML: disable x-cbid: 17033018-0016-0000-0000-0000022AA708 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17033018-0017-0000-0000-000006A49B76 Message-Id: <1490900184-26327-3-git-send-email-erichte@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-03-30_14:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=1 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1702020001 definitions=main-1703300161 X-BeenThere: petitboot@lists.ozlabs.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Petitboot bootloader development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: petitboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Petitboot" Adds a kexec_file boolean to the boot_task struct to control which syscall is used for kexec loading. If set to true, the parameter for kexec_file_load (-s) is passed to kexec-{tools,lite} instead of the default parameter for kexec_load (-l). Signed-off-by: Eric Richter --- discover/boot.c | 4 +++- discover/boot.h | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/discover/boot.c b/discover/boot.c index fab4b61..cdfed96 100644 --- a/discover/boot.c +++ b/discover/boot.c @@ -105,7 +105,7 @@ static int kexec_load(struct boot_task *boot_task) p = argv; *p++ = pb_system_apps.kexec; /* 1 */ - *p++ = "-l"; /* 2 */ + *p++ = (boot_task->kexec_file) ? "-s" : "-l"; /* 2 */ if (local_initrd) { s_initrd = talloc_asprintf(boot_task, "--initrd=%s", @@ -597,6 +597,8 @@ struct boot_task *boot(void *ctx, struct discover_boot_option *opt, boot_task->args = NULL; } + boot_task->kexec_file = config->kexec_file; + if (cmd && cmd->console && !config->manual_console) boot_task->boot_console = talloc_strdup(boot_task, cmd->console); else diff --git a/discover/boot.h b/discover/boot.h index 69643bf..7019208 100644 --- a/discover/boot.h +++ b/discover/boot.h @@ -33,6 +33,7 @@ struct boot_task { bool cancelled; bool verify_signature; bool decrypt_files; + bool kexec_file; struct load_url_result *image_signature; struct load_url_result *initrd_signature; struct load_url_result *dtb_signature;