File tree Expand file tree Collapse file tree 3 files changed +49
-3
lines changed Expand file tree Collapse file tree 3 files changed +49
-3
lines changed Original file line number Diff line number Diff line change @@ -6,11 +6,13 @@ mkdir /dev/pts
66mount -t devpts devpts /dev/pts
77mount -t tmpfs tmpfs /tmp
88
9- echo " Configuring networking..."
109ifconfig eth0 10.0.2.15 netmask 255.255.255.0
1110route add default gw 10.0.2.2
1211ifconfig lo 127.0.0.1 netmask 255.0.0.0
1312
14- echo -e " Boot took $( cut -d' ' -f1 /proc/uptime) seconds."
13+ mount -t 9p -o trans=virtio,version=9p2000.L hostshare /mnt/share
14+
15+ clear
16+ # echo -e "\nBoot took $(cut -d' ' -f1 /proc/uptime) seconds."
1517
1618exec /sbin/init
Original file line number Diff line number Diff line change 1+ #! /bin/sh
2+
3+ # Save current stty settings
4+ oldstty=$( stty -g)
5+
6+ # Set terminal to raw mode, no echo
7+ stty raw -echo
8+
9+ # Send the escape sequence to request cursor position
10+ printf ' \0337\033[r\033[999;999H\033[6n'
11+
12+ # Read the response: ESC [ rows ; cols R
13+ # Read first two bytes (ESC and [)
14+ c1=$( dd bs=1 count=1 2> /dev/null)
15+ c2=$( dd bs=1 count=1 2> /dev/null)
16+
17+ rows=" "
18+ cols=" "
19+ if [ " $c1$c2 " = " $( printf ' \033[' ) " ]; then
20+ # Read rows (until ';')
21+ while : ; do
22+ c=$( dd bs=1 count=1 2> /dev/null)
23+ [ " $c " = " ;" ] && break
24+ rows=" ${rows}${c} "
25+ done
26+ # Read cols (until 'R')
27+ while : ; do
28+ c=$( dd bs=1 count=1 2> /dev/null)
29+ [ " $c " = " R" ] && break
30+ cols=" ${cols}${c} "
31+ done
32+ fi
33+
34+ # Restore terminal settings
35+ stty " $oldstty "
36+
37+ # Set terminal cols
38+ [ -n " $cols " ] && stty cols " $cols "
39+
40+ # Optionally print values
41+ echo " Rows: $rows "
42+ echo " Cols: $cols "
Original file line number Diff line number Diff line change 11#! /bin/sh
2- echo -e " \nUptime $( cut -d' ' -f1 /proc/uptime) s\n"
2+ /usr/sbin/autocols
3+ clear
4+ echo -e " Uptime $( cut -d' ' -f1 /proc/uptime) s\n"
35exec login -f root
You can’t perform that action at this time.
0 commit comments