[Voyage-linux] Rebuilding Kernel and Distribution

Lee Woldanski (spam-protected)
Sun Feb 13 14:28:00 HKT 2011


So this seems to be a working solution:

diff -ruB ./voyage-live/config/chroot_local-hooks/099-voyage
./voyage-live-mod/config/chroot_local-hooks/099-voyage
--- ./voyage-live/config/chroot_local-hooks/099-voyage  2011-02-12
22:24:41.000000000 -0800
+++ ./voyage-live-mod/config/chroot_local-hooks/099-voyage
2011-02-12 22:23:40.000000000 -0800
@@ -11,9 +11,13 @@

 echo "($0)"

-for K in `ls /lib/modules/ `; do
-       update-initramfs -c -k $K
-done
+if [ ! -f /boot/initrd.img-* ]; then
+       for K in `ls /lib/modules/ `; do
+               update-initramfs -c -k $K
+               ln -s /boot/initrd.img-$K /initrd.img
+               ln -s /boot/vmlinuz-$K /vmlinuz
+       done
+fi

 if [ $(dpkg-query --show | cut -f1 | grep "^gcc$" | wc -l) -gt 0  ] ; then
     echo "($0) Building Voyage SDK.  No purging."


Without the test to see of there already is an initrd.img a build
using the stock Voyage 2.6.32 kernel package fails (since it has an
initrd.img already built).

This patch checks for the existence of an initrd.img, if it does not
find one, it runs update-initramfs to create one and puts the
appropriate symlinks in / to keep the rest of the scripts happy
without requiring further modification.

With this patch I have been able to take a vanilla 2.6.37 kernel from
kernel.org, patch it for aufs support (required), build a 2.6.37
image.deb, and rebuild a Voyage distro (img) with the latest kernel.
The resulting img boots in live mode properly, installs to a hard
disk, and reboots properly. Yay!


Thanks!


Lee

On Sat, Feb 12, 2011 at 2:03 PM, Lee Woldanski <ve7fet at tparc.org> wrote:
> Well, that gets closer.
>
> The other problem is that the symlinks in / to /boot/vmlinuz-* and
> /boot/initrd.img-* are no longer created by the make-kpkg tool.
>
> As such, when setboot.sh runs, and creates /boot/grub/menu.lst, it is
> expecting the symlinks /vmlinuz and /initrd.img. Because those are no
> longer created, once you install to a CF disk or hard drive, it will
> not boot (can't find the initrd.img or kernel).
>
> I guess there are a couple solutions to this, one is to create the
> symlinks manually with a hook, another option is to run update-grub in
> chroot on the target to find the initrd and kernel, but that might be
> a problem if you want to change the console to serial.
>
>
> Lee
>
> On Fri, Feb 11, 2011 at 1:43 AM, Kim-man 'Punky' TSE
> <punkytse at punknix.com> wrote:
>> Hi Lee,
>>
>> Strange, I followed the similar steps using the SDK and it can't be built
>> either.  But my official environment, which is still Lenny, works alright.
>>  The problem is that once you build a kernel deb using the SDK (or Squeeze I
>> suspect), debian live doesn't trigger running update-initramfs.  So I now
>> updated the 099-voyage hook and explicitly force generating the initramfs.
>>  Please checkout the latest code and try.
>>
>> Regards,
>> Punky
>>
>
> --
> Lee Woldanski, AScT
> VE7FET
>



-- 
Lee Woldanski, AScT
VE7FET




More information about the Voyage-linux mailing list