Thicket data repository for the EEG
at main 9.5 kB view raw
1{ 2 "id": "https://mort.io/blog/arming-linuxkit/", 3 "title": "ARMing LinuxKit", 4 "link": "https://mort.io/blog/arming-linuxkit/", 5 "updated": "2017-06-02T00:00:00", 6 "published": "2017-06-02T00:00:00", 7 "summary": "<p>As some may know, following the <a href=\"https://unikernels.com\">Unikernel Systems</a> acquisition, I\ncurrently do contract work for <a href=\"https://docker.com\">Docker Inc.</a> in addition to my day job\nhere at the <a href=\"https://www.cl.cam.ac.uk\">Cambridge University Computer Laboratory</a>. Recently this has\ncentred on <a href=\"https://github.com/linuxkit/linuxkit\">LinuxKit</a>, “<em>A toolkit for building secure, portable and lean\noperating systems for containers</em>” and, specifically, enabling ARM64 support.\nI’m pleased to say that a basic proof-of-concept is now complete, and we’re\nworking towards getting support merged upstream.</p>\n<p>The proof-of-concept was developed using the great ARM64 support provided\nby <a href=\"https://packet.net\"><code>packet.net</code></a>, on one of their <code>type 2A</code> boxes.</p>\n<p>If you fancy trying it out, then hopefully the following instructions will be of\nuse – or just bug me on the <a href=\"https://slack.packet.net/\"><code>packet.net</code> Slack</a>!</p>\n<h2><a href=\"https://mort.io/blog/arming-linuxkit/#building\">Building</a></h2>\n<p>Start by getting an ARM64 box setup. If you have one to hand, great! If not, you\ncould head over to <a href=\"https://packet.net\">packet.net</a> and create type 2A Ubuntu box to use as a build\nenvironment.</p>\n<p>Then clone the source, either <code>git clone</code> <a href=\"https://github.com/mor1/linuxkit/tree/project-arm64\">my dev branch</a>, or\nsee <a href=\"https://github.com/linuxkit/linuxkit/pull/1654\">https://github.com/linuxkit/linuxkit/pull/1654</a> for the open PR which may\nbe a bit more stable.</p>\n<p>The essence of it then is to build the containers based off <code>aarch64/alpine</code>,\nalong with an ARM64 version of the <a href=\"https://github.com/moby/moby\"><code>moby</code> CLI</a> if needed. Specifying the\ncontainer images you just built in your <code>moby.yml</code> file will then cause <code>moby</code>\nto assemble things that should boot on ARM64.</p>\n<p>The output should be a gzipped kernel, currently slightly misleadingly named\n<code>bzImage</code> as well as a suitable <code>initrd</code>.</p>\n<h2><a href=\"https://mort.io/blog/arming-linuxkit/#booting\">Booting</a></h2>\n<p>Setup another ARM64 box on which to boot the results. You could setup a\ntype 2A <a href=\"https://packet.net\">packet.net</a> box once more, but this time set it to <em>custom OS</em> and\n<em>iPXE boot</em>. For the iPXE boot URL, give a URL pointing to a suitable boot\nfile. I use:</p>\n<pre><code><span><span><span>#</span></span><span>!ipxe</span><span>\n</span></span><span><span><span>set</span></span><span> base-url URL-TO-DIRECTORY-HOLDING-IMAGES</span>\n</span><span><span><span>set</span></span><span> kernel-params ip=dhcp nomodeset ro serial console=ttyAMA0,115200 earlycon earlyprintk=serial,keep initrd=arm64-initrd.img</span>\n</span><span><span><span>initrd</span></span><span> <span><span>$</span><span>{</span></span><span><span>base</span></span><span><span>-</span></span><span>url</span><span><span>}</span></span>/arm64-initrd.img</span>\n</span><span><span><span>imgstat</span></span>\n</span><span><span><span>boot</span></span><span> <span><span>$</span><span>{</span></span><span><span>base</span></span><span><span>-</span></span><span>url</span><span><span>}</span></span>/arm64-bzImage <span><span>$</span><span>{</span></span><span><span>kernel</span></span><span><span>-</span></span><span>params</span><span><span>}</span></span></span>\n</span></code></pre>\n<p>Note that, currently at least, the <a href=\"https://packet.net\">packet.net</a> iPXE boot only occurs on the\nfirst boot as it is assumed that the iPXE boot will install a working image to\nthe local disk. Thus, if it doesn’t work first time, get an SOS console and\nbreak in by hitting <code>^B</code> at the appropriate moment, before issuing <code>chain URL</code>\nwhere <code>URL</code> points to your iPXE boot file.</p>\n<h2><a href=\"https://mort.io/blog/arming-linuxkit/#conclusion\">Conclusion</a></h2>\n<p>This just does the barest minimum for now – I did say it was a\nproof-of-concept… :) Work is currently ongoing to upstream this rather than\ndeveloping this PoC further, but if anyone has a particular interest or would\nlike to provide patches to, e.g., support network devices on <a href=\"https://packet.net\">packet.net</a>,\nplease <a href=\"mailto:mort@cantab.net\">get in touch</a>, file an issue or send a pull\nrequest!</p>", 8 "content": "<p>As some may know, following the <a href=\"https://unikernels.com\">Unikernel Systems</a> acquisition, I\ncurrently do contract work for <a href=\"https://docker.com\">Docker Inc.</a> in addition to my day job\nhere at the <a href=\"https://www.cl.cam.ac.uk\">Cambridge University Computer Laboratory</a>. Recently this has\ncentred on <a href=\"https://github.com/linuxkit/linuxkit\">LinuxKit</a>, “<em>A toolkit for building secure, portable and lean\noperating systems for containers</em>” and, specifically, enabling ARM64 support.\nI’m pleased to say that a basic proof-of-concept is now complete, and we’re\nworking towards getting support merged upstream.</p>\n<p>The proof-of-concept was developed using the great ARM64 support provided\nby <a href=\"https://packet.net\"><code>packet.net</code></a>, on one of their <code>type 2A</code> boxes.</p>\n<p>If you fancy trying it out, then hopefully the following instructions will be of\nuse – or just bug me on the <a href=\"https://slack.packet.net/\"><code>packet.net</code> Slack</a>!</p>\n<h2><a href=\"https://mort.io/blog/arming-linuxkit/#building\">Building</a></h2>\n<p>Start by getting an ARM64 box setup. If you have one to hand, great! If not, you\ncould head over to <a href=\"https://packet.net\">packet.net</a> and create type 2A Ubuntu box to use as a build\nenvironment.</p>\n<p>Then clone the source, either <code>git clone</code> <a href=\"https://github.com/mor1/linuxkit/tree/project-arm64\">my dev branch</a>, or\nsee <a href=\"https://github.com/linuxkit/linuxkit/pull/1654\">https://github.com/linuxkit/linuxkit/pull/1654</a> for the open PR which may\nbe a bit more stable.</p>\n<p>The essence of it then is to build the containers based off <code>aarch64/alpine</code>,\nalong with an ARM64 version of the <a href=\"https://github.com/moby/moby\"><code>moby</code> CLI</a> if needed. Specifying the\ncontainer images you just built in your <code>moby.yml</code> file will then cause <code>moby</code>\nto assemble things that should boot on ARM64.</p>\n<p>The output should be a gzipped kernel, currently slightly misleadingly named\n<code>bzImage</code> as well as a suitable <code>initrd</code>.</p>\n<h2><a href=\"https://mort.io/blog/arming-linuxkit/#booting\">Booting</a></h2>\n<p>Setup another ARM64 box on which to boot the results. You could setup a\ntype 2A <a href=\"https://packet.net\">packet.net</a> box once more, but this time set it to <em>custom OS</em> and\n<em>iPXE boot</em>. For the iPXE boot URL, give a URL pointing to a suitable boot\nfile. I use:</p>\n<pre><code><span><span><span>#</span></span><span>!ipxe</span><span>\n</span></span><span><span><span>set</span></span><span> base-url URL-TO-DIRECTORY-HOLDING-IMAGES</span>\n</span><span><span><span>set</span></span><span> kernel-params ip=dhcp nomodeset ro serial console=ttyAMA0,115200 earlycon earlyprintk=serial,keep initrd=arm64-initrd.img</span>\n</span><span><span><span>initrd</span></span><span> <span><span>$</span><span>{</span></span><span><span>base</span></span><span><span>-</span></span><span>url</span><span><span>}</span></span>/arm64-initrd.img</span>\n</span><span><span><span>imgstat</span></span>\n</span><span><span><span>boot</span></span><span> <span><span>$</span><span>{</span></span><span><span>base</span></span><span><span>-</span></span><span>url</span><span><span>}</span></span>/arm64-bzImage <span><span>$</span><span>{</span></span><span><span>kernel</span></span><span><span>-</span></span><span>params</span><span><span>}</span></span></span>\n</span></code></pre>\n<p>Note that, currently at least, the <a href=\"https://packet.net\">packet.net</a> iPXE boot only occurs on the\nfirst boot as it is assumed that the iPXE boot will install a working image to\nthe local disk. Thus, if it doesn’t work first time, get an SOS console and\nbreak in by hitting <code>^B</code> at the appropriate moment, before issuing <code>chain URL</code>\nwhere <code>URL</code> points to your iPXE boot file.</p>\n<h2><a href=\"https://mort.io/blog/arming-linuxkit/#conclusion\">Conclusion</a></h2>\n<p>This just does the barest minimum for now – I did say it was a\nproof-of-concept… :) Work is currently ongoing to upstream this rather than\ndeveloping this PoC further, but if anyone has a particular interest or would\nlike to provide patches to, e.g., support network devices on <a href=\"https://packet.net\">packet.net</a>,\nplease <a href=\"mailto:mort@cantab.net\">get in touch</a>, file an issue or send a pull\nrequest!</p>", 9 "content_type": "html", 10 "author": { 11 "name": "Unknown", 12 "email": null, 13 "uri": null 14 }, 15 "categories": [], 16 "source": "https://mort.io/atom.xml" 17}