Text color improvements.

This commit is contained in:
Ivan Davidov 2016-05-11 22:57:37 +03:00
parent 19c54e2411
commit 7fe35fb15b
6 changed files with 50 additions and 31 deletions

View File

@ -37,8 +37,8 @@
# #
# exec /sbin/init # exec /sbin/init
# Set cyan color. # Set white color.
echo -en "\\e[36m" echo -en "\\e[1m"
# Print message on screen. # Print message on screen.
cat << CEOF cat << CEOF
@ -60,14 +60,24 @@ if [ "$key" = "" ] ; then
echo "Executing /sbin/init as PID 1." echo "Executing /sbin/init as PID 1."
exec /sbin/init exec /sbin/init
else else
# Set white color.
echo -en "\\e[1m"
# Print message on screen. # Print message on screen.
cat << CEOF cat << CEOF
This is PID 1 rescue shell outside of the initramfs area. Execute the This is PID 1 rescue shell outside of the initramfs area. Execute the
following in order to continue with the system initialization: following in order to continue with the system initialization:
CEOF
# Set green color.
echo -en "\\e[32m"
cat << CEOF
exec /sbin/init exec /sbin/init
CEOF CEOF
# Unset all attributes.
echo -en "\\e[0m"
if [ "$PID1_SHELL" = "true" ] ; then if [ "$PID1_SHELL" = "true" ] ; then
# PID1_SHELL flag is set which means we have controlling terminal. # PID1_SHELL flag is set which means we have controlling terminal.

View File

@ -26,7 +26,7 @@
# | # |
# +--(2) /bin/sh (Alt + F4) # +--(2) /bin/sh (Alt + F4)
echo -e "\\e[32mWelcome to \"Minimal Linux Live\" \\e[35m(/sbin/init)\\e[0m" echo -e "Welcome to \\e[1mMinimal \\e[32mLinux \\e[31mLive\\e[0m (/sbin/init)"
for DEVICE in /sys/class/net/* ; do for DEVICE in /sys/class/net/* ; do
echo "Found network device ${DEVICE##*/}" echo "Found network device ${DEVICE##*/}"

View File

@ -1,13 +1,13 @@
::sysinit:/etc/04_bootscript.sh ::sysinit:/etc/04_bootscript.sh
::restart:/sbin/init ::restart:/sbin/init
::shutdown:echo -e "\n\\e[35mSync all file buffers...\\e[0m" ::shutdown:echo "\nSync all file buffers..."
::shutdown:sync ::shutdown:sync
::shutdown:echo -e "\\e[35mUnmount all filesystems...\\e[0m" ::shutdown:echo "Unmount all filesystems..."
::shutdown:umount -a -r ::shutdown:umount -a -r
::shutdown:echo -e "\n\\e[32mSee you soon! :)\\e[0m\n" ::shutdown:echo -e "\n \\e[1mSee you soon!\\e[0m\n"
::shutdown:sleep 1 ::shutdown:sleep 1
::ctrlaltdel:/sbin/reboot ::ctrlaltdel:/sbin/reboot
::once:/etc/welcome.sh 0 ::once:cat /etc/welcome.txt
::respawn:/bin/cttyhack /bin/sh ::respawn:/bin/cttyhack /bin/sh
tty2::once:cat /etc/welcome.txt tty2::once:cat /etc/welcome.txt
tty2::respawn:/bin/sh tty2::respawn:/bin/sh

View File

@ -1,10 +0,0 @@
#!/bin/sh
# Set cyan color.
echo -en "\\e[$1m"
cat /etc/welcome.txt
# Unset all attributes.
echo -en "\\e[0m"

View File

@ -1,7 +1,7 @@

##################################### ###################################
# # # #
# Welcome to "Minimal Linux Live" # # Welcome to Minimal Linux Live #
# # # #
##################################### ###################################


View File

@ -26,13 +26,13 @@
# | # |
# +--(2) /bin/sh (Alt + F4) # +--(2) /bin/sh (Alt + F4)
echo -e "\\e[32mWelcome to \"Minimal Linux Live\" \\e[35m(/init)\\e[0m" echo -e "Welcome to \\e[1mMinimal \\e[32mLinux \\e[31mLive\\e[0m (/init)"
# Let's mount all core file systems. # Let's mount all core file systems.
/etc/01_prepare.sh /etc/01_prepare.sh
# Set cyan color. # Set white color.
echo -en "\\e[36m" echo -en "\\e[1m"
# Print message on screen. # Print message on screen.
cat << CEOF cat << CEOF
@ -46,24 +46,43 @@ CEOF
# Unset all attributes. # Unset all attributes.
echo -en "\\e[0m" echo -en "\\e[0m"
# Wait 5 second or until any keybord key is pressed. # Wait 5 second or until any keybord key is pressed.
read -t 5 -n1 -s key read -t 5 -n1 -s key
if [ ! "$key" = "" ] ; then if [ ! "$key" = "" ] ; then
# Set white color.
echo -en "\\e[1m"
# Print message on screen. # Print message on screen.
cat << CEOF cat << CEOF
This is PID 1 rescue shell inside the initramfs area. Execute the following in This is PID 1 rescue shell inside the initramfs area. Execute the following in
order to continue with the overlay initialization process: order to continue with the overlay initialization process:
CEOF
# Set green color.
echo -en "\\e[32m"
cat << CEOF
exec /etc/02_overlay.sh exec /etc/02_overlay.sh
CEOF
# Set white color.
echo -en "\\e[0m\\e[1m"
cat << CEOF
Execute the following in order to skip the overlay initialization and continue Execute the following in order to skip the overlay initialization and continue
directly with the system initialization: directly with the system initialization:
exec /sbin/init
CEOF CEOF
# Set green color.
echo -en "\\e[32m"
cat << CEOF
exec /sbin/init
CEOF
# Unset all attributes.
echo -en "\\e[0m"
# Set flag which indicates that we have obtained controlling terminal. # Set flag which indicates that we have obtained controlling terminal.
export PID1_SHELL=true export PID1_SHELL=true