From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45926) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d0UV7-00060D-T5 for guix-patches@gnu.org; Tue, 18 Apr 2017 10:53:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d0UV4-0008Rv-Iw for guix-patches@gnu.org; Tue, 18 Apr 2017 10:53:05 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:56673) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1d0UV4-0008Rj-G2 for guix-patches@gnu.org; Tue, 18 Apr 2017 10:53:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1d0UV3-0000MV-TL for guix-patches@gnu.org; Tue, 18 Apr 2017 10:53:01 -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: Date: Tue, 18 Apr 2017 16:51:59 +0200 From: Danny Milosavljevic Message-ID: <20170418165159.2cb80518@scratchpost.org> In-Reply-To: <87vaq2rubm.fsf@gnu.org> References: <20170417170030.2212-1-dannym@scratchpost.org> <87vaq2rubm.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: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: 26544@debbugs.gnu.org Hi Ludo, > Could you explain the =E2=80=9Cbig picture=E2=80=9D, the rationale behind= 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 nothi= ng to do with bootloaders (it's not even a bootloader option - it's just pa= ssing 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 cour= se copy such a prepension-block to each of the bootloader modules, but in m= y opinion it's better if it's moved to (bootloader-independent) boot-parame= ters so everyone just automatically uses the correct kernel arguments, incl= uding which guix system guix should boot. I suspect that this wasn't done before because the boot-parameters are seri= alized to a file "parameters" in the "system" directory. But then "--syste= m=3D" in that file would have to contain the hash value of the syst= em, 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 "paramete= rs" doesn't. I think that that's the best of both worlds. Clients in guix can use data = read from without second-guessing everything and the stor= ed file still doesn't have to solve a hash-functions-really-try-to-prevent-= you-from-doing-that problem - the stored file doesn't contain the hash valu= e of itself (and now doesn't need to). I've successfully tested it by "guix system reconfigure" on my machine and = also by "guix system vm" (full-boot and non-full-boot) on my machine, start= ing from master. > 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." > 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 val= ue into the file. > > -(define (operating-system-parameters-file os) > > +(define (operating-system-boot-parameters os system root-device) =20 >=20 > 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) \"paramet= ers\" =20 >=20 > 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 "SYST= EM"?