'guix system' can suggest nonexistent kernel modules for the initrd

OpenSubmitted by Eric Brown.
Details
3 participants
  • Eric Brown
  • Ludovic Courtès
  • Timothy Sample
Owner
unassigned
Severity
important
E
E
Eric Brown wrote on 25 Aug 2018 05:13
guix system build bare-bones.scm fails with ahci shpchp
(address . bug-guix@gnu.org)
87a7pb3zqi.fsf@fastmail.com
I am attempting to guix system reconfigure a GuixSD 0.15 (updated)
Macintosh laptop where reconfigure recommends and requires:

(initrd-modules (append (list "ahci" "shpchp")
%base-initrd-modules))

However, the config file that I used at guix system init works
originally with this additional bit of lisp, but a reconfigure gives the
error below.

In an attempt to narrow down, inserting this into bare-bones.scm gives a
similar error. Thanks to samplet for help and confirmation on #guixsd.

------------------------>8------------- bare-bones.scm
;; This is an operating system configuration template
;; for a "bare bones" setup, with no X11 display server.

(use-modules (gnu) (gnu packages linux))
(use-service-modules networking ssh)
(use-package-modules screen ssh)

(operating-system
(host-name "komputilo")
(timezone "Europe/Berlin")
(locale "en_US.utf8")
(initrd-modules (append (list "ahci" "shpchp")
%base-initrd-modules))

;; Boot in "legacy" BIOS mode, assuming /dev/sdX is the
;; target hard disk, and "my-root" is the label of the target
;; root file system.
(bootloader (bootloader-configuration
(bootloader grub-bootloader)
(target "/dev/sdX")))
(file-systems (cons (file-system
(device (file-system-label "my-root"))
(mount-point "/")
(type "ext4"))
%base-file-systems))

;; This is where user accounts are specified. The "root"
;; account is implicit, and is initially created with the
;; empty password.
(users (cons (user-account
(name "alice")
(comment "Bob's sister")
(group "users")

;; Adding the account to the "wheel" group
;; makes it a sudoer. Adding it to "audio"
;; and "video" allows the user to play sound
;; and access the webcam.
(supplementary-groups '("wheel"
"audio" "video"))
(home-directory "/home/alice"))
%base-user-accounts))

;; Globally-installed packages.
(packages (cons* screen openssh %base-packages))

;; Add services to the baseline: a DHCP client and
;; an SSH server.
(services (cons* (dhcp-client-service)
(service openssh-service-type
(openssh-configuration
(port-number 2222)))
%base-services)))

------------------------>8------------- output


An example error:
------------------------>8------------- output
/gnu/store/11hrmawlda4gr1xajwyxlh8miqvp49k0-activate.drv
/gnu/store/8mm7lb5qal9qsfknl3f91g9sgqy8cxxm-boot.drv
/gnu/store/vx2311zqjk1vjhpqqi9cmh1zw96mjiqk-etc.drv
/gnu/store/hrrm5wls9ajpayi8wjf5w4qg7b4x45a8-raw-initrd.drv
/gnu/store/yj9dw5f8lnbqfhjl811yvdx0h06pf0gw-grub-image.png.drv
[ 1/ 2] Compiling './gnu/build/bootloader.scm'...
[ 2/ 2] Compiling './guix/build/utils.scm'...
grafting '/gnu/store/lwgzzwgszv1x6g0bwzn7zkd6cqqp1l31-audit-2.8.4' -> '/gnu/store/kw94vfhdxbg66fd3yhf74fqq50jb3gng-audit-2.8.4'...
grafting '/gnu/store/gpv9sy0l1igpanpsn8mf6i96ahmc9pj8-gnupg-2.2.9' -> '/gnu/store/kx3lvw5ni7clg710wdrkvyl0qjgyl8gg-gnupg-2.2.9'...
grafting '/gnu/store/04dr9902qdijkqm41f7vnsggw9cad9vc-gobject-introspection-1.56.0' -> '/gnu/store/d0gs9bx52gsrcvfkrasgyjngrji2dgml-gobject-introspection-1.56.0'...
grafting '/gnu/store/1hlrfb4896hllzq699aqbc21pjczmvgd-libevent-2.0.22' -> '/gnu/store/i4nn1r614n6xkn5vn0qjaq6i4vymaz3i-libevent-2.0.22'...
grafting '/gnu/store/4jxh7rd5p1667hnagzrxw4q4a9mmvbwm-libevent-2.1.8' -> '/gnu/store/cd18iq8q54gg47pm75n3482mmxc8mjrn-libevent-2.1.8'...
grafting '/gnu/store/wdfnkpb396xq0arss8gzwf1f973zif0n-libosinfo-1.0.0' -> '/gnu/store/1rsn2kb48n7gz6dpabjapldc1a28945s-libosinfo-1.0.0'...
Backtrace:
8 (primitive-load "/gnu/store/5q7mfn597l36jnylycfk1yfifri?")
In ice-9/eval.scm:
619:8 7 (_ #f)
626:19 6 (_ #<directory (guile-user) 7cc140>)
159:9 5 (_ _)
In gnu/build/linux-modules.scm:
184:47 4 (recursive-module-dependencies _ #:lookup-module _)
98:14 3 (module-dependencies _)
85:18 2 (modinfo-section-contents _)
In ice-9/ports.scm:
439:11 1 (call-with-input-file #f #<procedure get-bytevector-al?> ?)
In unknown file:
0 (open-file #f "r" #:encoding #f #:guess-encoding #f)

ERROR: In procedure open-file:
Wrong type (expecting string): #f
builder for `/gnu/store/c0vahbyxh6qkxdrgjr2sjcr35hwc4np8-linux-modules.drv' failed with exit code 1
cannot build derivation `/gnu/store/rwbi4h4mdi8h7h15szxw1jc31vv9kg6p-init.drv': 1 dependencies couldn't be built
cannot build derivation `/gnu/store/hrrm5wls9ajpayi8wjf5w4qg7b4x45a8-raw-initrd.drv': 1 dependencies couldn't be built
cannot build derivation `/gnu/store/4sryh7lwx7jjvlad2ivg29wv32gbida1-grub.cfg.drv': 1 dependencies couldn't be built
guix system: error: build failed: build of `/gnu/store/4sryh7lwx7jjvlad2ivg29wv32gbida1-grub.cfg.drv' failed
root@brown ~/src/guix [env]#
------------------------>8------------- output
T
T
Timothy Sample wrote on 25 Aug 2018 20:52
(name . Eric Brown)(address . brown@fastmail.com)(address . 32524@debbugs.gnu.org)
871sam6zyt.fsf@ngyro.com
Hello,

Eric Brown <brown@fastmail.com> writes:

Toggle quote (13 lines)
> I am attempting to guix system reconfigure a GuixSD 0.15 (updated)
> Macintosh laptop where reconfigure recommends and requires:
>
> (initrd-modules (append (list "ahci" "shpchp")
> %base-initrd-modules))
>
> However, the config file that I used at guix system init works
> originally with this additional bit of lisp, but a reconfigure gives the
> error below.
>
> In an attempt to narrow down, inserting this into bare-bones.scm gives a
> similar error. Thanks to samplet for help and confirmation on #guixsd.

Just to make things clear, the bare-bones config below works with
Linux-Libre 4.17, but not with 4.18. We no longer build the ”shpchp”
module. See commit 3004f1c69b258837b0e49a567787c97479ce6e71, which
includes the following:

-CONFIG_HOTPLUG_PCI_SHPC=m
+# CONFIG_HOTPLUG_PCI_SHPC is not set

I don’t know anything about this module or this change, so I don’t know
if we should change the config file or not. I will leave that to
someone more knowledgeable.

Toggle quote (98 lines)
> ------------------------>8------------- bare-bones.scm
> ;; This is an operating system configuration template
> ;; for a "bare bones" setup, with no X11 display server.
>
> (use-modules (gnu) (gnu packages linux))
> (use-service-modules networking ssh)
> (use-package-modules screen ssh)
>
> (operating-system
> (host-name "komputilo")
> (timezone "Europe/Berlin")
> (locale "en_US.utf8")
>
> (initrd-modules (append (list "ahci" "shpchp")
> %base-initrd-modules))
>
> ;; Boot in "legacy" BIOS mode, assuming /dev/sdX is the
> ;; target hard disk, and "my-root" is the label of the target
> ;; root file system.
> (bootloader (bootloader-configuration
> (bootloader grub-bootloader)
> (target "/dev/sdX")))
> (file-systems (cons (file-system
> (device (file-system-label "my-root"))
> (mount-point "/")
> (type "ext4"))
> %base-file-systems))
>
> ;; This is where user accounts are specified. The "root"
> ;; account is implicit, and is initially created with the
> ;; empty password.
> (users (cons (user-account
> (name "alice")
> (comment "Bob's sister")
> (group "users")
>
> ;; Adding the account to the "wheel" group
> ;; makes it a sudoer. Adding it to "audio"
> ;; and "video" allows the user to play sound
> ;; and access the webcam.
> (supplementary-groups '("wheel"
> "audio" "video"))
> (home-directory "/home/alice"))
> %base-user-accounts))
>
> ;; Globally-installed packages.
> (packages (cons* screen openssh %base-packages))
>
> ;; Add services to the baseline: a DHCP client and
> ;; an SSH server.
> (services (cons* (dhcp-client-service)
> (service openssh-service-type
> (openssh-configuration
> (port-number 2222)))
> %base-services)))
>
> ------------------------>8------------- output
>
>
> An example error:
> ------------------------>8------------- output
> /gnu/store/11hrmawlda4gr1xajwyxlh8miqvp49k0-activate.drv
> /gnu/store/8mm7lb5qal9qsfknl3f91g9sgqy8cxxm-boot.drv
> /gnu/store/vx2311zqjk1vjhpqqi9cmh1zw96mjiqk-etc.drv
> /gnu/store/hrrm5wls9ajpayi8wjf5w4qg7b4x45a8-raw-initrd.drv
> /gnu/store/yj9dw5f8lnbqfhjl811yvdx0h06pf0gw-grub-image.png.drv
> [ 1/ 2] Compiling './gnu/build/bootloader.scm'...
> [ 2/ 2] Compiling './guix/build/utils.scm'...
> grafting '/gnu/store/lwgzzwgszv1x6g0bwzn7zkd6cqqp1l31-audit-2.8.4' -> '/gnu/store/kw94vfhdxbg66fd3yhf74fqq50jb3gng-audit-2.8.4'...
> grafting '/gnu/store/gpv9sy0l1igpanpsn8mf6i96ahmc9pj8-gnupg-2.2.9' -> '/gnu/store/kx3lvw5ni7clg710wdrkvyl0qjgyl8gg-gnupg-2.2.9'...
> grafting '/gnu/store/04dr9902qdijkqm41f7vnsggw9cad9vc-gobject-introspection-1.56.0' -> '/gnu/store/d0gs9bx52gsrcvfkrasgyjngrji2dgml-gobject-introspection-1.56.0'...
> grafting '/gnu/store/1hlrfb4896hllzq699aqbc21pjczmvgd-libevent-2.0.22' -> '/gnu/store/i4nn1r614n6xkn5vn0qjaq6i4vymaz3i-libevent-2.0.22'...
> grafting '/gnu/store/4jxh7rd5p1667hnagzrxw4q4a9mmvbwm-libevent-2.1.8' -> '/gnu/store/cd18iq8q54gg47pm75n3482mmxc8mjrn-libevent-2.1.8'...
> grafting '/gnu/store/wdfnkpb396xq0arss8gzwf1f973zif0n-libosinfo-1.0.0' -> '/gnu/store/1rsn2kb48n7gz6dpabjapldc1a28945s-libosinfo-1.0.0'...
> Backtrace:
> 8 (primitive-load "/gnu/store/5q7mfn597l36jnylycfk1yfifri?")
> In ice-9/eval.scm:
> 619:8 7 (_ #f)
> 626:19 6 (_ #<directory (guile-user) 7cc140>)
> 159:9 5 (_ _)
> In gnu/build/linux-modules.scm:
> 184:47 4 (recursive-module-dependencies _ #:lookup-module _)
> 98:14 3 (module-dependencies _)
> 85:18 2 (modinfo-section-contents _)
> In ice-9/ports.scm:
> 439:11 1 (call-with-input-file #f #<procedure get-bytevector-al?> ?)
> In unknown file:
> 0 (open-file #f "r" #:encoding #f #:guess-encoding #f)
>
> ERROR: In procedure open-file:
> Wrong type (expecting string): #f
> builder for `/gnu/store/c0vahbyxh6qkxdrgjr2sjcr35hwc4np8-linux-modules.drv' failed with exit code 1
> cannot build derivation `/gnu/store/rwbi4h4mdi8h7h15szxw1jc31vv9kg6p-init.drv': 1 dependencies couldn't be built
> cannot build derivation `/gnu/store/hrrm5wls9ajpayi8wjf5w4qg7b4x45a8-raw-initrd.drv': 1 dependencies couldn't be built
> cannot build derivation `/gnu/store/4sryh7lwx7jjvlad2ivg29wv32gbida1-grub.cfg.drv': 1 dependencies couldn't be built
> guix system: error: build failed: build of `/gnu/store/4sryh7lwx7jjvlad2ivg29wv32gbida1-grub.cfg.drv' failed
> root@brown ~/src/guix [env]#
> ------------------------>8------------- output
L
L
Ludovic Courtès wrote on 29 Aug 2018 23:13
(name . Timothy Sample)(address . samplet@ngyro.com)
8736uw7u66.fsf@gnu.org
Hi,

Timothy Sample <samplet@ngyro.com> skribis:

Toggle quote (27 lines)
> Eric Brown <brown@fastmail.com> writes:
>
>> I am attempting to guix system reconfigure a GuixSD 0.15 (updated)
>> Macintosh laptop where reconfigure recommends and requires:
>>
>> (initrd-modules (append (list "ahci" "shpchp")
>> %base-initrd-modules))
>>
>> However, the config file that I used at guix system init works
>> originally with this additional bit of lisp, but a reconfigure gives the
>> error below.
>>
>> In an attempt to narrow down, inserting this into bare-bones.scm gives a
>> similar error. Thanks to samplet for help and confirmation on #guixsd.
>
> Just to make things clear, the bare-bones config below works with
> Linux-Libre 4.17, but not with 4.18. We no longer build the ”shpchp”
> module. See commit 3004f1c69b258837b0e49a567787c97479ce6e71, which
> includes the following:
>
> -CONFIG_HOTPLUG_PCI_SHPC=m
> +# CONFIG_HOTPLUG_PCI_SHPC is not set
>
> I don’t know anything about this module or this change, so I don’t know
> if we should change the config file or not. I will leave that to
> someone more knowledgeable.

I don’t know the rationale of this change, but I understand the problem:
it’s design issue with the module recommendation mechanism. Basically
it looks at modules needed on the current kernel for, say, your root
file system, and then it recommends adding those.

The problem occurs when you’re running on 4.17 and reconfiguring towards
4.18: on your system ‘shpchp’ is necessary, so ‘guix system’ recommends
it, but on the target system it’s not. In that case ‘--skip-checks’ is
needed.

What we could do is determine that ‘shpchp.ko’ is not provided by the
target kernel, though that doesn’t tell us whether it’s needed. Doing
that also has the disadvantage that we must build/download the target
kernel before we can emit the warning, as has been discussed before.

Thoughts?

Ludo’.
L
L
Ludovic Courtès wrote on 31 Aug 2018 12:02
control message for bug #32524
(address . control@debbugs.gnu.org)
87zhx2q2ez.fsf@gnu.org
severity 32524 important
L
L
Ludovic Courtès wrote on 31 Aug 2018 12:03
(address . control@debbugs.gnu.org)
87y3cmq2d9.fsf@gnu.org
retitle 32524 'guix system' can suggest nonexistent kernel modules for the initrd
?