From patchwork Thu Mar 23 16:46:18 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Richter X-Patchwork-Id: 742774 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 3vpssc4y4Fz9s85 for ; Fri, 24 Mar 2017 03:47:16 +1100 (AEDT) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3vpssc2RYfzDq93 for ; Fri, 24 Mar 2017 03:47:16 +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 3vpsrs24WnzDq93 for ; Fri, 24 Mar 2017 03:46:37 +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 v2NGikRU126038 for ; Thu, 23 Mar 2017 12:46:34 -0400 Received: from e28smtp06.in.ibm.com (e28smtp06.in.ibm.com [125.16.236.6]) by mx0b-001b2d01.pphosted.com with ESMTP id 29cg2q7vd2-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Thu, 23 Mar 2017 12:46:33 -0400 Received: from localhost by e28smtp06.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 23 Mar 2017 22:16:31 +0530 Received: from d28relay08.in.ibm.com (9.184.220.159) by e28smtp06.in.ibm.com (192.168.1.136) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Thu, 23 Mar 2017 22:16:28 +0530 Received: from d28av01.in.ibm.com (d28av01.in.ibm.com [9.184.220.63]) by d28relay08.in.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v2NGjD9X13828150 for ; Thu, 23 Mar 2017 22:15:13 +0530 Received: from d28av01.in.ibm.com (localhost [127.0.0.1]) by d28av01.in.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id v2NGkRtG012535 for ; Thu, 23 Mar 2017 22:16:27 +0530 Received: from machine.austin.ibm.com ([9.53.92.218]) by d28av01.in.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id v2NGkMxR012433; Thu, 23 Mar 2017 22:16:26 +0530 From: Eric Richter To: petitboot@lists.ozlabs.org Subject: [PATCH 2/4] boot/pb-discover: Use kexec_method config option to determine kexec syscall Date: Thu, 23 Mar 2017 11:46:18 -0500 X-Mailer: git-send-email 2.7.4 In-Reply-To: <1490287580-21725-1-git-send-email-erichte@linux.vnet.ibm.com> References: <1490287580-21725-1-git-send-email-erichte@linux.vnet.ibm.com> X-TM-AS-MML: disable x-cbid: 17032316-0020-0000-0000-000000D872C3 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17032316-0021-0000-0000-000002977790 Message-Id: <1490287580-21725-3-git-send-email-erichte@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-03-23_15:, , 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-1703230147 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_method 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..108f9ae 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_method) ? "-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_method = config->kexec_method; + 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..f508944 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_method; struct load_url_result *image_signature; struct load_url_result *initrd_signature; struct load_url_result *dtb_signature;