From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1oL7xJ-0008V2-Nx for mharc-grub-devel@gnu.org; Mon, 08 Aug 2022 14:58:25 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59036) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oL7xI-0008UV-Ht for grub-devel@gnu.org; Mon, 08 Aug 2022 14:58:24 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:47608) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oL7x8-0004V9-GE for grub-devel@gnu.org; Mon, 08 Aug 2022 14:58:16 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1659985092; 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: in-reply-to:in-reply-to:references:references; bh=s4Pzxjlzf7kBZDAVPhQIzFGSM0mrQslqGVVwquJNWtA=; b=CT2BKw12/ZeIzf3b4LEzjr/yUv1pP4yRYfLHs9BmOgI7UaEaipgR6ViVJrqYTCUPxlpvba uVHIVD+RQG6qxMayiBcqljLxCv9HaK3sYeGcyF0nQYKBm2jG4F0xSGgJG7D4bCv/uVVVzX CAWhEruO74XfyGlZy31g/Sf1C5lSEHM= Received: from mail-qt1-f197.google.com (mail-qt1-f197.google.com [209.85.160.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-574-5SoIDibTNAaqRDnxVTXi9w-1; Mon, 08 Aug 2022 14:58:10 -0400 X-MC-Unique: 5SoIDibTNAaqRDnxVTXi9w-1 Received: by mail-qt1-f197.google.com with SMTP id hj2-20020a05622a620200b0034286e2a191so7090490qtb.2 for ; Mon, 08 Aug 2022 11:58:10 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version; bh=s4Pzxjlzf7kBZDAVPhQIzFGSM0mrQslqGVVwquJNWtA=; b=pPvgRzrJT5blYp0+9Wwck4d7MdQt8Vu2bhxFZwCS3acCJA0+VNseXi5y/D5+TOPcPs wF6Tor0lxw0UXZpW5RHrHgdpexYnSzWjF2Y8BlP73Frso2BhkY+yNXdZrEWMapuMt2/X 8cZ2l0aWqpiZdkHHvVkWdrwdb3V39noQGWuUBrSLm5FWAd3lP7dkj6SRN0Q72i1QFx71 R3NA1UEcmlOruFF5l8yr/sfAzUovoPyXW+Ut7FJowxD5111fbtRnMkMLUUnEExMlspPp tKZmd8P5eDCkwCaELeO6eGfKTSu/prr1hAm+mWHKIKHCWAuRETxocEJW6CNiv6fyAZoU M8sw== X-Gm-Message-State: ACgBeo0n5oP0NoAGUFB79bv+aQ9Ov9WROhxe2/STKVlHlobUTqupWjer 9nipXo7Hnr+34H1/iaAxMhWRW6nLZ1xNzT5u+WrRvpHzKpegnciYGe9JloYFNfaQVSCluRiyqa9 SeaLQzhrLVn8= X-Received: by 2002:a05:6214:f07:b0:477:b7:7cb8 with SMTP id gw7-20020a0562140f0700b0047700b77cb8mr17444096qvb.26.1659985090001; Mon, 08 Aug 2022 11:58:10 -0700 (PDT) X-Google-Smtp-Source: AA6agR4qtzlUluROJNc8DZt8uILvyXaEULCIh1iXe7FKwlLYAkFv30AAnTeBv+r4f/zOYPRvIUE41w== X-Received: by 2002:a05:6214:f07:b0:477:b7:7cb8 with SMTP id gw7-20020a0562140f0700b0047700b77cb8mr17444075qvb.26.1659985089643; Mon, 08 Aug 2022 11:58:09 -0700 (PDT) Received: from localhost ([2601:184:4181:74c0:862e:5809:ed9e:e10e]) by smtp.gmail.com with ESMTPSA id g18-20020a05620a40d200b006b5f9b7ac87sm11012580qko.26.2022.08.08.11.58.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Aug 2022 11:58:09 -0700 (PDT) From: Robbie Harwood To: Daniel Kiper Cc: grub-devel@gnu.org, Raymund Will , John Jolly , Javier Martinez Canillas Subject: Re: [PATCH v2 1/1] Add support for grub-emu to kexec Linux menu entries In-Reply-To: <20220803152639.cne3dtxofhqakjqr@tomti.i.net-space.pl> References: <20220719203934.319797-1-rharwood@redhat.com> <20220803152639.cne3dtxofhqakjqr@tomti.i.net-space.pl> Date: Mon, 08 Aug 2022 14:58:06 -0400 Message-ID: MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" 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: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, 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: Mon, 08 Aug 2022 18:58:24 -0000 --=-=-= Content-Type: text/plain Daniel Kiper writes: > On Tue, Jul 19, 2022 at 04:39:34PM -0400, Robbie Harwood wrote: > >> +static grub_err_t >> +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 *systemctl[] = { "systemctl", "kexec", NULL }; > > I would prefer if we do not hardcode these commands. E.g. kexec > command has many options which can be useful for debugging. If we > hardcode the command here we cannot use these options. Can you clarify what you would like to see instead? I'm not sure what the alternative would be. >> + rc = grub_util_exec (systemctl); >> + >> + if (rc == GRUB_ERR_NONE) >> + return rc; >> + >> + 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'"); > > I would really do not fall back to 'kexec -e' by default. It is too > dangerous. And again I would not hardcode this command too. Same question as above regarding the alternative... also, can you elaborate on the danger you see here? >> + grub_fatal (N_("Use '"PACKAGE"-emu --kexec' to force a system restart.")); >> + >> + grub_dprintf ("linux", "Performing 'systemctl kexec' (%s) ", >> + (kexecute==1) ? "do-or-die" : "just-in-case"); > > s/kexecute==1/kexecute/ > > Please be more consistent how you check kexecute. None of this is my code yet - I just rebased the existing patch - but I will make these and other requested changes :) Thanks for the review; I'll cut another version once we resolve the conversations above. Be well, --Robbie --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQJIBAEBCgAyFiEEA5qc6hnelQjDaHWqJTL5F2qVpEIFAmLxXL4UHHJoYXJ3b29k QHJlZGhhdC5jb20ACgkQJTL5F2qVpEI2vA//d3N1X6X3Sc821g1hppxOll0kkW+e 3KBZVcQCqECSp+si/itAtA6ZgVOo7dvKwe/+RzRYQ7lE+zcEL2MHMcAKjNBXaLy0 sTYSAy524dj/9m37cYRD+GuJL+2pDLBp+suD8ThSZRsT+d5Cu09n6MlXa7680V0X dpF+SXBpyPNo6zSK+AlUd7+7sqbdjJkxVJYOYYnflaCwcKHVuIgxQSRY6lxm2fAB tgUK3lvKm/DYHgi1jXlCHqXCNkPcSuTSov08KzZJ7PMaji5RCJOv9JJCOn9SBbkG zMJ7b/TQa4IrtmtiKIywVRsaweE50yp+ae3Vws4XRcBZVjkluI58ypsqDatGwUnR hP77CvAG3aLfGwMDPjSMmWKH0Ywp7h6XLI0IZtKMCqFRi8ZT6NShTcoeot5atVlI xagchHp8NpVkuzObCmn4uooycWWhVAnVEpfbAb5I5HtqMmGZYNwR0DRcoBCbl6y7 bTWcHGnSztK+qbfF6aSuVIDsiIi7UKcszXnYQWysfMBmJLfQfAkTs/1n/Or0choQ GdRlO6C6+dkbNKlXri+gDh5WPOvscdWzGzr9H0uKZwToMFSugRyVT0nUA2TCC8Zm shHwqjY+KyL0Ib0g8NyJ8jIkJp7lgyZbi2oBa/AHri5klfnGJheLkSKsSGLgiF3v wur1n2uEISJyBbw= =OkGA -----END PGP SIGNATURE----- --=-=-=--