##################################################################################
# File...: /root/.profile
# Status : Local Slackware ARM addition - not required for x86.
# Purpose: Within the Slackware Installer, display the initial setup instructions
#          when the user activates the local consoles.  By default /etc/{issue,motd}
#          will be displayed only over the serial console, but if the user doesn't
#          have a serial adaptor (only installing via the console), they'll never
#          see these initial setup instructions.
# Author : Stuart Winter <mozes@slackware.com>
# Date...: 30-May-2021
##################################################################################

export PATH=/usr/sbin:$PATH

# Display the instructions once whenever any of the local consoles are activated:
( tty | grep -Eq '^/dev/tty[0-9]' ) && {

   # Offer to load a key map once on the local console:
   # (this code was copied from /etc/rc.d/rc.S)
   [ ! -f /.keymapset ] && {
      echo
      echo
      echo "<OPTION TO LOAD SUPPORT FOR NON-US KEYBOARD>"
      echo
      echo "If you are not using a US keyboard, you may now load a different"
      echo "keyboard map. To select a different keyboard map, please enter 1"
      echo "now. To continue using the US map, just hit enter."
      echo
      echo -n "Enter 1 to select a keyboard map: "
      read ONE
      if [ "$ONE" = "1" ]; then
         /usr/lib/setup/SeTkeymap
      fi
      clear
      # Set flag to bypass on any other local activations:
      touch /.keymapset ;}

   cat /etc/{issue,motd} ;}
