{"id":394,"date":"2018-10-26T02:49:27","date_gmt":"2018-10-26T02:49:27","guid":{"rendered":"https:\/\/www.piboxproject.com\/?p=394"},"modified":"2018-10-26T02:51:10","modified_gmt":"2018-10-26T02:51:10","slug":"the-history-of-pibox","status":"publish","type":"post","link":"https:\/\/www.piboxproject.com\/index.php\/2018\/10\/26\/the-history-of-pibox\/","title":{"rendered":"The History of PiBox"},"content":{"rendered":"<div id=\"dslc-theme-content\"><div id=\"dslc-theme-content-inner\"><p>The question of <span style=\"color: #000080;\"><em>Why PiBox<\/em><\/span> came up many times at the <a href=\"https:\/\/denver.makerfaire.com\/\">Denver Maker Faire<\/a> and after stumbling across a multitude poor responses I realized I needed a better answer.\u00a0 Or maybe just an actual answer.\u00a0 A real description of what PiBox is instead of a series of fumbled mumbles about why I have no life.\u00a0 And yes, I&#8217;ve already <a href=\"https:\/\/www.piboxproject.com\/index.php\/2015\/10\/05\/how-we-started\/\">written this once before<\/a>. But I need to get back into blogging about PiBox and this was a good way to grease the rusted gears in my forehead.<\/p>\n<p>The truth is simple: PiBox is my escape.\u00a0 I&#8217;m a nerd.\u00a0 A geek.\u00a0 A guy who, unlike everyone else, has known\u00a0since he was 14 years old exactly what he was going to do for the rest of this life.\u00a0 I am a computer dork.\u00a0 And computer dorks, well, we dork with computers.\u00a0 We don&#8217;t play games.\u00a0 We don&#8217;t use smart phones.\u00a0 We build things.\u00a0 Out of hardware parts and bits and stuff.\u00a0 And software.\u00a0 Because hardware without software is a boat anchor, or at least used to be.\u00a0 Now hardware without software is a light switch.\u00a0 Or a really cheap TV.\u00a0 But software without hardware, well that&#8217;s different.\u00a0 That&#8217;s called imagination.<\/p>\n<p>See, PiBox started life as a solution to a practical problem:\u00a0 how to build a custom software platform for some custom hardware.\u00a0 Except the definition of custom software platform was still evolving.\u00a0 This was about the time of PDAs.\u00a0 And the idea of building a custom software platform was really just forming with the OpenEmbedded project (which was known as something different back then, not that it matters).\u00a0 Custom really means targeted, as in <em>for a specific device<\/em> and probably for a specific purpose.\u00a0 And platform meant Linux, because who the hell builds a custom Windows platform on purpose?<\/p>\n<p>The sum of the parts of a custom platform is more than the whole because it takes extra work just to get started on building those parts, like acquiring a <a href=\"https:\/\/elinux.org\/Toolchains\"><em>toolchain<\/em><\/a>.\u00a0 Toolchains are collections of software for compiling code, like Linux, into files we can stuff onto hardware.\u00a0 And don&#8217;t underestimate the requirements for stuffing the files onto hardware.\u00a0 We need <a href=\"https:\/\/www.cs.tau.ac.il\/telux\/lin-club_files\/linux-boot\/slide0002.htm\"><em>bootloaders<\/em><\/a> and <a href=\"https:\/\/techterms.com\/definition\/firmware\"><em>firmware<\/em><\/a> and <a href=\"https:\/\/www.arduino.cc\/en\/Hacking\/Programmer\"><em>programmers<\/em><\/a> &#8211; no not people programmers, but tools for pushing files onto the hardware.\u00a0 There is a bunch of work that has to be done just to get started to do a bunch of other work of building a custom distribution.<\/p>\n<p><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"416\" data-permalink=\"https:\/\/www.piboxproject.com\/index.php\/2018\/10\/26\/the-history-of-pibox\/lfs-logo\/\" data-orig-file=\"https:\/\/i0.wp.com\/www.piboxproject.com\/wp-content\/uploads\/2018\/10\/lfs-logo.png?fit=192%2C75&amp;ssl=1\" data-orig-size=\"192,75\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"lfs-logo\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/i0.wp.com\/www.piboxproject.com\/wp-content\/uploads\/2018\/10\/lfs-logo.png?fit=192%2C75&amp;ssl=1\" data-large-file=\"https:\/\/i0.wp.com\/www.piboxproject.com\/wp-content\/uploads\/2018\/10\/lfs-logo.png?fit=192%2C75&amp;ssl=1\" class=\"size-full wp-image-416 alignright\" src=\"https:\/\/i0.wp.com\/www.piboxproject.com\/wp-content\/uploads\/2018\/10\/lfs-logo.png?resize=192%2C75&#038;ssl=1\" alt=\"\" width=\"192\" height=\"75\" \/>Before PiBox I found the <a href=\"http:\/\/www.linuxfromscratch.org\/\">Linux From Scratch<\/a> (LFS) site, which described how to make a custom Linux distribution.\u00a0 A Linux distribution is like a custom platform, but without a specific targeted hardware platform or even a defined use case (re: the reason you wanted to make the custom platform).\u00a0 LFS described, in book format, how to do everything to get a toolchain and compile Linux and the bits of pieces required to make your own Linux distribution.\u00a0 A Linux distribution is the combination of the Linux kernel and a <a href=\"https:\/\/www.tldp.org\/LDP\/sag\/html\/root-fs.html\">root file system.<\/a>\u00a0 A root file system is a collection of files that make up a set of core services such as device initialization and network configuration.<\/p>\n<p>But LFS just described in book format the process of creating a custom Linux distribution.\u00a0 The tools to automate that process were left to the reader.\u00a0 Since there were many readers of LFS there were a few tools floating around that tried to implement it.\u00a0 The first tool I found was <a href=\"http:\/\/kegel.com\/crosstool\/\">Dan Kegel&#8217;s Crosstool<\/a>, a set of shell scripts, C programs and data files that automate toolchain development.\u00a0\u00a0 A toolchain formed the backbone of scripts I wrote to build my own distribution.\u00a0 Crosstool and my own scripts sufficed for an initial project but was never a good general purpose solution.\u00a0 It was simply too specific to the hardware and project they targeted.<\/p>\n<p><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"422\" data-permalink=\"https:\/\/www.piboxproject.com\/index.php\/2018\/10\/26\/the-history-of-pibox\/buildroot\/\" data-orig-file=\"https:\/\/i0.wp.com\/www.piboxproject.com\/wp-content\/uploads\/2018\/10\/buildroot.jpg?fit=479%2C208&amp;ssl=1\" data-orig-size=\"479,208\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"buildroot\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/i0.wp.com\/www.piboxproject.com\/wp-content\/uploads\/2018\/10\/buildroot.jpg?fit=300%2C130&amp;ssl=1\" data-large-file=\"https:\/\/i0.wp.com\/www.piboxproject.com\/wp-content\/uploads\/2018\/10\/buildroot.jpg?fit=479%2C208&amp;ssl=1\" class=\"alignleft size-medium wp-image-422\" title=\"\" src=\"https:\/\/i0.wp.com\/www.piboxproject.com\/wp-content\/uploads\/2018\/10\/buildroot.jpg?resize=300%2C130&#038;ssl=1\" alt=\"\" width=\"300\" height=\"130\" srcset=\"https:\/\/i0.wp.com\/www.piboxproject.com\/wp-content\/uploads\/2018\/10\/buildroot.jpg?resize=300%2C130&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.piboxproject.com\/wp-content\/uploads\/2018\/10\/buildroot.jpg?w=479&amp;ssl=1 479w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/> Time passed and others like me expanded on the ideas started by Dan and the LFS project.\u00a0 \u00a0 First, Yann Morin took up Dan&#8217;s banner and extended Crosstool into <a href=\"https:\/\/crosstool-ng.github.io\/\">Crosstool-NG<\/a>, the modern tool for building toolchains.\u00a0 Next I came across two projects targeted specifically at embedded projects:\u00a0 <a href=\"https:\/\/busybox.net\/\">Busybox<\/a> and <a href=\"https:\/\/buildroot.org\/\">Buildroot<\/a>.\u00a0 Busybox provided a large set of common utilities needed in a root file system and linked into a single binary to reduce file size and memory use.\u00a0 Buildroot extended this to provide a wide variety of tools and applications.\u00a0 Together they provide just about everything you need for a custom Linux distribution.\u00a0 Toss in the Linux kernel and you&#8217;re just about there.<\/p>\n<p>Just about.\u00a0 What&#8217;s missing is way to build all these bits in a uniform, easy to understand manner.\u00a0 The Linux kernel has a utility called <a href=\"https:\/\/www.linuxjournal.com\/content\/kbuild-linux-kernel-build-system\">kbuild<\/a>, which allows a menu based configuration for choosing what drivers and services the kernel will include.\u00a0 Crosstool-NG, Busybox and Buildroot adopted that system so can also be configured using\u00a0 a menu system.\u00a0 Now you can build a custom Linux distribution using a menu system to pick and choose the bits you need. But a custom platform needs other things like bootloaders and firmware.\u00a0 Buildroot gets you most of the way there but these last two pieces can be their own problems.<\/p>\n<p><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"423\" data-permalink=\"https:\/\/www.piboxproject.com\/index.php\/2018\/10\/26\/the-history-of-pibox\/busybox\/\" data-orig-file=\"https:\/\/i0.wp.com\/www.piboxproject.com\/wp-content\/uploads\/2018\/10\/busybox.png?fit=300%2C300&amp;ssl=1\" data-orig-size=\"300,300\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"busybox\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/i0.wp.com\/www.piboxproject.com\/wp-content\/uploads\/2018\/10\/busybox.png?fit=300%2C300&amp;ssl=1\" data-large-file=\"https:\/\/i0.wp.com\/www.piboxproject.com\/wp-content\/uploads\/2018\/10\/busybox.png?fit=300%2C300&amp;ssl=1\" class=\"alignright wp-image-423 size-thumbnail\" title=\"\" src=\"https:\/\/i0.wp.com\/www.piboxproject.com\/wp-content\/uploads\/2018\/10\/busybox.png?resize=150%2C150&#038;ssl=1\" alt=\"\" width=\"150\" height=\"150\" srcset=\"https:\/\/i0.wp.com\/www.piboxproject.com\/wp-content\/uploads\/2018\/10\/busybox.png?resize=150%2C150&amp;ssl=1 150w, https:\/\/i0.wp.com\/www.piboxproject.com\/wp-content\/uploads\/2018\/10\/busybox.png?w=300&amp;ssl=1 300w\" sizes=\"auto, (max-width: 150px) 100vw, 150px\" \/>PiBox takes Crosstool-NG, Busybox, Buildroot and Linux kernel projects and wraps them in a simple <a href=\"https:\/\/www.gnu.org\/software\/make\/\">GNU Make<\/a> environment, allowing easy configuration and an extensible framework for adding firmware, bootloaders and packaging tools.\u00a0 PiBox provides a generalized mechanism for building custom platforms from toolchains to bootloaders to the Linux kernel and root file system for any hardware platform.<\/p>\n<p>But once you have this generalized platform you find you want to use it for something.\u00a0 That&#8217;s when PiBox began to separate into different vertical projects.\u00a0 The first was the media center, a set of small applications and configurations for basic media playback in a self-contained but network distributed setup used initially in my camper.<\/p>\n<p>The media center was extended to include a consumer interface modeled on the Roku but written in C, <a href=\"https:\/\/www.gtk.org\/\">GTK+<\/a> and <a href=\"https:\/\/cairographics.org\/\">Cairo<\/a> (no web technologies required).\u00a0 This required defining a software stack modeled on the <a href=\"https:\/\/developer.android.com\/guide\/platform\/\">block diagrams for Android<\/a> above the core PiBox custom platform .\u00a0 Libraries provide C APIs and user space applications are written primarily in C though eventually I added a simplistic web interface for distributed webcam viewing.<\/p>\n<p>After the media center stabilized (there are still <a href=\"http:\/\/redmine.graphics-muse.org\/projects\/pibox\/issues?query_id=9\">lots of ideas to be implemented<\/a>, however) I moved to home automation with the <a href=\"http:\/\/redmine.graphics-muse.org\/projects\/ironman\/wiki\/MVP_\">Ironman<\/a> project.\u00a0 This takes the media center UI and scales it to Nest-sized displays and adds a WiFi based closed network of sensors and controls.\u00a0 This is where the project stands now, with AES 128bit encryption working on a template Arduino control for light switches.<\/p>\n<p>From here there are a plethora of directions that PiBox can go.\u00a0 There are many refactoring projects and UI updates to be made to the media center and many new features to be added to Ironman and the media center.\u00a0 Things are wide open because, as I said before&#8230;<\/p>\n<p>&#8230;software is imaginiation.<\/p>\n<hr \/>\n<p>Since PiBox started Buildroot has evolved it&#8217;s own version of building the complete Linux distribution.\u00a0 But I prefer PiBox because it makes it a little easier to rebuild parts of the whole distribution.\u00a0\u00a0 And it includes the ability to get out-of-tree firmware along with with installation tools.<\/p>\n<\/div><\/div>","protected":false},"excerpt":{"rendered":"<p>Why PiBox?  That&#8217;s a question I need to answer for myself as much for anyone else.<\/p>\n","protected":false},"author":1,"featured_media":425,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false},"version":2}},"categories":[1],"tags":[],"class_list":{"0":"post-394","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-uncategorized","8":"czr-hentry"},"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/www.piboxproject.com\/wp-content\/uploads\/2018\/10\/history2.jpg?fit=731%2C231&ssl=1","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p8du2Y-6m","jetpack-related-posts":[],"_links":{"self":[{"href":"https:\/\/www.piboxproject.com\/index.php\/wp-json\/wp\/v2\/posts\/394","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.piboxproject.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.piboxproject.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.piboxproject.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.piboxproject.com\/index.php\/wp-json\/wp\/v2\/comments?post=394"}],"version-history":[{"count":12,"href":"https:\/\/www.piboxproject.com\/index.php\/wp-json\/wp\/v2\/posts\/394\/revisions"}],"predecessor-version":[{"id":428,"href":"https:\/\/www.piboxproject.com\/index.php\/wp-json\/wp\/v2\/posts\/394\/revisions\/428"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.piboxproject.com\/index.php\/wp-json\/wp\/v2\/media\/425"}],"wp:attachment":[{"href":"https:\/\/www.piboxproject.com\/index.php\/wp-json\/wp\/v2\/media?parent=394"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.piboxproject.com\/index.php\/wp-json\/wp\/v2\/categories?post=394"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.piboxproject.com\/index.php\/wp-json\/wp\/v2\/tags?post=394"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}