FS#43256 - [mkinitcpio] more specific error message upon failing to extract kernel version

Attached to Project: Arch Linux
Opened by Alexei Colin (alexei) - Sunday, 28 December 2014, 22:37 GMT
Last edited by Dave Reisner (falconindy) - Sunday, 03 July 2016, 18:23 GMT
Task Type Feature Request
Category Arch Projects
Status Closed
Assigned To Thomas Bächler (brain0)
Dave Reisner (falconindy)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description: The *_kver variable in mkinitcpio presets accepts either a kernel version or a path to kernel image (btw, we should document this in man page and on wiki). In the latter case, mkinitcpio extracts the version from the image at the given path. If mkinitcpio fails to extract the version, then the error reported is "invalid kernel specified".

To an uninformed user (e.g. me an our ago), it is first unclear why mkinitcpio needs the kernel image in the first place, and then it's not too helpful to know that it found the given image "invalid".

Sidenote: This arose on ARM where a kernel image packaged for uBoot ended up passed to mkcpioinit. The problem is not ARM-specific, though.

Patch attached to edit the error message.

Additional info:
* package version(s): 18-2 and git b209e8c5e965965c50878fb57a628bca83a06f8d
This task depends upon

Closed by  Dave Reisner (falconindy)
Sunday, 03 July 2016, 18:23 GMT
Reason for closing:  Fixed
Additional comments about closing:  mkinitcpio-20-1
Comment by Dave Reisner (falconindy) - Sunday, 28 December 2014, 22:55 GMT
> [...] we should document this in man page and on wiki
Feel free to edit the wiki if this isn't already there, but the manpage already calls this out:

-k, --kernel kernelversion
Use kernelversion, instead of the current running kernel. This may be a path to a kernel image, a specific kernel version or the special keyword none. In the latter case, no kernel modules are added to the image.

I'm not thrilled about the verbiage change because it's ignoring the real problem which is that we can't support version extraction from non-x86 kernels. I'd rather figure out a way to abort if you specify a file for the -k option.
Comment by Dave Reisner (falconindy) - Sunday, 03 July 2016, 17:59 GMT

Loading...