--- /dev/null
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=mksh
+PKG_VERSION:=R29b
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).cpio.gz
+PKG_SOURCE_URL:=http://www.mirbsd.org/MirOS/dist/mir/mksh
+PKG_MD5SUM:=a21850403bd30bab461f2fc9f9b803b8
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
+
+include $(INCLUDE_DIR)/package.mk
+
+# This program seems to depend on libssp, but only for GCC 4
+GCCVER:=$(if $(DUMP),4,$(word 1,$(subst ., ,$(CONFIG_GCC_VERSION))))
+ifeq ($(GCCVER),4)
+ DEP:=+libssp
+else
+ DEP:=
+endif
+
+define Package/mksh
+ SECTION:=shells
+ CATEGORY:=Base system
+ TITLE:=mksh
+ DEPENDS:=$(DEP)
+ DESCRIPTION:=MirBSD version of ksh
+endef
+
+define Build/Compile
+ cd $(PKG_BUILD_DIR); \
+ CC=$(TARGET_CC) \
+ TARGET_OS=$(shell uname -s) \
+ CFLAGS="$(TARGET_CFLAGS)" \
+ CPPFLAGS="-DMKSH_SMALL=1" \
+ LDFLAGS="$(TARGET_LDFLAGS)" \
+ $(BASH) Build.sh -d -r
+endef
+
+define Package/mksh/install
+ $(INSTALL_DIR) $(1)/etc
+ $(INSTALL_DATA) $(PKG_BUILD_DIR)/dot.mkshrc $(1)/etc/mkshrc
+ $(INSTALL_DIR) $(1)/bin
+ $(INSTALL_BIN) $(PKG_BUILD_DIR)/mksh $(1)/bin/
+endef
+
+$(eval $(call BuildPackage,mksh))
--- /dev/null
+--- mksh.old/dot.mkshrc 2007-03-04 06:21:11.000000000 +0000
++++ mksh.dev/dot.mkshrc 2007-03-05 22:11:49.000000000 +0000
+@@ -1,6 +1,6 @@
+ # $MirOS: src/bin/mksh/dot.mkshrc,v 1.8 2007/03/04 06:20:48 tg Exp $
+
+-: ${EDITOR:=/bin/ed} ${HOSTNAME:=$(hostname -s 2>/dev/null || hostname)}
++: ${EDITOR:=/bin/ed} ${HOSTNAME:=$(</proc/sys/kernel/hostname)}
+ PS1='$(((rv=$?)) && print $rv\|)${USER:=$(id -un)}@${HOSTNAME:=nil}:$(
+ local pfx=~ wd=${PWD:-$(pwd)}
+ [[ ${wd#$pfx} = $wd || $pfx = ?(/) ]] || wd=\~${wd#$pfx}
+@@ -21,7 +21,7 @@ export EDITOR HOSTNAME MKSH=$(whence -p
+ alias l='/bin/ls -F'
+ alias la='l -a'
+ alias ll='l -l'
+-alias lo='la -lo'
++alias lo='la -l'
+ [ -x /usr/bin/hd ] || eval alias hd="'hexdump -e '\\''\"%08.8_ax \" 8/1" \
+ '"%02X " " - " 8/1 "%02X "'"'\\'' -e '\\''"'" |" "%_p"'"'\\''" \
+ "-e '\\''"'"|\n"'"'\\'' '"