Skip to content

Instantly share code, notes, and snippets.

View marineam's full-sized avatar

Michael Marineau marineam

  • San Francisco, CA
View GitHub Profile
#!/bin/bash
set -ex
KOLA=$(which kola)
PAYLOAD="$HOME/coreos/testupdates/update.gz"
CACHE_DIR="$HOME/coreos/testupdates/stable/"
STABLE_URL="https://stable.release.core-os.net/amd64-usr/"
STABLE_VERSIONS=(
367.1.0
#!/bin/bash
set -e
eval $(go env)
tmp=$(mktemp)
trap "rm -f '$tmp'" EXIT
find "$GOROOT/src" -name '*.go' -type f -printf '%h\n' \
| grep -v -e '/cmd/' -e '/internal/' -e '/testdata/' \
diff --git a/src/basic/terminal-util.c b/src/basic/terminal-util.c
index 0a9d2bb..e900eac 100644
--- a/src/basic/terminal-util.c
+++ b/src/basic/terminal-util.c
@@ -837,13 +837,39 @@ int make_stdio(int fd) {
}
int make_null_stdio(void) {
- int null_fd;
+ int null_fd, kmsg_fd;
@marineam
marineam / gist:11f0e7d9e4a55cb599fe
Created February 16, 2016 19:54
squish openstack image
$ qemu-img convert -O raw coreos_production_openstack_image.img coreos_production_openstack_image.bin
$ sudo losetup --show --find --partscan coreos_production_openstack_image.bin
/dev/loop0
$ sudo losetup --show --find --partscan coreos_production_image.bin
/dev/loop1
$ sudo dd if=/dev/loop0p6 of=/dev/loop1p6 bs=1M
128+0 records in
# TODO: respect SDK_VERSION in version.txt
V=master
S=/mnt/host/source/src/scripts
B=amd64-usr
./bin/cork create --replace --sdk-version=${V} --verbose
./bin/cork enter -- ${S}/update_chroot --toolchain_boards=${B}
./bin/cork enter -- ${S}/build_packages --board=${B} --skip_chroot_upgrade --getbinpkgver=master --toolchainpkgonly
./bin/cork enter -- ${S}/build_image --board=${B} prod
./bin/cork enter -- ${S}/prune_images
@marineam
marineam / gist:cd257cafed4d6d86b56a
Created September 3, 2015 21:00
Gentoo Git + CVS hsitory
git clone git://anongit.gentoo.org/repo/gentoo.git
git remote add gentoo-gitmig-20150809-draft git://github.com/gentoo/gentoo-gitmig-20150809-draft.git
git fetch gentoo-gitmig-20150809-draft
git replace --graft 56bd759df1d0c750a065b8c845e93d5dfa6b549d 2ebda5cd08db6bdf193adaa6de33239a83a73af0
[ 0.000000] Initializing cgroup subsys cpuset
[ 0.000000] Initializing cgroup subsys cpu
[ 0.000000] Initializing cgroup subsys cpuacct
[ 0.000000] Linux version 4.1.0-rc5+ (marineam@crispin) (gcc version 4.8.4 (Gentoo 4.8.4 p1.4, pie-0.6.1) ) #179 SMP Tue May 26 22:15:05 PDT 2015
[ 0.000000] Command line: initrd=\f06334242ef80a24f117c44a527873e0\4.1.0-rc5+\initrd luks.options=discard luks.uuid=e13aa7d2-f5a8-4b0f-ab3e-62b4195356e6 resume=UUID=b0972a5b-ed54-4e2d-92e7-0dfeb6c776aa luks.uuid=f30f8625-cc56-475b-9461-b84b6b95196c root=UUID=e6b399d2-baa1-4eea-944c-e16b70648baf rootfstype=ext4 rootflags=data=writeback ro init=/usr/lib/systemd/systemd loglevel=6 video=efifb:off
[ 0.000000] KERNEL supported cpus:
[ 0.000000] Intel GenuineIntel
[ 0.000000] e820: BIOS-provided physical RAM map:
[ 0.000000] BIOS-e820: [mem 0x0000000000000000-0x0000000000057fff] usable
[ 0.000000] BIOS-e820: [mem 0x0000000000058000-0x0000000000058fff] reserved
@marineam
marineam / gist:9914debc25c8d7dc458f
Last active May 21, 2018 12:47
CoreOS dev container

Pending real documentation.... We do have a development container which includes the same toolchain version that was used to build CoreOS but it works under systemd-nspawn, not docker, and isn't documented. But here is a quick guide that may be a useful starting place.

# on coreos
wget http://alpha.release.core-os.net/amd64-usr/current/coreos_developer_container.bin.bz2
bunzip2 coreos_developer_container.bin.bz2
sudo systemd-nspawn -i coreos_developer_container.bin --share-system
#!/bin/bash
# And now we cry because --network-interface on systemd-nspawn is broken. :(
set -e
NAME="$1"
shift
for retry in {1..5}; do
if machinectl status "$NAME" &>/dev/null; then
@marineam
marineam / gist:e87509ddfc682ca6864a
Created December 2, 2014 23:52
Two stage cloudinit
#!/bin/bash
set -e
mkdir -p /etc/systemd/network
cat > /etc/systemd/network/00-eth.network <<EOF
[Match]
Name=eth*
[Network]