Merge pull request #157 from marineam/virtfs

coreos-init takes over the world
This commit is contained in:
Michael Marineau 2013-08-11 20:20:11 -07:00
commit 1c8bd08f85
23 changed files with 53 additions and 151 deletions

View File

@ -128,6 +128,10 @@ src_install() {
# Insert glibc's nsswitch.conf since that is installed weirdly
doins "${FILESDIR}"/nsswitch.conf
# Insert a mini vimrc to avoid driving everyone insane
insinto /etc/vim
doins "${FILESDIR}"/vimrc
# Symlink /etc/localtime to something on the stateful partition, which we
# can then change around at runtime.
dosym /var/lib/timezone/localtime /etc/localtime || die

View File

@ -0,0 +1,18 @@
" Minimal configuration file for Vim on CoreOS
"
" The vim package is installed with USE=minimal to avoid installing lots of
" extra files but that doesn't mean we like vim acting as if it were vi.
" General settings from Gentoo's default vimrc:
set nocompatible " Use Vim defaults (much better!)
set bs=2 " Allow backspacing over everything in insert mode
set ruler " Show the cursor position all the time
set nomodeline " We don't allow modelines by default
" Read vimrc from the state partition if it exists.
if filereadable("/media/state/etc/vim/vimrc")
source /etc/vim/vimrc
endif
if filereadable("/media/state/etc/vim/vimrc.local")
source /etc/vim/vimrc.local
endif

View File

@ -3,7 +3,7 @@
# Distributed under the terms of the GNU General Public License v2
EAPI="4"
CROS_WORKON_COMMIT="38505c2cd170420f0623564794063769a4147aa5"
CROS_WORKON_COMMIT="4146847b48b7d692f6b8ce50be07c886e7a85fc9"
CROS_WORKON_PROJECT="coreos/init"
CROS_WORKON_LOCALNAME="init"
@ -16,13 +16,16 @@ SRC_URI=""
LICENSE="BSD"
SLOT="0"
KEYWORDS="amd64 arm x86"
IUSE="nfs"
IUSE="test"
# Daemons we enable here must installed during build/install in addition to
# during runtime so the systemd unit enable step works.
DEPEND="
net-misc/dhcpcd
net-misc/openssh
!<dev-db/etcd-0.0.1-r6
!coreos-base/oem-service
test? ( dev-lang/python:2.7 )
"
RDEPEND="${DEPEND}
sys-block/parted
@ -31,25 +34,7 @@ RDEPEND="${DEPEND}
"
src_install() {
# Install our boot scripts along side systemd in /usr/lib
exeinto /usr/lib/coreos
for script in scripts/*; do
doexe "${script}"
done
# Install our custom ssh config settings.
insinto /etc/ssh
doins configs/ssh{,d}_config
fperms 600 /etc/ssh/sshd_config
# List of directories that should be recreated as needed
insinto /usr/lib/tmpfiles.d
newins configs/tmpfiles.conf zz-${PN}.conf
# Install all units, enable the higher-level services
for unit in systemd/*; do
systemd_dounit "${unit}"
done
default
# Set the default target to multi-user not graphical, this is CoreOS!
dosym /usr/lib/systemd/system/multi-user.target /etc/systemd/system/default.target
@ -57,6 +42,7 @@ src_install() {
systemd_enable_service basic.target coreos-startup.target
# Services!
systemd_enable_service default.target coreos-c10n.service
systemd_enable_service default.target local-enable.service
systemd_enable_service default.target dhcpcd.service
systemd_enable_service default.target sshd-keygen.service

View File

@ -15,13 +15,16 @@ SRC_URI=""
LICENSE="BSD"
SLOT="0"
KEYWORDS="~amd64 ~arm ~x86"
IUSE="nfs"
IUSE="test"
# Daemons we enable here must installed during build/install in addition to
# during runtime so the systemd unit enable step works.
DEPEND="
net-misc/dhcpcd
net-misc/openssh
!<dev-db/etcd-0.0.1-r6
!coreos-base/oem-service
test? ( dev-lang/python:2.7 )
"
RDEPEND="${DEPEND}
sys-block/parted
@ -30,25 +33,7 @@ RDEPEND="${DEPEND}
"
src_install() {
# Install our boot scripts along side systemd in /usr/lib
exeinto /usr/lib/coreos
for script in scripts/*; do
doexe "${script}"
done
# Install our custom ssh config settings.
insinto /etc/ssh
doins configs/ssh{,d}_config
fperms 600 /etc/ssh/sshd_config
# List of directories that should be recreated as needed
insinto /usr/lib/tmpfiles.d
newins configs/tmpfiles.conf zz-${PN}.conf
# Install all units, enable the higher-level services
for unit in systemd/*; do
systemd_dounit "${unit}"
done
default
# Set the default target to multi-user not graphical, this is CoreOS!
dosym /usr/lib/systemd/system/multi-user.target /etc/systemd/system/default.target
@ -56,6 +41,7 @@ src_install() {
systemd_enable_service basic.target coreos-startup.target
# Services!
systemd_enable_service default.target coreos-c10n.service
systemd_enable_service default.target local-enable.service
systemd_enable_service default.target dhcpcd.service
systemd_enable_service default.target sshd-keygen.service

View File

@ -149,7 +149,6 @@ RDEPEND="${RDEPEND}
app-emulation/docker
app-misc/ca-certificates
virtual/udev
coreos-base/oem-service
dev-db/etcd
"

View File

@ -1,13 +0,0 @@
#!/bin/bash
OEM_RELEASE="/usr/share/oem/oem-release"
VIRT=
if [ -e "${OEM_RELEASE}" ]; then
VIRT=$(cat ${OEM_RELEASE})
else
VIRT=$(systemd-detect-virt)
fi
echo $VIRT

View File

@ -1,6 +0,0 @@
[Service]
Type=oneshot
ExecStart=/usr/bin/run-oem.sh
[Install]
WantedBy=multi-user.target

View File

@ -1,6 +0,0 @@
#!/bin/bash
# Each oem implemenation has a run.sh that boostraps its OEM process for systemd
OEM_EXEC="/usr/share/oem/run.sh"
[ -e $OEM_EXEC ] && exec $OEM_EXEC || exit 0

View File

@ -1,26 +0,0 @@
#
# Copyright (c) 2011 The Chromium OS Authors. All rights reserved.
# Copyright (c) 2013 CoreOS, Inc.. All rights reserved.
# Distributed under the terms of the GNU General Public License v2
# $Header:$
#
EAPI=2
inherit systemd
DESCRIPTION="oem service"
HOMEPAGE=""
SRC_URI=""
LICENSE="Apache-2.0"
SLOT="0"
KEYWORDS="amd64 x86"
IUSE=""
src_install() {
dobin ${FILESDIR}/run-oem.sh
dobin ${FILESDIR}/coreos-detect-virt
systemd_dounit "${FILESDIR}"/${PN}.service
systemd_enable_service multi-user.target ${PN}.service
}

View File

@ -31,10 +31,8 @@ src_compile() {
src_install() {
dobin ${S}/${PN}
dobin ${FILESDIR}/coreos-c10n
dobin ${FILESDIR}/etcd-bootstrap
dobin ${FILESDIR}/etcd-pre-exec
dobin ${FILESDIR}/block-until-url
keepdir /var/lib/${PN}
fowners etcd:etcd /var/lib/${PN}

View File

@ -30,10 +30,8 @@ src_compile() {
src_install() {
dobin ${S}/${PN}
dobin ${FILESDIR}/coreos-c10n
dobin ${FILESDIR}/etcd-bootstrap
dobin ${FILESDIR}/etcd-pre-exec
dobin ${FILESDIR}/block-until-url
keepdir /var/lib/${PN}
fowners etcd:etcd /var/lib/${PN}

View File

@ -1,7 +0,0 @@
#!/bin/bash
URL="$1"
CMD="curl -s --capath /usr/share/coreos-ca-certificates/ --capath /etc/ssl/certs/ $URL"
while ($CMD > /dev/null); [ $? -ne 0 ];
do sleep .5; done

View File

@ -1,40 +0,0 @@
#!/bin/bash
VIRT=$(coreos-detect-virt)
if [ "${VIRT}" != "ec2" ]; then
# all of this is currently dependent on ec2, we'll refactor as we add more images
exit 0
fi
C10N_ENDPOINT=https://core-api.appspot.com/v1/c10n/group
META_URL="http://169.254.169.254/latest"
ETCD_BOOTSTRAP="/var/run/etcd/bootstrap.config"
/usr/bin/block-until-url $C10N_ENDPOINT
/usr/bin/block-until-url $META_URL
USER_DATA=$(curl -s --fail $META_URL/user-data)
if [ $? -eq 0 ] && [ ! -z "$USER_DATA" ]; then
URL=$USER_DATA
echo $URL | grep -q '^https://' || (echo Coordination URL requires valid SSL; exit 1)
TMP=`mktemp`
curl -s "$USER_DATA/raw" > $TMP
# validate ssh key
ssh-keygen -l -f $TMP > /dev/null 2>&1
if [ $? -eq 0 ]; then
cat $TMP >> /home/core/.ssh/authorized_keys
echo "SSH key updated"
chown -R core: /home/core/.ssh/
else
echo "Not a valid ssh key"
fi
fi
IP=$(curl -s $META_URL/meta-data/local-ipv4)
curl -s $C10N_ENDPOINT -d "c10n_url=$URL" -d"ip_list=$IP" > $ETCD_BOOTSTRAP

View File

@ -10,8 +10,6 @@ if [ "${VIRT}" != "ec2" ]; then
exec /usr/bin/etcd -v -d $STATE
fi
/usr/bin/coreos-c10n
META_URL="http://169.254.169.254/latest"
MY_IP=$(curl -s $META_URL/meta-data/local-ipv4)
BOOTSTRAP="/var/run/etcd/bootstrap.config"

View File

@ -1,3 +1,8 @@
[Unit]
Description=etcd
Wants=coreos-c10n.service
After=coreos-c10n.service
[Service]
User=etcd
PermissionsStartOnly=true

View File

@ -552,6 +552,7 @@ CONFIG_PCI_XEN=y
CONFIG_PCI_DOMAINS=y
# CONFIG_PCI_CNB20LE_QUIRK is not set
CONFIG_PCIEPORTBUS=y
CONFIG_HOTPLUG_PCI_PCIE=y
CONFIG_PCIEAER=y
CONFIG_PCIE_ECRC=y
# CONFIG_PCIEAER_INJECT is not set
@ -576,7 +577,11 @@ CONFIG_PCI_LABEL=y
CONFIG_ISA_DMA_API=y
CONFIG_AMD_NB=y
# CONFIG_PCCARD is not set
# CONFIG_HOTPLUG_PCI is not set
CONFIG_HOTPLUG_PCI=y
CONFIG_HOTPLUG_PCI_ACPI=y
# CONFIG_HOTPLUG_PCI_ACPI_IBM is not set
# CONFIG_HOTPLUG_PCI_CPCI is not set
# CONFIG_HOTPLUG_PCI_SHPC is not set
# CONFIG_RAPIDIO is not set
#
@ -1008,7 +1013,9 @@ CONFIG_FIB_RULES=y
# CONFIG_WIRELESS is not set
# CONFIG_WIMAX is not set
# CONFIG_RFKILL is not set
# CONFIG_NET_9P is not set
CONFIG_NET_9P=m
CONFIG_NET_9P_VIRTIO=m
# CONFIG_NET_9P_DEBUG is not set
# CONFIG_CAIF is not set
# CONFIG_CEPH_LIB is not set
# CONFIG_NFC is not set
@ -2538,6 +2545,8 @@ CONFIG_SUNRPC_DEBUG=y
# CONFIG_NCP_FS is not set
# CONFIG_CODA_FS is not set
# CONFIG_AFS_FS is not set
CONFIG_9P_FS=m
CONFIG_9P_FS_POSIX_ACL=y
CONFIG_NLS=y
CONFIG_NLS_DEFAULT="utf8"
CONFIG_NLS_CODEPAGE_437=y

View File

@ -36,7 +36,7 @@ net-misc/dhcpcd -crash
# this comment was here:
# build kvm with X and sdl so we have an option of running it with local
# display without VNC
app-emulation/qemu aio caps curl jpeg ncurses png python seccomp threads uuid vhost-net vnc qemu_softmmu_targets_arm qemu_softmmu_targets_i386 qemu_softmmu_targets_x86_64
app-emulation/qemu aio caps curl jpeg ncurses png python seccomp threads uuid vhost-net virtfs vnc xattr qemu_softmmu_targets_x86_64
dev-libs/libaio static-libs
cross-armv7a-cros-linux-gnueabi/gcc hardfp
cross-armv6j-cros-linux-gnueabi/gcc hardfp -thumb

View File

@ -3,7 +3,7 @@
# $Header: /var/cvsroot/gentoo-x86/sys-kernel/vanilla-sources/vanilla-sources-3.7.5.ebuild,v 1.1 2013/01/28 13:18:54 ago Exp $
EAPI=4
CROS_WORKON_COMMIT="42e65fc40aa591e7a4446a6953e73eecbfbfb954"
CROS_WORKON_COMMIT="690868ea535f744ddc7bce065b2d566726a3e1c3"
CROS_WORKON_REPO="git://github.com"
CROS_WORKON_PROJECT="coreos/linux"
CROS_WORKON_LOCALNAME="linux"