Ticket #1344 (closed defect: fixed)

Opened 11 years ago

Last modified 11 years ago

Kernel upgrade fails with GTA01 rootfs on SDHC

Reported by: cwixon@… Owned by: julian_chu
Priority: high Milestone:
Component: Distro Version: 2007.2
Severity: normal Keywords:
Cc: buglog@… Blocked By:
Blocking: Estimated Completion (week):
HasPatchForReview: PatchReviewResult:


I don't know exactly where to categorize this, because it's not really a kernel
issue, but more related to packaging and flashing . . . feel free to reclassify
this bug.

In any event, I'm running an AUTOREV rootfs (built myself) on my SDHC card via
the procedure described here:

Accordingly, my kernel is in NAND where it usually goes.

When the kernel gets upgraded via ipkg/opkg, the new kernel-image .ipk file has
a postinst script that is supposed to erase the kernel partition and reflash it
with the new kernel. But that's not working. Looks like this:

root@thrakkorzog:/$opkg upgrade
Configuring kernel-image-2.6.24
Upgrading kernel in Flash
DO NOT stop this process
/usr/bin/flash_eraseall: /dev/: Is a directory
postinst script returned status 1
Nothing to be done
Collected errors:
ERROR: kernel-image-2.6.24.postinst returned 1

So I looked into this a little further, and it appears that the postinst script
does some hackery based on grepping "kernel" in the contents of /proc/mtd to
determine where to flash. That should indicate where the kernel lives. But on
my device:

root@thrakkorzog:/$cat /proc/mtd
dev: size erasesize name
mtd0: 04000000 00004000 "neo1973-nand"

And that's all. So the kernel doesn't show up at all, and the flash operation

But I know it's there, and the default NAND partitioning scheme is in place (I
even have a basic rootfs in NAND, but I don't boot from it).

My workaround is to have a custom .bb for the kernel based on the official one
but with a few defconfig tweaks (turn OFF mmc debug messages) and removal of the
postinst flash operations to allow it to succeed. I haven't tested this yet
because there's something wrong with the openmoko git repository, but that's
another problem . . .

Change History

comment:1 Changed 11 years ago by andy@…

I guess this was an issue about passing in dynparts from the U-Boot environment.

When I boot from SD card on GTA02 (which I do a lot) I get

# cat /proc/mtd
dev: size erasesize name
mtd0: 00200000 00010000 "physmap-flash.0"
mtd1: 00040000 00020000 "u-boot"
mtd2: 00040000 00020000 "u-boot_env"
mtd3: 00800000 00020000 "kernel"
mtd4: 000a0000 00020000 "splash"
mtd5: 00040000 00020000 "factory"
mtd6: 0f6a0000 00020000 "rootfs"

which is correct. If I cat /proc/cmdline (ie, this is what the U-Boot
environment gave Linux):

rootfstype=ext2 root=/dev/mmcblk0p2 loglevel=4 init=/sbin/init ro

comment:2 Changed 11 years ago by andy

  • Owner changed from openmoko-kernel@… to julian_chu
  • Component changed from System Software to Distro

Moving to "Distro" Component. Please close it if seems to be fixed.

comment:3 Changed 11 years ago by julian_chu

  • Status changed from new to accepted

There are some code in postinstall

                if [ "x$MTD_KERNEL_PARTITION" = "x" ] ; then
                        exit 1

Therefore it should exit if it doesnt' find kernel partition.

However, I will do a test after I got a GTA01

Thanks, Andy , Cwixon

comment:4 Changed 11 years ago by graeme

  • Status changed from accepted to closed
  • Resolution set to fixed

I think this is fixed, closing.

Note: See TracTickets for help on using tickets.