From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1oSfwa-0001mG-1g for mharc-grub-devel@gnu.org; Mon, 29 Aug 2022 10:40:52 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35284) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oSfwY-0001ly-N3 for grub-devel@gnu.org; Mon, 29 Aug 2022 10:40:50 -0400 Received: from smtp-out1.suse.de ([195.135.220.28]:33090) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oSfwX-0002nf-64 for grub-devel@gnu.org; Mon, 29 Aug 2022 10:40:50 -0400 Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 1CD6233693; Mon, 29 Aug 2022 14:40:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1661784048; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=N1LYQAGvUKDeEhO4VOhqZexTed0PKdvYFAA6K+gN5JU=; b=XvSrYt0hXm7G1GyCdhmy+QqYZHBxD+BPk++goYqmYr+GXjSEAhAbptDV1+VPCfafVhROcP wMWpwh1MnE2fdTBG0gSXRVbSTgI3nuZNqdA+b+8m89k5hkBcuONuAh1TiqUM7kgD/+z+f+ 0pmu6knps7MXQ5FKLTTyIWEGglqxE48= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1661784048; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=N1LYQAGvUKDeEhO4VOhqZexTed0PKdvYFAA6K+gN5JU=; b=LMiIEwHJMKglgd6OKY2zDDhjlEAFTp7Caw/N/0bNhGn4RPYfDREfwCCfEAKhX2gctW2EVV ln+mZHmxjqkMJWBw== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id CCAC4133A6; Mon, 29 Aug 2022 14:40:47 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id 4mDLLu/PDGMYcgAAMHmgww (envelope-from ); Mon, 29 Aug 2022 14:40:47 +0000 Date: Mon, 29 Aug 2022 16:40:46 +0200 From: Ismael Luceno To: Michael Chang Cc: The development of GNU GRUB Subject: Re: [PATCH 2/2] Ensure nvram is available and functional on IEEE1275 Message-ID: <20220829164046.441e4216@pirotess> In-Reply-To: <20220825042416.GA14934@mazu> References: <20220824160311.21160-1-iluceno@suse.de> <20220824160311.21160-3-iluceno@suse.de> <20220825042416.GA14934@mazu> Organization: SUSE MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Received-SPF: pass client-ip=195.135.220.28; envelope-from=iluceno@suse.de; helo=smtp-out1.suse.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, 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, 29 Aug 2022 14:40:51 -0000 On Thu, 25 Aug 2022 12:24:17 +0800 Michael Chang wrote: <...> > Apparently there's missing grub_set_install_backup_ponr between > successful image embedding and grub_install_register_ieee1275 and we > should fix that as well. Thanks for the feedback; I've sent v2. <...> > > + if (linux_kmod_load("nvram")) > > + grub_util_error (_("%s: kernel module not found"), "nvram"); > > + fd = open ("/dev/nvram", O_RDWR); > > + if (fd == -1) > > + grub_util_error ("/dev/nvram: %s", strerror(errno)); <...> > I'm wondering why it is needed. The nvram module should be loaded > on-demand via linux kernel's request_module() and modalias trick > whever /dev/nvram is accessed. It was based on another patch that did so but without the extra checking, I guess both are wrong. It's enough checking /dev/nvram is operational; it's necessary to fail early because other commands down the line may get ENODEV if the module fails to load (e.g. the file may have been removed). I moved this to an earlier point in grub-install.