diff options
author | Robin H. Johnson <robbat2@gentoo.org> | 2015-08-08 13:49:04 -0700 |
---|---|---|
committer | Robin H. Johnson <robbat2@gentoo.org> | 2015-08-08 17:38:18 -0700 |
commit | 56bd759df1d0c750a065b8c845e93d5dfa6b549d (patch) | |
tree | 3f91093cdb475e565ae857f1c5a7fd339e2d781e /app-admin/amazon-ec2-init | |
download | gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.gz gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.bz2 gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.zip |
proj/gentoo: Initial commit
This commit represents a new era for Gentoo:
Storing the gentoo-x86 tree in Git, as converted from CVS.
This commit is the start of the NEW history.
Any historical data is intended to be grafted onto this point.
Creation process:
1. Take final CVS checkout snapshot
2. Remove ALL ChangeLog* files
3. Transform all Manifests to thin
4. Remove empty Manifests
5. Convert all stale $Header$/$Id$ CVS keywords to non-expanded Git $Id$
5.1. Do not touch files with -kb/-ko keyword flags.
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
X-Thanks: Alec Warner <antarus@gentoo.org> - did the GSoC 2006 migration tests
X-Thanks: Robin H. Johnson <robbat2@gentoo.org> - infra guy, herding this project
X-Thanks: Nguyen Thai Ngoc Duy <pclouds@gentoo.org> - Former Gentoo developer, wrote Git features for the migration
X-Thanks: Brian Harring <ferringb@gentoo.org> - wrote much python to improve cvs2svn
X-Thanks: Rich Freeman <rich0@gentoo.org> - validation scripts
X-Thanks: Patrick Lauer <patrick@gentoo.org> - Gentoo dev, running new 2014 work in migration
X-Thanks: Michał Górny <mgorny@gentoo.org> - scripts, QA, nagging
X-Thanks: All of other Gentoo developers - many ideas and lots of paint on the bikeshed
Diffstat (limited to 'app-admin/amazon-ec2-init')
-rw-r--r-- | app-admin/amazon-ec2-init/amazon-ec2-init-20101127.ebuild | 30 | ||||
-rw-r--r-- | app-admin/amazon-ec2-init/files/amazon-ec2.init | 35 | ||||
-rw-r--r-- | app-admin/amazon-ec2-init/metadata.xml | 7 |
3 files changed, 72 insertions, 0 deletions
diff --git a/app-admin/amazon-ec2-init/amazon-ec2-init-20101127.ebuild b/app-admin/amazon-ec2-init/amazon-ec2-init-20101127.ebuild new file mode 100644 index 000000000000..885b6f872592 --- /dev/null +++ b/app-admin/amazon-ec2-init/amazon-ec2-init-20101127.ebuild @@ -0,0 +1,30 @@ +# Copyright 1999-2014 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +EAPI="2" + +DESCRIPTION="Init script to setup Amazon EC2 instance parameters" +HOMEPAGE="http://www.gentoo.org/" +SRC_URI="" + +# Amazon only provides x86 and amd64 Linux Xen guests, possibly FreeBSD, +# so just don't go adding further keywords. +KEYWORDS="-* ~amd64 ~x86" + +LICENSE="GPL-2" +SLOT="0" +IUSE="" + +RDEPEND="net-misc/wget" +DEPEND="" + +src_install() { + newinitd "${FILESDIR}/amazon-ec2.init" amazon-ec2 || die +} + +pkg_postinst() { + elog "Remember to add amazon-ec2 init script to your boot runlevel" + elog "otherwise it won't bring up the correct interfaces and won't." + elog "start before the hostname has been set." +} diff --git a/app-admin/amazon-ec2-init/files/amazon-ec2.init b/app-admin/amazon-ec2-init/files/amazon-ec2.init new file mode 100644 index 000000000000..4a13e5aaf547 --- /dev/null +++ b/app-admin/amazon-ec2-init/files/amazon-ec2.init @@ -0,0 +1,35 @@ +#!/sbin/runscript +# Copyright 1999-2010 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +depend() { + before hostname + need net.eth0 +} + +start() { + einfo "Fetching metadata from EC2 servers" + + ebegin " hostname" + local hostname=$(wget -t 2 -T 5 -q -O - http://169.254.169.254/latest/meta-data/local-hostname) + echo "hostname=${hostname}" >> /etc/conf.d/hostname + eend $? + + ebegin " SSH keys" + + mkdir -p /root/.ssh + + local keys=$(wget -t 2 -T 5 -q -O - http://169.254.169.254/latest/meta-data/public-keys/ | cut -d = -f 1 | xargs echo) + [ -n "${keys}" ] && \ + wget -t 2 -T 5 -q -O - $(for key in $keys; do echo "http://169.254.169.254/latest/meta-data/public-keys/$key/openssh-key"; done) \ + >> /root/.ssh/authorized_keys \ + 2>/dev/null + + if [ -f /root/.ssh/authorized_keys ]; then + chown root:root /root/.ssh/authorized_keys + chmod 0600 /root/.ssh/authorized_keys + fi + + eend $? +} diff --git a/app-admin/amazon-ec2-init/metadata.xml b/app-admin/amazon-ec2-init/metadata.xml new file mode 100644 index 000000000000..1470e032181b --- /dev/null +++ b/app-admin/amazon-ec2-init/metadata.xml @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <maintainer> + <email>maintainer-needed@gentoo.org</email> + </maintainer> +</pkgmetadata> |