Skip to content

Instantly share code, notes, and snippets.

View marineam's full-sized avatar

Michael Marineau marineam

  • San Francisco, CA
View GitHub Profile
@marineam
marineam / bootxen.sh
Created September 12, 2013 02:22
Testing Xen with PXE CoreOS images
#!/bin/bash
XEN=$HOME/xen-3.4.4
#XEN=$HOME/xen-4.2.2
KERNEL=$HOME/latest/coreos_developer_pxe.vmlinuz
INITRD=$HOME/latest/coreos_developer_pxe_image.cpio.gz
COREOS_ARGS="root=squashfs: state=tmpfs:"
XEN_ARGS="console=hvc0 earlyprintk=xen"
CPU=host
#CPU=qemu64,+avx
@marineam
marineam / gist:6557621
Last active July 26, 2017 13:19
CoreOS Profile Refactor
INFO amd64-host : Portage 2.1.12.2 (releases/10.0, gcc-4.6.3, glibc-2.15-r3, 3.10.11-stable x86_64)
INFO amd64-host : =================================================================
INFO amd64-host : System uname: Linux-3.10.11-stable-x86_64-Intel-R-_Core-TM-_i7-3770_CPU_@_3.40GHz-with-gentoo-73.0.0
INFO amd64-host : KiB Swap: 7842812 total, 7842812 free
INFO amd64-host : Timestamp of tree: Unknown
INFO amd64-host : ld GNU ld (GNU Binutils) 2.23.1
INFO amd64-host : ccache version 3.1.6 [disabled]
INFO amd64-host : app-shells/bash: 4.2_p20
INFO amd64-host : dev-lang/python: 2.7.5-r2::coreos
INFO amd64-host : dev-util/ccache: 3.1.6
@marineam
marineam / gist:9493021
Created March 11, 2014 19:19
CoreOS postinst
# replacement psudocode for src/platform/installer
EFIPART=/dev/sda1
NEWROOT=/dev/sda4
mount -o ro $NEWROOT /media/newroot
mount $EFIPART /media/efi
# Normal boot
cp /media/newroot/boot/vmlinuz /media/efi/syslinux/vmlinuz.B
#cloud-config
coreos:
units:
- name: etcd.service
command: start
- name: fleet.service
command: start
- name: update-engine.service
command: restart
@marineam
marineam / gist:50f92ded40e02c163c19
Created September 4, 2014 19:49
3.16.1 + PV Xen boot failure
Xen Minimal OS!
start_info: 0xac4000(VA)
nr_pages: 0x26700
shared_inf: 0x7e38b000(MA)
pt_base: 0xac7000(VA)
nr_pt_frames: 0x9
mfn_list: 0x990000(VA)
mod_start: 0x0(VA)
mod_len: 0
flags: 0x0
@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]
#!/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: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
[ 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: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