Added ANSI escape codes for some messages. This works both in standard and graphics modes.
This commit is contained in:
parent
a9b550a4a1
commit
0c8b4e3502
@ -116,5 +116,10 @@ COPY_SOURCE_ISO=true
|
||||
# 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
|
||||
# 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
|
||||
|
||||
|
@ -42,10 +42,19 @@ else
|
||||
# Step 2 - enable the 'xz' compression option.
|
||||
sed -i "s/.*CONFIG_KERNEL_XZ.*/CONFIG_KERNEL_XZ=y/" .config
|
||||
|
||||
#sed -i "s/.*CONFIG_DRM_CIRRUS_QEMU.*/CONFIG_DRM_CIRRUS_QEMU=y/" .config
|
||||
#sed -i "s/.*CONFIG_DRM_BOCHS.*/CONFIG_DRM_BOCHS=y/" .config
|
||||
#sed -i "s/.*CONFIG_FB_CIRRUS.*/CONFIG_FB_CIRRUS=y/" .config
|
||||
# Enable the VESA framebuffer for graphics support.
|
||||
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
|
||||
|
||||
# Compile the kernel with optimization for 'parallel jobs' = 'number of processors'.
|
||||
|
@ -37,15 +37,21 @@
|
||||
#
|
||||
# exec /sbin/init
|
||||
|
||||
# Set cyan color.
|
||||
echo -en "\\e[36m"
|
||||
|
||||
# Print message on screen.
|
||||
cat << CEOF
|
||||
|
||||
Press empty key (ESC, TAB, SPACE, ENTER) or wait 5 seconds to continue with
|
||||
the system initialization process. Press any other key for PID 1 rescue shell
|
||||
Press empty key (TAB, SPACE, ENTER) or wait 5 seconds to continue with the
|
||||
system initialization process. Press any other key for PID 1 rescue shell
|
||||
outside of the initramfs area.
|
||||
|
||||
CEOF
|
||||
|
||||
# Unset all attributes.
|
||||
echo -en "\\e[0m"
|
||||
|
||||
# Wait 5 second or until any keybord key is pressed.
|
||||
read -t 5 -n1 -s key
|
||||
|
||||
|
@ -26,7 +26,7 @@
|
||||
# |
|
||||
# +--(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
|
||||
echo "Found network device ${DEVICE##*/}"
|
||||
|
@ -1,11 +1,13 @@
|
||||
::sysinit:/etc/04_bootscript.sh
|
||||
::restart:/sbin/init
|
||||
::shutdown:echo "Sync file buffers..."
|
||||
::shutdown:echo -e "\n\\e[35mSync all file buffers...\\e[0m"
|
||||
::shutdown:sync
|
||||
::shutdown:echo "Unmount all filesystems..."
|
||||
::shutdown:echo -e "\\e[35mUnmount all filesystems...\\e[0m"
|
||||
::shutdown:umount -a -r
|
||||
::shutdown:echo -e "\n\\e[32mSee you soon! :)\\e[0m\n"
|
||||
::shutdown:sleep 1
|
||||
::ctrlaltdel:/sbin/reboot
|
||||
::once:cat /etc/welcome.txt
|
||||
::once:/etc/welcome.sh 32
|
||||
::respawn:/bin/cttyhack /bin/sh
|
||||
tty2::once:cat /etc/welcome.txt
|
||||
tty2::respawn:/bin/sh
|
||||
|
10
src/minimal_rootfs/etc/welcome.sh
Executable file
10
src/minimal_rootfs/etc/welcome.sh
Executable 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"
|
||||
|
@ -26,20 +26,27 @@
|
||||
# |
|
||||
# +--(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.
|
||||
/etc/01_prepare.sh
|
||||
|
||||
# Set cyan color.
|
||||
echo -en "\\e[36m"
|
||||
|
||||
# Print message on screen.
|
||||
cat << CEOF
|
||||
|
||||
Press empty key (ESC, TAB, SPACE, ENTER) or wait 5 seconds to continue with
|
||||
the overlay initialization process. Press any other key for PID 1 rescue shell
|
||||
Press empty key (TAB, SPACE, ENTER) or wait 5 seconds to continue with the
|
||||
overlay initialization process. Press any other key for PID 1 rescue shell
|
||||
inside the initramfs area.
|
||||
|
||||
CEOF
|
||||
|
||||
# Unset all attributes.
|
||||
echo -en "\\e[0m"
|
||||
|
||||
|
||||
# Wait 5 second or until any keybord key is pressed.
|
||||
read -t 5 -n1 -s key
|
||||
|
||||
|
@ -9,7 +9,7 @@
|
||||
|
||||
if [ "$1" = "-hdd" -o "$1" = "-h" ] ; then
|
||||
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
|
||||
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
|
||||
|
@ -9,9 +9,9 @@
|
||||
|
||||
if [ "$1" = "-hdd" -o "$1" = "-h" ] ; then
|
||||
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
|
||||
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
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user