From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1oNz6T-0003Ql-4K for mharc-grub-devel@gnu.org; Tue, 16 Aug 2022 12:07:41 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45562) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oNz6M-0003Mp-7X for grub-devel@gnu.org; Tue, 16 Aug 2022 12:07:36 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:44753) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oNz6I-0005ZL-LQ for grub-devel@gnu.org; Tue, 16 Aug 2022 12:07:32 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1660666032; 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=01zNCu31tsZm6YK7BvYrGU9RaG9hA6wxhe+ooaNL59Q=; b=PjMpfbSoH3UYz7eGXSg9ZOa2uWce/FjlTABJ/uaua18Dg8+Yv2c455zUV5g4RS5lb0lxdF jtzBf/PZSuu7A1GwFSJprjiq4vV5cS5vGX9/jxYqkEpYWrUJDylCQqaKkvsr4+PMqg3XPb J7dnGXRwyW3U2YFCPgIi/iJwjnSpJAM= Received: from mail-qt1-f200.google.com (mail-qt1-f200.google.com [209.85.160.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-154-RiVy79GLNNm3YaIAanVEZg-1; Tue, 16 Aug 2022 12:07:10 -0400 X-MC-Unique: RiVy79GLNNm3YaIAanVEZg-1 Received: by mail-qt1-f200.google.com with SMTP id fy12-20020a05622a5a0c00b00344569022f7so5609094qtb.17 for ; Tue, 16 Aug 2022 09:07:10 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:x-gm-message-state:from:to:cc; bh=01zNCu31tsZm6YK7BvYrGU9RaG9hA6wxhe+ooaNL59Q=; b=amazrqQDYRDZY0LUQsFmai50ExpLys9Vjqh3AgSaNAPfjHVgm4SxUd5AEuAz+OUStA xbfJ1mlXb2ZZ5+PBdB9+AXM7bUlQq7Xx7ZpXTNOaHFLEK95UIY/dbKVrOhzlxZngtzKp QswfbEh0J940lWQ2CSq+ziC6Rl+hN7gm+zf09GKGCVyGTIXFPU1q4unpz/RM61sRGH5e ScLRgy6mvf16OFgPhpnP1I4cJxr0LXbu9VmqxaPBgLSjFYv1mbruQuME0/eY7SoiSWqb EmTTevfnTaoh2x1cn8oPLi1dnqfVKg8tilAMMXCnQjkTuIsFrzoFXlVhkUQKpgHpOCNs nKNg== X-Gm-Message-State: ACgBeo3zdQbknwJUYxiHh1LuGF97vfYPIX2M4bug4WJ3xBeBOLkK/wSv 8rSHQCO5a33Ub0u8Wt7fIvQfHrKJ6u0Puwes6kyqSWkJbBrYuxFipEP80qlsoQgo9LbZOgqdUEK OGH070j0vYk8= X-Received: by 2002:a05:620a:4449:b0:6b2:83d3:2e13 with SMTP id w9-20020a05620a444900b006b283d32e13mr15853051qkp.658.1660666030174; Tue, 16 Aug 2022 09:07:10 -0700 (PDT) X-Google-Smtp-Source: AA6agR7x03WoEZdsk37L6LD3kAO8qrGDfqU3v6zpLDpo2v9lXQcM90RjEwh7VW4b7KtjtOjJJC0zdg== X-Received: by 2002:a05:620a:4449:b0:6b2:83d3:2e13 with SMTP id w9-20020a05620a444900b006b283d32e13mr15853012qkp.658.1660666029745; Tue, 16 Aug 2022 09:07:09 -0700 (PDT) Received: from localhost ([2601:184:4181:74c0:862e:5809:ed9e:e10e]) by smtp.gmail.com with ESMTPSA id n5-20020a05620a294500b006b93fcc9604sm12877126qkp.108.2022.08.16.09.07.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Aug 2022 09:07:09 -0700 (PDT) From: Robbie Harwood To: Raymund Will , Daniel Kiper Cc: grub-devel@gnu.org, John Jolly , Javier Martinez Canillas Subject: Re: [PATCH v2 1/1] Add support for grub-emu to kexec Linux menu entries In-Reply-To: <20220815131615.GA9135@suse.de> References: <20220719203934.319797-1-rharwood@redhat.com> <20220803152639.cne3dtxofhqakjqr@tomti.i.net-space.pl> <20220811180820.asy5a4h5rh3vfr4y@tomti.i.net-space.pl> <20220815131615.GA9135@suse.de> Date: Tue, 16 Aug 2022 12:07: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: Tue, 16 Aug 2022 16:07:36 -0000 --=-=-= Content-Type: text/plain Raymund Will writes: > Hi, > > please let me try to add a bit of context and explain three IMHO > crucial points of the proposed patch. > > First, it is meant to work without any changes to config-files > on 'linux'-systems, simply by calling `grub-emu --kexec`. > And, called this way, it actually uses `systemctl kexec` exclusively > to instruct `systemd` to perform the "kexec"-reboot in a sane and > safe manner. > > Second, it only supports a very limited set of commands in `grub.cfg`, > as `grub-emu` can not implement the full functionality of a firmware- > loaded `grub` binary (like raw-device access) and it hinges massively > on proper `kexec`-support from the machine/firmware, so unfortunately > it won't be universally useful, > > Third, for use in a "pre-boot environment" (i.e. initrd/chroot), which > has full control over it's state, but no (fully) working `systemd`, > a call to `grub-emu --kexec --kexec` changes the behavior to allow a > fall-forward to `kexec -e`. As a safe-guard for the adventurously > minded `systemctl kexec` is still tried first! > > This third point describes the use-case the original patch-set was > developed for and the second doesn't hurt (much) on the systems it > is deployed/used in the field. But the first was found to be really > useful, especially on machines, which can reliably `kexec`, but are > dead slow through cold-boot (think "huge memory", "tons of devices") > and/or have "exotic" console setups ("3215" anybody?). Note that, > as the boot configuration (namely `grub.cfg`) wasn't changed, regular > boot can't be affected by this short-cut (particularly, when `kexec` > might have failed). > > Granted, the duplication of `--kexec` to signify "force it", might > as well be spelled out as `--force-kexec` (or something similar). > (But that change will provoke inconsistencies during an indefinite > migration phase, where pre-boot images don't match binaries in the > root filesystem, notably, when rollback snapshots come into play.) Passing --kexec twice (or --force-kexec) doesn't appear to change anything in the versions of this patch I can easily find. We could add the behavior you're describing though - Daniel, would that help with your concerns about it? > Config-overrides in `grub.cfg` in turn would be a nice addition, but > are relatively expensive to implement, as they'd probably need to be > parsed and split into an array for `grub_util_exec()`, right? Yes. It's inevitably best-effort, especially if we can't depend on a working shell. > But, please, still leave sane defaults in the binary, for out-of- > the-box, no-config-changes-necessary usage, pretty please! > > Would it be possible to re-evaluate the proposed patch with this > in mind? > > PS: in light of my statements above, the "description" of this > patch definitely needs re-wording... Any interest in doing that, or should I? Be well, --Robbie --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQJIBAEBCgAyFiEEA5qc6hnelQjDaHWqJTL5F2qVpEIFAmL7wKoUHHJoYXJ3b29k QHJlZGhhdC5jb20ACgkQJTL5F2qVpEJnKw//bG+eBqX7mSM0fC9CpzzWBbhnMI7Z 7/Qoh1fYbBBn1uI7wzmcMJZ+R13Ngcdavd25MT1BFYZVe4Bc+WS4haZ08F3C2duU lFF9k4Sn2k8RFKPZ0AsiZS+id+LSg9RQR6ZCDGv4POKn1QtVjc8r2NzkBAKORqE4 LjsStac7RsxzgrYCa5usEGfvvSZzdkd0o+Berj1sxEbmwbcWSQiaSPzaQ8ZOKozW GsivlqWMrAlDR7B3vIk+cnuQOA/F62Ps6KP5tFzod4xC6Q+Avh46U1Xj1ePT/1jL JaqA7KMyssWln55PGuzAbD4r2omlZfWnbL1kbAxpNM9DYG3utzdDCSJTNw68dchn mN4dfFJJwOmO4C6thCFlDTfZGuN5Ba796AjowAyDaK8zJyfQuX/+iw3fkAZcgbim gkEiZ3rVf6ZzbgnPMVh6Pmto2LYbXF7xWr2PnrP+RMRtlxxUue9bJMjInSh9lHGy zX6yR7OL45+FbDLBqwopl35A/YFESUtPEICQbkSXR+4g7rjdAlWsH5BxKgVKDmfa v9myhNyv9rzp6K0Uoi73LP7N4QJDvVIFO7Ru3J0UF524XfIeTBVClI+tu3fEAKql E1MXerQ3a3ZAA/jir9WLpBcsrdTxomiXzPYO3YvxM0CyOg2eqrhKxX0A9Q0eFu6g Sq59FiPP2ikUy1o= =t/sd -----END PGP SIGNATURE----- --=-=-=--