{"action":"created","issue":{"url":"https://api.github.com/repos/NodeOS/NodeOS/issues/273","repository_url":"https://api.github.com/repos/NodeOS/NodeOS","labels_url":"https://api.github.com/repos/NodeOS/NodeOS/issues/273/labels{/name}","comments_url":"https://api.github.com/repos/NodeOS/NodeOS/issues/273/comments","events_url":"https://api.github.com/repos/NodeOS/NodeOS/issues/273/events","html_url":"https://github.com/NodeOS/NodeOS/issues/273","id":164624545,"number":273,"title":"Building Toasters","user":{"login":"sbuller","id":8889,"avatar_url":"https://avatars.githubusercontent.com/u/8889?v=3","gravatar_id":"","url":"https://api.github.com/users/sbuller","html_url":"https://github.com/sbuller","followers_url":"https://api.github.com/users/sbuller/followers","following_url":"https://api.github.com/users/sbuller/following{/other_user}","gists_url":"https://api.github.com/users/sbuller/gists{/gist_id}","starred_url":"https://api.github.com/users/sbuller/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sbuller/subscriptions","organizations_url":"https://api.github.com/users/sbuller/orgs","repos_url":"https://api.github.com/users/sbuller/repos","events_url":"https://api.github.com/users/sbuller/events{/privacy}","received_events_url":"https://api.github.com/users/sbuller/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/NodeOS/NodeOS/labels/enhancement","name":"enhancement","color":"84b6eb"},{"url":"https://api.github.com/repos/NodeOS/NodeOS/labels/level:%20hard","name":"level: hard","color":"f9d0c4"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":10,"created_at":"2016-07-08T22:00:29Z","updated_at":"2016-08-08T16:11:07Z","closed_at":null,"body":"As a potential user, I'm finding the focus of the documentation and tooling a bit different than what I'd hope for. I think my aims are still in line with the direction of the project though.\r\n\r\nMy hope is to have a tool—let's call it `toast` for arguments sake—that builds a bootable disk image when run in a node repository (i.e. a directory containing a package.json file). I don't particularly care if it's built from source—in fact, I'd probably rather that `toast` would download a pre-built image. The downloaded image should be combined with the contents of the repository such that the resultant image can be booted by qemu, and the js file pointed to by \"main\" in the package.json file should then be started automatically.\r\n\r\nI specifically do not care about users, or any other direct form of interaction or administration. My goal in terms of administration is that when I want to change things, I modify the source code in my package, re-run `toast` generating a new image, and upload it—entirely replacing the old image. In view of this, I would recommend a read-only filesystem.\r\n\r\nBeyond this, some facility or API for mounting additional disks would be nice, but if that proves insurmountable then I would rather store my state elsewhere on the network rather than store my state alongside my application. Perhaps arguments passed on the command line to `toast` could be stored in the image as well, and be referenced by the running script, allowing an application to be more easily instanced.\r\n\r\n## Example\r\n\r\n### main.js\r\n```javascript\r\nvar http = require('http');\r\n\r\nvar server = http.createServer(function (request, response) {\r\n  response.writeHead(200, {\"Content-Type\": \"text/plain\"});\r\n  response.end(\"Hello World\\n\");\r\n});\r\n\r\nserver.listen(process.argv[2]);\r\n```\r\n\r\n### package.json\r\n```json\r\n{\r\n  \"main\": \"index.js\"\r\n}\r\n```\r\n\r\n### Command Line\r\n```\r\n$ toast -o hello.img --ip=192.168.0.10/24 --args=\"80\"\r\n$ qemu -net ... hello.img\r\n```\r\n\r\n... I hope I'm not talking like a crazy person here."},"comment":{"url":"https://api.github.com/repos/NodeOS/NodeOS/issues/comments/238286861","html_url":"https://github.com/NodeOS/NodeOS/issues/273#issuecomment-238286861","issue_url":"https://api.github.com/repos/NodeOS/NodeOS/issues/273","id":238286861,"user":{"login":"sbuller","id":8889,"avatar_url":"https://avatars.githubusercontent.com/u/8889?v=3","gravatar_id":"","url":"https://api.github.com/users/sbuller","html_url":"https://github.com/sbuller","followers_url":"https://api.github.com/users/sbuller/followers","following_url":"https://api.github.com/users/sbuller/following{/other_user}","gists_url":"https://api.github.com/users/sbuller/gists{/gist_id}","starred_url":"https://api.github.com/users/sbuller/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sbuller/subscriptions","organizations_url":"https://api.github.com/users/sbuller/orgs","repos_url":"https://api.github.com/users/sbuller/repos","events_url":"https://api.github.com/users/sbuller/events{/privacy}","received_events_url":"https://api.github.com/users/sbuller/received_events","type":"User","site_admin":false},"created_at":"2016-08-08T16:11:06Z","updated_at":"2016-08-08T16:11:06Z","body":"I've gotten a bit sidetracked. I put together [nos-init](https://github.com/sbuller/nos-init/) to generate initramfs files in the manner I envision. I've played a bunch with syslinux and other bootloaders, as well as related filesystems. I can't say that it's truly worthwhile, but I had been focused on generating a bootable disk image without depending on tools external to NodeJS/NPM. I settled on syslinux with fat16 is the most realistic option. It took me a while to come to the realization that there was no practical way to produce the output entirely with streams. I've got a bunch of spaghetti code at this point that puts together a lot of this but it's super hairy, and it's still missing some important parts. The stupid thing is that it's probably just a couple lines of bash script using mkisofs. I'd just rather make program that could run everywhere. That's one of the main things I like about NodeJS.\r\n\r\nAnyhow, it's still pinging around my brain at the moment, but hasn't seen any work for a week or two."}}
{"actor":{"display_login":"sbuller"}}