Skip to content

Instantly share code, notes, and snippets.

@azat
Created August 25, 2018 20:08
Show Gist options
  • Save azat/852e008cba90eeed94058435461128e0 to your computer and use it in GitHub Desktop.
Save azat/852e008cba90eeed94058435461128e0 to your computer and use it in GitHub Desktop.
#!/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