Skip to content

Instantly share code, notes, and snippets.

@papertigers
papertigers / downstack.d
Created January 26, 2022 02:53
illumos downstack
#!/usr/sbin/dtrace -FCs
$1:entry
{
stack();
self->trace = 1;
}
$1:return
/self->trace == 1/
@papertigers
papertigers / README.md
Created May 5, 2020 03:45 — forked from mgerdts/README.md
Install windows with bhyve

These are bare-bones instructions for creating a Windows image for bhyve on SmartOS. You will need a platform image that has the fix for OS-7117. Platform images that I've used in testing are here: iso tgz usb

Create a volume that will be the disk.

zfs create -o volblocksize=4k -V 16g -s zones/hdd-windows

This script will be used for booting from the CD.

@papertigers
papertigers / cpu.sh
Created October 31, 2019 20:33
Triton CPU usage
#!/bin/bash
#
# Print CPU Subscription % for all Servers
#
# Sorting
# Default - hostname
# -p - Subscription %
SORT="+1"
> fffffe3640df1470::walk thread | ::findstack -v
stack pointer for thread fffffdc9d72c7000 (bhyve/3 [blk-4:0-1]): fffffb0465436990
fffffb0465436a00 apix_hilevel_intr_prolog+0x87(fffffdc5200e3000, f, 0, fffffb0465436a70)
fffffb0465436a60 apix_do_interrupt+0x119(fffffb0465436a70, 0)
fffffb0465436a70 _interrupt+0xba()
fffffb0465436b80 default_lock_delay+0x4e(1400)
fffffb0465436bf0 mutex_vector_enter+0xc5(fffffdc508c6dd00)
fffffb0465436ca0 issig_forreal+0x3f()
fffffb0465436cc0 issig+0x25(0)
fffffb0465436d50 cv_wait_sig_swap_core+0x2fb(fffffdc9d72c71ee, fffffdc9d72c71f0, 0)
@papertigers
papertigers / guide.md
Last active October 30, 2019 12:26
bhyve mask viona features

Hiding viona guest checksumming

This is a "workaround" until the bhyve_config stuff is done.

Modified bhyve brand boot

You need to build a platform with this patch. If you are feeling lazy you can grab the binary of that file here.

Mount the file

@papertigers
papertigers / bhyve-boot.patch
Created July 25, 2019 16:29
Patch that allows setting the viona feature mask
diff --git a/usr/src/lib/brand/bhyve/zone/boot.c b/usr/src/lib/brand/bhyve/zone/boot.c
index 6e6f3dc640..e1c063d87e 100644
--- a/usr/src/lib/brand/bhyve/zone/boot.c
+++ b/usr/src/lib/brand/bhyve/zone/boot.c
@@ -82,6 +82,23 @@ get_zcfg_var(const char *rsrc, const char *inst, const char *prop)
return (ret);
}
+static long
+viona_feature_mask(const char *inst)
@papertigers
papertigers / how-to.md
Last active November 15, 2023 00:22
illumos boringtun (wireguard) guide

This port of boringtun works on any illumos box that has the tuntap device. SmartOS comes with this device by deafult. You can install this device on OmniOS by running pkg install tuntap. Currently the userland daemon will drop as many privileges(5) as it can after setting up the tunnel etc. The daemon is also currently using epoll/signalfd unil I find time to wire up the event port interface.

Clone the following repo and checkout the illumos branch.

git clone git@github.com:papertigers/boringtun.git
@papertigers
papertigers / Cargo.toml.patch
Created April 12, 2019 05:54
illumos build fd-find
diff --git a/Cargo.toml b/Cargo.toml
index 11ec364..2a0d20e 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -59,3 +59,7 @@ filetime = "0.2.1"
[profile.release]
lto = true
codegen-units = 1
+
+[patch.crates-io]
@papertigers
papertigers / playground.rs
Created April 8, 2019 14:36 — forked from rust-play/playground.rs
Code shared from the Rust Playground
use std::net::{self, AddrParseError, IpAddr, SocketAddr};
use std::str::FromStr;
#[derive(Debug)]
struct Endpoint {
addr: SocketAddr,
}
impl Endpoint {
fn new<S: Into<SocketAddr>>(s: S) -> Self {
@papertigers
papertigers / trunk-images.md
Created January 3, 2019 23:25 — forked from jperkin/trunk-images.md
Test pkgsrc trunk bootstraps and images

pkgsrc trunk packages and images

Now that pkgin has refresh support and the macOS trunk builds have proven that a rolling trunk release works well, I am happy to make SmartOS/illumos trunk packages and images available again for testing.

These are rolling builds of pkgsrc trunk every day (or so), providing the latest packages without having to upgrade across quarterly releases. Just install once then pkgin full-upgrade to keep up-to-date.

This is primarily of interest to:

  • Users who just want the latest software.
  • Users who don't want to bother with having to upgrade releases every quarter.