On Sat, Nov 13, 2010 at 5:42 PM, Luka Perkov <open...@lukaperkov.net> wrote: > On Wed, Nov 10, 2010 at 09:45:36PM -0500, Scott Nicholas wrote: >> I want my target to work on firstboot. I look how other targets will >> make image with 'deadc0de' at start of what will become jffs. This >> means I have to change the image CRC32 so that when it gets formatted, >> this part is not checked by u-boot next boot... >> >> The bootloader is old U-Boot. I cannot get crc32 calculated >> correctly.. I need to re-calculate the header and data CRC32, but >> we'll start with header since it's short and hopefully once I figure >> it out the data one will follow. > >> Any ideas?? The first seed of '0' seems correct too from u-boot >> mkimage sources. :( pleaseeee i've spent too long on this 1 bug. maybe >> other targets even do it different to ensure old parts of flash are >> erased? i still would like to resize image in flash on first boot. >> would allow squashfs replace without kernel. As now, kernel+squashfs >> are at the mercy of this crc. >> >> Maybe it's something simple I'm overlooking... > > My U-Boot bootm command: > > Marvell>> ? bootm > bootm [addr [arg ...]] > - boot application image stored in memory > passing arguments 'arg ...'; when booting a Linux kernel, > 'arg' can be the address of an initrd image > > This command calculates checksum for both kernel and ramdisk (kernel > located at addr1 and ramdisk located at addr2) and then boots kernel: > > Marvell>> bootm addr1 addr2 > > This command calculates checksum only for kernel (kernel located at > addr1) and then boots kernel: > > Marvell>> bootm addr1 > > Are you trying to make checksum for kernel and for ramdisk? OpenWrt does > not use ramdisk this way. If you compile your image as ramdisk you get > just one file. >
Thanks for the attempt, but I solved it. It was not an issue with bootloader at all. What I was trying to do is change the way MTD partitions are made in kernel to autodetect squashfs offset, and re-write the image header in flash so that the jffs marker (deadc0de) is not checked upon boot, much like brcm47xx target. Because once jffs formats this segment of flash, the crc32 changes, and U-boot would not boot the image. U-boot used crc32(0, data, len) which made me want to use crc32_le(0, data, len) but looking more at U-boot's crc32 function it actually XOR'd it with 0xffffffff before AND after. oops. R, Scott. _______________________________________________ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel