[Lunar-commits] <moonbase> bash_static: option for default root shell ...

Christian Krause wookietreiber at lunar-linux.org
Wed May 11 23:30:48 CEST 2011


commit 700c1a19d667fcabd7fe1c4fac32c94ffa0645af
Author: Christian Krause <wookietreiber at lunar-linux.org>
Date:   Wed May 11 23:30:48 2011 +0200

    bash_static: option for default root shell ...
    
    also fixed cp bug in BUILD (use cp -f rather than just cp)
    also removed non-unique depends ncurses
    also improved both short and long description
---
 shells/bash_static/BUILD        |    3 ++-
 shells/bash_static/CONFIGURE    |    1 +
 shells/bash_static/DEPENDS      |    1 -
 shells/bash_static/DETAILS      |   11 +++++++----
 shells/bash_static/POST_INSTALL |    6 +++++-
 shells/bash_static/POST_REMOVE  |    8 ++++++++
 6 files changed, 23 insertions(+), 7 deletions(-)

diff --git a/shells/bash_static/BUILD b/shells/bash_static/BUILD
index dafb2f7..e3c62ca 100644
--- a/shells/bash_static/BUILD
+++ b/shells/bash_static/BUILD
@@ -23,6 +23,7 @@
    make version.h   &&
    make             &&
    prepare_install  &&
-   cp bash /bin/bash_static
+
+   cp -f bash /bin/bash_static
 
 ) > $C_FIFO 2>&1
diff --git a/shells/bash_static/CONFIGURE b/shells/bash_static/CONFIGURE
new file mode 100644
index 0000000..f04f1c8
--- /dev/null
+++ b/shells/bash_static/CONFIGURE
@@ -0,0 +1 @@
+mquery ROOTSHELL "Set bash_static to default shell of root?" n
diff --git a/shells/bash_static/DEPENDS b/shells/bash_static/DEPENDS
index 30ee686..85f1fcd 100644
--- a/shells/bash_static/DEPENDS
+++ b/shells/bash_static/DEPENDS
@@ -1,2 +1 @@
-depends  ncurses
 depends  readline
diff --git a/shells/bash_static/DETAILS b/shells/bash_static/DETAILS
index 03a4689..81bbad0 100644
--- a/shells/bash_static/DETAILS
+++ b/shells/bash_static/DETAILS
@@ -37,10 +37,13 @@ SOURCE_DIRECTORY=$BUILD_DIRECTORY/bash-$BASE
         WEB_SITE=http://tiswww.case.edu/php/chet/bash_static/bashtop.html
          ENTERED=20020615
          UPDATED=20101018
-           SHORT="A static build of bash, named as bash_static"
+           SHORT="static bash build for rescue purposes"
 
 cat << EOF
-bash - Shell of the GNU operating system.
-This is the static build of bash; call bash_static to use it.
-EOF
+bash_static is the same as bash (Bourne Again SHell) -- just
+a static build of it so one can use it as a rescue shell
+without relying on any shared libraries.
 
+It will be located at /bin/bash_static. You can call it with
+$ bash_static
+EOF
diff --git a/shells/bash_static/POST_INSTALL b/shells/bash_static/POST_INSTALL
index a1b9d85..2236e65 100644
--- a/shells/bash_static/POST_INSTALL
+++ b/shells/bash_static/POST_INSTALL
@@ -3,7 +3,11 @@ cat << END
 The static build of bash is installed and located at
 /bin/bash_static.
 
-This is NOT an ordinary shell. It is installed for 
+This is NOT an ordinary shell. It is installed for
 rescue purposes.
 
 END
+
+if [ "$ROOTSHELL" == "y" ] ; then
+  chsh -s /bin/bash_static root
+fi
diff --git a/shells/bash_static/POST_REMOVE b/shells/bash_static/POST_REMOVE
new file mode 100644
index 0000000..3d8447b
--- /dev/null
+++ b/shells/bash_static/POST_REMOVE
@@ -0,0 +1,8 @@
+# set root shell to normal bash again
+echo `getent passwd root | cut -d: -f7`
+FOO=`getent passwd root | cut -d: -f7`
+echo $FOO
+
+if [ `getent passwd root | cut -d: -f7` == "/bin/bash_static" ] ; then
+  chsh -s /bin/bash root
+fi


More information about the Lunar-commits mailing list