diff mbox

[bug#53619,0/3] gnu: linux-libre: Build the snd-emu10k1 module.

Message ID 87y22x3nj9.fsf@gmail.com
State Accepted
Headers show

Commit Message

Maxim Cournoyer Jan. 30, 2022, 3:33 a.m. UTC
Hi Leo,

Leo Famulari <leo@famulari.name> writes:

> On Fri, Jan 28, 2022 at 09:30:34PM -0500, Maxim Cournoyer wrote:
>> Hello Guix,
>> 
>> If like me, you discovered a forgotten Sounblaster Live! from 2000 at the
>> bottom of your desktop and wondered why there was no support for it in the
>> Guix kernel config, this series is for you! ;-).
>> 
>> The last patch is unrelated; I find it convenient to have the current Linux
>> kernel's config exposed as /proc/config.gz, which makes it easy to consult,
>> for example to grep for the CONFIG_SND_EMU10K1 option!
>> 
>> Thank you,
>> 
>> Maxim Cournoyer (3):
>>   linux-libre: Normalize the CONFIG_ZONE_DMA to 'y' in kernel configs.
>>   linux-libre: Build SND_EMU10K1 as a module for x86.
>>   gnu: linux-libre: Expose running kernel config as /proc/config.gz.
>
> The first and third patches LGTM.

Thanks for having a look!

> It seems that the 2nd patch brings a lot of unrelated changes. Can you
> revise it to only add support for your old sound card?

The unrelated changes appear just by running 'make oldconfig' on the
master branch:

--8<---------------cut here---------------start------------->8---
$ guix build linux-libre@5.15 -S
/gnu/store/429863zh1abhyj21kpnxkalsv5q5bhi4-linux-libre-5.15.16-guix.tar.xz
maxim@hurd ~$ tar xf /gnu/store/429863zh1abhyj21kpnxkalsv5q5bhi4-linux-libre-5.15.16-guix.tar.xz -C /tmp
maxim@hurd ~$ cd /tmp/linux-5.15.16/
maxim@hurd /tmp/linux-5.15.16$ cp ~/src/guix/gnu/packages/aux-files/linux-libre/5.15-x86_64.conf .config
maxim@hurd /tmp/linux-5.15.16$ guix shell -D linux-libre ncurses
maxim@hurd /tmp/linux-5.15.16 [env]$ make oldconfig
  HOSTCC  scripts/basic/fixdep
  HOSTCC  scripts/kconfig/conf.o
  HOSTCC  scripts/kconfig/confdata.o
  HOSTCC  scripts/kconfig/expr.o
  LEX     scripts/kconfig/lexer.lex.c
  YACC    scripts/kconfig/parser.tab.[ch]
  HOSTCC  scripts/kconfig/lexer.lex.o
  HOSTCC  scripts/kconfig/menu.o
  HOSTCC  scripts/kconfig/parser.tab.o
  HOSTCC  scripts/kconfig/preprocess.o
  HOSTCC  scripts/kconfig/symbol.o
  HOSTCC  scripts/kconfig/util.o
  HOSTLD  scripts/kconfig/conf
*
* Restart config...
*
*
* Bootup logo
*
Bootup logo (LOGO) [Y/n/?] y
  Standard black and white Linux logo (LOGO_LINUX_MONO) [N/y/?] n
  Standard 16-color Linux logo (LOGO_LINUX_VGA16) [N/y/?] n
  Standard 224-color Linux logo (LOGO_LINUX_CLUT224) [N/y/?] n
  224-color Linux-libre logo (LOGO_LIBRE_CLUT224) [Y/n/?] (NEW) n
#
# configuration written to .config
#
maxim@hurd /tmp/linux-5.15.16 [env]$ make oldconfig^C
(reverse-i-search)`diff': cp e796b33.^Cff ~/src/guix-master/gnu/packages/patches/jami-memory-usage.patch
(reverse-i-search)`diff': __emacs_complete_pre_command;  echo -n "^[^[pwd=${PWD}^[^[";__EMACS_COMPLETE_WRAPPER='COMP_LINE='\''cp f5e4619.diff'\''; COMP_POINT=$(( 1 + ${#COMP_LINE} )); COMP_CWORD=1; COMP_WORDS=( cp f5e4619.diff ); _longopt cp f5e4619.^Cff cp' compgen -F __emacs_complete_wrapper -- f5e4619.diff 2>/dev/null
maxim@hurd /tmp/linux-5.15.16 [env]$ diff -u .config{.old,}
--8<---------------cut here---------------end--------------->8---

They appear to me as KConfig changes in the newer releases that weren't
propagated to the config files checked.  I've currently running a
reconfigure system on the kernel with an Soundblaster Audigy 2 sound
card; works well :-).

--8<---------------cut here---------------start------------->8---
$ zgrep EMU10K1 /proc/config.gz 
CONFIG_GAMEPORT_EMU10K1=m
CONFIG_SND_EMU10K1=m
CONFIG_SND_EMU10K1_SEQ=m
# CONFIG_SND_EMU10K1X is not set
--8<---------------cut here---------------end--------------->8---

Thanks,

Maxim

Comments

Leo Famulari Jan. 30, 2022, 7:14 p.m. UTC | #1
On Sat, Jan 29, 2022 at 10:33:46PM -0500, Maxim Cournoyer wrote:
> The unrelated changes appear just by running 'make oldconfig' on the
> master branch:

Understood. If you check the history of the kernel configs, you'll see
that we try to avoid making unnecessary changes to them within a kernel
series. I think that practice is an important source of stability for
Guix System users.

So, could you try to make only the changes necessary to make
your sound card work? You might have to manually edit the config files.
That is something that we do.

Examples of unnecessary changes:

> -CONFIG_CC_VERSION_TEXT="gcc (GCC) 11.2.0"
> +CONFIG_CC_VERSION_TEXT="gcc (GCC) 10.3.0"
>  CONFIG_CC_IS_GCC=y
> -CONFIG_GCC_VERSION=110200
> +CONFIG_GCC_VERSION=100300
>  CONFIG_CLANG_VERSION=0
>  CONFIG_AS_IS_GNU=y
> -CONFIG_AS_VERSION=23400
> +CONFIG_AS_VERSION=23700
>  CONFIG_LD_IS_BFD=y
> -CONFIG_LD_VERSION=23400
> +CONFIG_LD_VERSION=23700
>  CONFIG_LLD_VERSION=0
>  CONFIG_CC_CAN_LINK=y
>  CONFIG_CC_CAN_LINK_STATIC=y
>  CONFIG_CC_HAS_ASM_GOTO=y
> -CONFIG_CC_HAS_ASM_GOTO_OUTPUT=y
>  CONFIG_CC_HAS_ASM_INLINE=y
>  CONFIG_CC_HAS_NO_PROFILE_FN_ATTR=y
>  CONFIG_IRQ_WORK=y

> -CONFIG_X86_PLATFORM_DRIVERS_INTEL=y

> -CONFIG_CC_HAS_ZERO_CALL_USED_REGS=y
> -# CONFIG_ZERO_CALL_USED_REGS is not set
^
This one disables a new security feature, we definitely don't want to
disable that.

> -CONFIG_HAVE_KCSAN_COMPILER=y
> -# CONFIG_KCSAN is not set
Maxim Cournoyer Jan. 31, 2022, 4:45 a.m. UTC | #2
Hi Leo,

Leo Famulari <leo@famulari.name> writes:

> On Sat, Jan 29, 2022 at 10:33:46PM -0500, Maxim Cournoyer wrote:
>> The unrelated changes appear just by running 'make oldconfig' on the
>> master branch:
>
> Understood. If you check the history of the kernel configs, you'll see
> that we try to avoid making unnecessary changes to them within a kernel
> series. I think that practice is an important source of stability for
> Guix System users.

OK!  Thanks for explaining this; I was wondering about which methodology
were used.  It's reasonable.

> So, could you try to make only the changes necessary to make
> your sound card work? You might have to manually edit the config files.
> That is something that we do.
>
> Examples of unnecessary changes:
>
>> -CONFIG_CC_VERSION_TEXT="gcc (GCC) 11.2.0"
>> +CONFIG_CC_VERSION_TEXT="gcc (GCC) 10.3.0"
>>  CONFIG_CC_IS_GCC=y
>> -CONFIG_GCC_VERSION=110200
>> +CONFIG_GCC_VERSION=100300
>>  CONFIG_CLANG_VERSION=0
>>  CONFIG_AS_IS_GNU=y
>> -CONFIG_AS_VERSION=23400
>> +CONFIG_AS_VERSION=23700
>>  CONFIG_LD_IS_BFD=y
>> -CONFIG_LD_VERSION=23400
>> +CONFIG_LD_VERSION=23700
>>  CONFIG_LLD_VERSION=0>>  CONFIG_CC_CAN_LINK=y
>>  CONFIG_CC_CAN_LINK_STATIC=y
>>  CONFIG_CC_HAS_ASM_GOTO=y
>> -CONFIG_CC_HAS_ASM_GOTO_OUTPUT=y
>>  CONFIG_CC_HAS_ASM_INLINE=y
>>  CONFIG_CC_HAS_NO_PROFILE_FN_ATTR=y
>>  CONFIG_IRQ_WORK=y

I've dropped that hunk for all touched config files, as well as all the
ones not about CONFIG_SND* options.

>> -CONFIG_X86_PLATFORM_DRIVERS_INTEL=y
>
>> -CONFIG_CC_HAS_ZERO_CALL_USED_REGS=y
>> -# CONFIG_ZERO_CALL_USED_REGS is not set
> ^
> This one disables a new security feature, we definitely don't want to
> disable that.

Ugh.  Not sure why 'make oldconfig' ends up with this.  You'll probably
want to be careful when running it for the next upgrade.

I've adjusted strategy and used grep & sed to add support for the
EMU10K1-based sound cards without the added noise of 'make oldconfig'.

It's interesting to note that EMU10K1 was already enabled for some
configs.

Thank you!

Maxim
Maxim Cournoyer Feb. 6, 2022, 4:51 a.m. UTC | #3
Hello,

As discussed on IRC the other day, I've tested this configuration on all
kernels via 'make check-system TESTS=basic' on x86_64, and the result
was the same as before the change:

--8<---------------cut here---------------start------------->8---
version: 5.16.2 FAIL kernel module not found "framebuffer_coreboot"

version: 5.15.16 OK

version: 5.10.93 OK

version: 5.4.173 OK

version: 4.19.225 FAIL kernel module not found "framebuffer_coreboot"

version: 4.14.262 FAIL kernel module not found "framebuffer_coreboot"

version: 4.9.297 FAIL kernel module not found "framebuffer_coreboot"

version: 4.4.299 FAIL kernel module not found "framebuffer_coreboot"
--8<---------------cut here---------------end--------------->8---

I was testing the different linux-libre kernels using something like:

--8<---------------cut here---------------start------------->8---
modified   gnu/tests.scm
@@ -26,6 +26,7 @@ (define-module (gnu tests)
   #:use-module ((guix ui) #:select (warn-about-load-error))
   #:use-module (gnu bootloader)
   #:use-module (gnu bootloader grub)
+  #:use-module (gnu packages linux)
   #:use-module (gnu system)
   #:use-module (gnu system file-systems)
   #:use-module (gnu system shadow)
@@ -229,6 +230,7 @@ (define %simple-os
                           (type "ext4"))
                         %base-file-systems))
     (firmware '())
+    (kernel linux-libre-4.14)
 
     (users (cons (user-account
                   (name "alice")
--8<---------------cut here---------------end--------------->8---

The failures are all attributable to #52667.

I pushed the series with 1923ac4034653f86b5442417c4ea2a4603c69114.

Thanks for the review,

Closing.

Maxim
Maxim Cournoyer Feb. 7, 2022, 9:35 p.m. UTC | #4
Hi Leo,

I thought I had replied here with a more complete answer, but it seems
it may have fallen into the cracks as well, so I'll summarize what I
tested:

I tested on each kernel and it passed the 'make check-system
TESTS=basic' system test for all kernels not currently failing to boot
due to the coreboot framebuffer issue:

--8<---------------cut here---------------start------------->8---
version: 5.16.2 FAIL kernel module not found "framebuffer_coreboot"

version: 5.15.16 OK

version: 5.10.93 OK

version: 5.4.173 OK

version: 4.19.225 FAIL kernel module not found "framebuffer_coreboot"

version: 4.14.262 FAIL kernel module not found "framebuffer_coreboot"

version: 4.9.297 FAIL kernel module not found "framebuffer_coreboot"

version: 4.4.299 FAIL kernel module not found "framebuffer_coreboot"

Where for the failed kernels the failure was:
gnu/build/linux-modules.scm:257:5: kernel module not found "framebuffer_coreboot" "/gnu/store/dk6bzmfg1zyfhwg3yzwi47ncn5dqb8cr-linux-libre-5.16.5/lib/modules"
--8<---------------cut here---------------end--------------->8---

This has now been merged into master as of
e5c06dce937d96b36fab73df12ccfb6e77d127ac.

Thank you!

Maxim
diff mbox

Patch

--- .config.old 2022-01-29 22:21:49.011196075 -0500
+++ .config     2022-01-29 22:22:16.774374081 -0500
@@ -1,20 +1,19 @@ 
 #
 # Automatically generated file; DO NOT EDIT.
-# Linux/x86 5.15.5 Kernel Configuration
+# Linux/x86 5.15.16-gnu Kernel Configuration
 #
-CONFIG_CC_VERSION_TEXT="gcc (GCC) 11.2.0"
+CONFIG_CC_VERSION_TEXT="gcc (GCC) 10.3.0"
 CONFIG_CC_IS_GCC=y
-CONFIG_GCC_VERSION=110200
+CONFIG_GCC_VERSION=100300
 CONFIG_CLANG_VERSION=0
 CONFIG_AS_IS_GNU=y
-CONFIG_AS_VERSION=23400
+CONFIG_AS_VERSION=23700
 CONFIG_LD_IS_BFD=y
-CONFIG_LD_VERSION=23400
+CONFIG_LD_VERSION=23700
 CONFIG_LLD_VERSION=0
 CONFIG_CC_CAN_LINK=y
 CONFIG_CC_CAN_LINK_STATIC=y
 CONFIG_CC_HAS_ASM_GOTO=y
-CONFIG_CC_HAS_ASM_GOTO_OUTPUT=y
 CONFIG_CC_HAS_ASM_INLINE=y
 CONFIG_CC_HAS_NO_PROFILE_FN_ATTR=y
 CONFIG_IRQ_WORK=y
@@ -6763,6 +6762,7 @@ 
 # CONFIG_LOGO_LINUX_MONO is not set
 # CONFIG_LOGO_LINUX_VGA16 is not set
 # CONFIG_LOGO_LINUX_CLUT224 is not set
+# CONFIG_LOGO_LIBRE_CLUT224 is not set
 # end of Graphics support
 
 CONFIG_SOUND=m
@@ -8776,7 +8776,6 @@ 
 CONFIG_THINKPAD_ACPI_VIDEO=y
 CONFIG_THINKPAD_ACPI_HOTKEY_POLL=y
 CONFIG_THINKPAD_LMI=m
-CONFIG_X86_PLATFORM_DRIVERS_INTEL=y
 CONFIG_INTEL_ATOMISP2_PDX86=y
 CONFIG_INTEL_ATOMISP2_LED=m
 CONFIG_INTEL_SAR_INT1092=m
@@ -10322,8 +10321,6 @@ 
 CONFIG_STACKLEAK_RUNTIME_DISABLE=y
 CONFIG_INIT_ON_ALLOC_DEFAULT_ON=y
 # CONFIG_INIT_ON_FREE_DEFAULT_ON is not set
-CONFIG_CC_HAS_ZERO_CALL_USED_REGS=y
-# CONFIG_ZERO_CALL_USED_REGS is not set
 # end of Memory initialization
 # end of Kernel hardening options
 # end of Security options
@@ -10806,8 +10803,6 @@ 
 CONFIG_ARCH_HAS_UBSAN_SANITIZE_ALL=y
 # CONFIG_UBSAN is not set
 CONFIG_HAVE_ARCH_KCSAN=y
-CONFIG_HAVE_KCSAN_COMPILER=y
-# CONFIG_KCSAN is not set
 # end of Generic Kernel Debugging Instruments
 
 CONFIG_DEBUG_KERNEL=y