From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57990) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d0mPB-0007yO-96 for guix-patches@gnu.org; Wed, 19 Apr 2017 06:00:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d0mP5-00060M-8q for guix-patches@gnu.org; Wed, 19 Apr 2017 06:00:09 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:57379) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1d0mP5-0005zt-5h for guix-patches@gnu.org; Wed, 19 Apr 2017 06:00:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1d0mP4-0007qy-Tu for guix-patches@gnu.org; Wed, 19 Apr 2017 06:00:02 -0400 Subject: bug#26544: [PATCH] system: Move "--load" and other guix-specific parameters from the grub module to the generic system module. Resent-Message-ID: From: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) References: <20170417170030.2212-1-dannym@scratchpost.org> <87vaq2rubm.fsf@gnu.org> <20170418165159.2cb80518@scratchpost.org> Date: Wed, 19 Apr 2017 11:59:37 +0200 In-Reply-To: <20170418165159.2cb80518@scratchpost.org> (Danny Milosavljevic's message of "Tue, 18 Apr 2017 16:51:59 +0200") Message-ID: <87inm0ra46.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: Danny Milosavljevic Cc: 26544@debbugs.gnu.org Hello! Danny Milosavljevic skribis: >> Could you explain the =E2=80=9Cbig picture=E2=80=9D, the rationale behin= d this >> change? > > Currenly, (gnu system grub) prepends the "--system", "--load" and > "--root" on its own. But that's something specific to the guix system > and has nothing to do with bootloaders (it's not even a bootloader > option - it's just passing it through to the Linux kernel and *that* > is passing some through to Shepherd). > > In connection with the effort to support other bootloaders we could of > course copy such a prepension-block to each of the bootloader modules, > but in my opinion it's better if it's moved to > (bootloader-independent) boot-parameters so everyone just > automatically uses the correct kernel arguments, including which guix > system guix should boot. OK, that makes a lot of sense, indeed. > I suspect that this wasn't done before because the boot-parameters are > serialized to a file "parameters" in the "system" directory. But then > "--system=3D" in that file would have to contain the hash value > of the system, which is ... impossible (or at least very very hard to > do). > > Therefore, this patch makes sure the in-memory > instances do contain "--system" with the correct hash value, but the > stored "parameters" doesn't. OK, I see. I=E2=80=99ll look more closely at the patch but I think it=E2= =80=99s fine to treat --system specially, for the reasons you gave. >> Danny Milosavljevic skribis: >>=20 >> > +(define (bootable-kernel-arguments kernel-arguments system >> > root-device) > >> Please add a docstring to top-level procedures: > > Something like this? > > "Prepend extra arguments to KERNEL-ARGUMENTS that allow the guix > system to boot SYSTEM on ROOT-DEVICE." Yeah, something like that (=E2=80=9Cthat allow SYSTEM to be botted from ROOT-DEVICE=E2=80=9D maybe.) >> So I suggest stick to this convention and thus have: >>=20 >> operating-system-user-kernel-arguments ;arguments specified by the >> user operating-system-kernel-arguments ;all the arguments > > Hmm, I don't think it's really directly specified by the user, is it? > I'm just trying to avoid having to store the file's (more or less) own > hash value into the file. I=E2=80=99ll have to check. >> > -(define (operating-system-parameters-file os) +(define >> > (operating-system-boot-parameters os system root-device) >> I think it would be clearer to rename in a separate patch. > > I'll try. > >> > +(define (read-boot-parameters-file sysgen) + "Read boot >> > parameters from SYSGEN's (system or generation) \"parameters\" >> Please use full words in variable names, typically =E2=80=98system=E2= =80=99 here. > > Ok. Should the docstring say "SYSTEM (system or generation)" or just > "SYSTEM"? The former is clearer IMO. Thank you, Ludo=E2=80=99.