Glomation
 
Advanced Search
Welcome, Guest. Please login or register.

Login with username, password and session length
May 22, 2012, 03:39:03 AM
News: Welcome to GLomation peer support forum
Pages: [1]
Topic Tools  
Read August 27, 2010, 10:14:40 AM #0
mimmus

Someone knows a way to update kernel from internal linux?

Someone knows a way to update kernel from internal linux?
I need to implement some simple web function like "update firmware"
that is able to update also the kernel and not only root fs files.
« Last Edit: August 27, 2010, 03:22:49 PM by mimmus »
 
Read August 28, 2010, 05:24:05 PM #1
mimmus

Re: Someone knows a way to update kernel from internal linux?

I managed to do this.

In my first attempt I destroyed u-boot, so I have to recover the board by
sam-ba (it seems that linux version does not works but this is another
story) because the kernel (I don't know why) overwrite u-boot mtdparts
parameter and mtd1 was mapped in some part of u-boot.

At this point I applied this patch in kernel file:

arch/arm/mach-at91/board-sam9260ek.c

changing definition of ek_nand_partition with this new:

static struct mtd_partition __initdata ek_nand_partition[] = {
        {
                .name   = "uImage",
                .offset = 0x00100000,
                .size   = 4 * SZ_1M,
        },
        {
                .name   = "store",
                .offset = MTDPART_OFS_NXTBLK,
                .size   = MTDPART_SIZ_FULL,
        },
};


this time I decided to not map u-boot at all.

So I compiled corrected kernel, loaded it with u-boot and than
the two commands:

$> flash_eraseall /dev/mtd0
$> nandwrite -p /dev/mtd0 /uImage.2.6.30-gesbc9260-armel


worked as expected.

Last few words... I decide to reserve 4M for kernel instead of
3M and call second mtd as "store" instead of "rootfs".

So if you want to go classic this options should works as in the original board:

static struct mtd_partition __initdata ek_nand_partition[] = {
        {
                .name   = "uBoot",
                .offset = 0x00000000,
                .size   = SZ_1M,
        },
        {
                .name   = "uImage",
                .offset = 0x00100000,
                .size   = 3 * SZ_1M,
        },
        {
                .name   = "rootfs",
                .offset = MTDPART_OFS_NXTBLK,
                .size   = MTDPART_SIZ_FULL,
        },
};


with commands:

$> flash_eraseall /dev/mtd1
$> nandwrite -p /dev/mtd1 /uImage.2.6.30-gesbc9260-armel


but i did not tested.

« Last Edit: August 28, 2010, 05:53:59 PM by mimmus »
 
Pages: [1]
Jump to:  

Theme Update by Runic Warrior Originally created by m3talc0re