-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't execute files from ext4-formatted SDcard #3423
Comments
Clarification: the chroot itself does not live on an SD card. It's just a normal chroot, but has access to the card. |
Found a partial solution in a similar issue: #1613 Executing Note, the other approach in the linked issue does not work for me. Explicitly using sh is no different from just startcli in my case. |
And, I just found out, the |
afaik this is a ChromeOS safety feature (it's full of annoying safety features), but i dont know where to turn it off... |
You may have to prefix your commands with ' Hope this helps, |
That will help only with manually running shell scripts, not with actual executables on the device, or with actual scripting. My suggestion is to just mount the fs a second time on a different mount point in the chroot, this way you can change (some, these noexec/dev/suid are included, more low level fs flags will just match the existing mount) of the mount flags for that mount point. (And i think ChromeOS should just not twiddle with a new mount like this, but I didnt do a long-term test so i cant test 100% sure yet.) |
urjaman's suggestion works! One can do the following in /etc/rc.local (inside the crouton chroot): mount --bind /media/removable/SD\ card /srv/mymnt After that the executables in /srv/mymnt are actually executable without an "sh" or anything. To complete this solution just put /srv/mymnt in PATH in your .profile. |
urjaman did not suggest remounting the same mount, but mount it again on a different mount point. First, mounting it twice will likely just fail with "block device busy" but I'll try. Second, I already tried remounting. It works for a while, but goes back after a few hours. It's not as useful for long-running builds, which keep getting interrupted. And the sh trick doesn't work, because as urjaman said this is a large Makefile that executes other scripts. Changing them all isn't feasible. |
But yeah, if somebody knows how to disable stuck safety features, that'd be awesome. |
You need to run both steps (Edit: inside the chroot):
The first step mounts the device again at I have tried this and it works! |
That's interesting, changing the exec on a bind mount doesnt propagate to the previous one? I didnt know that, if that works it seems actually cleaner than what I did, but I'll explain anyways. I actually ended up once testing just by remounting the same device again (just mount ./dev/mmcblk1... /another/place) and that worked for the chroot, but the Files app got confused about the SD card (it disappeared? I've forgotten exactly what it did.) Now that I ended up actually needing the sdcard as exec space, I made a different hack:
This is pretty crude, but yeah made a new device node for mmcblk1 (yeah i have no partition tables on it) and used that to mount it in an another place... this way "mount" lists it as "/dev/sdcard" being mounted somewhere random, instead of /dev/mmcblk1 twice (which is what i think confused Files), and I havent had a problem with this so far. |
Just because someone asked for where the noexecery occurs, i found it i think: Always. No knobs. [REDACTED]. I suppose if you rebuild cros-disks without those lines and make the rootfs RW and replace it... and then repeat it for every update (thats why I havent done anything that would need rootfs changes, because that would need me making a re-change-the-rootfs script or something.) |
Please describe your issue:
Executable files don't work when they are on an ext4-formatted SD card. They work fine when I copy the executables off the SD-card into root filesystem.
If known, describe the steps to reproduce the issue:
I have an SD card plugged in and mounted:
It is usable from inside my chroot:
I wanted to do some lightweight development using my Chromebook, but was running out of space. SD card was supposed to be the solution. But ran into this issue:
So the file executes when in the root filesystem, but not on the card. I can see the execute bit is properly set. Given the error
su
error message prefix, I feel like this has something to do with the crouton chroot, but not sure what.If this is the intended default behavior, let me know what I can do to override it.
The text was updated successfully, but these errors were encountered: