mkinitcpio hooks that print the word "Welcome" in big letters and draw a box for inputting an encryption password and catching the fsck output during early userspace. See blog post for a video: https://mcol.xyz/2020/06/ricing-early-userspace.html
git clone https://github.com/m-col/mkinitcpio-welcome
Files | Refs | Readme

Commit c8b3119a8699d94cb86c779595322fb2b89cd06e
Parent: e1f548fbc48a28db86e9f114347d7788271edee6
Author: mcol <mcol@posteo.net>
Date: 2020-06-29 19:33:00 +0100
Committer: mcol <mcol@posteo.net>
Committed: 2020-06-29 19:33:00 +0100

move user configuration to /etc/vconsole.conf

install/welcome Modified

@@ -1,11 +1,27 @@
 #!/bin/bash
 
 build() {
-    add_runscript
+    (
+	WELCOME_FG=5
+	WELCOME_BG=0
+	WELCOME_IN=4
+
+        [[ -s /etc/vconsole.conf ]] && . /etc/vconsole.conf
+
+	is_int() { [[ $1 =~ ^-?[0-9]+$ ]] }
+	is_int $WELCOME_FG || error "welcome: WELCOME_FG should be an integer" && exit 1
+	is_int $WELCOME_BG || error "welcome: WELCOME_BG should be an integer" && exit 1
+	is_int $WELCOME_IN || error "welcome: WELCOME_IN should be an integer" && exit 1
+
+	echo "WELCOME_FG=$WELCOME_FG" >> "$BUILDROOT/welcome"
+	echo "WELCOME_BG=$WELCOME_BG" >> "$BUILDROOT/welcome"
+	echo "WELCOME_IN=$WELCOME_IN" >> "$BUILDROOT/welcome"
+    ) &&  add_runscript
 }
 
 help() {
     cat <<HELPEOF
-Sets up console appearance before asking for passphrase
+Prints the word "Welcome" in large letters and draws a box around the input for
+the encrypt hook and output of the fsck hook.
 HELPEOF
 }

hooks/welcome Modified

@@ -1,28 +1,21 @@
 #!/usr/bin/ash
 
 
-# # # # # # # USER SETTINGS
-
-# These should be a number from 0 to 15
-
-BACKGROUND=0
-WELCOME=5
-INPUTBOX=4
-
-# # # # # # # # # # # # # #
-
-
-run_hook() {
-    bk="\x1b[48;5;${BACKGROUND}m"
-    we="\x1b[48;5;${WELCOME}m"
-    in="\x1b[48;5;${INPUTBOX}m"
-
+draw_welcome() {
+    # user-defined colours
+    . /welcome
+    we="\x1b[48;5;${WELCOME_FG}m"
+    bk="\x1b[48;5;${WELCOME_BG}m"
+    in="\x1b[48;5;${WELCOME_IN}m"
+
+    # drawing tools
     p="$we  $bk"  		# single pixel
     s="$we  "	    		# start pixel row
     e="  $bk"	    		# end pixel row
     non="\x1b[0m"		# reset all settings
     fill="\033[K"   		# fill to end of line
 
+    # draw "Welcome"
     echo -e "$b14\n$fill\n$fill\n$fill\n$fill\n$fill\n$fill\n$fill\n$fill\n$fill\n$fill\n$fill\n$fill\n$fill\n$fill\n$fill\n$fill"
     echo -e "                                                                                                  $s$e$fill"
     echo -e "                                                                   $p          $p                   $p$fill"
@@ -34,11 +27,27 @@
     echo -e "                                                                   $p  $p  $p  $p  $p               $p          $p        $p    $p        $p    $p    $p    $p  $p$fill"
     echo -e "                                                                   $s$e      $s$e    $s      $e       $s  $e      $s    $e        $s    $e      $p    $p    $p    $s      $e$fill"
     echo -e "$fill\n$fill\n$fill\n$fill"
-    echo -e "                                                                                             $in                                                      $bk$fill"
-    echo -e "                                                                                             $in  $bk                                                  $in  $bk$fill"
-    echo -e "                                                                                             $in                                                      $bk$fill"
-    echo -e "$fill\n$fill\n$fill\n$fill\n$fill\n$fill\n$fill\n$fill\n$fill\n$fill\n$fill\n$fill\n$fill\n$fill\n$fill\n$fill\n$fill\n$fill\n$fill\n$fill\n$fill\n$fill\n$fill\n$fill\n$fill\n$fill\n$fill\n$fill\n$fill\n$fill\n$fill\n$fill\n$fill"
 
-    # move cursor to input box
-    echo -ne "\x1b[32;96H"
+    # draw input box
+    echo -e "                                                                              $in                                                                                   $bk$fill"
+    echo -e "                                                                              $in  $bk                                                                               $in  $bk$fill"
+    echo -e "                                                                              $in  $bk                                                                               $in  $bk$fill"
+    echo -e "                                                                              $in                                                                                   $bk$fill"
+
+    # fill rest of screen
+    echo -e "$fill\n$fill\n$fill\n$fill\n$fill\n$fill\n$fill\n$fill\n$fill\n$fill\n$fill\n$fill\n$fill\n$fill\n$fill\n$fill"
+    echo -e "$fill\n$fill\n$fill\n$fill\n$fill\n$fill\n$fill\n$fill\n$fill\n$fill\n$fill\n$fill\n$fill\n$fill\n$fill\n$fill"
+
+    # move cursor into inpux box
+    echo -ne "\x1b[32;81H"
+}
+
+
+run_hook() {
+    if [ -e /welcome ]
+    then
+	draw_welcome
+    else
+	msg "/welcome not found despite added hook."
+    fi
 }