LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux From Scratch
User Name
Password
Linux From Scratch This Forum is for the discussion of LFS.
LFS is a project that provides you with the steps necessary to build your own custom Linux system.

Notices


Reply
  Search this Thread
Old 09-19-2022, 06:10 PM   #1
jr_bob_dobbs
Member
 
Registered: Mar 2009
Distribution: Bedrock, Devuan, Slackware, Linux From Scratch, Void
Posts: 651
Blog Entries: 135

Rep: Reputation: 188Reputation: 188
Void sh points to dash yet LFS wants bash


Thinking of building an LFS system again.

I'm currently running Void Linux. /bin/sh is a sym link to dash. LFS book says it should be a sym link to bash.

Bash is installed in my system but I wonder if bash's emulation of sh is the same as dash's. Will anything in Void break if I change the sym link to point to bash? If I leave the sym link, will anything break in the LFS scripts and/or commands?

Thank you.
 
Old 09-19-2022, 07:47 PM   #2
jmgibson1981
Senior Member
 
Registered: Jun 2015
Location: Tucson, AZ USA
Distribution: Debian
Posts: 1,150

Rep: Reputation: 393Reputation: 393Reputation: 393Reputation: 393
Most likely not. Worst case bash should be installed, just create a temp symlink to it and use the new symlink to open the shell as you work on your lfs. Is what I would do anyway. You can also enter a bash shell by typing bash in the shell. it will go to a subshell of sorts that is bash... at least as long as bash isn't also symlinked to dash.

Last edited by jmgibson1981; 09-19-2022 at 07:48 PM.
 
Old 09-20-2022, 04:17 AM   #3
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,650
Blog Entries: 19

Rep: Reputation: 4480Reputation: 4480Reputation: 4480Reputation: 4480Reputation: 4480Reputation: 4480Reputation: 4480Reputation: 4480Reputation: 4480Reputation: 4480Reputation: 4480
istr there are some "bashisms" in LFS builds that won't work if dash is the system shell. At least that used to be the case.
 
Old 09-20-2022, 05:05 AM   #4
Keith Hedger
Senior Member
 
Registered: Jun 2010
Location: Wiltshire, UK
Distribution: Void, Linux From Scratch, Slackware64
Posts: 3,154

Rep: Reputation: 857Reputation: 857Reputation: 857Reputation: 857Reputation: 857Reputation: 857Reputation: 857
Its not so much that LFS uses so called 'bashisms' ( in fact I think they dont ) but some build systems use a hard coded BASH, just symlink sh->/bin/bash it wont hurt, you can always put it back later.
 
Old 09-20-2022, 06:00 AM   #5
boughtonp
Senior Member
 
Registered: Feb 2007
Location: UK
Distribution: Debian
Posts: 3,616

Rep: Reputation: 2555Reputation: 2555Reputation: 2555Reputation: 2555Reputation: 2555Reputation: 2555Reputation: 2555Reputation: 2555Reputation: 2555Reputation: 2555Reputation: 2555
Quote:
Originally Posted by jr_bob_dobbs View Post
/bin/sh is a sym link to dash. LFS book says it should be a sym link to bash.
More precisely, LFS Host Requirements says:
Quote:
Originally Posted by https://www.linuxfromscratch.org/lfs/view/stable/chapter02/hostreqs.html
Bash-3.2 (/bin/sh should be a symbolic or hard link to bash)

...

Note that the symlinks mentioned above are required to build an LFS system using the instructions contained within this book. Symlinks that point to other software (such as dash, mawk, etc.) may work, but are not tested or supported by the LFS development team, and may require either deviation from the instructions or additional patches to some packages.

However, Bash says:
Quote:
Originally Posted by https://www.gnu.org/software/bash/manual/html_node/Bash-POSIX-Mode.html
Starting Bash with the --posix command-line option or executing ‘set -o posix’ while Bash is running will cause Bash to conform more closely to the POSIX standard by changing the behavior to match that specified by POSIX in areas where the Bash default differs.

When invoked as sh, Bash enters POSIX mode after reading the startup files.
The posix option includes the clarification: "This is intended to make Bash behave as a strict superset of that standard."

So as a superset it is still possible that invoking Bash as /bin/sh has Bash-specific behaviour in areas which POSIX has not defined, but that would be bad practice and unnecessary since anything needing Bash behaviour can easily just use /bin/bash instead.

If LFS does do use Bash-specific behaviour via /bin/sh, manually updating any commands/scripts to use "/bin/bash --posix" instead of "/bin/sh" should work, without needing to swap the /bin/sh symlink, (even if that might be a simpler option).

 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
pthread giving error: invalid conversion from ‘void* (*)(int*)’ to ‘void* (*)(void*)’ knobby67 Programming 4 05-05-2017 10:54 AM
(void)time(&cur_time); Why did the author put (void) here? e3399 Programming 3 03-28-2011 11:45 AM
me wants cluster me wants cluster me wants cluster funkymunky Linux - Networking 3 01-06-2004 07:51 AM
void main(void) linuxanswer Programming 4 10-26-2003 12:37 AM
void foo(void) and void foo() lackluster Programming 9 02-15-2003 10:57 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux From Scratch

All times are GMT -5. The time now is 12:53 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration