summaryrefslogtreecommitdiff
path: root/snappy
diff options
context:
space:
mode:
authorBen Howard <ben.howard@ubuntu.com>2015-12-07 16:48:51 -0700
committerusd-importer <ubuntu-server@lists.ubuntu.com>2015-12-08 16:10:11 +0000
commit83432149e212155469b1e9f06eb0095121377356 (patch)
tree9029a2e7836dce3025d5c5a6527d74bbf8d799e5 /snappy
parent04946cba49f19c0b6b876bccdbb36d47334af002 (diff)
downloadvyos-walinuxagent-83432149e212155469b1e9f06eb0095121377356.tar.gz
vyos-walinuxagent-83432149e212155469b1e9f06eb0095121377356.zip
Import patches-unapplied version 2.1.2-0ubuntu1 to ubuntu/xenial-proposed
Imported using git-ubuntu import. Changelog parent: 04946cba49f19c0b6b876bccdbb36d47334af002 New changelog entries: * New upstream release (LP: #1523715): - Bug fixes for Ubuntu 15.10 on Azure - Enablement for Azure Stack - Dropped patch for systemd job as upstream now includes it.
Diffstat (limited to 'snappy')
-rwxr-xr-xsnappy/bin/waagent49
-rwxr-xr-xsnappy/bin/waagent.start5
-rw-r--r--snappy/lib/readme.md1
-rw-r--r--snappy/meta/package.yaml10
-rw-r--r--snappy/meta/readme.md2
-rw-r--r--snappy/meta/walinuxagent.apparmor85
-rw-r--r--snappy/meta/walinuxagent.seccomp1
-rw-r--r--snappy/readme.md17
-rw-r--r--snappy/waagent.conf70
9 files changed, 240 insertions, 0 deletions
diff --git a/snappy/bin/waagent b/snappy/bin/waagent
new file mode 100755
index 0000000..e65bc0c
--- /dev/null
+++ b/snappy/bin/waagent
@@ -0,0 +1,49 @@
+#!/usr/bin/env python
+#
+# Azure Linux Agent
+#
+# Copyright 2015 Microsoft Corporation
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+# Requires Python 2.6+ and Openssl 1.0+
+#
+# Implements parts of RFC 2131, 1541, 1497 and
+# http://msdn.microsoft.com/en-us/library/cc227282%28PROT.10%29.aspx
+# http://msdn.microsoft.com/en-us/library/cc227259%28PROT.13%29.aspx
+#
+
+import os
+import imp
+import sys
+
+if __name__ == '__main__' :
+ import azurelinuxagent.agent as agent
+ """
+ Invoke main method of agent
+ """
+ agent.main()
+
+if __name__ == 'waagent':
+ """
+ Load waagent2.0 to support old version of extensions
+ """
+ if sys.version_info[0] == 3:
+ raise ImportError("waagent2.0 doesn't support python3")
+ bin_path = os.path.dirname(os.path.abspath(__file__))
+ agent20_path = os.path.join(bin_path, "waagent2.0")
+ if not os.path.isfile(agent20_path):
+ raise ImportError("Can't load waagent")
+ agent20 = imp.load_source('waagent', agent20_path)
+ __all__ = dir(agent20)
+
diff --git a/snappy/bin/waagent.start b/snappy/bin/waagent.start
new file mode 100755
index 0000000..ec71224
--- /dev/null
+++ b/snappy/bin/waagent.start
@@ -0,0 +1,5 @@
+#!/bin/bash
+
+export PYTHONPATH="${PATH}:${SNAP_APP_PATH}/lib"
+
+python3 ${SNAP_APP_PATH}/bin/waagent -daemon
diff --git a/snappy/lib/readme.md b/snappy/lib/readme.md
new file mode 100644
index 0000000..c91a79c
--- /dev/null
+++ b/snappy/lib/readme.md
@@ -0,0 +1 @@
+Copy the azurelinuxagent folder here
diff --git a/snappy/meta/package.yaml b/snappy/meta/package.yaml
new file mode 100644
index 0000000..85e4835
--- /dev/null
+++ b/snappy/meta/package.yaml
@@ -0,0 +1,10 @@
+name: walinuxagent
+version: 2.1.1
+vendor: Microsoft Corporation <lizzha@microsoft.com>
+type: framework
+services:
+ - name: walinuxagent
+ start: bin/waagent.start
+ security-policy:
+ apparmor: meta/walinuxagent.apparmor
+ seccomp: meta/walinuxagent.seccomp
diff --git a/snappy/meta/readme.md b/snappy/meta/readme.md
new file mode 100644
index 0000000..33a7768
--- /dev/null
+++ b/snappy/meta/readme.md
@@ -0,0 +1,2 @@
+Microsoft Azure Linux Agent Snap Framework
+
diff --git a/snappy/meta/walinuxagent.apparmor b/snappy/meta/walinuxagent.apparmor
new file mode 100644
index 0000000..8315713
--- /dev/null
+++ b/snappy/meta/walinuxagent.apparmor
@@ -0,0 +1,85 @@
+# AppArmor confinement for waagent
+
+#include <tunables/global>
+
+# Specified profile variables
+###VAR###
+
+###PROFILEATTACH### flags=(attach_disconnected) {
+ #include <abstractions/base>
+ #include <abstractions/ssl_certs>
+ #include <abstractions/openssl>
+ #include <abstractions/python>
+
+ # Executable binaries
+ /usr/{,s}bin/* ixr,
+ /{,s}bin/* ixr,
+
+ # Capabilities
+ capability net_bind_service,
+ capability net_raw,
+ capability net_admin,
+ capability dac_override,
+ capability sys_module,
+ capability sys_admin,
+ capability sys_ptrace,
+
+ ptrace (read),
+ ptrace (trace),
+
+ mount,
+ umount,
+ network,
+
+ # Log path
+ /var/log/waagent.log rw,
+ /var/log/azure/ rw,
+ /var/log/azure/** rw,
+
+ # Lib path
+ /var/lib/waagent/ rw,
+ /var/lib/waagent/** mrwlk,
+ # Enable VM extensions to execute unconfined
+ /var/lib/waagent/** PUx,
+ /{,usr/}lib/ r,
+ /{,usr/}lib/** r,
+
+ /etc/ r,
+ /etc/** r,
+ /etc/udev/rules.d/** w,
+
+ /usr/share/ r,
+ /usr/share/** r,
+ /usr/local/{,s}bin/ r,
+ /usr/{,s}bin/ r,
+ /{,s}bin/ r,
+
+ /dev/ r,
+ /dev/sr0 r,
+ /dev/null w,
+ /dev/console rw,
+ /dev/tty rw,
+
+ /run/ r,
+ /run/** r,
+ /run/mount/utab w,
+ /run/waagent.pid w,
+
+ @{PROC}/ r,
+ @{PROC}/** r,
+
+ /sys/module/ r,
+ /sys/module/** r,
+ /sys/firmware/acpi/tables/** r,
+ /sys/block/ r,
+ /sys/block/sd*/device/timeout rw,
+ /sys/devices/** rw,
+
+ /mnt/cdrom/ rw,
+ /mnt/cdrom/secure/ rw,
+
+ # Writable for the install directory
+ @{CLICK_DIR}/@{APP_PKGNAME}/ r,
+ @{CLICK_DIR}/@{APP_PKGNAME}/@{APP_VERSION}/ r,
+ @{CLICK_DIR}/@{APP_PKGNAME}/@{APP_VERSION}/** mrwklix,
+}
diff --git a/snappy/meta/walinuxagent.seccomp b/snappy/meta/walinuxagent.seccomp
new file mode 100644
index 0000000..90fbc81
--- /dev/null
+++ b/snappy/meta/walinuxagent.seccomp
@@ -0,0 +1 @@
+@unrestricted
diff --git a/snappy/readme.md b/snappy/readme.md
new file mode 100644
index 0000000..348895e
--- /dev/null
+++ b/snappy/readme.md
@@ -0,0 +1,17 @@
+### Building the walinuxagent snap package
+
+1. You will need the snappy developer tools on your Ubuntu Developer Desktop:
+
+ $ sudo add-apt-repository ppa:snappy-dev/tools
+ $ sudo apt-get update
+ $ sudo apt-get upgrade
+ $ sudo apt-get install snappy-tools
+
+2. Copy the azurelinuxagent folder to snappy/lib
+
+ $ cp -rf azurelinuxagent snappy/lib
+
+3. Build the snap package under the snappy folder
+
+ $ cd snappy
+ $ snappy build \ No newline at end of file
diff --git a/snappy/waagent.conf b/snappy/waagent.conf
new file mode 100644
index 0000000..74dccb8
--- /dev/null
+++ b/snappy/waagent.conf
@@ -0,0 +1,70 @@
+#
+# Microsoft Azure Linux Agent Configuration
+#
+
+# Specified program is invoked with the argument "Ready" when we report ready status
+# to the endpoint server.
+Role.StateConsumer=None
+
+# Specified program is invoked with XML file argument specifying role
+# configuration.
+Role.ConfigurationConsumer=None
+
+# Specified program is invoked with XML file argument specifying role topology.
+Role.TopologyConsumer=None
+
+# Enable instance creation
+Provisioning.Enabled=n
+
+# Password authentication for root account will be unavailable.
+Provisioning.DeleteRootPassword=y
+
+# Generate fresh host key pair.
+Provisioning.RegenerateSshHostKeyPair=n
+
+# Supported values are "rsa", "dsa" and "ecdsa".
+Provisioning.SshHostKeyPairType=rsa
+
+# Monitor host name changes and publish changes via DHCP requests.
+Provisioning.MonitorHostName=n
+
+# Decode CustomData from Base64.
+Provisioning.DecodeCustomData=n
+
+# Execute CustomData after provisioning.
+Provisioning.ExecuteCustomData=n
+
+# Format if unformatted. If 'n', resource disk will not be mounted.
+ResourceDisk.Format=n
+
+# File system on the resource disk
+# Typically ext3 or ext4. FreeBSD images should use 'ufs2' here.
+ResourceDisk.Filesystem=ext4
+
+# Mount point for the resource disk
+ResourceDisk.MountPoint=/mnt/resource
+
+# Create and use swapfile on resource disk.
+ResourceDisk.EnableSwap=n
+
+# Size of the swapfile.
+ResourceDisk.SwapSizeMB=0
+
+# Respond to load balancer probes if requested by Microsoft Azure.
+LBProbeResponder=y
+
+# Enable verbose logging (y|n)
+Logs.Verbose=n
+
+# Root device timeout in seconds.
+OS.RootDeviceScsiTimeout=300
+
+# If "None", the system default version is used.
+OS.OpensslPath=None
+
+# If set, agent will use proxy server to access internet
+#HttpProxy.Host=None
+#HttpProxy.Port=None
+
+# Detect Scvmm environment, default is n
+# DetectScvmmEnv=n