Skip to content

Instantly share code, notes, and snippets.

View cgwalters's full-sized avatar
👍
LGTM

Colin Walters cgwalters

👍
LGTM
View GitHub Profile
@cgwalters
cgwalters / ubuntu-core-persistence.md
Last active April 25, 2022 13:04
colin's quick investigation of ubuntu core and persistence

Ubuntu Core investigation

Following up to this tweet.

Setup

I followed the qemu instructions, using ubuntu-core-20-amd64.img.

Investigating the mount/block setup

$ podman pull quay.io/openshift-release-dev/ocp-v4.0-art-dev@sha256:502f9b8333a88ecee1eb7e904af5cb0c75946e3084a553374079abf862446c70
Trying to pull quay.io/openshift-release-dev/ocp-v4.0-art-dev@sha256:502f9b8333a88ecee1eb7e904af5cb0c75946e3084a553374079abf862446c70...
Getting image source signatures
Copying blob 1e138cc587ef done  
Copying blob 54183f4a5679 done  
Copying blob fadcf7c660d5 done  
Copying config 10b43b2460 done  
Writing manifest to image destination
Storing signatures
flowchart TB
    subgraph ostreebuild [ostree build]
    quayprevious["previous ostree container"] -->|change detection| container["ostree container"]
    configgit["config git"]-->container
    rpms --> container["ostree container"]
    container --> quay["quay.io"]
    end
    subgraph imagebuild [image build]
 quay --> qemu["qemu image"]
@cgwalters
cgwalters / setns-demo.py
Created April 7, 2015 14:47
python setns
#!/usr/bin/env python
import ctypes
import sys
import os
import subprocess
f = None
libc = ctypes.CDLL('libc.so.6')
myfd = os.open('/proc/1/ns/mnt', os.O_RDONLY)
```
$ cosa generate-release-meta --stream-name podman --stream-baseurl https://fedorapeople.org/groups/podman --url https://fedorapeople.org/groups/podman/builds/35.20220208.dev.0/x86_64/meta.json --output stream.json
Downloading https://fedorapeople.org/groups/podman/builds/35.20220208.dev.0/x86_64/meta.json...
podman stream
x86_64 images:
- qemu
Successfully wrote release file at stream.json
$ jq . < stream.json
{
"release": "35.20220208.dev.0",
```
walters@toolbox /v/s/w/b/rhcos-master> oc image info (oc adm release info --image-for=machine-os-content quay.io/openshift-release-dev/ocp-release:4.6.52-x86_64)
Name: quay.io/openshift-release-dev/ocp-v4.0-art-dev@sha256:6ea6c6f23e0fe047c5813c0607c3bed53dc6bcf2c1064f8fc72235236aacc182
Media Type: application/vnd.docker.distribution.manifest.v2+json
Created: 39d ago
Image Size: 1.001GB in 3 layers
Layers: 86.08MB sha256:c2aecb3e557dba3008677634224d2eec02c1ccdf36e29026d57e933095a790a6
1.883kB sha256:65b3ce9d57bf94cef9ca928be2f78a5f61be880670860dbd05111489cac97368
914.5MB sha256:322dbbe859bd09590f8612b9ae0b59a2cc9d4f869c310a4525c86f7d36d7a614
OS: linux
$ rpm -q gcc cargo
gcc-8.5.0-7.el8.x86_64
cargo-1.56.1-2.module+el8.6.0+13527+64f2eba2.x86_64
$ rhpkg local
...
error: build-id found in /var/home/walters/rpmbuild/BUILDROOT/rpm-ostree-2021.14-2.el8.x86_64/usr/bin/rpm-ostree too small
error: Generating build-id links failed

walters@quicksilver ~> podman run --rm -ti quay.io/cgwalters/fcos bash
# rpm -Uvh https://kojipkgs.fedoraproject.org//packages/libdnf/0.64.0/1.fc35/x86_64/libdnf-0.64.0-1.fc35.x86_64.rpm https://kojipkgs.fedoraproject.org//packages/microdnf/3.8.0/2.fc35/x86_64/microdnf-3.8.0-2.fc35.x86_64.rpm https://kojipkgs.fedoraproject.org//packages/dnf/4.9.0/1.fc35/noarch/dnf-data-4.9.0-1.fc35.noarch.rpm https://kojipkgs.fedoraproject.org//packages/libpeas/1.30.0/5.fc35/x86_64/libpeas-1.30.0-5.fc35.x86_64.rpm https://kojipkgs.fedoraproject.org//packages/gobject-introspection/1.70.0/1.fc35/x86_64/gobject-introspection-1.70.0-1.fc35.x86_64.rpm
Retrieving https://kojipkgs.fedoraproject.org//packages/libdnf/0.64.0/1.fc35/x86_64/libdnf-0.64.0-1.fc35.x86_64.rpm
Retrieving https://kojipkgs.fedoraproject.org//packages/microdnf/3.8.0/2.fc35/x86_64/microdnf-3.8.0-2.fc35.x86_64.rpm
Retrieving https://kojipkgs.fedoraproject.org//packages/dnf/4.9.0/1.fc35/noarch/dnf-data-4.9.0-1.fc35.noarch.rpm
Retrieving https://kojipkgs.fedorap
@cgwalters
cgwalters / local-to-coreos.md
Last active December 9, 2021 22:02
Adding an updated local binary to an OCP4 coreos node

EDIT: Nevermind these instructions don't quite work because

$ findmnt -o PROPAGATION /rootfs
PROPAGATION
private
$ podman run --rm -ti quay.io/centos/centos:stream8
[root@b87a35397c31 /]# grep -ri devel /etc/yum.repos.d/
[root@b87a35397c31 /]#
$