funtoo/boot-update — pull request #9 by kini (2012-05-05 21:04:56+00:00)
Title: Fix initramfs detection when using glob for kernel

Putting "initramfs[-v]" in a boot.conf entry is supposed to match a file
starting with "initramfs" and ending with whatever string "[]"
matched in the kernel's filename, supposing that, say,
"vmlinuz-[]" was specified for the kernel in boot.conf.

But currently it fails to do this properly because it assumes that the
de-bracketed glob expression from the kernel name will be exactly two
characters longer than the complement of the desired string (i.e. one
can partition "kernel-foo-bar" into "kernel" and "-foo-bar" by knowing
the length of the glob expression "kernel-*").

This assumption is true when the kernel filename is globbed using
"[-v]", but it is not true when other globs are used. I guess this was
an oversight when the new globbing functionality was added. After this
commit, everything should make sense as long as there is only one glob
expression in the kernel filename in boot.conf, and that expression is
at the end of the kernel filename. As far as I know this is
a requirement in any case.