You are not logged in.

#1 2011-08-10 14:41:10

maddojf
Member
Registered: 2008-10-29
Posts: 8

Linux 3.0 + Custom Kernel + Grub2 + removed symlinks = missing initram

After searching, I don't think this specific case has been addressed on the forum, but I could have missed it.

I am using a custom kernel based on the PKGBUILD in the abs (version 3.0.1-1).  I used basically the same procedure to modify the PKGBUILD that I previously used when building a custom kernel26 package.  The end result is a kernel with an additional version name installed along side the stock kernel, i.e. (note: I went ahead and removed the symlinks that were created for backward compatability)

$ ls /boot
grub/                         initramfs-linux-mbp-fallback.img  vmlinuz-linux
initramfs-linux-fallback.img  initramfs-linux-mbp.img           vmlinuz-linux-mbp
initramfs-linux.img           syslinux/

The problem is that when I updated the grub2 menu, it missed the initramfs-linux-mbp.img file and therefore the custom kernel wouldn't boot.  The solution I found was to edit the file /etc/grub.d/10_linux as follows:
Change

  initrd=
  for i in "initrd.img-${version}" "initrd-${version}.img" \
           "initrd-${version}" "initramfs-${version}.img" \
           "initrd.img-${alt_version}" "initrd-${alt_version}.img" \
           "initrd-${alt_version}" "initramfs-${alt_version}.img" \
           "initramfs-genkernel-${version}" \
           "initramfs-genkernel-${alt_version}" \
           "${basename/vmlinuz/kernel}.img"; do
    if test -e "${dirname}/${i}" ; then
      initrd="$i"
      break
    fi
  done

to

  initrd=
  for i in "initrd.img-${version}" "initrd-${version}.img" \
           "initrd-${version}" "initramfs-${version}.img" "initramfs-linux-${version}.img" \
           "initrd.img-${alt_version}" "initrd-${alt_version}.img" \
           "initrd-${alt_version}" "initramfs-${alt_version}.img" \
           "initramfs-genkernel-${version}" \
           "initramfs-genkernel-${alt_version}" \
           "${basename/vmlinuz/kernel}.img"; do
    if test -e "${dirname}/${i}" ; then
      initrd="$i"
      break
    fi
  done

where the important bit is the "initramfs-linux-${version}.img" entry on the second line of the list. 

I think this is an unintended side effect of the recent change in the naming convention for kernels >= 3.0.  Since the previous configuration had the stock initramfs as "kernel26.img", adding a custom version "ver" to the kernel would result in a "kernel26-ver.img". 

However, with the new convention, the stock initramfs is "initramfs-linux.img" and /etc/grub.d/10_linux script treats the -linux portion as the version.  While for a custom version "ver" the initramfs would be "initramfs-linux-ver.img" which gets missed by the /etc/grub.d/10_linux script because it is searching for a file called "initramfs-ver.img".

Is this
a) a bug that should be reported upstream,
b) a bug in the grub2 Arch package,
c) an oversight in the new naming convention
d) a misunderstanding and/or misconfiguration on my part?

Offline

#2 2011-08-11 16:22:35

slytux
Member
From: New York
Registered: 2010-09-25
Posts: 107

Re: Linux 3.0 + Custom Kernel + Grub2 + removed symlinks = missing initram

The problem was discovered and a proposed solution is on another thread.

https://bbs.archlinux.org/viewtopic.php?id=124083

Nevermind, your problem isn't with the initramfs creation but grub2.

Last edited by slytux (2011-08-11 16:28:14)

Offline

#3 2011-08-11 22:48:04

graysky
Member
From: /run/user/1000
Registered: 2008-12-01
Posts: 8,605
Website

Re: Linux 3.0 + Custom Kernel + Grub2 + removed symlinks = missing initram

This is a known issue with grub2.  Ronald has been contacted and knows about it.


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#4 2011-08-13 16:10:39

graysky
Member
From: /run/user/1000
Registered: 2008-12-01
Posts: 8,605
Website

Re: Linux 3.0 + Custom Kernel + Grub2 + removed symlinks = missing initram

@mad - does your fix work with the stock packages as well as custom packages?  If so, I would suggest you submit it as a patch for the official grub2 packages.


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#5 2011-08-13 18:38:42

skodabenz
Banned
From: Tamilnadu, India
Registered: 2010-04-11
Posts: 382

Re: Linux 3.0 + Custom Kernel + Grub2 + removed symlinks = missing initram

Better would be to change (last line in for...do)

"${basename/vmlinuz/kernel}.img"; do

to

"${basename/vmlinuz/initramfs}.img"; do

Or if you use only Arch, you can always maintain grub.cfg manually since the kernel and initramfs filenames do not change across package updates in Arch.

Last edited by skodabenz (2011-08-13 18:39:46)


My new forum user/nick name is "the.ridikulus.rat" .

Offline

Board footer

Powered by FluxBB