From 17fabe47dcbbe6b2180e73cac6211f7394d61a8a Mon Sep 17 00:00:00 2001 From: Scott Moser Date: Fri, 18 Jun 2010 00:23:25 -0400 Subject: add 'cloud-boothook' type if user data is of type text/cloud-boothook, or begins with #cloud-boothook, then assume it to be code to be executed. Boothooks are a very simple format. Basically, its a one line header ('#cloud-config\n') and then executable payload. The executable payload is written to a file, then that file is executed at the time it is read. The file is left in /var/lib/cloud/data/boothooks There is no "first-time-only" protection. If running only once is desired, the boothook must handle that itself. --- tools/write-mime-multipart | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'tools') diff --git a/tools/write-mime-multipart b/tools/write-mime-multipart index d7ce0992..6466c3ff 100755 --- a/tools/write-mime-multipart +++ b/tools/write-mime-multipart @@ -25,7 +25,8 @@ starts_with_mappings={ '#!' : 'text/x-shellscript', '#cloud-config' : 'text/cloud-config', '#upstart-job' : 'text/upstart-job', - '#part-handler' : 'text/part-handler' + '#part-handler' : 'text/part-handler', + '#cloud-boothook' : 'text/cloud-boothook' } def get_type(fname,deftype): -- cgit v1.2.3