diff -Nru maas-enlist-0.4/debian/changelog maas-enlist-0.4/debian/changelog --- maas-enlist-0.4/debian/changelog 2012-07-12 18:48:54.000000000 +0000 +++ maas-enlist-0.4/debian/changelog 2012-10-02 15:22:09.000000000 +0000 @@ -1,3 +1,10 @@ +maas-enlist (0.4-0ubuntu1.2) precise-proposed; urgency=low + + * debian/patch/02-add-subarch.patch: Add subarchitecture support for + ARM enablement (LP: #1056816). + + -- Robie Basak Thu, 27 Sep 2012 09:16:44 +0100 + maas-enlist (0.4-0ubuntu1.1) precise-proposed; urgency=low * SRU: Enlist with after_commissioning_action=0 as 2 doesn no longer exist diff -Nru maas-enlist-0.4/debian/patches/02-add-subarch.patch maas-enlist-0.4/debian/patches/02-add-subarch.patch --- maas-enlist-0.4/debian/patches/02-add-subarch.patch 1970-01-01 00:00:00.000000000 +0000 +++ maas-enlist-0.4/debian/patches/02-add-subarch.patch 2012-10-02 15:19:56.000000000 +0000 @@ -0,0 +1,78 @@ +Description: Add subarch support + Add's subarch support in order to support different ARM + architectures. +Author: Robie Basak +Bug-Ubuntu: https://bugs.launchpad.net/bugs/1056816 + +--- maas-enlist-0.4.orig/bin/maas-enlist ++++ maas-enlist-0.4/bin/maas-enlist +@@ -57,14 +57,29 @@ get_host_architecture() { + echo "$arch" + } + ++get_host_subarchitecture() { ++ local arch=$1 ++ case $arch in ++ i386|amd64) ++ # Skip the call to archdetect as that's what ++ # get_host_architecture does ++ echo generic ++ ;; ++ *) ++ archdetect | cut -d'/' -f2 ++ ;; ++ esac ++} ++ + enlist_node() { + serverurl="${1}" + mac="${2}" + arch="${3}" +- hostname="${4}" ++ subarch="${4}" ++ hostname="${5}" + + curl \ +- --data "op=new${mac}&hostname=${hostname}&architecture=${arch}&after_commissioning_action=0" \ ++ --data "op=new${mac}&hostname=${hostname}&architecture=${arch}&subarchitecture=${subarch}&after_commissioning_action=0" \ + "${serverurl}"/MAAS/api/1.0/nodes/ + } + +@@ -84,6 +99,7 @@ Usage: ${0##*/} [ options ] + -n | --hostname hostname of the node to register + -i | --interface interface address to register (obtains MAC address) + -a | --arch architecture of the node to register ++ --subarch subarchitecture of the node to register + + Example: + - ${0##*/} --serverurl 127.0.0.1 --interface eth0 +@@ -94,7 +110,7 @@ EOF + bad_Usage() { Usage 1>&2; [ $# -eq 0 ] || Error "$@"; exit 1; } + + short_opts="hs:n:i:a:" +-long_opts="help,serverurl:,hostname:,interface:,arch:" ++long_opts="help,serverurl:,hostname:,interface:,arch:,subarch:" + getopt_out=$(getopt --name "${0##*/}" \ + --options "${short_opts}" --long "${long_opts}" -- "$@") && + eval set -- "${getopt_out}" || +@@ -108,6 +124,7 @@ while [ $# -ne 0 ]; do + -n|--hostname) hostname=${2}; shift;; + -i|--interface) iface=${2}; shift;; + -a|--arch) arch=${2}; shift;; ++ --subarch) subarch=${2}; shift;; + --) shift; break;; + esac + shift; +@@ -157,7 +174,11 @@ if [ -z "$arch" ]; then + arch=$(get_host_architecture) + fi + ++if [ -z "$subarch" ]; then ++ subarch=$(get_host_subarchitecture $arch) ++fi ++ + # Obtain the MAC addresses data + mac=$(get_mac_address_data "$mac_addrs") + +-enlist_node "$protocol://$servername" "$mac" "$arch" "$hostname" ++enlist_node "$protocol://$servername" "$mac" "$arch" "$subarch" "$hostname" diff -Nru maas-enlist-0.4/debian/patches/series maas-enlist-0.4/debian/patches/series --- maas-enlist-0.4/debian/patches/series 2012-07-12 18:49:43.000000000 +0000 +++ maas-enlist-0.4/debian/patches/series 2012-10-02 15:17:59.000000000 +0000 @@ -1 +1,2 @@ 01-fix-after-commissioning-action.patch +02-add-subarch.patch