[cloud-init/el6] base package on patches against upstream
Pádraig Brady
pbrady at fedoraproject.org
Wed Jun 27 17:24:34 UTC 2012
commit da2af48fcb1faa2a0da9b5a8be0727db9b5c1f89
Author: Pádraig Brady <P at draigBrady.com>
Date: Wed Jun 27 18:22:22 2012 +0100
base package on patches against upstream
No functional change
cloud-config.init | 90 -----
cloud-final.init | 92 -----
....patch => cloud-init-0.6.3-subprocess-2.6.patch | 31 +-
cloud-init-0.6.3-sysv.patch | 405 ++++++++++++++++++++
cloud-init-local.init | 90 -----
cloud-init.init | 90 -----
cloud-init.spec | 15 +-
7 files changed, 433 insertions(+), 380 deletions(-)
---
diff --git a/cloud-init-subprocess-2.6.patch b/cloud-init-0.6.3-subprocess-2.6.patch
similarity index 60%
rename from cloud-init-subprocess-2.6.patch
rename to cloud-init-0.6.3-subprocess-2.6.patch
index 7dcd694..e5fa179 100644
--- a/cloud-init-subprocess-2.6.patch
+++ b/cloud-init-0.6.3-subprocess-2.6.patch
@@ -1,8 +1,17 @@
-make subprocess usage, python 2.6 compatible
+From 8e9ef3fab3d42e76bb109b268f36d2a190ab248e Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?P=C3=A1draig=20Brady?= <P at draigBrady.com>
+Date: Wed, 27 Jun 2012 16:28:09 +0100
+Subject: [PATCH] make subprocess usage python 2.6 compatible
-diff -Naru cloud-init-0.6.3-bzr532.orig/cloudinit/netinfo.py cloud-init-0.6.3-bzr532/cloudinit/netinfo.py
---- cloud-init-0.6.3-bzr532.orig/cloudinit/netinfo.py 2012-03-05 19:05:34.000000000 +0000
-+++ cloud-init-0.6.3-bzr532/cloudinit/netinfo.py 2012-05-22 16:15:01.546245169 +0100
+---
+ cloudinit/netinfo.py | 12 ++++++++++--
+ cloudinit/util.py | 4 +++-
+ 2 files changed, 13 insertions(+), 3 deletions(-)
+
+diff --git a/cloudinit/netinfo.py b/cloudinit/netinfo.py
+index 7e07812..fe9f0d5 100644
+--- a/cloudinit/netinfo.py
++++ b/cloudinit/netinfo.py
@@ -21,10 +21,18 @@
import subprocess
@@ -23,7 +32,7 @@ diff -Naru cloud-init-0.6.3-bzr532.orig/cloudinit/netinfo.py cloud-init-0.6.3-bz
devs = {}
for line in ifcfg_out.splitlines():
if len(line) == 0:
-@@ -70,7 +78,7 @@
+@@ -70,7 +78,7 @@ def netdev_info(empty=""):
def route_info():
@@ -32,10 +41,11 @@ diff -Naru cloud-init-0.6.3-bzr532.orig/cloudinit/netinfo.py cloud-init-0.6.3-bz
routes = []
for line in route_out.splitlines()[1:]:
if not line:
-diff -Naru cloud-init-0.6.3-bzr532.orig/cloudinit/util.py cloud-init-0.6.3-bzr532/cloudinit/util.py
---- cloud-init-0.6.3-bzr532.orig/cloudinit/util.py 2012-06-18 12:38:58.695948654 +0100
-+++ cloud-init-0.6.3-bzr532/cloudinit/util.py 2012-06-18 12:48:34.653968515 +0100
-@@ -227,7 +227,9 @@
+diff --git a/cloudinit/util.py b/cloudinit/util.py
+index 4739741..d512952 100644
+--- a/cloudinit/util.py
++++ b/cloudinit/util.py
+@@ -228,7 +228,9 @@ def subp(args, input_=None):
stderr=subprocess.PIPE, stdin=subprocess.PIPE)
out, err = sp.communicate(input_)
if sp.returncode is not 0:
@@ -46,3 +56,6 @@ diff -Naru cloud-init-0.6.3-bzr532.orig/cloudinit/util.py cloud-init-0.6.3-bzr53
return(out, err)
+--
+1.7.6.4
+
diff --git a/cloud-init-0.6.3-sysv.patch b/cloud-init-0.6.3-sysv.patch
new file mode 100644
index 0000000..0986af0
--- /dev/null
+++ b/cloud-init-0.6.3-sysv.patch
@@ -0,0 +1,405 @@
+From 52879823f7043fe9711987e6f725a6d163d8c1df Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?P=C3=A1draig=20Brady?= <P at draigBrady.com>
+Date: Wed, 27 Jun 2012 16:18:48 +0100
+Subject: [PATCH] Add sysv init scripts
+
+---
+ sysv/cloud-config | 90 +++++++++++++++++++++++++++++++++++++++++++++++
+ sysv/cloud-final | 92 +++++++++++++++++++++++++++++++++++++++++++++++++
+ sysv/cloud-init | 90 +++++++++++++++++++++++++++++++++++++++++++++++
+ sysv/cloud-init-local | 90 +++++++++++++++++++++++++++++++++++++++++++++++
+ 4 files changed, 362 insertions(+), 0 deletions(-)
+ create mode 100755 sysv/cloud-config
+ create mode 100755 sysv/cloud-final
+ create mode 100755 sysv/cloud-init
+ create mode 100755 sysv/cloud-init-local
+
+diff --git a/sysv/cloud-config b/sysv/cloud-config
+new file mode 100755
+index 0000000..b082409
+--- /dev/null
++++ b/sysv/cloud-config
+@@ -0,0 +1,90 @@
++#!/bin/sh
++#
++# cloud-config
++#
++# chkconfig: - 20 80
++# description: Apply the settings specified in cloud-config
++
++### BEGIN INIT INFO
++# Provides: cloud-config
++# Required-Start: $remote_fs $network $syslog cloud-init-local cloud-init
++# Required-Stop: $remote_fs $syslog
++# Default-Stop: 0 1 6
++# Short-Description: Apply the settings specified in cloud-config
++# Description: Apply the settings specified in cloud-config
++### END INIT INFO
++
++. /etc/rc.d/init.d/functions
++
++prog=cloud-init-cfg
++exec="/usr/bin/$prog"
++
++[ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog
++
++
++start() {
++ [ -x $exec ] || exit 5
++ echo -n $"Starting $prog: "
++ $prog all config
++ retval=$?
++ echo
++ return $retval
++}
++
++stop() {
++ return
++}
++
++restart() {
++ stop
++ start
++}
++
++reload() {
++ restart
++}
++
++force_reload() {
++ restart
++}
++
++rh_status() {
++ status $prog
++}
++
++rh_status_q() {
++ rh_status >/dev/null 2>&1
++}
++
++
++case "$1" in
++ start)
++ rh_status_q && exit 0
++ $1
++ ;;
++ stop)
++ rh_status_q || exit 0
++ $1
++ ;;
++ restart)
++ $1
++ ;;
++ reload)
++ rh_status_q || exit 7
++ $1
++ ;;
++ force-reload)
++ force_reload
++ ;;
++ status)
++ rh_status
++ ;;
++ condrestart|try-restart)
++ rh_status_q || exit 0
++ restart
++ ;;
++ *)
++ echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}"
++ exit 2
++esac
++exit $?
+diff --git a/sysv/cloud-final b/sysv/cloud-final
+new file mode 100755
+index 0000000..54c0bf8
+--- /dev/null
++++ b/sysv/cloud-final
+@@ -0,0 +1,92 @@
++#!/bin/sh
++#
++# cloud-final
++#
++# chkconfig: - 99 01
++# description: Execute cloud user/final scripts
++
++### BEGIN INIT INFO
++# Provides:
++# Required-Start: $remote_fs $network $syslog cloud-config
++# Required-Stop: $remote_fs $syslog
++# Default-Stop: 0 1 6
++# Short-Description: Execute cloud user/final scripts
++# Description: Execute cloud user/final scripts
++### END INIT INFO
++
++. /etc/rc.d/init.d/functions
++
++prog=cloud-init-cfg
++exec="/usr/bin/$prog"
++
++[ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog
++
++
++start() {
++ [ -x $exec ] || exit 5
++ echo -n $"Starting $prog: "
++ # TODO: Note this will run before rc.local
++ # which needs to be changed to run after.
++ $prog all final
++ retval=$?
++ echo
++ return $retval
++}
++
++stop() {
++ return
++}
++
++restart() {
++ stop
++ start
++}
++
++reload() {
++ restart
++}
++
++force_reload() {
++ restart
++}
++
++rh_status() {
++ status $prog
++}
++
++rh_status_q() {
++ rh_status >/dev/null 2>&1
++}
++
++
++case "$1" in
++ start)
++ rh_status_q && exit 0
++ $1
++ ;;
++ stop)
++ rh_status_q || exit 0
++ $1
++ ;;
++ restart)
++ $1
++ ;;
++ reload)
++ rh_status_q || exit 7
++ $1
++ ;;
++ force-reload)
++ force_reload
++ ;;
++ status)
++ rh_status
++ ;;
++ condrestart|try-restart)
++ rh_status_q || exit 0
++ restart
++ ;;
++ *)
++ echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}"
++ exit 2
++esac
++exit $?
+diff --git a/sysv/cloud-init b/sysv/cloud-init
+new file mode 100755
+index 0000000..0e08ae1
+--- /dev/null
++++ b/sysv/cloud-init
+@@ -0,0 +1,90 @@
++#!/bin/sh
++#
++# cloud-init remote
++#
++# chkconfig: - 20 80
++# description: Initial cloud-init job (metadata service crawler)
++
++### BEGIN INIT INFO
++# Provides: cloud-init
++# Required-Start: $remote_fs $network $syslog cloud-init-local
++# Required-Stop: $remote_fs $syslog
++# Default-Stop: 0 1 6
++# Short-Description: Initial cloud-init job
++# Description: Initial cloud-init job (metadata service crawler)
++### END INIT INFO
++
++. /etc/rc.d/init.d/functions
++
++prog=cloud-init
++exec="/usr/bin/$prog"
++
++[ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog
++
++
++start() {
++ [ -x $exec ] || exit 5
++ echo -n $"Starting $prog: "
++ $prog start
++ retval=$?
++ echo
++ return $retval
++}
++
++stop() {
++ return
++}
++
++restart() {
++ stop
++ start
++}
++
++reload() {
++ restart
++}
++
++force_reload() {
++ restart
++}
++
++rh_status() {
++ status $prog
++}
++
++rh_status_q() {
++ rh_status >/dev/null 2>&1
++}
++
++
++case "$1" in
++ start)
++ rh_status_q && exit 0
++ $1
++ ;;
++ stop)
++ rh_status_q || exit 0
++ $1
++ ;;
++ restart)
++ $1
++ ;;
++ reload)
++ rh_status_q || exit 7
++ $1
++ ;;
++ force-reload)
++ force_reload
++ ;;
++ status)
++ rh_status
++ ;;
++ condrestart|try-restart)
++ rh_status_q || exit 0
++ restart
++ ;;
++ *)
++ echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}"
++ exit 2
++esac
++exit $?
+diff --git a/sysv/cloud-init-local b/sysv/cloud-init-local
+new file mode 100755
+index 0000000..cb42ce2
+--- /dev/null
++++ b/sysv/cloud-init-local
+@@ -0,0 +1,90 @@
++#!/bin/sh
++#
++# cloud-init local
++#
++# chkconfig: - 20 80
++# description: Initial cloud-init job (pre-networking)
++
++### BEGIN INIT INFO
++# Provides: cloud-init-local
++# Required-Start: $syslog
++# Required-Stop: $syslog
++# Default-Stop: 0 1 6
++# Short-Description: Initial cloud-init job
++# Description: Initial cloud-init job (pre-networking)
++### END INIT INFO
++
++. /etc/rc.d/init.d/functions
++
++prog=cloud-init
++exec="/usr/bin/$prog"
++
++[ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog
++
++
++start() {
++ [ -x $exec ] || exit 5
++ echo -n $"Starting $prog: "
++ $prog start-local
++ retval=$?
++ echo
++ return $retval
++}
++
++stop() {
++ return
++}
++
++restart() {
++ stop
++ start
++}
++
++reload() {
++ restart
++}
++
++force_reload() {
++ restart
++}
++
++rh_status() {
++ status $prog
++}
++
++rh_status_q() {
++ rh_status >/dev/null 2>&1
++}
++
++
++case "$1" in
++ start)
++ rh_status_q && exit 0
++ $1
++ ;;
++ stop)
++ rh_status_q || exit 0
++ $1
++ ;;
++ restart)
++ $1
++ ;;
++ reload)
++ rh_status_q || exit 7
++ $1
++ ;;
++ force-reload)
++ force_reload
++ ;;
++ status)
++ rh_status
++ ;;
++ condrestart|try-restart)
++ rh_status_q || exit 0
++ restart
++ ;;
++ *)
++ echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}"
++ exit 2
++esac
++exit $?
+--
+1.7.6.4
+
diff --git a/cloud-init.spec b/cloud-init.spec
index b3232e9..cd02de6 100644
--- a/cloud-init.spec
+++ b/cloud-init.spec
@@ -12,10 +12,6 @@ URL: http://launchpad.net/cloud-init
Source0: %{name}-%{version}-bzr532.tar.gz
Source1: cloud-init-fedora.cfg
Source2: cloud-init-README.fedora
-Source3: cloud-config.init
-Source4: cloud-final.init
-Source5: cloud-init.init
-Source6: cloud-init-local.init
Patch0: cloud-init-0.6.3-fedora.patch
# Make runparts() work on Fedora
@@ -23,8 +19,10 @@ Patch0: cloud-init-0.6.3-fedora.patch
Patch1: cloud-init-0.6.3-no-runparts.patch
# https://bugs.launchpad.net/cloud-init/+bug/970071
Patch2: cloud-init-0.6.3-lp970071.patch
+# Add sysv init scripts
+Patch3: cloud-init-0.6.3-sysv.patch
# Support subprocess on python < 2.7
-Patch3: cloud-init-subprocess-2.6.patch
+Patch4: cloud-init-0.6.3-subprocess-2.6.patch
BuildArch: noarch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
@@ -59,6 +57,7 @@ ssh keys and to let the user run various scripts.
%patch1 -p0
%patch2 -p1
%patch3 -p1
+%patch4 -p1
cp -p %{SOURCE2} README.fedora
@@ -84,10 +83,8 @@ mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/rsyslog.d
cp -p tools/21-cloudinit.conf $RPM_BUILD_ROOT/%{_sysconfdir}/rsyslog.d/21-cloudinit.conf
# Install the init scripts
-install -p -D -m 755 %{SOURCE3} $RPM_BUILD_ROOT/%{_initrddir}/cloud-config
-install -p -D -m 755 %{SOURCE4} $RPM_BUILD_ROOT/%{_initrddir}/cloud-final
-install -p -D -m 755 %{SOURCE5} $RPM_BUILD_ROOT/%{_initrddir}/cloud-init
-install -p -D -m 755 %{SOURCE6} $RPM_BUILD_ROOT/%{_initrddir}/cloud-init-local
+mkdir -p $RPM_BUILD_ROOT/%{_initrddir}
+install -p -m 755 sysv/* $RPM_BUILD_ROOT/%{_initrddir}/
%clean
More information about the scm-commits
mailing list