Subject: Re: [bug#42193] [WIP 2/6] services: Add 'kernel-profile-service-type'.

From: Brice Waegeneire <[email-masked]>
Date: Wed, 08 Jul 2020 16:22:06 +0000

On 2020-07-08 11:29, pelzflorian (Florian Pelz) wrote:
> Thank you for your work!

Note that it's not finished yet.

> After I apply this kernel profile patch, I get an error:
> 
> florian@florianmacbook ~/git/guix [env]$ ./pre-inst-env guix system
> disk-image --file-system-type=iso9660        gnu/system/install.scm
> substitute: Liste der Substitute von „https://ci.guix.gnu.org“ wird
> aktualisiert … 100.0%
> The following derivations will be built:
>    /gnu/store/l51h17zylvjmapvcpdmmqmvrylv8b2cb-iso9660-image.drv
>    /gnu/store/mhdkqnh4iri5rk1ayqd3xlw04q86zj29-grub.cfg.drv
>    /gnu/store/xvgn60irpzzdwvk30lqpsj2hh81h8jyh-system.drv
>    /gnu/store/6y2r0ab5jcflbajd6843v9g1j0v9xrzj-gc-roots.drv
>    /gnu/store/156m13243bcn2429swq8brp2qmfifi3b-system.drv
> building /gnu/store/156m13243bcn2429swq8brp2qmfifi3b-system.drv...
> |builder for `/gnu/store/156m13243bcn2429swq8brp2qmfifi3b-system.drv'
> failed with exit code 1
> build of /gnu/store/156m13243bcn2429swq8brp2qmfifi3b-system.drv failed
> View build log at
> '/var/log/guix/drvs/15/6m13243bcn2429swq8brp2qmfifi3b-system.drv.bz2'.
> cannot build derivation
> `/gnu/store/6y2r0ab5jcflbajd6843v9g1j0v9xrzj-gc-roots.drv': 1
> dependencies couldn't be built
> cannot build derivation
> `/gnu/store/xvgn60irpzzdwvk30lqpsj2hh81h8jyh-system.drv': 1
> dependencies couldn't be built
> cannot build derivation
> `/gnu/store/l51h17zylvjmapvcpdmmqmvrylv8b2cb-iso9660-image.drv': 1
> dependencies couldn't be built
> guix system: error: build of
> `/gnu/store/l51h17zylvjmapvcpdmmqmvrylv8b2cb-iso9660-image.drv' failed
> florian@florianmacbook ~/git/guix [env]$ bzcat
> /var/log/guix/drvs/15/6m13243bcn2429swq8brp2qmfifi3b-system.drv.bz2
> Backtrace:
>            1 (primitive-load "/gnu/store/59nx7bbflcqzavwsjj3wkq3lwfb?")
>            0 (symlink "/gnu/store/86xgvarqwir47c16x6crx0jra5dgzr62-?" 
> ?)
> 
> ERROR: In procedure symlink:
> In procedure symlink: File exists
> 
> 
> I have no idea where this comes from but I hope you can reproduce the 
> error.

Unfortunately I can't, it build successfully for me when applied on top 
of
6f3ede9ae2b2268181ebc0ca3764d865bd06bd63.  You probably just need to 
clean
your Guix repository and rebuild it from scratch

> In general, I would be happy to use the kernel module configuration
> service for replacing the uvesafb-service-type by something like
> 
>  (simple-service 'uvesafb-module
>              kernel-module-configuration-service-type
>              (list (kernel-module
>                     (name "uvesafb")
>                     (options
>                      (list #~(string-append "v86d=" #$v86d 
> "/sbin/v86d")
>                            "mode_option=1024x768\n"))))))))

I think it should work without gexp/ungexp and the "\n".

> Even better would be if it were possible to detect the resolution to
> use for uvesafb at runtime before the module is loaded.  Is it
> possible to execute as root at runtime before modprobe a script like
> testvbe.scm attached to the first message from
> <https://issues.guix.gnu.org/40538#0> to compute the mode_option to
> use?

AFAIU it's not possible because service extensions are generated at 
build time,
not run time so you can't extend KMCS with a value generated when your 
service
is executed. It is a limitation of the service extension paradigm.

A kind of dirty way to achieve what you want would be for KMCS' options 
field
to accept an arbitrary configuration path that will be symlinked to, 
like
“(options "/var/run/uvesafb/uvesafb.conf")”. That way from uvesafb 
service
you generate that modprobe configuration file at run time (before KMCS) 
and
so when KMCS run modprobe it's direcotry configuration contains a 
symlink
named "uvesafb.conf" which point to "/var/run/uvesafb/uvesafb.conf". But
it doesn't seems Guixy to me.

- Brice