Last year, I wrote instructions and provided a download link about a minimal image for Raspberry Pi based on Raspbian. The compressed image is 84MB, and the good thing about it is that you can just use apt-get to install packages. The problem is that it’s not actually that small as once it is uncompressed the rootfs is still a massive 414 MB.
So today, I’ll explain how to create a smaller (and custom) image using the Yocto Project, a platform that let you build an embedded Linux distribution matching exactly your project’s requirements. Other advantages are that the build is configurable with config files, so it’s easily reproducible with a few command lines, and it might turn out to be useful to learn more about the Yocto Project as many boards and SoC are now making use of the framework, including Freescale i.MX6 (Wandboard, Olinuxino-imx233, Sabrelite, etc…), the Beagleboard, and Minnowboard to name a few.
If you just want the image, you can download the compressed image (12MB), extract it, use dd to copy it to your SD card, and gparted to resize the rootfs. This is an image that’s only useful for (headless) embedded systems, but more likely than not, you’d want to customize it with the instructions below.
I got started with instructions from pimpmypi, but these are a little old, and now everything seems much simpler. I’ve performed the steps below in a PC running Ubuntu 12.04 LTS, and with most dependencies required (e.g. build-essentials, git) already installed.
First you need to get poky and the meta layer for Raspberry Pi:
1 2 3 4 5 |
mkdir yocto cd yocto git clone -b dylan git://git.yoctoproject.org/poky.git cd poky git clone -b dylan git://git.yoctoproject.org/meta-raspberrypi |
dylan is the codename of the latest Yocto Project release (Version 1.4).
Then you can run the following command line to initialize some environment variables and the build directory:
1 |
. oe-init-build-env build |
Now edit conf/local.conf with vim or nano to optimize the build speed depending on your PC processor (generally number of threads/cores +1), set the machine as Raspberry Pi, and possibly adjust the GPU memory, by updating or adding the corresponding lines:
1 2 3 4 |
BB_NUMBER_THREADS = "9" PARALLEL_MAKE = "-j 9" MACHINE ?= "raspberrypi" GPU_MEM = "16" |
You may want to check the README if you want to overclock your R-Pi board, change the rootfs type, add VC-1 or/and MPEG-2 licenses, or disable overscan. All those extra options, including GPU_MEM, can be added by editing config.txt directly in the SD card, but doing it before the build makes the steps automatically reproducible.
You also need to add the path to meta-raspberrypi in conf/bblayers file, so that it looks like:
1 2 3 4 5 6 |
BBLAYERS ?= " \ /home/jaufranc/edev/rpi/yocto/poky/meta \ /home/jaufranc/edev/rpi/yocto/poky/meta-yocto \ /home/jaufranc/edev/rpi/yocto/poky/meta-yocto-bsp \ <strong> /home/jaufranc/edev/rpi/yocto/poky/meta-raspberrypi \</strong> " |
Now we’re ready to build the image. There are two images possible: rpi-basic-image and rpi-hwup-image, both of will provide a minimal image, but rpi-basic-image will add ssh-server-dropbear (for ssh server support) and splash (for the splash screen). Let’s go with rpi-basic-image:
1 |
bitbake rpi-basic-image |
It took just over one hour in my computer, but it may take less or much more time depending on your computer and/or Internet connection.
Once the build is complete you should see a file called tmp/deploy/images/rpi-basic-image-raspberrypi.rpi-sdimg, which is a symlink to the binary image you want to dump on your SD card. The file size is 80MB, but it can be compressed to 12MB if you want to distribute over the Internet:
1 |
7z a -t7z -m0=lzma -mx=9 -mfb=64 -md=32m -ms=on rpi-basic-image-raspberrypi-20130702123605.rootfs.rpi-sdimg.7z rpi-basic-image-raspberrypi-20130702123605.rootfs.rpi-sdimg |
Now insert an SD card in your Linux computer, and check the device name:
1 2 3 4 5 6 7 8 9 10 11 |
lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sr0 11:0 1 1024M 0 rom sda 8:0 0 931.5G 0 disk ├─sda1 8:1 0 915.5G 0 part / ├─sda2 8:2 0 1K 0 part └─sda5 8:5 0 16G 0 part [SWAP] sdc 8:32 0 931.5G 0 disk └─sdc1 8:33 0 931.5G 0 part /media/SEAGATE EXTENSION sdb 8:16 1 241.3M 0 disk └─sdb1 8:17 1 240.3M 0 part |
Since I have a USB hard drive attached to my computer I do this all the time, because sometimes the SD card is /dev/sdb, and other times /dev/sdc, and if I use the wrong one, all my data will be lost.
Let’s copy the image with dd or dd.sh:
1 |
sudo dd.sh if=tmp/deploy/images/rpi-basic-image-raspberrypi.rpi-sdimg of=/dev/sdb bs=1M |
Now remove the SD card, and reinsert it. The ext-3 partition in the image is only 55MB, so to make full use of your SD card storage capacity, you need to resize the partition with the command line, or easier, with gparted. Resizing from the Raspberry Pi won’t work with this image, as resize2fs utility is not available.
We’re now ready to try it out. Let’s insert the SD card into the Raspberry Pi, and connect the power. You can access the console via HDMI, the UART port, or if you’ve connected an Ethernet cable via ssh.
Near the end of the boot, or when you access the board with SSH, you should see:
1 2 3 |
Poky 9.0 (Yocto Project 1.4 Reference Distro) 1.4.1 raspberrypi ttyAMA0 raspberrypi login: |
Login with as root without password.
Let’s check some details about the kernel:
1 2 |
uname -a Linux raspberrypi 3.6.11 #1 PREEMPT Tue Jul 2 18:05:23 ICT 2013 armv6l GNU/Linux |
busybox:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
BusyBox v1.20.2 (2013-07-02 18:09:51 ICT) multi-call binary. ... Currently defined functions: [, [[, ar, ash, awk, basename, bunzip2, bzcat, cat, chattr, chgrp, chmod, chown, chroot, chvt, clear, cmp, cp, cpio, cut, date, dc, dd, deallocvt, df, diff, dirname, dmesg, dnsdomainname, du, dumpkmap, dumpleases, echo, egrep, env, expr, false, fbset, fdisk, fgrep, find, flock, free, fsck, fsck.minix, fuser, grep, groups, gunzip, gzip, halt, head, hexdump, hostname, hwclock, id, ifconfig, ifdown, ifup, insmod, ip, kill, killall, klogd, less, ln, loadfont, loadkmap, logger, logname, logread, losetup, ls, lsmod, md5sum, microcom, mkdir, mkfifo, mkfs.minix, mknod, mkswap, mktemp, modprobe, more, mount, mv, nc, netstat, nohup, nslookup, od, openvt, patch, pidof, ping, ping6, pivot_root, poweroff, printf, ps, pwd, rdate, readlink, realpath, reboot, renice, reset, rfkill, rm, rmdir, rmmod, route, run-parts, sed, seq, setconsole, sh, sleep, sort, start-stop-daemon, stat, strings, stty, swapoff, swapon, switch_root, sync, sysctl, syslogd, tail, tar, tee, telnet, test, tftp, time, top, touch, tr, traceroute, true, tty, udhcpc, udhcpd, umount, uname, uniq, unzip, uptime, users, usleep, vi, watch, wc, wget, which, who, whoami, xargs, yes, zcat |
available space:
1 2 3 4 5 6 7 8 |
df -h Filesystem Size Used Available Use% Mounted on /dev/root 212.5M 42.8M 158.9M 21% / devtmpfs 108.0M 4.0K 108.0M 0% /dev tmpfs 116.0M 188.0K 115.8M 0% /var/volatile tmpfs 116.0M 0 116.0M 0% /dev/shm tmpfs 116.0M 0 116.0M 0% /media/ram /dev/mmcblk0p1 19.9M 8.2M 11.7M 41% /media/mmcblk0p1 |
and available memory:
1 2 3 4 5 |
free -h total used free shared buffers Mem: 237628 19872 217756 0 1456 -/+ buffers: 18416 219212 Swap: 0 0 0 |
We’ve got a recent kernel, only 42.8MB of the root file system is used, and 232MB RAM available on a Raspberry Pi Model B with 256 MB RAM.
Let’s check the kernel config on the board:
1 |
zcat /proc/config.gz |
You can download the kernel config for details.
If you want to save even more memory, or add features, you can change the kernel configuration with:
1 |
bitbake virtual/kernel -c menuconfig |
and build the kernel with:
1 |
bitbake virtual/kernel |
Busybox can also be tuned with the commands:
1 2 |
bitbake busybox -c menuconfig bitbake busybox |
The images recipes are located in poky/meta-raspberrypi/recipes-core/images, and you you could copy rpi-basic-image.bb to rpi-myappliance-image.bb, and edit the later to add the recipes/packages you need.
But this may be difficult, if you don’t know exactly what you need, and luckily the Yocto Project also have a graphical interface called “hob” that you can just start from the build directory. Let’s start with rpi-hwup-image for the Raspberry Pi by selecting the corresponding machine and base image:
You can then either select “Edit Image” to add recipes and/or package groups, or simply click “Build Image” to start the build. Let’s just do that. The build is now much faster since most packages have already been built when we ran “bitbake rpi-basic-image”.
After a few minutes, you should the “Your image is ready” window below with easy access to the binaries and log files:
If instead of clicking “Build Image”, you clicked on “Edit image” you’d have access to the list of included recipes, all recipes and package groups. In the screenshot below I searched for recipes with “bcm” and “rpi” names. bcm2835 is used for GPIO support, so you may want to include it in the build.
Once you’ve selected the required packages, click on “Build Packages”, and after a while, Step 2 window will appear and let you click on “Build Image”. Your custom SD card image will be available in tmp/deploy/images/ directory with the name hob-image-raspberrypi.rpi-sdimg.
That’s just a small overview of what’s possible with the Yocto Project for the Raspberry Pi board. For further details you may want to check the project’s documentation, and you may also read Hob’s manual for specific details about Yocto’s GUI.
Jean-Luc started CNX Software in 2010 as a part-time endeavor, before quitting his job as a software engineering manager, and starting to write daily news, and reviews full time later in 2011.
Support CNX Software! Donate via cryptocurrencies, become a Patron on Patreon, or purchase goods on Amazon or Aliexpress
Incredible, congratulations. This summer if I have enough time I try to prepare my own little distro with your instructions.
Hi,
Should not it be?
mkdir yocto
cd yocto
git clone -b dylan git://git.yoctoproject.org/poky.git
cd poky
git clone -b dylan git://git.yoctoproject.org/meta-raspberrypi
Regards
@Vinicius Tinti
Correct! Thanks!
Thanks for pointing me in this direction. I already have a nice custom build for my Pi thanks to this. I do have some issue though – on first boot ethernet is working fine, but on subsequent boots it doesnt. I have to goto a prompt (using a monitor etc) and manually do “ifdown eth0” then “ifup eth0” and it is working again.
Have you seen this happen, and if so how did you fix it?
@Rich
I haven’t experienced this issue.
You can use dmesg between the boots to find out the issue, or like I do, use the serial console to check the boot log.
i tried your commands but bitbake is failing here:
Pseudo is not present but is required, building this first before the main build
ERROR: Unable to parse /home/edsiper/coding/yocto/poky/meta-raspberry/conf/layer.conf: [Errno 2] No such file or directory: ‘/home/edsiper/coding/yocto/poky/meta-raspberry/conf/layer.conf’
i cannot find the missing dependency package…
@Eduardo
If you don’t have “/home/edsiper/coding/yocto/poky/meta-raspberry/conf/layer.conf”, it’s probably because “git clone -b dylan git://git.yoctoproject.org/meta-raspberrypi” command line, or was done in the wrong directory.
please teal me how can i install gui interface (Desktop) and install other application on it ???
I tried to follow the steps to the letter, tried under Fedora and Ubuntu distributions.
Every time bitbake stops at this point:
0: linux-raspberrypi-3.6.11+git31a951046155b27361127d9cf85a1f58719fe9b3-r6 do_fetch (pid 1705)
1: linux-libc-headers-raspberrypi-3.2.27-r0 do_fetch (pid 1690)
2: bcm2835-bootfiles-20130107-r3 do_fetch (pid 1706)
It seems to be unable to get those files and I don’t know how to get them in other way. Tried to google for the problem without luck.
Any Ideas?
@kazaar
There should be some logs files, but I can’t quite remember the location.
The build will take time. If you’re computer is not a fast machine, it may take several hours, so it’s also possible you may just have to wait a bit longer.
Thank you very much for this. I have reconstructed your described build process and flashed the resulting image. After dding it to the SD, inserting SD, HDMI and uUSB power, the green ACT LED flashes up once, red LED lights up permanently, nothing is visible on the HDMI Monitor. Plugging in USB keyboard, caps lock LED does not react. I tried the same with your prebuilt image with the same result. Using a rasbian as reference from the same SD works well. Any hints would be most appreciated.
@kazaar
Just wait until bitbake finished cloning those git repositories. Especially the kernel might take a while, maybe hours. A workaround would be to modify the kernel recipe changing the original SRC_URI to a mirror.
Unless it encounters an error and notifies you about that, bitbake won’t stop.
@Luke
You could try with another SD card, or preferably use an USB to TTL debug board to access the serial console and see if there’s any output. If there’s no output at all that means the system does not boot (even to the bootloader), so it’s probably because it can’t read the SD card
@cnxsoft
Thanks, same symptoms writing your image to an old 2GB SD. Also, with the other SDHC card, rasbian works, yocto images don’t. So I guess I cannot blame the SD. Looks like I will have to recover my old FTDI cable.
Do you get any output on your HDMI display and usb function by default in the posted image?
@Luke
Yes, HDMI worked, and I used a USB keyboard to login.
@cnxsoft
Ok. So I hooked up the FTDI cable.
16 GB SanDisk Class 100 SDHC
2013-09-25-wheezy-raspbian.img will give a bunch regular linux boot kernel messages in the terminal. I can connect usb hdmi and everything works instantly.
rpi-basic-image-raspberrypi-20130702123605.rootfs.rpi-sdimg will give this �<� in terminal and no hdmi or usb interaction.
Might this be related to different hardware revisions ? A sticker on the back of my RPI says E1613RS2V13B1.0
Do you have a similar identifier?
@Luke
My raspberry Pi is in a box with lots of connected wires, and I’d have to disconnect all that to look at the back of the board, so I’d rather avoid that right now. But I have one of the earlier versions with 256MB RAM. It could be the reason for the failure. Maybe some of the binary files in the FAT partition need to be changed. You could try to copy the bin files from your working SD card to the one with the Yocto image.
@Luke
Maybe a solution. I remember newer boards have different SDRAM chips that requires an upgraded firmware.
See http://www.raspberrypi.org/phpBB3/viewtopic.php?f=28&t=52842
That’s basically the same solution as copying binaries from working SD to non working SD, but it’s neater.
That’s great! Something similar here http://blog.rogiervandenberg.nl/2013/05/how-to-fix-boot-problems-with-hynix.html
In fact I do have a newer version with hynix memory. Will update once tested
@cnxsoft
Win 🙂
So for everybody who encounters the no boot problem:
Using
bootcode.bin
cmdline.txt
config.txt
*.elf
from
http://downloads.raspberrypi.org/images/raspbian/2013-02-09-wheezy-raspbian/2013-02-09-wheezy-raspbian.zip
fixes the yocto 1.4 images on my newer 512MB hynix memory raspberry pi.
@Luke
Great!
By the way, Yocto 1.5 (Dora) has been released last month, so it’s possible replacing “dylan” by “dora” in the instructions above fixes the issue too.
For example, replacing:
git clone -b dylan git://git.yoctoproject.org/poky.git
by
git clone -b dora git://git.yoctoproject.org/poky.git
@cnxsoft
Hi,
I tried with dora for both poky and meta-raspberrypi and I’ve this error when I bitbake basic image:
ERROR: No recipes available for:
/home/plegal/svn/rpi/poky/meta-raspberrypi/recipes-graphics/mesa/mesa_9.2.2.bbappend
ERROR: Command execution failed: Exited with 1
So I tried dora for poky and dylan for meta-raspberrypi and I still have the no boot problem.
One solution is to replace the bootcode.bin, start.elf and start_cd.elf from the deploy img with the same files in the last noobs_v1.3.2 image.
After that it boots.
@phil
OK, it’s compile and boot fine if we change mesa_9.2.2 to mesa_9.1.6 and if we change the preferred kernel to 3.8.%
Hello, I created the minimal rpi-hwup-image image and it boots great. Problem is in eclipse for my c project I am using tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabi-raspbian I have used the normal or hard floating point.
The hard floating point creates an executable that when I run on this build it just says “not found” like it doesn’t even understand it. So I changed it to soft floating point and I get “segmentation fault”. My only linker entry is for pthread. What compiler works with this build? I would really appreciate your help. Thanks.
@Paul
You should use the compiler built by Yocto.
Is it possible to configure yocto to be build for raspberrypi with hard-float support set?
@Filip
Is the image armel? There must be a way to change compiler flags (CFLAGS) somewhere, maybe conf/local.conf, or meta-raspberrypi.
I am currently trying to add new packages to rpi-basic-image and build my custom distribution. I started with hello world package. I created a new meta layer and I wanted to add additional packages to the image in that layer.
I tried testing with the hello world auto tooled package. This hello
world is the hello world autotooled package downloaded from
ftp://ftp.gnu.org/gnu/hello/hello-2.7.tar.gz. When trying
to execute that bb, am getting the error as follows,
| make: *** No rule to make target `install’. Stop.
| ERROR: oe_runmake failed
My bb file is as follows,
DESCRIPTION = “Dummy”
SECTION = “package”
LICENSE = “CLOSED”
PR = “r0”
SRC_URI = “file://hello/”
inherit autotools gettext
After executing this bb file, i took a look at the logs of configure.
It says nothing to configure.
Please help me with what’s wrong with this process am following?
@Sheeru
Sorry, I haven’t done this type of modif. You’d better ask on Yocto mailing list.
The image generated out of “bitbake rpi-basic-image” works well on Raspberry Pi Rev B model. But it does not work on Rev B+ model hardware. Any one verified this?
@Aananth C N
Maybe you need to make sure you have an updated firmware…
http://www.cnx-software.com/2013/07/05/12mb-minimal-image-for-raspberry-pi-using-the-yocto-project/#comment-116525
@cnxsoft
Thank you. It worked after updating the firmware as per the link above.
Hi @cnxsoft , thank you very much for the share. I’m using “bitbake busybox -c menuconfig” and customized the utilities working good. But when I trying to add telnetd utility via busybox, I find that I need to add some configuration in rootfs, for telnetd to auto launch and configure itself. How can I find the way to add my own files to rootfs and let bitbake compile it together with the whole rootfs?
Hi
I have Rasberry Pi B+ board and downloaded the 12 Mb compressed image from the link specified in your blog.
After decompressing it I issued following command from terminal of my Ubuntu 14.04
sudo dd if=./rpi-basic-image-raspberrypi-20130702123605.rootfs.rpi-sdimg of=/dev/sdb bs=1M
Bow I have inserted the SD card on my board and attached Keyboard and Monitor to it.
My issue is When I give power to the board then nothing comes up. Can anyone help ??
@Deepak
Try -> http://www.cnx-software.com/2013/07/05/12mb-minimal-image-for-raspberry-pi-using-the-yocto-project/#comment-116504 and other comments in this post.
Hi,
I ran a bitbake rpi-base-image then tweaked a few things with hob. Problem is I don’t get any *.rpi-sdimg in my deploy dirtectory now.
Do you know how to build an sd card image from just Image-*.bin and rpi-basic-image-raspberrypi.rootfs.* files ?
Regards.
@Oolav
I found the solution to my problem :
using hob adds a few lines to your local.conf file.
add to comment the lines below :
#added by hob
#IMAGE_FSTYPES = “ext3 tar.bz2”
Then bibake rpi-basic-img creates the *.rpi-sdimg file.
Do you think I could add “rpi-sdimg” to the IMAGE_FSTYPES variable ? would it work ?
bitbake rpi-basic-image results in:
ERROR: Function failed: Unpack failure for URL: ‘http://www.rpm5.org/files/rpm/rpm-5.4/rpm-5.4.9-0.20120508.src.rpm;extract=rpm-5.4.9.tar.gz’. Unpack command PATH=”/home/yocto/poky.git/scripts/native-intercept:/home/yocto/poky.git/scripts:/home/yocto/my-rpi-build/tmp/sysroots/x86_64-linux/usr/bin/armv6-vfp-linux:/home/yocto/my-rpi-build/tmp/sysroots/x86_64-linux/usr/bin:/home/yocto/my-rpi-build/tmp/sysroots/x86_64-linux/usr/sbin:/home/yocto/my-rpi-build/tmp/sysroots/x86_64-linux/usr/bin:/home/yocto/my-rpi-build/tmp/sysroots/x86_64-linux/sbin:/home/yocto/my-rpi-build/tmp/sysroots/x86_64-linux//bin:/home/yocto/poky.git/scripts:/home/yocto/poky.git/bitbake/bin:/usr/local/bin:/usr/bin:/bin:/opt/bin:/usr/x86_64-pc-linux-gnu/gcc-bin/4.8.3″ rpm2cpio.sh /home/yocto/my-rpi-build/downloads/rpm-5.4.9-0.20120508.src.rpm | cpio -id rpm-5.4.9.tar.gz failed with return value 1
ERROR: Logfile of failure stored in: /home/yocto/my-rpi-build/tmp/work/x86_64-linux/rpm-native/5.4.9-r63/temp/log.do_unpack.28861
Log data follows:
| DEBUG: Executing python function do_unpack
| DEBUG: Executing python function base_do_unpack
| NOTE: Unpacking /home/yocto/my-rpi-build/downloads/rpm-5.4.9-0.20120508.src.rpm to /home/yocto/my-rpi-build/tmp/work/x86_64-linux/rpm-native/5.4.9-r63/
| /home/yocto/my-rpi-build/tmp/sysroots/x86_64-linux/usr/bin/unlzma: /lib64/liblzma.so.5: no version information available (required by /home/yocto/my-rpi-build/tmp/sysroots/x86_64-linux/usr/bin/unlzma)
| /home/yocto/my-rpi-build/tmp/sysroots/x86_64-linux/usr/bin/unlzma: /lib64/liblzma.so.5: no version information available (required by /home/yocto/my-rpi-build/tmp/sysroots/x86_64-linux/usr/bin/unlzma)
| /home/yocto/my-rpi-build/tmp/sysroots/x86_64-linux/usr/bin/unlzma: (stdin): File format not recognized
| cpio: premature end of archive
| DEBUG: Python function base_do_unpack finished
| DEBUG: Python function do_unpack finished
| ERROR: Function failed: Unpack failure for URL: ‘http://www.rpm5.org/files/rpm/rpm-5.4/rpm-5.4.9-0.20120508.src.rpm;extract=rpm-5.4.9.tar.gz’. Unpack command PATH=”/home/yocto/poky.git/scripts/native-intercept:/home/yocto/poky.git/scripts:/home/yocto/my-rpi-build/tmp/sysroots/x86_64-linux/usr/bin/armv6-vfp-linux:/home/yocto/my-rpi-build/tmp/sysroots/x86_64-linux/usr/bin:/home/yocto/my-rpi-build/tmp/sysroots/x86_64-linux/usr/sbin:/home/yocto/my-rpi-build/tmp/sysroots/x86_64-linux/usr/bin:/home/yocto/my-rpi-build/tmp/sysroots/x86_64-linux/sbin:/home/yocto/my-rpi-build/tmp/sysroots/x86_64-linux//bin:/home/yocto/poky.git/scripts:/home/yocto/poky.git/bitbake/bin:/usr/local/bin:/usr/bin:/bin:/opt/bin:/usr/x86_64-pc-linux-gnu/gcc-bin/4.8.3″ rpm2cpio.sh /home/yocto/my-rpi-build/downloads/rpm-5.4.9-0.20120508.src.rpm | cpio -id rpm-5.4.9.tar.gz failed with return value 1
ERROR: Task 74 (virtual:native:/home/yocto/poky.git/meta/recipes-devtools/rpm/rpm_5.4.9.bb, do_unpack) failed with exit code ‘1’
NOTE: Tasks Summary: Attempted 529 tasks of which 523 didn’t need to be rerun and 1 failed.
Waiting for 0 running tasks to finish:
Summary: 1 task failed:
virtual:native:/home/yocto/poky.git/meta/recipes-devtools/rpm/rpm_5.4.9.bb, do_unpack
Summary: There was 1 WARNING message shown.
Summary: There was 1 ERROR message shown, returning a non-zero exit code.
Which is a little odd as running the command manually seem to work:
../poky.git/scripts/rpm2cpio.sh /home/yocto/my-rpi-build/downloads/rpm-5.4.9-0.20120508.src.rpm | cpio -id rpm-5.4.9.tar.gz
15071 blocks
I tried on a different host where I got a different error message but still related to unpacking:
| ERROR: Function failed: Unpack failure for URL: ‘http://www.python.org/ftp/pyt
hon/2.7.3/Python-2.7.3.tar.bz2’. Unpack command PATH=”/home/yocto/poky.git/scrip
ts/native-intercept:/home/yocto/my-rpi-build/tmp/sysroots/x86_64-linux/usr/bin/b
zip2-native:/home/yocto/poky.git/scripts:/home/yocto/my-rpi-build/tmp/sysroots/x
86_64-linux/usr/bin/armv6-vfp-linux:/home/yocto/my-rpi-build/tmp/sysroots/x86_64
-linux/usr/bin:/home/yocto/my-rpi-build/tmp/sysroots/x86_64-linux/usr/sbin:/home
/yocto/my-rpi-build/tmp/sysroots/x86_64-linux/usr/bin:/home/yocto/my-rpi-build/t
mp/sysroots/x86_64-linux/sbin:/home/yocto/my-rpi-build/tmp/sysroots/x86_64-linux
//bin:/home/yocto/poky.git/scripts:/home/yocto/poky.git/bitbake/bin:/usr/local/b
in:/usr/bin:/bin:/opt/bin:/usr/x86_64-pc-linux-gnu/gcc-bin/4.8.3″ bzip2 -dc /hom
e/yocto/my-rpi-build/downloads/Python-2.7.3.tar.bz2 | tar x –no-same-owner -f –
failed with return value 2
ERROR: Task 783 (/home/yocto/poky.git/meta/recipes-devtools/python/python-native
_2.7.3.bb, do_unpack) failed with exit code ‘1’
NOTE: Tasks Summary: Attempted 426 tasks of which 422 didn’t need to be rerun an
d 1 failed.
Waiting for 0 running tasks to finish:
Summary: 1 task failed:
/home/yocto/poky.git/meta/recipes-devtools/python/python-native_2.7.3.bb, do_unpack
Still this seem to work fine:
bzip2 -dc /home/yocto/my-rpi-build/downloads/Python-2.7.3.tar.bz2 | tar tvf –
I’ve successfully built core-image-minimal on both of the hosts (using the dizzy branch)
I am not able to download using git clone -b dora git://git.yoctoproject.org/poky.git
gives connection timeout error
please update your post for Ubuntu 14.04 as well
Thank you
@Abhishek
The first error is probably just a transient server issue. Try again later it should work.
The instructions should be the same or very similar for Ubuntu 14.04
How could i come to know that what packages are already available in final image ?actually I wanted to customize as per my requirement, with minimum possible size !
In case I need to add some additional packages, how can i do so?
Thank you
@Abhishek
Click on “Edit image” in hob to add the packages you need.
Otherwise you can edit some text files manually in meta-raspberrypi, I haven’t used Yocto for a while, so I don’t remember which files need to be modified.
@cnxsoft
i am getting these warming while doing “bitbake rpi-basic-image”. Is it OK? how can i remove these warnings?
WARNING: Failed to fetch URL http://zlib.net/pigz/pigz-2.3.tar.gz, attempting MIRRORS if available
WARNING: Failed to fetch URL http://www.apache.org/dist/apr/apr-1.4.8.tar.bz2, attempting MIRRORS if available
WARNING: Failed to fetch URL http://www.apache.org/dist/apr/apr-util-1.5.2.tar.gz, attempting MIRRORS if available
WARNING: Failed to fetch URL http://www.apache.org/dist/subversion/subversion-1.7.10.tar.bz2, attempting MIRRORS if available
WARNING: Failed to fetch URL ftp://ftp.debian.org/debian/pool/main/n/netbase/netbase_5.1.tar.gz, attempting MIRRORS if available
WARNING: Failed to fetch URL ftp://ftp.debian.org/debian/pool/main/d/dpkg/dpkg_1.17.1.tar.xz, attempting MIRRORS if available
WARNING: Failed to fetch URL ftp://ftp.uni-erlangen.de/pub/Linux/LOCAL/dosfstools/dosfstools-2.11.src.tar.gz, attempting MIRRORS if available
WARNING: Failed to fetch URL http://ftp.de.debian.org/debian/pool/main/m/mklibs/mklibs_0.1.38.tar.gz, attempting MIRRORS if available
I have used git clone -b dora git://git.yoctoproject.org/poky.git & git clone -b dora git://git.yoctoproject.org/meta-raspberrypi
bitbake get stuck with this
0: linux-raspberrypi-3.6.11+git63b69a8806ce1890711ff55280c90673ea415933-r7 do_fetch (pid 26599)
1: bcm2835-bootfiles-20130819-r3 do_fetch (pid 17868)
no further improvements no matter how much time is given……….
please help
@Abhishek
Looks like some server issues. You’d have to try again later.
btw, there’s a release of Poky every 6 months. When I wrote this is was dora (Yocto 1.5), but Yocto 1.7 has recently been released (dizzy), and it should still support the R-Pi.
These are the error I received at the end and it stopped. I am using Ubuntu 14.04. please help
WARNING: Failed to fetch URL git://github.com/raspberrypi/firmware.git;protocol=git;branch=master, attempting MIRRORS if available
ERROR: Fetcher failure: Fetch command failed with exit code 128, output:
Cloning into bare repository ‘/home/abhi/yocto/poky/build/downloads/git2/github.com.raspberrypi.firmware.git’…
fatal: unable to connect to github.com:
github.com: Name or service not known
ERROR: Function failed: Fetcher failure for URL: ‘git://github.com/raspberrypi/firmware.git;protocol=git;branch=master’. Unable to fetch URL from any source.
ERROR: Logfile of failure stored in: /home/abhi/yocto/poky/build/tmp/work/raspberrypi-poky-linux-gnueabi/bcm2835-bootfiles/20130819-r3/temp/log.do_fetch.31947
ERROR: Task 299 (/home/abhi/yocto/poky/meta-raspberrypi/recipes-bcm/bootfiles/bcm2835-bootfiles.bb, do_fetch) failed with exit code ‘1’
@cnxsoft
dizzy does not have meta-raspberrypi
@Abhishek
It seems you right: http://git.yoctoproject.org/cgit/cgit.cgi/meta-raspberrypi/
part of dylan however, and has been updated in master three weeks ago. So I’m not sure why.
@cnxsoft
So,It seems, I must stick with ‘dora’ only………or shall I try for ‘master’? any suggestions ?
Hi Abhishek,
I am trying with daisy, with this “linux-raspberrypi” is fetched successfully and “bcm2835-bootfiles” is still fetching.
I will let you know once it is done. But the size of linux-raspberrypi object is around 1.2GB. I don’t know why this much.
I have used following link to build my image but here, the size is 29 MB. WHY
@Abhishek
Because it’s not compressed?
Difference between rpi-basic-image and rpi-hwup-image? actually,I want have generated rpi-hwup-image, which is 294 mB size using “bitbake rpi-hwup-image”……..Now I want to customize it further,so remove/add some features to/from it? how can I do so?
What are the features which are already removed in this reduced version? Can I add those removed features also from this image? HOW?
@Abhishek
http://www.cnx-software.com/2013/07/05/12mb-minimal-image-for-raspberry-pi-using-the-yocto-project/#comment-308897
My build seem to work, but will lock up sometime around the login prompt. The output on the serial line looks fine in the start, but then at the end it’s just garbage, and then it dies.
how can i add my TFT driver to rpi-hwup-image ? do i need some tool chains like gcc or gdb additionally?
Please answer to these questions:
1) What basic packages needed fo raspberrypi ?
2) What if I want to add any package after my image is build ?
3) Do i need to repeat the complete process again?
4) How can i add any driver (ex: TFT driver) to the build kernel image?
5) How to add any desired applications to packages?
@Abhishek
I’m by no mean a Yocto specialist, so if you want to do something more advanced better ask on Yocto Mailing list.
But I’ll try to answer anyway
1) the packages found in rpi-hwup-image
2) Edit some config files (not sure which ones) or use Hob interface
3) No need to repeat I think, it will just compile the new packages (TBC)
4) I’m not sure, I have never done that.
5) I’m not sure, I have never done that, except for the packages available through Hob (i.e. not my own app)
I have successfully created rpi-basic-image with ssh server. Now I want to access raspberrypi via ethernet cable using ssh server on my laptop.I have tried to use the standard ways as mentioned for raspbian. But nmap is not able to find raspberrypi’s address. Could u please specify steps how to connect raspberrypi with ubuntu using ssh? Please help
@Abhishek
1. connect an HDMI screen to check the IP address with ifconfig eth0
or
2. Connect a serial to ttl board to access the command line, and run ifconfig
or
3. Check your router list of clients via its web interface
or
4. Use wireshark in your PC to capture DHCP packets and find out the IP address.
I have successfully generated npi-basic-image but when I try to access the raspberrypi using ssh (ethernet cable) I get error: DNS server missing on host How to enable dns-server on host rpi-basic-image ?
@cnxsoft
I have successfully created rpi-basic-image. I have installed openssh package already in image
actually I am trying to access laptop screen via ethernet (ssh) by giving static ip in /etc/network/interface at host side (laptop). eg:
auto lo
iface lo inet loopback
iface eth0 inet static
address 192.168.1.248
netmask 255.255.255.0
network 192.168.1.0
gateway 192.168.1.1
But when I try to search using “nmap -sP 192.168.1.1-255”, it says:
mass_dns: warning: Unable to determine any DNS servers. Reverse DNS is disabled. Try using –system-dns or specify valid servers with –dns-servers
how could this issue be resolved ?
Hi!
Congrats for the tutorial!
I have made an image with hob like you said but after i copy on it a cross-compiled program i can’t run it.I receive this message: -sh: program_name : not found.
If I copy the program to a raspberry that runs raspbian it works fine.
You know what can be the problem in this case?
Thanks
the smallest image i can get for the Pi 0 W is 125 MB. The website refered to is no longer online.
@Dr. Sherif Omran
I can see the pimpmypi website is not hosting the page anymore, but you don’t need that site to make an image with Yocto Project.
will it work for the raspberry pi 3 B+ ??
The Yocto Project will work on Raspberry Pi 3B+, but if you just download the image I provided it will miss the right firmware for RPi 3B+. If you follow the instructions – with a new version of Yocto Project as well – it should work on RPi 3B+.
No. At least not without exchanging the primary OS called ThreadX on the FAT partition. RPi users usually don’t know it but the main operating system on these RPi thingies is a closed source RTOS (euphemistically called ‘firmware’) that needs to be loaded first and everything that’s related to hardware happens here.
Asides that it really makes no sense to run a software stack that is half a decade old today.