{"action":"created","issue":{"url":"https://api.github.com/repos/dnschneid/crouton/issues/2646","repository_url":"https://api.github.com/repos/dnschneid/crouton","labels_url":"https://api.github.com/repos/dnschneid/crouton/issues/2646/labels{/name}","comments_url":"https://api.github.com/repos/dnschneid/crouton/issues/2646/comments","events_url":"https://api.github.com/repos/dnschneid/crouton/issues/2646/events","html_url":"https://github.com/dnschneid/crouton/pull/2646","id":162257253,"number":2646,"title":"`sudo sh enter-chroot` doesn't mount Downloads","user":{"login":"mjwhitta","id":1239825,"avatar_url":"https://avatars.githubusercontent.com/u/1239825?v=3","gravatar_id":"","url":"https://api.github.com/users/mjwhitta","html_url":"https://github.com/mjwhitta","followers_url":"https://api.github.com/users/mjwhitta/followers","following_url":"https://api.github.com/users/mjwhitta/following{/other_user}","gists_url":"https://api.github.com/users/mjwhitta/gists{/gist_id}","starred_url":"https://api.github.com/users/mjwhitta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mjwhitta/subscriptions","organizations_url":"https://api.github.com/users/mjwhitta/orgs","repos_url":"https://api.github.com/users/mjwhitta/repos","events_url":"https://api.github.com/users/mjwhitta/events{/privacy}","received_events_url":"https://api.github.com/users/mjwhitta/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-06-25T01:49:24Z","updated_at":"2016-06-25T17:09:27Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/dnschneid/crouton/pulls/2646","html_url":"https://github.com/dnschneid/crouton/pull/2646","diff_url":"https://github.com/dnschneid/crouton/pull/2646.diff","patch_url":"https://github.com/dnschneid/crouton/pull/2646.patch"},"body":"For some reason, `startlxde` (and I assume others) properly substitute\r\n`~` before mounting Downloads, however just calling `enter-chroot`\r\ndoes not. After escaping the `~`, both `startlxde` and `enter-chroot`\r\nwork as expected."},"comment":{"url":"https://api.github.com/repos/dnschneid/crouton/issues/comments/228558790","html_url":"https://github.com/dnschneid/crouton/pull/2646#issuecomment-228558790","issue_url":"https://api.github.com/repos/dnschneid/crouton/issues/2646","id":228558790,"user":{"login":"DennisLfromGA","id":3418772,"avatar_url":"https://avatars.githubusercontent.com/u/3418772?v=3","gravatar_id":"","url":"https://api.github.com/users/DennisLfromGA","html_url":"https://github.com/DennisLfromGA","followers_url":"https://api.github.com/users/DennisLfromGA/followers","following_url":"https://api.github.com/users/DennisLfromGA/following{/other_user}","gists_url":"https://api.github.com/users/DennisLfromGA/gists{/gist_id}","starred_url":"https://api.github.com/users/DennisLfromGA/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DennisLfromGA/subscriptions","organizations_url":"https://api.github.com/users/DennisLfromGA/orgs","repos_url":"https://api.github.com/users/DennisLfromGA/repos","events_url":"https://api.github.com/users/DennisLfromGA/events{/privacy}","received_events_url":"https://api.github.com/users/DennisLfromGA/received_events","type":"User","site_admin":false},"created_at":"2016-06-25T17:09:27Z","updated_at":"2016-06-25T17:09:27Z","body":"@mjwhitta,\r\n\r\n*[ I am by no means qualified to answer this but I thought I'd take a stab at it. ]*\r\n\r\nI'm not saying your PR is not warranted but, since you're having problems with normal execution, maybe that's why this 'fix' is needed for you, I don't think others have run into this problem.\r\n\r\nThe tilde (~) character is used/expanded in the bash shell but not the normal posix shell so that may be part of the problem. In your crosh shell session, you're using 'bash' so the tilde is expanded.\r\n`enter-chroot` invokes the posix shell on line 1: `#!/bin/sh -e` so the tilde has to be handled differently. \r\n\r\n----\r\nHaving to use 'sh' in every case does indeed sound strange, it sounds like `/usr/local/bin` is not 'executable'. Are you using the internal SSD and have your chroot(s) installed in the default location?\r\n\r\nHere's what mine looks like -\r\n```\r\nchronos@localhost ~ $ mount|grep local\r\n/dev/sda1 on /usr/local type ext4 (rw,nodev,relatime,commit=600,data=ordered)\r\nchronos@localhost ~ $ ls -ld /usr/local/bin\r\ndrwxr-xr-x 2 root root 4.0K Jun 21 17:10 /usr/local/bin\r\n```\r\n\r\nMaybe some of the gurus lurking about can jump in and explain what might be going on with your system and why... \r\n\r\n-----\r\n**Additional info.** *( please disregard if you like )* -\r\nWhen I first got my Cr-48, I used to build my own Chrome OS images and also used some from *real* developers. One of them (tvierling) gave me a routine that I've used in my `.bashrc` script on every Chromebook I've had since. It creates a special 'dev_image' and uses it for `/usr/local`.\r\nI've included it below for your perusal and to maybe gain some perspective about what's going on in Chrme OS.\r\nHere's a link where he explains what's going on, \r\nscroll down to ['[Cr-48]-CHROME-OS Experimental ADD-ON PKGS'](https://www.diigo.com/list/kim122079/chrome_os)\r\n```\r\n##\r\n## Open a shell and run:\r\n#   sudo mkdir /mnt/stateful_partition/dev_image\r\n##\r\n## This will create a new directory in the stateful partition that represents the (modifiable!) /usr/local area.\r\n## The name \"dev_image\" is semi-magic -- this is the same name that non-official (developer) builds use to represent /usr/local.\r\n## You can actually pick any name, even \"local\", but the instructions here assume \"dev_image\".\r\n##\r\n## Mount /usr/local by hand with the following commands:\r\n#   sudo mount -n --bind /mnt/stateful_partition/dev_image /usr/local\r\n#   sudo mount -n -o remount,exec,suid /usr/local\r\n##\r\n## At this point, you should be able to verify that /usr/local is mounted by:\r\n#   mount|grep local\r\n## which should show:\r\n##  /dev/sda1 on /usr/local type ext3 (rw,nodev,relatime,errors=continue,commit=600,data=ordered)\r\n## In particular, the mount should not show the flags noexec or nosuid.\r\n##\r\n## If you're using any package that has a \"requires: ...\" note below, you need one more command to\r\n## ensure the extra libraries are picked up at runtime.\r\n## To do this, also run:\r\n##  export LD_LIBRARY_PATH=/usr/local/lib\r\nexport LD_LIBRARY_PATH=/usr/lib:/usr/local/lib:/usr/local/lib64\r\n##\r\n## The steps above have to be performed on every boot, but to save hassle,\r\n## edit ~/.bashrc and add the following lines to the bottom to mount it as soon as any shell is invoked\r\n## (vt2 or via Ctrl-Alt-T plus \"shell\" command):\r\n##\r\n   if ! grep -q /usr/local /etc/mtab; then\r\n      [ ! -d /mnt/stateful_partition/dev_image/ ] && sudo mkdir /mnt/stateful_partition/dev_image 2>/dev/null\r\n      sudo mount -n --bind /mnt/stateful_partition/dev_image /usr/local\r\n      sudo mount -n -o remount,exec,suid /usr/local\r\n      echo \"...local mounted r-w-x...\"\r\n   fi\r\n\r\n##\r\n```\r\n\r\n*Hope at least some of this helps,*\r\n-**DennisL**"}}
{"actor":{"display_login":"DennisLfromGA"}}