Skip to content

Instantly share code, notes, and snippets.

👍
LGTM

Colin Walters cgwalters

👍
LGTM
Block or report user

Report or block cgwalters

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@cgwalters
cgwalters / cosa-extend.md
Created Jan 2, 2020
Extend previous coreos-assembler build with a new AWS region
View cosa-extend.md
@cgwalters
cgwalters / raul.md
Last active Dec 17, 2019
fio RHCOS LUKS null cipher vs direct XFS
View raul.md
@cgwalters
cgwalters / gist:5741d640f4c2af811f47c043de392c32
Created Dec 13, 2019
Overriding content in an old RHCOS AMI for testing
View gist:5741d640f4c2af811f47c043de392c32
First, given a build like: https://releases-art-rhcos.svc.ci.openshift.org/art/storage/releases/rhcos-4.3/43.81.201911081536.0/x86_64/meta.json
Download the qemu image:
```
$ curl -L https://releases-art-rhcos.svc.ci.openshift.org/art/storage/releases/rhcos-4.3/43.81.201911081536.0/x86_64/rhcos-43.81.201911081536.0-qemu.x86_64.qcow2.gz | gunzip > rhcos-43.81.201911081536.0-qemu.x86_64.qcow2
```
Download new RPM or other content you want, in this case let's assume it's a new hyperkube we want to drop in `/usr/bin`:
`$ curl -L http://example/openshift-hyperkube-4.3.0-201912131246.git.0.09a9468.el8.x86_64.rpm | rpm2cpio | cpio -div`
@cgwalters
cgwalters / gist:4e5eb36bd439f5995928e9232d865f67
Last active Dec 13, 2019
Testing FCOS/RHCOS OSTree upgrades manually
View gist:4e5eb36bd439f5995928e9232d865f67
On host in your cosa build directory run e.g.:
```
$ cd /srv/walters/rhcos-4.4
$ python3 -m http.server
```
```
$ cosa run -d rhcos-4.2.0-qemu.qcow2
# ostree remote add --set=gpg-verify=false local http://10.0.2.2:8000/tmp/repo
# while ! rpm-ostree rebase local:tmpref-rhcos; do sleep 0.1; done
View coreos-test-installer.sh
#!/bin/bash
# Automate an end-to-end run of coreos-installer with the metal image, which then
# boots and writes a success message to a virtio-serial port, which we read on the host.
set -euo pipefail
run_tmp_webserver() {
local statedir=$1
shift
local dir=$1
shift
View gist:77db117622337270f1d04315c8716044
```
walters@toolbox ~/s/g/c/coreos-assembler> git diff
diff --git a/src/create_disk.sh b/src/create_disk.sh
index e9cd8596..76808b3e 100755
--- a/src/create_disk.sh
+++ b/src/create_disk.sh
@@ -10,6 +10,9 @@
# an issue and we can discuss configuration needs.
set -euo pipefail
View gist:32ef862585ac9a87cd974e5d1b9e0db4
#!/bin/bash
# forked from https://gist.github.com/innovia/fbba8259042f71db98ea8d4ad19bd708
set -e
set -o pipefail
# Add user to k8s using service account, no RBAC (must create RBAC after this script)
if [[ -z "$1" ]] || [[ -z "$2" ]]; then
echo "usage: $0 <service_account_name> <namespace>"
exit 1
fi
View gist:1a7ae148a983037b42b98d837419d962
From ffc795562602637a7c3bc57bad7f20fdad58fa33 Mon Sep 17 00:00:00 2001
From: Stephen Lowrie <stephen.lowrie@gmail.com>
Date: Thu, 3 Oct 2019 15:40:48 -0500
Subject: [PATCH] HACK: Manhole on failure
---
kola/cluster/cluster.go | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/kola/cluster/cluster.go b/kola/cluster/cluster.go
@cgwalters
cgwalters / cosa.md
Last active Aug 22, 2019
cosa unprivileged
View cosa.md
cosa() {
   env | grep COREOS_ASSEMBLER
   id=$(id -u)
   set -x # so we can see what command gets run
   podman run --rm -ti --security-opt label:disable --privileged \
              --uidmap=${id}:0:1 --uidmap=0:1:${id} \
              -v ${PWD}:/srv/ -v /dev/kvm:/dev/kvm -v /dev/fuse:/dev/fuse --device /dev/kvm \
              --tmpfs /tmp --tmpfs /var/tmp --name cosa \
              ${COREOS_ASSEMBLER_CONFIG_GIT:+-v $COREOS_ASSEMBLER_CONFIG_GIT:/srv/src/config/:ro}   \
View gist:020e0a671f9fa02d155fcc604dc898b0
```
#!/bin/bash
# Convert from a label to its containing block device
# see https://github.com/coreos/ignition-dracut/pull/93
label=root
device=$(realpath /dev/disk/by-label/${label})
major=$(echo $((0x$(stat -c '%t' "${device}"))))
minor=$(echo $((0x$(stat -c '%T' "${device}"))))
majmin=${major}:${minor}
devpath=$(realpath "/sys/dev/block/$majmin")
You can’t perform that action at this time.