[PATCH] make /sbin/installkernel with kernel's "make install"
Luis R. Rodriguez
mcgrof at gmail.com
Tue Jun 2 06:19:19 UTC 2009
On Wed, May 27, 2009 at 1:35 AM, Tim Gardner <tim.gardner at canonical.com> wrote:
> Jesse Barnes wrote:
>> The upstream kernel has an "install" option which is handy for
>> development. It uses /sbin/installkernel to set up the new kernel
>> (make the initrd and update GRUB). Unfortunately, on
>> Ubuntu, /sbin/installkernel doesn't actually do everything necessary to
>> set up the new kernel (no initrd, no GRUB update). This patch fixes
>> that for me, but may not be correct in all cases. Any thoughts?
>>
>> Please cc me on reply, I'm not subscribed to the kernel-team list.
>>
>> Thanks,
>> Jesse
>>
>> --- installkernel.orig 2009-05-26 00:16:48.000000000 -0700
>> +++ installkernel 2009-05-26 00:26:21.000000000 -0700
>> @@ -74,5 +74,8 @@
>> # mkboot -i ${dir}/vmlinuz-${ver} #
>> # fi #
>> ########################################################################
>> +
>> +update-initramfs -k $ver -c
>> +update-grub
>>
>> exit 0
>>
>
> We should probably add some smarts to accommodate lilo in a distro (or
> debian) centric way. I noted that arch/x86/boot/install.sh already runs
> /sbin/lilo if it exists.
>
> Scott - is it sufficient to just check for /usr/sbin/grub before running
> update-grub ? How does chain booting grub2 affect things ?
This should work with grub and grub2, I've been using it on both grub
and grub2, my patch is a bit different though, it just does this for
Ubuntu, I forget if Debian uses the same initramfs file layout or not
but in any case that can be easily modified. Patch is just
copied+pasted.
As you noted I think lilo is already handled upstream.
Luis
--- /sbin/installkernel.old 2008-10-04 12:45:40.000000000 -0700
+++ /sbin/installkernel 2009-06-01 23:08:03.000000000 -0700
@@ -66,6 +66,17 @@
updatever config "$config"
fi
+LSB_RED_ID=$(/usr/bin/lsb_release -i -s)
+
+case $LSB_RED_ID in
+"Ubuntu")
+ mkinitramfs -o $dir/initrd.img-$ver $ver
+ update-grub
+ ;;
+*)
+ ;;
+esac
+
## This is very far from existing practice in modern Debian installations
########################################################################
# if [ "$(basename $img)" = "vmlinux" ] && [ "$(id -u)" = "0" ] ; then #
More information about the kernel-team
mailing list