Welcome! Log In Create A New Profile

Advanced

updating kernel - what else do you need to do after copying uimage & modules ?

Posted by hyena 
updating kernel - what else do you need to do after copying uimage & modules ?
March 10, 2013 01:50PM
Hi,

just cross compiled a new kernel (for my kirkwood based iconnect) ... and have the uimage and modules and copied them across to the existing wkg (old kernel - 3.2.0-4) boot usb flash drive ... it all boots up fine and in to the new kernel .. but i get an error on apt-get when it tries 2 update using initramfs-tools the old kernel version of the files (3.2.0-4) rather than the new version of the files

which gives me the error message

update-initramfs: Generating /boot/initrd.img-3.2.0-4-kirkwood
Unsupported platform.
run-parts: /etc/initramfs/post-update.d//flash-kernel exited with return code 1
dpkg: error processing initramfs-tools (--configure):
subprocess installed post-installation script returned error exit status 1

Can anyone give me the instructions to update the files on the boot partition to the new kernel version which im hoping will get rid of the error and a proper boot process

thx

ian
Re: updating kernel - what else do you need to do after copying uimage & modules ?
March 10, 2013 04:16PM
Ian,

I think because you did not run dpkg -i your-new-kernel-name.deb. Because dpkg modifies the hooks in initramfs to use the new kernel, IIRC. So somewhere in there the hooks still point to the old kernel.

So rather finding the hooks files and manually change it, you can just run
cd /boot
dpkg -i your-new-kernel-name.deb

to install everything into the correct location.

-bodhi
Re: updating kernel - what else do you need to do after copying uimage & modules ?
March 10, 2013 04:26PM
Bodhi,

hi

thx for this,

my /boot on the iconnect flash drive consists of :

config-3.2.0-4-kirkwood
System.map-3.2.0-4-kirkwood
initrd.img
uImage
initrd.img-3.2.0-4-kirkwood
vmlinuz
initrd.img-3.2.0-4-kirkwood.dpkg-bak
vmlinuz-3.2.0-4-kirkwood

the uimage being the new kernel (3.5.0-iconnect)

i dont have a .deb file, so just get the no file found message

thx

ian
Re: updating kernel - what else do you need to do after copying uimage & modules ?
March 10, 2013 04:31PM
After you compiled the kernel, it should give you a .deb file?

In any case, I think if you look somewhere in post install for initramfs (I don't remmeber where, if I can find it in the log, I'll post here), I recall there is a file where the kernel name is written in during dpkg installation.

P.S.

-You can see the old kernel still installed with
apt-cache search linux-image

- Ok, found it: look for post install stuff in /etc/kernel



Edited 2 time(s). Last edit at 03/10/2013 04:41PM by bodhi.
Re: updating kernel - what else do you need to do after copying uimage & modules ?
March 10, 2013 04:46PM
hyena Wrote:
-------------------------------------------------------
> Bodhi,
>
> hi
>
> thx for this,
>
> my /boot on the iconnect flash drive consists of
> :
>
> config-3.2.0-4-kirkwood
> System.map-3.2.0-4-kirkwood
> initrd.img
> uImage
> initrd.img-3.2.0-4-kirkwood
> vmlinuz
> initrd.img-3.2.0-4-kirkwood.dpkg-bak
> vmlinuz-3.2.0-4-kirkwood
>
> the uimage being the new kernel (3.5.0-iconnect)
>
> i dont have a .deb file, so just get the no file
> found message
>
> thx
>
> ian

Ian,

You also need to copy

config-3.5.0-iconnect
System.map-3.5.0-iconnect
initrd.img-3.5.0-iconnect
vmlinuz-3.5.0-iconnect

-bodhi
Re: updating kernel - what else do you need to do after copying uimage & modules ?
March 10, 2013 06:31PM
Bodhi,

hi,

I'm struggling to find the files .. heres what i did to compile the kernel :

download source and patch it for iconnect
/usr/src/linux-3.5

make ARCH=arm menuconfig <<i then configure kernel and save>>
make -j4 ARCH=arm CROSS_COMPILE=../arm-2010q1/bin/arm-none-eabi-uImage
make -j4 ARCH=arm CROSS_COMPILE=../arm-2010q1/bin/arm-none-eabi-modules
make -j4 ARCH=arm CROSS_COMPILE=../arm-2010q1/bin/arm-none-eabi-INSTALL_MOD_PATH=../ modules_install

this gives me a uimage (in usr/src/linux-3.5/arch/arm/boot) and a directory of modules (3.5.0-iconnect in usr/src/lib/modules)

it would be great to find out how both to modify the above to generate the .deb to apply in the way you described

plus the alternative which is to copy across the uimage and the directory of modules to a working boot flash drive and how to get at the the "missing files" needed to replace the old kernel files on /boot


thx

ian



Edited 1 time(s). Last edit at 03/14/2013 12:34PM by hyena.
Re: updating kernel - what else do you need to do after copying uimage & modules ?
March 11, 2013 12:13AM
Ian,

So you're cross-compiling the kernel on you PC? I compiled it natively. Perhaps shv can answer this question, since shv has recently cross-compiled a 3.x.x kernel.

- bodhi
Re: updating kernel - what else do you need to do after copying uimage & modules ?
March 13, 2013 01:40PM
Got rid of the apt-get error by "dumb ignorant brutality" - deleted /var/lib/intramfs-tools/3.2.0.4-kirkwood and ran apt-get update/apt-get upgrade and error message gone .. not very satisfactory as I'm sure the boot process is still falling over but falling over to boot eventually the new kernel



Edited 1 time(s). Last edit at 03/14/2013 08:28AM by hyena.
shv
Re: updating kernel - what else do you need to do after copying uimage & modules ?
March 14, 2013 01:02PM
Installing Linaro ARM Cross Toolchain on Ubuntu:

apt-get install gcc-arm-linux-gnueabi
apt-get install kernel-package

You can use the following command to cross compile the kernel and get the necessary .deb file:

DEB_HOST_ARCH=armel fakeroot make-kpkg --arch arm --cross-compile arm-linux-gnueabi- --append-to-version=-hyena --revision=1.0 --initrd -j 5 kernel_image

I am not sure if the option -j 5 is similar to CONCURRENCY_LEVEL=5 to use some processor cores in parallel to speed up the build time.



Edited 4 time(s). Last edit at 03/14/2013 01:08PM by shv.
Re: updating kernel - what else do you need to do after copying uimage & modules ?
March 15, 2013 04:42PM
Shv, thanks for this .. had a try and generated the .deb and installed

but still the same error message ... on apt-get

-------------------------------
Setting up linux-image-3.5.0-hyena-iconnect (1.0) ...

Hmm. There is a symbolic link /lib/modules/3.5.0-hyena-iconnect/build
However, I can not read it: No such file or directory
Therefore, I am deleting /lib/modules/3.5.0-hyena-iconnect/build


Hmm. The package shipped with a symbolic link /lib/modules/3.5.0-hyena-iconnect/source
However, I can not read the target: No such file or directory
Therefore, I am deleting /lib/modules/3.5.0-hyena-iconnect/source

Running depmod.
Examining /etc/kernel/postinst.d.
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 3.5.0-hyena-iconnect /boot/vmlinuz-3.5.0-hyena-iconnect
update-initramfs: Generating /boot/initrd.img-3.5.0-hyena-iconnect
flash-kernel: deferring update (trigger activated)
run-parts: executing /etc/kernel/postinst.d/zz-flash-kernel 3.5.0-hyena-iconnect /boot/vmlinuz-3.5.0-hyena-iconnect
flash-kernel: deferring update (trigger activated)
Processing triggers for flash-kernel ...
Unsupported platform.
dpkg: error processing flash-kernel (--install):
subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
flash-kernel
-----------------------------------------------------



Edited 2 time(s). Last edit at 03/15/2013 05:21PM by hyena.
Re: updating kernel - what else do you need to do after copying uimage & modules ?
March 15, 2013 06:05PM
@hyena,

I'm not sure I understand. What files did you get on your /boot ? did you get

/boot/initrd.img-3.5.0-hyena-iconnect
/boot/vmlinuz-3.5.0-hyena-iconnect

If you did, then ignore the error, it was caused by flash-kernel, and you don't really need it to automatically generate your uImage and uInitrd.
shv
Re: updating kernel - what else do you need to do after copying uimage & modules ?
March 16, 2013 05:07AM
And then generate new uImage and uInitrd:

mkimage -A arm -O linux -T kernel -C none -a 0x00008000 -e 0x00008000 -n Linux-3.5.0-iconnect -d /boot/vmlinuz-3.5.0-hyena-iconnect /boot/uImage
mkimage -A arm -O linux -T ramdisk -C gzip -a 0x00000000 -e 0x00000000 -n initramfs-3.5.0-iconnect -d /boot/initrd.img-3.5.0-hyena-iconnect /boot/uInitrd
Re: updating kernel - what else do you need to do after copying uimage & modules ?
March 16, 2013 08:40PM
shv,

hi,many thx for this

just installed the tools first ... apt-get install u-boot-tools uboot-mkimage then ...

tried your commands .. first command worked fine, second didn't .. figured second should be something like this (which seemed to work)

mkimage -A arm -O linux -T ramdisk -C gzip -a 0x00000000 -e 0x00000000 -n initramfs -d initrd.img-3.5.0-hyena-iconnect /boot/uInitrd


did the apt-get update/install after and it seems to have done the job fingers crossed :-) deleted all the 3.2.0-4 files in /boot & lib/modules as a test and it seemed to boot ok as well :-) .. thx a lot for the help !

a good reference for those ppl doing a kernel update on these devices ...

---------------------------------------------------------------------------------------
The following packages will be upgraded:
linux-image-3.2.0-4-kirkwood
1 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 15.2 MB of archives.
After this operation, 114 kB of additional disk space will be used.
Do you want to continue [Y/n]? y
Get:1 http://mirror.ox.ac.uk/debian/ wheezy/main linux-image-3.2.0-4-kirkwood ar mel 3.2.39-2 [15.2 MB]
Fetched 15.2 MB in 14s (1,071 kB/s)
Reading changelogs... Done
Preconfiguring packages ...
(Reading database ... 22870 files and directories currently installed.)
Preparing to replace linux-image-3.2.0-4-kirkwood 3.2.35-2 (using .../linux-imag e-3.2.0-4-kirkwood_3.2.39-2_armel.deb) ...
Examining /etc/kernel/preinst.d/
Unpacking replacement linux-image-3.2.0-4-kirkwood ...
Examining /etc/kernel/postrm.d .
run-parts: executing /etc/kernel/postrm.d/initramfs-tools 3.2.0-4-kirkwood /boot/vmlinuz-3.2.0-4-kirkwood
run-parts: executing /etc/kernel/postrm.d/zz-flash-kernel 3.2.0-4-kirkwood /boot/vmlinuz-3.2.0-4-kirkwood
Setting up linux-image-3.2.0-4-kirkwood (3.2.39-2) ...
Running depmod.
Examining /etc/kernel/postinst.d.
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 3.2.0-4-kirkwood /boot/vmlinuz-3.2.0-4-kirkwood
update-initramfs: Generating /boot/initrd.img-3.2.0-4-kirkwood
Ignoring old or unknown version 3.2.0-4-kirkwood (latest is 3.5.0-hyena-iconnect)
run-parts: executing /etc/kernel/postinst.d/zz-flash-kernel 3.2.0-4-kirkwood /boot/vmlinuz-3.2.0-4-kirkwood
Ignoring old or unknown version 3.2.0-4-kirkwood (latest is 3.5.0-hyena-iconnect)
------------------------------------------------------------------------
shv
Re: updating kernel - what else do you need to do after copying uimage & modules ?
March 17, 2013 05:56AM
hyena Wrote:
-------------------------------------------------------
> did the apt-get update/install after and it seems
> to have done the job fingers crossed :-) deleted
> all the 3.2.0-4 files in /boot & lib/modules as a
> test and it seemed to boot ok as well :-)

Instead of just deleting the old kernel files you should deinstall them.

First find out the name of the old kernel package to delete:
dpkg -l | grep linux-image
then remove the old kernel package:
apt-get remove --purge linux-image-3.2....
apt-get autoremove
Re: updating kernel - what else do you need to do after copying uimage & modules ?
March 17, 2013 04:28PM
shv,

hi .. thx for this

I kind of found this out the hard way when the message reappeared so I uninstalled it "by chance"

.. works perfectly now .. thx a lot for you help
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: