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

-rw-r--r-- hooks/welcome


      1 #!/usr/bin/ash
      2 
      3 
      4 run_hook() {
      5     # user-defined colours
      6     . /welcome
      7     we="\x1b[48;5;${WELCOME_FG}m"
      8     in="\x1b[48;5;${WELCOME_IN}m"
      9 
     10     # drawing tools
     11     bk="\x1b[0m"		# reset settings
     12     p="$we  $bk"  		# single pixel
     13     s="$we  "	    		# start pixel row
     14     e="  $bk"	    		# end pixel row
     15     fill="\033[K"   		# fill to end of line
     16 
     17     # draw "Welcome"
     18     echo -e "\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"
     19     echo -e "                                                                                                  $s$e$fill"
     20     echo -e "                                                                   $p          $p                   $p$fill"
     21     echo -e "                                                                   $p          $p                   $p$fill"
     22     echo -e "                                                                   $p          $p    $s    $e       $p            $s    $e        $s    $e      $s  $e  $s$e      $s    $e$fill"
     23     echo -e "                                                                   $p    $p    $p  $p        $p     $p          $p        $p    $p        $p    $p    $p    $p  $p        $p$fill"
     24     echo -e "                                                                   $p    $p    $p  $s        $e     $p          $p              $p        $p    $p    $p    $p  $s        $e$fill"
     25     echo -e "                                                                   $p    $p    $p  $p               $p          $p              $p        $p    $p    $p    $p  $p$fill"
     26     echo -e "                                                                   $p  $p  $p  $p  $p               $p          $p        $p    $p        $p    $p    $p    $p  $p$fill"
     27     echo -e "                                                                   $s$e      $s$e    $s      $e       $s  $e      $s    $e        $s    $e      $p    $p    $p    $s      $e$fill"
     28     echo -e "$fill\n$fill\n$fill\n$fill"
     29 
     30     # draw input box
     31     echo -e "                                                                              $in                                                                                   $bk$fill"
     32     echo -e "                                                                              $in  $bk                                                                               $in  $bk$fill"
     33     echo -e "                                                                              $in  $bk                                                                               $in  $bk$fill"
     34     echo -e "                                                                              $in                                                                                   $bk$fill"
     35 
     36     # fill rest of screen
     37     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"
     38     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"
     39 
     40     # decrypt
     41     echo -ne "\x1b[32;81H"
     42     (
     43 	. /welcome-decrypt
     44 	run_hook
     45     )
     46     echo -ne "\x1b[33;81H"
     47 }
     48