summaryrefslogtreecommitdiff
path: root/mk
diff options
context:
space:
mode:
authorThorsten Glaser <tg@mirbsd.org>2011-01-07 15:37:19 +0000
committerWaldemar Brodkorb <wbx@openadk.org>2011-01-07 17:06:27 +0100
commitc76fbbb7e8a7517abeec6740272738e121fd6fec (patch)
tree3885c3a30bccfe3d3e4641d60f6b99317bf36b5f /mk
parenta0ea7c09e9b28bf6571363a2c3542fb03f7b34ae (diff)
add choices for both the root login shell and /bin/sh
Signed-off-by: Thorsten Glaser <tg@mirbsd.org>
Diffstat (limited to 'mk')
-rw-r--r--mk/image.mk31
1 files changed, 31 insertions, 0 deletions
diff --git a/mk/image.mk b/mk/image.mk
index 1b7178eef..9b74348fe 100644
--- a/mk/image.mk
+++ b/mk/image.mk
@@ -1,6 +1,34 @@
# This file is part of the OpenADK project. OpenADK is copyrighted
# material, please see the LICENCE file in the top-level directory.
+# relative paths, like 'mksh' or '../usr/bin/foosh'
+ifeq (${ADK_BINSH_ASH},y)
+BINSH:=ash
+else ifeq (${ADK_BINSH_BASH},y)
+BINSH:=bash
+else ifeq (${ADK_BINSH_MKSH},y)
+BINSH:=mksh
+else ifeq (${ADK_BINSH_ZSH},y)
+BINSH:=zsh
+else
+$(error No /bin/sh configured!)
+endif
+
+# absolute paths
+ifeq (${ADK_ROOTSH_ASH},y)
+ROOTSH:=/bin/ash
+else ifeq (${ADK_ROOTSH_BASH},y)
+ROOTSH:=/bin/bash
+else ifeq (${ADK_ROOTSH_MKSH},y)
+ROOTSH:=/bin/mksh
+else ifeq (${ADK_ROOTSH_TCSH},y)
+ROOTSH:=/usr/bin/tcsh
+else ifeq (${ADK_ROOTSH_ZSH},y)
+ROOTSH:=/bin/zsh
+else
+$(error No login shell configured!)
+endif
+
imageprepare: image-prepare-post extra-install
# if an extra directory exist in TOPDIR, copy all content over the
@@ -20,6 +48,9 @@ image-prepare-post:
mkfontdir ${TARGET_DIR}/usr/share/fonts/X11/$${i}; \
done; \
fi
+ sed -i '/^root:/s!:/bin/sh$$!:${ROOTSH}!' ${TARGET_DIR}/etc/passwd
+ -rm -f ${TARGET_DIR}/bin/sh
+ ln -sf ${BINSH} ${TARGET_DIR}/bin/sh
KERNEL_PKGDIR:=$(LINUX_BUILD_DIR)/kernel-pkg
KERNEL_PKG:=$(PACKAGE_DIR)/kernel_$(KERNEL_VERSION)_$(CPU_ARCH).$(PKG_SUFFIX)