scripts: Add CoreOS assets download script

This commit is contained in:
Dalton Hubble
2015-12-14 10:48:08 -08:00
parent ad737d5c13
commit d30d4e3b60
3 changed files with 25 additions and 32 deletions

2
.gitignore vendored
View File

@@ -26,4 +26,4 @@ _testmain.go
bin/
coverage/
Godeps/_workspace/src/github.com/coreos/coreos-baremetal
static/
images/

View File

@@ -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
View 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