<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>Eyes-free Linux Ninja! (bsdtar)</title><link>http://eyesfreelinux.ninja/</link><description></description><atom:link href="http://eyesfreelinux.ninja/categories/bsdtar.xml" type="application/rss+xml" rel="self"></atom:link><language>en</language><lastBuildDate>Fri, 22 Sep 2017 20:57:18 GMT</lastBuildDate><generator>https://getnikola.com/</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>Arch Linux on the Raspberry Pi and the  bsdtar Fix</title><link>http://eyesfreelinux.ninja/posts/raspberry-pi-arch-and-the-fix.html</link><dc:creator>Mike</dc:creator><description>&lt;div&gt;&lt;p&gt;A couple of years ago, or more, I wrote a script to get the latest
&lt;a href="https://www.raspberrypi.org/"&gt;Raspberry Pi&lt;/a&gt; filesystem archive from the
&lt;a href="https://archlinuxarm.org/"&gt;Arch LinuxARM&lt;/a&gt; site, create, partition
and mount a new &lt;code&gt;.img&lt;/code&gt; file and extract the &lt;code&gt;.tar.gz&lt;/code&gt; file into the
mounted partitions.&lt;/p&gt;
&lt;p&gt;But a while ago, about December 2016 or so I started to get &lt;code&gt;bsdtar&lt;/code&gt;
errors when extracting the archive.&lt;/p&gt;
&lt;p&gt;Note here that it is documented on the Arch Linux ARM
site that &lt;code&gt;GNU tar&lt;/code&gt; will not work with this operation and it must be
&lt;code&gt;bsdtar&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;In the last couple of days my need to find a solution has grown more
pressing and I went looking for the answer. I turned up &lt;a href="https://archlinuxarm.org/forum/viewtopic.php?f=64&amp;amp;t=11396"&gt;this post in the Arch Linux ARM forums&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;On page two of the thread it says that version 3.3+ is required.&lt;/p&gt;
&lt;p&gt;As my main machine is &lt;code&gt;Debian Stretch&lt;/code&gt; my version was not
that high.&lt;/p&gt;
&lt;p&gt;Below is a script which will get, make and install a
sufficiently current version:&lt;/p&gt;
&lt;table class="codehilitetable"&gt;&lt;tr&gt;&lt;td class="linenos"&gt;&lt;div class="linenodiv"&gt;&lt;pre&gt; 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20&lt;/pre&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class="code"&gt;&lt;pre class="code literal-block"&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="ch"&gt;#!/bin/bash&lt;/span&gt;
&lt;span class="c1"&gt;#&lt;/span&gt;
&lt;span class="c1"&gt;# Get, build and install the version of bsdtar needed by the Raspberry Pi Arch Linux root file-system get and &lt;/span&gt;
&lt;span class="c1"&gt;# extract&lt;/span&gt;
&lt;span class="c1"&gt;#&lt;/span&gt;

&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt; &lt;span class="sb"&gt;`&lt;/span&gt;whoami&lt;span class="sb"&gt;`&lt;/span&gt; !&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'root'&lt;/span&gt; &lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;then&lt;/span&gt;
    &lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"Script must be run as root, try: &lt;/span&gt;&lt;span class="nv"&gt;$0&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
    &lt;span class="nb"&gt;exit&lt;/span&gt; 1
&lt;span class="k"&gt;fi&lt;/span&gt;

&lt;span class="nb"&gt;set&lt;/span&gt; -e

wget https://www.libarchive.org/downloads/libarchive-3.3.1.tar.gz
tar xzf libarchive-3.3.1.tar.gz
&lt;span class="nb"&gt;cd&lt;/span&gt; libarchive-3.3.1
./configure
make
make install
&lt;span class="nb"&gt;exit&lt;/span&gt; 0
&lt;/pre&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;

&lt;p&gt;Now:&lt;/p&gt;
&lt;pre class="code literal-block"&gt;&lt;span&gt;&lt;/span&gt;bsdtar --version
&lt;/pre&gt;


&lt;p&gt;Should show a version &amp;gt; 3.3.&lt;/p&gt;
&lt;p&gt;Here is how to clone my repo and use the script:&lt;/p&gt;
&lt;pre class="code literal-block"&gt;&lt;span&gt;&lt;/span&gt;git clone https://github.com/cromarty/rpi-stuff
&lt;/pre&gt;


&lt;p&gt;Now:&lt;/p&gt;
&lt;pre class="code literal-block"&gt;&lt;span&gt;&lt;/span&gt;cd rpi-stuff/make-rpi-arch
&lt;/pre&gt;


&lt;p&gt;Execute the script with one argument, which is the version
architecture:&lt;/p&gt;
&lt;pre class="code literal-block"&gt;&lt;span&gt;&lt;/span&gt;sudo ./make-rpi-arch.sh &amp;lt;architecture&amp;gt;
&lt;/pre&gt;


&lt;p&gt;Where &lt;code&gt;&amp;lt;architecture&amp;gt;&lt;/code&gt; is one of:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;armv6 for the older Pi versions&lt;/li&gt;
&lt;li&gt;armv7 for the Pi2&lt;/li&gt;
&lt;li&gt;armv8 for the Pi3&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Note I have never run an &lt;code&gt;armv8&lt;/code&gt; image.&lt;/p&gt;
&lt;p&gt;The script also needs &lt;code&gt;bsdtar&lt;/code&gt; (as discussed above), &lt;code&gt;kpartx&lt;/code&gt;, and
&lt;code&gt;parted&lt;/code&gt;.&lt;/p&gt;&lt;/div&gt;</description><category>Arch</category><category>bsdtar</category><category>Raspberry Pi</category><guid>http://eyesfreelinux.ninja/posts/raspberry-pi-arch-and-the-fix.html</guid><pubDate>Fri, 22 Sep 2017 20:29:56 GMT</pubDate></item></channel></rss>