Comments (6)
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.
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.
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.
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.
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 bash
isms 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.
Please ignore the reference from #133 : fake one from source excerpt.
from elks.
Related Issues (20)
- elf.c:34:18: error: use of undeclared identifier 'LIBELF_ARCH' HOT 5
- 8018X system: bell-8254.c:24:14: error: ‘SPEAKER_PORT’ undeclared HOT 3
- Cannot compile v0.7.0, undefined reference to "hd_drive_map" HOT 6
- Incompatibility with 3inONEder HOT 3
- V25 support HOT 5
- fd_type number mismatch for FD1232 HOT 7
- ELKs rebuilds with no configuration changes HOT 1
- Congratulations and wish list for elks functionality HOT 1
- Net start does not start httpd HOT 1
- ftp not working HOT 4
- Question on return code on create in socket.c HOT 2
- Building/porting ELKS in ROM HOT 19
- Not an issue, but i am willing to donate the intel etherexpress 8/16 network card HOT 8
- [qemu] cannot get network up HOT 6
- PC-98 Build errors HOT 8
- serial 2 ps/2 mouse adapter mouse acts funny HOT 11
- Selecting NANO sockets breaks build HOT 1
- Use of plain char as signed char in libc is not optimal
- Elksemu support for OS/2 NE HOT 5
- Can not boot no HD image with supplied qemu.sh script HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from elks.