diff --git a/Containerfile b/Containerfile index 78dda97..932b008 100644 --- a/Containerfile +++ b/Containerfile @@ -71,6 +71,9 @@ FROM stagex/user-usbmuxd@sha256:90f687d2368328b76141badc382a21873a5b44d4ddccf851 FROM stagex/user-socat@sha256:990a70ae13462d8ba0a925fe959dd83070cbecdb3f91ff145caca5232171f3b8 AS user-socat FROM stagex/user-dhcpcd@sha256:60bd86d9e2fcb6341c1efaeda5d786b63ff92e9d0c729cd8f634a20ff54ee71e AS user-dhcpcd FROM stagex/user-guestctl@sha256:95ad9e34a003c7d1d01f5d427b5f79d2430f6e6634debde8e54f9a6f08749704 AS user-guestctl +FROM stagex/core-ncurses@sha256:6602a073bf9a408d1ed7c20ccc98fca974cd307fb8d1da6381fbca684a08169c AS core-ncurses +FROM stagex/user-libevent@sha256:1ba6f006f49cc327a5da84caeb0de7088da844f8021c5902fe387cd379732aec AS user-libevent +FROM stagex/user-tmux@sha256:57b63a27169a333edb073f1c6646a37ec6a9eee02ffdbc494a52bd6d670fc576 AS user-tmux FROM scratch AS base ARG VERSION development @@ -247,6 +250,9 @@ COPY --from=user-libzbar . initramfs COPY --from=user-keyfork . initramfs COPY --from=user-icepick . initramfs COPY --from=user-guestctl . initramfs +COPY --from=user-libevent . initramfs +COPY --from=core-ncurses . initramfs +COPY --from=user-tmux . initramfs COPY src/host/rootfs/ initramfs COPY <<-EOF initramfs/etc/environment export VERSION="$VERSION" diff --git a/src/host/rootfs/etc/inittab b/src/host/rootfs/etc/inittab index 56b8725..0c35acd 100644 --- a/src/host/rootfs/etc/inittab +++ b/src/host/rootfs/etc/inittab @@ -10,6 +10,7 @@ # Startup the system ::sysinit:/bin/mount -t devtmpfs devtmpfs /dev ::sysinit:/bin/mkdir -p /proc /run /dev/pts /dev/shm /sys +::sysinit:/bin/mount -t devpts devpts /dev/pts ::sysinit:/bin/mount -t sysfs sysfs /sys ::sysinit:/bin/mount -t proc proc /proc ::sysinit:/bin/mount -o remount,rw / @@ -21,8 +22,8 @@ null::sysinit:/bin/ln -sf /proc/self/fd/2 /dev/stderr # now run any rc scripts ::sysinit:/etc/init.d/rcS -# Put shells on the serial terminal and console -console::respawn:-/bin/bash +# Put a shell on serial and tmux on console +console::respawn:-/bin/bash -l -c /bin/tmux ttyS0::respawn:-/bin/bash # Stuff to do for the 3-finger salute diff --git a/src/host/rootfs/etc/profile b/src/host/rootfs/etc/profile index b3ae715..726b124 100644 --- a/src/host/rootfs/etc/profile +++ b/src/host/rootfs/etc/profile @@ -1,4 +1,5 @@ export EDITOR=/bin/vi +export SHELL=/bin/bash export PATH="/usr/local/bin:/bin:/sbin:/usr/bin:/usr/sbin" export PS1="[\h \t] \\$ " export GNUPGHOME=/.gnupg diff --git a/src/host/rootfs/etc/tmux.conf b/src/host/rootfs/etc/tmux.conf new file mode 100644 index 0000000..cab552c --- /dev/null +++ b/src/host/rootfs/etc/tmux.conf @@ -0,0 +1,36 @@ +# Zero-based indexing is sure great in programming languages, +# but not so much in terminal multiplexers where that zero is +# all the way on the other side of the keyboard. +set-option -g base-index 1 + +set-option -g status on +set-option -g status-interval 1 + +# We should not have more than one session, but it's still possible. +# Therefore... +set-option -g status-left "[#S] " + +# Just so we can use `-ag` properly later +set-option -g status-right "" + +# The current power battery level +set-option -ag status-right '#(test -d /sys/class/power_supply/BAT0 && printf " [%%s%%%%]" "$(cat /sys/class/power_supply/BAT0/capacity)")' + +# Current date and time, in case it's relevant, and has drifted +set-option -ag status-right " [%Y-%m-%d %H:%M:%S]" + +# because cyan on black is cool, and pops out +set-option -g status-style "bg=color0 fg=color6" +set-option -g status-position bottom + +# we don't have much screen space, let's limit what's displayed +set-window-option -g window-status-bell-style "bold" +set-window-option -g window-status-current-format "#I:#W" +set-window-option -g window-status-format "#I:#W" + +# our "focused" window and pane is the brighter one +set-window-option -g window-status-style "fg=color6" +set-window-option -g window-status-current-style "fg=color14" +set-option -g pane-border-style "fg=color6" +set-option -g pane-active-border-style "fg=color14" +set-option -g message-style "fg=color6 bg=color0"