From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id 5E6029A9E for ; Mon, 18 May 2015 10:23:54 +0200 (CEST) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga103.fm.intel.com with ESMTP; 18 May 2015 01:23:52 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.13,452,1427785200"; d="scan'208";a="696454359" Received: from pgsmsx101.gar.corp.intel.com ([10.221.44.78]) by orsmga001.jf.intel.com with ESMTP; 18 May 2015 01:23:52 -0700 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by PGSMSX101.gar.corp.intel.com (10.221.44.78) with Microsoft SMTP Server (TLS) id 14.3.224.2; Mon, 18 May 2015 16:23:28 +0800 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.120]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.180]) with mapi id 14.03.0224.002; Mon, 18 May 2015 16:23:27 +0800 From: "Xu, HuilongX" To: "Jiajia, SunX" , "dts@dpdk.org" Thread-Topic: =?utf-8?B?W2R0c10gW+KAmGR0cy12MeKAmSA0LzldIEFkZCBWTSBjbGFzcyBhbmQgdGhl?= =?utf-8?B?IHZpcnR1YWwgRFVUIGNsYXNzIGFuZCB0aGUgdmlydHVhbCByZXNvdXJjZSBt?= =?utf-8?Q?odule?= Thread-Index: AQHQkSiYDLDAONkCJEihMMLMUlR+152BX3SQ Date: Mon, 18 May 2015 08:23:27 +0000 Message-ID: References: <1431925646-1314-1-git-send-email-sunx.jiajia@intel.com> <1431925646-1314-5-git-send-email-sunx.jiajia@intel.com> In-Reply-To: <1431925646-1314-5-git-send-email-sunx.jiajia@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-cr-hashedpuzzle: AKYt AfKL BH0Z BQ3f CRJ/ Cd2K Fwaj GrKU Hf8G Inrc I4aq I8me JpEf J0Kx J1Mr KVav; 1; ZAB0AHMAQABkAHAAZABrAC4AbwByAGcA; Sosha1_v1; 7; {BD103E6B-143A-4219-B425-2DC1A26E101C}; aAB1AGkAbABvAG4AZwB4AC4AeAB1AEAAaQBuAHQAZQBsAC4AYwBvAG0A; Mon, 18 May 2015 08:23:25 GMT; UgBFADoAIABbAGQAdABzAF0AIABbABggZAB0AHMALQB2ADEAGSAgADQALwA5AF0AIABBAGQAZAAgAFYATQAgAGMAbABhAHMAcwAgAGEAbgBkACAAdABoAGUAIAB2AGkAcgB0AHUAYQBsACAARABVAFQAIABjAGwAYQBzAHMAIABhAG4AZAAgAHQAaABlACAAdgBpAHIAdAB1AGEAbAAgAHIAZQBzAG8AdQByAGMAZQAgAG0AbwBkAHUAbABlAA== x-cr-puzzleid: {BD103E6B-143A-4219-B425-2DC1A26E101C} x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 MIME-Version: 1.0 Subject: Re: [dts] =?utf-8?b?W+KAmGR0cy12MeKAmSA0LzldIEFkZCBWTSBjbGFzcyBhbmQg?= =?utf-8?q?the_virtual_DUT_class_and_the_virtual_resource_module?= X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: test suite reviews and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 May 2015 08:23:55 -0000 SGkgSmlhamlhLA0KSSBoYXZlIGEgY29tbWVudCBhdCAiQEAgLTIwMiw3ICsyMTMsNyBAQCBjbGFz cyBEUERLZHV0KER1dCk6Ig0KDQpXb3VsZCB5b3UgY2hlY2sgaXQsIHRoYW5rcyAgYSBsb3QuDQot LS0tLU9yaWdpbmFsIE1lc3NhZ2UtLS0tLQ0KRnJvbTogZHRzIFttYWlsdG86ZHRzLWJvdW5jZXNA ZHBkay5vcmddIE9uIEJlaGFsZiBPZiBzamlhamlheA0KU2VudDogTW9uZGF5LCBNYXkgMTgsIDIw MTUgMTowNyBQTQ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5IHRoaXMgcGFyYW0sIHRoZSBzcGVjaWZpZWQgdmNwdXMgd2ls bA0KKyAgICAgICAgYmUgcGlubmVkIHRvIFZNIGJ5IHRoZSBjb21tYW5kICd0YXNrc2V0JyB3aGVu DQorICAgICAgICBzdGFydGluZyB0aGUgVk0uDQorICAgICAgICBleGFtcGxlOg0KKyAgICAgICAg ICAgIHZjcHVzX3Bpbm5lZF90b192bSA9ICcxIDIgMyA0Jw0KKyAgICAgICAgICAgIHRhc2tzZXQg LWMgMSwyLDMsNCBxZW11LWJvb3QtY29tbWFuZC1saW5lDQorICAgICAgICAiIiINCisgICAgICAg IHNlbGYudmNwdXNfcGlubmVkX3RvX3ZtID0gJycNCisNCisgICAgICAgICMgaW5pdGlhbGl6ZSBh c3NpZ25lZCBQQ0kNCisgICAgICAgIHNlbGYuYXNzaWduZWRfcGNpcyA9IFtdDQorDQorICAgIGRl ZiBnZXRfdmlydF90eXBlKHNlbGYpOg0KKyAgICAgICAgIiIiDQorICAgICAgICBHZXQgdGhlIHZp cnR1YWwgdHlwZS4NCisgICAgICAgICIiIg0KKyAgICAgICAgcmV0dXJuICdLVk0nDQorDQorICAg IGRlZiBnZXRfcWVtdV9lbXVsYXRvcihzZWxmKToNCisgICAgICAgICIiIg0KKyAgICAgICAgR2V0 IHRoZSBxZW11IGVtdWxhdG9yIGJhc2VkIG9uIHRoZSBjcmIuDQorICAgICAgICAiIiINCisgICAg ICAgIGFyY2ggPSBzZWxmLmhvc3Rfc2Vzc2lvbi5zZW5kX2V4cGVjdCgndW5hbWUgLW0nLCAnIyAn KQ0KKyAgICAgICAgcmV0dXJuICdxZW11LXN5c3RlbS0nICsgYXJjaA0KKw0KKyAgICBkZWYgc2V0 X3FlbXVfZW11bGF0b3Ioc2VsZiwgcWVtdV9lbXVsYXRvcik6DQorICAgICAgICAiIiINCisgICAg ICAgIFNldCB0aGUgcWVtdSBlbXVsYXRvciBleHBsaWNpdGx5Lg0KKyAgICAgICAgIiIiDQorICAg ICAg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sg aW1hZ2VfcGF0aC5zdHJpcCgpLnNwbGl0KCcvJylbLTFdICsgJyAnDQorICAgICAgICBpZiBpbWFn ZV9wYXRoIGluIHFlbXVfY21kX2xpbmVzIG9yIFwNCisgICAgICAgICAgICAgICAgaW1hZ2VfbmFt ZV9mbGFnIGluIHFlbXVfY21kX2xpbmVzOg0KKyAgICAgICAgICAgIHJldHVybiBUcnVlDQorICAg ICAgICByZXR1cm4gRmFsc2UNCisNCisgICAgZGVmIF9fYWRkX2Jvb3RfbGluZShzZWxmLCBvcHRp b25fYm9vdF9saW5lKToNCisgICAgICAgICIiIg0KKyAgICAgICAgQWRkIGJvb3Qgb3B0aW9uIGlu dG8gdGhlIGJvb3QgbGluZS4NCisgICAgICAgICIiIg0KKyAgICAgICAgc2VwYXJhdG9yID0gJyAn DQorICAgICAgICBzZWxmLndob2xlX3FlbXVfa3ZtX2Jvb3RfbGluZSArPSBzZXBhcmF0b3IgKyBv cHRpb25fYm9vdF9saW5lDQorDQorICAgIGRlZiBzZXRfdm1fZW5hYmxlX2t2bShzZWxmLCBlbmFi bGU9J3llcycpOg0KKyAgICAgICAgIiIiDQorICAgICAgICBTZXQgVk0gYm9vdCBvcHRpb24gdG8g ZW5hYmxlIHRoZSBvcHRpb24gJ2VuYWJsZS1rdm0nLg0KKyAgICAgICAgIiIiDQorICAgICAgICBz ZWxmLnBhcmFtcy5hcHBlbmQoeydlbmFibGVfa3ZtJzogW3snZW5hYmxlJzogJyVzJyAlIGVuYWJs ZX1dfSkNCisNCisgICAgZGVmIGFkZF92bV9lbmFibGVfa3ZtKHNlbGYsICoqb3B0aW9ucyk6DQor ICAgICAgICAiIiINCisgICAgICAgICdlbmFibGUnOiAneWVzJw0KKyAgICAgICAgIiIiDQorICAg ICAgICBpZiAnZW5hYmxlJyBpbiBvcHRpb25zLmtleXMoKSBhbmQgXA0KKyAgICAgICAgICAgICAg ICBvcHRpb25zWydlbmFibGUnXSA9PSAneWVzJzoNCisgICAgICAgICAgICBlbmFibGVfa3ZtX2Jv b3RfbGluZSA9ICctZW5hYmxlLWt2bScNCisgICAgICAgICAgICBzZWxmLl9fYWRkX2Jvb3RfbGlu ZShlbmFibGVfa3ZtX2Jvb3RfbGluZSkNCisNCisgICAgZGVmIHNldF92bV9uYW1lKHNlbGYsIHZt X25hbWUpOg0KKyAgICAgICAgIiIiDQorICAgICAgICBTZXQgVk0gbmFtZS4NCisgICAgICAgICIi Ig0KKyAgICAgICAgc2VsZi5wYXJhbXMuYXBwZW5kKHsnbmFtZSc6IFt7J25hbWUnOiAnJXMnICUg dm1fbmFtZX1dfSkNCisNCisgICAgZGVmIGFkZF92bV9uYW1lKHNlbGYsICoqb3B0aW9ucyk6DQor ICAgICAgICAiIiINCisgICAgICAgIG5hbWU6IHZtMQ0KKyAgICAgICAgIiIiDQorICAgICAgICBp ZiAnbmFtZScgaW4gb3B0aW9ucy5rZXlzKCkgYW5kIFwNCisgICAgICAgICAgICAgICAgb3B0aW9u c1snbmFtZSddOg0KKyAgICAgICAgICAgIG5hbWVfYm9vdF9saW5lID0gJy1uYW1lICVzJyAlIG9w dGlvbnNbJ25hbWUnXQ0KKyAgICAgICAgICAgIHNlbGYuX19hZGRfYm9vdF9saW5lKG5hbWVfYm9v dF9saW5lKQ0KKw0KKyAgICBkZWYgYWRkX3ZtX2NwdShzZWxmLCAqKm9wdGlvbnMpOg0KKyAgICAg ICAgIiIiDQorICAgICAgICBtb2RlbDogW2hvc3QgfCBjb3JlMmR1byB8IC4uLl0NCisgICAgICAg ICAgICAgICB1c2FnZToNCisgICAgICAgICAgICAgICAgICAgIGNob29zZSBtb2RlbCB2YWx1ZSBm cm9tIHRoZSBjb21tYW5kDQorICAgICAgICAgICAgICAgICAgICAgICAgcWVtdS1zeXN0ZW0teDg2 XzY0IC1jcHUgaGVscA0KKyAgICAgICAgbnVtYmVyOiAnNCcgI251bWJlciBvZiB2Y3B1cw0KKyAg ICAgICAgY3B1cGluOiAnMyA0IDUgNicgIyBob3N0IGNwdSBsaXN0DQorICAgICAgICAiIiINCisg ICAgICAgIGlmICdtb2RlbCcgaW4gb3B0aW9ucy5rZXlzKCkgYW5kIFwNCisgICAgICAgICAgICAg ICAgb3B0aW9uc1snbW9kZWwnXToNCisgICAgICAgICAgICBjcHVfYm9vdF9saW5lID0gJy1jcHUg JXMnICUgb3B0aW9uc1snbW9kZWwnXQ0KKyAgICAgICAgICAgIHNlbGYuX19hZGRfYm9vdF9saW5l KGNwdV9ib290X2xpbmUpDQorICAgICAgICBpZiAnbnVtYmVyJyBpbiBvcHRpb25zLmtleXMoKSBh bmQgXA0KKyAgICAgICAgICAgICAgICBvcHRpb25zWydudW1iZXInXToNCisgICAgICAgICAgICBz bXBfY21kX2xpbmUgPSAnLXNtcCAlZCcgJSBpbnQob3B0aW9uc1snbnVtYmVyJ10pDQorICAgICAg ICAgICAgc2VsZi5fX2FkZF9ib290X2xpbmUoc21wX2NtZF9saW5lKQ0KKyAgICAgICAgaWYgJ2Nw dXBpbicgaW4gb3B0aW9ucy5rZXlzKCkgYW5kIFwNCisgICAgICAgICAgICAgICAgb3B0aW9uc1sn Y3B1cGluJ106DQorICAgICAgICAgICAgc2VsZi52Y3B1c19waW5uZWRfdG9fdm0gPSBzdHIob3B0 aW9uc1snY3B1cGluJ10pDQorDQorICAgIGRlZiBhZGRfdm1fbWVtKHNlbGYsICoqb3B0aW9ucyk6 DQorICAgICAgICAiIiINCisgICAgICAgIHNpemU6IDEwMjQNCisgICAgICAgICIiIg0KKyAgICAg ICAgaWYgJ3NpemUnIGluIG9wdGlvbnMua2V5cygpOg0KKyAgICAgICAgICAgIG1lbV9ib290X2xp bmUgPSAnLW0gJXMnICUgb3B0aW9uc1snc2l6ZSddDQorICAgICAgICAgICAgc2VsZi5fX2FkZF9i b290X2xpbmUobWVtX2Jvb3RfbGluZSkNCisNCisgICAgZGVmIGFkZF92bV9kaXNrKHNlbGYsICoq b3B0aW9ucyk6DQorICAgICAgICAiIiINCisgICAgICAgIGZpbGU6IC9ob21lL2ltYWdlL3Rlc3Qu aW1nDQorICAgICAgICAiIiINCisgICAgICAgIGlmICdmaWxlJyBpbiBvcHRpb25zLmtleXMoKToN CisgICAgICAgICAgICBkaXNrX2Jvb3RfbGluZSA9ICctZHJpdmUgZmlsZT0lcycgJSBvcHRpb25z WydmaWxlJ10NCisgICAgICAgICAgICBzZWxmLl9fYWRkX2Jvb3RfbGluZShkaXNrX2Jvb3RfbGlu ZSkNCisNCisgICAgZGVmIGFkZF92bV9uZXQoc2VsZiwgKipvcHRpb25zKToNCisgICAgICAgICIi Ig0KKyAgICAgICAgQWRkIFZNIG5ldCBkZXZpY2UuDQorICAgICAgICB0eXBlOiBbbmljIHwgdXNl ciB8IHRhcCB8IGJyaWRnZSB8IC4uLl0NCisgICAgICAgIG9wdF9bdmxhbiB8IGZkIHwgYnIgfCBt YWMgfCAuLi5dDQorICAgICAgICAgICAgbm90ZTp0aGUgc3ViLW9wdGlvbiB3aWxsIGJlIGRlY2lk ZWQgYWNjb3JkaW5nIHRvIHRoZSBuZXQgdHlwZS4NCisgICAgICAgICIiIg0KKyAgICAgICAgaWYg J3R5cGUnIGluIG9wdGlvbnMua2V5cygpOg0KKyAgICAgICAgICAgIGlmICdvcHRfdmxhbicgbm90 IGluIG9wdGlvbnMua2V5cygpOg0KKyAgICAgICAgICAgICAgICBvcHRpb25zWydvcHRfdmxhbidd ID0gJzAnDQorICAgICAgICAgICAgaWYgb3B0aW9uc1sndHlwZSddID09ICduaWMnOg0KKyAgICAg ICAgICAgICAgICBzZWxmLl9fYWRkX3ZtX25ldF9uaWMoKipvcHRpb25zKQ0KKyAgICAgICAgICAg IGlmIG9wdGlvbnNbJ3R5cGUnXSA9PSAndXNlcic6DQorICAgICAgICAgICAgICAgIHNlbGYuX19h ZGRfdm1fbmV0X3VzZXIoKipvcHRpb25zKQ0KKyAgICAgICAgICAgIGlmIG9wdGlvbnNbJ3R5cGUn XSA9PSAndGFwJzoNCisgICAgICAgICAgICAgICAgc2VsZi5fX2FkZF92bV9uZXRfdGFwKCoqb3B0 aW9ucykNCisNCisgICAgICAgICAgICBpZiBvcHRpb25zWyd0eXBlJ10gPT0gJ3VzZXInOg0KKyAg ICAgICAgICAgICAgICBzZWxmLm5ldF90eXBlID0gJ2hvc3Rmd2QnDQorICAgICAgICAgICAgZWxp ZiBvcHRpb25zWyd0eXBlJ10gaW4gWyd0YXAnLCAnYnJpZGdlJ106DQorICAgICAgICAgICAgICAg IHNlbGYubmV0X3R5cGUgPSAnYnJpZGdlJw0KKw0KKyAgICBkZWYgX19hZGRfdm1fbmV0X25pYyhz ZWxmLCAqKm9wdGlvbnMpOg0KKyAgICAgICAgIiIiDQorICAgICAgICB0eXBlOiBuaWMNCisgICAg ICAgIG9wdF92bGFuOiAwDQorICAgICAgICAgICAgbm90ZTogRGVmYXVsdCBpcyAwLg0KKyAgICAg ICAgb3B0X21hY2FkZHI6IDAwOjAwOjAwOjAwOjAxOjAxDQorICAgICAgICAgICAgbm90ZTogaWYg Y3JlYXRpbmcgYSBuaWMsIGl0YHMgYmV0dGVyIHRvIHNwZWNpZnkgYSBNQUMsDQorICAgICAgICAg ICAgICAgICAgZWxzZSBpdCB3aWxsIGdldCBhIHJhbmRvbSBudW1iZXIuDQorICAgICAgICBvcHRf bW9kZWw6WyJlMTAwMCIgfCAidmlydGlvIiB8ICJpODI1NTEiIHwgLi4uXQ0KKyAgICAgICAgICAg IG5vdGU6IERlZmF1bHQgaXMgZTEwMDAuDQorICAgICAgICBvcHRfbmFtZTogJ25pYzEnDQorICAg ICAgICBvcHRfYWRkcjogJycNCisgICAgICAgICAgICBub3RlOiBQQ0kgY2FyZHMgb25seS4NCisg ICAgICAgIG9wdF92ZWN0b3JzOg0KKyAgICAgICAgICAgIG5vdGU6IFRoaXMgb3B0aW9uIGN1cnJl bnRseSBvbmx5IGFmZmVjdHMgdmlydGlvIGNhcmRzLg0KKyAgICAgICAgIiIiDQorICAgICAgICBu ZXRfYm9vdF9saW5lID0gJy1uZXQgbmljJw0KKyAgICAgICAgc2VwYXJhdG9yID0gJywnDQorICAg ICAgICBpZiAnb3B0X3ZsYW4nIGluIG9wdGlvbnMua2V5cygpIGFuZCBcDQorICAgICAgICAgICAg ICAgIG9wdGlvbnNbJ29wdF92bGFuJ106DQorICAgICAgICAgICAgbmV0X2Jvb3RfbGluZSArPSBz ZXBhcmF0b3IgKyAndmxhbj0lcycgJSBvcHRpb25zWydvcHRfdmxhbiddDQorDQorICAgICAgICAj IGFkZCBNQUMgaW5mbw0KKyAgICAgICAgaWYgJ29wdF9tYWNhZGRyJyBpbiBvcHRpb25zLmtleXMo KSBhbmQgXA0KKyAgICAgICAgICAgICAgICBvcHRpb25zWydvcHRfbWFjYWRkciddOg0KKyAgICAg ICAgICAgIG1hYyA9IG9wdGlvbnNbJ29wdF9tYWNhZGRyJ10NCisgICAgICAgIGVsc2U6DQorICAg ICAgICAgICAgbWFjID0gc2VsZi5nZW5lcmF0ZV91bmlxdWVfbWFjKCkNCisgICAgICAgIG5ldF9i b290X2xpbmUgKz0gc2VwYXJhdG9yICsgJ21hY2FkZHI9JXMnICUgbWFjDQorDQorICAgICAgICBp ZiAnb3B0X21vZGVsJyBpbiBvcHRpb25zLmtleXMoKSBhbmQgXA0KKyAgICAgICAgICAgICAgICBv cHRpb25zWydvcHRfbW9kZWwnXToNCisgICAgICAgICAgICBuZXRfYm9vdF9saW5lICs9IHNlcGFy YXRvciArICdtb2RlbD0lcycgJSBvcHRpb25zWydvcHRfbW9kZWwnXQ0KKyAgICAgICAgaWYgJ29w dF9uYW1lJyBpbiBvcHRpb25zLmtleXMoKSBhbmQgXA0KKyAgICAgICAgICAgICAgICBvcHRpb25z WydvcHRfbmFtZSddOg0KKyAgICAgICAgICAgIG5ldF9ib290X2xpbmUgKz0gc2VwYXJhdG9yICsg J25hbWU9JXMnICUgb3B0aW9uc1snb3B0X25hbWUnXQ0KKyAgICAgICAgaWYgJ29wdF9hZGRyJyBp biBvcHRpb25zLmtleXMoKSBhbmQgXA0KKyAgICAgICAgICAgICAgICBvcHRpb25zWydvcHRfYWRk ciddOg0KKyAgICAgICAgICAgIG5ldF9ib290X2xpbmUgKz0gc2VwYXJhdG9yICsgJ2FkZHI9JXMn ICUgb3B0aW9uc1snb3B0X2FkZHInXQ0KKyAgICAgICAgaWYgJ29wdF92ZWN0b3JzJyBpbiBvcHRp b25zLmtleXMoKSBhbmQgXA0KKyAgICAgICAgICAgICAgICBvcHRpb25zWydvcHRfdmVjdG9ycydd Og0KKyAgICAgICAgICAgIG5ldF9ib290X2xpbmUgKz0gc2VwYXJhdG9yICsgJ3ZlY3RvcnM9JXMn ICUgb3B0aW9uc1snb3B0X3ZlY3RvcnMnXQ0KKw0KKyAgICAgICAgaWYgc2VsZi5fX3N0cmluZ19o YXNfbXVsdGlfZmllbGRzKG5ldF9ib290X2xpbmUsIHNlcGFyYXRvcik6DQorICAgICAgICAgICAg c2VsZi5fX2FkZF9ib290X2xpbmUobmV0X2Jvb3RfbGluZSkNCisNCisgICAgZGVmIF9fYWRkX3Zt X25ldF91c2VyKHNlbGYsICoqb3B0aW9ucyk6DQorICAgICAgICAiIiINCisgICAgICAgIHR5cGU6 IHVzZXINCisgICAgICAgIG9wdF92bGFuOiAwDQorICAgICAgICAgICAgbm90ZTogZGVmYXVsdCBp cyAwLg0KKyAgICAgICAgb3B0X2hvc3Rmd2Q6IFt0Y3B8dWRwXTpbaG9zdGFkZHJdOmhvc3Rwb3J0 LVtndWVzdGFkZHJdOmd1ZXN0cG9ydA0KKyAgICAgICAgIiIiDQorICAgICAgICBuZXRfYm9vdF9s aW5lID0gJy1uZXQgdXNlcicNCisgICAgICAgIHNlcGFyYXRvciA9ICcsJw0KKyAgICAgICAgaWYg J29wdF92bGFuJyBpbiBvcHRpb25zLmtleXMoKSBhbmQgXA0KKyAgICAgICAgICAgICAgICBvcHRp b25zWydvcHRfdmxhbiddOg0KKyAgICAgICAgICAgIG5ldF9ib290X2xpbmUgKz0gc2VwYXJhdG9y ICsgJ3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J1ZHAiXT86JXM/OlxkKy0lcz86XGQrJyAlIChy ZWd4X2lwLCByZWd4X2lwKQ0KKyAgICAgICAgaWYgbm90IHJlLm1hdGNoKHJlZ3hfaG9zdGZ3ZCwg b3B0X2hvc3Rmd2QpOg0KKyAgICAgICAgICAgIHJhaXNlIEV4Y2VwdGlvbigiT3B0aW9uIG9wdF9o b3N0ZndkIGZvcm1hdCBpcyBub3QgY29ycmVjdCxcbiIgKw0KKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAiaXQgaXMgJXMsXG4gIiAlIG9wdF9ob3N0ZndkICsNCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIml0IHNob3VsZCBiZSBbdGNwfHVkcF06W2hvc3RhZGRyXTpob3N0cG9ydC0i ICsNCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIltndWVzdGFkZHJdOmd1ZXN0cG9ydC5c biIpDQorDQorICAgIGRlZiBfX3BhcnNlX25ldF91c2VyX29wdF9ob3N0ZndkKHNlbGYsIG9wdF9o b3N0ZndkKToNCisgICAgICAgICIiIg0KKyAgICAgICAgUGFyc2UgdGhlIGJvb3Qgb3B0aW9uICdo b3N0ZndkJy4NCisgICAgICAgICIiIg0KKyAgICAgICAgc2VwYXJhdG9yID0gJzonDQorICAgICAg ICBmaWVsZCA9IGxhbWJkYSBvcHRpb24sIGluZGV4LCBzZXBhcmF0b3I9JzonOiBcDQorICAgICAg ICAgICAgb3B0aW9uLnNwbGl0KHNlcGFyYXRvcilbaW5kZXhdDQorDQorICAgICAgICAjIGdldCB0 aGUgZm9yd29yZCB0eXBlDQorICAgICAgICBmd2RfdHlwZSA9IGZpZWxkKG9wdF9ob3N0ZndkLCAw KQ0KKyAgICAgICAgaWYgbm90IGZ3ZF90eXBlOg0KKyAgICAgICAgICAgIGZ3ZF90eXBlID0gJ3Rj cCcNCisNCisgICAgICAgICMgZ2V0IHRoZSBob3N0IGFkZHINCisgICAgICAgIGhvc3RfYWRkciA9 IGZpZWxkKG9wd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ICAgICAnLScgKyBcDQorICAgICAgICAgICAgZ3Vl c3RfYWRkciArIHNlcGFyYXRvciArIFwNCisgICAgICAgICAgICBndWVzdF9wb3J0DQorDQorICAg ICAgICAjIGluaXQgdGhlIHJlZGlyZWN0IGluY29taW5nIFRDUCBvciBVRFAgY29ubmVjdGlvbnMN CisgICAgICAgICMganVzdCBjb21iaW5lIGhvc3QgYWRkcmVzcyBhbmQgaG9zdCBwb3J0LCBpdCBp cyBlbm91Z2gNCisgICAgICAgICMgZm9yIHVzaW5nIHNzaCB0byBjb25uZWN0IHdpdGggVk0NCisg ICAgICAgIHNlbGYuaG9zdGZ3ZF9hZGRyID0gaG9zdF9hZGRyICsgc2VwYXJhdG9yICsgaG9zdF9w b3J0DQorDQorICAgICAgICByZXR1cm4gaG9zdGZ3ZF9saW5lDQorDQorICAgIGRlZiBfX2FkZF92 bV9uZXRfdGFwKHNlbGYsICoqb3B0aW9ucyk6DQorICAgICAgICAiIiINCisgICAgICAgIHR5cGU6 IHRhcA0KKyAgICAgICAgb3B0X3ZsYW46IDANCisgICAgICAgICAgICBub3RlOiBkZWZhdWx0IGlz IDAuDQorICAgICAgICBvcHRfYnI6IGJyMA0KKyAgICAgICAgICAgIG5vdGU6IGlmIGNob29zaW5n IHRhcCwgbmVlZCB0byBzcGVjaWZ5IGJyaWRnZSBuYW1lLA0KKyAgICAgICAgICAgICAgICAgIGVs c2UgaXQgd2lsbCBiZSBicjAuDQorICAgICAgICBvcHRfc2NyaXB0OiBRRU1VX0lGVVBfUEFUSA0K KyAgICAgICAgICAgIG5vdGU6IGlmIG5vdCBzcGVjaWZpZWQsIGRlZmF1bHQgaXMgc2VsZi5RRU1V X0lGVVBfUEFUSC4NCisgICAgICAgIG9wdF9kb3duc2NyaXB0OiBRRU1VX0lGRE9XTl9QQVRIDQor ICAgICAgICAgICAgbm90ZTogaWYgbm90IHNwZWNpZmllZCwgZGVmYXVsdCBpcyBzZWxmLlFFTVVf SUZET1dOX1BBVEguDQorICAgICAgICAiIiINCisgICAgICAgIG5ldF9ib290X2xpbmUgPSAnLW5l dCB0YXAnDQorICAgICAgICBzZXBhcmF0b3IgPSAnLCcNCisNCisgICAgICAgICMgYWRkIGJyaWRn ZSBpbmZvDQorICAgICAgICBpZiAnb3B0X2JyJyBpbiBvcHRpb25zLmtleXMoKSBhbmQgXA0KKyAg ICAgICAgICAgICAgICBvcHRpb25zWydvcHRfYnInXToNCisgICAgICAgICAgICBicmlkZ2UgPSBv cHRpb25zWydvcHRfYnInXQ0KKyAgICAgICAgZWxzZToNCisgICAgICAgICAgICBicmlkZ2UgPSBz ZWxmLkRFRkFVTFRfQlJJREdFDQorICAgICAgICBzZWxmLl9fZ2VuZXJhdGVfbmV0X2NvbmZpZ19z Y3JpcHQoc3RyKGJyaWRnZSkpDQorDQorICAgICAgICBpZiAnb3B0X3ZsYW4nIGluIG9wdGlvbnMu a2V5cygpIGFuZCBcDQorICAgICAgICAgICAgICAgIG9wdGlvbnNbJ29wdF92bGFuJ106DQorICAg ICAgICAgICAgbmV0X2Jvb3RfbGluZSArPSBzZXBhcmF0b3IgKyAndmxhbj0lcycgJSBvcHRpb25z WydvcHRfdmxhbiddDQorDQorICAgICAgICAjIGFkZCBuZXR3b3JrIGNvbmZpZ3VyZSBzY3JpcHQg cGF0aA0KKyAgICAgICAgaWYgJ29wdF9zY3JpcHQnIGluIG9wdGlvbnMua2V5cygpIGFuZCBcDQor ICAgICAgICAgICAgICAgIG9wdGlvbnNbJ29wdF9zY3JpcHQnXToNCisgICAgICAgICAgICBzY3Jp cHRfcGF0aCA9IG9wdGlvbnNbJ29wdF9zY3JpcHQnXQ0KKyAgICAgICAgZWxzZToNCisgICAgICAg ICAgICBzY3JpcHRfcGF0aCA9IHNlbGYuUUVNVV9JRlVQX1BBVEgNCisgICAgICAgIG5ldF9ib290 X2xpbmUgKz0gc2VwYXJhdG9yICsgJ3NjcmlwdD0lcycgJSBzY3JpcHRfcGF0aA0KKw0KKyAgICAg ICAgIyBhZGQgbmV0d29yayBjb25maWd1cmUgZG93bnNjcmlwdCBwYXRoDQorICAgICAgICBpZiAn b3B0X2Rvd25zY3JpcHQnIGluIG9wdGlvbnMua2V5cygpIGFuZCBcDQorICAgICAgICAgICAgICAg IG9wdGlvbnNbJ29wdF9kb3duc2NyaXB0J106DQorICAgICAgICAgICAgbmV0X2Jvb3RfbGluZSAr PSBzZXBhcmF0b3IgKyBcDQorICAgICAgICAgICAgICAgICdkb3duc2NyaXB0PSVzJyAlIG9wdGlv bnNbJ29wdF9kb3duc2NyaXB0J10NCisNCisgICAgICAgIGlmIHNlbGYuX19zdHJpbmdfaGFzX211 bHRpX2ZpZWxkcyhuZXRfYm9vdF9saW5lLCBzZXBhcmF0b3IpOg0KKyAgICAgICAgICAgIHNlbGYu X19hZGRfYm9vdF9saW5lKG5ldF9ib290X2xpbmUpDQorDQorICAgIGRlZiBfX2dlbmVyYXRlX25l dF9jb25maWdfc2NyaXB0KHNlbGYsIHN3aXRjaD1ERUZBVUxUX0JSSURHRSk6DQorICAgICAgICAi IiINCisgICAgICAgIEdlbmVyYXRlIGEgc2NyaXB0IGZvciBxZW11IGVtdWxhdG9yIHRvIGJ1aWxk IGEgdGFwIGRldmljZQ0KKyAgICAgICAgYmV0d2VlbiBob3N0IGFuZCBndWVzdC4NCisgICAgICAg ICIiIg0KKyAgICAgICAgcWVtdV9pZnVwID0gc2VsZi5RRU1VX0lGVVAgJSB7J3N3aXRjaCc6IHN3 aXRjaH0NCisgICAgICAgIGZpbGVfbmFtZSA9IG9zLnBhdGguYmFzZW5hbWUoc2VsZi5RRU1VX0lG VVBfUEFUSCkNCisgICAgICAgIHRtcF9maWxlX3BhdGggPSAnL3RtcC8lcycgJSBmaWxlX25hbWUN CisgICAgICAgIHNlbGYuaG9zdF9kdXQuY3JlYXRlX2ZpbGUocWVtdV9pZnVwLCB0bXBfZmlsZV9w YXRoKQ0KKyAgICAgICAgc2VsZi5ob3N0X3Nlc3Npb24uc2VuZF9leHBlY3QoJ212IC1mIH4vJXMg JXMnICUgKGZpbGVfbmFtZSwNCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICBzZWxmLlFFTVVfSUZVUF9QQVRIKSwgJyMgJykNCisgICAgICAg IHNlbGYuaG9zdF9zZXNzaW9uLnNlbmRfZXhwZWN0KA0KKyAgICAgICAgICAgICdjaG1vZCAreCAl cycgJSBzZWxmLlFFTVVfSUZVUF9QQVRILCAnIyAnKQ0KKw0KKyAgICBkZWYgc2V0X3ZtX2Rldmlj ZShzZWxmLCBkcml2ZXI9J3BjaS1hc3NpZ24nLCAqKnByb3BzKToNCisgICAgICAgICIiIg0KKyAg ICAgICAgU2V0IFZNIGRldmljZSB3aXRoIHNwZWNpZmllZCBkcml2ZXIuDQorICAgICAgICAiIiIN CisgICAgICAgIHByb3BzWydkcml2ZXInXSA9IGRyaXZlcg0KKyAgICAgICAgaW5kZXggPSBzZWxm LmZpbmRfb3B0aW9uX2luZGV4KCdkZXZpY2UnKQ0KKyAgICAgICAgaWYgaW5kZXg6DQorICAgICAg ICAgICAgc2VsZi5wYXJhbXNbaW5kZXhdWydkZXZpY2UnXS5hcHBlbmQocHJvcHMpDQorICAgICAg ICBlbHNlOg0KKyAgICAgICAgICAgIHNlbGYucGFyYW1zLmFwcGVuZCh7J2RldmljZSc6IFtwcm9w c119KQ0KKw0KKyAgICBkZWYgYWRkX3ZtX2RldmljZShzZWxmLCAqKm9wdGlvbnMpOg0KKyAgICAg ICAgIiIiDQorICAgICAgICBkcml2ZXI6IFtwY2ktYXNzaWduIHwgdmlydGlvLW5ldC1wY2kgfCAu Li5dDQorICAgICAgICBwcm9wX1tob3N0IHwgYWRkciB8IC4uLl06IHZhbHVlDQorICAgICAgICAg ICAgbm90ZTp0aGUgc3ViLXByb3BlcnR5IHdpbGwgYmUgZGVjaWRlZCBhY2NvcmRpbmcgdG8gdGhl IGRyaXZlci4NCisgICAgICAgICIiIg0KKyAgICAgICAgaWYgJ2RyaXZlcicgaW4gb3B0aW9ucy5r ZXlzKCkgYW5kIFwNCisgICAgICAgICAgICAgICAgb3B0aW9uc1snZHJpdmVyJ106DQorICAgICAg ICAgICAgaWYgb3B0aW9uc1snZHJpdmVyJ10gPT0gJ3BjaS1hc3NpZ24nOg0KKyAgICAgICAgICAg ICAgICBzZWxmLl9fYWRkX3ZtX3BjaV9hc3NpZ24oKipvcHRpb25zKQ0KKyAgICAgICAgICAgIGVs aWYgb3B0aW9uc1snZHJpdmVyJ10gPT0gJ3ZpcnRpby1uZXQtcGNpJzoNCisgICAgICAgICAgICAg ICAgc2VsZi5fX2FkZF92bV92aXJ0aW9fbmV0X3BjaSgqKm9wdGlvbnMpDQorDQorICAgIGRlZiBf X2FkZF92bV9wY2lfYXNzaWduKHNlbGYsICoqb3B0aW9ucyk6DQorICAgICAgICAiIiINCisgICAg ICAgIGRyaXZlcjogcGNpLWFzc2lnbg0KKyAgICAgICAgcHJvcF9ob3N0OiAwODowMC4wDQorICAg ICAgICBwcm9wX2FkZHI6IDAwOjAwOjAwOjAwOjAxOjAyDQorICAgICAgICAiIiINCisgICAgICAg IGRldl9ib290X2xpbmUgPSAnLWRldmljZSBwY2ktYXNzaWduJw0KKyAgICAgICAgc2VwYXJhdG9y ID0gJywnDQorICAgICAgICBpZiAncHJvcF9ob3N0JyBpbiBvcHRpb25zLmtleXMoKSBhbmQgXA0K KyAgICAgICAgICAgICAgICBvcHRpb25zWydwcm9wX2hvc3QnXToNCisgICAgICAgICAgICBkZXZf Ym9vdF9saW5lICs9IHNlcGFyYXRvciArICdob3N0PSVzJyAlIG9wdGlvbnNbJ3Byb3BfaG9zdCdd DQorICAgICAgICBpZiAncHJvcF9hZGRyJyBpbiBvcHRpb25zLmtleXMoKSBhbmQgXA0KKyAgICAg ICAgICAgICAgICBvcHRpb25zWydwcm9wX2FkZHInXToNCisgICAgICAgICAgICBkZXZfYm9vdF9s aW5lICs9IHNlcGFyYXRvciArICdhZGRyPSVzJyAlIG9wdGlvbnNbJ3Byb3BfYWRkciddDQorICAg ICAgICAgICAgc2VsZi5hc3NpZ25lZF9wY2lzLmFwcGVuZChvcHRpb25zWydwcm9wX2FkZHInXSkN CisNCisgICAgICAgIGlmIHNlbGYuX19zdHJpbmdfaGFzX211bHRpX2ZpZWxkcyhkZXZfYm9vdF9s aW5lLCBzZXBhcmF0b3IpOg0KKyAgICAgICAgICAgIHNlbGYuX19hZGRfYm9vdF9saW5lKGRldl9i b290X2xpbmUpDQorDQorICAgIGRlZiBfX2FkZF92bV92aXJ0aW9fbmV0X3BjaShzZWxmLCAqKm9w dGlvbnMpOg0KKyAgICAgICAgIiIiDQorICAgICAgICBkcml2ZXI6IHZpcnRpby1uZXQtcGNpDQor ICAgICAgICBwcm9wX25ldGRldjogbXluZXQxDQorICAgICAgICBwcm9wX2lkOiBuZXQxDQorICAg ICAgICBwcm9wX21hYzogMDA6MDA6MDA6MDA6MDE6MDMNCisgICAgICAgIHByb3BfYnVzOiBwY2ku MA0KKyAgICAgICAgcHJvcF9hZGRyOiAweDMNCisgICAgICAgICIiIg0KKyAgICAgICAgZGV2X2Jv b3RfbGluZSA9ICctZGV2aWNlIHZpcnRpby1uZXQtcGNpJw0KKyAgICAgICAgc2VwYXJhdG9yID0g JywnDQorICAgICAgICBpZiAncHJvcF9uZXRkZXYnIGluIG9wdGlvbnMua2V5cygpIGFuZCBcDQor ICAgICAgICAgICAgICAgIG9wdGlvbnNbJ3Byb3BfbmV0ZGV2J106DQorICAgICAgICAgICAgZGV2 X2Jvb3RfbGluZSArPSBzZXBhcmF0b3IgKyAnbmV0ZGV2PSVzJyAlIG9wdGlvbnNbJ3Byb3BfbmV0 ZGV2J10NCisgICAgICAgIGlmICdwcm9wX2lkJyBpbiBvcHRpb25zLmtleXMoKSBhbmQgXA0KKyAg ICAgICAgICAgICAgICBvcHRpb25zWydwcm9wX2lkJ106DQorICAgICAgICAgICAgZGV2X2Jvb3Rf bGluZSArPSBzZXBhcmF0b3IgKyAnaWQ9JXMnICUgb3B0aW9uc1sncHJvcF9pZCddDQorICAgICAg ICBpZiAncHJvcF9tYWMnIGluIG9wdGlvbnMua2V5cygpIGFuZCBcDQorICAgICAgICAgICAgICAg IG9wdGlvbnNbJ3Byb3BfbWFjJ106DQorICAgICAgICAgICAgZGV2X2Jvb3RfbGluZSArPSBzZXBh cmF0b3IgKyAnbWFjPSVzJyAlIG9wdGlvbnNbJ3Byb3BfbWFjJ10NCisgICAgICAgIGlmICdwcm9w X2J1cycgaW4gb3B0aW9ucy5rZXlzKCkgYW5kIFwNCisgICAgICAgICAgICAgICAgb3B0aW9uc1sn cHJvcF9idXMnXToNCisgICAgICAgICAgICBkZXZfYm9vdF9saW5lICs9IHNlcGFyYXRvciArICdi dXM9JXMnICUgb3B0aW9uc1sncHJvcF9idXMnXQ0KKyAgICAgICAgaWYgJ3Byb3BfYWRkcicgaW4g b3B0aW9ucy5rZXlzKCkgYW5kIFwNCisgICAgICAgICAgICAgICAgb3B0aW9uc1sncHJvcF9hZGRy J106DQorICAgICAgICAgICAgZGV2X2Jvb3RfbGluZSArPSBzZXBhcmF0b3IgKyAnYWRkcj0lcycg JSBvcHRpb25zWydwcm9wX2FkZHInXQ0KKw0KKyAgICAgICAgaWYgc2VsZi5fX3N0cmluZ19oYXNf bXVsdGlfZmllbGRzKHNlbGYsIHN0cmluZywgc2VwYXJhdG9yKToNCisgICAgICAgICAgICBzZWxm Ll9fYWRkX2Jvb3RfbGluZShkZXZfYm9vdF9saW5lKQ0KKw0KKyAgICBkZWYgX19zdHJpbmdfaGFz X211bHRpX2ZpZWxkcyhzZWxmLCBzdHJpbmcsIHNlcGFyYXRvciwgZmllbGRfbnVtPTIpOg0KKyAg ICAgICAgIiIiDQorICAgICAgICBDaGVjayBpZiBzdHJpbmcgaGFzIG11bHRpcGxlIGZpZWxkcyB3 aGljaCBpcyBzcGxpdGVkIHdpdGgNCisgICAgICAgIHNwZWNpZmllZCBzZXBhcmF0b3IuDQorICAg ICAgICAiIiINCisgICAgICAgIGZpZWxkcyA9IHN0cmluZy5zcGxpdChzZXBhcmF0b3IpDQorICAg ICAgICBudW1iZXIgPSAwDQorICAgICAgICBmb3IgZmllbGQgaW4gZmllbGRzOg0KKyAgICAgICAg ICAgIGlmIGZpZWxkOg0KKyAgICAgICAgICAgICAgICBudW1iZXIgKz0gMQ0KKyAgICAgICAgaWYg bnVtYmVyID49IGZpZWxkX251bToNCisgICAgICAgICAgICByZXR1cm4gVHJ1ZQ0KKyAgICAgICAg ZWxzZToNCisgICAgICAgICAgICByZXR1cm4gRmFsc2UNCisNCisgICAgZGVmIGFkZF92bV9tb25p dG9yKHNlbGYsICoqb3B0aW9ucyk6DQorICAgICAgICAiIiINCisgICAgICAgIHBvcnQ6IDYwNjEg ICAjIGlmIGFkZGluZyBtb25pdG9yIHRvIHZtLCBuZWVkIHRvIHNwZWNpY3kNCisgICAgICAgICAg ICAgICAgICAgICAgIHRoaXMgcG9ydCwgZWxzZSBpdCB3aWxsIGdldCBhIGZyZWUgcG9ydA0KKyAg ICAgICAgICAgICAgICAgICAgICAgb24gdGhlIGhvc3QgbWFjaGluZS4NCisgICAgICAgICIiIg0K KyAgICAgICAgaWYgJ3BvcnQnIGluIG9wdGlvbnMua2V5cygpOg0KKyAgICAgICAgICAgIGlmIG9w dGlvbnNbJ3BvcnQnXToNCisgICAgICAgICAgICAgICAgcG9ydCA9IG9wdGlvbnNbJ3BvcnQnXQ0K KyAgICAgICAgICAgIGVsc2U6DQorICAgICAgICAgICAgICAgIHBvcnQgPSBzZWxmLnZpcnRfcG9v bC5hbGxvY19wb3J0KHNlbGYudm1fbmFtZSkNCisNCisgICAgICAgICAgICBtb25pdG9yX2Jvb3Rf bGluZSA9ICctbW9uaXRvciB0Y3A6OiVkLHNlcnZlcixub3dhaXQnICUgaW50KHBvcnQpDQorICAg ICAgICAgICAgc2VsZi5fX2FkZF9ib290X2xpbmUobW9uaXRvcl9ib290X2xpbmUpDQorDQorICAg IGRlZiBzZXRfdm1fcWdhKHNlbGYsIGVuYWJsZT0neWVzJyk6DQorICAgICAgICAiIiINCisgICAg ICAgIFNldCBWTSBxZW11LWd1ZXN0LWFnZW50Lg0KKyAgICAgICAgIiIiDQorICAgICAgICBpbmRl eCA9IHNlbGYuZmluZF9vcHRpb25faW5kZXgoJ3FnYScpDQorICAgICAgICBpZiBpbmRleDoNCisg ICAgICAgICAgICBzZWxmLnBhcmFtc1tpbmRleF0gPSB7J3FnYSc6IFt7J2VuYWJsZSc6ICclcycg JSBlbmFibGV9XX0NCisgICAgICAgIGVsc2U6DQorICAgICAgICAgICAgc2VsZi5wYXJhbXMuYXBw ZW5kKHsncWdhJzogW3snZW5hYmxlJzogJyVzJyAlIGVuYWJsZX1dfSkNCisgICAgICAgIFFHQV9T T0NLX1BBVEggPSBRR0FfU09DS19QQVRIX1RFTVBMQVRFICUgeyd2bV9uYW1lJzogc2VsZi52bV9u YW1lfQ0KKyAgICAgICAgc2VsZi5xZ2Ffc29ja19wYXRoID0gUUdBX1NPQ0tfUEFUSA0KKw0KKyAg ICBkZWYgYWRkX3ZtX3FnYShzZWxmLCAqKm9wdGlvbnMpOg0KKyAgICAgICAgIiIiDQorICAgICAg ICBlbmFibGU6ICd5ZXMnDQorICAgICAgICAiIiINCisgICAgICAgIFFHQV9ERVZfSUQgPSAnJSh2 bV9uYW1lKXNfcWdhMCcgJSB7J3ZtX25hbWUnOiBzZWxmLnZtX25hbWV9DQorICAgICAgICBRR0Ff U09DS19QQVRIID0gUUdBX1NPQ0tfUEFUSF9URU1QTEFURSAlIHsndm1fbmFtZSc6IHNlbGYudm1f bmFtZX0NCisNCisgICAgICAgIHNlcGFyYXRvciA9ICcgJw0KKw0KKyAgICAgICAgaWYgJ2VuYWJs ZScgaW4gb3B0aW9ucy5rZXlzKCk6DQorICAgICAgICAgICAgaWYgb3B0aW9uc1snZW5hYmxlJ10g PT0gJ3llcyc6DQorICAgICAgICAgICAgICAgIHFnYV9ib290X2Jsb2NrID0gJy1jaGFyZGV2IHNv Y2tldCxwYXRoPSUoU09DS19QQVRIKXMsc2VydmVyLG5vd2FpdCxpZD0lKElEKXMnICsgXA0KKyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNlcGFyYXRvciArICctZGV2aWNlIHZpcnRp by1zZXJpYWwnICsgc2VwYXJhdG9yICsgXA0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICctZGV2aWNlIHZpcnRzZXJpYWxwb3J0LGNoYXJkZXY9JShJRClzLG5hbWU9JShERVZfTkFN RSlzJw0KKyAgICAgICAgICAgICAgICBxZ2FfYm9vdF9saW5lID0gcWdhX2Jvb3RfYmxvY2sgJSB7 J1NPQ0tfUEFUSCc6IFFHQV9TT0NLX1BBVEgsDQorICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAnREVWX05BTUUnOiBRR0FfREVWX05BTUUsDQorICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAnSUQnOiBRR0FfREVW X0lEfQ0KKyAgICAgICAgICAgICAgICBzZWxmLl9fYWRkX2Jvb3RfbGluZShxZ2FfYm9vdF9saW5l KQ0KKyAgICAgICAgICAgICAgICBzZWxmLnFnYV9zb2NrX3BhdGggPSBRR0FfU09DS19QQVRIDQor ICAgICAgICAgICAgZWxzZToNCisgICAgICAgICAgICAgICAgc2VsZi5xZ2Ffc29ja19wYXRoID0g JycNCisNCisgICAgZGVmIGFkZF92bV9zZXJpYWxfcG9ydChzZWxmLCAqKm9wdGlvbnMpOg0KKyAg ICAgICAgIiIiDQorICAgICAgICBlbmFibGU6ICd5ZXMnDQorICAgICAgICAiIiINCisgICAgICAg IFNFUkFJTF9TT0NLX1BBVEggPSAiL3RtcC8lc19zZXJpYWwuc29jayIgJSBzZWxmLnZtX25hbWUN CisgICAgICAgIGlmICdlbmFibGUnIGluIG9wdGlvbnMua2V5cygpOg0KKyAgICAgICAgICAgIGlm IG9wdGlvbnNbJ2VuYWJsZSddID09ICd5ZXMnOg0KKyAgICAgICAgICAgICAgICBzZXJpYWxfYm9v dF9saW5lID0gJy1zZXJpYWwgdW5peDolcyxzZXJ2ZXIsbm93YWl0JyAlIFNFUklBTF9TT0NLX1BB VEgNCisgICAgICAgICAgICAgICAgc2VsZi5fX2FkZF9ib290X2xpbmUoc2VyaWFsX2Jvb3RfbGlu ZSkNCisgICAgICAgICAgICBlbHNlOg0KKyAgICAgICAgICAgICAgICBwYXNzDQorDQorICAgIGRl ZiBhZGRfdm1fdm5jKHNlbGYsICoqb3B0aW9ucyk6DQorICAgICAgICAiIiINCisgICAgICAgIGRp c3BsYXlOdW06IDENCisgICAgICAgICIiIg0KKyAgICAgICAgaWYgJ2Rpc3BsYXlOdW0nIGluIG9w dGlvbnMua2V5cygpIGFuZCBcDQorICAgICAgICAgICAgICAgIG9wdGlvbnNbJ2Rpc3BsYXlOdW0n XToNCisgICAgICAgICAgICBkaXNwbGF5X251bSA9IG9wdGlvbnNbJ2Rpc3BsYXlOdW0nXQ0KKyAg ICAgICAgZWxzZToNCisgICAgICAgICAgICBkaXNwbGF5X251bSA9IHNlbGYudmlydF9wb29sLmFs bG9jX3ZuY19udW0oc2VsZi52bV9uYW1lKQ0KKw0KKyAgICAgICAgdm5jX2Jvb3RfbGluZSA9ICct dm5jIDolZCcgJSBpbnQoZGlzcGxheV9udW0pDQorICAgICAgICBzZWxmLl9fYWRkX2Jvb3RfbGlu ZSh2bmNfYm9vdF9saW5lKQ0KKw0KKyAgICBkZWYgc2V0X3ZtX2RhZW1vbihzZWxmLCBlbmFibGU9 J3llcycpOg0KKyAgICAgICAgIiIiDQorICAgICAgICBTZXQgVk0gZGFlbW9uIG9wdGlvbi4NCisg ICAgICAgICIiIg0KKyAgICAgICAgaW5kZXggPSBzZWxmLmZpbmRfb3B0aW9uX2luZGV4KCdkYWVt b24nKQ0KKyAgICAgICAgaWYgaW5kZXg6DQorICAgICAgICAgICAgc2VsZi5wYXJhbXNbaW5kZXhd ID0geydkYWVtb24nOiBbeydlbmFibGUnOiAnJXMnICUgZW5hYmxlfV19DQorICAgICAgICBlbHNl Og0KKyAgICAgICAgICAgIHNlbGYucGFyYW1zLmFwcGVuZCh7J2RhZW1vbic6IFt7J2VuYWJsZSc6 ICclcycgJSBlbmFibGV9XX0pDQorDQorICAgIGRlZiBhZGRfdm1fZGFlbW9uKHNlbGYsICoqb3B0 aW9ucyk6DQorICAgICAgICAiIiINCisgICAgICAgIGVuYWJsZTogJ3llcycNCisgICAgICAgICAg ICBub3RlOg0KKyAgICAgICAgICAgICAgICBCeSBkZWZhdWx0IFZNIHdpbGwgc3RhcnQgd2l0aCB0 aGUgZGFlbW9uaXplIHN0YXR1cy4NCisgICAgICAgICAgICAgICAgTm90IHN1cHBvcnQgc3RhcnRp bmcgaXQgb24gdGhlIHN0ZGluIG5vdy4NCisgICAgICAgICIiIg0KKyAgICAgICAgaWYgJ2RhZW1v bicgaW4gb3B0aW9ucy5rZXlzKCkgYW5kIFwNCisgICAgICAgICAgICAgICAgb3B0aW9uc1snZW5h YmxlJ10gPT0gJ25vJzoNCisgICAgICAgICAgICBwYXNzDQorICAgICAgICBlbHNlOg0KKyAgICAg ICAgICAgIGRhZW1vbl9ib290X2xpbmUgPSAnLWRhZW1vbml6ZScNCisgICAgICAgICAgICBzZWxm Ll9fYWRkX2Jvb3RfbGluZShkYWVtb25fYm9vdF9saW5lKQ0KKw0KKyAgICBkZWYgc3RhcnRfdm0o c2VsZik6DQorICAgICAgICAiIiINCisgICAgICAgIFN0YXJ0IFZNLg0KKyAgICAgICAgIiIiDQor ICAgICAgICBxZW11X2VtdWxhdG9yID0gc2VsZi5xZW11X2VtdWxhdG9yDQorDQorICAgICAgICBz ZWxmLl9fYWxsb2NfYXNzaWduZWRfcGNpcygpDQorDQorICAgICAgICBpZiBzZWxmLnZjcHVzX3Bp bm5lZF90b192bS5zdHJpcCgpOg0KKyAgICAgICAgICAgIHZjcHVzID0gc2VsZi5fX2FsbG9jX3Zj cHVzKCkNCisNCisgICAgICAgICAgICBpZiB2Y3B1cy5zdHJpcCgpOg0KKyAgICAgICAgICAgICAg ICB3aG9sZV9xZW11X2t2bV9ib290X2xpbmUgPSAndGFza3NldCAtYyAlcyAnICUgdmNwdXMgKyBc DQorICAgICAgICAgICAgICAgICAgICBxZW11X2VtdWxhdG9yICsgJyAnICsgXA0KKyAgICAgICAg ICAgICAgICAgICAgc2VsZi53aG9sZV9xZW11X2t2bV9ib290X2xpbmUNCisgICAgICAgIGVsc2U6 DQorICAgICAgICAgICAgd2hvbGVfcWVtdV9rdm1fYm9vdF9saW5lID0gcWVtdV9lbXVsYXRvciAr ICcgJyArIFwNCisgICAgICAgICAgICAgICAgc2VsZi53aG9sZV9xZW11X2t2bV9ib290X2xpbmUN CisNCisgICAgICAgICMgU3RhcnQgVk0gdXNpbmcgdGhlIHFlbXUgY29tbWFuZA0KKyAgICAgICAg b3V0ID0gc2VsZi5ob3N0X3Nlc3Npb24uc2VuZF9leHBlY3Qod2hvbGVfcWVtdV9rdm1fYm9vdF9s aW5lLCAnIyAnKQ0KKyAgICAgICAgdGltZS5zbGVlcCgzMCkNCisgICAgICAgIGlmIG91dDoNCisg ICAgICAgICAgICByYWlzZSBTdGFydFZNRmFpbGVkRXhjZXB0aW9uKG91dCkNCisNCisgICAgZGVm IF9fYWxsb2NfdmNwdXMoc2VsZik6DQorICAgICAgICAiIiINCisgICAgICAgIEFsbG9jYXRlIHZp cnR1YWwgQ1BVcyBmb3IgVk0uDQorICAgICAgICAiIiINCisgICAgICAgIHJlcV9jcHVzID0gc2Vs Zi52Y3B1c19waW5uZWRfdG9fdm0uc3BsaXQoKQ0KKyAgICAgICAgY3B1cyA9IHNlbGYudmlydF9w b29sLmFsbG9jX2NwdSh2bT1zZWxmLnZtX25hbWUsIGNvcmVsaXN0PXJlcV9jcHVzKQ0KKw0KKyAg ICAgICAgdmNwdXNfcGlubmVkX3RvX3ZtID0gJycNCisgICAgICAgIGZvciBjcHUgaW4gY3B1czoN CisgICAgICAgICAgICB2Y3B1c19waW5uZWRfdG9fdm0gKz0gJywnICsgY3B1DQorICAgICAgICB2 Y3B1c19waW5uZWRfdG9fdm0gPSB2Y3B1c19waW5uZWRfdG9fdm0ubHN0cmlwKCcsJykNCisNCisg ICAgICAgIGlmIGxlbihyZXFfY3B1cykgIT0gbGVuKGNwdXMpOg0KKyAgICAgICAgICAgIHByaW50 ICJXQVJOSU5HOiBKdXN0IHBpbiB2Y3B1cyBbICVzIF0gdG8gVk0hIiAlIHZjcHVzX3Bpbm5lZF90 b192bQ0KKw0KKyAgICAgICAgcmV0dXJuIHZjcHVzX3Bpbm5lZF90b192bQ0KKw0KKyAgICBkZWYg X19hbGxvY19hc3NpZ25lZF9wY2lzKHNlbGYpOg0KKyAgICAgICAgIiIiDQorICAgICAgICBSZWNv cmQgdGhlIFBDSSBkZXZpY2UgaW5mbw0KKyAgICAgICAgU3RydWN0OiB7ZGV2IHBjaTogeydpc192 Zic6IFtUcnVlIHwgRmFsc2VdLA0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAncGZfcGNp JzogcGNpfX0NCisgICAgICAgIGV4YW1wbGU6DQorICAgICAgICAgICAgeycwODoxMC4wJzp7J2lz X3ZmJzpUcnVlLCAncGZfcGNpJzogMDg6MDAuMH19DQorICAgICAgICAiIiINCisgICAgICAgIGFz c2lnbmVkX3BjaXNfaW5mbyA9IHt9DQorICAgICAgICBmb3IgcGNpIGluIHNlbGYuYXNzaWduZWRf cGNpczoNCisgICAgICAgICAgICBhc3NpZ25lZF9wY2lzX2luZm9bcGNpXSA9IHt9DQorICAgICAg ICAgICAgaWYgc2VsZi5fX2lzX3ZmX3BjaShwY2kpOg0KKyAgICAgICAgICAgICAgICBhc3NpZ25l ZF9wY2lzX2luZm9bcGNpXVsnaXNfdmYnXSA9IFRydWUNCisgICAgICAgICAgICAgICAgcGZfcGNp ID0gc2VsZi5fX21hcF92Zl90b19wZihwY2kpDQorICAgICAgICAgICAgICAgIGFzc2dpbmVkX3Bj aXNfaW5mb1twY2ldWydwZl9wY2knXSA9IHBmX3BjaQ0KKyAgICAgICAgICAgICAgICBpZiBzZWxm LnZpcnRfcG9vbC5hbGxvY192Zl9mcm9tX3BmKHZtPXNlbGYudm1fbmFtZSwNCisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwZl9wY2k9cGZfcGNpLA0K KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICpbcGNp XSk6DQorICAgICAgICAgICAgICAgICAgICBwb3J0ID0gc2VsZi5fX2dldF92Zl9wb3J0KHBjaSkN CisgICAgICAgICAgICAgICAgICAgIHBvcnQudW5iaW5kX2RyaXZlcigpDQorICAgICAgICAgICAg ICAgICAgICBwb3J0LmJpbmRfZHJpdmVyKCdwY2ktc3R1YicpDQorICAgICAgICAgICAgZWxzZToN CisgICAgICAgICAgICAgICAgIyBjaGVjayB0aGF0IGlmIGFueSBWRiBvZiBzcGVjaWZpZWQgUEYg aGFzIGJlZW4NCisgICAgICAgICAgICAgICAgIyB1c2VkLCByYWlzZSBleGNlcHRpb24NCisgICAg ICAgICAgICAgICAgdmZfcGNpID0gc2VsZi5fX3ZmX2hhc19iZWVuX2Fzc2luZ2VkKHBjaSwgKiph c3NpbmdlZF9wY2lzX2luZm8pDQorICAgICAgICAgICAgICAgIGlmIHZmX3BjaToNCisgICAgICAg ICAgICAgICAgICAgIHJhaXNlIEV4Y2VwdGlvbigNCisgICAgICAgICAgICAgICAgICAgICAgICAi RXJyb3I6IEEgVkYgWyVzXSBnZW5lcmF0ZWQgYnkgUEYgWyVzXSBoYXMgIiAlDQorICAgICAgICAg ICAgICAgICAgICAgICAgKHZmX3BjaSwgcGNpKSArDQorICAgICAgICAgICAgICAgICAgICAgICAg ImJlZW4gYXNzaWduZWQgdG8gVk0sIHNvIHRoaXMgUEYgY2FuIG5vdCBiZSAiICsNCisgICAgICAg ICAgICAgICAgICAgICAgICAiYXNzaWduZWQgdG8gVk0gYWdhaW4hIikNCisgICAgICAgICAgICAg ICAgIyBnZXQgdGhlIHBvcnQgaW5zdGFuY2Ugb2YgUEYNCisgICAgICAgICAgICAgICAgcG9ydCA9 IHNlbGYuX19nZXRfbmV0X2RldmljZV9ieV9wY2kocGNpKQ0KKw0KKyAgICAgICAgICAgICAgICBp ZiBzZWxmLnZpcnRfcG9vbC5hbGxvY19wZih2bT1zZWxmLnZtX25hbWUsDQorICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICpbcGNpXSk6DQorICAgICAgICAgICAgICAg ICAgICBwb3J0LnVuYmluZF9kcml2ZXIoKQ0KKw0KKyAgICBkZWYgX19pc192Zl9wY2koc2VsZiwg ZGV2X3BjaSk6DQorICAgICAgICAiIiINCisgICAgICAgIENoZWNrIGlmIHRoZSBzcGVjaWZpZWQg UENJIGRldiBpcyBhIFZGLg0KKyAgICAgICAgIiIiDQorICAgICAgICBmb3IgcG9ydF9pbmZvIGlu IHNlbGYuaG9zdF9kdXQucG9ydHNfaW5mbzoNCisgICAgICAgICAgICBpZiAnc3Jpb3ZfdmZzX3Bj aScgaW4gcG9ydF9pbmZvLmtleXMoKToNCisgICAgICAgICAgICAgICAgaWYgZGV2X3BjaSBpbiBw b3J0X2luZm9bJ3NyaW92X3Zmc19wY2knXToNCisgICAgICAgICAgICAgICAgICAgIHJldHVybiBU cnVlDQorICAgICAgICByZXR1cm4gRmFsc2UNCisNCisgICAgZGVmIF9fbWFwX3ZmX3RvX3BmKHNl bGYsIGRldl9wY2kpOg0KKyAgICAgICAgIiIiDQorICAgICAgICBNYXAgdGhlIHNwZWNpZmllZCBW RiB0byBQRi4NCisgICAgICAgICIiIg0KKyAgICAgICAgZm9yIHBvcnRfaW5mbyBpbiBzZWxmLmhv c3RfZHV0LnBvcnRzX2luZm86DQorICAgICAgICAgICAgaWYgJ3NyaW92X3Zmc19wY2knIGluIHBv cnRfaW5mby5rZXlzKCk6DQorICAgICAgICAgICAgICAgIGlmIGRldl9wY2kgaW4gcG9ydF9pbmZv Wydzcmlvdl92ZnNfcGNpJ106DQorICAgICAgICAgICAgICAgICAgICByZXR1cm4gcG9ydF9pbmZv WydwY2knXQ0KKyAgICAgICAgcmV0dXJuIE5vbmUNCisNCisgICAgZGVmIF9fZ2V0X3ZmX3BvcnQo c2VsZiwgZGV2X3BjaSk6DQorICAgICAgICAiIiINCisgICAgICAgIEdldCB0aGUgTmV0RGV2aWNl IGluc3RhbmNlIG9mIHNwZWNpZmllZCBWRi4NCisgICAgICAgICIiIg0KKyAgICAgICAgZm9yIHBv cnRfaW5mbyBpbiBzZWxmLmhvc3RfZHV0LnBvcnRzX2luZm86DQorICAgICAgICAgICAgaWYgJ3Zm c19wb3J0JyBpbiBwb3J0X2luZm8ua2V5cygpOg0KKyAgICAgICAgICAgICAgICBmb3IgcG9ydCBp biBwb3J0X2luZm9bJ3Zmc19wb3J0J106DQorICAgICAgICAgICAgICAgICAgICBpZiBkZXZfcGNp ID09IHBvcnQucGNpOg0KKyAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBwb3J0DQorICAg ICAgICByZXR1cm4gTm9uZQ0KKw0KKyAgICBkZWYgX192Zl9oYXNfYmVlbl9hc3NpZ25lZChzZWxm LCBwZl9wY2ksICoqYXNzaWduZWRfcGNpc19pbmZvKToNCisgICAgICAgICIiIg0KKyAgICAgICAg Q2hlY2sgaWYgdGhlIHNwZWNpZmllZCBWRiBoYXMgYmVlbiB1c2VkLg0KKyAgICAgICAgIiIiDQor ICAgICAgICBmb3IgcGNpIGluIGFzc2lnbmVkX3BjaXNfaW5mby5rZXlzKCk6DQorICAgICAgICAg ICAgaWYgYXNzaWduZWRfcGNpc19pbmZvW3BjaV1bJ2lzX3ZmJ10gYW5kIFwNCisgICAgICAgICAg ICAgICAgICAgIGFzc2lnbmVkX3BjaXNfaW5mb1twY2ldWydwZl9wY2knXSA9PSBwZl9wY2k6DQor ICAgICAgICAgICAgICAgIHJldHVybiBwY2kNCisgICAgICAgIHJldHVybiBGYWxzZQ0KKw0KKyAg ICBkZWYgX19nZXRfbmV0X2RldmljZV9ieV9wY2koc2VsZiwgbmV0X2RldmljZV9wY2kpOg0KKyAg ICAgICAgIiIiDQorICAgICAgICBHZXQgTmV0RGV2aWNlIGluc3RhbmNlIGJ5IHRoZSBzcGVjaWZp ZWQgUENJIGJ1cyBudW1iZXIuDQorICAgICAgICAiIiINCisgICAgICAgIHBvcnRfaW5mbyA9IHNl bGYuaG9zdF9kdXQuZ2V0X3BvcnRfaW5mbyhuZXRfZGV2aWNlX3BjaSkNCisgICAgICAgIHJldHVy biBwb3J0X2luZm9bJ3BvcnQnXQ0KKw0KKyAgICBkZWYgZ2V0X3ZtX2lwKHNlbGYpOg0KKyAgICAg ICAgIiIiDQorICAgICAgICBHZXQgVk0gSVAuDQorICAgICAgICAiIiINCisgICAgICAgIGdldF92 bV9pcCA9IGdldGF0dHIoc2VsZiwgImdldF92bV9pcF8lcyIgJSBzZWxmLm5ldF90eXBlKQ0KKyAg ICAgICAgcmV0dXJuIGdldF92bV9pcCgpDQorDQorICAgIGRlZiBnZXRfdm1faXBfaG9zdGZ3ZChz ZWxmKToNCisgICAgICAgICIiIg0KKyAgICAgICAgR2V0IElQIHdoaWNoIFZNIGlzIGNvbm5lY3Rl ZCBieSBob3N0ZndkLg0KKyAgICAgICAgIiIiDQorICAgICAgICByZXR1cm4gc2VsZi5ob3N0Zndk X2FkZHINCisNCisgICAgZGVmIGdldF92bV9pcF9icmlkZ2Uoc2VsZik6DQorICAgICAgICAiIiIN CisgICAgICAgIEdldCBJUCB3aGljaCBWTSBpcyBjb25uZWN0ZWQgYnkgYnJpZGdlLg0KKyAgICAg ICAgIiIiDQorICAgICAgICBvdXQgPSBzZWxmLl9fY29udHJvbF9zZXNzaW9uKCdwaW5nJywgJzYw JykNCisgICAgICAgIGlmIG5vdCBvdXQ6DQorICAgICAgICAgICAgdGltZS5zbGVlcCgxMCkNCisg ICAgICAgICAgICBvdXQgPSBzZWxmLl9fY29udHJvbF9zZXNzaW9uKCdpZmNvbmZpZycpDQorICAg ICAgICAgICAgaXBzID0gcmUuZmluZGFsbChyJ2luZXQgKFxkK1wuXGQrXC5cZCtcLlxkKyknLCBv dXQpDQorDQorICAgICAgICAgICAgaWYgJzEyNy4wLjAuMScgaW4gaXBzOg0KKyAgICAgICAgICAg ICAgICBpcHMucmVtb3ZlKCcxMjcuMC4wLjEnKQ0KKw0KKyAgICAgICAgICAgIG51bSA9IDMNCisg ICAgICAgICAgICBmb3IgaXAgaW4gaXBzOg0KKyAgICAgICAgICAgICAgICBvdXQgPSBzZWxmLmhv c3Rfc2Vzc2lvbi5zZW5kX2V4cGVjdCgNCisgICAgICAgICAgICAgICAgICAgICdwaW5nIC1jICVk ICVzJyAlIChudW0sIGlwKSwgJyMgJykNCisgICAgICAgICAgICAgICAgaWYgJzAlIHBhY2tldCBs b3NzJyBpbiBvdXQ6DQorICAgICAgICAgICAgICAgICAgICByZXR1cm4gaXANCisgICAgICAgIHJl dHVybiAnJw0KKw0KKyAgICBkZWYgX19jb250cm9sX3Nlc3Npb24oc2VsZiwgY29tbWFuZCwgKmFy Z3MpOg0KKyAgICAgICAgIiIiDQorICAgICAgICBVc2UgdGhlIHFlbXUgZ3Vlc3QgYWdlbnQgc2Vy dmljZSB0byBjb250cm9sIFZNLg0KKyAgICAgICAgTm90ZToNCisgICAgICAgICAgICA6Y29tbWFu ZDogdGhlcmUgYXJlIHRoZXNlIGNvbW1hbmRzIGFzIGJlbG93Og0KKyAgICAgICAgICAgICAgICAg ICAgICAgY2F0LCBmc2ZyZWV6ZSwgZnN0cmltLCBoYWx0LCBpZmNvbmZpZywgaW5mbyxcDQorICAg ICAgICAgICAgICAgICAgICAgICBwaW5nLCBwb3dlcmRvd24sIHJlYm9vdCwgc2h1dGRvd24sIHN1 c3BlbmQNCisgICAgICAgICAgICA6YXJnczogZ2l2ZSBkaWZmZXJlbnQgYXJncyBieSB0aGUgZGlm ZmVyZW50IGNvbW1hbmRzLg0KKyAgICAgICAgIiIiDQorICAgICAgICBpZiBub3Qgc2VsZi5xZ2Ff c29ja19wYXRoOg0KKyAgICAgICAgICAgIHNlbGYuaG9zdF9sb2dnZXIuaW5mbygNCisgICAgICAg ICAgICAgICAgIk5vIFFHQSBzZXJ2aWNlIGJldHdlZW4gaG9zdCBbICVzIF0gYW5kIGd1ZXN0IFsg JXMgXSIgJQ0KKyAgICAgICAgICAgICAgICAoc2VsZi5ob3N0X2R1dC5OYW1lLCBzZWxmLnZtX25h bWUpKQ0KKyAgICAgICAgICAgIHJldHVybiBOb25lDQorDQorICAgICAgICBjbWRfaGVhZCA9ICd+ L1FNUC8nICsgXA0KKyAgICAgICAgICAgICJxZW11LWdhLWNsaWVudCAiICsgXA0KKyAgICAgICAg ICAgICItLWFkZHJlc3M9JXMgJXMiICUgXA0KKyAgICAgICAgICAgIChzZWxmLnFnYV9zb2NrX3Bh dGgsIGNvbW1hbmQpDQorDQorICAgICAgICBjbWQgPSBjbWRfaGVhZA0KKyAgICAgICAgZm9yIGFy ZyBpbiBhcmdzOg0KKyAgICAgICAgICAgIGNtZCA9IGNtZF9oZWFkICsgJyAnICsgc3RyKGFyZykN CisNCisgICAgICAgIG91dCA9IHNlbGYuaG9zdF9zZXNzaW9uLnNlbmRfZXhwZWN0KGNtZCwgJyMg JykNCisNCisgICAgICAgIHJldHVybiBvdXQNCisNCisgICAgZGVmIHN0b3Aoc2VsZik6DQorICAg ICAgICAiIiINCisgICAgICAgIFN0b3AgVk0uDQorICAgICAgICAiIiINCisgICAgICAgIHNlbGYu X19jb250cm9sX3Nlc3Npb24oJ3Bvd2VyZG93bicpDQorICAgICAgICB0aW1lLnNsZWVwKDUpDQor ICAgICAgICBzZWxmLnZpcnRfcG9vbC5mcmVlX2FsbF9yZXNvdXJjZShzZWxmLnZtX25hbWUpDQor DQorDQoraWYgX19uYW1lX18gPT0gIl9fbWFpbl9fIjoNCisgICAgaW1w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yBpbml0IHRoZSBob3N0IHNlc3Npb24gYW5kIGxvZ2dlciBmb3IgVk0NCisg ICAgICAgIHNlbGYuaG9zdF9kdXQuaW5pdF9ob3N0X3Nlc3Npb24oKQ0KKw0KKyAgICAgICAgIyBy ZXBsYWNlIGR1dCBzZXNzaW9uDQorICAgICAgICBzZWxmLmhvc3Rfc2Vzc2lvbiA9IHNlbGYuaG9z dF9kdXQuaG9zdF9zZXNzaW9uDQorICAgICAgICBzZWxmLmhvc3RfbG9nZ2VyID0gc2VsZi5ob3N0 X2R1dC5sb2dnZXINCisNCisgICAgICAgICMgaW5pdCB0aGUgaG9zdCByZXNvdWNlIHBvb2wgZm9y IFZNDQorICAgICAgICBzZWxmLnZpcnRfcG9vbCA9IHNlbGYuaG9zdF9kdXQudmlydF9wb29sDQor DQorICAgICAgICBpZiBub3Qgc2VsZi5oYXNfdmlydHVhbF9hYmlsaXR5KCk6DQorICAgICAgICAg ICAgaWYgbm90IHNlbGYuZW5hYmxlX3ZpcnR1YWxfYWJpbGl0eSgpOg0KKyAgICAgICAgICAgICAg ICByYWlzZSBFeGNlcHRpb24oDQorICAgICAgICAgICAgICAgICAgICAiRHV0IFsgJXMgXSBjYW5u b3QgaGF2ZSB0aGUgdmlydHVhbCBhYmlsaXR5ISEhIikNCisNCisgICAgICAgIHNlbGYudmlydF90 eXBlID0gc2VsZi5nZXRfdmlydF90eXBlKCkNCisgICAgICAgIHNlbGYubG9hZF9nbG9iYWxfY29u ZmlnKCkNCisgICAgICAgIHNlbGYubG9hZF9sb2NhbF9jb25maWcoc3VpdGVfbmFtZSkNCisNCisg ICAgZGVmIGdldF92aXJ0X3R5cGUoc2VsZik6DQorICAgICAgICAiIiINCisgICAgICAgIEdldCB0 aGUgdmlydHVhbCB0eXBlLCBzdWNoIGFzIEtWTSwgWEVOIG9yIExJQlZJUlQuDQorICAgICAgICAi IiINCisgICAgICAgIE5vdEltcGxlbWVudGVkDQorDQorICAgIGRlZiBoYXNfdmlydHVhbF9hYmls aXR5KHNlbGYpOg0KKyAgICAgICAgIiIiDQorICAgICAgICBDaGVjayBpZiB0aGUgaG9zdCBoYXZl IHRoZSBhYmlsaXR5IG9mIHZpcnR1YWxpemF0aW9uLg0KKyAgICAgICAgIiIiDQorICAgICAgICBO b3RJbXBsZW1lbnRlZA0KKw0KKyAgICBkZWYgZW5hYmxlX3ZpcnR1YWxfYWJpbGl0eShzZWxmKToN CisgICAgICAgICIiIg0KKyAgICAgICAgRW5hbGJlIHRoZSB2aXJ0dWFsIGFiaWxpdHkgb24gdGhl IERVVC4NCisgICAgICAgICIiIg0KKyAgICAgICAgTm90SW1wbGVtZW50ZWQNCisNCisgICAgZGVm IGxvYWRfZ2xvYmFsX2NvbmZpZyhzZWxmKToNCisgICAgICAgICIiIg0KKyAgICAgICAgTG9hZCBn bG9iYWwgY29uZmlndXJlIGluIHRoZSBwYXRoIERUU19ST09UX1BBSFQvY29uZi4NCisgICAgICAg ICIiIg0KKyAgICAgICAgY29uZiA9IFZpcnRDb25mKFZJUlRDT05GKQ0KKyAgICAgICAgY29uZi5s b2FkX3ZpcnRfY29uZmlnKHNlbGYudmlydF90eXBlKQ0KKyAgICAgICAgc2VsZi5wYXJhbXMgPSBj b25mLmdldF92aXJ0X2NvbmZpZygpDQorDQorICAgIGRlZiBsb2FkX2xvY2FsX2NvbmZpZyhzZWxm LCBzdWl0ZV9uYW1lKToNCisgICAgICAgICIiIg0KKyAgICAgICAgTG9hZCBsb2NhbCBjb25maWd1 cmUgaW4gdGhlIHBhdGggRFRTX1JPT1RfUEFUSC9jb25mLg0KKyAgICAgICAgIiIiDQorICAgICAg ICAjIGxvYWQgbG9jYWwgY29uZmlndXJhdGlvbiBieSBzdWl0ZSBhbmQgdm0gbmFtZQ0KKyAgICAg ICAgY29uZiA9IFZpcnRDb25mKENPTkZJR19ST09UX1BBVEggKyBzdWl0ZV9uYW1lICsgJy5jZmcn KQ0KKyAgICAgICAgY29uZi5sb2FkX3ZpcnRfY29uZmlnKHNlbGYudm1fbmFtZSkNCisgICAgICAg IGxvY2FscGFyYW1zID0gY29uZi5nZXRfdmlydF9jb25maWcoKQ0KKyAgICAgICAgIyByZXBsYWNl IGdsb2JhbCBjb25maWd1cmF0aW9ucyB3aXRoIGxvY2FsIGNvbmZpZ3VyYXRpb25zDQorICAgICAg ICBmb3IgcGFyYW0gaW4gbG9jYWxwYXJhbXM6DQorICAgICAgICAgICAgaWYgJ21lbScgaW4gcGFy YW0ua2V5cygpOg0KKyAgICAgICAgICAgICAgICBzZWxmLl9fc2F2ZV9sb2NhbF9jb25maWcoJ21l bScsIHBhcmFtWydtZW0nXSkNCisgICAgICAgICAgICAgICAgY29udGludWUNCisgICAgICAgICAg ICBpZiAnY3B1JyBpbiBwYXJhbS5rZXlzKCk6DQorICAgICAgICAgICAgICAgIHNlbGYuX19zYXZl X2xvY2FsX2NvbmZpZygnY3B1JywgcGFyYW1bJ2NwdSddKQ0KKyAgICAgICAgICAgICAgICBjb250 aW51ZQ0KKyAgICAgICAgICAgICMgc2F2ZSBsb2NhbCBjb25maWd1cmF0aW9ucw0KKyAgICAgICAg ICAgIHNlbGYucGFyYW1zLmFwcGVuZChwYXJhbSkNCisNCisgICAgZGVmIF9fc2F2ZV9sb2NhbF9j b25maWcoc2VsZiwga2V5LCB2YWx1ZSk6DQorICAgICAgICAiIiINCisgICAgICAgIFNhdmUgdGhl IGxvY2FsIGNvbmZpZyBpbnRvIHRoZSBnbG9iYWwgZGljdCBzZWxmLnBhcmFtLg0KKyAgICAgICAg IiIiDQorICAgICAgICBmb3IgcGFyYW0gaW4gc2VsZi5wYXJhbXM6DQorICAgICAgICAgICAgaWYg a2V5IGluIHBhcmFtLmtleXMoKToNCisgICAgICAgICAgICAgICAgcGFyYW1ba2V5XSA9IHZhbHVl DQorDQorICAgIGRlZiBjb21wb3NlX2Jvb3RfcGFyYW0oc2VsZik6DQorICAgICAgICAiIiINCisg ICAgICAgIENvbXBvc2UgYWxsIGJvb3QgcGFyYW0gZm9yIHN0YXJ0aW5nIHRoZSBWTS4NCisgICAg ICAgICIiIg0KKyAgICAgICAgZm9yIHBhcmFtIGluIHNlbGYucGFyYW1zOg0KKyAgICAgICAgICAg IGtleSA9IHBhcmFtLmtleXMoKVswXQ0KKyAgICAgICAgICAgIHZhbHVlID0gcGFyYW1ba2V5XQ0K KyAgICAgICAgICAgIHRyeToNCisgICAgICAgICAgICAgICAgcGFyYW1fZnVuYyA9IGdldGF0dHIo c2VsZiwgJ2FkZF92bV8nICsga2V5KQ0KKyAgICAgICAgICAgICAgICBpZiBjYWxsYWJsZShwYXJh bV9mdW5jKToNCisgICAgICAgICAgICAgICAgICAgIGZvciBvcHRpb24gaW4gdmFsdWU6DQorICAg ICAgICAgICAgICAgICAgICAgICAgcGFyYW1fZnVuYygqKm9wdGlvbikNCisgICAgICAgICAgICAg ICAgZWxzZToNCisgICAgICAgICAgICAgICAgICAgIHByaW50ICJWaXJ0ICVzIGZ1bmN0aW9uIG5v dCBpbXBsZW1lbnRlZCEhISIgJSBrZXkNCisgICAgICAgICAgICBleGNlcHQgRXhjZXB0aW9uIGFz IGU6DQorICAgICAgICAgICAgICAgIHByaW50ICJGYWlsZWQ6ICIsIGUNCisNCisgICAgZGVmIGZp bmRfb3B0aW9uX2luZGV4KHNlbGYsIG9wdGlvbik6DQorICAgICAgICAiIiINCisgICAgICAgIEZp bmQgdGhlIGJvb3Qgb3B0aW9uIGluIHRoZSBwYXJhbXMgd2hpY2ggaXMgZ2VuZXJhdGVkIGZyb20N CisgICAgICAgIHRoZSBnbG9iYWwgYW5kIGxvY2FsIGNvbmZpZ3VyZXMsIGFuZCB0aGlzIGZ1bmN0 aW9uIHdpbGwNCisgICAgICAgIHJldHVybiB0aGUgaW5kZXggYnkgd2hpY2ggb3B0aW9uIGNhbiBi ZSBpbmRleGVkIGluIHRoZQ0KKyAgICAgICAgcGFyYW0gbGlzdC4NCisgICAgICAgICIiIg0KKyAg ICAgICAgaW5kZXggPSAwDQorICAgICAgICBmb3IgcGFyYW0gaW4gc2VsZi5wYXJhbXM6DQorICAg ICAgICAgICAga2V5ID0gcGFyYW0ua2V5cygpWzBdDQorICAgICAgICAgICAgaWYga2V5LnN0cmlw KCkgPT0gb3B0aW9uLnN0cmlwKCk6DQorICAgICAgICAgICAgICAgIHJldHVybiBpbmRleA0KKyAg ICAgICAgICAgIGluZGV4ICs9IDENCisNCisgICAgICAgIHJldHVybiBOb25lDQorDQorICAgIGRl ZiBnZW5lcmF0ZV91bmlxdWVfbWFjKHNlbGYpOg0KKyAgICAgICAgIiIiDQorICAgICAgICBHZW5l cmF0ZSBhIHVuaXF1ZSBNQUMgYmFzZWQgb24gdGhlIERVVC4NCisgICAgICAgICIiIg0KKyAgICAg ICAgbWFjX2hlYWQgPSAnMDA6MDA6MDA6Jw0KKyAgICAgICAgbWFjX3RhaWwgPSAnOicuam9pbigN CisgICAgICAgICAgICBbJyUwMngnICUgeCBmb3IgeCBpbiBpbWFwKGxhbWJkYSB4OnJhbmRpbnQo MCwgMjU1KSwgcmFuZ2UoMykpXSkNCisgICAgICAgIHJldHVybiBtYWNfaGVhZCArIG1hY190YWls DQorDQorICAgIGRlZiBnZXRfdm1faXAoc2VsZik6DQorICAgICAgICAiIiINCisgICAgICAgIEdl dCB0aGUgVk0gSVAuDQorICAgICAgICAiIiINCisgICAgICAgIE5vdEltcGxlbWVudGVkDQorDQor ICAgIGRlZiBzdGFydChzZWxmKToNCisgICAgICAgICIiIg0KKyAgICAgICAgU3RhcnQgVk0gYW5k IGluc3RhbnRpYXRlIHRoZSBWTSB3aXRoIFZpcnREdXQuDQorICAgICAgICAiIiINCisgICAgICAg IHNlbGYuY29tcG9zZV9ib290X3BhcmFtKCkNCisgICAgICAgIHRyeToNCisgICAgICAgICAgICBz ZWxmLnN0YXJ0X3ZtKCkNCisgICAgICAgIGV4Y2VwdCBFeGNlcHRpb24gYXMgZToNCisgICAgICAg ICAgICBzZWxmLmhvc3RfbG9nZ2VyLmVycm9yKGUpDQorICAgICAgICAgICAgcmV0dXJuIE5vbmUN CisgICAgICAgIHRyeToNCisgICAgICAgICAgICB2bV9kdXQgPSBzZWxmLmluc3RhbnRpYXRlX3Zt X2R1dCgpDQorICAgICAgICBleGNlcHQgRXhjZXB0aW9uIGFzIGU6DQorICAgICAgICAgICAgc2Vs Zi5ob3N0X2xvZ2dlci5lcnJvcihlKQ0KKyAgICAgICAgICAgIHNlbGYuc3RvcCgpDQorICAgICAg ICAgICAgcmV0dXJuIE5vbmUNCisgICAgICAgIHJldHVybiB2bV9kdXQNCisNCisgICAgZGVmIHN0 YXJ0X3ZtKHNlbGYpOg0KKyAgICAgICAgIiIiDQorICAgICAgICBTdGFydCBWTS4NCisgICAgICAg ICIiIg0KKyAgICAgICAgTm90SW1wbGVtZW50ZWQNCisNCisgICAgZGVmIGluc3RhbnRpYXRlX3Zt X2R1dChzZWxmKToNCisgICAgICAgICIiIg0KKyAgICAgICAgSW5zdGFudGlhdGUgdGhlIER1dCBj bGFzcyBmb3IgVk0uDQorICAgICAgICAiIiINCisgICAgICAgIGNyYiA9IHNlbGYuaG9zdF9kdXQu Y3JiLmNvcHkoKQ0KKyAgICAgICAgY3JiWydieXBhc3MgY29yZTAnXSA9IEZhbHNlDQorICAgICAg ICB2bV9pcCA9IHNlbGYuZ2V0X3ZtX2lwKCkNCisgICAgICAgIGNyYlsnSVAnXSA9IHZtX2lwDQor ICAgICAgICBpZiAnOicgbm90IGluIHZtX2lwOg0KKyAgICAgICAgICAgIHJlbW90ZV9pcCA9IHZt X2lwLnN0cmlwKCkNCisgICAgICAgICAgICByZWRpcmVjdF9wb3J0ID0gJycNCisgICAgICAgIGVs c2U6DQorICAgICAgICAgICAgcmVtb3RlX2FkZHIgPSB2bV9pcC5zcGxpdCgnOicpDQorICAgICAg ICAgICAgcmVtb3RlX2lwID0gcmVtb3RlX2FkZHJbMF0uc3RyaXAoKQ0KKyAgICAgICAgICAgIHJl ZGlyZWN0X3BvcnQgPSByZW1vdGVfYWRkclsxXS5zdHJpcCgpDQorICAgICAgICBzZWxmLl9fcmVt b3ZlX29sZF9yc2Ffa2V5KHJlbW90ZV9pcCwgcmVkaXJlY3RfcG9ydCkNCisNCisgICAgICAgIHNl cmlhbGl6ZXIgPSBzZWxmLmhvc3RfZHV0LnNlcmlhbGl6ZXINCisNCisgICAgICAgIHRyeToNCisg ICAgICAgICAgICB2bV9kdXQgPSBWaXJ0RHV0KA0KKyAgICAgICAgICAgICAgICBjcmIsDQorICAg ICAgICAgICAgICAgIHNlcmlhbGl6ZXIsDQorICAgICAgICAgICAgICAgIHNlbGYudmlydF90eXBl LA0KKyAgICAgICAgICAgICAgICBzZWxmLnZtX25hbWUsDQorICAgICAgICAgICAgICAgIHNlbGYu c3VpdGUpDQorICAgICAgICBleGNlcHQgRXhjZXB0aW9uIGFzIGU6DQorICAgICAgICAgICAgcmFp c2UgRXhjZXB0aW9uKGUpDQorICAgICAgICB2bV9kdXQubmljX3R5cGUgPSAnYW55Jw0KKyAgICAg ICAgdm1fZHV0LnRlc3RlciA9IHNlbGYuaG9zdF9kdXQudGVzdGVyDQorICAgICAgICB2bV9kdXQu aG9zdF9kdXQgPSBzZWxmLmhvc3RfZHV0DQorICAgICAgICB2bV9kdXQuaG9zdF9zZXNzaW9uID0g c2VsZi5ob3N0X3Nlc3Npb24NCisNCisgICAgICAgIHJlYWRfY2FjaGUgPSBGYWxzZQ0KKyAgICAg ICAgc2tpcF9zZXR1cCA9IHNlbGYuaG9zdF9kdXQuc2tpcF9zZXR1cA0KKyAgICAgICAgYmFzZV9k aXIgPSBzZWxmLmhvc3RfZHV0LmJhc2VfZGlyDQorICAgICAgICB2bV9kdXQuc2V0X3NwZWVkdXBf b3B0aW9ucyhyZWFkX2NhY2hlLCBza2lwX3NldHVwKQ0KKyAgICAgICAgZnVuY19vbmx5ID0gc2Vs Zi5ob3N0X2R1dC53YW50X2Z1bmNfdGVzdHMNCisgICAgICAgIHBlcmZfb25seSA9IHNlbGYuaG9z dF9kdXQud2FudF9wZ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5BTUUpDQorICAgICAgICBz ZWxmLmxvZ2dlci5jb25maWdfZXhlY3V0aW9uKCd2bWR1dCcpDQorICAgICAgICBzZWxmLnNlc3Np b24gPSBTU0hDb25uZWN0aW9uKHNlbGYudm1faXAsIHNlbGYuTkFNRSwNCisgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgc2VsZi5nZXRfcGFzc3dvcmQoKSkNCisgICAgICAgIHNl bGYuc2Vzc2lvbi5pbml0X2xvZyhzZWxmLmxvZ2dlcikNCisNCisgICAgICAgICMgaWYgcmVkaXJl Y3Qgc3NoIHBvcnQsIHRoZXJlJ3Mgb25seSBvbmUgc2Vzc2lvbiBlbmFibGVkDQorICAgICAgICBz ZWxmLmFsdF9zZXNzaW9uID0gU1NIQ29ubmVjdGlvbihzZWxmLnZtX2lwLCBzZWxmLk5BTUUgKyAn X2FsdCcsDQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZWxmLmdl dF9wYXNzd29yZCgpKQ0KKyAgICAgICAgc2VsZi5hbHRfc2Vzc2lvbi5pbml0X2xvZyhzZWxmLmxv Z2dlcikNCisNCisgICAgICAgIHNlbGYubnVtYmVyX29mX2NvcmVzID0gMA0KKyAgICAgICAgc2Vs Zi50ZXN0ZXIgPSBOb25lDQorICAgICAgICBzZWxmLmNvcmVzID0gW10NCisgICAgICAgIHNlbGYu YXJjaGl0ZWN0dXJlID0gTm9uZQ0KKyAgICAgICAgc2VsZi5wb3J0c19pbmZvID0gTm9uZQ0KKyAg ICAgICAgc2VsZi5wb3J0c19tYXAgPSBbXQ0KKyAgICAgICAgc2VsZi52aXJ0dHlwZSA9IHZpcnR0 eXBlDQorICAgICAgICBzZWxmLnZtdHlwZSA9ICcnDQorICAgICAgICBpZiBzZWxmLnZpcnR0eXBl ID09ICdYRU4nOg0KKyAgICAgICAgICAgIHNlbGYudm10eXBlID0gJ2RvbXUnDQorICAgICAgICAg ICAgc2VsZi52aXJ0dHlwZSA9ICdob3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sb2FkIHBvcnQgaW5m b3IgZnJvbSBjb25maWcgZmlsZQ0KKyAgICAgICAgc2VsZi5sb2FkX3BvcnRjb25mKCkNCisNCisg ICAgICAgICMgZW5hYmxlIHRlc3RlciBwb3J0IGlwdjYNCisgICAgICAgIHNlbGYuaG9zdF9kdXQu ZW5hYmxlX3Rlc3Rlcl9pcHY2KCkNCisgICAgICAgIHNlbGYubW91bnRfcHJvY2ZzKCkNCisgICAg ICAgICMgYXV0byBkZXRlY3QgbmV0d29yayB0b3BvbG9neQ0KKyAgICAgICAgc2VsZi5tYXBfYXZh aWxhYmxlX3BvcnRzKCkNCisgICAgICAgICMgZGlzYWJsZSB0ZXN0ZXIgcG9ydCBpcHY2DQorICAg ICAgICBzZWxmLmhvc3RfZHV0LmRpc2FibGVfdGVzdGVyX2lwdjYoKQ0KKw0KKyAgICAgICAgIyBw cmludCBsYXRlc3QgcG9ydHNfaW5mbw0KKyAgICAgICAgZm9yIHBvcnRfaW5mbyBpbiBzZWxmLnBv cnRzX2luZm86DQorICAgICAgICAgICAgc2VsZi5sb2dnZXIuaW5mbyhwb3J0X2luZm8pDQorDQor ICAgIGRlZiByZXN0b3JlX2ludGVyZmFjZXNfZG9tdShzZWxmKToNCisgICAgICAgICIiIg0KKyAg ICAgICAgUmVzdG9yZSBMaW51eCBpbnRlcmZhY2VzLg0KKyAgICAgICAgIiIiDQorICAgICAgICBm b3IgcG9ydCBpbiBzZWxmLnBvcnRzX2luZm86DQorICAgICAgICAgICAgcGNpX2J1cyA9IHBvcnRb J3BjaSddDQorICAgICAgICAgICAgcGNpX2lkID0gcG9ydFsndHlwZSddDQorICAgICAgICAgICAg ZHJpdmVyID0gc2V0dGluZ3MuZ2V0X25pY19kcml2ZXIocGNpX2lkKQ0KKyAgICAgICAgICAgIGlm IGRyaXZlciBpcyBub3QgTm9uZToNCisgICAgICAgICAgICAgICAgYWRkcl9hcnJheSA9IHBjaV9i dXMuc3BsaXQoJzonKQ0KKyAgICAgICAgICAgICAgICBidXNfaWQgPSBhZGRyX2FycmF5WzBdDQor ICAgICAgICAgICAgICAgIGRldmZ1bl9pZCA9IGFkZHJfYXJyYXlbMV0NCisgICAgICAgICAgICAg ICAgcG9ydCA9IE5ldERldmljZShzZWxmLCBidXNfaWQsIGRldmZ1bl9pZCkNCisgICAgICAgICAg ICAgICAgaXRmID0gcG9ydC5nZXRfaW50ZXJmYWNlX25hbWUoKQ0KKyAgICAgICAgICAgICAgICBz ZWxmLnNlbmRfZXhwZWN0KCJpZmNvbmZpZyAlcyB1cCIgJSBpdGYsICIjICIpDQorICAgICAgICAg ICAgICAgIHRpbWUuc2xlZXAoMzApDQorICAgICAgICAgICAgICAgIHByaW50IHNlbGYuc2VuZF9l eHBlY3QoImlwIGxpbmsgbHMgJXMiICUgaXRmLCAiIyAiKQ0KKyAgICAgICAgICAgIGVsc2U6DQor ICAgICAgICAgICAgICAgIHNlbGYubG9nZ2VyLmluZm8oDQorICAgICAgICAgICAgICAgICAgICAi Tk9UIEZPVU5EIERSSVZFUiBGT1IgUE9SVCAoJXN8JXMpISEhIiAlIChwY2lfYnVzLCBwY2lfaWQp KQ0KKw0KKyAgICBkZWYgcGNpX2RldmljZXNfaW5mb3JtYXRpb24oc2VsZik6DQorICAgICAgICBz ZWxmLnBjaV9kZXZpY2VzX2luZm9ybWF0aW9uX3VuY2FjaGVkKCkNCisNCisgICAgZGVmIGdldF9t ZW1vcnlfY2hhbm5lbHMoc2VsZik6DQorICAgICAgICAiIiINCisgICAgICAgIFZpcnR1YWwgbWFj aGluZSBoYXMgbm8gbWVtb3J5IGNoYW5uZWwgY29uY2VwdCwgc28gYWx3YXlzIHJldHVybiAxDQor ICAgICAgICAiIiINCisgICAgICAgIHJldHVybiAxDQorDQorICAgIGRlZiBjaGVja19wb3J0c19h dmFpbGFibGUoc2VsZiwgcGNpX2J1cywgcGNpX2lkKToNCisgICAgICAgICIiIg0KKyAgICAgICAg Q2hlY2sgdGhhdCB3aGV0aGVyIGF1dG8gc2N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FsndW51 c2VkJ10gKiBsZW4oc2VsZi51bnVzZWRfcG9ydHMpDQorDQorICAgICAgICAjIGluaXRpYWxpemVk IHZmIHBvcnRzDQorICAgICAgICBzZWxmLnZmc19pbmZvID0gW10NCisgICAgICAgIHNlbGYudmZz ID0gW10NCisgICAgICAgIHNlbGYudW51c2VkX3ZmcyA9IFtdDQorICAgICAgICBzZWxmLnVzZWRf dmZzID0gW10NCisNCisgICAgICAgICMgc2F2ZSBhbGxvY2F0ZWQgY29yZXMgYW5kIHJlbGF0ZWQg dm0NCisgICAgICAgIHNlbGYuYWxsb2NhdGVkX2luZm8gPSB7fQ0KKw0KKyAgICBkZWYgX19wb3J0 X3VzZWQoc2VsZiwgcGNpKToNCisgICAgICAgIGluZGV4ID0gc2VsZi5wb3J0cy5pbmRleChwY2kp DQorICAgICAgICBzZWxmLnVzZWRfcG9ydHNbaW5kZXhdID0gcGNpDQorICAgICAgICBzZWxmLnVu dXNlZF9wb3J0c1tpbmRleF0gPSAndXNlZCcNCisNCisgICAgZGVmIF9fcG9ydF91bnVzZWQoc2Vs ZiwgcGNpKToNCisgICAgICAgIGluZGV4ID0gc2VsZi5wb3J0cy5pbmRleChwY2kpDQorICAgICAg ICBzZWxmLnVudXNlZF9wb3J0c1tpbmRleF0gPSBwY2kNCisgICAgICAgIHNlbGYudXNlZF9wb3J0 c1tpbmRleF0gPSAndW51c2VkJw0KKw0KKyAgICBkZWYgX19wb3J0X29uX3NvY2tldChzZWxmLCBw Y2ksIHNvY2tldCk6DQorICAgICAgICBmb3IgcG9ydCBpbiBzZWxmLnBvcnRzX2luZm86DQorICAg ICAgICAgICAgaWYgcG9ydFsncGNpJ10gPT0gcGNpOg0KKyAgICAgICAgICAgICAgICBpZiBzb2Nr ZXQgaXMgLTE6DQorICAgICAgICAgICAgICAgICAgICByZXR1cm4gVHJ1ZQ0KKw0KKyAgICAgICAg ICAgICAgICBpZiBwb3J0WydudW1hJ10gPT0gc29ja2V0Og0KKyAgICAgICAgICAgICAgICAgICAg cmV0dXJuIFRydWUNCisgICAgICAgICAgICAgICAgZWxzZToNCisgICAgICAgICAgICAgICAgICAg IHJldHVybiBGYWxzZQ0KKw0KKyAgICAgICAgcmV0dXJuIEZhbHNlDQorDQorICAgIGRlZiBfX3Zm X3VzZWQoc2VsZiwgcGNpKToNCisgICAgICAgIGluZGV4ID0gc2VsZi52ZnMuaW5kZXgocGNpKQ0K KyAgICAgICAgc2VsZi51c2VkX3Zmc1tpbmRleF0gPSBwY2kNCisgICAgICAgIHNlbGYudW51c2Vk X3Zmc1tpbmRleF0gPSAndXNlZCcNCisNCisgICAgZGVmIF9fdmZfdW51c2VkKHNlbGYsIHBjaSk6 DQorICAgICAgICBpbmRleCA9IHNlbGYudmZzLmluZGV4KHBjaSkNCisgICAgICAgIHNlbGYudXNl ZF92ZnNbaW5kZXhdID0gJ3VudXNlZCcNCisgICAgICAgIHNlbGYudW51c2VkX3Zmc1tpbmRleF0g PSBwY2kNCisNCisgICAgZGVmIF9fY29yZV91c2VkKHNlbGYsIGNvcmUpOg0KKyAgICAgICAgY29y ZSA9IGludChjb3JlKQ0KKyAgICAgICAgaW5kZXggPSBzZWxmLmNvcmVzLmluZGV4KGNvcmUpDQor ICAgICAgICBzZWxmLnVzZWRfY29yZXNbaW5kZXhdID0gY29yZQ0KKyAgICAgICAgc2VsZi51bnVz ZWRfY29yZXNbaW5kZXhdID0gLTENCisNCisgICAgZGVmIF9fY29yZV91bnVzZWQoc2VsZiwgY29y ZSk6DQorICAgICAgICBjb3JlID0gaW50KGNvcmUpDQorICAgICAgICBpbmRleCA9IHNlbGYuY29y ZXMuaW5kZXgoY29yZSkNCisgICAgICAgIHNlbGYudW51c2VkX2NvcmVzW2luZGV4XSA9IGNvcmUN CisgICAgICAgIHNlbGYudXNlZF9jb3Jlc1tpbmRleF0gPSAtMQ0KKw0KKyAgICBkZWYgX19jb3Jl X29uX3NvY2tldChzZWxmLCBjb3JlLCBzb2NrZXQpOg0KKyAgICAgICAgZm9yIGR1dF9jb3JlIGlu IHNlbGYuZHV0LmNvcmVzOg0KKyAgICAgICAgICAgIGlmIGludChkdXRfY29yZVsndGhyZWFkJ10p ID09IGNvcmU6DQorICAgICAgICAgICAgICAgIGlmIHNvY2tldCBpcyAtMToNCisgICAgICAgICAg ICAgICAgICAgIHJldHVybiBUcnVlDQorDQorICAgICAgICAgICAgICAgIGlmIGludChkdXRfY29y ZVsnc29ja2V0J10pID09IHNvY2tldDoNCisgICAgICAgICAgICAgICAgICAgIHJldHVybiBUcnVl DQorICAgICAgICAgICAgICAgIGVsc2U6DQorICAgICAgICAgICAgICAgICAgICByZXR1cm4gRmFs c2UNCisNCisgICAgICAgIHJldHVybiBGYWxzZQ0KKw0KKyAgICBkZWYgX19jb3JlX2lzdXNlZChz ZWxmLCBjb3JlKToNCisgICAgICAgIGluZGV4ID0gc2VsZi5jb3Jlcy5pbmRleChjb3JlKQ0KKyAg ICAgICAgaWYgc2VsZi51c2VkX2NvcmVzW2luZGV4XSAhPSAtMToNCisgICAgICAgICAgICByZXR1 cm4gVHJ1ZQ0KKyAgICAgICAgZWxzZToNCisgICAgICAgICAgICByZXR1cm4gRmFsc2UNCisNCisg ICAgZGVmIHJlc2VydmVfY3B1KHNlbGYsIGNvcmVtYXNrPScnKToNCisgICAgICAgICIiIg0KKyAg ICAgICAgUmVzZXJ2ZSBkcGRrIHVzZWQgY3B1cyBieSBtYXNrDQorICAgICAgICAiIiINCisgICAg ICAgIHZhbCA9IGludChjb3JlbWFzaywgYmFzZT0xNikNCisgICAgICAgIGNwdXMgPSBbXQ0KKyAg ICAgICAgaW5kZXggPSAwDQorICAgICAgICB3aGlsZSB2YWwgIT0gMDoNCisgICAgICAgICAgICBp ZiB2YWwgJiAweDE6DQorICAgICAgICAgICAgICAgIGNwdXMuYXBwZW5kKGluZGV4KQ0KKw0KKyAg ICAgICAgICAgIHZhbCA9IHZhbCA+PiAxDQorICAgICAgICAgICAgaW5kZXggKz0gMQ0KKw0KKyAg ICAgICAgZm9yIGNwdSBpbiBjcHVzOg0KKyAgICAgICAgICAgIHNlbGYuX19jb3JlX3VzZWQoY3B1 KQ0KKw0KKyAgICBkZWYgYWxsb2NfY3B1KHNlbGYsIHZtPScnLCBudW1iZXI9LTEsIHNvY2tldD0t MSwgY29yZWxpc3Q9Tm9uZSk6DQorICAgICAgICAiIiINCisgICAgICAgIFRoZXJlJ3JlIHR3byBv cHRpb25zIGZvciByZXF1ZXN0IGNwdSByZXNvdWNlIGZvciB2bS4NCisgICAgICAgIElmIG51bWJl ciBpcyBub3QgLTEsIGp1c3QgYWxsb2NhdGUgY3B1IGZyb20gbm90IHVzZWQgY29yZXMuDQorICAg ICAgICBJZiBsaXN0IGlzIG5vdCBOb25lLCB3aWxsIGFsbG9jYXRlIGNwdSBhZnRlciBjaGVja2Vk Lg0KKyAgICAgICAgIiIiDQorICAgICAgICBjb3JlcyA9IFtdDQorDQorICAgICAgICBpZiB2bSA9 PSAnJzoNCisgICAgICAgICAgICBwcmludCAiQWxsb2MgY3B1IHJlcXVlc3Qgdml0dWFsIG1hY2hp bmUgbmFtZSEhISINCisgICAgICAgICAgICByZXR1cm4gY29yZXMNCisNCisgICAgICAgIGlmIG51 bWJlciAhPSAtMToNCisgICAgICAgICAgICBmb3IgY29yZSBpbiBzZWxmLnVudXNlZF9jb3JlczoN CisgICAgICAgICAgICAgICAgaWYgY29yZSAhPSAtMSBhbmQgbnVtYmVyICE9IDA6DQorICAgICAg ICAgICAgICAgICAgICBpZiBzZWxmLl9fY29yZV9vbl9zb2NrZXQoY29yZSwgc29ja2V0KSBpcyBU cnVlOg0KKyAgICAgICAgICAgICAgICAgICAgICAgIHNlbGYuX19jb3JlX3VzZWQoY29yZSkNCisg ICAgICAgICAgICAgICAgICAgICAgICBjb3Jlcy5hcHBlbmQoc3RyKGNvcmUpKQ0KKyAgICAgICAg ICAgICAgICAgICAgICAgIG51bWJlciA9IG51bWJlciAtIDENCisgICAgICAgICAgICBpZiBudW1i ZXIgIT0gMDoNCisgICAgICAgICAgICAgICAgcHJpbnQgIkNhbid0IGFsbG9jYXRlZCByZXF1ZXN0 ZWQgY3B1ISEhIg0KKw0KKyAgICAgICAgaWYgY29yZWxpc3QgaXMgbm90IE5vbmU6DQorICAgICAg ICAgICAgZm9yIGNvcmUgaW4gY29yZWxpc3Q6DQorICAgICAgICAgICAgICAgIGlmIHNlbGYuX19j b3JlX2lzdXNlZChpbnQoY29yZSkpIGlzIFRydWU6DQorICAgICAgICAgICAgICAgICAgICBwcmlu dCAiQ29yZSAlcyBoYXMgYmVlbiB1c2VkISEhIiAlIGNvcmUNCisgICAgICAgICAgICAgICAgZWxz ZToNCisgICAgICAgICAgICAgICAgICAgIGlmIHNlbGYuX19jb3JlX29uX3NvY2tldChpbnQoY29y ZSksIHNvY2tldCkgaXMgVHJ1ZToNCisgICAgICAgICAgICAgICAgICAgICAgICBzZWxmLl9fY29y ZV91c2VkKGludChjb3JlKSkNCisgICAgICAgICAgICAgICAgICAgICAgICBjb3Jlcy5hcHBlbmQo Y29yZSkNCisNCisgICAgICAgIGlmIHZtIG5vdCBpbiBzZWxmLmFsbG9jYXRlZF9pbmZvOg0KKyAg ICAgICAgICAgIHNlbGYuYWxsb2NhdGVkX2luZm9bdm1dID0ge30NCisNCisgICAgICAgIHNlbGYu YWxsb2NhdGVkX2luZm9bdm1dWydjb3JlcyddID0gY29yZXMNCisgICAgICAgIHJldHVybiBjb3Jl cw0KKw0KKyAgICBkZWYgX192bV9oYXNfcmVzb3VyY2Uoc2VsZiwgdm0sIHJlc291cmNlPScnKToN CisgICAgICAgIGlmIHZtID09ICcnOg0KKyAgICAgICAgICAgIHNlbGYuZHV0LmxvZ2dlci5pbmZv KCJWTSBuYW1lIGNhbm50IGJlIE5VTEwhISEiKQ0KKyAgICAgICAgICAgIHJhaXNlIEV4Y2VwdGlv bigiVk0gbmFtZSBjYW5udCBiZSBOVUxMISEhIikNCisgICAgICAgIGlmIHZtIG5vdCBpbiBzZWxm LmFsbG9jYXRlZF9pbmZvOg0KKyAgICAgICAgICAgIHNlbGYuZHV0LmxvZ2dlci5pbmZvKA0KKyAg ICAgICAgICAgICAgICAiVGhlcmUgaXMgbm8gcmVzb3VyY2UgYWxsb2NhdGVkIHRvIFZNIFslc10u IiAlIHZtKQ0KKyAgICAgICAgICAgIHJldHVybiBGYWxzZQ0KKyAgICAgICAgaWYgcmVzb3VyY2Ug PT0gJyc6DQorICAgICAgICAgICAgcmV0dXJuIFRydWUNCisgICAgICAgIGlmIHJlc291cmNlIG5v dCBpbiBzZWxmLmFsbG9jYXRlZF9pbmZvW3ZtXToNCisgICAgICAgICAgICBzZWxmLmR1dC5sb2dn ZXIuaW5mbygNCisgICAgICAgICAgICAgICAgIlRoZXJlIGlzIG5vIHJlc291cmNlIFslc10gYWxs b2NhdGVkIHRvIFZNIFslc10gIiAlDQorICAgICAgICAgICAgICAgIChyZXNvdXJjZSwgdm0pKQ0K KyAgICAgICAgICAgIHJldHVybiBGYWxzZQ0KKyAgICAgICAgcmV0dXJuIFRydWUNCisNCisgICAg ZGVmIGZyZWVfY3B1KHNlbGYsIHZtKToNCisgICAgICAgIGlmIHNlbGYuX192bV9oYXNfcmVzb3Vy Y2Uodm0sICdjb3JlcycpOg0KKyAgICAgICAgICAgIGZvciBjb3JlIGluIHNlbGYuYWxsb2NhdGVk X2luZm9bdm1dWydjb3JlcyddOg0KKyAgICAgICAgICAgICAgICBzZWxmLl9fY29yZV91bnVzZWQo Y29yZSkNCisgICAgICAgICAgICBzZWxmLmFsbG9jYXRlZF9pbmZvW3ZtXS5wb3AoJ2NvcmVzJykN CisNCisgICAgZGVmIGFsbG9jX3BmKHNlbGYsIHZtPScnLCBudW1iZXI9LTEsIHNvY2tldD0tMSwg cGZsaXN0PVtdKToNCisgICAgICAgICIiIg0KKyAgICAgICAgVGhlcmUncmUgdHdvIG9wdGlvbnMg Zm9yIHJlcXVlc3QgcGYgZGV2aWNlcyBmb3Igdm0uDQorICAgICAgICBJZiBudW1iZXIgaXMgbm90 IC0xLCBqdXN0IGFsbG9jYXRlIHBmIGRldmljZSBmcm9tIG5vdCB1c2VkIHBmcy4NCisgICAgICAg IElmIGxpc3QgaXMgbm90IE5vbmUsIHdpbGwgYWxsb2NhdGUgcGYgZGV2aWNlcyBhZnRlciBjaGVj a2VkLg0KKyAgICAgICAgIiIiDQorICAgICAgICBwb3J0cyA9IFtdDQorDQorICAgICAgICBpZiBu dW1iZXIgIT0gLTE6DQorICAgICAgICAgICAgZm9yIHBjaSBpbiBzZWxmLnVudXNlZF9wb3J0czoN CisgICAgICAgICAgICAgICAgaWYgcGNpICE9ICd1bnVzZWQnIGFuZCBudW1iZXIgIT0gMDoNCisg ICAgICAgICAgICAgICAgICAgIGlmIHNlbGYuX19wb3J0X29uX3NvY2tldChwY2ksIHNvY2tldCkg aXMgVHJ1ZToNCisgICAgICAgICAgICAgICAgICAgICAgICBzZWxmLl9fcG9ydF91c2VkKHBjaSkN CisgICAgICAgICAgICAgICAgICAgICAgICBwb3J0cy5hcHBlbmQocGNpKQ0KKyAgICAgICAgICAg ICAgICAgICAgICAgIG51bWJlciA9IG51bWJlciAtIDENCisgICAgICAgICAgICBpZiBudW1iZXIg IT0gMDoNCisgICAgICAgICAgICAgICAgcHJpbnQgIkNhbid0IGFsbG9jYXRlZCByZXF1ZXN0ZWQg UEYgZGV2aWNlcyEhISINCisNCisgICAgICAgIGlmIHBmbGlzdCBpcyBub3QgTm9uZToNCisgICAg ICAgICAgICBmb3IgcGNpIGluIHBmbGlzdDoNCisgICAgICAgICAgICAgICAgaWYgc2VsZi5fX3Bv cnRfaXN1c2VkKHBjaSkgaXMgVHJ1ZToNCisgICAgICAgICAgICAgICAgICAgIHByaW50ICJQb3J0 ICVzIGhhcyBiZWVuIHVzZWQhISEiICUgcGNpDQorICAgICAgICAgICAgICAgIGVsc2U6DQorICAg ICAgICAgICAgICAgICAgICBpZiBzZWxmLl9fcG9ydF9vbl9zb2NrZXQocGNpLCBzb2NrZXQpIGlz IFRydWU6DQorICAgICAgICAgICAgICAgICAgICAgICAgc2VsZi5fX3BvcnRfdXNlZChjb3JlKQ0K KyAgICAgICAgICAgICAgICAgICAgICAgIHBvcnRzLmFwcGVuZChjb3JlKQ0KKw0KKyAgICAgICAg aWYgdm0gbm90IGluIHNlbGYuYWxsb2NhdGVkX2luZm86DQorICAgICAgICAgICAgc2VsZi5hbGxv Y2F0ZWRfaW5mb1t2bV0gPSB7fQ0KKw0KKyAgICAgICAgc2VsZi5hbGxvY2F0ZWRfaW5mb1t2bV1b J3BvcnRzJ10gPSBwb3J0cw0KKyAgICAgICAgcmV0dXJuIHBvcnRzDQorDQorICAgIGRlZiBmcmVl X3BmKHNlbGYsIHZtKToNCisgICAgICAgIGlmIHNlbGYuX192bV9oYXNfcmVzb3VyY2Uodm0sICdw b3J0cycpOg0KKyAgICAgICAgICAgIGZvciBwY2kgaW4gc2VsZi5hbGxvY2F0ZWRfaW5mb1t2bV1b J3BvcnRzJ106DQorICAgICAgICAgICAgICAgIHNlbGYuX19wb3J0X3VudXNlZChwY2kpDQorICAg ICAgICAgICAgc2VsZi5hbGxvY2F0ZWRfaW5mb1t2bV0ucG9wKCdwb3J0cycpDQorDQorICAgIGRl ZiBhbGxvY192Zl9mcm9tX3BmKHNlbGYsIHZtPScnLCBwZl9wY2k9JycsIG51bWJlcj0tMSwgdmZs aXN0PVtdKToNCisgICAgICAgICIiIg0KKyAgICAgICAgVGhlcmUncmUgdHdvIG9wdGlvbnMgZm9y IHJlcXVlc3QgdmYgZGV2aWNlcyBvZiBwZiBkZXZpY2UuDQorICAgICAgICBJZiBudW1iZXIgaXMg bm90IC0xLCBqdXN0IGFsbG9jYXRlIHZmIGRldmljZSBmcm9tIG5vdCB1c2VkIHZmcy4NCisgICAg ICAgIElmIGxpc3QgaXMgbm90IE5vbmUsIHdpbGwgYWxsb2NhdGUgdmYgZGV2aWNlcyBhZnRlciBj aGVja2VkLg0KKyAgICAgICAgIiIiDQorICAgICAgICB2ZnMgPSBbXQ0KKyAgICAgICAgaWYgdm0g PT0gJyc6DQorICAgICAgICAgICAgcHJpbnQgIkFsbG9jIFZGIHJlcXVlc3Qgdml0dWFsIG1hY2hp bmUgbmFtZSEhISINCisgICAgICAgICAgICByZXR1cm4gdmZzDQorDQorICAgICAgICBpZiBwZl9w Y2kgPT0gJyc6DQorICAgICAgICAgICAgcHJpbnQgIkFsbG9jIFZGIHJlcXVlc3QgUEYgcGNpIGFk ZHJlc3MhISEiDQorICAgICAgICAgICAgcmV0dXJuIHZmcw0KKw0KKyAgICAgICAgZm9yIHZmX2lu Zm8gaW4gc2VsZi52ZnNfaW5mbzoNCisgICAgICAgICAgICBpZiB2Zl9pbmZvWydwZl9wY2knXSA9 PSBwZl9wY2k6DQorICAgICAgICAgICAgICAgIGlmIHZmX2luZm9bJ3BjaSddIGluIHZmbGlzdDoN CisgICAgICAgICAgICAgICAgICAgIHZmcy5hcHBlbmQodmZfaW5mb1sncGNpJ10pDQorICAgICAg ICAgICAgICAgICAgICBjb250aW51ZQ0KKw0KKyAgICAgICAgICAgICAgICBpZiBudW1iZXIgPiAw Og0KKyAgICAgICAgICAgICAgICAgICAgdmZzLmFwcGVuZCh2Zl9pbmZvWydwY2knXSkNCisgICAg ICAgICAgICAgICAgICAgIG51bWJlciA9IG51bWJlciAtIDENCisNCisgICAgICAgIGZvciB2ZiBp biB2ZnM6DQorICAgICAgICAgICAgc2VsZi5fX3ZmX3VzZWQodmYpDQorDQorICAgICAgICBpZiB2 bSBub3QgaW4gc2VsZi5hbGxvY2F0ZWRfaW5mbzoNCisgICAgICAgICAgICBzZWxmLmFsbG9jYXRl ZF9pbmZvW3ZtXSA9IHt9DQorDQorICAgICAgICBzZWxmLmFsbG9jYXRlZF9pbmZvW3ZtXVsndmZz J10gPSB2ZnMNCisgICAgICAgIHJldHVybiB2ZnMNCisNCisgICAgZGVmIGZyZWVfdmYoc2VsZiwg dm0pOg0KKyAgICAgICAgaWYgc2VsZi5fX3ZtX2hhc19yZXNvd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gW10NCisgICAgICAgIGZvciB2ZiBpbiB2Zmxpc3Q6DQorICAgICAgICAg ICAgZm9yIHZmc19pbmZvIGluIHNlbGYudmZzX2luZm86DQorICAgICAgICAgICAgICAgIGlmIHZm c19pbmZvWydwY2knXSA9PSB2ZjoNCisgICAgICAgICAgICAgICAgICAgIHZmcy5hcHBlbmQodmYp DQorDQorICAgICAgICBmb3IgdmYgaW4gdmZzOg0KKyAgICAgICAgICAgIHRyeToNCisgICAgICAg ICAgICAgICAgaW5kZXggPSBzZWxmLnZmcy5pbmRleCh2ZikNCisgICAgICAgICAgICBleGNlcHQ6 DQorICAgICAgICAgICAgICAgIGNvbnRpbnVlDQorICAgICAgICAgICAgZGVsIHNlbGYudmZzX2lu Zm9baW5kZXhdDQorICAgICAgICAgICAgZGVsIHNlbGYudW51c2VkX3Zmc1tpbmRleF0NCisgICAg ICAgICAgICBkZWwgc2VsZi51c2VkX3Zmc1tpbmRleF0NCisgICAgICAgICAgICBkZWwgc2VsZi52 ZnNbaW5kZXhdDQorDQorICAgIGRlZiBhbGxvY19wb3J0KHNlbGYsIHZtPScnKToNCisgICAgICAg ICIiIg0KKyAgICAgICAgQWxsb2NhdGUgdW51c2VkIGhvc3QgcG9ydCBmb3Igdm0NCisgICAgICAg ICIiIg0KKyAgICAgICAgaWYgdm0gPT0gJyc6DQorICAgICAgICAgICAgcHJpbnQgIkFsbG9jIGhv c3QgcG9ydCByZXF1ZXN0IHZpdHVhbCBtYWNoaW5lIG5hbWUhISEiDQorICAgICAgICAgICAgcmV0 dXJuIE5vbmUNCisNCisgICAgICAgIHBvcnRfc3RhcnQgPSBJTklUX0ZSRUVfUE9SVCArIHJhbmRp bnQoMSwgMTAwKQ0KKyAgICAgICAgcG9ydF9zdGVwID0gcmFuZGludCgxLCAxMCkNCisgICAgICAg IHBvcnQgPSBOb25lDQorICAgICAgICBjb3VudCA9IDIwDQorICAgICAgICB3aGlsZSBUcnVlOg0K KyAgICAgICAgICAgIGlmIHNlbGYuZHV0LmNoZWNrX3BvcnRfb2NjdXBpZWQocG9ydF9zdGFydCkg aXMgRmFsc2U6DQorICAgICAgICAgICAgICAgIHBvcnQgPSBwb3J0X3N0YXJ0DQorICAgICAgICAg ICAgICAgIGJyZWFrDQorICAgICAgICAgICAgY291bnQgLT0gMQ0KKyAgICAgICAgICAgIGlmIGNv dW50IDwgMDoNCisgICAgICAgICAgICAgICAgcHJpbnQgJ05vIGF2YWlsYWJsZSBwb3J0IG9uIHRo ZSBob3N0ISEhJw0KKyAgICAgICAgICAgICAgICBicmVhaw0KKyAgICAgICAgICAgIHBvcnRfc3Rh cnQgKz0gcG9ydF9zdGVwDQorDQorICAgICAgICBpZiB2bSBub3QgaW4gc2VsZi5hbGxvY2F0ZWRf aW5mbzoNCisgICAgICAgICAgICBzZWxmLmFsbG9jYXRlZF9pbmZvW3ZtXSA9IHt9DQorDQorICAg ICAgICBzZWxmLmFsbG9jYXRlZF9pbmZvW3ZtXVsnaG9zdHBvcnQnXSA9IHBvcnQNCisgICAgICAg IHJldHVybiBwb3J0DQorDQorICAgIGRlZiBmcmVlX3BvcnQoc2VsZiwgdm0pOg0KKyAgICAgICAg aWYgc2VsZi5fX3ZtX2hhc19yZXNvdXJjZSh2bSwgJ2hvc3Rwb3J0Jyk6DQorICAgICAgICAgICAg c2VsZi5hbGxvY2F0ZWRfaW5mb1t2bV0ucG9wKCdob3N0cG9ydCcpDQorDQorICAgIGRlZiBhbGxv Y192bmNfbnVtKHNlbGYsIHZtPScnKToNCisgICAgICAgICIiIg0KKyAgICAgICAgQWxsb2NhdGUg dW51c2VkIGhvc3QgVk5DIGRpc3BsYXkgbnVtYmVyIGZvciBWTS4NCisgICAgICAgICIiIg0KKyAg ICAgICAgaWYgdm0gPT0gJyc6DQorICAgICAgICAgICAgcHJpbnQgIkFsbG9jIHZuYyBkaXNwbGF5 IG51bWJlciByZXF1ZXN0IHZpdHVhbCBtYWNoaW5lIG5hbWUhISEiDQorICAgICAgICAgICAgcmV0 dXJu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DQorICAgIGRlZiBfX2luaXRfXyhzZWxmKToNCisgICAgICAgIHNlbGYucG9ydHNfaW5mbyA9 IFtdDQorICAgICAgICBzZWxmLmNvcmVzID0gW10NCisNCisgICAgZGVmIGNoZWNrX3BvcnRfb2Nj dXBpZWQoc2VsZiwgcG9ydCk6DQorICAgICAgICByZXR1cm4gRmFsc2UNCisNCitpZiBfX25hbWVf XyA9PSAiX19tYWluX18iOg0KKyAgICBkdXQgPSBzaW1wbGVfZHV0KCkNCisgICAgZHV0LmNvcmVz ID0gW3sndGhyZWFkJzogJzEnLCAnc29ja2V0JzogJzAnfSwgeyd0aHJlYWQnOiAnMicsICdzb2Nr ZXQnOiAnMCd9LA0KKyAgICAgICAgICAgICAgICAgeyd0aHJlYWQnOiAnMycsICdzb2NrZXQnOiAn MCd9LCB7J3RocmVhZCc6ICc0JywgJ3NvY2tldCc6ICcwJ30sDQorICAgICAgICAgICAgICAgICB7 J3RocmVhZCc6ICc1JywgJ3NvY2tldCc6ICcwJ30sIHsndGhyZWFkJzogJzYnLCAnc29ja2V0Jzog JzAnfSwNCisgICAgICAgICAgICAgICAgIHsndGhyZWFkJzogJzcnLCAnc29ja2V0JzogJzEnfSwg eyd0aHJlYWQnOiAnOCcsICdzb2NrZXQnOiAnMSd9LA0KKyAgICAgICAgICAgICAgICAgeyd0aHJl YWQnOiAnOScsICdzb2NrZXQnOiAnMSd9LCB7J3RocmVhZCc6ICcxMCcsICdzb2NrZXQnOiAnMSd9 LA0KKyAgICAgICAgICAgICAgICAgeyd0aHJlYWQnOiAnMTEnLCAnc29ja2V0JzogJzEnfSwgeyd0 aHJlYWQnOiAnMTInLCAnc29ja2V0JzogJzEnfV0NCisNCisgICAgZHV0LnBvcnRzX2luZm8gPSBb eydpbnRmJzogJ3A3ODZwMScsICdzb3VyY2UnOiAnY2ZnJywgJ21hYyc6ICc5MDplMjpiYTo2OTpl NTplNCcsDQorICAgICAgICAgICAgICAgICAgICAgICAncGNpJzogJzA4OjAwLjAnLCAnbnVtYSc6 IDAsICdpcHY2JzogJ2ZlODA6OjkyZTI6YmFmZjpmZTY5OmU1ZTQnLA0KKyAgICAgICAgICAgICAg ICAgICAgICAgJ3BlZXInOiAnSVhJQTo2LjUnLCAndHlwZSc6ICc4MDg2OjEwZmInfSwNCisgICAg ICAgICAgICAgICAgICAgICAgeydpbnRmJzogJ3A3ODZwMicsICdzb3VyY2UnOiAnY2ZnJywgJ21h Yyc6ICc5MDplMjpiYTo2OTplNTplNScsDQorICAgICAgICAgICAgICAgICAgICAgICAncGNpJzog JzA4OjAwLjEnLCAnbnVtYSc6IDAsICdpcHY2JzogJ2ZlODA6OjkyZTI6YmFmZjpmZTY5OmU1ZTUn LA0KKyAgICAgICAgICAgICAgICAgICAgICAgJ3BlZXInOiAnSVhJQTo2LjYnLCAndHlwZSc6ICc4 MDg2OjEwZmInfSwNCisgICAgICAgICAgICAgICAgICAgICAgeydpbnRmJzogJ3A3ODdwMScsICdz b3VyY2UnOiAnY2ZnJywgJ21hYyc6ICc5MDplMjpiYTo2OTplNTplNicsDQorICAgICAgICAgICAg ICAgICAgICAgICAncGNpJzogJzg0OjAwLjAnLCAnbnVtYSc6IDEsICdpcHY2JzogJ2ZlODA6Ojky ZTI6YmFmZjpmZTY5OmU1ZTYnLA0KKyAgICAgICAgICAgICAgICAgICAgICAgJ3BlZXInOiAnSVhJ QTo2LjcnLCAndHlwZSc6ICc4MDg2OjEwZmInfSwNCisgICAgICAgICAgICAgICAgICAgICAgeydp bnRmJzogJ3A3ODdwMicsICdzb3VyY2UnOiAnY2ZnJywgJ21hYyc6ICc5MDplMjpiYTo2OTplNTpl NycsDQorICAgICAgICAgICAgICAgICAgICAgICAncGNpJzogJzg0OjAwLjEnLCAnbnVtYSc6IDEs ICdpcHY2JzogJ2ZlODA6OjkyZTI6YmFmZjpmZTY5OmU1ZTcnLA0KKyAgICAgICAgICAgICAgICAg ICAgICAgJ3BlZXInOiAnSVhJQTo2LjgnLCAndHlwZSc6ICc4MDg2OjEwZmInfV0NCisNCisgICAg dmlydF9wb29sID0gVmlydFJlc291cmNlKGR1dCkNCisgICAgcHJpbnQgIkFsbG9jIHR3byBQRiBk ZXZpY2VzIG9uIHNvY2tldCAxIGZyb20gVk0iDQorICAgIHByaW50IHZpcnRfcG9vbC5hbGxvY19w Zih2bT0ndGVzdDEnLCBudW1iZXI9Miwgc29ja2V0PTEpDQorDQorICAgIHZpcnRfcG9vbC5hZGRf dmZfb25fcGYocGZfcGNpPScwODowMC4wJywgdmZsaXN0PVsNCisgICAgICAgICAgICAgICAgICAg ICAgICAgICAnMDg6MTAuMCcsICcwODoxMC4yJywgJzA4OjEwLjQnLCAnMDg6MTAuNiddKQ0KKyAg ICB2aXJ0X3Bvb2wuYWRkX3ZmX29uX3BmKHBmX3BjaT0nMDg6MDAuMScsIHZmbGlzdD1bDQorICAg ICAgICAgICAgICAgICAgICAgICAgICAgJzA4OjEwLjEnLCAnMDg6MTAuMycsICcwODoxMC41Jywg JzA4OjEwLjcnXSkNCisgICAgcHJpbnQgIkFkZCBWRiBkZXZpY2VzIHRvIHJlc291cmNlIHBvb2wi DQorICAgIHByaW50IHZpcnRfcG9vbC52ZnNfaW5mbw0KKw0KKyAgICBwcmludCAiQWxsb2MgVkYg ZGV2aWNlIGZyb20gcmVzb3VyY2UgcG9vbCINCisgICAgcHJpbnQgdmlydF9wb29sLmFsbG9jX3Zm X2Zyb21fcGYodm09J3Rlc3QxJywgcGZfcGNpPScwODowMC4wJywgbnVtYmVyPTIpDQorICAgIHBy aW50IHZpcnRfcG9vbC51c2VkX3Zmcw0KKyAgICBwcmludCAiQWxsb2MgVkYgZGV2aWNlIGZyb20g cmVzb3VyY2UgcG9vbCINCisgICAgcHJpbnQgdmlydF9wb29sLmFsbG9jX3ZmX2Zyb21fcGYodm09 J3Rlc3QyJywgcGZfcGNpPScwODowMC4xJywgdmZsaXN0PVsnMDg6MTAuMycsICcwODoxMC41J10p DQorICAgIHByaW50IHZpcnRfcG9vbC51c2Vk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