Created
August 25, 2018 20:08
-
-
Save azat/852e008cba90eeed94058435461128e0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
function configure_init() | |
{ | |
set -x | |
export PATH=/sbin:/bin | |
} | |
function configure_fs() | |
{ | |
mount -o remount,rw / | |
mount -t proc proc /proc | |
mount -t sysfs sys /sys | |
# /dev/ptmx | |
mkdir -p /dev/pts | |
mount -t devpts devpts /dev/pts | |
} | |
function configure_net() | |
{ | |
ip l s dev lo up | |
} | |
function configure_env() | |
{ | |
# TODO: parse cmdline | |
local env=( | |
TERM=xterm | |
) | |
export "${env[@]}" | |
} | |
function configure_tty() | |
{ | |
stty rows 50 cols 182 | |
} | |
function main() | |
{ | |
configure_init | |
configure_fs | |
configure_net | |
configure_env | |
configure_tty | |
tmux || bash | |
} | |
main "$@" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment