Skip to content

Instantly share code, notes, and snippets.

View mgerdts's full-sized avatar

Mike Gerdts mgerdts

View GitHub Profile
@mgerdts
mgerdts / README.md
Last active June 21, 2019 21:42
illumos-9318

Overview

This fixes

9318 vol_volsize_to_reservation does not account for raidz skip blocks

$ git whatchanged -v master..
commit 969a6b100f3e67c3a623d898c3825506f1a40b49
Author: Mike Gerdts <mike.gerdts@joyent.com>

This is for the initial round of review of link-local route support for LX ....

$ bldenv illumos.sh "cstyle /tmp/lxinit.c"
Build type   is  non-DEBUG
RELEASE      is
VERSION      is joyent_20190713T171701Z
RELEASE_DATE is July 2019

The top-level 'setup' target is available to build headers and tools.
@mgerdts
mgerdts / illumos.sh.md
Created July 17, 2019 12:51
build failure

This is has the OmniOS variables from Building Illumos at the end.

# -----------------------------------------------------------------------------
# Parameters you are likely to want to change
# -----------------------------------------------------------------------------

#       DEBUG build only (-D, -F)
#       do not bringover from the parent (-n)
#       runs 'make check' (-C)
@mgerdts
mgerdts / Makefile
Last active July 18, 2019 13:48
can make handle % in file names?
THINGS = foo%bar foo.bar
SRCS = $(THINGS:%=src/%)
OBJS = $(THINGS:%=obj/%)
install: $(OBJS)
obj/%: src/%
@echo Making $@ from $<
rm -f $@
@mgerdts
mgerdts / README.md
Created July 18, 2019 20:50
create ubuntu 18.04 20190627 bhyve instance
[root@raidz /zones]# ssh-keygen -t rsa -P "" -f id_rsa
Generating public/private rsa key pair.
Your identification has been saved in id_rsa.
Your public key has been saved in id_rsa.pub.
The key fingerprint is:
MD5:58:e7:5e:2e:a5:05:95:58:da:97:06:f8:5f:60:b8:c4 root@raidz
The key's randomart image is:
+---[RSA 2048]----+
|           =+o   |
@mgerdts
mgerdts / README.md
Created July 26, 2019 21:48
SmartLogin work-alike for bhyve, kvm, and lx

SmartLogin only works with SmartOS zones. Control of key-based access to bhyve, kvm, and lx isntances can be accomplished using OpenSSH's authorized keys command to fetch authorized keys from the metadata service.

Guest Setup

The guest OS needs to have the following added to {{/etc/ssh/sshd_config}}.

AuthorizedKeysCommand /usr/sbin/mdata-get "%u_authorized_keys"
AuthorizedKeysCommandUser mdataget
@mgerdts
mgerdts / README.md
Last active August 8, 2019 17:27
boot modules in Triton

It seems that there should be a way to do this with sdc-cnapi. I've not had luck in getting any updates to flow from sdc-cnapi to booter, so I tried another approach.

root@headnode# sdc-login dhcpd
...
root@dhcpd0 ~ # cd /tftpboot/00505634604c
root@dhcpd0 /tftpboot/00505634604c # mkdir etc
root@dhcpd0 /tftpboot/00505634604c # cd etc
root@dhcpd0 /tftpboot/00505634604c/etc # echo "this is a test file" > testfile
root@dhcpd0 /tftpboot/00505634604c/etc # digest -a sha1 testfile > testfile.hash
@mgerdts
mgerdts / README.md
Created October 18, 2019 11:56
Triton on Linux KVM

Triton on Linux KVM

I have a beefy Linux box that I use for development. One of the things this box does is run KVM instances that run a Triton headnode and several compute nodes.

Configuration

Networking

I have a single gigabit link to the outside world. All networks are able to reach the outside world via NAT.

@mgerdts
mgerdts / README.md
Last active December 6, 2019 14:54
ipxe silently truncates boot module arguments

When SmartOS is pxe booted in a Triton cloud, the kernel args are on the order of 200 bytes, there is a kernel, a ramdisk, and at least one other boot module. This does not fit in 512 bytes and multiboot.c silently truncates the url to the boot module and does not have any space for the name of the boot module. If a system is booted with a non-Joyent ipxe, this means that the SmartOS instance cannot find the boot module.

This probblem was recognized and fixed many years ago and Joyent fixed it in our fork of ipxe. Can this be included upstream so that boot modules are more useful?

Related tickets I've filed at Joyent are:

  • OS-3770 ipxe silently truncates boot module arguments
  • OS-8062 boot modules appear at wrong path (I think I got the buffer details wrong in that ticket,
@mgerdts
mgerdts / lvn.md
Created December 9, 2019 20:42 — forked from mtds/lvn.md
Linux Virtual Networking

Virtual Networking on Linux

In the Linux Kernel, support for networking hardware and the methods to interact with these devices is standardized by the socket API:

                +----------------+
                |   Socket API   |
                +-------+--------+
                        |
User space              |