diff --git a/src/minimal_rootfs/etc/03_init.sh b/src/minimal_rootfs/etc/03_init.sh index 6e6f96ed8..7bdf5d04b 100755 --- a/src/minimal_rootfs/etc/03_init.sh +++ b/src/minimal_rootfs/etc/03_init.sh @@ -37,20 +37,8 @@ # # exec /sbin/init -# Set white color. -echo -en "\\e[1m" - -# Print message on screen. -cat << CEOF - - 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" +# Print first message on screen. +cat /etc/msg/03_init_01.txt # Wait 5 second or until any keybord key is pressed. read -t 5 -n1 -s key @@ -60,24 +48,8 @@ if [ "$key" = "" ] ; then echo "Executing /sbin/init as PID 1." exec /sbin/init else - # Set white color. - echo -en "\\e[1m" - - # Print message on screen. - cat << CEOF - This is PID 1 rescue shell outside of the initramfs area. Execute the - following in order to continue with the system initialization: - -CEOF - # Set green color. - echo -en "\\e[32m" - - cat << CEOF - exec /sbin/init - -CEOF - # Unset all attributes. - echo -en "\\e[0m" + # Print second message on screen. + cat /etc/msg/03_init_02.txt if [ "$PID1_SHELL" = "true" ] ; then # PID1_SHELL flag is set which means we have controlling terminal. diff --git a/src/minimal_rootfs/etc/inittab b/src/minimal_rootfs/etc/inittab index 7ffa3a87c..59135d948 100644 --- a/src/minimal_rootfs/etc/inittab +++ b/src/minimal_rootfs/etc/inittab @@ -7,12 +7,12 @@ ::shutdown:echo -e "\n \\e[1mSee you soon!\\e[0m\n" ::shutdown:sleep 1 ::ctrlaltdel:/sbin/reboot -::once:cat /etc/welcome.txt +::once:cat /etc/msg/welcome.txt ::respawn:/bin/cttyhack /bin/sh -tty2::once:cat /etc/welcome.txt +tty2::once:cat /etc/msg/welcome.txt tty2::respawn:/bin/sh -tty3::once:cat /etc/welcome.txt +tty3::once:cat /etc/msg/welcome.txt tty3::respawn:/bin/sh -tty4::once:cat /etc/welcome.txt +tty4::once:cat /etc/msg/welcome.txt tty4::respawn:/bin/sh diff --git a/src/minimal_rootfs/etc/msg/03_init_01.txt b/src/minimal_rootfs/etc/msg/03_init_01.txt new file mode 100644 index 000000000..5fa6a8191 --- /dev/null +++ b/src/minimal_rootfs/etc/msg/03_init_01.txt @@ -0,0 +1,5 @@ + + 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. + diff --git a/src/minimal_rootfs/etc/msg/03_init_02.txt b/src/minimal_rootfs/etc/msg/03_init_02.txt new file mode 100644 index 000000000..a22f8f1b7 --- /dev/null +++ b/src/minimal_rootfs/etc/msg/03_init_02.txt @@ -0,0 +1,5 @@ + This is PID 1 rescue shell outside of the initramfs area. Execute the + following in order to continue with the system initialization: + + exec /sbin/init + diff --git a/src/minimal_rootfs/etc/msg/init_01.txt b/src/minimal_rootfs/etc/msg/init_01.txt new file mode 100644 index 000000000..95601b827 --- /dev/null +++ b/src/minimal_rootfs/etc/msg/init_01.txt @@ -0,0 +1,5 @@ + + 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. + diff --git a/src/minimal_rootfs/etc/msg/init_02.txt b/src/minimal_rootfs/etc/msg/init_02.txt new file mode 100644 index 000000000..0906b0935 --- /dev/null +++ b/src/minimal_rootfs/etc/msg/init_02.txt @@ -0,0 +1,10 @@ + This is PID 1 rescue shell inside the initramfs area. Execute the following in + order to continue with the overlay initialization process: + + exec /etc/02_overlay.sh + + Execute the following in order to skip the overlay initialization and continue + directly with the system initialization: + + exec /sbin/init + diff --git a/src/minimal_rootfs/etc/welcome.txt b/src/minimal_rootfs/etc/msg/welcome.txt similarity index 100% rename from src/minimal_rootfs/etc/welcome.txt rename to src/minimal_rootfs/etc/msg/welcome.txt diff --git a/src/minimal_rootfs/init b/src/minimal_rootfs/init index 4f5cc2939..a62a81f7d 100755 --- a/src/minimal_rootfs/init +++ b/src/minimal_rootfs/init @@ -31,58 +31,15 @@ echo -e "Welcome to \\e[1mMinimal \\e[32mLinux \\e[31mLive\\e[0m (/init)" # Let's mount all core file systems. /etc/01_prepare.sh -# Set white color. -echo -en "\\e[1m" - -# Print message on screen. -cat << CEOF - - 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" +# Print first message on screen. +cat /etc/msg/init_01.txt # Wait 5 second or until any keybord key is pressed. read -t 5 -n1 -s key if [ ! "$key" = "" ] ; then - # Set white color. - echo -en "\\e[1m" - - # Print message on screen. - cat << CEOF - This is PID 1 rescue shell inside the initramfs area. Execute the following in - order to continue with the overlay initialization process: - -CEOF - # Set green color. - echo -en "\\e[32m" - - cat << CEOF - 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 - directly with the system initialization: - -CEOF - # Set green color. - echo -en "\\e[32m" - - cat << CEOF - exec /sbin/init - -CEOF - # Unset all attributes. - echo -en "\\e[0m" + # Print second message on screen. + cat /etc/msg/init_02.txt # Set flag which indicates that we have obtained controlling terminal. export PID1_SHELL=true