Any bash users here?
Chris Mahoney (1684) 2100 posts |
Hi everyone, Unfortunately since “bash” is a generic word it’s really hard to search for! :) I’ve been looking at a few open-source apps that I’d like to see on RISC OS, but the vast majority of them expect a working bash environment so that you can run “configure” etc. While it’s possible to manually mess around with Makefiles, I noticed a port of bash in PackMan and decided to give it a go (I also installed Coreutils and Fileutils). Unfortunately I’m not having much luck with it and I don’t know whether it’s a problem with my system (Pi 1) or with bash/UnixLib. The first thing I’ve noticed is that running the same command twice in a row results in a crash: *bash bash-4.2$ uname RISC OS bash-4.2$ uname UnixLib process structure is corrupt. Exiting. Internal error: abort on data transfer at &202CBA8C The other thing is that it doesn’t actually want to run bash scripts: bash-4.2$ ./configure An application that loads a file of this type has not been found by the Filer. Open a directory display containing the required application and try again. It seems that I need to somehow tell bash to execute the file itself instead of pass it back to the OS, but I haven’t been able to find any documentation on how to do this. I’ve also tried using Nettle, just in case it needed a terminal emulator, but no luck. It seems that the standard way of accomplishing this sort of thing is to use the GCCSDK cross-compiler on a Linux machine, but I don’t have one (I tried doing it on the Pi itself under Raspbian but my 4 GB card isn’t sufficient). Using Linux is probably the best way forward, but at this stage I’m just seeing what I can accomplish under RISC OS itself. Any tips? :) |
Steve Pampling (1551) 7928 posts |
That’s probably why the better results come from doing a search for “Bourne shell”, or more appropriately for this case “Bourne Again SHell” “bash” “bourne again shell”
Have you tried with a larger wimpslot? |
Chris Mahoney (1684) 2100 posts |
Argh! It’s always something so trivially simple! Seems to be behaving itself now; thanks :) As for running the script, I just tried doing “bash configure” (ie. using “configure” as a parameter to bash) and it appeared to try to run it, but quickly fell over. It’s time for me to work now but I’ll certainly try a few things when I’m back home. |
Steve Pampling (1551) 7928 posts |
In the office1 we tend to throw questions to the room in general or describe a problem to someone who isn’t busy. Possible outcomes frequently include: 1 3rd line support, if we can’t fix it the place is stuffed. So said one of the trainers showing a newbie round the building. |
Chris Mahoney (1684) 2100 posts |
Yep, been there, done that :) |
Ronald May (387) 407 posts |
It seems that I need to somehow tell bash to execute the file itself instead of pass it back to the OS, but I haven’t been able to find any documentation on how to do this. Unixlib programs translate the standard /bin/sh to a call to RISC OS CLI. |
Chris Mahoney (1684) 2100 posts |
Thanks, it looks like that’ll get me going in the meantime until I can get my mitts on a Linux machine :) |
Alan Buckley (167) 232 posts |
If (and I know it’s a big IF) you have a Windows machine, you can use something like VirtualBox to create a virtual Linux machine that runs on Windows. I switched to this from using Cygwin a while ago for the GCCSDK cross compiler and it works very well. |
Theo Markettos (89) 919 posts |
The Pi is probably OK for this, though it helps to run the compiles off USB flash or HDD rather than SD (unless you get an SD with good IOPS they can be deathly slow). Aside from the relative slowness of RISC OS hardware compared with big Intel boxes (especially lack of RISC OS multicore), one of the reasons for using Linux is RISC OS doesn’t really have a process model. That means it’s OK to run bash, but then ./configure will spawn a few hundred instances of (compile tiny C program with GCC; run tiny C program; set a variable based on the results). RISC OS can’t cope with that. RISC OS isn’t really designed for spawning a tree of processes inside, say, a Task Window — what happens is that the current program gets copied into higher memory, the new one gets loaded at &8000, run and then the old one is copied down again (not sure if actually copied or MMU twiddled). You could spawn a few thousand TaskWindows with pipes here and there, but it would get very slow very quickly. If RISC OS had a decent process model then UnixLib could use it – it’s quite good at patching up the difference between the RISC OS API and POSIX, in most cases. So bash kinda works (to the stage you might use it as an interpreter of bash scripts) but any launching of other programs is quite dicey. For building stuff I’d suggest a VM is the way to go, or maybe a USB live stick. One other option is to rent a VPS – you can get them from about dollar a month (see LowEndBox for the cheapo deals) – if you stretch the budget to maybe $3pm you can rent a VM on an adequate x86 server (but minimal support if things go wrong). |
Chris Mahoney (1684) 2100 posts |
Thanks for that explanation. As it happens, the previously-mentioned “getting mitts on a Linux machine” happened more quickly than expected – I have a relatively new PC here that I’d tried Linux on in the past with no luck, but it seems that the most recent Ubuntu has better hardware support. I’ve successfully compiled GCCSDK and will try to get my head around using it later. My to-do list is growing! |