Changeset 9a87912 in freewrt


Ignore:
Timestamp:
Jul 27, 2006, 2:22:26 PM (19 years ago)
Author:
Thorsten Glaser <tg@…>
Branches:
freewrt_1_0, freewrt_2_0
Children:
2314460
Parents:
bc417a4
Message:

add the ability to choose user's default shell, too
XXX untested

git-svn-id: svn://www.freewrt.org/trunk/freewrt@439 afb5a338-a214-0410-bd46-81f09a774fd1

Location:
package
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • package/Config.shell

    rbc417a4 r9a87912  
    11# $FreeWRT$
    22
    3 comment "/bin/sh"
     3comment "Shell selection"
    44choice
    5         prompt "Choose your default shell"
     5        prompt "Choose the default bourne shell (/bin/sh)"
    66        default BUSYBOX_CONFIG_FEATURE_SH_IS_ASH
    77        help
     
    6969
    7070endchoice
     71
     72choice
     73        prompt "Choose the login shell for admin"
     74        default FWRT_BASEFILES_ADMIN_ASH
     75        help
     76          Choose a shell which is to be used as the default login
     77          shell for the "admin" user. Only shells selected above
     78          can be chosen.
     79
     80config FWRT_BASEFILES_ADMIN_ASH
     81        depends BUSYBOX_CONFIG_ASH
     82        bool "ash (busybox)"
     83        help
     84          Tha 'ash' shell adds about 60k in the default configuration and is
     85          the most complete and most pedantically correct shell included with
     86          busybox.  This shell is actually a derivative of the Debian 'dash'
     87          shell (by Herbert Xu), which was created by porting the 'ash' shell
     88          (written by Kenneth Almquist) from NetBSD.
     89
     90config FWRT_BASEFILES_ADMIN_MKSH
     91        depends FWRT_PACKAGE_MKSH
     92        bool "mksh"
     93        help
     94          mksh is the MirBSD enhanced version of the Public Domain Korn
     95          shell (pdksh), a bourne-compatible shell which is largely similar
     96          to the original AT&T Korn shell. It includes bug fixes and
     97          feature improvements in order to produce a modern, robust shell
     98          good for interactive and especially script use. Some sh/ksh/pdksh
     99          compatibility kludges have been removed.
     100
     101config FWRT_BASEFILES_ADMIN_HUSH
     102        depends BUSYBOX_CONFIG_HUSH
     103        bool "hush (busybox)"
     104        help
     105          hush is a very small shell (just 18k) and it has fairly complete
     106          Bourne shell grammar.  It even handles all the normal flow control
     107          options such as if/then/elif/else/fi, for/in/do/done, while loops,
     108          etc.
     109
     110          It does not handle case/esac, select, function, here documents ( <<
     111          word ), arithmetic expansion, aliases, brace expansion, tilde
     112          expansion, &> and >& redirection of stdout+stderr, etc.
     113
     114config FWRT_BASEFILES_ADMIN_LASH
     115        depends BUSYBOX_CONFIG_LASH
     116        bool "lash (busybox)"
     117        help
     118          lash is the very smallest shell (adds just 10k) and it is quite
     119          usable as a command prompt, but it is not suitable for any but the
     120          most trivial scripting (such as an initrd that calls insmod a few
     121          times) since it does not understand any Bourne shell grammar.  It
     122          does handle pipes, redirects, and job control though.  Adding in
     123          command editing makes it a very nice lightweight command prompt.
     124
     125config FWRT_BASEFILES_ADMIN_MSH
     126        depends BUSYBOX_CONFIG_MSH
     127        bool "msh (busybox)"
     128        help
     129          The minix shell (adds just 30k) is quite complete and handles things
     130          like for/do/done, case/esac and all the things you expect a Bourne
     131          shell to do.  It is not always pedantically correct about Bourne
     132          shell grammar (try running the shell testscript "tests/sh.testcases"
     133          on it and compare vs bash) but for most things it works quite well.
     134          It also uses only vfork, so it can be used on uClinux systems.
     135
     136config FWRT_BASEFILES_ADMIN_SH
     137        bool "/bin/sh"
     138        help
     139          Fall-back: use /bin/sh, whatever it is.
     140
     141endchoice
  • package/base-files/Makefile

    rbc417a4 r9a87912  
    44
    55PKG_NAME:=              base-files
    6 PKG_RELEASE:=           8
     6PKG_RELEASE:=           9
    77WRKSRC=                 ${WRKDIR}/base-files
    88
     
    4646endif
    4747
     48ADMIN_SHELL:=           /bin/sh
     49ifeq (${FWRT_BASEFILES_ADMIN_ASH},y)
     50ADMIN_SHELL:=           /bin/ash
     51endif
     52ifeq (${FWRT_BASEFILES_ADMIN_MKSH},y)
     53ADMIN_SHELL:=           /bin/mksh
     54endif
     55ifeq (${FWRT_BASEFILES_ADMIN_HUSH},y)
     56ADMIN_SHELL:=           /bin/hush
     57endif
     58ifeq (${FWRT_BASEFILES_ADMIN_LASH},y)
     59ADMIN_SHELL:=           /bin/lash
     60endif
     61ifeq (${FWRT_BASEFILES_ADMIN_MSH},y)
     62ADMIN_SHELL:=           /bin/msh
     63endif
     64
    4865$(WRKBUILD)/.prepared:
    4966        mkdir -p $(WRKBUILD) $(PACKAGE_DIR)
     
    6683        test -z $(FWRT_RUNTIME_PASSWORD) || \
    6784            $(SED) 's,\*NP\*,$(MD5CRYPT),g' $(IDIR_BASE)/etc/passwd
     85        $(SED) 's!@SHELL@!${ADMIN_SHELL}!g' $(IDIR_BASE)/etc/passwd
    6886        test -z $(FWRT_RUNTIME_SSHKEY) || ( \
    6987            mkdir -p $(IDIR_BASE)/etc/dropbear; \
  • package/base-files/default/etc/passwd

    rbc417a4 r9a87912  
    11root:*NP*:0:0:root:/tmp:/bin/sh
    2 admin:*NP*:100:100:admin:/tmp:/bin/ash
     2admin:*NP*:100:100:admin:/tmp:@SHELL@
    33nobody:*:65534:65534:nobody:/var:/bin/false
Note: See TracChangeset for help on using the changeset viewer.