From: Mike Gilbert <floppym@gentoo.org>
To: The development of GNU GRUB <grub-devel@gnu.org>
Subject: Improve support for genkernel in 10_linux
Date: Sat, 07 Apr 2012 17:54:54 -0400 [thread overview]
Message-ID: <4F80B7AE.9000607@gentoo.org> (raw)
[-- Attachment #1.1: Type: text/plain, Size: 954 bytes --]
Gentoo Linux maintains its own kernel builder and initramfs generation
utility called "genkernel".
It looks like some attempt was made to make 10_linux compatible with
initiramfs images created by genkernel. However, this support is
currently broken. There are two problems.
Firstly, genkernel initramfs images are named like so:
initramfs-genkernel-$ARCH-$version
10_linux currently looks for this:
initramfs-genkernel-$version
The simplest solution here would be to use a wildcard beteen genkernel
and $version.
Secondly, genkernel looks for the "real_root" kernel command line option
to determine the root filesystem. This is a holdover from the days when
we used true initrd images and we needed to use root=/dev/ram0.
I have attached a rough patch that resolves these issues. I would
appreciate any feedback you can give me. My goal is to move this
upstream so that I will not have to rebase it in the future.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: grub-2.00-10_linux-genkernel.patch --]
[-- Type: text/x-patch; name="grub-2.00-10_linux-genkernel.patch", Size: 1776 bytes --]
=== modified file 'util/grub.d/10_linux.in'
--- util/grub.d/10_linux.in 2012-03-10 14:21:25 +0000
+++ util/grub.d/10_linux.in 2012-04-07 21:24:06 +0000
@@ -135,7 +135,7 @@
message="$(gettext_printf "Loading Linux %s ..." ${version})"
sed "s/^/$submenu_indentation/" << EOF
echo '$message'
- linux ${rel_dirname}/${basename} root=${linux_root_device_thisversion} ro ${args}
+ linux ${rel_dirname}/${basename} ${rootcmd}=${linux_root_device_thisversion} ro ${args}
EOF
if test -n "${initrd}" ; then
# TRANSLATORS: ramdisk isn't identifier. Should be translated.
@@ -181,19 +181,31 @@
alt_version=`echo $version | sed -e "s,\.old$,,g"`
linux_root_device_thisversion="${LINUX_ROOT_DEVICE}"
+ rootcmd=root
initrd=
+ pushd "${dirname}" > /dev/null
for i in "initrd.img-${version}" "initrd-${version}.img" "initrd-${version}.gz" \
"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}"; do
- if test -e "${dirname}/${i}" ; then
+ "initrd-${alt_version}" "initramfs-${alt_version}.img"; do
+ if test -e "${i}" ; then
initrd="$i"
break
fi
done
+ if [ "x$initrd" = x ]; then
+ for i in "initramfs-genkernel"*"-${version}" \
+ "initramfs-genkernel"*"-${alt_version}"; do
+ if test -e "${i}"; then
+ initrd="$i"
+ rootcmd=real_root
+ break
+ fi
+ done
+ fi
+ popd > /dev/null
+
config=
for i in "${dirname}/config-${version}" "${dirname}/config-${alt_version}" "/etc/kernels/kernel-config-${version}" ; do
if test -e "${i}" ; then
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 230 bytes --]
next reply other threads:[~2012-04-07 21:55 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-07 21:54 Mike Gilbert [this message]
2012-04-11 2:56 ` Improve support for genkernel in 10_linux Mike Gilbert
2012-04-11 12:05 ` Vladimir 'φ-coder/phcoder' Serbinenko
2012-04-11 15:52 ` Mike Gilbert
2012-04-15 2:21 ` Mike Gilbert
2012-04-18 9:24 ` Vladimir 'φ-coder/phcoder' Serbinenko
2012-04-18 15:06 ` Mike Gilbert
2012-04-18 15:16 ` Vladimir 'φ-coder/phcoder' Serbinenko
2012-04-18 15:39 ` Mike Gilbert
2012-04-18 21:26 ` Vladimir 'φ-coder/phcoder' Serbinenko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4F80B7AE.9000607@gentoo.org \
--to=floppym@gentoo.org \
--cc=grub-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.