Butterknife server at {{ request.host }}

What is this?

You've stumbled upon Butterknife server instance, some cool people are hosting Linux-based operating system templates here as Btrfs snapshots and you can deploy those templates on your hardware.

How to use it?

You are reccommended to boot Butterknife provisioning image either from PXE or from memory stick. Additionally we've included a code snippet below which can be used to bootstrap machine using LiveCD or even from working system.

1a Butterknife provisioning from memory stick

Download ISO file and write it on a memory stick

wget -c https://github.com/v6sa/butterknife/raw/master/butterknife-i386.iso
sudo dd if=butterknife-i386.iso of=/dev/sdx # Where sdx corresponds to your USB key

In case you wish to deploy 64-bit templates or running on 64-bit capable hardware use following image instead:

wget -c https://github.com/v6sa/butterknife/raw/master/butterknife-amd64.iso
sudo dd if=butterknife-amd64.iso of=/dev/sdx

Windows users may want to give Rufus a try.

1b Butterknife provisioning from PXE

Set up TFTP server to serve Butterknife provisioning image on your LAN segment, replicate the directory structure from GitHub repository to TFTP server root and adjust pxelinux.cfg/default.

2 Boot the machine

Boot the machine either from PXE, memory stick or CD. Refer to your motherboard manual for temporary boot device. Note that currently Butterknife supports legacy boot methods only, hence make sure you have turned (U)EFI and secure boot off.

3 Follow instructions on the screen

Make sure you're connected to a DHCP-enabled router via ethernet cable and wait for Butterknife provisioning image to boot up. Once you've landed at following screen, you're almost done, just follow instructions of the screen:

Butterknife wipes the harddisk, creates a Btrfs filesystem and downloads the snapshot to newly created filesystem by default. There are options to use unpartitioned disk space, reformat a partition, resize NTFS filesystem and even receive into existing Btrfs filesystem. Once the snapshot is downloaded you can join the machine to an Active Directory compatible domain or create a local user account. Finally post installation scripts reconfigure bootloader and if you're lucky enough you're greeted with a shiny Linux OS deployment.

Deploying from generic LiveCD or memory stick

As an alternative or for experimentation you may use following commands on your machine to download a snapshot and set up the bootloader. This assumes you're running the target machine off eg Ubuntu LiveCD or you want to convert your current workstation:

# Determine first Btrfs filesystem
UUID=$(blkid -s UUID -l -t TYPE=btrfs -o value)

# Create directories
mkdir -p /mnt/target/ /var/butterknife/pool/

# Mount subvolumes
mount UUID=$UUID -o subvol=/ /var/butterknife/pool
mount UUID=$UUID -o subvol=$SUBVOLUME /mnt/target

# Download and apply snapshot
curl {{ request.uri }}SELECT-SNAPSHOT-BELOW \
 | btrfs receive /var/butterknife/pool

# Mountpoints for chroot
mount --bind /sys /mnt/target/sys/
mount --bind /proc /mnt/target/proc/
mount --bind /dev /mnt/target/dev/
mount --bind /dev /mnt/target/dev/pts/

# Run post-deploy scripts
chroot /mnt/target/ /usr/bin/butterknife-postdeploy

# Unmount filesystems
umount /mnt/target/dev/pts/
umount /mnt/target/dev/
umount /mnt/target/proc/
umount /mnt/target/sys/
umount /mnt/target/
umount /var/butterknife/pool/

# Reboot machine
reboot

Run downstream server

In case you want to run downstream Butterknife server with snapshots on this machine you can use butterknife pull feature, but first install Butterknife:

pip3 install butterknife

Pull the snapshots from this server:

butterknife pull {{request.uri}}

Run downstream server:

butterknife serve

This of course assumes you're running on top of Btrfs filesystem and your Btrfs utilities are up-to-date.

Available snapshots

Following snapshots are available on this server, use butterknife pull to download the snapshots to your local server as described above or use Butterknife provisioning image to deploy the templates.

{% for subvolume in subvolumes %} {% endfor %}
Namespace Identifier Architecture Version
{{subvolume.namespace}} {{subvolume.identifier}} {{subvolume.architecture}} {{subvolume.version}}