mirror of
https://github.com/outbackdingo/matchbox.git
synced 2026-01-27 10:19:35 +00:00
scripts: Add CoreOS assets download script
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -26,4 +26,4 @@ _testmain.go
|
||||
bin/
|
||||
coverage/
|
||||
Godeps/_workspace/src/github.com/coreos/coreos-baremetal
|
||||
static/
|
||||
images/
|
||||
@@ -14,40 +14,12 @@ import (
|
||||
|
||||
var log = capnslog.NewPackageLogger("github.com/coreos/coreos-baremetal/cmd/bootcfg", "main")
|
||||
|
||||
// Example Boot Configs
|
||||
|
||||
var CoreOSStable = &api.BootConfig{
|
||||
Kernel: "http://stable.release.core-os.net/amd64-usr/current/coreos_production_pxe.vmlinuz",
|
||||
Initrd: []string{"http://stable.release.core-os.net/amd64-usr/current/coreos_production_pxe_image.cpio.gz"},
|
||||
Cmdline: map[string]interface{}{},
|
||||
}
|
||||
|
||||
var CoreOSBeta = &api.BootConfig{
|
||||
Kernel: "http://beta.release.core-os.net/amd64-usr/current/coreos_production_pxe.vmlinuz",
|
||||
Initrd: []string{"http://beta.release.core-os.net/amd64-usr/current/coreos_production_pxe_image.cpio.gz"},
|
||||
Cmdline: map[string]interface{}{},
|
||||
}
|
||||
|
||||
var CoreOSAlpha = &api.BootConfig{
|
||||
Kernel: "http://alpha.release.core-os.net/amd64-usr/current/coreos_production_pxe.vmlinuz",
|
||||
Initrd: []string{"http://alpha.release.core-os.net/amd64-usr/current/coreos_production_pxe_image.cpio.gz"},
|
||||
Cmdline: map[string]interface{}{},
|
||||
}
|
||||
|
||||
var CoreOSLocal = &api.BootConfig{
|
||||
Kernel: "/images/coreos_production_pxe.vmlinuz",
|
||||
Initrd: []string{"/images/coreos_production_pxe_image.cpio.gz"},
|
||||
Kernel: "/images/stable/coreos_production_pxe.vmlinuz",
|
||||
Initrd: []string{"/images/stable/coreos_production_pxe_image.cpio.gz"},
|
||||
Cmdline: map[string]interface{}{},
|
||||
}
|
||||
|
||||
var CoreOSLocalAutoLogin = &api.BootConfig{
|
||||
Kernel: "/images/coreos_production_pxe.vmlinuz",
|
||||
Initrd: []string{"/images/coreos_production_pxe_image.cpio.gz"},
|
||||
Cmdline: map[string]interface{}{
|
||||
"coreos.autologin": "",
|
||||
},
|
||||
}
|
||||
|
||||
func main() {
|
||||
flags := flag.NewFlagSet("bootcfg", flag.ExitOnError)
|
||||
address := flags.String("address", "127.0.0.1:8080", "HTTP listen address")
|
||||
@@ -81,7 +53,6 @@ func main() {
|
||||
|
||||
// load some boot configs
|
||||
bootAdapter := api.NewMapBootAdapter()
|
||||
bootAdapter.SetUUID("8a549bf5-075c-4372-8b0d-ce7844faa48c", CoreOSLocalAutoLogin )
|
||||
bootAdapter.SetDefault(CoreOSLocal)
|
||||
|
||||
config := &api.Config{
|
||||
|
||||
22
scripts/get-coreos
Executable file
22
scripts/get-coreos
Executable file
@@ -0,0 +1,22 @@
|
||||
#!/bin/bash -e
|
||||
|
||||
CHANNEL="stable"
|
||||
VERSION="current"
|
||||
DEST=${PWD}/images/$CHANNEL
|
||||
|
||||
mkdir -p $DEST
|
||||
echo "Downloading CoreOS kernel and initrd"
|
||||
|
||||
# kernel and sig
|
||||
BASE_URL=http://$CHANNEL.release.core-os.net/amd64-usr/$VERSION
|
||||
curl $BASE_URL/coreos_production_pxe.vmlinuz -o $DEST/coreos_production_pxe.vmlinuz
|
||||
curl $BASE_URL/coreos_production_pxe.vmlinuz.sig -o $DEST/coreos_production_pxe.vmlinuz.sig
|
||||
|
||||
# initrd and sig
|
||||
curl $BASE_URL/coreos_production_pxe_image.cpio.gz -o $DEST/coreos_production_pxe_image.cpio.gz
|
||||
curl $BASE_URL/coreos_production_pxe_image.cpio.gz.sig -o $DEST/coreos_production_pxe_image.cpio.gz.sig
|
||||
|
||||
# verify signatures
|
||||
# https://coreos.com/security/image-signing-key/
|
||||
gpg --verify $DEST/coreos_production_pxe.vmlinuz.sig
|
||||
gpg --verify $DEST/coreos_production_pxe_image.cpio.gz.sig
|
||||
Reference in New Issue
Block a user