Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1oQbFg-0008AL-7c for mharc-grub-devel@gnu.org; Tue, 23 Aug 2022 17:16:00 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60896) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oQbFe-0008A4-R6 for grub-devel@gnu.org; Tue, 23 Aug 2022 17:15:58 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:29387) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oQbFc-000342-0t for grub-devel@gnu.org; Tue, 23 Aug 2022 17:15:57 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1661289355; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=hnn8X/LRjjTaqKgTjxP6zhfNgu0rkboG0jkyCF61hNk=; b=PZVozjD04kzKfOfzVH5guxsEp0b7UMiTec+2gdEKEt11L+ILBvLMaffqHFNCjaFr3IutVH fj5N9zIk0Dbxsr4T2yUtJ4dVskRNhsoXyClzk9HstymPCpk4OsrKby1zDNi6cReBKmuIzg O4vsKHpybIV/IcVY0W+aGLdfrxkE270= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-606-4XQu1WhlNaaQV6sutEdR7g-1; Tue, 23 Aug 2022 17:15:44 -0400 X-MC-Unique: 4XQu1WhlNaaQV6sutEdR7g-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 443931C0BC69; Tue, 23 Aug 2022 21:15:44 +0000 (UTC) Received: from eesha.redhat.com (unknown [10.22.18.229]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8FA511121315; Tue, 23 Aug 2022 21:15:43 +0000 (UTC) From: Robbie Harwood To: grub-devel@gnu.org Cc: Robbie Harwood , dkiper@net-space.pl, rw@suse.de Subject: [PATCH v3 0/1] Add support for grub-emu to kexec Linux menu entries Date: Tue, 23 Aug 2022 17:15:41 -0400 Message-Id: <20220823211542.167373-1-rharwood@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII"; x-default=true Received-SPF: pass client-ip=170.10.133.124; envelope-from=rharwood@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Aug 2022 21:15:59 -0000 This version syncs with the openSUSE version of the patch. Interdiff attached. Be well, --Robbie Raymund Will (1): Add support for grub-emu to kexec Linux menu entries grub-core/Makefile.am | 1 + grub-core/Makefile.core.def | 2 +- grub-core/kern/emu/main.c | 4 + grub-core/kern/emu/misc.c | 18 +++- grub-core/loader/emu/linux.c | 180 +++++++++++++++++++++++++++++++++++ include/grub/emu/exec.h | 4 +- include/grub/emu/hostfile.h | 3 +- include/grub/emu/misc.h | 3 + 8 files changed, 211 insertions(+), 4 deletions(-) create mode 100644 grub-core/loader/emu/linux.c Interdiff against v2: diff --git a/grub-core/loader/emu/linux.c b/grub-core/loader/emu/linux.c index 020cf56cd1..b5ea48a677 100644 --- a/grub-core/loader/emu/linux.c +++ b/grub-core/loader/emu/linux.c @@ -38,7 +38,7 @@ grub_linux_boot (void) { grub_err_t rc = GRUB_ERR_NONE; char *initrd_param; - const char *kexec[] = { "kexec", "-l", kernel_path, boot_cmdline, NULL, NULL }; + const char *kexec[] = { "kexec", "-la", kernel_path, boot_cmdline, NULL, NULL }; const char *systemctl[] = { "systemctl", "kexec", NULL }; int kexecute = grub_util_get_kexecute (); @@ -53,7 +53,7 @@ grub_linux_boot (void) initrd_param = grub_xasprintf ("%s", ""); } - grub_dprintf ("linux", "%serforming 'kexec -l %s %s %s'\n", + grub_dprintf ("linux", "%serforming 'kexec -la %s %s %s'\n", (kexecute) ? "P" : "Not p", kernel_path, initrd_param, boot_cmdline); @@ -76,10 +76,8 @@ grub_linux_boot (void) (kexecute==1) ? "do-or-die" : "just-in-case"); rc = grub_util_exec (systemctl); - if (rc == GRUB_ERR_NONE) - return rc; - - grub_error (rc, N_("Error trying to perform 'systemctl kexec'")); + if (kexecute == 1) + grub_error (rc, N_("Error trying to perform 'systemctl kexec'")); /* need to check read-only root before resetting hard!? */ grub_dprintf ("linux", "Performing 'kexec -e -x'"); -- 2.35.1