summaryrefslogtreecommitdiff
path: root/debian
diff options
context:
space:
mode:
authorBen Howard <ben.howard@ubuntu.com>2012-06-22 09:10:22 -0600
committerusd-importer <ubuntu-server@lists.ubuntu.com>2012-07-13 13:33:37 +0000
commit342dba6f6102a286979361c86b89f8c65496c8f5 (patch)
tree03e6ed63f58dae0671c779cfda0edce1c865b33b /debian
downloadvyos-walinuxagent-342dba6f6102a286979361c86b89f8c65496c8f5.tar.gz
vyos-walinuxagent-342dba6f6102a286979361c86b89f8c65496c8f5.zip
Import patches-unapplied version 1.0~git20120606.c16f5e9-0ubuntu1 to ubuntu/quantal
Imported using git-ubuntu import.
Diffstat (limited to 'debian')
-rw-r--r--debian/README.source7
-rw-r--r--debian/changelog9
-rw-r--r--debian/compat1
-rw-r--r--debian/control25
-rw-r--r--debian/copyright21
-rw-r--r--debian/default2
-rw-r--r--debian/dirs1
-rw-r--r--debian/docs3
-rw-r--r--debian/install1
-rw-r--r--debian/patches/000_ubuntu_init_resolvconf.patch153
-rw-r--r--debian/patches/001_ubuntu_agent_startup.patch22
-rw-r--r--debian/patches/series2
-rw-r--r--debian/postinst23
-rw-r--r--debian/prerm25
-rwxr-xr-xdebian/rules14
-rw-r--r--debian/source/format1
16 files changed, 310 insertions, 0 deletions
diff --git a/debian/README.source b/debian/README.source
new file mode 100644
index 0000000..7f12ed5
--- /dev/null
+++ b/debian/README.source
@@ -0,0 +1,7 @@
+version=3
+# Upstream have not yet released so its based on a git snapshot from:
+#
+# https://github.com/Windows-Azure/WALinuxAgent
+#
+# See the get-packaged-orig-source target in debian/rules for more
+# information.
diff --git a/debian/changelog b/debian/changelog
new file mode 100644
index 0000000..2e0e6b4
--- /dev/null
+++ b/debian/changelog
@@ -0,0 +1,9 @@
+walinuxagent (1.0~git20120606.c16f5e9-0ubuntu1) quantal; urgency=low
+
+ * Initial package import (LP: #1014864).
+ * Ubuntu specific modifications:
+ - Made resolvconf aware during deprovisioning
+ - Added Ubuntu upstart job
+ - Added ability to prevent agent startup.
+
+ -- Ben Howard <ben.howard@ubuntu.com> Fri, 22 Jun 2012 09:10:22 -0600
diff --git a/debian/compat b/debian/compat
new file mode 100644
index 0000000..45a4fb7
--- /dev/null
+++ b/debian/compat
@@ -0,0 +1 @@
+8
diff --git a/debian/control b/debian/control
new file mode 100644
index 0000000..7063adf
--- /dev/null
+++ b/debian/control
@@ -0,0 +1,25 @@
+Source: walinuxagent
+Section: python
+Priority: extra
+Maintainer: Ben Howard <ben.howard@ubuntu.com>
+XSBC-Original-Maintainer: Microsoft Corporation <walinuxagent@microsoft.com>
+Build-Depends: debhelper (>= 8), python-all
+Standards-Version: 3.9.3
+XS-Python-Version: all
+Homepage: http://go.microsoft.com/fwlink/?LinkId=250998
+
+Package: walinuxagent
+Architecture: all
+Depends: python (>= 2.4),
+ openssl (>=1.0),
+ openssh-server (>=1:5.9p1),
+ passwd (>=4.1.4.2),
+ util-linux (>=2.0),
+ linux-image-extra-virtual,
+ ${misc:Depends},
+ ${python:Depends}
+Conflicts: network-manager
+Description: Windows Azure Linux Agent
+ The Windows Azure Linux Agent supports the provisioning and running of Linux
+ VMs in the Windows Azure cloud. This package should be installed on Linux
+ disk images that are built to run in the Windows Azure environment.
diff --git a/debian/copyright b/debian/copyright
new file mode 100644
index 0000000..fba1f44
--- /dev/null
+++ b/debian/copyright
@@ -0,0 +1,21 @@
+Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0
+Upstream-Name: walinuxagent
+Upstream-Contact: Microsoft Corporation <walinuxagent@microsoft.com>
+Source: https://github.com/Windows-Azure/WALinuxAgent/
+
+Files: *
+Copyright: 2012, Microsoft Corporation <walinuxagent@microsoft.com>
+License: Apache-2.0
+
+Files: waaagent
+Copyright: 2012, Microsoft Corporation <walinuxagent@microsoft.com>
+ 2012, Ben Howard <ben.howard@canonical.com>
+License: Apache-2.0
+
+Files: debian/*
+Copyright: 2012, Ben Howard <ben.howard@canonical.com>
+License: Apache-2.0
+
+License: Apache-2.0
+ On Debian systems, the complete text of the Apache version 2.0 license
+ can be found in "/usr/share/common-licenses/Apache-2.0".
diff --git a/debian/default b/debian/default
new file mode 100644
index 0000000..a17174c
--- /dev/null
+++ b/debian/default
@@ -0,0 +1,2 @@
+# To disable the Windows Azure Agent, set WALINUXAGENT_ENABLED=0
+WALINUXAGENT_ENABLED=1
diff --git a/debian/dirs b/debian/dirs
new file mode 100644
index 0000000..500a2c6
--- /dev/null
+++ b/debian/dirs
@@ -0,0 +1 @@
+/usr/share/doc/walinuxagent
diff --git a/debian/docs b/debian/docs
new file mode 100644
index 0000000..b924fd1
--- /dev/null
+++ b/debian/docs
@@ -0,0 +1,3 @@
+NOTICE
+LICENSE-2.0.txt
+README
diff --git a/debian/install b/debian/install
new file mode 100644
index 0000000..0c4c492
--- /dev/null
+++ b/debian/install
@@ -0,0 +1 @@
+waagent usr/sbin
diff --git a/debian/patches/000_ubuntu_init_resolvconf.patch b/debian/patches/000_ubuntu_init_resolvconf.patch
new file mode 100644
index 0000000..70c0097
--- /dev/null
+++ b/debian/patches/000_ubuntu_init_resolvconf.patch
@@ -0,0 +1,153 @@
+Description: Microsoft provided walinuxagent does not include the
+ required UFS module, is not resolvconf aware, and does not provide
+ an upstart script; this patch fixes all of that.
+Author: Ben Howard <ben.howard@ubuntu.com>
+Bug-Ubuntu: https://bugs.launchpad.net/bugs/1014864
+Forwarded: yes
+
+--- a/waagent
++++ b/waagent
+@@ -1970,6 +1970,26 @@ esac
+ exit $RETVAL
+ """
+
++Init_Ubuntu = """\
++#walinuxagent - start Windows Azure agent
++
++description "walinuxagent"
++author "Ben Howard <ben.howard@canonical.com>"
++
++start on (filesystem and started rsyslog)
++
++pre-start script
++ if [ ! -x /usr/sbin/waagent ]; then
++ exit 1
++ fi
++
++ #Load the udf module
++ modprobe -b udf
++end script
++
++exec /usr/sbin/waagent -daemon
++"""
++
+ Init_Debian = """\
+ #!/bin/sh
+ ### BEGIN INIT INFO
+@@ -2135,18 +2155,30 @@ def Install():
+ os.remove(GetLastPathElement(a))
+ shutil.move(a, ".")
+ Warn("Moved " + a + " -> " + LibDir + "/" + GetLastPathElement(a) )
+- filename = "waagent"
+- filepath = "/etc/init.d/" + filename
+- distro = IsRedHat() + IsDebian() * 2 + IsSuse() * 3
+- if distro == 0:
+- Error("Unable to detect Linux Distribution.")
+- return 1
+- init = [[Init_RedHat, "chkconfig --add " + filename],
+- [Init_Debian, "update-rc.d " + filename + " defaults"],
+- [Init_Suse, "insserv " + filename]][distro - 1]
+- SetFileContents(filepath, init[0])
+- os.chmod(filepath, 0755)
+- Run(init[1])
++
++ if IsUbuntu():
++ # Support for Ubuntu's upstart configuration
++ filename="waagent.conf"
++ filepath = "/etc/init/" + filename
++ SetFileContents(filepath, Init_Ubuntu)
++ os.chmod(filepath, 0644)
++
++ else:
++ # Regular init.d configurations
++ filename = "waagent"
++ filepath = "/etc/init.d/" + filename
++
++ distro = IsRedHat() + IsDebian() * 2 + IsSuse()
++ if distro == 0:
++ Error("Unable to detect Linux Distribution.")
++ return 1
++ init = [[Init_RedHat, "chkconfig --add " + filename],
++ [Init_Debian, "update-rc.d " + filename + " defaults"],
++ [Init_Suse, "insserv " + filename]][distro - 1]
++ SetFileContents(filepath, init[0])
++ os.chmod(filepath, 0755)
++ Run(init[1])
++
+ if os.path.isfile("/etc/waagent.conf"):
+ try:
+ os.remove("/etc/waagent.conf.old")
+@@ -2179,17 +2211,26 @@ def Uninstall():
+ Warn("Moved " + LibDir + "/" + GetLastPathElement(a) + " -> " + a )
+ except:
+ pass
++
++ filepath = "/etc/init.d/"
+ filename = "waagent"
+- a = IsRedHat() + IsDebian() * 2 + IsSuse() * 3
+- if a == 0:
+- Error("Unable to detect Linux Distribution.")
+- return 1
+- Run("service " + filename + " stop")
+- cmd = ["chkconfig --del " + filename,
+- "update-rc.d -f " + filename + " remove",
+- "insserv -r " + filename][a - 1]
+- Run(cmd)
+- for f in os.listdir(LibDir) + ["/etc/init.d/" + filename, "/etc/waagent.conf", "/etc/logrotate.d/waagent", "/etc/sudoers.d/waagent"]:
++
++ if IsUbuntu():
++ Run("stop " + filename)
++ filepath = "/etc/init/"
++ filename = "waagent.conf"
++ else:
++ a = IsRedHat() + IsDebian() * 2 + IsSuse() * 3
++ if a == 0:
++ Error("Unable to detect Linux Distribution.")
++ return 1
++ Run("service " + filename + " stop")
++ cmd = ["chkconfig --del " + filename,
++ "update-rc.d -f " + filename + " remove",
++ "insserv -r " + filename][a - 1]
++ Run(cmd)
++
++ for f in os.listdir(LibDir) + [filepath + filename, "/etc/waagent.conf", "/etc/logrotate.d/waagent", "/etc/sudoers.d/waagent"]:
+ try:
+ os.remove(f)
+ except:
+@@ -2217,7 +2258,12 @@ def Deprovision(force, deluser):
+
+ print("WARNING! The waagent service will be stopped.")
+ print("WARNING! All SSH host key pairs will be deleted.")
+- print("WARNING! Nameserver configuration in /etc/resolv.conf will be deleted.")
++
++ if IsUbuntu():
++ print("WARNING! Nameserver configuration in /etc/resolvconf/resolv.conf.d/{tail,originial} will be deleted.")
++ else:
++ print("WARNING! Nameserver configuration in /etc/resolv.conf will be deleted.")
++
+ print("WARNING! Cached DHCP leases will be deleted.")
+
+ delRootPass = Config.get("Provisioning.DeleteRootPassword")
+@@ -2253,7 +2299,21 @@ def Deprovision(force, deluser):
+ Run("rm -f " + a + "/*")
+
+ # Clear LibDir, remove nameserver and root bash history
+- for f in os.listdir(LibDir) + ["/etc/resolv.conf", "/root/.bash_history", "/var/log/waagent.log"]:
++ fileBlackList = [ "/root/.bash_history", "/var/log/waagent.log" ]
++
++ # Ubuntu uses resolvconf, so we want to preserve the ability to use resolvconf
++ if IsUbuntu():
++ if os.path.realpath('/etc/resolv.conf') != '/run/resolvconf/resolv.conf':
++ Log("resolvconf is not configured. Removing /etc/resolv.conf")
++ fileBlackList.append('/etc/resolv.conf')
++ else:
++ Log("resolvconf is enabled; leaving /etc/resolv.conf intact")
++ resolvConfD = '/etc/resolvconf/resolv.conf.d/'
++ fileBlackList.extend([resolvConfD + 'tail', resolvConfD + 'originial' ])
++ else:
++ fileBlackList.append(os.listdir(LibDir) + '/etc/resolv.conf')
++
++ for f in os.listdir(LibDir) + fileBlackList:
+ try:
+ os.remove(f)
+ except:
diff --git a/debian/patches/001_ubuntu_agent_startup.patch b/debian/patches/001_ubuntu_agent_startup.patch
new file mode 100644
index 0000000..118bdb0
--- /dev/null
+++ b/debian/patches/001_ubuntu_agent_startup.patch
@@ -0,0 +1,22 @@
+Description: Enablement/disablement via /etc/default/waagent
+ Allow users to control the startup of waagent via /etc/default/waagent.
+ Setting "WAAGENT_ENABLED=0" will turn off the agent at boot time.
+Author: Ben Howard <ben.howard@ubuntu.com>
+Bug-Ubuntu: https://bugs.launchpad.net/bugs/1014864
+
+--- a/waagent
++++ b/waagent
+@@ -1979,6 +1979,13 @@ author "Ben Howard <ben.howard@canonical
+ start on (filesystem and started rsyslog)
+
+ pre-start script
++
++ [ -r /etc/default/walinuxagent ] && . /etc/default/walinuxagent
++
++ if [ "$WALINUXAGENT_ENABLED" != "1" ]; then
++ exit 1
++ fi
++
+ if [ ! -x /usr/sbin/waagent ]; then
+ exit 1
+ fi
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..233ee46
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1,2 @@
+000_ubuntu_init_resolvconf.patch
+001_ubuntu_agent_startup.patch
diff --git a/debian/postinst b/debian/postinst
new file mode 100644
index 0000000..b18aa8e
--- /dev/null
+++ b/debian/postinst
@@ -0,0 +1,23 @@
+#!/bin/sh
+set -e
+case "$1" in
+ configure)
+ waagent --setup --force
+ ;;
+
+ abort-upgrade|abort-remove|abort-deconfigure)
+ if [ -f /etc/init/waagent ]; then
+ rm /etc/init/waagent
+ fi
+ ;;
+
+ *)
+ echo "postinst called with unknown argument \`$1'" >&2
+ exit 1
+ ;;
+esac
+
+#DEBHELPER#
+
+exit 0
+
diff --git a/debian/prerm b/debian/prerm
new file mode 100644
index 0000000..22c87b2
--- /dev/null
+++ b/debian/prerm
@@ -0,0 +1,25 @@
+#!/bin/sh
+set -e
+case "$1" in
+ purge)
+ rm /etc/waagent.conf > /dev/null || true
+ ;;
+
+ remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
+ if [ -x /usr/sbin/waagent ]; then
+ waagent --uninstall
+ fi
+ ;;
+
+ *)
+ echo "postrm called with unknown argument \`$1'" >&2
+ exit 1
+ ;;
+esac
+
+# dh_installdeb will replace this with shell code automatically
+# generated by other debhelper scripts.
+
+#DEBHELPER#
+
+exit 0
diff --git a/debian/rules b/debian/rules
new file mode 100755
index 0000000..7923b65
--- /dev/null
+++ b/debian/rules
@@ -0,0 +1,14 @@
+#!/usr/bin/make -f
+
+DEB_UPSTREAM_VERSION=$(shell dpkg-parsechangelog | sed -rne 's,^Version: ([^-]+).*,\1,p')
+ORIG_COMMIT=$(shell echo $(DEB_UPSTREAM_VERSION) | cut -f3 -d\. )
+ORIG_SRC=https://github.com/Windows-Azure/WALinuxAgent
+
+get-packaged-orig-source:
+ git clone --separate-git-dir=.git \
+ $(ORIG_SRC) orig_source
+ git archive --format=tar.gz $(ORIG_COMMIT) \
+ -o walinuxagent_$(DEB_UPSTREAM_VERSION).orig.tar.gz
+
+%:
+ dh $@ --with python2
diff --git a/debian/source/format b/debian/source/format
new file mode 100644
index 0000000..163aaf8
--- /dev/null
+++ b/debian/source/format
@@ -0,0 +1 @@
+3.0 (quilt)