Odd_Bloke | vans163: If your shell supports <(...), that might work? | 11:15 |
---|---|---|
=== shardy is now known as shardy_lunch | ||
=== shardy_lunch is now known as shardy | ||
vans163 | Odd_Bloke: I need to try but it needs user-data AND meta-data, does it just cat the two? | 14:13 |
vans163 | if it just needed one I would definetly try piping it in without thinking about it | 14:13 |
Odd_Bloke | I would expect: genisoimage ... <(cat user-data) <(cat meta-data) | 14:14 |
vans163 | Odd_Bloke: let me try that thats a good idea | 14:33 |
smoser | vans163, you could just use cloud-localds too | 18:57 |
smoser | which cleans up stuff, and provides the meta-data if you dont need it. | 18:57 |
vans163 | smoser: that is useful, so I can just pip the (cat user-data) into cloud-localds? http://ubuntu-smoser.blogspot.ca/2013/02/using-ubuntu-cloud-images-without-cloud.html this tutorial does not show how to account for the user-data supplied by user which can be a bash script | 19:04 |
smoser | oh. i dont know if it supports user-data from - or not | 19:08 |
smoser | let me see | 19:08 |
smoser | seems like it does | 19:08 |
vans163 | smoser: where are you looking if you dont mind me asking, googling does not seem to reveal any documentation | 19:09 |
smoser | $ printf '#!/bin/sh\necho hi mom\n' | cloud-localds -v my.img - | 19:09 |
smoser | wrote my.img with filesystem=iso9660 and diskformat=raw | 19:09 |
smoser | vans163, i looked at source code :) and source code I wrote even ;) | 19:10 |
smoser | http://bazaar.launchpad.net/~cloud-utils-dev/cloud-utils/trunk/view/head:/bin/cloud-localds | 19:10 |
smoser | http://bazaar.launchpad.net/~cloud-utils-dev/cloud-utils/trunk/view/head:/bin/cloud-localds#L206 | 19:10 |
smoser | but as Odd_Bloke suggested above, bash with <() basically makes a temp file and then cleans it up i think. | 19:11 |
vans163 | smoser: ty is that () really critical? so in my case it would look like <("#cloud-config\npassword: ...") ? does () not mean execute whats inside? | 19:12 |
smoser | vans163, see 'Process Substitution' in 'man bash' | 19:15 |
smoser | $ bash -c 'for i in "$@"; do echo -n $i:; cat "$i"; done' -- <(echo first) <(echo another) | 19:16 |
smoser | /dev/fd/63:first | 19:17 |
smoser | /dev/fd/62:another | 19:17 |
smoser | in your case, if you just need the one thing, then its sufficient to do like i did above with printf, or you could do a "here document" | 19:18 |
smoser | $ cloud-localds -v my.img - <<END> #!/bin/sh | 19:18 |
smoser | > hi mom | 19:18 |
smoser | > END | 19:18 |
smoser | note, the '> ' are the prefix the shell added to m ulti line input. | 19:19 |
smoser | sell, shoot. but the '#!/bin/sh' was on a new line too' p | 19:19 |
smoser | better: http://paste.ubuntu.com/23476971/ | 19:19 |
vans163 | smoser: ah ty for that explain, i think if it works that way, geniso should do the trick, I do not see the benefit of cloud-localds for simple usecase like mine | 19:27 |
powersj | smoser: why is there both a "set hostname (cc_set_hostname)" and an "update hostname (cc_update_hostname)" modules? They both use the same keys, so does that mean they both always get run when set? | 22:04 |
smoser | powersj, remind me again if i dont answer. | 22:10 |
smoser | i have to go now htough | 22:10 |
powersj | smoser: will do thx | 22:11 |
Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!