Added ANSI escape codes for some messages. This works both in standard and graphics modes.

This commit is contained in:
Ivan Davidov 2016-05-10 23:56:25 +03:00
parent a9b550a4a1
commit 0c8b4e3502
9 changed files with 55 additions and 16 deletions

View File

@ -116,5 +116,10 @@ COPY_SOURCE_ISO=true
# requires more than 1MB free space. The solution is to use folder overlay or to # requires more than 1MB free space. The solution is to use folder overlay or to
# edit the script 'xx_generate_iso.sh' and set it to create sparse image file # edit the script 'xx_generate_iso.sh' and set it to create sparse image file
# with bigger size. # with bigger size.
BUILD_OVERLAY_SOFTWARE=true BUILD_OVERLAY_SOFTWARE=false
# This property enables the standard penguin boot logo in the upper left corner
# of the screen. The property is used in 'xx_build_kernel.sh'. The default value
# is 'true' for demonstration purposes.
USE_BOOT_LOGO=true

View File

@ -42,10 +42,19 @@ else
# Step 2 - enable the 'xz' compression option. # Step 2 - enable the 'xz' compression option.
sed -i "s/.*CONFIG_KERNEL_XZ.*/CONFIG_KERNEL_XZ=y/" .config sed -i "s/.*CONFIG_KERNEL_XZ.*/CONFIG_KERNEL_XZ=y/" .config
#sed -i "s/.*CONFIG_DRM_CIRRUS_QEMU.*/CONFIG_DRM_CIRRUS_QEMU=y/" .config # Enable the VESA framebuffer for graphics support.
#sed -i "s/.*CONFIG_DRM_BOCHS.*/CONFIG_DRM_BOCHS=y/" .config
#sed -i "s/.*CONFIG_FB_CIRRUS.*/CONFIG_FB_CIRRUS=y/" .config
sed -i "s/.*CONFIG_FB_VESA.*/CONFIG_FB_VESA=y/" .config sed -i "s/.*CONFIG_FB_VESA.*/CONFIG_FB_VESA=y/" .config
# Read the 'USE_BOOT_LOGO' property from '.config'
USE_BOOT_LOGO="$(grep -i USE_BOOT_LOGO $SRC_DIR/.config | cut -f2 -d'=')"
if [ "$USE_BOOT_LOGO" = "true" ] ; then
sed -i "s/.*CONFIG_LOGO_LINUX_CLUT224.*/CONFIG_LOGO_LINUX_CLUT224=y/" .config
echo "Boot logo is enabled."
else
sed -i "s/.*CONFIG_LOGO_LINUX_CLUT224.*/\\# CONFIG_LOGO_LINUX_CLUT224 is not set/" .config
echo "Boot logo is disabled."
fi
fi fi
# Compile the kernel with optimization for 'parallel jobs' = 'number of processors'. # Compile the kernel with optimization for 'parallel jobs' = 'number of processors'.

View File

@ -37,15 +37,21 @@
# #
# exec /sbin/init # exec /sbin/init
# Set cyan color.
echo -en "\\e[36m"
# Print message on screen. # Print message on screen.
cat << CEOF cat << CEOF
Press empty key (ESC, TAB, SPACE, ENTER) or wait 5 seconds to continue with Press empty key (TAB, SPACE, ENTER) or wait 5 seconds to continue with the
the system initialization process. Press any other key for PID 1 rescue shell system initialization process. Press any other key for PID 1 rescue shell
outside of the initramfs area. outside of the initramfs area.
CEOF CEOF
# Unset all attributes.
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

View File

@ -26,7 +26,7 @@
# | # |
# +--(2) /bin/sh (Alt + F4) # +--(2) /bin/sh (Alt + F4)
echo "Welcome to \"Minimal Linux Live\" (/sbin/init)" echo -e "\\e[32mWelcome to \"Minimal Linux Live\" \\e[35m(/sbin/init)\\e[0m"
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,11 +1,13 @@
::sysinit:/etc/04_bootscript.sh ::sysinit:/etc/04_bootscript.sh
::restart:/sbin/init ::restart:/sbin/init
::shutdown:echo "Sync file buffers..." ::shutdown:echo -e "\n\\e[35mSync all file buffers...\\e[0m"
::shutdown:sync ::shutdown:sync
::shutdown:echo "Unmount all filesystems..." ::shutdown:echo -e "\\e[35mUnmount all filesystems...\\e[0m"
::shutdown:umount -a -r ::shutdown:umount -a -r
::shutdown:echo -e "\n\\e[32mSee you soon! :)\\e[0m\n"
::shutdown:sleep 1
::ctrlaltdel:/sbin/reboot ::ctrlaltdel:/sbin/reboot
::once:cat /etc/welcome.txt ::once:/etc/welcome.sh 32
::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

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

View File

@ -26,20 +26,27 @@
# | # |
# +--(2) /bin/sh (Alt + F4) # +--(2) /bin/sh (Alt + F4)
echo "Welcome to \"Minimal Linux Live\" (/init)" echo -e "\\e[32mWelcome to \"Minimal Linux Live\" \\e[35m(/init)\\e[0m"
# 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.
echo -en "\\e[36m"
# Print message on screen. # Print message on screen.
cat << CEOF cat << CEOF
Press empty key (ESC, TAB, SPACE, ENTER) or wait 5 seconds to continue with Press empty key (TAB, SPACE, ENTER) or wait 5 seconds to continue with the
the overlay initialization process. Press any other key for PID 1 rescue shell overlay initialization process. Press any other key for PID 1 rescue shell
inside the initramfs area. inside the initramfs area.
CEOF CEOF
# Unset all attributes.
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

View File

@ -9,7 +9,7 @@
if [ "$1" = "-hdd" -o "$1" = "-h" ] ; then if [ "$1" = "-hdd" -o "$1" = "-h" ] ; then
echo "Starting QEMU with attached ISO image and hard disk." echo "Starting QEMU with attached ISO image and hard disk."
qemu-system-i386 -m 64M -cdrom minimal_linux_live.iso -hda hdd.img -boot d qemu-system-i386 -m 64M -cdrom minimal_linux_live.iso -hda hdd.img -boot d -vga std
else else
echo "Starting QEMU with attached ISO image and no hard disk." echo "Starting QEMU with attached ISO image and no hard disk."
qemu-system-i386 -m 64M -cdrom minimal_linux_live.iso -boot d -vga std qemu-system-i386 -m 64M -cdrom minimal_linux_live.iso -boot d -vga std

View File

@ -9,9 +9,9 @@
if [ "$1" = "-hdd" -o "$1" = "-h" ] ; then if [ "$1" = "-hdd" -o "$1" = "-h" ] ; then
echo "Starting QEMU with attached ISO image and hard disk." echo "Starting QEMU with attached ISO image and hard disk."
qemu-system-x86_64 -m 64M -cdrom minimal_linux_live.iso -hda hdd.img -boot d qemu-system-x86_64 -m 64M -cdrom minimal_linux_live.iso -hda hdd.img -boot d -vga std
else else
echo "Starting QEMU with attached ISO image." echo "Starting QEMU with attached ISO image."
qemu-system-x86_64 -m 64M -cdrom minimal_linux_live.iso -boot d qemu-system-x86_64 -m 64M -cdrom minimal_linux_live.iso -boot d -vga std
fi fi