Skip to content
Browse files

Adding mksh

  • Loading branch information...
1 parent 90f337a commit 179b1f0a4d791ef2e9a5bb649493d5d979e3e57e @geirha committed Sep 19, 2012
Showing with 27 additions and 3 deletions.
  1. +4 −1 Makefile
  2. +12 −0 build-mksh
  3. +7 −0 generate-initramfs
  4. +4 −2 triggers
View
5 Makefile
@@ -4,7 +4,7 @@ awks = build/bin/bwk build/bin/gawk3 build/bin/gawk4 build/bin/mawk build/bin/na
evalbot: hda
-initramfs.cpio.gz: $(bashes) $(awks) initramfs
+initramfs.cpio.gz: $(bashes) build/bin/mksh $(awks) initramfs
{ cd initramfs && pax -x sv4cpio -w .; } | gzip -9 > initramfs.cpio.gz
initramfs: generate-initramfs
@@ -43,3 +43,6 @@ build/bin/nawk:
./build-awk nawk
build/bin/oawk:
./build-awk oawk
+
+build/bin/mksh:
+ ./build-mksh R40i20120901 mksh
View
12 build-mksh
@@ -0,0 +1,12 @@
+#!/bin/bash
+
+version=$1 bin_name=${2:-mksh$version}
+
+mkdir -p build/bin &&
+cd build &&
+wget -c -O "mksh-$version.tgz" "https://www.mirbsd.org/MirOS/dist/mir/mksh/snapshot/mksh-$version.tgz" &&
+
+gzip -cd "mksh-$version.tgz" | pax -r &&
+cd mksh &&
+sh Build.sh &&
+cp mksh "../bin/$bin_name"
View
7 generate-initramfs
@@ -185,6 +185,7 @@ declare -A commands='(
[gzip]="compress or expand files"
[hostname]="show or set the system'\''s host name"
[mknod]="make block or character special files"
+ [mksh]="MirBSD Korn shell"
[mktemp]="create a temporary file or directory"
[mount]="mount a filesystem"
[ksh]="KornShell, a command and programming language"
@@ -314,6 +315,12 @@ cat > initramfs/root/.bashrc << 'EOF'
shopt -s globstar
} 2>/dev/null
EOF
+cat > initramfs/root/.mkshrc << 'EOF'
+# when emacs mode is on, it "overrides" stty -echo
+set +o emacs
+# mksh overrides PS1 from env when run as a login shell
+PS1='$({ mkdir /tmp/... || echo o >/proc/sysrq-trigger; set +x; } 2>/dev/null)'
+EOF
# /init
cat > initramfs/init << 'EOF'
View
6 triggers
@@ -1,8 +1,10 @@
++ bash+
1 bash1
2 bash2
3 bash3
4 bash
+d dash
k ksh
+m mksh
+mk mksh
sh sh
-d dash
-+ bash+

0 comments on commit 179b1f0

Please sign in to comment.
Something went wrong with that request. Please try again.