<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>BEC Systems</title>
	
	<link>http://bec-systems.com/site</link>
	<description>Embedded Linux consulting.</description>
	<lastBuildDate>Wed, 08 May 2013 13:56:38 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.4</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/bec-systems" /><feedburner:info uri="bec-systems" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><feedburner:browserFriendly>This is an XML content feed. It is intended to be viewed in a newsreader or syndicated to another site, subject to copyright and fair use.</feedburner:browserFriendly><item>
		<title>OS Containers for Build Systems</title>
		<link>http://feedproxy.google.com/~r/bec-systems/~3/lRxsCIBoJ9w/os-containers-for-build-systems</link>
		<comments>http://bec-systems.com/site/1029/os-containers-for-build-systems#comments</comments>
		<pubDate>Wed, 08 May 2013 13:56:38 +0000</pubDate>
		<dc:creator>Cliff Brake</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[build]]></category>
		<category><![CDATA[Embedded Linux]]></category>
		<category><![CDATA[OpenEmbedded]]></category>
		<category><![CDATA[systemd]]></category>

		<guid isPermaLink="false">http://bec-systems.com/site/?p=1029</guid>
		<description><![CDATA[Since I&#8217;ve been running archlinux on some of my systems, one thing I&#8217;ve found useful is systemd-nspawn. systemd-nspawn containers (or chroots on non-systemd systems) give you a quick way to install a Linux distribution, that can run inside an existing Linux system. Some cases where systemd-nspawn containers (referred to as containers in this document) are [...]]]></description>
			<content:encoded><![CDATA[<p>Since I&#8217;ve been running archlinux on some of my systems, one thing I&#8217;ve found useful is <a href="http://www.freedesktop.org/software/systemd/man/systemd-nspawn.html">systemd-nspawn</a>. systemd-nspawn containers (or chroots on non-systemd systems) give you a quick way to install a Linux distribution, that can run inside an existing Linux system.</p>
<p>Some cases where systemd-nspawn containers (referred to as containers in this document) are useful:</p>
<ol>
<li>Currently OpenEmbedded won&#8217;t build with GCC 4.8 (included in archlinux).</li>
<li>For product build systems (may live for many years), typically OE will eventually break as you upgrade the workstation distribution.  For projects that need a long-lived OpenEmbedded build system, setting it up in a chroot makes a lot of sense.</li>
<li>Someone might be having a compile or build problem with a distribution you don&#8217;t currently have installed.  With containers, you can quickly set up a test distribution to reproduce problems.</li>
<li><span style="font-size: 13px;">I&#8217;ve had cases where I need an older version of Qt for a project, but my workstation includes a newer version.  Again, setting up a OS container is sometimes simpler than getting two versions of Qt to dwell together peaceably in the same distribution.</span></li>
<li>Backing up or replicating your entire build system is very easy &#8212; simply rsync the OS container directory to another machine.</li>
</ol>
<p>So the solution is to select a relatively stable, long-lived distribution to host your product builds. Debian is good choice.  Because the container is simply a directory in the host workstation filesystem, you can use host workstation tools (editors, git, etc) directly in the container filesystem.  The only thing you need to use the chroot for is the actually building.  If you make sure the user ID is the same between your workstation and nspawn container, then permissions are seamless &#8212; you can easily access files in the container from the context of your host workstation.</p>
<p>To set up a nspawn-container:</p>
<ol>
<li>host: <em>sudo debootstrap &#8211;arch=amd64 wheezy ~/debian-wheezy/</em></li>
<li>host: <em>sudo systemd-nspawn -D ~/debian-wheezy/</em></li>
<li>container: <em>apt-get update &amp;&amp; apt-get install ssh</em></li>
<li>container: <em>edit /etc/ssh/sshd_config, and set port to something other than 22 (23 in this example)</em></li>
<li>container: <em>/etc/init.d/ssh start</em></li>
<li>container: <em>set up users, ssh keys, etc.</em></li>
</ol>
<p>(This <a href="http://www.freedesktop.org/software/systemd/man/systemd-nspawn.html">systemd-nspawn</a> man page gives examples for setting up other distributions.)</p>
<p>Now, on the host system, you can simply &#8220;<em>ssh -p23 localhost&#8221;</em> any time you want to log into the container.  Soft links between the project workspace on the host system, and the container can also make shifting between the two easier.</p>
<p>An alternative way to start the container once its set up is:</p>
<p style="padding-left: 30px;"><em>sudo systemd-nspawn -D ~/debian-wheezy /sbin/init</em></p>
<p>Its also handy to make the shell prompt in the container slightly different than the host OS so that you can easily tell the difference.  To accomplish this, add the following to ~/.profile in the container OS:</p>
<p style="padding-left: 30px;"><em>export PS1=&#8221;[\u@wheezy \W]\$ &#8220;</em></p>
<p>Hopefully this gives you a quick overview of how OS containers can be set up, and used in your OpenEmbedded build systems.</p>
<img src="http://feeds.feedburner.com/~r/bec-systems/~4/lRxsCIBoJ9w" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://bec-systems.com/site/1029/os-containers-for-build-systems/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://bec-systems.com/site/1029/os-containers-for-build-systems</feedburner:origLink></item>
		<item>
		<title>Git submodules can now track branches</title>
		<link>http://feedproxy.google.com/~r/bec-systems/~3/YNAT5v_UjHY/git-submodules-can-now-track-branches</link>
		<comments>http://bec-systems.com/site/1020/git-submodules-can-now-track-branches#comments</comments>
		<pubDate>Mon, 22 Apr 2013 17:55:55 +0000</pubDate>
		<dc:creator>Cliff Brake</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[build]]></category>
		<category><![CDATA[Git]]></category>

		<guid isPermaLink="false">http://bec-systems.com/site/?p=1020</guid>
		<description><![CDATA[As of version 1.8.2, Git submodules can now track branches instead of specific commits.  This is good news as in many cases, this is exactly the behavior we want.  However, Git submodules are still not as flexible as Google repo, but since submodules are built into Git, the submodule command is a good solution in [...]]]></description>
			<content:encoded><![CDATA[<p>As of version 1.8.2, Git submodules can now track branches instead of specific commits.  This is good news as in many cases, this is exactly the behavior we want.  However, Git submodules are still not as flexible as Google <a href="https://code.google.com/p/git-repo/">repo</a>, but since submodules are built into Git, the submodule command is a good solution in many cases.</p>
<p>The &#8220;<em>git submodule update &#8211;remote</em>&#8221; command is the key to tracking branches with submodules.   The following is from the Git man pages:</p>
<p><em>&#8211;remote<br />
This option is only valid for the update command. Instead of using the superproject’s recorded SHA-1 to update the submodule, use the status of the submodule’s remote tracking branch. The remote used is branch’s remote (branch.&lt;name&gt;.remote), defaulting to origin. <strong>The remote branch used defaults to master, but the branch name may be overridden by setting the submodule.&lt;name&gt;.branch option in either .gitmodules</strong> or .git/config (with .git/config taking precedence).</em></p>
<p><em><span style="font-size: 13px;">This works for any of the supported update procedures (&#8211;checkout, &#8211;rebase, </span>etc.). The only change is the source of the target SHA-1. For example, submodule update &#8211;remote &#8211;merge will merge upstream submodule changes into the submodules, while submodule update &#8211;merge will merge superproject gitlink changes into the submodules. </em></p>
<p><em>In order to ensure a current tracking branch state, update &#8211;remote fetches the submodule’s remote repository before calculating the SHA-1. If you don’t want to fetch, you should use submodule update &#8211;remote &#8211;no-fetch.</em></p>
<p>So, if you already have a Git submodule set up, its a simple matter to run <em>git submodule update &#8211;remote</em> to update the submodule to the latest master branch.  If you want a different branch, simple edit <em>.gitconfig</em>.</p>
<pre>[submodule "meta-bec"]
   path = meta-bec
   url = git@github.com:cbrake/meta-bec.git
<strong>   branch = test</strong></pre>
<p>Now, if you run <em>git submodule update &#8211;remote, </em>Git will update the <em>meta-bec</em> submodule to the latest on the <em>test</em> branch.</p>
<p>This functionality is purely a convenience feature in the <em>submodule update</em> command.  In the actual repository, Git still stores submodules pointed to a particular commit.  The same thing could be accomplished with something like <em>git foreach &#8220;git fetch &amp;&amp; git checkout test&#8221;</em>.  <span style="font-size: 13px;">The branch option in .gitmodules functions more as documentation and convenience.  It is very handy to be able to look at .gitmodules and quickly determine that submodule X is tracking branch Y.  Normally, this would have to be documented elsewhere, or figured out in some other way.  Also, for build systems where you want the build to always track the production branches of various projects, <em>update &#8211;remote</em> gives you a convenient way to update the build tree.</span></p>
<img src="http://feeds.feedburner.com/~r/bec-systems/~4/YNAT5v_UjHY" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://bec-systems.com/site/1020/git-submodules-can-now-track-branches/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://bec-systems.com/site/1020/git-submodules-can-now-track-branches</feedburner:origLink></item>
		<item>
		<title>A quick way to share files from any directory</title>
		<link>http://feedproxy.google.com/~r/bec-systems/~3/E9uqJ_Kmqtw/a-quick-way-to-share-files-from-any-directory</link>
		<comments>http://bec-systems.com/site/1015/a-quick-way-to-share-files-from-any-directory#comments</comments>
		<pubDate>Tue, 22 Jan 2013 14:31:53 +0000</pubDate>
		<dc:creator>Cliff Brake</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[node.js]]></category>
		<category><![CDATA[tools]]></category>

		<guid isPermaLink="false">http://bec-systems.com/site/?p=1015</guid>
		<description><![CDATA[Did you ever need a quick way to share files from a directory on your computer?  Or perhaps transfer a large file to another person?  With nodejs and express, you can easily set up a temporary web server that allows users to browse and access a list of files in a directory.  For convenience, I [...]]]></description>
			<content:encoded><![CDATA[<p>Did you ever need a quick way to share files from a directory on your computer?  Or perhaps transfer a large file to another person?  With <a href="http://nodejs.org/">nodejs</a> and <a href="http://expressjs.com/">express</a>, you can easily set up a temporary web server that allows users to browse and access a list of files in a directory.  For convenience, I created a simple <a href="https://github.com/cbrake/http-file-server">github project</a> that can be cloned into any directory, and then a server started in a matter of seconds.  Yes, you could upload files to a server, or share them with a file sharing service, but if you can expose a random port on your computer to the person who needs the files, then this is faster, and does not require any intermediate steps.  Check out <a href="https://github.com/cbrake/http-file-server">https://github.com/cbrake/http-file-server</a> for more information.</p>
<img src="http://feeds.feedburner.com/~r/bec-systems/~4/E9uqJ_Kmqtw" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://bec-systems.com/site/1015/a-quick-way-to-share-files-from-any-directory/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://bec-systems.com/site/1015/a-quick-way-to-share-files-from-any-directory</feedburner:origLink></item>
		<item>
		<title>OpenEmbedded Source Mirrors</title>
		<link>http://feedproxy.google.com/~r/bec-systems/~3/RgZMsq2HRv4/openembedded-source-mirrors</link>
		<comments>http://bec-systems.com/site/1010/openembedded-source-mirrors#comments</comments>
		<pubDate>Mon, 07 Jan 2013 20:19:34 +0000</pubDate>
		<dc:creator>Cliff Brake</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Embedded Linux]]></category>
		<category><![CDATA[OpenEmbedded]]></category>

		<guid isPermaLink="false">http://bec-systems.com/site/?p=1010</guid>
		<description><![CDATA[When using OpenEmbedded for product development, there are several reasons you may want to consider setting up a source mirror for your OpenEmbedded build: over time, sources disappear from download locations various servers for source packages may be off-line at the time a build is run some servers may be very slow, which slows down [...]]]></description>
			<content:encoded><![CDATA[<p>When using OpenEmbedded for product development, there are several reasons you may want to consider setting up a source mirror for your OpenEmbedded build:</p>
<ul>
<li>over time, sources disappear from download locations</li>
<li>various servers for source packages may be off-line at the time a build is run</li>
<li>some servers may be very slow, which slows down your build</li>
<li>occasionally the checksums of a source package will change</li>
</ul>
<p>For a production build system, you want the build to be reliable and consistent, so this means not depending on 3rd party web sites/servers for a clean build to complete.  Fortunately, OpenEmbedded makes it easy to set up a source mirror with the <a href="http://www.yoctoproject.org/docs/1.0/poky-ref-manual/poky-ref-manual.html#idm1091472">PREMIRRORS</a> variable. When bitbake tries to fetch source code, it tries PREMIRRORS, the upstream source, and then MIRRORS.  There are several advantages to using a PREMIRROR variable over a MIRROR for your source mirror:</p>
<ul>
<li>your source mirror will be used first, thus slow web sites are not an issue</li>
<li>if the checksums of the package change, the build will not fail because its still using the original source package from the mirror.  You are guaranteed to be always using the same source package.</li>
</ul>
<p>Setting up a source mirror is as simple as copying the contents of your downloads directory to a web server, and then populating the following variable in local.conf:</p>
<pre>
<pre>PREMIRRORS_prepend = "\
     git://.*/.* http://my-server/sources/ \n \
     ftp://.*/.* http://my-server/sources/ \n \
     http://.*/.* http://my-server/sources/ \n \
     https://.*/.* http://my-server/sources/ \n"</pre>
</pre>
<p>The Poky reference manual has more <a href="http://www.yoctoproject.org/docs/1.0/poky-ref-manual/poky-ref-manual.html#idm1091472">details</a>.</p>
<img src="http://feeds.feedburner.com/~r/bec-systems/~4/RgZMsq2HRv4" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://bec-systems.com/site/1010/openembedded-source-mirrors/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://bec-systems.com/site/1010/openembedded-source-mirrors</feedburner:origLink></item>
		<item>
		<title>Perisistent device names for USB serial ports</title>
		<link>http://feedproxy.google.com/~r/bec-systems/~3/fUBSxcT4Kp4/perisistent-device-names-usb-serial-ports</link>
		<comments>http://bec-systems.com/site/1004/perisistent-device-names-usb-serial-ports#comments</comments>
		<pubDate>Wed, 19 Dec 2012 14:44:43 +0000</pubDate>
		<dc:creator>Cliff Brake</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Embedded Linux]]></category>
		<category><![CDATA[tools]]></category>
		<category><![CDATA[USB]]></category>

		<guid isPermaLink="false">http://bec-systems.com/site/?p=1004</guid>
		<description><![CDATA[Currently, my workstation has two 8-port USB&#60;-&#62;RS232 devices, one dual port USB&#60;-&#62;RS422/RS485 adapter, and several single port adapters such as the very useful BUBII.  So with around 20 USB-&#62;serial devices, figuring out which /dev/ttyUSBx entry corresponds to which port is not really practical.  However, with udev in Linux, you can easily give static names to [...]]]></description>
			<content:encoded><![CDATA[<p>Currently, my workstation has <a href="http://usbgear.com/USB2-8COM-M.html">two 8-port USB&lt;-&gt;RS232 devices</a>, one <a href="http://usbgear.com/USB-2COMi-M.html">dual port USB&lt;-&gt;RS422/RS485 adapter</a>, and several single port adapters such as the very useful <a href="http://shop.moderndevice.com/products/bub_ii">BUBII</a>.  So with around 20 USB-&gt;serial devices, figuring out which /dev/ttyUSBx entry corresponds to which port is not really practical.  However, with udev in Linux, you can easily give static names to each device.  This is especially convenient to do with FTDI devices because each FTDI device has a serial number.  In devices such as the 8-port RS232 adapter, there are 4, 2-port FTDI chips.  I could not find a serial number available in the adapter with a Prolific IC, so I would avoid those until that is sorted.</p>
<p>udevadm can be used to discover the serial number for a FTDI device:</p>
<pre>udevadm info --attribute-walk -n /dev/ttyUSB0|grep serial
</pre>
<p>After the serial number is known, rules can be created in the <em>/etc/udev/rules.d/99-usb-serial.rules</em> as shown in <a href="https://gist.github.com/4337154">this example</a>.  Now, serial ports can be accessed using convenient names such as <em>/dev/ttyUSB_beagle</em>.</p>
<img src="http://feeds.feedburner.com/~r/bec-systems/~4/fUBSxcT4Kp4" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://bec-systems.com/site/1004/perisistent-device-names-usb-serial-ports/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://bec-systems.com/site/1004/perisistent-device-names-usb-serial-ports</feedburner:origLink></item>
		<item>
		<title>A quick way to set up an OpenEmbedded feed server</title>
		<link>http://feedproxy.google.com/~r/bec-systems/~3/M7fLqiEOc2E/a-quick-way-to-set-up-an-openembedded-feed-server</link>
		<comments>http://bec-systems.com/site/988/a-quick-way-to-set-up-an-openembedded-feed-server#comments</comments>
		<pubDate>Sat, 08 Dec 2012 14:24:47 +0000</pubDate>
		<dc:creator>Cliff Brake</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Embedded Linux]]></category>
		<category><![CDATA[node.js]]></category>
		<category><![CDATA[OpenEmbedded]]></category>

		<guid isPermaLink="false">http://bec-systems.com/site/?p=988</guid>
		<description><![CDATA[During development with OpenEmbedded (oe-core, meta-oe, meta-angstrom), I often find it useful to set up a feed server so that packages can quickly be installed on the target system without manually copying them over or building a new image.  One way to do this is copy your deploy/ipk directory to an existing web server (perhaps [...]]]></description>
			<content:encoded><![CDATA[<p>During development with OpenEmbedded (oe-core, meta-oe, meta-angstrom), I often find it useful to set up a feed server so that packages can quickly be installed on the target system without manually copying them over or building a new image.  One way to do this is copy your deploy/ipk directory to an existing web server (perhaps Apache running on your workstation), or configure Apache to point at your OE build directory, etc.  But, it might be more convenient if your build system could directly create an opkg feed with no extra configuration.  In the below example, we use <a href="http://nodejs.org/">node.js</a> + <a href="http://expressjs.com/">express.js</a> to create a feed server (basically just a web server that serves up the ipk files).</p>
<p><em>tools/feed-server/app.js:</em></p>
<pre>
<div id="_mcePaste">// nodejs script to start a http server with the feed from this directory</div>
<div id="_mcePaste">// default is port 4000</div>
<div id="_mcePaste">var express = require('express')</div>
<div id="_mcePaste">var app = express()</div>
<div id="_mcePaste">app.use('/', express.static(__dirname +
   '/../../build/tmp-angstrom_next-eglibc/deploy/ipk/'))</div>
<div id="_mcePaste">app.use('/', express.directory(__dirname +
   '/../../build/tmp-angstrom_next-eglibc/deploy/ipk/'))</div>
<div id="_mcePaste">console.log("feed server started on port 4000")</div>
<div id="_mcePaste">app.listen(4000)</div>
</pre>
<p>The <em>express.directory</em> function is used to create a directory listing that can be browsed.  With most other web servers, at least this much code is required just for configuration.  With node.js, this is the code to create an entire server from scratch!  This node.js app can be started with a bash function in the environment:</p>
<pre>function oe_feed_server()
{
  cd $OE_BASE
  bitbake package-index
  node tools/feed-server/app.js
  cd -
}</pre>
<p>The <em>package-index</em> target is used to rebuild the index files that list the available packages.</p>
<p>On the target system, the /etc/opkg configuration files must be modified to point to the feed server, and then you can run:</p>
<pre>opkg update; opkg install &lt;package&gt;</pre>
<p>An exmaple build environement with this integrated is located:</p>
<p><a href="https://github.com/cbrake/oe-build-core">https://github.com/cbrake/oe-build-core</a></p>
<p><a href="https://github.com/cbrake/oe-build-core/commit/23352b9a43c60d67070abe5ac001aba9a9ac5cc4">https://github.com/cbrake/oe-build-core/commit/23352b9a43c60d67070abe5ac001aba9a9ac5cc4</a></p>
<p><a href="https://github.com/cbrake/oe-build-core/commit/6baceb8b1e4477ccfd03aa553a5fcf501b398196">https://github.com/cbrake/oe-build-core/commit/6baceb8b1e4477ccfd03aa553a5fcf501b398196</a></p>
<p>It might be argued that it is just as easy or easier to set up a more conventional web server.  However, the benefit of node.js is that it is a full blown programming environment.  You can quickly extend it to provide a web interface, perhaps add functionality to automatically push updated opkg configuration files to the target system that point to your feed server, etc.  It is much more than just a web server.</p>
<img src="http://feeds.feedburner.com/~r/bec-systems/~4/M7fLqiEOc2E" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://bec-systems.com/site/988/a-quick-way-to-set-up-an-openembedded-feed-server/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://bec-systems.com/site/988/a-quick-way-to-set-up-an-openembedded-feed-server</feedburner:origLink></item>
	</channel>
</rss>
