{"action":"opened","number":898,"pull_request":{"url":"https://api.github.com/repos/u-root/u-root/pulls/898","id":209256636,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA5MjU2NjM2","html_url":"https://github.com/u-root/u-root/pull/898","diff_url":"https://github.com/u-root/u-root/pull/898.diff","patch_url":"https://github.com/u-root/u-root/pull/898.patch","issue_url":"https://api.github.com/repos/u-root/u-root/issues/898","number":898,"state":"open","locked":false,"title":"pex: portable executables","user":{"login":"rminnich","id":74928,"node_id":"MDQ6VXNlcjc0OTI4","avatar_url":"https://avatars0.githubusercontent.com/u/74928?v=4","gravatar_id":"","url":"https://api.github.com/users/rminnich","html_url":"https://github.com/rminnich","followers_url":"https://api.github.com/users/rminnich/followers","following_url":"https://api.github.com/users/rminnich/following{/other_user}","gists_url":"https://api.github.com/users/rminnich/gists{/gist_id}","starred_url":"https://api.github.com/users/rminnich/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rminnich/subscriptions","organizations_url":"https://api.github.com/users/rminnich/orgs","repos_url":"https://api.github.com/users/rminnich/repos","events_url":"https://api.github.com/users/rminnich/events{/privacy}","received_events_url":"https://api.github.com/users/rminnich/received_events","type":"User","site_admin":false},"body":"A portable executable is a squashfs containing a set of files,\n.so's, and anything else you want to bring along. It is inspired\nby tinycore packages and appimage. While appimages and\ntinycore packages are a bit involved to build, pex makes\nit easy.\n\nWhy we're doing this: we've had a lot of trouble bringing along binaries due to\nshared library issues. For example, if we build the cgpt tool from chromeos\nstatic, on debian, it core dumps. GNU and glibc are no longer friendly to\nstatic linking.\n\npex is a program that builds portable executables that look like\ntinycore tczs.\n\nFor example, we might want some random programs such as\n/usr/bin/minicom and a few files such as /etc/minicom.d.\nWe can say this:\n\npex /usr/bin/minicom /etc/minicom.d\n\nThe command, its .so dependencies, and /etc/minicom.d\nwill be packaged into a squashfs that can be (we hope)\ninstall via the tcz command.\n\nYou can test this easily:\npex -t /bin/bash\n\nwill build the squashfs, mount it, and drop you into bash:\nrminnich@uroot:~/go/src/github.com/u-root/u-root/xcmds/pex$ sudo ./pex -t /bin/bash\nshell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory\nbash-4.4# ls\njob-working-directory: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory\n'#main.go#'   pex   pex.go   shit\nbash-4.4# exit\nexit\n2018/08/17 13:45:00 Done, your pex is in /tmp/pex.tcz\n\nor you can even add a program for fun:\npex -t /bin/bash /bin/cat /etc/hosts\n sudo ./pex -t /bin/bash /bin/cat /etc/hosts\nshell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory\nbash-4.4# cat /etc/hosts\njob-working-directory: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory\n127.0.0.1\tlocalhost\n127.0.1.1\turoot\n\n::1     localhost ip6-localhost ip6-loopback\nff02::1 ip6-allnodes\nff02::2 ip6-allrouters\n192.81.129.194\t linode\nbash-4.4# exit\nexit\n2018/08/17 13:45:47 Done, your pex is in /tmp/pex.tcz\n\nOne remaining question is how to run a pex. I'm thinking\nof pexe, which would take a pex and a command in it and just\nrun it; for we could just have a -c to pex, meaning, use the\nfile but don't build it, since pex can already run these files.\n\nI took the opportunity to clean up the mount and loop packages.\nIt seemed a good time to create a Mounter interface.\nShould Mounter distinguish Free and Unmount? Seems a bit of\noverkill.\n\nComments welcome.\n\nSigned-off-by: Ronald G. Minnich <rminnich@gmail.com>","created_at":"2018-08-17T21:00:55Z","updated_at":"2018-08-17T21:00:55Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/u-root/u-root/pulls/898/commits","review_comments_url":"https://api.github.com/repos/u-root/u-root/pulls/898/comments","review_comment_url":"https://api.github.com/repos/u-root/u-root/pulls/comments{/number}","comments_url":"https://api.github.com/repos/u-root/u-root/issues/898/comments","statuses_url":"https://api.github.com/repos/u-root/u-root/statuses/b28d90eeaf8c7661cee77532aea66c15a34ed4ed","head":{"label":"rminnich:PortableArchive","ref":"PortableArchive","sha":"b28d90eeaf8c7661cee77532aea66c15a34ed4ed","user":{"login":"rminnich","id":74928,"node_id":"MDQ6VXNlcjc0OTI4","avatar_url":"https://avatars0.githubusercontent.com/u/74928?v=4","gravatar_id":"","url":"https://api.github.com/users/rminnich","html_url":"https://github.com/rminnich","followers_url":"https://api.github.com/users/rminnich/followers","following_url":"https://api.github.com/users/rminnich/following{/other_user}","gists_url":"https://api.github.com/users/rminnich/gists{/gist_id}","starred_url":"https://api.github.com/users/rminnich/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rminnich/subscriptions","organizations_url":"https://api.github.com/users/rminnich/orgs","repos_url":"https://api.github.com/users/rminnich/repos","events_url":"https://api.github.com/users/rminnich/events{/privacy}","received_events_url":"https://api.github.com/users/rminnich/received_events","type":"User","site_admin":false},"repo":{"id":53349408,"node_id":"MDEwOlJlcG9zaXRvcnk1MzM0OTQwOA==","name":"u-root","full_name":"rminnich/u-root","owner":{"login":"rminnich","id":74928,"node_id":"MDQ6VXNlcjc0OTI4","avatar_url":"https://avatars0.githubusercontent.com/u/74928?v=4","gravatar_id":"","url":"https://api.github.com/users/rminnich","html_url":"https://github.com/rminnich","followers_url":"https://api.github.com/users/rminnich/followers","following_url":"https://api.github.com/users/rminnich/following{/other_user}","gists_url":"https://api.github.com/users/rminnich/gists{/gist_id}","starred_url":"https://api.github.com/users/rminnich/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rminnich/subscriptions","organizations_url":"https://api.github.com/users/rminnich/orgs","repos_url":"https://api.github.com/users/rminnich/repos","events_url":"https://api.github.com/users/rminnich/events{/privacy}","received_events_url":"https://api.github.com/users/rminnich/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/rminnich/u-root","description":"A universal root. You mount it, and it's mostly Go source with the exception of 5 binaries. ","fork":true,"url":"https://api.github.com/repos/rminnich/u-root","forks_url":"https://api.github.com/repos/rminnich/u-root/forks","keys_url":"https://api.github.com/repos/rminnich/u-root/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rminnich/u-root/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rminnich/u-root/teams","hooks_url":"https://api.github.com/repos/rminnich/u-root/hooks","issue_events_url":"https://api.github.com/repos/rminnich/u-root/issues/events{/number}","events_url":"https://api.github.com/repos/rminnich/u-root/events","assignees_url":"https://api.github.com/repos/rminnich/u-root/assignees{/user}","branches_url":"https://api.github.com/repos/rminnich/u-root/branches{/branch}","tags_url":"https://api.github.com/repos/rminnich/u-root/tags","blobs_url":"https://api.github.com/repos/rminnich/u-root/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rminnich/u-root/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rminnich/u-root/git/refs{/sha}","trees_url":"https://api.github.com/repos/rminnich/u-root/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rminnich/u-root/statuses/{sha}","languages_url":"https://api.github.com/repos/rminnich/u-root/languages","stargazers_url":"https://api.github.com/repos/rminnich/u-root/stargazers","contributors_url":"https://api.github.com/repos/rminnich/u-root/contributors","subscribers_url":"https://api.github.com/repos/rminnich/u-root/subscribers","subscription_url":"https://api.github.com/repos/rminnich/u-root/subscription","commits_url":"https://api.github.com/repos/rminnich/u-root/commits{/sha}","git_commits_url":"https://api.github.com/repos/rminnich/u-root/git/commits{/sha}","comments_url":"https://api.github.com/repos/rminnich/u-root/comments{/number}","issue_comment_url":"https://api.github.com/repos/rminnich/u-root/issues/comments{/number}","contents_url":"https://api.github.com/repos/rminnich/u-root/contents/{+path}","compare_url":"https://api.github.com/repos/rminnich/u-root/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rminnich/u-root/merges","archive_url":"https://api.github.com/repos/rminnich/u-root/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rminnich/u-root/downloads","issues_url":"https://api.github.com/repos/rminnich/u-root/issues{/number}","pulls_url":"https://api.github.com/repos/rminnich/u-root/pulls{/number}","milestones_url":"https://api.github.com/repos/rminnich/u-root/milestones{/number}","notifications_url":"https://api.github.com/repos/rminnich/u-root/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rminnich/u-root/labels{/name}","releases_url":"https://api.github.com/repos/rminnich/u-root/releases{/id}","deployments_url":"https://api.github.com/repos/rminnich/u-root/deployments","created_at":"2016-03-07T18:40:47Z","updated_at":"2018-07-09T21:46:42Z","pushed_at":"2018-08-17T20:56:09Z","git_url":"git://github.com/rminnich/u-root.git","ssh_url":"git@github.com:rminnich/u-root.git","clone_url":"https://github.com/rminnich/u-root.git","svn_url":"https://github.com/rminnich/u-root","homepage":null,"size":37135,"stargazers_count":8,"watchers_count":8,"language":"Go","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":1,"open_issues":0,"watchers":8,"default_branch":"master"}},"base":{"label":"u-root:master","ref":"master","sha":"500c5fb9b497910a21b5b4905f5b604b15f24ea9","user":{"login":"u-root","id":13317538,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEzMzE3NTM4","avatar_url":"https://avatars3.githubusercontent.com/u/13317538?v=4","gravatar_id":"","url":"https://api.github.com/users/u-root","html_url":"https://github.com/u-root","followers_url":"https://api.github.com/users/u-root/followers","following_url":"https://api.github.com/users/u-root/following{/other_user}","gists_url":"https://api.github.com/users/u-root/gists{/gist_id}","starred_url":"https://api.github.com/users/u-root/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/u-root/subscriptions","organizations_url":"https://api.github.com/users/u-root/orgs","repos_url":"https://api.github.com/users/u-root/repos","events_url":"https://api.github.com/users/u-root/events{/privacy}","received_events_url":"https://api.github.com/users/u-root/received_events","type":"Organization","site_admin":false},"repo":{"id":46462030,"node_id":"MDEwOlJlcG9zaXRvcnk0NjQ2MjAzMA==","name":"u-root","full_name":"u-root/u-root","owner":{"login":"u-root","id":13317538,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEzMzE3NTM4","avatar_url":"https://avatars3.githubusercontent.com/u/13317538?v=4","gravatar_id":"","url":"https://api.github.com/users/u-root","html_url":"https://github.com/u-root","followers_url":"https://api.github.com/users/u-root/followers","following_url":"https://api.github.com/users/u-root/following{/other_user}","gists_url":"https://api.github.com/users/u-root/gists{/gist_id}","starred_url":"https://api.github.com/users/u-root/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/u-root/subscriptions","organizations_url":"https://api.github.com/users/u-root/orgs","repos_url":"https://api.github.com/users/u-root/repos","events_url":"https://api.github.com/users/u-root/events{/privacy}","received_events_url":"https://api.github.com/users/u-root/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/u-root/u-root","description":"A fully Go userland! u-root can create a root file system (initramfs) containing a busybox-like set of tools written in Go.","fork":false,"url":"https://api.github.com/repos/u-root/u-root","forks_url":"https://api.github.com/repos/u-root/u-root/forks","keys_url":"https://api.github.com/repos/u-root/u-root/keys{/key_id}","collaborators_url":"https://api.github.com/repos/u-root/u-root/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/u-root/u-root/teams","hooks_url":"https://api.github.com/repos/u-root/u-root/hooks","issue_events_url":"https://api.github.com/repos/u-root/u-root/issues/events{/number}","events_url":"https://api.github.com/repos/u-root/u-root/events","assignees_url":"https://api.github.com/repos/u-root/u-root/assignees{/user}","branches_url":"https://api.github.com/repos/u-root/u-root/branches{/branch}","tags_url":"https://api.github.com/repos/u-root/u-root/tags","blobs_url":"https://api.github.com/repos/u-root/u-root/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/u-root/u-root/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/u-root/u-root/git/refs{/sha}","trees_url":"https://api.github.com/repos/u-root/u-root/git/trees{/sha}","statuses_url":"https://api.github.com/repos/u-root/u-root/statuses/{sha}","languages_url":"https://api.github.com/repos/u-root/u-root/languages","stargazers_url":"https://api.github.com/repos/u-root/u-root/stargazers","contributors_url":"https://api.github.com/repos/u-root/u-root/contributors","subscribers_url":"https://api.github.com/repos/u-root/u-root/subscribers","subscription_url":"https://api.github.com/repos/u-root/u-root/subscription","commits_url":"https://api.github.com/repos/u-root/u-root/commits{/sha}","git_commits_url":"https://api.github.com/repos/u-root/u-root/git/commits{/sha}","comments_url":"https://api.github.com/repos/u-root/u-root/comments{/number}","issue_comment_url":"https://api.github.com/repos/u-root/u-root/issues/comments{/number}","contents_url":"https://api.github.com/repos/u-root/u-root/contents/{+path}","compare_url":"https://api.github.com/repos/u-root/u-root/compare/{base}...{head}","merges_url":"https://api.github.com/repos/u-root/u-root/merges","archive_url":"https://api.github.com/repos/u-root/u-root/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/u-root/u-root/downloads","issues_url":"https://api.github.com/repos/u-root/u-root/issues{/number}","pulls_url":"https://api.github.com/repos/u-root/u-root/pulls{/number}","milestones_url":"https://api.github.com/repos/u-root/u-root/milestones{/number}","notifications_url":"https://api.github.com/repos/u-root/u-root/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/u-root/u-root/labels{/name}","releases_url":"https://api.github.com/repos/u-root/u-root/releases{/id}","deployments_url":"https://api.github.com/repos/u-root/u-root/deployments","created_at":"2015-11-19T02:28:59Z","updated_at":"2018-08-17T12:01:16Z","pushed_at":"2018-08-17T00:09:14Z","git_url":"git://github.com/u-root/u-root.git","ssh_url":"git@github.com:u-root/u-root.git","clone_url":"https://github.com/u-root/u-root.git","svn_url":"https://github.com/u-root/u-root","homepage":"http://u-root.tk","size":36577,"stargazers_count":744,"watchers_count":744,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":100,"mirror_url":null,"archived":false,"open_issues_count":98,"license":{"key":"bsd-3-clause","name":"BSD 3-Clause \"New\" or \"Revised\" License","spdx_id":"BSD-3-Clause","url":"https://api.github.com/licenses/bsd-3-clause","node_id":"MDc6TGljZW5zZTU="},"forks":100,"open_issues":98,"watchers":744,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/u-root/u-root/pulls/898"},"html":{"href":"https://github.com/u-root/u-root/pull/898"},"issue":{"href":"https://api.github.com/repos/u-root/u-root/issues/898"},"comments":{"href":"https://api.github.com/repos/u-root/u-root/issues/898/comments"},"review_comments":{"href":"https://api.github.com/repos/u-root/u-root/pulls/898/comments"},"review_comment":{"href":"https://api.github.com/repos/u-root/u-root/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/u-root/u-root/pulls/898/commits"},"statuses":{"href":"https://api.github.com/repos/u-root/u-root/statuses/b28d90eeaf8c7661cee77532aea66c15a34ed4ed"}},"author_association":"MEMBER","merged":false,"mergeable":null,"rebaseable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"maintainer_can_modify":true,"commits":1,"additions":27389,"deletions":8885,"changed_files":227}}
{"actor":{"display_login":"rminnich"}}