Code Monkey home page Code Monkey logo

Comments (6)

jbruchon avatar jbruchon commented on August 18, 2024

Are you on Debian? What shell is used as /bin/sh on your system? Some systems do not use bash as the default shell. I do all my testing on a CRUX Linux 3.1 machine with /bin/sh -> bash.

from elks.

darkstar avatar darkstar commented on August 18, 2024

I'm on (k)ubuntu 14.10. It appears that although my login shell is set to bash, /bin/sh points to ubuntu's own "dash" shell. And then gmake picks up /bin/sh insteat of my login shell, so it was using dash all along instead of bash. Manually removing the dash-link and pointing /bin/sh to /bin/bash has solved the issue.

from elks.

jbruchon avatar jbruchon commented on August 18, 2024

It would be better if we could fix the problem on dash instead of requiring /bin/sh to point to bash. It seems that dash doesn't support the [[ ... ]] construct and that this is the source of the problem. I've already committed a likely fix. Could you please pull the latest git and see if this error is gone?

from elks.

darkstar avatar darkstar commented on August 18, 2024

Yes, now it works.

There's still another small issue with dash. Right at the start, when running ./build.sh, there's supposed to be a pause where the user has to press a key to continue. I only noticed that after switching /bin/sh to bash, because with dash, it starts building right away:

root@kubuntu:/usr/src/elks# ./build.sh
WARNING: Disk images can only be built logged in as 'root'

Preparing to build the ELKS kernel. This will invoke 'make menuconfig'
for you to configure the system. The defaults should be OK for many
systems, but you may want to review them.

Press a key to continue... ./build.sh: 9: read: Illegal option -n

sed '/\#\#\# Dependencies:/q' < Makefile > make.tmp
make[1]: Entering directory '/usr/src/elks/elks/Documentation'
sed '/\#\#\# Dependencies:/q' < Makefile > make.tmp
make[2]: Entering directory '/usr/src/elks/elks/Documentation/Images'
sed '/\#\#\# Dependencies:/q' < Makefile > make.tmp
...

looks like dash doesn't like "read -n". Not sure about how to fix this as there's no /bin/read or /usr/bin/read as fallback and dash's read is very limited in what it can do..

from elks.

jbruchon avatar jbruchon commented on August 18, 2024

I've implemented a workaround that sleeps for 7 seconds (configurable by editing DELAY=7 at the top of the build.sh script) when the $BASH_VERSION var is missing. It won't detect bash in 100% of scenarios (see http://stackoverflow.com/questions/3199893/howto-detect-bash-from-shell-script for more information) but it will work in most common cases.

Tested against BusyBox-flavored ash in busybox-1.21.1 and confirmed the workaround triggers. Note that BusyBox supports some bashisms in their port of ash and it might be a good idea to use the read -n 1 -s 2>/dev/null || sleep 7 construct instead so that /bin/sh -> BusyBox can take advantage of read -n, but for now we just need the initial help text to be up long enough to be readable.

Fixed in commit 32532ed (build.sh: fix a bashism).

from elks.

mfld-fr avatar mfld-fr commented on August 18, 2024

Please ignore the reference from #133 : fake one from source excerpt.

from elks.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.