Bash scripts
Kevin Gordon
kgordon420 at gmail.com
Sun Apr 17 11:19:36 EDT 2011
Martin and the Gang:
Since last we spoke, I've been working on this new issue I'd mentioned,
where when I try to run a bash shell script resident on a USB drive inserted
into an OS16 OLPC, I always get "Permission Denied". But now, I'm not sure
it's a "bug"; and if so, I'm now pretty sure it isn't an OLPC bug.
Here are the details to reproduce. Go to terminal on a 10.1.3 Build 860, or
any build before. Log in as root (su -) Write a little script - it can be
a one liner, "echo Hello World" is good enough. Save it as test.sh to a
USB stick which has been formatted FAT32 and has a volume name FEDORA. Do a
"Chmod +x /media/FEDORA/test.sh". One can then take that USB stick to any
previous-to-Fedora 14 OLPC, and execute the script by simply installing the
drive, logging into root (su -), going to the terminal prompt, and entering
"/media/FEDORA/test.sh", and see the old 'Hello World' come up - not
"Permission Denied". One can also tab complete through that command, and it
sees and auto-completes the test.sh portion too,
So, I tried on a vanilla little lenovo with a fresh unaltered installation
of the Fedora14 Live-Desktop. The script runs fine from the USB drive.
Then after accepting and installing the 422 recommened Software Updates on
the box, this box too now gives "Permission Denied". I repeated this same
procedure twice more with fresh installs, then updates. Very consistent,,
works before updates, does not work after.
On the OLPC side, I did a more binary search, and the script continues to
work right up to and including os5 from the 11.2 builds. At os6, and after,
is where the Permission Denied starts to occur when attempting to execute.
Not surprisingly, and concurrently, the tab complete capability on the
"test.sh" portion ceases to function at this point as well.
Alas, someone upstream might now consider this a feature, not a bug. Also,
someone upstream might be able to figure out which of those 422 packages is
responsible, if they should care to.
Now the good news: two workarounds:
1) copy the script down to the home directory from the USB, and then execute
using "./test.sh" - works fine.
2) or, precede your attempt to run directly from the USB with the command
"bash". That is, enter "bash /media/FEDORA/test.sh" and it works fine too.
In both above cases the tab-complete also works again too.
Perhaps one could conjecture that this is some added security, or new
property for execution of scripts resident on portable drives that has been
implemented. However, as for 'filing a bug report', it looks like it's
something way upstream from my pay-class, since it isn't limited to OLPC,
but occurs across Fedora 14 updated machines too.
Some other, perhaps unrelated, notes:
When I do an 'ls' on the USB drive in Pre-os5, all the file names display in
green. When I do an ls on the USB drive in Post-os5, they show in black.
The same symptoms, listed above for the USB drive, occur on the SD card as
happen on the USB drive, whether formatted FAT32 or ext2, and even with
permission in ext2 checked to allow execution of files, and access rights to
all users full access. Permission denied, without preceding it with the bash
command.
Last, and devinitely unrelate, even back as far as os1 on 11.2, when one
logs into terminal as root, instead of the more familiar [root at x0-xx-xx-xx]#
prompt which we saw in 10.1.3, one instead now gets a -bash-4.1# prompt on
the OLPC. My lenovo vanilla Fedora 14 still displays the [root at machinename]#
prompt upon su - in terminal, both re and post updates. Again, not sure
whether this is a bug or a feature, and which one is 'right'.
Cheers,
KG
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.laptop.org/pipermail/devel/attachments/20110417/c620da35/attachment.html>
More information about the Devel
mailing list