# grub-mkconfig kernel naming convention

## koan

I have been manually managing grub up until recently, and now am using grub2, and so grub-mkconfig

I was wondering what people are using for a naming convention for their kernels with grub2?

I was just prefixing kernel- and suffixing the version as per the package, but this leads to:

```

kernel-bzImage-3.2.1-r2

kernel-bzImage-3.2.12

```

As grub-mkconfig seems to go in ascii order, the 3.2.1-r2 gets prioritised over the newer 3.2.12 version.  I could stick symbolic links to the most recent, but I'd rather not add any more steps, and manually monkeying with the version name to make it ascii sequenced seems silly.

What is everyone else doing?  What does genkernel do for that matter?

----------

## Jeffrey0

I just run make install from within the kernel tree which results in filenames like vmlinuz-3.2.1-hardened and vmlinuz-3.2.2-hardened-r1. grub2-mkconfig picks these up perfectly.

grub-2.00_beta2-r1 and onwards include a fix for ordering, see bug 408195.

----------

## Jaglover

I'm too lazy for that, I'm just using symlinks.

ls command in my /boot

```
lrwxrwxrwx 1 root root    bzImage -> /usr/src/linux/arch/x86/boot/bzImage

lrwxrwxrwx 1 root root    bzImage.pre -> /usr/src/linux.pre/arch/x86/boot/bzImage

lrwxrwxrwx 1 root root    System.map -> /usr/src/linux/System.map

```

Every time a new kernel comes out I just change symlinks in /usr/src

----------

## koan

 *Jaglover wrote:*   

> I'm too lazy for that, I'm just using symlinks.
> 
> ls command in my /boot
> 
> ```
> ...

 

Interesting.  Your boot and usr are in the same file system?  Everything in root?  And no fallback in case the new kernel doesn't work?

Neither of these options are for me!

----------

## koan

 *Jeffrey0 wrote:*   

> 
> 
> grub-2.00_beta2-r1 and onwards include a fix for ordering, see bug 408195.

 

Aah, ok, thats all I need then.

If only I could get this version to emerge....

```

$ sudo emerge -av grub 

Password: 

/usr/lib/portage/pym/portage/package/ebuild/config.py:353: UserWarning: 'cache.metadata_overlay.database' is deprecated: /etc/portage/modules

  (user_auxdbmodule, modules_file))

These are the packages that would be merged, in order:

Calculating dependencies... done!

[ebuild     U *] sys-boot/grub-2.00_beta3-r1 [1.99_rc1] USE="device-mapper%* nls%* sdl%* static truetype -custom-cflags -debug -efiemu% -libzfs% -mount% (-multislot%*)" GRUB_PLATFORMS="-coreboot% -efi-32% -efi-64% -emu% -ieee1275% -multiboot% -pc% -qemu% -qemu-mips% -yeeloong%" 0 kB

Total: 1 package (1 upgrade), Size of downloads: 0 kB

Would you like to merge these packages? [Yes/No] y

>>> Verifying ebuild manifests

>>> Emerging (1 of 1) sys-boot/grub-2.00_beta3-r1

```

---snip---

```

i686-pc-linux-gnu-gcc -Wall -W -Wshadow -Wold-style-definition -Wpointer-arith -Wundef -Wextra -Waddress -Wattributes -Wcast-align -Wchar-subscripts -Wcomment -Wdeprecated-declarations -Wdisabled-optimization -Wdiv-by-zero -Wempty-body -Wendif-labels -Wfloat-equal -Wformat-extra-args -Wformat-security -Wformat-y2k -Wimplicit -Wimplicit-function-declaration -Wimplicit-int -Winit-self -Wint-to-pointer-cast -Winvalid-pch -Wmain -Wmissing-braces -Wmissing-field-initializers -Wmissing-format-attribute -Wmissing-noreturn -Wmultichar -Wnonnull -Woverflow -Wparentheses -Wpointer-arith -Wpointer-to-int-cast -Wreturn-type -Wsequence-point -Wshadow -Wsign-compare -Wstrict-aliasing -Wswitch -Wtrigraphs -Wundef -Wuninitialized -Wunknown-pragmas -Wunused -Wunused-function -Wunused-label -Wunused-parameter -Wunused-value  -Wunused-variable -Wvariadic-macros -Wvolatile-register-var -Wwrite-strings -Wnested-externs -Wstrict-prototypes -Wpointer-sign -Wno-undef -Wno-sign-compare -Wno-unused -Wno-unused-parameter -Wno-redundant-decls -Wno-unreachable-code -Wno-conversion -Wno-old-style-definition -Wno-unsafe-loop-optimizations      -static -o grub-menulst2cfg util/grub_menulst2cfg-grub-menulst2cfg.o grub-core/lib/grub_menulst2cfg-legacy_parse.o grub-core/lib/i386/pc/grub_menulst2cfg-vesa_modes_table.o  libgrubmods.a libgrubgcry.a libgrubkern.a grub-core/gnulib/libgnu.a       

/usr/lib/gcc/i686-pc-linux-gnu/4.4.5/../../../../i686-pc-linux-gnu/bin/ld: cannot find -lfreetype

/usr/lib/gcc/i686-pc-linux-gnu/4.4.5/../../../../i686-pc-linux-gnu/bin/ld: cannot find -lbz2

collect2: ld returned 1 exit status

make[2]: *** [grub-mkfont] Error 1

make[2]: *** Waiting for unfinished jobs....

```

--snip--

```

make[2]: Leaving directory `/var/tmp/portage/sys-boot/grub-2.00_beta3-r1/work/build-guessed'

make[1]: *** [all-recursive] Error 1

make[1]: Leaving directory `/var/tmp/portage/sys-boot/grub-2.00_beta3-r1/work/build-guessed'

make: *** [all] Error 2

 * ERROR: sys-boot/grub-2.00_beta3-r1 failed (compile phase):

 *   emake failed

```

I am not sure why it is failing on these libraries - neither have use flags, and I have app-arch/bzip2 and media-libs/freetype installed.  I managed to get previous versions of grub2 installed without issue, so don't get what is missing.

What use flags are you using?

----------

## Jeffrey0

 *koan wrote:*   

> I am not sure why it is failing on these libraries - neither have use flags, and I have app-arch/bzip2 and media-libs/freetype installed.  I managed to get previous versions of grub2 installed without issue, so don't get what is missing.
> 
> What use flags are you using?

 I'm using the same flags minus static and I can report that I get the same error (with -lz is missing as well) if I try to build with USE=static set.

Just a guess, but you might need to set & rebuild with USE=static-libs for app-arch/bzip2, sys-libs/zlib and media-libs/freetype (possibly others too) if you want to keep your static flag. Or alternatively, just drop it because there's not much of a point in building GRUB2 statically.

----------

## koan

ah cool, I'll drop static... I am not sure how it got there in the first place.

----------

## Jaglover

 *koan wrote:*   

>  *Jaglover wrote:*   I'm too lazy for that, I'm just using symlinks.
> 
> ls command in my /boot
> 
> ```
> ...

 

Yes, when I switched to SSD I put /tmp on tmpfs and /var to a regular hard drive. Portage was on NFS before.

I see no reason why I should have /usr on separate partition after these modifications. Having /boot on separate partition is just a measure to make sure an old/broken BIOS will not break your boot sequence.

And there is fallback to previous kernel.

----------

