* Improve support for genkernel in 10_linux
@ 2012-04-07 21:54 Mike Gilbert
2012-04-11 2:56 ` Mike Gilbert
0 siblings, 1 reply; 10+ messages in thread
From: Mike Gilbert @ 2012-04-07 21:54 UTC (permalink / raw)
To: The development of GNU GRUB
[-- 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 --]
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Improve support for genkernel in 10_linux
2012-04-07 21:54 Improve support for genkernel in 10_linux Mike Gilbert
@ 2012-04-11 2:56 ` Mike Gilbert
2012-04-11 12:05 ` Vladimir 'φ-coder/phcoder' Serbinenko
0 siblings, 1 reply; 10+ messages in thread
From: Mike Gilbert @ 2012-04-11 2:56 UTC (permalink / raw)
To: The development of GNU GRUB
[-- Attachment #1.1: Type: text/plain, Size: 556 bytes --]
On 04/07/2012 05:54 PM, Mike Gilbert wrote:
> 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.
>
It was brought to my attention that genkernel's initramfs code will in
fact utilize "root" if "real_root" is unset. This part of my previous
patch is therefore pointless.
I have attached a revised patch containing only the changes necessary to
detect a genkernel initramfs image.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: grub-2.00-genkernel.patch --]
[-- Type: text/x-patch; name="grub-2.00-genkernel.patch", Size: 1405 bytes --]
=== modified file 'ChangeLog'
--- ChangeLog 2012-04-07 18:11:04 +0000
+++ ChangeLog 2012-04-11 02:53:02 +0000
@@ -1,3 +1,7 @@
+2012-04-10 Mike Gilbert <floppym@gentoo.org>
+
+ * util/grub.d/10_linux.in: Fix detection of genkernel initramfs.
+
2012-04-07 Vladimir Serbinenko <phcoder@gmail.com>
* grub-core/normal/charset.c (grub_ucs4_to_utf8): Return number of
=== 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-11 02:32:46 +0000
@@ -182,17 +182,19 @@
linux_root_device_thisversion="${LINUX_ROOT_DEVICE}"
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
+ "initramfs-genkernel"*"-${version}" \
+ "initramfs-genkernel"*"-${alt_version}"; do
+ if test -e "${i}" ; then
initrd="$i"
break
fi
done
+ popd > /dev/null
config=
for i in "${dirname}/config-${version}" "${dirname}/config-${alt_version}" "/etc/kernels/kernel-config-${version}" ; do
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 230 bytes --]
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Improve support for genkernel in 10_linux
2012-04-11 2:56 ` Mike Gilbert
@ 2012-04-11 12:05 ` Vladimir 'φ-coder/phcoder' Serbinenko
2012-04-11 15:52 ` Mike Gilbert
0 siblings, 1 reply; 10+ messages in thread
From: Vladimir 'φ-coder/phcoder' Serbinenko @ 2012-04-11 12:05 UTC (permalink / raw)
To: grub-devel
[-- Attachment #1: Type: text/plain, Size: 1011 bytes --]
On 11.04.2012 04:56, Mike Gilbert wrote:
> On 04/07/2012 05:54 PM, Mike Gilbert wrote:
>> 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.
>>
> It was brought to my attention that genkernel's initramfs code will in
> fact utilize "root" if "real_root" is unset. This part of my previous
> patch is therefore pointless.
>
> I have attached a revised patch containing only the changes necessary to
> detect a genkernel initramfs image.
>
pushd/popd isn't POSIX so we can't use it in our scripts. Also I don't
feel like glob expansion is the right thing to use here. Why not infer
the architecture from uname ?
>
>
> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> https://lists.gnu.org/mailman/listinfo/grub-devel
--
Regards
Vladimir 'φ-coder/phcoder' Serbinenko
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 294 bytes --]
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Improve support for genkernel in 10_linux
2012-04-11 12:05 ` Vladimir 'φ-coder/phcoder' Serbinenko
@ 2012-04-11 15:52 ` Mike Gilbert
2012-04-15 2:21 ` Mike Gilbert
0 siblings, 1 reply; 10+ messages in thread
From: Mike Gilbert @ 2012-04-11 15:52 UTC (permalink / raw)
To: The development of GNU GRUB
2012/4/11 Vladimir 'φ-coder/phcoder' Serbinenko <phcoder@gmail.com>:
> On 11.04.2012 04:56, Mike Gilbert wrote:
>> On 04/07/2012 05:54 PM, Mike Gilbert wrote:
>>> 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.
>>>
>> It was brought to my attention that genkernel's initramfs code will in
>> fact utilize "root" if "real_root" is unset. This part of my previous
>> patch is therefore pointless.
>>
>> I have attached a revised patch containing only the changes necessary to
>> detect a genkernel initramfs image.
>>
> pushd/popd isn't POSIX so we can't use it in our scripts. Also I don't
> feel like glob expansion is the right thing to use here. Why not infer
> the architecture from uname ?
That should also work. Here's the logic that genkernel uses to populate ARCH:
ARCH=`uname -m`
case "${ARCH}" in
i?86)
ARCH="x86"
;;
mips|mips64)
ARCH="mips"
;;
arm*)
ARCH=arm
;;
*)
;;
esac
I'm thinking it would be a good idea to rename ARCH to something like
GENKERNEL_ARCH. We should also let the user override this in
/etc/default/grub.
Does that sound ok?
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Improve support for genkernel in 10_linux
2012-04-11 15:52 ` Mike Gilbert
@ 2012-04-15 2:21 ` Mike Gilbert
2012-04-18 9:24 ` Vladimir 'φ-coder/phcoder' Serbinenko
0 siblings, 1 reply; 10+ messages in thread
From: Mike Gilbert @ 2012-04-15 2:21 UTC (permalink / raw)
To: The development of GNU GRUB
[-- Attachment #1.1: Type: text/plain, Size: 1458 bytes --]
On 04/11/2012 11:52 AM, Mike Gilbert wrote:
> 2012/4/11 Vladimir 'φ-coder/phcoder' Serbinenko <phcoder@gmail.com>:
>> On 11.04.2012 04:56, Mike Gilbert wrote:
>>> On 04/07/2012 05:54 PM, Mike Gilbert wrote:
>>>> 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.
>>>>
>>> It was brought to my attention that genkernel's initramfs code will in
>>> fact utilize "root" if "real_root" is unset. This part of my previous
>>> patch is therefore pointless.
>>>
>>> I have attached a revised patch containing only the changes necessary to
>>> detect a genkernel initramfs image.
>>>
>> pushd/popd isn't POSIX so we can't use it in our scripts. Also I don't
>> feel like glob expansion is the right thing to use here. Why not infer
>> the architecture from uname ?
>
> That should also work. Here's the logic that genkernel uses to populate ARCH:
>
> ARCH=`uname -m`
> case "${ARCH}" in
> i?86)
> ARCH="x86"
> ;;
> mips|mips64)
> ARCH="mips"
> ;;
> arm*)
> ARCH=arm
> ;;
> *)
> ;;
> esac
>
> I'm thinking it would be a good idea to rename ARCH to something like
> GENKERNEL_ARCH. We should also let the user override this in
> /etc/default/grub.
>
> Does that sound ok?
I have modified my patch to implement what I describe above.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: grub-2.00-genkernel.patch --]
[-- Type: text/x-patch; name="grub-2.00-genkernel.patch", Size: 1654 bytes --]
=== modified file 'ChangeLog'
--- ChangeLog 2012-04-07 18:11:04 +0000
+++ ChangeLog 2012-04-11 19:51:47 +0000
@@ -1,3 +1,7 @@
+2012-04-11 Mike Gilbert <floppym@gentoo.org>
+
+ * util/grub.d/10_linux.in: Fix detection of genkernel initramfs.
+
2012-04-07 Vladimir Serbinenko <phcoder@gmail.com>
* grub-core/normal/charset.c (grub_ucs4_to_utf8): Return number of
=== 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-11 19:26:45 +0000
@@ -150,7 +150,8 @@
EOF
}
-case x`uname -m` in
+machine=`uname -m`
+case "x$machine" in
xi?86 | xx86_64)
list=`for i in /boot/vmlinuz-* /vmlinuz-* /boot/kernel-* ; do
if grub_file_is_not_garbage "$i" ; then echo -n "$i " ; fi
@@ -161,6 +162,15 @@
done` ;;
esac
+if test "x${GENKERNEL_ARCH-unset}" = xunset; then
+ case "$machine" in
+ i?86) GENKERNEL_ARCH="x86" ;;
+ mips|mips64) GENKERNEL_ARCH="mips" ;;
+ arm*) GENKERNEL_ARCH="arm" ;;
+ *) GENKERNEL_ARCH="$machine" ;;
+ esac
+fi
+
prepare_boot_cache=
prepare_root_cache=
boot_device_id=
@@ -186,8 +196,8 @@
"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
+ "initramfs-genkernel-${GENKERNEL_ARCH}-${version}" \
+ "initramfs-genkernel-${GENKERNEL_ARCH}-${alt_version}"; do
if test -e "${dirname}/${i}" ; then
initrd="$i"
break
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 230 bytes --]
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Improve support for genkernel in 10_linux
2012-04-15 2:21 ` Mike Gilbert
@ 2012-04-18 9:24 ` Vladimir 'φ-coder/phcoder' Serbinenko
2012-04-18 15:06 ` Mike Gilbert
0 siblings, 1 reply; 10+ messages in thread
From: Vladimir 'φ-coder/phcoder' Serbinenko @ 2012-04-18 9:24 UTC (permalink / raw)
To: grub-devel
[-- Attachment #1: Type: text/plain, Size: 1717 bytes --]
On 15.04.2012 04:21, Mike Gilbert wrote:
> On 04/11/2012 11:52 AM, Mike Gilbert wrote:
>> 2012/4/11 Vladimir 'φ-coder/phcoder' Serbinenko <phcoder@gmail.com>:
>>> On 11.04.2012 04:56, Mike Gilbert wrote:
>>>> On 04/07/2012 05:54 PM, Mike Gilbert wrote:
>>>>> 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.
>>>>>
>>>> It was brought to my attention that genkernel's initramfs code will in
>>>> fact utilize "root" if "real_root" is unset. This part of my previous
>>>> patch is therefore pointless.
>>>>
>>>> I have attached a revised patch containing only the changes necessary to
>>>> detect a genkernel initramfs image.
>>>>
>>> pushd/popd isn't POSIX so we can't use it in our scripts. Also I don't
>>> feel like glob expansion is the right thing to use here. Why not infer
>>> the architecture from uname ?
>> That should also work. Here's the logic that genkernel uses to populate ARCH:
>>
>> ARCH=`uname -m`
>> case "${ARCH}" in
>> i?86)
>> ARCH="x86"
>> ;;
>> mips|mips64)
>> ARCH="mips"
>> ;;
>> arm*)
>> ARCH=arm
>> ;;
>> *)
>> ;;
>> esac
>>
>> I'm thinking it would be a good idea to rename ARCH to something like
>> GENKERNEL_ARCH. We should also let the user override this in
>> /etc/default/grub.
>>
>> Does that sound ok?
> I have modified my patch to implement what I describe above.
>
What is the reason to make it configurable? There shouldn't be any need
to configure something that is autodetected
--
Regards
Vladimir 'φ-coder/phcoder' Serbinenko
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 294 bytes --]
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Improve support for genkernel in 10_linux
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
0 siblings, 1 reply; 10+ messages in thread
From: Mike Gilbert @ 2012-04-18 15:06 UTC (permalink / raw)
To: The development of GNU GRUB
2012/4/18 Vladimir 'φ-coder/phcoder' Serbinenko <phcoder@gmail.com>:
> On 15.04.2012 04:21, Mike Gilbert wrote:
>> On 04/11/2012 11:52 AM, Mike Gilbert wrote:
>>> 2012/4/11 Vladimir 'φ-coder/phcoder' Serbinenko <phcoder@gmail.com>:
>>>> On 11.04.2012 04:56, Mike Gilbert wrote:
>>>>> On 04/07/2012 05:54 PM, Mike Gilbert wrote:
>>>>>> 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.
>>>>>>
>>>>> It was brought to my attention that genkernel's initramfs code will in
>>>>> fact utilize "root" if "real_root" is unset. This part of my previous
>>>>> patch is therefore pointless.
>>>>>
>>>>> I have attached a revised patch containing only the changes necessary to
>>>>> detect a genkernel initramfs image.
>>>>>
>>>> pushd/popd isn't POSIX so we can't use it in our scripts. Also I don't
>>>> feel like glob expansion is the right thing to use here. Why not infer
>>>> the architecture from uname ?
>>> That should also work. Here's the logic that genkernel uses to populate ARCH:
>>>
>>> ARCH=`uname -m`
>>> case "${ARCH}" in
>>> i?86)
>>> ARCH="x86"
>>> ;;
>>> mips|mips64)
>>> ARCH="mips"
>>> ;;
>>> arm*)
>>> ARCH=arm
>>> ;;
>>> *)
>>> ;;
>>> esac
>>>
>>> I'm thinking it would be a good idea to rename ARCH to something like
>>> GENKERNEL_ARCH. We should also let the user override this in
>>> /etc/default/grub.
>>>
>>> Does that sound ok?
>> I have modified my patch to implement what I describe above.
>>
> What is the reason to make it configurable? There shouldn't be any need
> to configure something that is autodetected
>
genkernel allows the user to cross-compile their kernel and/or
initramfs, in which case uname -m would not provide the correct value.
I don't have a clear picture in my mind of how that would work with
grub, but I figure it would be better to err on the side of
flexibility.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Improve support for genkernel in 10_linux
2012-04-18 15:06 ` Mike Gilbert
@ 2012-04-18 15:16 ` Vladimir 'φ-coder/phcoder' Serbinenko
2012-04-18 15:39 ` Mike Gilbert
0 siblings, 1 reply; 10+ messages in thread
From: Vladimir 'φ-coder/phcoder' Serbinenko @ 2012-04-18 15:16 UTC (permalink / raw)
To: grub-devel
[-- Attachment #1: Type: text/plain, Size: 2512 bytes --]
On 18.04.2012 17:06, Mike Gilbert wrote:
> 2012/4/18 Vladimir 'φ-coder/phcoder' Serbinenko <phcoder@gmail.com>:
>> On 15.04.2012 04:21, Mike Gilbert wrote:
>>> On 04/11/2012 11:52 AM, Mike Gilbert wrote:
>>>> 2012/4/11 Vladimir 'φ-coder/phcoder' Serbinenko <phcoder@gmail.com>:
>>>>> On 11.04.2012 04:56, Mike Gilbert wrote:
>>>>>> On 04/07/2012 05:54 PM, Mike Gilbert wrote:
>>>>>>> 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.
>>>>>>>
>>>>>> It was brought to my attention that genkernel's initramfs code will in
>>>>>> fact utilize "root" if "real_root" is unset. This part of my previous
>>>>>> patch is therefore pointless.
>>>>>>
>>>>>> I have attached a revised patch containing only the changes necessary to
>>>>>> detect a genkernel initramfs image.
>>>>>>
>>>>> pushd/popd isn't POSIX so we can't use it in our scripts. Also I don't
>>>>> feel like glob expansion is the right thing to use here. Why not infer
>>>>> the architecture from uname ?
>>>> That should also work. Here's the logic that genkernel uses to populate ARCH:
>>>>
>>>> ARCH=`uname -m`
>>>> case "${ARCH}" in
>>>> i?86)
>>>> ARCH="x86"
>>>> ;;
>>>> mips|mips64)
>>>> ARCH="mips"
>>>> ;;
>>>> arm*)
>>>> ARCH=arm
>>>> ;;
>>>> *)
>>>> ;;
>>>> esac
>>>>
>>>> I'm thinking it would be a good idea to rename ARCH to something like
>>>> GENKERNEL_ARCH. We should also let the user override this in
>>>> /etc/default/grub.
>>>>
>>>> Does that sound ok?
>>> I have modified my patch to implement what I describe above.
>>>
>> What is the reason to make it configurable? There shouldn't be any need
>> to configure something that is autodetected
>>
> genkernel allows the user to cross-compile their kernel and/or
> initramfs, in which case uname -m would not provide the correct value.
>
> I don't have a clear picture in my mind of how that would work with
> grub, but I figure it would be better to err on the side of
> flexibility.
grub-mkconfig doesn't support cross-configuration and arch name is just
one of the problems. Unless we have a designed system for this case it's
useless to add stray bits which don't work anyway.
--
Regards
Vladimir 'φ-coder/phcoder' Serbinenko
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 294 bytes --]
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Improve support for genkernel in 10_linux
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
0 siblings, 1 reply; 10+ messages in thread
From: Mike Gilbert @ 2012-04-18 15:39 UTC (permalink / raw)
To: The development of GNU GRUB
2012/4/18 Vladimir 'φ-coder/phcoder' Serbinenko <phcoder@gmail.com>:
> On 18.04.2012 17:06, Mike Gilbert wrote:
>> 2012/4/18 Vladimir 'φ-coder/phcoder' Serbinenko <phcoder@gmail.com>:
>>> On 15.04.2012 04:21, Mike Gilbert wrote:
>>>> On 04/11/2012 11:52 AM, Mike Gilbert wrote:
>>>>> 2012/4/11 Vladimir 'φ-coder/phcoder' Serbinenko <phcoder@gmail.com>:
>>>>>> On 11.04.2012 04:56, Mike Gilbert wrote:
>>>>>>> On 04/07/2012 05:54 PM, Mike Gilbert wrote:
>>>>>>>> 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.
>>>>>>>>
>>>>>>> It was brought to my attention that genkernel's initramfs code will in
>>>>>>> fact utilize "root" if "real_root" is unset. This part of my previous
>>>>>>> patch is therefore pointless.
>>>>>>>
>>>>>>> I have attached a revised patch containing only the changes necessary to
>>>>>>> detect a genkernel initramfs image.
>>>>>>>
>>>>>> pushd/popd isn't POSIX so we can't use it in our scripts. Also I don't
>>>>>> feel like glob expansion is the right thing to use here. Why not infer
>>>>>> the architecture from uname ?
>>>>> That should also work. Here's the logic that genkernel uses to populate ARCH:
>>>>>
>>>>> ARCH=`uname -m`
>>>>> case "${ARCH}" in
>>>>> i?86)
>>>>> ARCH="x86"
>>>>> ;;
>>>>> mips|mips64)
>>>>> ARCH="mips"
>>>>> ;;
>>>>> arm*)
>>>>> ARCH=arm
>>>>> ;;
>>>>> *)
>>>>> ;;
>>>>> esac
>>>>>
>>>>> I'm thinking it would be a good idea to rename ARCH to something like
>>>>> GENKERNEL_ARCH. We should also let the user override this in
>>>>> /etc/default/grub.
>>>>>
>>>>> Does that sound ok?
>>>> I have modified my patch to implement what I describe above.
>>>>
>>> What is the reason to make it configurable? There shouldn't be any need
>>> to configure something that is autodetected
>>>
>> genkernel allows the user to cross-compile their kernel and/or
>> initramfs, in which case uname -m would not provide the correct value.
>>
>> I don't have a clear picture in my mind of how that would work with
>> grub, but I figure it would be better to err on the side of
>> flexibility.
> grub-mkconfig doesn't support cross-configuration and arch name is just
> one of the problems. Unless we have a designed system for this case it's
> useless to add stray bits which don't work anyway.
>
Alright, not a bit deal. Do you need a new patch from me?
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Improve support for genkernel in 10_linux
2012-04-18 15:39 ` Mike Gilbert
@ 2012-04-18 21:26 ` Vladimir 'φ-coder/phcoder' Serbinenko
0 siblings, 0 replies; 10+ messages in thread
From: Vladimir 'φ-coder/phcoder' Serbinenko @ 2012-04-18 21:26 UTC (permalink / raw)
To: grub-devel
[-- Attachment #1: Type: text/plain, Size: 3085 bytes --]
On 18.04.2012 17:39, Mike Gilbert wrote:
> 2012/4/18 Vladimir 'φ-coder/phcoder' Serbinenko <phcoder@gmail.com>:
>> On 18.04.2012 17:06, Mike Gilbert wrote:
>>> 2012/4/18 Vladimir 'φ-coder/phcoder' Serbinenko <phcoder@gmail.com>:
>>>> On 15.04.2012 04:21, Mike Gilbert wrote:
>>>>> On 04/11/2012 11:52 AM, Mike Gilbert wrote:
>>>>>> 2012/4/11 Vladimir 'φ-coder/phcoder' Serbinenko <phcoder@gmail.com>:
>>>>>>> On 11.04.2012 04:56, Mike Gilbert wrote:
>>>>>>>> On 04/07/2012 05:54 PM, Mike Gilbert wrote:
>>>>>>>>> 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.
>>>>>>>>>
>>>>>>>> It was brought to my attention that genkernel's initramfs code will in
>>>>>>>> fact utilize "root" if "real_root" is unset. This part of my previous
>>>>>>>> patch is therefore pointless.
>>>>>>>>
>>>>>>>> I have attached a revised patch containing only the changes necessary to
>>>>>>>> detect a genkernel initramfs image.
>>>>>>>>
>>>>>>> pushd/popd isn't POSIX so we can't use it in our scripts. Also I don't
>>>>>>> feel like glob expansion is the right thing to use here. Why not infer
>>>>>>> the architecture from uname ?
>>>>>> That should also work. Here's the logic that genkernel uses to populate ARCH:
>>>>>>
>>>>>> ARCH=`uname -m`
>>>>>> case "${ARCH}" in
>>>>>> i?86)
>>>>>> ARCH="x86"
>>>>>> ;;
>>>>>> mips|mips64)
>>>>>> ARCH="mips"
>>>>>> ;;
>>>>>> arm*)
>>>>>> ARCH=arm
>>>>>> ;;
>>>>>> *)
>>>>>> ;;
>>>>>> esac
>>>>>>
>>>>>> I'm thinking it would be a good idea to rename ARCH to something like
>>>>>> GENKERNEL_ARCH. We should also let the user override this in
>>>>>> /etc/default/grub.
>>>>>>
>>>>>> Does that sound ok?
>>>>> I have modified my patch to implement what I describe above.
>>>>>
>>>> What is the reason to make it configurable? There shouldn't be any need
>>>> to configure something that is autodetected
>>>>
>>> genkernel allows the user to cross-compile their kernel and/or
>>> initramfs, in which case uname -m would not provide the correct value.
>>>
>>> I don't have a clear picture in my mind of how that would work with
>>> grub, but I figure it would be better to err on the side of
>>> flexibility.
>> grub-mkconfig doesn't support cross-configuration and arch name is just
>> one of the problems. Unless we have a designed system for this case it's
>> useless to add stray bits which don't work anyway.
>>
> Alright, not a bit deal. Do you need a new patch from me?
I've fixed it myself. Also I've kept the incorrect names for backwards
compatibility and since they create no problem
> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> https://lists.gnu.org/mailman/listinfo/grub-devel
--
Regards
Vladimir 'φ-coder/phcoder' Serbinenko
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 294 bytes --]
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2012-04-18 21:26 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-07 21:54 Improve support for genkernel in 10_linux Mike Gilbert
2012-04-11 2:56 ` 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
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.