1 (edited by truy 2012-05-13 21:14:35)

Topic: Error building image for OLPC XO-1

I am trying to build an image (backfire branch r31348) for the XO-1 (x86-Target) but there are at least two problems:


1)

lib/decompress_unlzo.c:53: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'parse_header'

This can be fixed by modifying 'build_dir/linux-x86_olpc/linux-2.6.32.27/lib/decompress_unlzo.c' (line 40+) from

#include <linux/types.h>
#include <linux/lzo.h>
#include <linux/decompress/mm.h>

to

#include <linux/types.h>
#include <linux/lzo.h>
#include <linux/decompress/inflate_mm.h>
#include <linux/decompress/mm.h>

[s]I haven't tested but[/s] I found 'decompress_unlzo.c' created/written by 'target/linux/generic-2.6/patches-2.6.32/050-lzo_compressed_kernels.patch'

EDIT:
Fix is from http://forums.gentoo.org/viewtopic-p-6221638.html?sid=5da6c3438906c6b25d35bc08c0e7a13f#6221638
The fix in [s]changeset 18477[/s] changeset 18459 didn't do it for me [s](https://forum.openwrt.org/viewtopic.php?id=22651)[/s]

2)
At the end the image creation process gzip fails to find 'openwrt-x86-olpc-combined-ext2.img':

[...]
Root device is (117, 0)
Setup is 12472 bytes (padded to 12800 bytes).
System is 1826 kB
CRC ac87ffc1
Kernel: arch/x86/boot/bzImage is ready  (#2)
make[5]: Leaving directory `/mnt/data/openwrt/openwrt-backfire-branch/build_dir/
linux-x86_olpc/linux-2.6.32.27'
i486-openwrt-linux-uclibc-objcopy -O binary -R .reginfo -R .notes -R .note -R .c
omment -R .mdebug -R .note.gnu.build-id -S /mnt/data/openwrt/openwrt-backfire-br
anch/build_dir/linux-x86_olpc/linux-2.6.32.27/vmlinux /mnt/data/openwrt/openwrt-
backfire-branch/build_dir/linux-x86_olpc/vmlinux
i486-openwrt-linux-uclibc-objcopy -R .reginfo -R .notes -R .note -R .comment -R
.mdebug -R .note.gnu.build-id -S /mnt/data/openwrt/openwrt-backfire-branch/build
_dir/linux-x86_olpc/linux-2.6.32.27/vmlinux /mnt/data/openwrt/openwrt-backfire-b
ranch/build_dir/linux-x86_olpc/vmlinux.elf
touch /mnt/data/openwrt/openwrt-backfire-branch/build_dir/linux-x86_olpc/linux-2
.6.32.27/.image
make -C image compile install TARGET_BUILD=
make[5]: Entering directory `/mnt/data/openwrt/openwrt-backfire-branch/target/li
nux/x86/image'
make[5]: `compile' is up to date.
cp -fpR /mnt/data/openwrt/openwrt-backfire-branch/build_dir/linux-x86_olpc/linux
-2.6.32.27/arch/x86/boot/bzImage /mnt/data/openwrt/openwrt-backfire-branch/build
_dir/linux-x86_olpc/bzImage
/usr/bin/find /mnt/data/openwrt/openwrt-backfire-branch/build_dir/target-i386_uC
libc-0.9.30.1/root-x86 -type f -not -perm +0100 -not -name 'ssh_host*' -print0 |
 xargs -r -0 chmod 0644
/usr/bin/find /mnt/data/openwrt/openwrt-backfire-branch/build_dir/target-i386_uC
libc-0.9.30.1/root-x86 -type f -perm +0100 -print0 | xargs -r -0 chmod 0755
/usr/bin/find /mnt/data/openwrt/openwrt-backfire-branch/build_dir/target-i386_uC
libc-0.9.30.1/root-x86 -type d -print0 | xargs -r -0 chmod 0755
install -d -m0755 /mnt/data/openwrt/openwrt-backfire-branch/build_dir/target-i38
6_uClibc-0.9.30.1/root-x86/tmp
chmod 0777 /mnt/data/openwrt/openwrt-backfire-branch/build_dir/target-i386_uClib
c-0.9.30.1/root-x86/tmp
cp -fpR /mnt/data/openwrt/openwrt-backfire-branch/build_dir/linux-x86_olpc/bzIma
ge /mnt/data/openwrt/openwrt-backfire-branch/bin/x86/openwrt-x86-olpc-vmlinuz
/bin/tar -zcf /mnt/data/openwrt/openwrt-backfire-branch/bin/x86/openwrt-x86-olpc-rootfs.tar.gz --numeric-owner --owner=0 --group=0 -C /mnt/data/openwrt/openwrt-backfire-branch/build_dir/target-i386_uClibc-0.9.30.1/root-x86/ .
/mnt/data/openwrt/openwrt-backfire-branch/staging_dir/host/bin/genext2fs -U -b 49152 -N 6000 -d /mnt/data/openwrt/openwrt-backfire-branch/build_dir/target-i386_uClibc-0.9.30.1/root-x86/ /mnt/data/openwrt/openwrt-backfire-branch/build_dir/linux-x86_olpc/root.ext2
cp -fpR /mnt/data/openwrt/openwrt-backfire-branch/build_dir/linux-x86_olpc/root.ext2 /mnt/data/openwrt/openwrt-backfire-branch/bin/x86/openwrt-x86-olpc-rootfs-ext2.img
cp -fpR /mnt/data/openwrt/openwrt-backfire-branch/build_dir/linux-x86_olpc/bzImage /mnt/data/openwrt/openwrt-backfire-branch/bin/x86/openwrt-x86-olpc-vmlinuz
gzip -f9 /mnt/data/openwrt/openwrt-backfire-branch/bin/x86/openwrt-x86-olpc-combined-ext2.img
gzip: /mnt/data/openwrt/openwrt-backfire-branch/bin/x86/openwrt-x86-olpc-combined-ext2.img: No such file or directory
make[5]: *** [install] Error 1
make[5]: Leaving directory `/mnt/data/openwrt/openwrt-backfire-branch/target/linux/x86/image'
make[4]: *** [install] Error 2
make[4]: Leaving directory `/mnt/data/openwrt/openwrt-backfire-branch/target/linux/x86'
make[3]: *** [install] Error 2
make[3]: Leaving directory `/mnt/data/openwrt/openwrt-backfire-branch/target/linux'
make[2]: *** [target/linux/install] Error 2
make[2]: Leaving directory `/mnt/data/openwrt/openwrt-backfire-branch'
make[1]: *** [/mnt/data/openwrt/openwrt-backfire-branch/staging_dir/target-i386_uClibc-0.9.30.1/stamp/.target_install] Error 2
make[1]: Leaving directory `/mnt/data/openwrt/openwrt-backfire-branch'
make: *** [world] Error 2

I haven't found a solution yet, maybe 'scripts/combined-image.sh' didn't get executed?

Does someone know what is going on or how to fix this?

Re: Error building image for OLPC XO-1

1) Reopened ticket 6180.
2) Opened ticket 11447.