Github messages for voidlinux
 help / color / mirror / Atom feed
* [ISSUE] configuration files for linux
@ 2025-04-14  4:23 paigeadelethompson
  2025-04-16  0:02 ` classabbyamp
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: paigeadelethompson @ 2025-04-14  4:23 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 4477 bytes --]

New issue by paigeadelethompson on void-packages repository

https://github.com/void-linux/void-packages/issues/55055

Description:
This might be a better dialog for @Duncaen but I'm nothing the package for the kernel is using the generated (make *config) configuration which is I guess okay people do it but it's not exactly ideal. I'm guessing you use `make olddefconfig` whenever there's an update between versions. (ok) but did you know there is a tool provided in the scripts directory called `scripts/config` ? There's two downsides to actually using it: 

- you can only specify a single parameter per use: 
- there are a lot of options, but you can pretty easily convert to the commands and group them into multiple files that can be sourced in the correct order: 

```
awk '
/^CONFIG_[A-Za-z0-9_]+=y$/ { 
    opt = substr($0, 1, index($0, "=")-1);
    unset_cmd = "scripts/config -d " opt;
    set_cmd = "scripts/config -e " opt;
    prefix = substr(opt, 8);
    sub(/_.*/, "", prefix);
    if (prefix == "") prefix = "MISC";
    file = "CONFIG_" prefix;
    print unset_cmd >> file;
    print set_cmd >> file;
    if (!seen[file]++) sources[file] = 1;
}
/^CONFIG_[A-Za-z0-9_]+=".*"$/ { 
    opt = substr($0, 1, index($0, "=")-1);
    val = substr($0, index($0, "=")+2, length($0)-index($0, "=")-2);
    unset_cmd = "scripts/config -d " opt;
    set_cmd = "scripts/config --set-str " opt " \"" val "\"";
    prefix = substr(opt, 8);
    sub(/_.*/, "", prefix);
    if (prefix == "") prefix = "MISC";
    file = "CONFIG_" prefix;
    print unset_cmd >> file;
    print set_cmd >> file;
    if (!seen[file]++) sources[file] = 1;
}
/^CONFIG_[A-Za-z0-9_]+=m$/ { 
    opt = substr($0, 1, index($0, "=")-1);
    unset_cmd = "scripts/config -d " opt;
    set_cmd = "scripts/config -m " opt;
    prefix = substr(opt, 8);
    sub(/_.*/, "", prefix);
    if (prefix == "") prefix = "MISC";
    file = "CONFIG_" prefix;
    print unset_cmd >> file;
    print set_cmd >> file;
    if (!seen[file]++) sources[file] = 1;
}
/^CONFIG_[A-Za-z0-9_]+=0x[0-9a-fA-F]+$/ { 
    opt = substr($0, 1, index($0, "=")-1);
    val = substr($0, index($0, "=")+1);
    unset_cmd = "scripts/config -d " opt;
    set_cmd = "scripts/config --set-val " opt " " val;
    prefix = substr(opt, 8);
    sub(/_.*/, "", prefix);
    if (prefix == "") prefix = "MISC";
    file = "CONFIG_" prefix;
    print unset_cmd >> file;
    print set_cmd >> file;
    if (!seen[file]++) sources[file] = 1;
}
/^CONFIG_[A-Za-z0-9_]+=[-0-9]+$/ { 
    opt = substr($0, 1, index($0, "=")-1);
    val = substr($0, index($0, "=")+1);
    unset_cmd = "scripts/config -d " opt;
    set_cmd = "scripts/config --set-val " opt " " val;
    prefix = substr(opt, 8);
    sub(/_.*/, "", prefix);
    if (prefix == "") prefix = "MISC";
    file = "CONFIG_" prefix;
    print unset_cmd >> file;
    print set_cmd >> file;
    if (!seen[file]++) sources[file] = 1;
}
END {
    # Print sources in alphabetical order
    PROCINFO["sorted_in"] = "@ind_str_asc";
    for (file in sources) {
        print "source " file;
    }
}' .config
```
- rm .config && make allnoconfig
- source CONFIG_* from wherever 
- `grep "CONFIG_CC_VERSION_TEXT" .config`

```
CONFIG_CC_VERSION_TEXT="ohai2u"
```

the awk script prints the grouped options so that it will produce them in the same order, but CONFIG. But you wouldn't run this awk script routinely or ever more than once. It's just something to put configuration management into better context for tracking configuration changes across revisions. And if you don't know by the time you've ran this what the differences are you can also do something like: `diff <(zcat /proc/config.gz) .config` or `/boot` or wherever you wanna get your old configuration from. 

If you don't trust defaulting to =y for new options you can start from `allnoconfig` then source your options or do both and then diff the two to see what's changed. 

I don't really care for it that much but at least this way you can put some context to what options are enabled vs the automatically generated file which has:

```
#
# Automatically generated file; DO NOT EDIT. <--- 
# Linux/x86 6.14.0-rc5 Kernel Configuration
#
#
# General setup
#
# CONFIG_COMPILE_TEST is not set
# CONFIG_KERNEL_BZIP2 is not set
# CONFIG_KERNEL_LZMA is not set
# CONFIG_KERNEL_XZ is not set
# CONFIG_KERNEL_LZO is not set
# CONFIG_KERNEL_LZ4 is not set
# CONFIG_KERNEL_ZSTD is not set
# CONFIG_WATCH_QUEUE is not set
# CONFIG_USELIB is not set
```


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: configuration files for linux
  2025-04-14  4:23 [ISSUE] configuration files for linux paigeadelethompson
@ 2025-04-16  0:02 ` classabbyamp
  2025-04-23 16:43 ` paigeadelethompson
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: classabbyamp @ 2025-04-16  0:02 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 299 bytes --]

New comment by classabbyamp on void-packages repository

https://github.com/void-linux/void-packages/issues/55055#issuecomment-2807807532

Comment:
kernels use `make oldconfig` https://github.com/void-linux/void-packages/blob/21243dc9734c8f5f7b47bab65aab8ae407d48f70/srcpkgs/linux6.14/template#L108

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: configuration files for linux
  2025-04-14  4:23 [ISSUE] configuration files for linux paigeadelethompson
  2025-04-16  0:02 ` classabbyamp
@ 2025-04-23 16:43 ` paigeadelethompson
  2025-07-23  2:14 ` github-actions
  2025-08-06  2:14 ` [ISSUE] [CLOSED] " github-actions
  3 siblings, 0 replies; 5+ messages in thread
From: paigeadelethompson @ 2025-04-23 16:43 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 2171 bytes --]

New comment by paigeadelethompson on void-packages repository

https://github.com/void-linux/void-packages/issues/55055#issuecomment-2824911796

Comment:
Thank you , yeah sorry I've been falling a bit behind lately, I actually opted for a different solution to build my kernels which has been sufficient enough for the time being but there are some issues with it: 

https://gist.github.com/paigeadelethompson/a94ff2e7cc4916d7feecef96936bb2d7#file-create_vm-sh-L321

specifically with the long list of options I have to -d that either get enabled in defconfig (starting from tinyconfig would be a lot more work I think.) But even some of these options will persist even after disabling them: 

```
➜  /vm cat /mnt/pub/linux/.config | nc termbin.com 9999 
https://termbin.com/fssm
➜  /vm ssh -i /vm/HOME1/id_ed25519 admin@192.168.64.130 "sudo dmesg | head -n 2"
[    0.000000] Linux version 6.14.0 (root@swarm1.netcrave.network) (gcc (GCC) 14.2.1 20250405, GNU ld (GNU Binutils) 2.44) #1 SMP PREEMPT_DYNAMIC Thu Apr 17 15:15:11 UTC 2025
[    0.000000] Command line: fs0:\efi\boot\vmlinuz console=ttyS0 root=/dev/vda2 rootflags=ufstype=ufs2 rootfstype=ufs
```

but this solution is working OK for me for the time being. This script is really weird and experimental it creates a void linux VM for FreeBSD's BHyve hypervisor, and it does this using a chroot from FreeBSD (linux binary compatibility) but it can't really setup/configure efibootmgr or grub that way, and over all it just ended up being easier bypassing the need for an initrd, too because the only filesystem I could use to create a VM this way was UFS2 (because there are no newfs_ext4 tools in the FreeBSD userland except maybe in ports which I wanted to avoid.) Fortunately BHyve's coreboot EFI firmware comes with EFI shell, so I was able to get it to boot using a startup.sh script, requires CONFIG_EFI_STUB=y which should be in my script here but its not (its default anyway.)

It's a little janky I was thinking I might need to update this kernel and it might be better to package it somehow but really the easiest way is to just nfsmount the src tree and build it again if necessary in this case. 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: configuration files for linux
  2025-04-14  4:23 [ISSUE] configuration files for linux paigeadelethompson
  2025-04-16  0:02 ` classabbyamp
  2025-04-23 16:43 ` paigeadelethompson
@ 2025-07-23  2:14 ` github-actions
  2025-08-06  2:14 ` [ISSUE] [CLOSED] " github-actions
  3 siblings, 0 replies; 5+ messages in thread
From: github-actions @ 2025-07-23  2:14 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 293 bytes --]

New comment by github-actions[bot] on void-packages repository

https://github.com/void-linux/void-packages/issues/55055#issuecomment-3105397276

Comment:
Issues become stale 90 days after last activity and are closed 14 days after that.  If this issue is still relevant bump it or assign it.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [ISSUE] [CLOSED] configuration files for linux
  2025-04-14  4:23 [ISSUE] configuration files for linux paigeadelethompson
                   ` (2 preceding siblings ...)
  2025-07-23  2:14 ` github-actions
@ 2025-08-06  2:14 ` github-actions
  3 siblings, 0 replies; 5+ messages in thread
From: github-actions @ 2025-08-06  2:14 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 4480 bytes --]

Closed issue by paigeadelethompson on void-packages repository

https://github.com/void-linux/void-packages/issues/55055

Description:
This might be a better dialog for @Duncaen but I'm nothing the package for the kernel is using the generated (make *config) configuration which is I guess okay people do it but it's not exactly ideal. I'm guessing you use `make olddefconfig` whenever there's an update between versions. (ok) but did you know there is a tool provided in the scripts directory called `scripts/config` ? There's two downsides to actually using it: 

- you can only specify a single parameter per use: 
- there are a lot of options, but you can pretty easily convert to the commands and group them into multiple files that can be sourced in the correct order: 

```
awk '
/^CONFIG_[A-Za-z0-9_]+=y$/ { 
    opt = substr($0, 1, index($0, "=")-1);
    unset_cmd = "scripts/config -d " opt;
    set_cmd = "scripts/config -e " opt;
    prefix = substr(opt, 8);
    sub(/_.*/, "", prefix);
    if (prefix == "") prefix = "MISC";
    file = "CONFIG_" prefix;
    print unset_cmd >> file;
    print set_cmd >> file;
    if (!seen[file]++) sources[file] = 1;
}
/^CONFIG_[A-Za-z0-9_]+=".*"$/ { 
    opt = substr($0, 1, index($0, "=")-1);
    val = substr($0, index($0, "=")+2, length($0)-index($0, "=")-2);
    unset_cmd = "scripts/config -d " opt;
    set_cmd = "scripts/config --set-str " opt " \"" val "\"";
    prefix = substr(opt, 8);
    sub(/_.*/, "", prefix);
    if (prefix == "") prefix = "MISC";
    file = "CONFIG_" prefix;
    print unset_cmd >> file;
    print set_cmd >> file;
    if (!seen[file]++) sources[file] = 1;
}
/^CONFIG_[A-Za-z0-9_]+=m$/ { 
    opt = substr($0, 1, index($0, "=")-1);
    unset_cmd = "scripts/config -d " opt;
    set_cmd = "scripts/config -m " opt;
    prefix = substr(opt, 8);
    sub(/_.*/, "", prefix);
    if (prefix == "") prefix = "MISC";
    file = "CONFIG_" prefix;
    print unset_cmd >> file;
    print set_cmd >> file;
    if (!seen[file]++) sources[file] = 1;
}
/^CONFIG_[A-Za-z0-9_]+=0x[0-9a-fA-F]+$/ { 
    opt = substr($0, 1, index($0, "=")-1);
    val = substr($0, index($0, "=")+1);
    unset_cmd = "scripts/config -d " opt;
    set_cmd = "scripts/config --set-val " opt " " val;
    prefix = substr(opt, 8);
    sub(/_.*/, "", prefix);
    if (prefix == "") prefix = "MISC";
    file = "CONFIG_" prefix;
    print unset_cmd >> file;
    print set_cmd >> file;
    if (!seen[file]++) sources[file] = 1;
}
/^CONFIG_[A-Za-z0-9_]+=[-0-9]+$/ { 
    opt = substr($0, 1, index($0, "=")-1);
    val = substr($0, index($0, "=")+1);
    unset_cmd = "scripts/config -d " opt;
    set_cmd = "scripts/config --set-val " opt " " val;
    prefix = substr(opt, 8);
    sub(/_.*/, "", prefix);
    if (prefix == "") prefix = "MISC";
    file = "CONFIG_" prefix;
    print unset_cmd >> file;
    print set_cmd >> file;
    if (!seen[file]++) sources[file] = 1;
}
END {
    # Print sources in alphabetical order
    PROCINFO["sorted_in"] = "@ind_str_asc";
    for (file in sources) {
        print "source " file;
    }
}' .config
```
- rm .config && make allnoconfig
- source CONFIG_* from wherever 
- `grep "CONFIG_CC_VERSION_TEXT" .config`

```
CONFIG_CC_VERSION_TEXT="ohai2u"
```

the awk script prints the grouped options so that it will produce them in the same order, but CONFIG. But you wouldn't run this awk script routinely or ever more than once. It's just something to put configuration management into better context for tracking configuration changes across revisions. And if you don't know by the time you've ran this what the differences are you can also do something like: `diff <(zcat /proc/config.gz) .config` or `/boot` or wherever you wanna get your old configuration from. 

If you don't trust defaulting to =y for new options you can start from `allnoconfig` then source your options or do both and then diff the two to see what's changed. 

I don't really care for it that much but at least this way you can put some context to what options are enabled vs the automatically generated file which has:

```
#
# Automatically generated file; DO NOT EDIT. <--- 
# Linux/x86 6.14.0-rc5 Kernel Configuration
#
#
# General setup
#
# CONFIG_COMPILE_TEST is not set
# CONFIG_KERNEL_BZIP2 is not set
# CONFIG_KERNEL_LZMA is not set
# CONFIG_KERNEL_XZ is not set
# CONFIG_KERNEL_LZO is not set
# CONFIG_KERNEL_LZ4 is not set
# CONFIG_KERNEL_ZSTD is not set
# CONFIG_WATCH_QUEUE is not set
# CONFIG_USELIB is not set
```


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2025-08-06  2:14 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-14  4:23 [ISSUE] configuration files for linux paigeadelethompson
2025-04-16  0:02 ` classabbyamp
2025-04-23 16:43 ` paigeadelethompson
2025-07-23  2:14 ` github-actions
2025-08-06  2:14 ` [ISSUE] [CLOSED] " github-actions

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).