Multiple kernels kver_cmd to return an incoherent string
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
curtin |
New
|
Undecided
|
Unassigned |
Bug Description
Hello,
A customer had contacted with an issue related to this bug. Taking a look at the stacktrace for the issue:
```
ls -la
total 16
drwxr-xr-x. 4 root root 4096 Feb 10 02:53 .
dr-xr-xr-x. 40 root root 4096 Feb 10 02:58 ..
drwxr-xr-x. 6 root root 4096 Feb 10 02:54 4.18.0-
drwxr-xr-x. 6 root root 4096 Feb 10 02:49 4.18.0-
<stack trace>
Running curthooks.
Traceback (most recent call last):
File "/tmp/tmp1x5k7i
main()
File "/tmp/tmp1x5k7i
curthook(config, target, state)
File "/tmp/tmp1x5k7i
curthooks.
File "/curtin/
redhat_
File "/curtin/
in_chroot.
File "/curtin/
return subp(*args, **kwargs)
File "/curtin/
return _subp(*args, **kwargs)
File "/curtin/
raise ProcessExecutio
curtin.
Command: ['unshare', '--fork', '--pid', '--', 'chroot', '/tmp/tmp1x5k7i
Exit code: 1
Reason: -
Stdout: ''
Stderr: dracut: Cannot find module directory /lib/modules/
dracut: and --no-kernel was not specified
```
Then following the stack trace, this line in the source can be found:
```
kver_cmd = ['rpm', '-q', '--queryformat', '%{VERSION}
```
Then, if this command is run on a system with at leas two kernels installed, the returned string is malformed:
```
rpm -q --queryformat=
4.18.0-
```
Which causes an issue in the customer's use-case.
As this issue is time sensitive, would it be possible to request a workaround while a fix is developed?
Thank you.
We have a workaround (we ensure only one kernel exists in our image). This issue can occur if a user builds and image and in the process runs a yum update. In this case, two kernels may exist in /boot causing this issue.