<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Gianluca Pacchiella (Posts about embedded)</title><link>https://ktln2.org/</link><description></description><atom:link href="https://ktln2.org/categories/embedded.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2025 &lt;a href="mailto:gp@ktln2.org"&gt;Gianluca Pacchiella&lt;/a&gt; </copyright><lastBuildDate>Wed, 31 Dec 2025 10:36:33 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>Reusing old shit: creating a BSP using Yocto for the Samsung Galaxy S (S5PV210)</title><link>https://ktln2.org/2021/01/31/yocto-samsung-galaxy-s/</link><dc:creator>Gianluca Pacchiella</dc:creator><description>&lt;div&gt;&lt;p&gt;In this post I'll describe my esperiments in reusing my old Samsung Galaxy S;
don't expected anything sophisticated, it's more a brain dump.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://ktln2.org/2021/01/31/yocto-samsung-galaxy-s/"&gt;Read more…&lt;/a&gt; (21 min remaining to read)&lt;/p&gt;&lt;/div&gt;</description><category>embedded</category><category>WIP</category><category>yocto</category><guid>https://ktln2.org/2021/01/31/yocto-samsung-galaxy-s/</guid><pubDate>Sun, 31 Jan 2021 00:00:00 GMT</pubDate></item><item><title>Build embedded systems with buildroot</title><link>https://ktln2.org/2020/02/14/buildroot-getting-started/</link><dc:creator>Gianluca Pacchiella</dc:creator><description>&lt;div&gt;&lt;p&gt;&lt;a href="https://buildroot.org/"&gt;Buildroot&lt;/a&gt; is an integration system used to obtain complete bootable
embedded systems; it uses a KConfig configuration mechanism (the &lt;code&gt;menuconfig&lt;/code&gt; thing).&lt;/p&gt;
&lt;p&gt;&lt;a href="https://ktln2.org/2020/02/14/buildroot-getting-started/"&gt;Read more…&lt;/a&gt; (3 min remaining to read)&lt;/p&gt;&lt;/div&gt;</description><category>buildroot</category><category>embedded</category><category>Linux</category><category>WIP</category><guid>https://ktln2.org/2020/02/14/buildroot-getting-started/</guid><pubDate>Fri, 14 Feb 2020 00:00:00 GMT</pubDate></item><item><title>Yocto: using U-Boot as bootloader with a RaspberryPi Zero</title><link>https://ktln2.org/2018/10/28/u-boot-rpi0/</link><dc:creator>Gianluca Pacchiella</dc:creator><description>&lt;div&gt;&lt;p&gt;This is a guide about building and configuring a Yocto build for a raspberry pi zero with u-boot.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://ktln2.org/2018/10/28/u-boot-rpi0/"&gt;Read more…&lt;/a&gt; (5 min remaining to read)&lt;/p&gt;&lt;/div&gt;</description><category>embedded</category><category>rpi</category><category>u-boot</category><category>WIP</category><guid>https://ktln2.org/2018/10/28/u-boot-rpi0/</guid><pubDate>Sun, 28 Oct 2018 00:00:00 GMT</pubDate></item><item><title>Create root filesystems for embedded systems</title><link>https://ktln2.org/2017/09/06/create-rootfs-for-embedded/</link><dc:creator>Gianluca Pacchiella</dc:creator><description>&lt;p&gt;All is started from this &lt;a href="https://blahcat.github.io/2017/06/25/qemu-images-to-play-with/"&gt;link&lt;/a&gt; where
a good boy shared some images in order to start to put hands on esotic architectures.&lt;/p&gt;
&lt;p&gt;The bad thing in my opinion is that he doesn't explain how they have been generated,
just in case someone need to customize something; in this post I want to show how to create root filesystems for all
the necessary architectures using &lt;code&gt;multistrap&lt;/code&gt;. If you want instead to use something more serious,
&lt;a href="https://ktln2.org/2020/02/14/buildroot-getting-started/"&gt;here&lt;/a&gt; another post about buildroot,
that allows you to do something similar.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://wiki.debian.org/Multistrap"&gt;Multistrap&lt;/a&gt; is a Debian tool used to create root filesystem: from the
Debian's wiki&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;It was designed primarily for making root filesystems for foreign architecture embedded systems, but in fact can be used for many tasks where one might also use debootstrap.&lt;/p&gt;
&lt;p&gt;Its main limitation compared to debootstrap is that it uses apt and dpkg directly so can only work on a debian system - debootstrap depends on nothing but shell, wget, binutils and thus can run pretty-much anywhere.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;This is not a complete replacement for the images linked above since at the end
of the procedure won't have a linux kernel to use to start &lt;code&gt;QEMU&lt;/code&gt; but I think
it's useful for someone with already a running instance.&lt;/p&gt;
&lt;h3&gt;Create the filesystem&lt;/h3&gt;
&lt;p&gt;The dependencies on a Debian system are&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;$ sudo apt-get install qemu multistrap qemu-user-static
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;since I am corageous I choose to create one root filesystem for the PowerPC architecture:
save the content below as &lt;code&gt;multistrap.conf&lt;/code&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;[General]
directory=target-rootfs
cleanup=true
noauth=true
unpack=true
debootstrap=Grip Net Utils
aptsources=Grip
#tarballname=rootfs.tar
#
[Grip]
noauth=true
packages=apt kmod lsof
source=http://emdebian.bytesatwork.ch/mirror/grip
keyring=emdebian-archive-keyring
suite=stable-grip

[Net]
#Basic packages to enable the networking
packages=netbase net-tools udev iproute iputils-ping ifupdown isc-dhcp-client ssh

[Utils]
#General purpose utilities
packages=locales adduser nano less wget dialog usbutils
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Then we can create a root fs using &lt;code&gt;multistrap&lt;/code&gt; (the &lt;code&gt;-a&lt;/code&gt; flag is what
sets the architecture)&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;$ sudo multistrap -a powerpc -f multistrap.conf -d /tmp/rootfs-ppc
$ sudo mount -o bind /dev/ /tmp/rootfs-ppc/dev
$ sudo cp /usr/bin/qemu-ppc-static /tmp/rootfs-ppc/usr/bin/
$ sudo LC_ALL=C LANGUAGE=C LANG=C chroot /tmp/rootfs-ppc/ dpkg --configure -a
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;select &lt;code&gt;NO&lt;/code&gt; when asked to use &lt;code&gt;dash&lt;/code&gt; as default shell. Now we can enter
inside the system and how can see now you have a PowerPC architecture&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;$ sudo chroot /tmp/rootfs-ppc/ /bin/bash
root@host:/# uname -a
Linux antani 4.9.0-3-amd64 #1 SMP Debian 4.9.30-2 (2017-06-12) ppc GNU/Linux
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;If you want an internet connection remember to &lt;code&gt;mount --bind&lt;/code&gt; the
&lt;code&gt;resolv.conf&lt;/code&gt; file inside the &lt;code&gt;chroot&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;If you want to create a real root filesystem for QEMU (or whatever) you can use the
following command after installing the &lt;code&gt;libguestfs-tools&lt;/code&gt; package:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;$ sudo virt-make-fs --format=qcow2 --size=+200M /tmp/rootfs-ppc/ /tmp/rootfs.img
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;(see &lt;a href="http://libguestfs.org/virt-make-fs.1.html"&gt;virt-make-fs&lt;/a&gt; &lt;code&gt;man&lt;/code&gt; page for more informations).&lt;/p&gt;
&lt;p&gt;Probably in a following up post I will write about using projects like &lt;a href="https://www.openembedded.org"&gt;OpenEmbedded&lt;/a&gt; or
&lt;a href="https://buildroot.org/"&gt;buildroot&lt;/a&gt; to have a complete and customizable running systems.&lt;/p&gt;
&lt;h3&gt;&lt;code&gt;The following signatures couldn't be verified&lt;/code&gt; error&lt;/h3&gt;
&lt;p&gt;Depending on the system you are in, &lt;code&gt;multistrap&lt;/code&gt; can fail with this error,
from &lt;a href="https://github.com/volumio/Build/issues/348#issuecomment-462271607"&gt;here&lt;/a&gt;
the advise is to add above the line in &lt;code&gt;/usr/sbin/multistrap&lt;/code&gt; that contains&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;$config_str .= " -o Apt::Get::AllowUnauthenticated=true"
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;this line&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;$config_str .= " -o Acquire::AllowInsecureRepositories=true";
&lt;/code&gt;&lt;/pre&gt;</description><category>Debian</category><category>embedded</category><category>Linux</category><category>multistrap</category><category>QEMU</category><guid>https://ktln2.org/2017/09/06/create-rootfs-for-embedded/</guid><pubDate>Wed, 06 Sep 2017 00:00:00 GMT</pubDate></item></channel></rss>