diff options
author | Ludovic Pouzenc <ludovic@pouzenc.fr> | 2017-10-22 21:26:42 +0200 |
---|---|---|
committer | Ludovic Pouzenc <ludovic@pouzenc.fr> | 2017-10-22 21:26:42 +0200 |
commit | 211e646859ee028a0a66b67c96057a2f1a6a82ba (patch) | |
tree | f040fcbe520045d00c6e71ccc9b8307019489470 /make-boot-image.sh | |
parent | c6af909787ba0256b9f09903d9274acf0cd6aeaf (diff) | |
download | eficast-211e646859ee028a0a66b67c96057a2f1a6a82ba.tar.gz eficast-211e646859ee028a0a66b67c96057a2f1a6a82ba.tar.bz2 eficast-211e646859ee028a0a66b67c96057a2f1a6a82ba.zip |
More polishing
Diffstat (limited to 'make-boot-image.sh')
-rwxr-xr-x | make-boot-image.sh | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/make-boot-image.sh b/make-boot-image.sh index 93a2d1d..c96b19b 100755 --- a/make-boot-image.sh +++ b/make-boot-image.sh @@ -415,9 +415,9 @@ autorun() { [ "x$1" == "xnfs" ] && tmux split-window -t %0 -l5 iftop-watch network [ $(tput lines) -gt 30 ] && tmux \ - split-window -t %0 -l6 iostat-watch cpu-disk \; \ - split-window -t %0 -l6 mpstat-watch cpu-softintr \; \ - split-window -h -p40 pstree-watch processes + split-window -t %0 -l10 iostat-watch cpu-disk \; \ + split-window -h -p26 pstree-watch processes \; \ + split-window -t -1 mpstat-watch cpu-softintr tmux select-pane -t:.0 \; attach # Hack to keep the error flow intact @@ -459,6 +459,7 @@ sfx_starting() { sound 1 25 $C5 $G4 $C5 $E5 $G5 $C6 $G5 $Ab4 $C5 $Eb5 $Ab5 $Eb5 eval $(notes) EOF +# All shell spawned here must be login-shell, will load /etc/profile cat > "$WORKDIR/initrd/etc/inittab" <<"EOF" # Custom init scripts ::sysinit:/etc/rc.d/rcS @@ -467,7 +468,7 @@ cat > "$WORKDIR/initrd/etc/inittab" <<"EOF" ::shutdown:/sbin/swapoff -a ::shutdown:/bin/umount -a -r ::restart:/sbin/init -tty1::respawn:/etc/rc.d/rc2-or-rescue +tty1::respawn:/bin/sh -lc /etc/rc.d/rc2-or-rescue tty2::askfirst:/bin/sh -l tty3::askfirst:/bin/sh -l EOF @@ -550,7 +551,7 @@ then rm /run/rescue rescue_shell else touch /run/rescue echo_color green black "/etc/rc.d/rc2 script will run on /dev/tty1 now" - sh -lc /etc/rc.d/rc2 # Need /etc/profile + /etc/rc.d/rc2 fi EOF add_initrd_script "/etc/rc.d/tmux-main-pane" <<"EOF" @@ -612,7 +613,7 @@ EOF add_initrd_script "/bin/iostat-watch" <<"EOF" # Emulates watch command with iostat (filtered info, minimal height) echo -ne "\e]2;$*\007" # Term title (tmux) -iostat -cdmz 1 | awk '$1=="avg-cpu:" { system("clear"); } length($0) > 0 { print $0; }' +iostat -cdmz 1 | awk '$1=="avg-cpu:"{system("clear")} length($0)>0{print}' EOF add_initrd_script "/bin/mpstat-watch" <<"EOF" # Emulates watch command with mpstat @@ -634,8 +635,8 @@ EOF add_initrd_script "/bin/pstree-watch" <<"EOF" echo -ne "\e]2;$*\007" # Term title (tmux) while true; do - pid=$(pidof tmux-main-pane) - [ -n "$pid" ] && watch -t pstree -p $pid + pid=$(pidof tmux-main-pane | tr ' ' '\n' | sort -n | head -n1) + [ -n "$pid" ] && watch -t "pstree -p $pid" sleep 1 done EOF |