Welcome new user! You can search existing questions and answers without registering, but please register to post new questions and receive answers.

Problem Building & flashing SD from clean installation on ubuntu 16.10

0 votes
After building jevois and jevoisbase following easy install procedure

i try to build sd card but have this error:

simone@MacBookUbuntu:~/jevois-sdk$ ./jevois-build.sh -y /dev/sdb
INFO: CHIP: sun8iw5p1 PLATFORM: linux KERN: linux-3.4 BOARD: jevois33
INFO: ----------------------------------------
INFO: build lichee ...
INFO: chip: sun8iw5p1
INFO: platform: linux
INFO: kernel: linux-3.4
INFO: board: jevois33
INFO: output: out/sun8iw5p1/linux/jevois33
INFO: ----------------------------------------
INFO: CHIP: sun8iw5p1 PLATFORM: linux KERN: linux-3.4 BOARD: jevois33
INFO: build buildroot ...

.

.

.

.

/home/simone/jevois-sdk/out/sun8iw5p1/linux/common/buildroot/target/usr/share/doc
rm -rf /home/simone/jevois-sdk/out/sun8iw5p1/linux/common/buildroot/target/usr/share/gtk-doc
rmdir /home/simone/jevois-sdk/out/sun8iw5p1/linux/common/buildroot/target/usr/share 2>/dev/null
Makefile:617: recipe for target 'target-finalize' failed
make: [target-finalize] Error 1 (ignored)
find /home/simone/jevois-sdk/out/sun8iw5p1/linux/common/buildroot/target -type f \( -perm /111 -o -name '*.so*' \) -not \( -name 'libpthread*.so*' -o -name 'ld-*.so*' -o -name '*.ko' \) -print0 | xargs -0 /home/simone/jevois-sdk/out/sun8iw5p1/linux/common/buildroot/host/usr/bin/arm-buildroot-linux-gnueabihf-strip --remove-section=.comment --remove-section=.note 2>/dev/null || true
if test -d /home/simone/jevois-sdk/out/sun8iw5p1/linux/common/buildroot/target/lib/modules; then \
    find /home/simone/jevois-sdk/out/sun8iw5p1/linux/common/buildroot/target/lib/modules -type f -name '*.ko' -print0 | \
    xargs -0 -r /home/simone/jevois-sdk/out/sun8iw5p1/linux/common/buildroot/host/usr/bin/arm-buildroot-linux-gnueabihf-strip --remove-section=.comment --remove-section=.note --strip-unneeded; fi
find /home/simone/jevois-sdk/out/sun8iw5p1/linux/common/buildroot/target/lib -type f -name 'libpthread*.so*' | \
    xargs -r /home/simone/jevois-sdk/out/sun8iw5p1/linux/common/buildroot/host/usr/bin/arm-buildroot-linux-gnueabihf-strip --remove-section=.comment --remove-section=.note --strip-debug
find /home/simone/jevois-sdk/out/sun8iw5p1/linux/common/buildroot/target/lib -type f -name 'ld-*.so*' | \
    xargs -r /home/simone/jevois-sdk/out/sun8iw5p1/linux/common/buildroot/host/usr/bin/arm-buildroot-linux-gnueabihf-strip --remove-section=.comment --remove-section=.note --strip-debug
test -f /home/simone/jevois-sdk/out/sun8iw5p1/linux/common/buildroot/target/etc/ld.so.conf && \
    { echo "ERROR: we shouldn't have a /etc/ld.so.conf file"; exit 1; } || true
test -d /home/simone/jevois-sdk/out/sun8iw5p1/linux/common/buildroot/target/etc/ld.so.conf.d && \
    { echo "ERROR: we shouldn't have a /etc/ld.so.conf.d directory"; exit 1; } || true
mkdir -p /home/simone/jevois-sdk/out/sun8iw5p1/linux/common/buildroot/target/etc
( \
    echo "NAME=Buildroot"; \
    echo "VERSION=2016.08-rc2-gba432eb"; \
    echo "ID=buildroot"; \
    echo "VERSION_ID=2016.08-rc2"; \
    echo "PRETTY_NAME=\"Buildroot 2016.08-rc2\"" \
) >  /home/simone/jevois-sdk/out/sun8iw5p1/linux/common/buildroot/target/etc/os-release
>>>   Executing post-build script target/sun8i.sh
cp: cannot stat '/home/simone/jevois-sdk/out/sun8iw5p1/linux/common/buildroot/external-toolchain/arm-linux-gnueabi/libc/lib/arm-linux-gnueabi/*': No such file or directory
bin/

.

.

.

usr/bin/ldd
>>>   Generating root filesystem image rootfs.ext2
rm -f /home/simone/jevois-sdk/out/sun8iw5p1/linux/common/buildroot/build/_fakeroot.fs
rm -f /home/simone/jevois-sdk/out/sun8iw5p1/linux/common/buildroot/target/THIS_IS_NOT_YOUR_ROOT_FILESYSTEM
rm -f /home/simone/jevois-sdk/out/sun8iw5p1/linux/common/buildroot/build/_users_table.txt
echo '#!/bin/sh' > /home/simone/jevois-sdk/out/sun8iw5p1/linux/common/buildroot/build/_fakeroot.fs
echo "set -e" >> /home/simone/jevois-sdk/out/sun8iw5p1/linux/common/buildroot/build/_fakeroot.fs
echo "chown -h -R 0:0 /home/simone/jevois-sdk/out/sun8iw5p1/linux/common/buildroot/target" >> /home/simone/jevois-sdk/out/sun8iw5p1/linux/common/buildroot/build/_fakeroot.fs
printf '   \n' >> /home/simone/jevois-sdk/out/sun8iw5p1/linux/common/buildroot/build/_users_table.txt
PATH="/home/simone/jevois-sdk/out/sun8iw5p1/linux/common/buildroot/host/bin:/home/simone/jevois-sdk/out/sun8iw5p1/linux/common/buildroot/host/sbin:/home/simone/jevois-sdk/out/sun8iw5p1/linux/common/buildroot/host/usr/bin:/home/simone/jevois-sdk/out/sun8iw5p1/linux/common/buildroot/host/usr/sbin:/home/simone/bin:/home/simone/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin" /home/simone/jevois-sdk/buildroot/support/scripts/mkusers /home/simone/jevois-sdk/out/sun8iw5p1/linux/common/buildroot/build/_users_table.txt /home/simone/jevois-sdk/out/sun8iw5p1/linux/common/buildroot/target >> /home/simone/jevois-sdk/out/sun8iw5p1/linux/common/buildroot/build/_fakeroot.fs
cat target/generic/device_table.txt > /home/simone/jevois-sdk/out/sun8iw5p1/linux/common/buildroot/build/_device_table.txt
printf '       /bin/busybox                     f 4755 0  0 - - - - -\n /dev/console c 622 0 0 5 1 - - -\n\n' >> /home/simone/jevois-sdk/out/sun8iw5p1/linux/common/buildroot/build/_device_table.txt
echo "/home/simone/jevois-sdk/out/sun8iw5p1/linux/common/buildroot/host/usr/bin/makedevs -d /home/simone/jevois-sdk/out/sun8iw5p1/linux/common/buildroot/build/_device_table.txt /home/simone/jevois-sdk/out/sun8iw5p1/linux/common/buildroot/target" >> /home/simone/jevois-sdk/out/sun8iw5p1/linux/common/buildroot/build/_fakeroot.fs
printf '       PATH="/home/simone/jevois-sdk/out/sun8iw5p1/linux/common/buildroot/host/bin:/home/simone/jevois-sdk/out/sun8iw5p1/linux/common/buildroot/host/sbin:/home/simone/jevois-sdk/out/sun8iw5p1/linux/common/buildroot/host/usr/bin:/home/simone/jevois-sdk/out/sun8iw5p1/linux/common/buildroot/host/usr/sbin:/home/simone/bin:/home/simone/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin" mke2img -d /home/simone/jevois-sdk/out/sun8iw5p1/linux/common/buildroot/target -G 4 -R 1 -B 0 -I 0 -o /home/simone/jevois-sdk/out/sun8iw5p1/linux/common/buildroot/images/rootfs.ext2\n' >> /home/simone/jevois-sdk/out/sun8iw5p1/linux/common/buildroot/build/_fakeroot.fs
chmod a+x /home/simone/jevois-sdk/out/sun8iw5p1/linux/common/buildroot/build/_fakeroot.fs
PATH="/home/simone/jevois-sdk/out/sun8iw5p1/linux/common/buildroot/host/bin:/home/simone/jevois-sdk/out/sun8iw5p1/linux/common/buildroot/host/sbin:/home/simone/jevois-sdk/out/sun8iw5p1/linux/common/buildroot/host/usr/bin:/home/simone/jevois-sdk/out/sun8iw5p1/linux/common/buildroot/host/usr/sbin:/home/simone/bin:/home/simone/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin" /home/simone/jevois-sdk/out/sun8iw5p1/linux/common/buildroot/host/usr/bin/fakeroot -- /home/simone/jevois-sdk/out/sun8iw5p1/linux/common/buildroot/build/_fakeroot.fs
fakeroot: preload library `libfakeroot.so' not found, aborting.
fs/ext2/ext2.mk:46: recipe for target '/home/simone/jevois-sdk/out/sun8iw5p1/linux/common/buildroot/images/rootfs.ext2' failed
make: *** [/home/simone/jevois-sdk/out/sun8iw5p1/linux/common/buildroot/images/rootfs.ext2] Error 1
make: Leaving directory '/home/simone/jevois-sdk/buildroot'
ERROR: build buildroot Failed
asked May 1 in Programmer Questions by simonefalsini (180 points)

2 Answers

0 votes
Did you complete any of the other sections from the install help besides the Easy Install Option section?  I had the same problem.  I'm not sure which, but either running through the entire install instructions or prefixing some of the install script commands with sudo fixed it for me.  I assume you also confirmed the SD card is in fact mounted as sdb on your machine?
answered May 2 by franz (1,060 points)
0 votes
Apparently buildroot hardcodes absolute host build paths in multiple places through the build tree. Unfortunately that means certain things are expecting the base path to be /home/ilab/jevois-sdk. Fakeroot is one of these, and it's actually a shell script so you can open it in an editor and see the bogus paths.

Unfortunately that means the easy install route is currently broken for everyone except for the jevois developers... and anyone whose username is "ilab" :P
answered May 4 by pelrun (2,310 points)
Thanks for confirming, this has been a bit of a puzzle here.

We need to think about the best solution...

either recompile everything (10+ hours)?

or patch all the instances of /home/ilab to the new user name (very hacky)?

or?
Is there any solution to this yet?
must have change hardcoded path with :
grep -l -r --include "*.sh" home/ilab .|xargs sed -i 's/home\/ilab/home\/velvet/g'
velvet is my user account.
But there is another problem with fakeroot : the one installed in jevois doesn't work (fakeroot: preload library `libfakeroot.so' not found, aborting.).
So I have also to change BR_PATH in buildroot/Makefile : line 401
BR_PATH = "/usr/bin:$(HOST_DIR)/bin:$(HOST_DIR)/sbin:$(HOST_DIR)/usr/bin:$(HOST_DIR)/usr/sbin:$(PATH)"
to make /usr/bin prioritary.
And in buildroot/fs/common.mk , change :
PATH=$$(BR_PATH) $$(HOST_DIR)/usr/bin/fakeroot -- $$(FAKEROOT_SCRIPT)
into
PATH=$$(BR_PATH) fakeroot -- $$(FAKEROOT_SCRIPT)

Surely not the best way but it works !
Thanks stilgar, your approach looks great.

Here are two temporary fixes. As noted here and in other threads, problems arise because the user name (ilab) that we used to precompile many of the files in the jevois-sdk gets hardwired into some scripts, libraries, etc which then fail when another user is attempting to build a microSD image.

Option 1: Create a user named ‘ilab’ on your linux box, and run the easy install in that user’s account. You should be able to follow the EASY INSTALL OPTION of https://github.com/jevois/jevois/blob/master/INSTALL and get everything setup and be able to flash new microSD cards.

Option 2: This takes a while to run and does require some manual intervention, but all steps are outlined and should be easy to follow. Basically, you will rebuild the JeVois operating system partially from scratch, which will eliminate the dependence on the hardcoded user name.

cd ~/jevois-sdk
rm -rf out

and then follow the instructions starting at line 302 of https://github.com/jevois/jevois/blob/master/INSTALL

We just tested it here using a different username and it worked fine. We will try to find a better solution soon. Maybe not all of the out/ directory has to be nuked.
I forgot, make sure you also rebuild jevois and jevoisbase since they got nuked in the process:

cd ~/jevois && git pull && ./rebuild-platform.sh
cd ~/jevoisbase && git pull && ./rebuild-platform.sh -DJEVOIS_MODULES_TO_BUILDROOT=ON
cd ~/jevois-sdk && git pull && ./jevois-build.sh -y /dev/sdX
Tested with easy-install and ilab user : works well, just a strange behavior, after the creation of user ilab I have to reboot (at least create a new terminal session) else JEVOIS_SRC_ROOT continue to point at my old user account ...
...