|
Bugzilla – Full Text Bug Listing |
| Summary: | yast sysconfig editor tries to run mkinitrd instead of dracut | ||
|---|---|---|---|
| Product: | [openSUSE] openSUSE Tumbleweed | Reporter: | Alexander Kruppa <akruppa> |
| Component: | Basesystem | Assignee: | dracut maintainers <dracut-maintainers> |
| Status: | RESOLVED FIXED | QA Contact: | E-mail List <qa-bugs> |
| Severity: | Normal | ||
| Priority: | P5 - None | CC: | akruppa, antonio.feijoo, jbohac, kanderssen, thomas.blume |
| Version: | Current | ||
| Target Milestone: | --- | ||
| Hardware: | x86-64 | ||
| OS: | openSUSE Tumbleweed | ||
| URL: | https://trello.com/c/9IFT6fKd | ||
| Whiteboard: | |||
| Found By: | --- | Services Priority: | |
| Business Priority: | Blocker: | --- | |
| Marketing QA Status: | --- | IT Deployment: | --- |
| Attachments: |
yast logs
Test file to save at /etc/sysconfig/ytest |
||
|
Description
Alexander Kruppa
2023-06-27 09:12:19 UTC
It would be nice to have yast logs as documented at https://en.opensuse.org/openSUSE:Report_a_YaST_bug BTW It looks like at least it is still called from the s390 module https://github.com/yast/yast-s390/blob/54d7d5f23eddad9690a05398ea961eddabce78ac/src/lib/y2s390/dialogs/mkinitrd.rb#L5 We already addressed this issue not so long ago (https://bugzilla.suse.com/show_bug.cgi?id=1203019) see https://github.com/yast/yast-country/pull/306 and https://github.com/yast/yast-yast2/pull/1289 So, maybe the issue you reported is already fixed by some of that PR. Could you please provide the logs as requested? Created attachment 867838 [details]
yast logs
From one of the "yast2 sysconfig" parts of the y2logs: > 2023-06-27 11:10:47 <1> lily(1607) [Ruby] sysconfig/complex.rb(MainDialog):1047 > Selected: INITRD_MODULES$/etc/sysconfig/kernel > . > 2023-06-27 11:10:47 <1> lily(1607) [Ruby] modules/Sysconfig.rb(block in parse_metadata):359 > tag: Path val: 'System/Kernel' > tag: Description val: '' > tag: Type val: 'string' > tag: Command val: '/sbin/mkinitrd' > . > 2023-06-27 11:10:47 <1> lily(1607) [Ruby] > sysconfig/complex.rb(MainDialog):1051 > Descr: > $[ > "Command":"/sbin/mkinitrd", > "Description":"", > "Path":"System/Kernel", > "Type":"string", > "actions":$["Cmd":"/sbin/mkinitrd"], > "comment":" > "\n This variable contains the list of modules to be added to the initial > \n ramdisk by calling the script \"mkinitrd\" > \n (like drivers for scsi-controllers, for lvm or reiserfs) > \n > \n", > "file":"/etc/sysconfig/kernel", > "location":"System/Kernel", > "name":"INITRD_MODULES", > "value":"pata_atiixp ata_generic processor fan ahci jbd ext3 edd" > ] So that call to /sbin/mkinitrd is indeed in the configuration file, in this case in /etc/sysconfig/kernel. Those files below /etc/sysconfig can define a command to be executed after one of the parameters has been changed: https://github.com/yast/yast-sysconfig/blob/master/src/modules/Sysconfig.rb#L1132-L1163 i.e. in a special comment like this: ## Command: /usr/sbin/fonts-config The problem is that this config file /etc/sysconfig/kernel contains that 'mkinitrd' command that is picked up by the YaST sysconfig editor. I checked on my working PC's Leap 15.5, on my Tumbleweed VM, on a Leap 15.3 VM: None of them has that file /etc/sysconfig/kernel. But a SLES-12 SP5 that I have access to has it. It's not easy to find out where that file comes from since it's not directly owned by any package, like almost all files below /etc/sysconfig (check with rpm -qf /etc/sysconfig/kernel Rather, those files are created in the post-install script of a package, using the 'fillup' command and one of the templates below /usr/share/fillup-templates (which also does not contain a file sysconfig.kernel). I checked the YaST packages, the kernel packages, the dracut package, but no result so far. Alexander, is it possible that this file /etc/sysconfig/kernel on your machine is left over from a migration such as a Leap 42.x to Tumbleweed? (maybe with Leap 15.x in between; Leap 42.x -> Leap 15.x -> TW). Yes, that is possible. I'm pretty sure the upgrade chain that resulted in my current system started with 42.x - or possibly even earlier than that. Okay, that might explain why it's there. For your concrete setup, it's probably best to simply move that file out of the way. AFAICS it's only used by that compatibility 'mkinitrd' script that is now moved out to package 'dracut-mkinitrd-deprecated'. I am still investigating, though. Configuring what initrd modules should be used should only be necessary in very exotic cases AFAIK; 'dracut' handles this much more intelligently, based on what kernel modules are currently being loaded, i.e. what hardware the kernel detected. For manual configuration, there is now the /etc/dracut.conf.d directory. On my machine, I have for example [sh @ balrog] /etc/dracut.conf.d 28 % cat 60-nvidia-default.conf add_drivers+=" nvidia nvidia-drm nvidia-modeset nvidia-uvm " i.e. you can add kernel modules a lot more dynamically depending on your needs; you don't need to specify them all (with a very real chance of forgetting a very important one). More details at man 5 dracut.conf Summary of the current status: - That 'mkinitrd' call is caused by an instruction in the config file, in this case /etc/sysconfig/kernel. - Those parameters that trigger the call are mostly obsolete by now, replaced by new mechanisms that 'dracut' provides. - The compatibility 'mkinitrd' script from the 'dracut-mkinitrd-deprecated' still use those parameters like 'INITRD_MODULES'; it feeds that content to the new 'dracut' mechanisms. - The /etc/sysconfig/kernel file is not completely obsolete; some parts are still used by e.g. 'kdump'. - So far, it is unclear what package creates that file, and with what 'fillup' template. - It appears that in this particular case, the old parameters in /etc/sysconfig/kernel were carried over from a previous installation. They are not there in SLE-15.x / Leap 15.x, but the file is there on at least one SLE-12-SP5 machine. - It is unclear if there even is a well-defined mechanism to remove obsolete parameters from any file in /etc/sysconfig. - Almost all of the files in /etc/sysconfig are not owned by any package. - They are created in some package's post-install script with the 'fillup' command which uses one of the templates at /usr/share/fillup-templates (15.x) or /var/adm/fillup-templates (SLE-12 GA/SPx / Leap 42.x). So, at the very minimum, we should tell the user in a warning pop-up that a command from an /etc/sysconfig file could not be executed, but let him continue if desired. But we know that 'mkinitrd' is now obsolete, and that there are better mechanisms by dracut to specify initrd modules. It would be nice to tell the user, but that would be hard-coding very specific release-related information in the YaST code; which sounds very wrong. The whole file /etc/sysconfig/kernel is not obsolete, just some of its old parameters; there are still some legitimate ones like all the KDUMP_xx parameters. Created attachment 869328 [details]
Test file to save at /etc/sysconfig/ytest
Test case for available and unavailable commands.
Copy this file to /etc/sysconfig/ytest and start "yast2 sysconfig".
In the tree in the left panel, navigate to
System -> Yast2 -> Test
Change the values for YTEST_UNAVAILABLE_CMD and/or YTEST_AVAILABLE_CMD and hit the "OK" button, then confirm the "Save" popup. Observe how a change of YTEST_UNAVAILABLE_CMD opens a warning popup
ERROR
Command /usr/bin/unavailable-command failed
[ OK ]
Notice that this is only a warning popup; the values are saved nonetheless.
Dracut maintainers, please check where those values in /etc/sysconfig/kernel come from; in particular, INITRD_MODULES and maybe some others that also have that special comment ## Command: /usr/sbin/mkinitrd I checked a lot of packages that seemed obvious to me, like yast2-bootloader, kernel-default and also dracut, in several releases (TW, 15.5, 15.4, 15.3, 12.5), but I didn't find any relevant "fillup" command in any of the post-install etc. scripts, and also no fillup template (in /usr/share/fillup-templates or /var/adm/fillup-templates) that contained those parameters or the 'mkinitrd' command. Yet, in some migration cases, they seem to be left over, and that is very confusing to the user. I don't know what the policy for that kind of thing is; but maybe using 'fillup -r' for those parameters that are known to be obsolete is the way to go. Notice that after some discussion in the team, we decided against hard-coding any specific handling for parameters and commands that are known to be obsolete in the yast2-sysconfig code: We agreed that this is not future-proof, and it's not the responsbility of the editing software to handle that kind of glitches. We inform the user about the command not being available, and that's it. We do not elaborate that there is now a better replacement for those old values with the new dracut mechanisms. We also don't want to handle weird cases for that chicken-and-egg problem that is the existing 'dracut-mkinitrd-deprecated' package (in Leap 15.5) that still uses that INITRD_MODULES parameter and feeds the modules specified there to a dracut command line. If the command (mkinitrd) is specified in the /etc/sysconfig file and available, we will call it. If it's not available, yet still listed in the file, there will be that error popup that started this whole bug. (In reply to Stefan Hundhammer from comment #10) > Dracut maintainers, please check where those values in /etc/sysconfig/kernel > come from; in particular, INITRD_MODULES and maybe some others that also > have that special comment > > ## Command: /usr/sbin/mkinitrd > > > I checked a lot of packages that seemed obvious to me, like > yast2-bootloader, kernel-default and also dracut, in several releases (TW, > 15.5, 15.4, 15.3, 12.5), but I didn't find any relevant "fillup" command in > any of the post-install etc. scripts, and also no fillup template (in > /usr/share/fillup-templates or /var/adm/fillup-templates) that contained > those parameters or the 'mkinitrd' command. > > Yet, in some migration cases, they seem to be left over, and that is very > confusing to the user. Seems to come from mkinitrd: https://github.com/openSUSE/mkinitrd/blob/master/etc/sysconfig.kernel-mkinitrd The mkinitrd specfile at: https://build.opensuse.org/package/view_file/openSUSE:13.1/mkinitrd/mkinitrd.spec?expand=1 contains: mkdir -p $RPM_BUILD_ROOT/var/adm/fillup-templates install -m 644 etc/sysconfig.kernel-mkinitrd $RPM_BUILD_ROOT/var/adm/fillup-templates/ But that is not in the files section of the specfile. So, I guess it won't get deleted when the package is removed. Since the mkinitrd package has disappeared, we cannot fix it there. Maybe we could add something to the dracut specfile that checks for: var/adm/fillup-templates/sysconfig.kernel-mkinitrd and deletes it if found. Antonio, what do you think? There is no mkinitrd in Factory since snapshot 20230411, but unfortunately it will still be shipped in SLE-15 SP6 (and predecessors). FTR a bit of history. Up to SLE-11, /etc/sysconfig/kernel was the recommended method to force the addition of kernel modules in the initrd (see https://drivers.suse.com/doc/kmpm/Kmpm-code11.pdf - 11 System Installation and Kernel Module Packages). But after moving from the old mkinitrd to dracut in SLE-12, /etc/sysconfig/kernel is not shipped anymore, but this file remains on migrated systems, and there is still some legacy compatibility code in dracut that parses this file. Thanks Thomas, I didn't know the existence of this fillup template, so yes, I also think it'd a good idea to remove it using the dracut spec file. [1] https://github.com/openSUSE/dracut/blob/72a5d4f8e9f604f2f290e251a68e66ba3dbda7be/modules.d/99suse-initrd/module-setup.sh#L29-L35 (In reply to Stefan Hundhammer from comment #8) > The whole file /etc/sysconfig/kernel is not obsolete, just some of its old > parameters; there are still some legitimate ones like all the KDUMP_xx > parameters. I don't think there are any legitimate KDUMP_ parameters in /etc/sysconfig/kernel. These should be in /etc/sysconfig/kdump . The kdump package certainly does not read them from /etc/sysconfig/kernel . (In reply to Thomas Blume from comment #13) > Since the mkinitrd package has disappeared, we cannot fix it there. > Maybe we could add something to the dracut specfile that checks for: > var/adm/fillup-templates/sysconfig.kernel-mkinitrd and deletes it if found. Fix applied in Factory since snapshot 20230911. Thanks Thomas! Related bug that led to this problem becoming obvious: Bug #1213222 |