Updating kernel

Asked by Gary Thomas on 2010-01-05

I'm using UCK 2.10 and it works well for my needs. However, I'd like to update the kernel
on my ISO using the UCK package manager. When I try this, the resulting image will no
longer boot :-(

I've successfully updated lots of other packages, but anything related to the kernel (grub, etc)
totally hoses the result.

How can I move forward?

Thanks

Question information

Language:
English Edit question
Status:
Expired
For:
Ubuntu Customization Kit Edit question
Assignee:
No assignee Edit question
Last query:
2010-01-11
Last reply:
2010-01-28
Wolf Geldmacher (wolf-womaro) said : #1

I'm assuming that you try to perform a kernel upgrade for Karmic:

The default compression format for the initrd was changed from gzip to lzip - a change that has not yet been
tracked by UCK. Essentially this means that when you upgrade you kernel the initrd will not longer match the
kernel and you will get errors as also reported as bugs against UCK. Also the isolinux configuration now needs
to be done on a file with the name "bootlogo" instead of "message" - again a change not yet tracked by UCK.

Here's a code fragment that I use to solve these problems (you will need to add this at the end of ~/tmp/customization-scripts/customize_iso):

# ---------------%<--------------%<-----------------------

# Misc fixup for Karmic
pushd "$ISO_REMASTER_DIR"/isolinux >/dev/null

# -- what used to be called "message" is now called "bootlogo"
if [ -f isolinux.cfg -a -n "`grep "gfxboot bootlogo" isolinux.cfg 2>/dev/mull`" ]
then
        if [ -f message ]
        then
                echo "Using bootlogo instead of message"
                mv message bootlogo
        fi
fi

# -- what used to be a gzipped initrd now is a lzipped initrd
if [ -f text.cfg ]
then
        lzused=`grep initrd.lz text.cfg`
        lzipcmd=`which lzip`
        if [ -n "$lzused" ]
        then
                if [ -n "lzipcmd" ]
                then
                        if [ -f initrd.gz ]
                        then
                                echo "Recompressing initrd from gzip to lzip"
                                rm -f initrd.lz
                                gunzip <initrd.gz | lzip >initrd.lz
                                rm -f initrd.gz
                        fi
                else
                        if [ -f initrd.gz ]
                        then
                                echo "lzip command not installed"
                                echo "Switching permanently to gzipped initrd"
                                sed -e 's/initrd\.lz/initrd.gz/g' \
                                        < text.cfg >/tmp/text.cfg.$$ &&
                                mv /tmp/text.cfg.$$ text.cfg
                                rm -f initrd.lz
                        else
                                : do nothing - no initrd.gz
                        fi
                fi
        else
                : do nothing - initrd.lz not used
        fi
fi
popd >/dev/null

# ----%<---

Cheers,
Wolf

this is a great patch, actually i haven't see that attached to some bug report, anyway, can we import that into uck?
thanks
fabrizio

Gary Thomas (gary-mlbassoc) said : #3

Sorry, but this patch didn't work for me.

I started with the Ubuntu Netbook Remix and ran the package manager to update to latest,.
When I boot (via USB stick, I don't have a CD drive), I see lots of messages about missing
modules (I ran in noisy mode)

Wolf Geldmacher (wolf-womaro) said : #4

The symptoms you are describing hint to a broken kernel/initrd
combination.

I'm not sure I understand what you are trying to achieve with UCK:
My understanding is that UCK is to be used to remaster CDs -
mainly the desktop live system(s). Could you be more specific on
exactly what you are trying to do?

Gary Thomas (gary-mlbassoc) said : #5

Precisely that - I want to take a Live CD (Ubuntu Netbok Remix), fiddle with the packages a little, including
updating to the latest and then use this. The process works fine except when I allow the kernel packages
to be updated.

Wolf Geldmacher (wolf-womaro) said : #6

Did you try to generate a CD (Ubuntu Netbook Remix Remix ;-) with your changes?
Could you boot off that generated CD?
How does the changed image get transferred to the USB stick you boot from afterwards?
Which parts do you update, which parts are not updated?
Do you just copy the root image?
Do you regenerate all of the USB stick from scratch?
Which tools do you use in this process?
Which bootlader do you use to boot off the USB stick?

Gary Thomas (gary-mlbassoc) said : #7

I'm using only the stock tools. Here are the steps I use:

% uck-gui
-- start with a working CD, e.g. Netbook remix
-- run the package manager
-- update all packages to latest
-- done

% usb-creator-gtk
-- creates the bootable USB from the CD image

I've had success with this process if I manually select the packages to update and
explicitly leave out the ones that touch the kernel.

It's a simple enough process, you should be able to try it yourself.

I've also tried this process using VirtualBox and it fails the same way there.
Note: this has nothing to do with booting via USB - the same image fails when
I boot directly from CD (in VirtualBox since my hardware has no CD drive)

Gary Thomas (gary-mlbassoc) said : #8

My problem may be that I did not have 'lzip' installed. The patches to the customize_iso script
silently fall away if these tools are not installed.

I'm rebuilding now that I have the tools installed...

Gary Thomas (gary-mlbassoc) said : #9

Sadly, it still does not work :-( It can now find the /lib/modules (meaning that it's using the correct initrd file),
but it can't mount the CD.

Also, I had to make a small change to your 'patch'. The initrd files live in /cdrom/casper, not /cdrom/isolinux,
so I made this change:

        if [ -n "$lzused" ]
        then
               #------------------------------
                cd ../casper
               #------------------------------
                if [ -n "lzipcmd" ]

Any way you can try this?

Gary Thomas (gary-mlbassoc) said : #10

I finally got it to work. I had a problem with your patch - it was using 'lzip' to create the initrd.lz image,
but this needs to be created using the lzma tool. Here's the final version of your patch which is now
working for me:

# ----%<---
# Misc fixup for Karmic
pushd "$ISO_REMASTER_DIR"/isolinux >/dev/null

# -- what used to be called "message" is now called "bootlogo"
if [ -f isolinux.cfg -a -n "`grep "gfxboot bootlogo" isolinux.cfg 2>/dev/mull`" ]
then
        if [ -f message ]
        then
                echo "Using bootlogo instead of message"
                mv message bootlogo
        fi
fi

# -- what used to be a gzipped initrd now is a lzipped initrd
if [ -f text.cfg ]
then
        lzused=`grep initrd.lz text.cfg`
        lzipcmd=`which lzma`
        if [ -n "$lzused" ]
        then
                if [ -n "$lzipcmd" ]
                then
                        cd ../casper
                        if [ -f initrd.gz ]
                        then
                                echo "Recompressing initrd from gzip to lzma"
                                rm -f initrd.lz
                                gunzip <initrd.gz | lzma >initrd.lz
                                rm -f initrd.gz
                        fi
                else
                        if [ -f ../casper/initrd.gz ]
                        then
                                echo "lzma command not installed"
                                echo "Switching permanently to gzipped initrd"
                                sed -e 's/initrd\.lz/initrd.gz/g' \
                                        < text.cfg >/tmp/text.cfg.$$ &&
                                mv /tmp/text.cfg.$$ text.cfg
                                rm -f ../casper/initrd.lz
                        else
                                : do nothing - no initrd.gz
                        fi
                fi
        else
                : do nothing - initrd.lz not used
        fi
fi
popd >/dev/null
# ----%<---

Wolf Geldmacher (wolf-womaro) said : #11

Thanks for finding and fixing the bugs ;-)
I was using the "switch from lz to gz" strategy only, so the part you ran into was never tested.
BTW: There is a typo left - "/dev/mull" on line 4 should really read "/dev/null"

Launchpad Janitor (janitor) said : #12

This question was expired because it remained in the 'Open' state without activity for the last 15 days.