Andrew's blog (Entries tagged as debian)https://cerberus.etc.gen.nz/
This is a blog, it is it is.enSerendipity 2.1.4 - http://www.s9y.org/Sun, 19 Apr 2020 21:47:27 GMThttps://cerberus.etc.gen.nz/templates/2k11/img/s9y_banner_small.pngRSS: Andrew's blog - This is a blog, it is it is.https://cerberus.etc.gen.nz/
10021Install Fedora CoreOS using FAIhttps://cerberus.etc.gen.nz/archives/134-Install-Fedora-CoreOS-using-FAI.html
https://cerberus.etc.gen.nz/archives/134-Install-Fedora-CoreOS-using-FAI.html#commentshttps://cerberus.etc.gen.nz/wfwcomment.php?cid=1340https://cerberus.etc.gen.nz/rss.php?version=2.0&type=comments&cid=134andrew@etc.gen.nz (Andrew Ruthven)
<p>I've spent the last couple of days trying to deploy <a onclick="_gaq.push(['_trackPageview', '/extlink/getfedora.org/en/coreos/']);" href="https://getfedora.org/en/coreos/">Fedora CoreOS</a> to some <a onclick="_gaq.push(['_trackPageview', '/extlink/docs.fedoraproject.org/en-US/fedora-coreos/bare-metal/']);" href="https://docs.fedoraproject.org/en-US/fedora-coreos/bare-metal/">physical hardware/bare metal</a> for a colleague using the official PXE installer from Fedora CoreOS. It wasn't very pleasant, and just wouldn't work reliably.</p>
<p>Maybe my expectations were to high, in that I thought I could use Ignition to prepare more of the system for me, as my colleague has been able to bare metal installs correctly. I just tried to use Ignition as documented.</p>
<p>A few interesting aspects I encountered:
<ol>
<li>The PXE installer for it has a 618MB initrd file. This takes quite a while to transfer via tftp!</li>
<li>It can't build software RAID for the main install device (and the developers have no intention of adding this), and it seems very finicky to build other RAID sets for other partitions.</li>
<li>And, well, I just kept having problems where the built systems would hang during boot for no obvious reason.</li>
<li>The time to do an installation was incredibly long.</li>
<li>The initrd image is really just running coreos-installer against the nominated device.</li>
</ol>
</p>
<p>During the night I got feed up with that process and wrote a <a onclick="_gaq.push(['_trackPageview', '/extlink/fai-project.org']);" href="https://fai-project.org">Fully Automatic Installer</a> (FAI) profile that'd install CoreOS instead. I can now use setup-storage from FAI using it's standard disk_config files. This allows me to build complicated disk configurations with software RAID and LVM easily.</p>
<p>A big bonus is that a rebuild is a <b>lot</b> faster, timed from typing reboot to a fresh login prompt is 10 minutes - and this is on physical hardware so includes BIOS POST and RAID controller set up, twice each.</p>
<p>I thought this might be of interest to other people, so the FAI profile I developed for this is located here: <a onclick="_gaq.push(['_trackPageview', '/extlink/github.com/catalyst-cloud/fai-profile-fedora-coreos']);" href="https://github.com/catalyst-cloud/fai-profile-fedora-coreos">https://github.com/catalyst-cloud/fai-profile-fedora-coreos</a></p>
<p>FAI was initially developed to deploy Debian systems, it has since been extended to be able to install a number of other operating systems, however I think this is a good example of how easy it is to deploy non-Debian derived operating systems using FAI without having to modify FAI itself.</p>
Sun, 19 Apr 2020 18:43:00 +1200https://cerberus.etc.gen.nz/archives/134-guid.htmldebianfaifedora_coreosgeekNetwork boot a Raspberry Pi 3https://cerberus.etc.gen.nz/archives/131-Network-boot-a-Raspberry-Pi-3.html
catalysthttps://cerberus.etc.gen.nz/archives/131-Network-boot-a-Raspberry-Pi-3.html#commentshttps://cerberus.etc.gen.nz/wfwcomment.php?cid=1310https://cerberus.etc.gen.nz/rss.php?version=2.0&type=comments&cid=131andrew@etc.gen.nz (Andrew Ruthven)
<p>I found to make all this work I had to piece together a bunch of information from different locations. This fills in some of the blanks from the official Raspberry Pi documentation. See <a onclick="_gaq.push(['_trackPageview', '/extlink/www.raspberrypi.org/documentation/hardware/raspberrypi/bootmodes/net.md']);" href="https://www.raspberrypi.org/documentation/hardware/raspberrypi/bootmodes/net.md">here</a>, <a onclick="_gaq.push(['_trackPageview', '/extlink/www.raspberrypi.org/blog/pi-3-booting-part-ii-ethernet-all-the-awesome/']);" href="https://www.raspberrypi.org/blog/pi-3-booting-part-ii-ethernet-all-the-awesome/">here</a>, and <a onclick="_gaq.push(['_trackPageview', '/extlink/www.raspberrypi.org/documentation/hardware/raspberrypi/bootmodes/net_tutorial.md']);" href="https://www.raspberrypi.org/documentation/hardware/raspberrypi/bootmodes/net_tutorial.md">here</a>.<p>
<p><b>Image</b></p>
<p>Download the latest raspbian image from <a onclick="_gaq.push(['_trackPageview', '/extlink/www.raspberrypi.org/downloads/raspbian/']);" href="https://www.raspberrypi.org/downloads/raspbian/">https://www.raspberrypi.org/downloads/raspbian/</a> and unzip it. I used the lite version as I'll install only what I need later.</p>
<p>To extract the files from the image we need to jump through some hoops. Inside the image are two partitions, we need data from each one.</p>
<pre>
# Make it easier to re-use these instructions by using a variable
IMG=2017-04-10-raspbian-jessie-lite.img
fdisk -l $IMG
</pre>
<p>You should see some output like:</p>
<pre>
Disk 2017-04-10-raspbian-jessie-lite.img: 1.2 GiB, 1297862656 bytes, 2534888 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x84fa8189
Device Boot Start End Sectors Size Id Type
2017-04-10-raspbian-jessie-lite.img1 8192 92159 83968 41M c W95 FAT32 (LBA)
2017-04-10-raspbian-jessie-lite.img2 92160 2534887 2442728 1.2G 83 Linux
</pre>
<p>You need to be able to mount both the boot and the root partitions. Do this by tracking the offset of each one and multiplying it by the sector size, which is given on the line saying "Sector size" (typically 512 bytes), for example with the 2017-04-01 image, boot has an offset of 8192, so I mount it like this (it is VFAT):</p>
<pre>
mount -v -o offset=$((8192 * 512)) -t vfat $IMG /mnt
# I then copy the data off:
mkdir -p /data/diskless/raspbian-lite-base-boot/
rsync -xa /mnt/ /data/diskless/raspbian-lite-base-boot/
# unmount the partition now:
umount /mnt
</pre>
<p>Then we do the same for the root partition:</p>
<pre>
mount -v -o offset=$((92160 * 512)) -t ext4 $IMG /mnt
# copy the data off:
mkdir -p /data/diskless/raspbian-lite-base-root/
rsync -xa /mnt/ /data/diskless/raspbian-lite-base-root/
# umount the partition now:
umount /mnt
</pre>
<p><b>DHCP</b></p>
<p>When I first set this up, I used <a onclick="_gaq.push(['_trackPageview', '/extlink/openwrt.org']);" href="http://openwrt.org">OpenWRT</a> on my router, and I had to patch <tt>/etc/init/dnsmasq</tt> to support setting DHCP option 43. As of the writting of this article, a similar patch has been merged, but isn't in a release yet, and, well, there may never be another release of OpenWRT. I'm now running <a onclick="_gaq.push(['_trackPageview', '/extlink/lede-project.org/']);" href="https://lede-project.org/">LEDE</a>, and the the good news is it already has the patch merged (hurrah!). If you're still on OpenWRT, then here's the patch you'll need:</p>
<p><a onclick="_gaq.push(['_trackPageview', '/extlink/git.lede-project.org/?p=source.git;a=commit;h=9412fc294995ae2543fabf84d2ce39a80bfb3bd6']);" href="https://git.lede-project.org/?p=source.git;a=commit;h=9412fc294995ae2543fabf84d2ce39a80bfb3bd6">
https://git.lede-project.org/?p=source.git;a=commit;h=9412fc294995ae2543fabf84d2ce39a80bfb3bd6</a></p>
<p>This lets you put the following in <tt>/etc/config/dnsmasq</tt>, this says that any device that uses DHCP and has a MAC issued by the Raspberry PI Foundation, should have option 66 (boot server) and option 43 set as specified. Set the IP address on option 66 to the device that should be used for tftp on your network, if it's the same device that provides DHCP then it isn't required. I had to set the boot server, as my other network boot devices are using a different server (with an older tftpd-hpa, I explain the problem further down).</p>
<pre>
config mac 'rasperrypi'
option mac 'b8:27:eb:*:*:*'
option networkid 'rasperrypi'
list dhcp_option '66,10.1.0.253'
list dhcp_option '43,Raspberry Pi Boot'
</pre>
<p><b>tftp</b></p>
<p>Initially I used a version of tftpd that was too old and didn't support how the RPi tried to discover if it should use the serial number based naming scheme. The version of tftpd-hpa Debian Jessie works just fine. To find out the serial number you'll probably need to increase the logging of tftpd-hpa, do so by editing <tt>/etc/default/tftpd-hpa</tt> and adding "-v" to the <tt>TFTP_OPTIONS</tt> option. It can also be useful to watch tcpdump to see the requests and responses, for example (10.1.0.203 is the IP of the RPi I'm working with):</p>
<pre>
tcpdump -n -i eth0 host 10.1.0.203 and dst port 69
</pre>
<p>This was able to tell me the serial number of my RPi, so I made a directory in my tftpboot directory with the same serial number and copied all the boot files into there. I then found that I had to remove the init= portion from the cmdline.txt file I'm using. To ease debugging I also removed quiet. So, my current cmdline.txt contains (newlines entered for clarity, but the file has it all on one line):</p>
<pre>
idwc_otg.lpm_enable=0 console=serial0,115200 console=tty1 root=/dev/nfs
nfsroot=10.1.0.253:/data/diskless/raspbian-lite-base-root,vers=3,rsize=1462,wsize=1462
ip=dhcp elevator=deadline rootwait hostname=rpi.etc.gen.nz
</pre>
<p><b>NFS root</b></p>
<p>You'll need to export the directories you created via NFS. My exports file has these lines:</p>
<pre>
/data/diskless/raspbian-lite-base-root 10.1.0.0/24(rw,no_root_squash,sync,no_subtree_check)
/data/diskless/raspbian-lite-base-boot 10.1.0.0/24(rw,no_root_squash,sync,no_subtree_check)
</pre>
<p>And you'll also want to make sure you're mounting those correctly during boot, so I have in <tt>/data/diskless/raspbian-lite-base-root/etc/fstab</tt> the following lines:
<pre>
10.1.0.253:/data/diskless/raspbian-lite-base-root / nfs rw,vers=3 0 0
10.1.0.253:/data/diskless/raspbian-lite-base-boot /boot nfs vers=3,nolock 0 2
</pre>
<p><b>Network Booting</b></p>
<p>Now you can hopefully boot. Unless you into this <a onclick="_gaq.push(['_trackPageview', '/extlink/github.com/raspberrypi/firmware/issues/764']);" href="https://github.com/raspberrypi/firmware/issues/764">bug</a>, as I did. Where the RPi will sometimes fail to boot. Turns out the fix, which is mentioned on the bug report, is to put bootcode.bin (and only bootcode.bin) onto an SD card. That'll then load the fixed bootcode, and which will then boot reliably.</p>
Sat, 02 Sep 2017 23:31:00 +1200https://cerberus.etc.gen.nz/archives/131-guid.htmlcatalystdebiangeekhardwarerpiLCA2015 - Debian Miniconf & nz2015 Debian mini-DebConfhttps://cerberus.etc.gen.nz/archives/127-LCA2015-Debian-Miniconf-nz2015-Debian-mini-DebConf.html
catalystfamilyhttps://cerberus.etc.gen.nz/archives/127-LCA2015-Debian-Miniconf-nz2015-Debian-mini-DebConf.html#commentshttps://cerberus.etc.gen.nz/wfwcomment.php?cid=1270https://cerberus.etc.gen.nz/rss.php?version=2.0&type=comments&cid=127andrew@etc.gen.nz (Andrew Ruthven)
<strong>nz2015 mini-DebConf</strong><br />
<br />
Already attending <a onclick="_gaq.push(['_trackPageview', '/extlink/lca2015.linux.org.au']);" href="http://lca2015.linux.org.au">linux.conf.au</a>? Come a couple of days earlier and attend the mini-DebConf too! There will be a day of talks with a strong focus on the Debian project and a bug squashing day.<br />
<br />
<strong>Debian Miniconf</strong><br />
<br />
After 5 years, the Debian Miniconf is back! Run as part of linux.conf.au 2015, this event will attract speakers talking on topics that suit the broader audience attending LCA. The Debian Miniconf has been one of the largest miniconfs in the history of linux.conf.au.<br />
<br />
For more information about both these events which I'm organising, head over to: <a onclick="_gaq.push(['_trackPageview', '/extlink/nz2015.mini.debconf.org']);" href="http://nz2015.mini.debconf.org">nz2015.mini.debconf.org</a>!
Tue, 02 Dec 2014 13:08:13 +1300https://cerberus.etc.gen.nz/archives/127-guid.htmlcatalystdebianfamilylca2015linux.conf.auLCA2015 - Debian Miniconf submittedhttps://cerberus.etc.gen.nz/archives/125-LCA2015-Debian-Miniconf-submitted.html
catalystfamilyhttps://cerberus.etc.gen.nz/archives/125-LCA2015-Debian-Miniconf-submitted.html#commentshttps://cerberus.etc.gen.nz/wfwcomment.php?cid=1250https://cerberus.etc.gen.nz/rss.php?version=2.0&type=comments&cid=125andrew@etc.gen.nz (Andrew Ruthven)
Phew, I've submitted a proposal to run a <a onclick="_gaq.push(['_trackPageview', '/extlink/www.debian.org']);" href="http://www.debian.org">Debian</a> Miniconf at <a onclick="_gaq.push(['_trackPageview', '/extlink/lca2015.linux.org.au/']);" href="http://lca2015.linux.org.au/">linux.conf.au 2015</a> here's hoping that it is accepted!<br />
<br />
The Debian Miniconf was held in 2008 in <a onclick="_gaq.push(['_trackPageview', '/extlink/lca2008.linux.org.au']);" href="http://lca2008.linux.org.au">Melbourne</a>, so I feel it is well overdue to run it again.
Fri, 11 Jul 2014 09:43:25 +1200https://cerberus.etc.gen.nz/archives/125-guid.htmlcatalystdebianfamilygeeklcalca2015linux.conf.auDebian Maintainerhttps://cerberus.etc.gen.nz/archives/82-Debian-Maintainer.html
catalysthttps://cerberus.etc.gen.nz/archives/82-Debian-Maintainer.html#commentshttps://cerberus.etc.gen.nz/wfwcomment.php?cid=820https://cerberus.etc.gen.nz/rss.php?version=2.0&type=comments&cid=82andrew@etc.gen.nz (Andrew Ruthven)
Well, as of debian-maintainers version 1.39 (uploaded on 2008-07-08) I'm now a Debian Maintainer.<br />
<br />
w00t!<br />
<br />
Francois will upload a new version of <a onclick="_gaq.push(['_trackPageview', '/extlink/www.etc.gen.nz/projects/mythtv/mythtv-status.html']);" href="http://www.etc.gen.nz/projects/mythtv/mythtv-status.html">MythTV Status</a> soonish which amongst other things adds the magic fu required to allow me to upload it directly. Oh, and I've changed MythTV Status to be GPLv3.<br />
<br />
More w00t!
Tue, 22 Jul 2008 12:49:07 +1200https://cerberus.etc.gen.nz/archives/82-guid.htmlcatalystdebiangeekmythtvmythtv-status(almost) Whole House Audiohttps://cerberus.etc.gen.nz/archives/62-almost-Whole-House-Audio.html
catalysthousehttps://cerberus.etc.gen.nz/archives/62-almost-Whole-House-Audio.html#commentshttps://cerberus.etc.gen.nz/wfwcomment.php?cid=620https://cerberus.etc.gen.nz/rss.php?version=2.0&type=comments&cid=62andrew@etc.gen.nz (Andrew Ruthven)
In our house we have a server that does a number of tasks, one of which is playing a jukebox (using <a onclick="_gaq.push(['_trackPageview', '/extlink/www.musicpd.org/']);" href="http://www.musicpd.org/">MusicPD</a>) it is hooked up to an amp that has speakers in our study and in our family room. This rocks, turn on the amp, have continuous music that we want to listen to and no chatter.<br />
<br />
Unfortunately this doesn't extend to the lounge. Which means that if you sit in the lounge you can only just hear the music (unless you turn it up too loud). I've thought off and on (mostly off) about extending the jukebox to the lounge, the other week Susanne asked about having this, which meant it was finally time for me to really look into possible solutions.<br />
<br />
Warning, geeky bits follow...<br />
<br />
Since we used to use Icecast2 to stream the jukebox to Susanne's computer in our old flat I tried that first. We have a PC in the lounge that is a <a onclick="_gaq.push(['_trackPageview', '/extlink/www.mythtv.org']);" href="http://www.mythtv.org">MythTV</a> frontend that we could play the stream on, so that aspect is covered. Unfortunately the 5 second lag which was acceptable when Susanne's computer was a long way away from the main jukebox in our old flat was too annoying when the speakers were only a room apart (yes, I could have reduced the buffers, but it would never have been quite right). <br />
<br />
So fall back to plan B, stick another soundcard in the jukebox computer and run line level audio to the amp in the lounge. We managed to dig up an old soundcard in the good junk pile (every geek should have a good junk pile), stuck it in the computer and then proceeded to try and configure ALSA to drive it. The plan was to duplicate the same audio stream out to both soundcards. After a bit of researching and a bit of tinkering with <tt>asound.conf</tt> and it not working I decided not to waste any more time on that path.<br />
<br />
I vaguely recalled that <a onclick="_gaq.push(['_trackPageview', '/extlink/www.pulseaudio.org']);" href="http://www.pulseaudio.org">PulseAudio</a> was incredibly flexible and allowed all sorts of things. A quick <tt>apt-get install pulseaudio pulseaudio-module-hal</tt> and bit of reading, and I found that adding the following line to <tt>/etc/pulse/default.pa</tt>:<br />
<br />
<tt>load-module module-combine master=&lt;sound card 1&gt; slaves=&lt;sound card 2&gt; set-default-sink combined</tt><br />
<br />
Would create a new virtual soundcard output (PulseAudio refers to this as a sink) called "combined" that would replicate the audio to both soundcards. Awesome. (The master and slaves settings were determed by using <tt>paman</tt> to inspect the PulseAudio devices.)<br />
<br />
Then after recompiling MusicPD (to add PulseAudio support, the version in Debian unstable already has it, but stable doesn't), telling it to use that sink and voila, both soundcards are playing the jukebox.<br />
<br />
To actually get the line level audio to the lounge I've used some Cat5 we already have running there (with suitable audio flyleads) and we have the jukebox playing in the lounge, in sync with the family room. The sound quality is pretty good, so I won't worry about balanced audio or anything else fancy like that. Gotta love structured cabling.<br />
<br />
Another benefit of PulseAudio is we will be able to configure our Linux workstations to use the jukebox soundcards as audio sinks as well, which will mean no more tinny little monitor speakers. w00t!<br />
<br />
<b>Update:</b> Say which file to add the load-module line to, and fix a typo.
Mon, 09 Jul 2007 09:25:07 +1200https://cerberus.etc.gen.nz/archives/62-guid.htmlaudiocatalystdebiangeekhouseDebian Etch released!https://cerberus.etc.gen.nz/archives/45-Debian-Etch-released!.html
catalysthttps://cerberus.etc.gen.nz/archives/45-Debian-Etch-released!.html#commentshttps://cerberus.etc.gen.nz/wfwcomment.php?cid=450https://cerberus.etc.gen.nz/rss.php?version=2.0&type=comments&cid=45andrew@etc.gen.nz (Andrew Ruthven)
w00t!<br />
<br />
<a onclick="_gaq.push(['_trackPageview', '/extlink/www.debian.org']);" href="http://www.debian.org">Debian</a> Etch is <a onclick="_gaq.push(['_trackPageview', '/extlink/lists.debian.org/debian-announce/debian-announce-2007/msg00002.html']);" href="http://lists.debian.org/debian-announce/debian-announce-2007/msg00002.html">released</a>!<br />
<br />
Now it is time to perform the ritual upgrade dance on a bunch of machines that weren't already running Etch while it was the testing distribution. And also I'll need to decide if the boxes that were already running it should move to lenny (which will is the name for the next stable release). I think I'll defer that decision a few months though...
Mon, 09 Apr 2007 17:39:52 +1200https://cerberus.etc.gen.nz/archives/45-guid.htmldebiangeekoss