<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	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/"
	>

<channel>
	<title>John Wells &#187; Linux</title>
	<atom:link href="http://www.jfwhome.com/category/linux/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.jfwhome.com</link>
	<description>Knowledge Management and Social Web App Guru</description>
	<lastBuildDate>Mon, 04 Jan 2016 17:26:35 +0000</lastBuildDate>
	<language>en-US</language>
		<sy:updatePeriod>hourly</sy:updatePeriod>
		<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.9</generator>
	<item>
		<title>Raspberry Pi-powered waterproof Plex media centre</title>
		<link>http://www.jfwhome.com/2014/05/01/raspberry-pi-powered-waterproof-plex-media-centre/</link>
		<comments>http://www.jfwhome.com/2014/05/01/raspberry-pi-powered-waterproof-plex-media-centre/#comments</comments>
		<pubDate>Thu, 01 May 2014 03:13:08 +0000</pubDate>
		<dc:creator><![CDATA[admin]]></dc:creator>
				<category><![CDATA[Hardware]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.jfwhome.com/?p=306</guid>
		<description><![CDATA[How to build an on-wall media centre from scratch&#8230; This is a small project I did for my better half &#8212; I noticed she always had the iPad on full volume when having a shower. As she is busy studying for her masters, that&#8217;s about the only time she has to &#8220;watch&#8221; TV. I thought&#8230;]]></description>
				<content:encoded><![CDATA[<p>How to build an on-wall media centre from scratch&#8230;</p>
<div id="attachment_317" style="width: 470px" class="wp-caption aligncenter"><a href="http://www.jfwhome.com/wp-content/uploads/2014/05/IMG_20140521_105913.jpg"><img class="size-large wp-image-317" src="http://www.jfwhome.com/wp-content/uploads/2014/05/IMG_20140521_105913-767x1024.jpg" alt="Because what else are you going to do in the shower?" width="460" height="614" /></a><p class="wp-caption-text">Because what else are you going to do in the shower?</p></div>
<p><span id="more-306"></span></p>
<p>This is a small project I did for my better half &#8212; I noticed she always had the iPad on full volume when having a shower. As she is busy studying for her masters, that&#8217;s about the only time she has to &#8220;watch&#8221; TV.</p>
<p>I thought I&#8217;d make it easier for her by putting a waterproof screen on the wall. My first thought was a waterproof tablet, like the Sony Xperia. However, that would be (a) no fun; (b) expensive; and (c) touchscreens don&#8217;t work at all when wet. So I decided to build my own.</p>
<p>For software, I used <a href="http://www.rasplex.com">RasPlex</a>. It fits in well as we have a number of Plex devices in the house already, and it also provides an Airplay sink. So my wife can just send whatever she&#8217;s watching on her iPad to the screen on the wall. And the entire thing can be controlled from any mobile device with Plex.</p>
<p>This isn&#8217;t a set of instructions or even a build log &#8212; like most things, the build was more trial and error than meticulous planning. It&#8217;s not difficult if you decide to build your own. That said, I was asked by a couple of people to post details, so here goes&#8230;</p>
<p>I ordered nearly all my parts from Taobao (China&#8217;s eBay).</p>
<ul>
<li>Raspberry Pi Model B (easy, so no link&#8230;)</li>
<li><a href="http://item.taobao.com/item.htm?&amp;id=37590931001">10.1&#8243; 1280&#215;800 LCD panel and HDMI-&gt;LVDS controller board</a> (there are many to choose from here. The panel is about 2mm thick. Get the controller and screen as a pair, or they might not be compatible. Be careful &#8212; most cheap screens are sub-HD 1024&#215;768.).</li>
<li>An <a href="item.taobao.com/item.htm?id=19977342674">HDMI analog audio extractor</a> (Analog audio from the RPi is poor. This little box is powered from USB and solves the problem. I removed it from its housing and used the bare board.)</li>
<li>Some sort of sound output. I&#8217;m using waterproof in-ceiling speakers with integrated amplifiers.</li>
<li>A Wi-Fi dongle. (I used a fairly large Atheros-chip Wireless-N dongle that I knew worked well with Linux. Lots of wireless dongles are reputed to work with the Raspberry Pi, but not all work well &#8212; you may need to try a few).</li>
<li>A <a href="https://www.modmypi.com/pi-modules-upis-advanced">&#8220;UPiS Advanced&#8221; Uninterruptible Power Supply</a></li>
<li>A power supply. I bought this locally &#8212; A 120V/230VAC -&gt; 12V 5A DC power supply. It needs to be able to handle the combined power draw of the screen and all peripherals, so bigger is better.</li>
<li>Two ABS project boxes &#8212; <a href="http://item.taobao.com/item.htm?id=38399842186">one for the screen</a>, and one waterproof one for the power supply. Get some waterproof wire grommets for the PSU box.</li>
<li>A sheet of 1mm-thick quartz glass (any glass will do &#8212; I chose quartz for its clarity. The thinner and clearer the better the image will be).</li>
<li><a href="http://item.taobao.com/item.htm?id=18174896500">A couple of tiny HDMI cables</a> (I made them smaller still by hacking away insulation. And destroyed two in the process &#8212; so get more than you need)..</li>
</ul>
<p>All of these were from Taobao, with the exception of the UPiS, which I ordered from modmypi.com.</p>
<p>The entire thing is powered from the 12V 5A PSU. This is housed in the waterproof project box and hidden in the ceiling. It can be turned on and off using a spare light switch.</p>
<p>The 12V output from the PSU then feeds through (via waterproof grommets) to the screen &#8212; specifically, the LCD module (which requires 12V) and the UPis (which converts 12V to 5V for the rest of the hardware).</p>
<p>I use the UPiS to coordinate graceful shutdown when the light switch is flicked off. It detects the loss of power, but can provide backup power to the Raspberry Pi. Once the power loss is detected, it signals to the Raspbery Pi to shut down. Without this, file corruption could potentially be a problem after thousands of cycles of powering off without shutting down gracefully.</p>
<p>I wrote a <a href="http://www.jfwhome.com/2014/05/26/communicating-with-the-upis-ups-from-rasplex/">small Python script</a> so that the RasPi could query the UPis every few seconds to determine if the power had been cut.</p>
<p>One detail worth noting is that I had to remove the composite and USB ports on the RPi in order to get it to fit. I then directly soldered in wires for my USB devices. This saved a lot of space.</p>
<div id="attachment_315" style="width: 470px" class="wp-caption aligncenter"><a href="http://www.jfwhome.com/wp-content/uploads/2014/05/IMG_20140521_110052.jpg"><img class="size-large wp-image-315" src="http://www.jfwhome.com/wp-content/uploads/2014/05/IMG_20140521_110052-1024x767.jpg" alt="The (almost) finished product" width="460" height="344" /></a><p class="wp-caption-text">The (almost) finished product</p></div>
<p>Obviously this is pretty light on details, but I figure that no two builds are likely to be the same here. I tried to make use of what I already had lying around. In the picture above, the RaspPi is in the top left with the UPis on top of it. To the right you can see the UPiS battery. Below this is the LVDS converter board. On the bottom left is the HDMI audio extractor, and on the bottom right is the Wi-Fi dongle.</p>
<p>After plugging in everything and testing, most of the work involved carving up the project box and waterproofing it. To fit everything in, I made standoffs out of <a href="http://www.instructables.com/id/How-To-Make-Your-Own-Sugru-Substitute/">&#8220;Oogoo&#8221;</a> (A silicone / cornflower mix, in my case coloured with blue acrylic paint), but you could also 3D-print them. The inner portion of the project box was already waterproof. Obviously once I had cut out the hole for the screen, this was no longer the case, but I managed to seal it around the front (behind the glass and screen) with a large Oogoo gasket and some 3M mastik tape. This presses the front of the glass to the inside of the ABS box, with a bead of silicone to fill the gaps and make it waterproof.</p>
<p>I chopped the box down thinner, filled gaps, and finished it with some acrylic spray paint and clear coat. And some cutesy stick-on lettering. And, tadaaa&#8230;</p>
<div id="attachment_316" style="width: 470px" class="wp-caption aligncenter"><a href="http://www.jfwhome.com/wp-content/uploads/2014/05/PICT_20140520_204439.jpg"><img class="size-large wp-image-316" src="http://www.jfwhome.com/wp-content/uploads/2014/05/PICT_20140520_204439-1024x768.jpg" alt="Ready to watch. Ignore the cutesy name!" width="460" height="345" /></a><p class="wp-caption-text">Ready to watch. Ignore the cutesy name!</p></div>
]]></content:encoded>
			<wfw:commentRss>http://www.jfwhome.com/2014/05/01/raspberry-pi-powered-waterproof-plex-media-centre/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>Ubuntu (or other Linux) on the Asus Transformer Book T100</title>
		<link>http://www.jfwhome.com/2014/03/07/perfect-ubuntu-or-other-linux-on-the-asus-transformer-book-t100/</link>
		<comments>http://www.jfwhome.com/2014/03/07/perfect-ubuntu-or-other-linux-on-the-asus-transformer-book-t100/#comments</comments>
		<pubDate>Fri, 07 Mar 2014 13:48:09 +0000</pubDate>
		<dc:creator><![CDATA[admin]]></dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.jfwhome.com/?p=251</guid>
		<description><![CDATA[This post is now out of date &#8212; see the latest update, here The T100 is a nice little convertible tablet/netbook. My aim is to get a &#8220;perfect&#8221; Ubuntu installation on the T100, such that it can be used successfully as a daily machine in both netbook and tablet modes. Unfortunately Linux support right now&#8230;]]></description>
				<content:encoded><![CDATA[<blockquote><p>This post is now out of date &#8212; <a href="http://www.jfwhome.com/2016/01/04/latest-steps-to-install-ubuntu-on-the-asus-t100ta/">see the latest update, here</a></p></blockquote>
<p>The T100 is a nice little convertible tablet/netbook.</p>
<p>My aim is to get a &#8220;perfect&#8221; Ubuntu installation on the T100, such that it can be used successfully as a daily machine in both netbook and tablet modes.</p>
<div id="attachment_320" style="width: 470px" class="wp-caption aligncenter"><a href="http://www.jfwhome.com/wp-content/uploads/2014/05/DSC_0020_20140521112555872.jpg"><img src="http://www.jfwhome.com/wp-content/uploads/2014/05/DSC_0020_20140521112555872-576x1024.jpg" alt="GLXGears in tablet mode" width="460" height="817" class="size-large wp-image-320" /></a><p class="wp-caption-text">GLXGears in tablet mode</p></div>
<p><span id="more-251"></span><br />
Unfortunately Linux support right now is quite rudimentary, and installing it requires us to jump through a few hoops. The situation is improving rapidly however. <del datetime="2016-01-04T15:07:20+00:00">So I will keep updating this How-to as new drivers become available and things improve</del>. <a href="http://www.jfwhome.com/2016/01/04/latest-steps-to-install-ubuntu-on-the-asus-t100ta/">See the latest update</a>.</p>
<h3>Warning</h3>
<p>Eventually I expect hardware support for the T100 will be excellent, but we are not there yet. In order to get the best support possible, we will be using bleeding-edge builds and the latest Linux kernels. If you&#8217;d just prefer an easy life, come back in October and just install Ubuntu 14.10.</p>
<p>That said, this little convertible is a lovely machine, and Ubuntu/unity works very nicely on it &#8212; finally Unity has a purpose! The more people get on for the ride now, the quicker we can test and iron out bugs.</p>
<p><strong>*** <del datetime="2016-01-04T15:07:20+00:00">This post will constantly be updated as in-kernel support improves</del> ***</strong></p>
<h3>Current status (updated 23/03/2014)</h3>
<p><del datetime="2016-01-04T15:07:20+00:00">I&#8217;ll update this whenever I manage to get new things working</del>. I will only add items to the How-to below that are confirmed to work well.</p>
<div style="border: 1px solid #fff;">
<ul>
<li><strong>Graphics</strong>: Working with accelerated (3D) graphics <strong style="color: green;">7/10</strong></li>
<li><strong>Wifi</strong>: Working, but often drops connection [working on improving this] <strong style="color: green;">6/10</strong></li>
<li><strong>Touchscreen</strong>: Working, with multi-touch out of the box <strong style="color: green;">10/10</strong></li>
<li><strong>Sound</strong>: Working, with patches <strong style="color: green;">8/10</strong></li>
<li><strong>SD card reader</strong>: Working, some configuration needed (thanks akira) <strong style="color: green;">9/10</strong></li>
<li><strong>Battery monitoring</strong>: Working, with patches <strong style="color: green;">8/10</strong></li>
<li><strong>Tablet keys (Volume up/down etc)</strong>: Not yet working <strong style="color: red;">0/10</strong></li>
<li><strong>Power management (Suspend/resume)</strong>: Not yet working <strong style="color: red;">0/10</strong></li>
<li><strong>Orientation sensor</strong>: Not yet working [currently testing] <strong style="color: red;">0/10</strong></li>
<li><strong>Backlight &amp; ambient light sensor</strong>: Backlight not adjustable. Light sensor works with custom driver <strong style="color: orange;">5/10</strong></li>
<li><strong>Touchpad</strong>: Working, no multitouch yet <strong style="color: green;">8/10</strong></li>
<li><strong>Shutdown / reboot</strong>: Working, with patches <strong style="color: green;">9/10</strong></li>
</ul>
</div>
<h3>1. First steps: Preparing for the Ubuntu Install</h3>
<p>First things first, update using Asus LiveUpdate to the latest &#8220;BIOS&#8221; available. At the time of writing, that is v304. Do any backing up of Windows / recovery partitions. I&#8217;ll leave the details of that up to you.</p>
<p>Before we attempt to boot Linux on the T100, we need to do some preparation, so start in Windows. Download the latest daily AMD64 build of Ubuntu 14.04 from <a href="http://cdimage.ubuntu.com/daily-live/current/">here</a>.</p>
<p>Download the <a href="http://rufus.akeo.ie/">Rufus </a>USB bootable image creator, and &#8220;burn&#8221; your downloaded ISO to a spare USB stick. In Rufus, for &#8220;Partition scheme and target system type&#8221;, choose &#8220;GPT partition scheme for UEFI computer&#8221;. For &#8220;File System&#8221;, choose &#8220;FAT32&#8243;, and leave the rest at default. At the bottom, check &#8220;Create a bootable disk using: ISO Image&#8221; and select your downloaded Ubuntu image, then hit &#8220;Start&#8221;.</p>
<p>When your USB stick is ready, close Rufus. It should now be browseable in Windows. Browse to the EFI\Boot directory, and place <a href="https://github.com/jfwells/linux-asus-t100ta/blob/master/boot/bootia32.efi">this bootloader</a> (named bootia32.efi) there. This bootloader was compiled from source using the latest Grub2. If you don&#8217;t trust random downloaded files from the Internet (and you shouldn&#8217;t), you can find the instructions for building it yourself <a href="https://github.com/jfwells/linux-asus-t100ta/tree/master/boot">here</a>.</p>
<h3>2. Booting the Live Image</h3>
<p>Now, insert the USB stick and reboot to the firmware (BIOS). You can do this in Windows by holding shift when pressing &#8220;restart&#8221;, then touching Troubleshoot &rarr; Advanced Options &rarr; UEFI Firmware Settings &rarr; Restart. </p>
<p>Once there, disable SecureBoot, then visit the boot options, and ensure the USB stick is the first in the list.</p>
<p>Press F10 to save settings, and after a few seconds you will be in the GRUB bootloader. Before the timeout, immediately hit CTRL-ALT-DEL. This will reboot the computer again, but this time you will have the laptop&#8217;s native resolution (rather than being stuck at 800&#215;600 from the &#8220;bios&#8221;).</p>
<p>In the GRUB menu, highlight &#8220;Try Ubuntu&#8221;, and press &#8220;e&#8221; to edit it. In the editing screen, scroll down to the command line options, where it says &#8220;quiet splash&#8221;. Delete &#8220;splash&#8221; and replace it with:<br />
<code>video=VGA-1:1368x768e reboot=pci,force</code></p>
<p>Then press F10 to boot. You should get all the way to the Desktop.</p>
<h3>3. Installing the distro</h3>
<p>Click the &#8220;Install Ubuntu&#8221; desktop icon to install Ubuntu permanently. </p>
<p>The partitioning scheme you choose is up to you &#8212; but you will need to preserve the EFI partition, so don&#8217;t just partition the entire disk for Ubuntu.</p>
<p>In addition to the EFI partition, I prefer separate /, /home and /boot mount points; but that is up to you. You could squish down the Windows partition and created the additional partition(s), or just delete the Windows partition altogether if you don&#8217;t need it. </p>
<p>When done, reboot, leaving the USB stick in. </p>
<h3>4. First boot</h3>
<p>Ubuntu won&#8217;t boot yet. We&#8217;ll need to compile our own bootia32.efi to use with Grub. To do that we really need a wireless connection. So we&#8217;ll boot manually, fix up wireless, and fix Grub.</p>
<p>Boot back to the Grub welcome screen on the USB stick. Hit &#8216;c&#8217; to drop to a Grub command line.</p>
<p>You&#8217;ll need to provide Grub with the path to your kernel and initrd to boot. First, the path to the kernel:</p>
<p><code><br />
linux (hd2,gpt5)/boot/vmlinuz-3.13-xxxx root=/dev/mmcblk0p5 video=VGA-1:1368x768e reboot=pci,force<br />
</code></p>
<p>Here, (hd2, gpt5) refers to the fifth partition on the third disk (Partition numbering begins at 1 and disk numbering begins at 0). This will vary depending on how yo uinstalled and your T100 model. On my 32GB model, Grub assigns the USB stick as hd0, the read-only recovery flash chip as hd1, and the main internal flash as hd2. gpt5 is the fifth partition, but it will depend on how you installed.</p>
<p>Fortunately, grub has good auto-completion features, so you can hit <Tab> twice as you type, and grub will list possible completions for you &#8212; just keep trying until you see the various vmlinuz kernels. </p>
<p>The root=/dev/mmcblk0p5 will also depend on the partition you installed to. It will be your root partition. Unfortunately this can&#8217;t be auto-completed, so if you can&#8217;t remember your partition setup, you&#8217;ll need to try by trial and error.</p>
<p>To complete the line, press Enter. </p>
<p>Then you need to specify the location of your initrd. This is easy, it&#8217;s in the same place as the kernel:<br />
<code>initrd (hd2,gpt5)/boot/initrd-3.13-xxxx </code></p>
<p>Then Enter. </p>
<p>Then boot with:<br />
<code>boot</code></p>
<p>With luck after hitting Enter, you&#8217;ll boot through to Ubuntu. If not, don&#8217;t be disheartened &#8212; keep trying.</p>
<h3>5. Enabling wifi </h3>
<p>To get further, we&#8217;ll need wifi. However internal wifi on the T100 isn&#8217;t terribly reliable under Linux yet. If you have access to another wifi dongle, you might want to try that until you&#8217;re fully set up.</p>
<p>The driver is already included, but it needs some firmware and a copy of your system&#8217;s wifi nvram:</p>
<ul>
<li>Grab the <a href="http://ftp2.halpanet.org/source/_dev/linux-firmware.git/brcm/brcmfmac43241b4-sdio.bin">Wifi firmware</a> here (from the Linux-wireless repository). Copy it to /lib/firmware/brcm/brcmfmac43241b4-sdio.bin</li>
<li>The NVRAM is difficult to get right now, as 32-bit EFI runtime services aren&#8217;t yet available on 64-bit. But you can use my NVRAM &#8212; <a href="https://raw.github.com/jfwells/linux-asus-t100ta/master/nvram/lib/firmware/brcm/brcmfmac43241b4-sdio.txt">get it here</a> and copy it to /lib/firmware/brcm/brcmfmac43241b4-sdio.txt</li>
</ul>
<p>You&#8217;ll now need to reboot using the same procedure again, and wifi should be working.</p>
<p>However, I found wifi performance to be very poor &#8212; there are some bugs in the driver. This is improved somewhat with the latest kernel, which we will upgrade to in a later step. I managed to improve performance somewhat by using the NVRAMs from other platforms, and splicing in some of the missing variables. You can see my tries <a href="https://github.com/jfwells/linux-asus-t100ta/tree/master/nvram/lib/firmware/brcm">here</a>. In all cases, copy them to /lib/firmware/brcm/brcmfmac43241b4-sdio.txt , and reboot or unload/reload the wifi driver:<br />
<code><br />
sudo modprobe -r brcmfmac<br />
sudo modprobe brcmfmac<br />
</code></p>
<p>If you find a firmware/nvram combination that works really well, please share.</p>
<h3>6. Completing the installation</h3>
<p>We can&#8217;t keep rebooting like this&#8230; so let&#8217;s fix Grub. This assumes you now have a working Internet connection.</p>
<p>We&#8217;ll need some build tools &#8212; install them:</p>
<p><code><br />
sudo apt-get update &#038;&#038; sudo apt-get install git bison libopts25 libselinux1-dev autogen m4 autoconf help2man libopts25-dev flex libfont-freetype-perl automake autotools-dev libfreetype6-dev texinfo ia32_libs build_essential</code></p>
<p>Then get the Grub source:<br />
<code>git clone git://git.savannah.gnu.org/grub.git</code></p>
<p>Now build it:<br />
<code><br />
cd grub<br />
./autogen.sh<br />
./configure --with-platform=efi --target=i386 --program-prefix=""<br />
make<br />
</code></p>
<p>And install to efi:</p>
<p><code><br />
cd grub-core<br />
sudo ../grub-install -d . --efi-directory /boot/efi/ --target=i386<br />
</code></p>
<p>This will create a directory, &#8216;grub&#8217;, in your EFI partition.<br />
We want to copy the grubia32.efi from there to the location Ubuntu created during installation:</p>
<p><code><br />
cd /boot/efi/EFI<br />
sudo cp grub/grubia32.efi ubuntu/grubx64.efi<br />
</code></p>
<p>This should be enough to allow you to boot from the &#8220;ubuntu&#8221; option in your EFI firmware.</p>
<p>Before you boot, let&#8217;s add the default command line options to Grub.</p>
<p>Open /etc/default grub in a text editor:<br />
<code>sudo nano /etc/default/grub</code></p>
<p>And edit the GRUB_CMDLINE_LINUX_DEFAULT exactly as we did before. When done, hit ctrl-o to save then ctrl-x to exit. Then, to update Grub:<br />
<code>sudo update-grub</code></p>
<p>Congratulations! you should now be able to boot/reboot directly to the Ubuntu desktop!</p>
<h3>7. Upgrading to the bleeding edge to improve hardware support</h3>
<p>There are still a lot of things to get working. The best way to improve hardware support further is to use the latest development branches of the kernel.</p>
<p>Unfortunately (as at the time of writing), even the latest development Linux kernel (3.14-rc5) lacks some key hardware support for Baytrail tablets. But we can improve that by pulling in latest patches for sound. We&#8217;ll also compile in a new experimental feature for accessing 32-bit EFI services from a 64-bit system, as we need that for tools like efibootmgr to work. Finally, we&#8217;ll pull in the latest wireless fixes and the latest power management changes. We need to power management changes for our battery patch.</p>
<p>I recommend you compile this on a fast desktop computer with a decent network connection. You could do this on your tablet, but it would be extremely slow. For the following instructions, I assume you&#8217;re using a recent 64-bit Ubuntu on a desktop. If you&#8217;re using 32-bit, you&#8217;ll have to change the instructions to cross-compile &#8212; I&#8217;ll leave that up to you (and Google).</p>
<p>On your compiling machine, install the packages you&#8217;ll need to build a kernel:<br />
<code><br />
sudo apt-get install git build-essential fakeroot crash kexec-tools makedumpfile kernel-wedge libncurses5 libncurses5-dev<br />
sudo apt-get build-dep linux-image-$(uname -r)<br />
</code></p>
<p>Then create a working directory, step into it, and download the sources you&#8217;ll need:<br />
<code><br />
mkdir kernel<br />
cd kernel<br />
git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git<br />
cd source<br />
git remote add sound git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git<br />
git remote add efi git://git.kernel.org/pub/scm/linux/kernel/git/mfleming/efi.git<br />
git remote add pmfixes git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git<br />
git remote add wifinext git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next.git<br />
git fetch sound<br />
git fetch efi<br />
git fetch pmfixes<br />
git fetch wifinext<br />
</code></p>
<p>Then merge the updates from sound, efi mixed-mode, power management and wireless onto the mainline kernel:<br />
<code><br />
git merge sound/topic/intel<br />
git merge efi/efi-for-mingo<br />
git merge pmfixes/linux-next<br />
git merge wifinext/master<br />
</code></p>
<p>There are still some patches we need to apply. Step back and create a patch directory, and download some patches into it:</p>
<p><code><br />
cd ..<br />
mkdir patches<br />
^mkdir^cd<br />
git clone https://github.com/jfwells/linux-asus-t100ta.git<br />
</code></p>
<p>Now apply the patches:<br />
<code><br />
cd ../source<br />
git apply ../patches/linux-asus-t100ta/patches/*<br />
</code></p>
<p>They should all apply without error.</p>
<p>Now we&#8217;re almost ready to compile. Before we do, we need a .config file to tell the kernel build system what parts we want to compile. Start by copying over the current one from your T100. You&#8217;ll find it at /boot/config-xxxxxx , where xxxxxx is the version of the currently running kernel. Grab it and copy it to the kernel/source directory you&#8217;ve just been working in. Rename it to .config .</p>
<p>Now we need to update the config:</p>
<p><code><br />
make oldconfig<br />
</code></p>
<p>This will prompt you to set configuration for the things that will be newer in this kernel. Select &#8216;m&#8217; to compile relevant drivers as a module where offered (in particular all the &#8216;soc&#8217; sound options). Select &#8216;Y&#8217; to enable EFI mixed mode where offered. Leave the kernel debugging options off.</p>
<p>When done, we&#8217;re ready to compile. We can just do it the quick and dirty way:</p>
<p><code><br />
make clean<br />
make -j8 deb-pkg<br />
</code></p>
<p>The above assumes this is on a quad-core processor with hyperthreading (hence the &#8216;-j8&#8242;, or 8 simultaneous processes). Reduce this number appropriately if you have less cores.</p>
<p>This will take some time (anywhere from 20 minutes to over an hour. If you&#8217;re doing it directly on the T100, all bets are off &#8211; it could take all day. </p>
<p>When complete, you&#8217;ll have a set of .deb packages in the directory above (i.e. in the &#8220;kernel&#8221; directory). We need &#8220;linux-headers-xxxxx.deb&#8221; and &#8220;linux-image-xxxxx.deb&#8221;. Choose the smaller of the linux-image packages, the one without debug symbols. Copy them over to your T100.</p>
<p>On the T100, install the new kernel with:<br />
<code><br />
cd &lt;folder where you saved the .debs&gt;<br />
dpkg -i ./*.deb<br />
</code></p>
<p>Then reboot!</p>
<h3>8. Sound</h3>
<p>Sound won&#8217;t yet be working. First, you&#8217;ll need some more firmware. For now, you can grab it from <a href="https://chromium.googlesource.com/chromiumos/third_party/linux-firmware/+archive/master/intel.tar.gz">ChromiumOS, here</a>. Unpack the archive and copy the files to /lib/firmware/intel .</p>
<p>The drivers are in a bit of a raw state &#8212; they expose about a hundred oddly-named mixer and DSP devices to ALSA. We can set some defaults. Grab the defaults file <a href="https://raw.github.com/AdamWill/baytrail-m/master/alsa/t100_B.state">here</a>, and copy it to /var/lib/alsa/asound.state .</p>
<p>Reboot, and force-load the state file into alsa with :<br />
<code>sudo alsactl -f /var/lib/alsa/asound.state restore</code></p>
<p>For me, my sound still sounds pretty awful. I need to mute the distorted right channel in alsamixer, then at least it is bearable. I also find the CPU runs a bit hot with sound enabled. Let me know if you have more luck. </p>
<p><strong>* please be careful &#8212; my sound is permanently distorted, even in Windows now; keep the volume low when testing the various options *</strong></p>
<h3>9. SD card reader</h3>
<p>The SD card reader works with newer kernels, but the sdhci module needs some configuration. Create a new file:</p>
<p><code><br />
sudo nano /etc/modprobe.d/sdhci.conf<br />
</code></p>
<p>Then add the following:</p>
<p><code><br />
options sdhci debug_quirks=0x8000<br />
</code></p>
<p>ctrl-o then ctrl-x to save and exit, then:</p>
<p><code><br />
update-initramfs -u -k all<br />
</code></p>
<p>Then reboot and the card reader should be working.</p>
<h3>9. Other drivers</h3>
<p>So far, the only additional driver I have working is the light sensor. <a href="https://github.com/jfwells/linux-asus-t100ta/tree/master/cm3218_ambient_light_sensor_driver">Please download and test my driver here</a>.</p>
<h3>9. Other scripts</h3>
<p>I have made some additional small scripts to improve usability.</p>
<p><a href="https://github.com/jfwells/linux-asus-t100ta/tree/master/dock-scripts">Dock scripts</a>: These enable/disable the Onboard on-screen keyboard when you undock/dock the tablet. Set up the onscreen keyboard first in System Settings &rarr; Accessibility, then the scripts will enable/disable they keyboard for text fields.</p>
<p><a href="https://github.com/jfwells/linux-asus-t100ta/tree/master/rotation">Rotate script</a>: This will rotate the screen and touchscreen when run. You can place the desktop entry on your desktop. We can connect the orientation sensor to this later, once that is working.</p>
<div id="attachment_319" style="width: 470px" class="wp-caption aligncenter"><a href="http://www.jfwhome.com/wp-content/uploads/2014/05/IMG_20140521_112704.jpg"><img src="http://www.jfwhome.com/wp-content/uploads/2014/05/IMG_20140521_112704-1024x576.jpg" alt="Workable... for now." width="460" height="258" class="size-large wp-image-319" /></a><p class="wp-caption-text">Workable&#8230; for now.</p></div>
]]></content:encoded>
			<wfw:commentRss>http://www.jfwhome.com/2014/03/07/perfect-ubuntu-or-other-linux-on-the-asus-transformer-book-t100/feed/</wfw:commentRss>
		<slash:comments>478</slash:comments>
		</item>
		<item>
		<title>Ubuntu server: /xcache.so: cannot open shared object file: No such file or directory</title>
		<link>http://www.jfwhome.com/2012/12/27/ubuntu-server-xcache-so-cannot-open-shared-object-file-no-such-file-or-directory/</link>
		<comments>http://www.jfwhome.com/2012/12/27/ubuntu-server-xcache-so-cannot-open-shared-object-file-no-such-file-or-directory/#comments</comments>
		<pubDate>Thu, 27 Dec 2012 05:05:33 +0000</pubDate>
		<dc:creator><![CDATA[admin]]></dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Servers]]></category>

		<guid isPermaLink="false">http://www.jfwhome.com/?p=230</guid>
		<description><![CDATA[If you keep getting this spamming your PHP error log, it is likely because PHP xcache was installed previously and then uninstalled, but its configuration files were not cleared out. This could have happened at an upgrade or when you chose a different cache system. You can check if you have xcache installed by doing&#8230;]]></description>
				<content:encoded><![CDATA[<p>If you keep getting this spamming your PHP error log, it is likely because PHP xcache was installed previously and then uninstalled, but its configuration files were not cleared out. This could have happened at an upgrade or when you chose a different cache system.</p>
<p>You can check if you have xcache installed by doing <code>sudo dpkg -s php5-xcache | grep Status</code>. If the status shows as &quot;deinstalled&quot; but with config files left, you can simply purge it with <code>sudo apt-get remove --purge php5-xcache</code> .</p>
<p>Then restart Apache: <code>sudo service apache2 restart</code>. Your error log should now be spam free.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jfwhome.com/2012/12/27/ubuntu-server-xcache-so-cannot-open-shared-object-file-no-such-file-or-directory/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>Reboot TP-Link router remotely or automatically</title>
		<link>http://www.jfwhome.com/2012/06/18/reboot-tp-link-router-remotely-or-automatically/</link>
		<comments>http://www.jfwhome.com/2012/06/18/reboot-tp-link-router-remotely-or-automatically/#comments</comments>
		<pubDate>Mon, 18 Jun 2012 05:09:09 +0000</pubDate>
		<dc:creator><![CDATA[admin]]></dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[OSX]]></category>
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.jfwhome.com/?p=171</guid>
		<description><![CDATA[using cURL or wget, it&#8217;s easy to reboot a TP-Link router from a terminal or command line. Put it in a script and schedule it to run automatically if your router overheats or is flaky: in OSX (using cURL): curl --user username:password http://192.168.1.1/userRpm/SysRebootRpm.htm?Reboot=Reboot > /dev/null If you have wget by default instead of cURL (i.e.&#8230;]]></description>
				<content:encoded><![CDATA[<p>using cURL or wget, it&#8217;s easy to reboot a TP-Link router from a terminal or command line. Put it in a script and schedule it to run automatically if your router overheats or is flaky:</p>
<p>in OSX (using cURL):<br />
<code><br />
curl --user username:password http://192.168.1.1/userRpm/SysRebootRpm.htm?Reboot=Reboot > /dev/null<br />
</code></p>
<p>If you have wget by default instead of cURL (i.e. most *nix):<br />
<code><br />
wget -qO- --user=username --password=password http://192.168.1.1/userRpm/SysRebootRpm.htm?Reboot=Reboot > /dev/null<br />
</code></p>
<p>Replace username and password with the admin username and password of your router. Replace 192.168.1.1 with the IP address of your router.</p>
<p>If you have Windows, with neither of the above, and don&#8217;t want to download wget, try using bitsadmin to create a download job.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jfwhome.com/2012/06/18/reboot-tp-link-router-remotely-or-automatically/feed/</wfw:commentRss>
		<slash:comments>438</slash:comments>
		</item>
		<item>
		<title>Fixing problems with Dovecot &#8211; Postfix mail server after Ubuntu server upgrade to 11.10</title>
		<link>http://www.jfwhome.com/2012/02/02/fixing-problems-with-dovecot-postfix-mail-server-after-ubuntu-server-upgrade-to-1110/</link>
		<comments>http://www.jfwhome.com/2012/02/02/fixing-problems-with-dovecot-postfix-mail-server-after-ubuntu-server-upgrade-to-1110/#comments</comments>
		<pubDate>Thu, 02 Feb 2012 09:45:14 +0000</pubDate>
		<dc:creator><![CDATA[admin]]></dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[Servers]]></category>

		<guid isPermaLink="false">http://www.jfwhome.com/?p=159</guid>
		<description><![CDATA[The thing that scares me most about server upgrades is the mail server&#8230; the thought of having to reconfigure the many interdependent servers and processes involved is horrible. So I wasn&#8217;t pleased to find my postfix-dovecot installation dying on upgrade from 11.04 to 11.10. I couldn&#8217;t sent outgoing mail or receive inbound. Fortunately I wasn&#8217;t&#8230;]]></description>
				<content:encoded><![CDATA[<p>The thing that scares me most about server upgrades is the mail server&#8230; the thought of having to reconfigure the many interdependent servers and processes involved is horrible.</p>
<p>So I wasn&#8217;t pleased to find my postfix-dovecot installation dying on upgrade from 11.04 to 11.10. I couldn&#8217;t sent outgoing mail or receive inbound.</p>
<p>Fortunately I wasn&#8217;t an &#8220;early upgrader&#8221;&#8230; both issues were easy to find and fix.</p>
<p><span id="more-159"></span></p>
<p><strong>Fixing inbound mail</strong></p>
<p>Messages sent to my address were being returned as undeliverable with the following error:<br />
<code>
<pre>
            < my-server.com #5.3.0 x-unix; /usr/lib/dovecot/deliver: invalid option -- 'n' Usage:    dovecot-lda [-c <config file>] [-a <address>] [-d <username>] [-p <path>]    [-f <envelope sender>] [-m <mailbox>] [-e] [-k]>
</pre>
<p></code><br />
This is fairly self-explanatory: In the new version of Dovecot, the &#8220;n&#8221; option is no longer used. If you receive this error, type the following commands:<br />
<code>
<pre>
sudo postconf -e "mailbox_command = /usr/lib/dovecot/deliver -c /etc/dovecot/conf.d/01-mail-stack-delivery.conf -m \"\${EXTENSION}\""
sudo service postfix restart 
</pre>
<p></code></p>
<p>Done.</p>
<p><strong>Fixing outbound mail</strong></p>
<p>My errors were caused by the SASL authentication server, saslauthd. A bug report is <a href="https://bugs.launchpad.net/ubuntu/+bug/875440">here</a>.</p>
<p>The problem can be fixed by rolling back saslauthd packages to a previous version, then &#8220;sticking&#8221; them so that they don&#8217;t get updated with regular system updates. Keep track of this so that you can remember to un-stick them when it comes time to upgrade.</p>
<p>First get the old packages. Replace &#8220;i386&#8243; in the links below with &#8220;amd64&#8243; if your server is 64-bit<br />
<code>
<pre>
mkdir ~/saslfixes
cd ~/saslfixes
wget http://archive.ubuntu.com/ubuntu/pool/main/c/cyrus-sasl2/libsasl2-2_2.1.23.dfsg1-5ubuntu3_i386.deb http://archive.ubuntu.com/ubuntu/pool/main/c/cyrus-sasl2/libsasl2-modules_2.1.23.dfsg1-5ubuntu3_i386.deb http://archive.ubuntu.com/ubuntu/pool/main/c/cyrus-sasl2/libsasl2-dev_2.1.23.dfsg1-5ubuntu3_i386.deb http://archive.ubuntu.com/ubuntu/pool/main/c/cyrus-sasl2/libsasl2-modules-sql_2.1.23.dfsg1-5ubuntu3_i386.deb http://archive.ubuntu.com/ubuntu/pool/main/c/cyrus-sasl2/sasl2-bin_2.1.23.dfsg1-5ubuntu3_i386.deb
</pre>
<p></code></p>
<p>Then remove the old packages and install the new ones:<br />
<code>
<pre>
sudo /etc/init.d/saslauthd stop
sudo dpkg -r libsasl2-dev
sudo dpkg -r libsasl2-modules-sql
sudo dpkg -r sasl2-bin
sudo dpkg -r --force-all libsasl2-2 libsasl2-2:i386
sudo dpkg -r --force-all libsasl2-modules
sudo dpkg -i --force-all *.deb
</pre>
<p></code></p>
<p>Then restart the servers:</p>
<p><code>
<pre>
sudo /etc/init.d/saslauthd restart
sudo /etc/init.d/postfix restart
</pre>
<p></code></p>
<p>And finally &#8220;stick&#8221; the packages so they aren&#8217;t updated:</p>
<p>Type these commands <em>as root</em> (<code>sudo su -</code> will get you a root shell)<br />
<code>
<pre>
echo libsasl2-dev hold | dpkg --set-selections
echo libsasl2-modules-sql hold | dpkg --set-selections
echo libsasl2-2 hold | dpkg --set-selections
echo libsasl2-modules hold | dpkg --set-selections
echo sasl2-bin hold | dpkg --set-selections
</pre>
<p></code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.jfwhome.com/2012/02/02/fixing-problems-with-dovecot-postfix-mail-server-after-ubuntu-server-upgrade-to-1110/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>IPSec/L2TP VPN on Linode Ubuntu server for iPhone/Android</title>
		<link>http://www.jfwhome.com/2012/01/29/ipsecl2tp-vpn-on-linode-ubuntu-server-for-iphoneandroid/</link>
		<comments>http://www.jfwhome.com/2012/01/29/ipsecl2tp-vpn-on-linode-ubuntu-server-for-iphoneandroid/#comments</comments>
		<pubDate>Sun, 29 Jan 2012 07:47:01 +0000</pubDate>
		<dc:creator><![CDATA[admin]]></dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Networking]]></category>

		<guid isPermaLink="false">http://www.jfwhome.com/?p=150</guid>
		<description><![CDATA[It&#8217;s now easy to set up your own cheap VPN virtual private server that can be used with your mobile devices. Great for accessing resources on private networks, browsing securely, or accessing blocked sites. This is now much easier than it used to be. Last time I tried to set up a VPN on an&#8230;]]></description>
				<content:encoded><![CDATA[<p>It&#8217;s now easy to set up your own cheap VPN virtual private server that can be used with your mobile devices. Great for accessing resources on private networks, browsing securely, or accessing blocked sites.</p>
<p>This is now much easier than it used to be. Last time I tried to set up a VPN on an Ubuntu server, I had trouble with reconnections and had to manually compile OpenSwan. These all seem to be fixed. </p>
<p>Instructions are already all over the internet, but there are a few extra steps for a default Ubuntu linode in order to get routing to work.</p>
<p>These instructions are tested with Ubuntu 11.04 (Natty), but should also work on 11.10. We will set up an OpenSwan IPSec server with l2tp encryption provided by xl2tpd.</p>
<p><span id="more-150"></span></p>
<ol>
<li>Install everything:<br /><code>
<pre>sudo apt-get install openswan ppp xl2tpd</pre>
<p></code></li>
<li>When OpenSwan installs, answer &#8220;No&#8221; to the question about certificates&#8230; on mobile devices you will use a shared secret rather than a certificate.</li>
<li>Follow the rest of the directions in <a href="http://ubuntuforums.org/showthread.php?t=1645473&#038;highlight=openswan+iphone">this post</a> to set up the configuration files, up until it asks you to restart the three servers. Be sure to substitute the Ubuntu Server IP Address<br />
and your Gateway Internal IP with the Public IP and Default Gateway provided by Linode. These can be found on your Linode Manager under the &#8220;Remote Access&#8221; tab. </p>
<p>When editing the /etc/xl2tpd/xl2tpd.conf file, you can choose any private subnet for &#8220;IP Range&#8221; and &#8220;local IP&#8221;. The &#8220;Local IP&#8221; will be assigned to the server, and clients will be assigned IPs from the &#8220;IP Range&#8221;. For example, I chose 192.168.0.2 &#8211; 192.168.0.20 for the range and 192.168.0.1 for the local IP.</p>
<p>In addition, in the /etc/ppp/options.xl2tpd file, change the ms-dns line to point to your DNS name servers. You will probably want to use those provided by Linode too &#8212; you can add multiple ms-dns lines, one for each resolver. </li>
<li>Now edit your /etc/rc.local file, and add the following, before the <code>exit 0;</code> line. Change the 192.168.0.0/24 IP range to match the IP range you chose above in the xl2tpd.conf file.
<p><code>
<pre>iptables -A FORWARD -m state --state RELATED,ESTABLISHED -j ACCEPT
iptables -A FORWARD -s 192.168.0.0/24 -j ACCEPT
iptables -A FORWARD -j REJECT
iptables -t nat -A POSTROUTING -s 192.168.0.0/24 -o eth0 -j MASQUERADE
echo 1 > /proc/sys/net/ipv4/ip_forward
for each in /proc/sys/net/ipv4/conf/*
do
    echo 0 > $each/accept_redirects
    echo 0 > $each/send_redirects
done
/etc/init.d/ipsec restart</pre>
<p></code></li>
<li>This sets up the necessary kernel routing options and firewall rules for traffic to be routed through to the Internet. The file will be executed at each boot.. but you can run it now without rebooting with <code>sudo /etc/rc.local</code>.</li>
<li>Now restart all the servers:<br /><code>
<pre>sudo /etc/init.d/pppd-dns restart
sudo /etc/init.d/xl2tpd restart
sudo /etc/init.d/ipsec restart</pre>
<p></code></li>
<li>Check that everything is working&#8230; you should get &#8220;OK&#8221; for everything other than &#8220;Opportunistic encryption&#8221; and RSA key:<br /><code>
<pre>sudo ipsec verify
</pre>
<p></code></li>
<li>All done! You can follow the directions for iPhone setup at the bottom of the same post</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://www.jfwhome.com/2012/01/29/ipsecl2tp-vpn-on-linode-ubuntu-server-for-iphoneandroid/feed/</wfw:commentRss>
		<slash:comments>43</slash:comments>
		</item>
	</channel>
</rss>
