Ignore:
Timestamp:
02/22/2015 09:50:39 PM (9 years ago)
Author:
Bruce Dubbs <bdubbs@…>
Branches:
10.0, 10.0-rc1, 10.1, 10.1-rc1, 11.0, 11.0-rc1, 11.0-rc2, 11.0-rc3, 11.1, 11.1-rc1, 11.2, 11.2-rc1, 11.3, 11.3-rc1, 12.0, 12.0-rc1, 12.1, 12.1-rc1, 7.7, 7.8, 7.9, 8.0, 8.1, 8.2, 8.3, 8.4, 9.0, 9.1, arm, bdubbs/gcc13, ml-11.0, multilib, renodr/libudev-from-systemd, s6-init, trunk, xry111/arm64, xry111/arm64-12.0, xry111/clfs-ng, xry111/lfs-next, xry111/loongarch, xry111/loongarch-12.0, xry111/loongarch-12.1, xry111/mips64el, xry111/pip3, xry111/rust-wip-20221008, xry111/update-glibc
Children:
9ee0e52a
Parents:
eb8b1c5
Message:

Cosmetic changes to output messages by network boot scripts.

git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@10858 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689

File:
1 edited

Legend:

Unmodified
Added
Removed
  • bootscripts/lfs/lib/services/init-functions

    reb8b1c5 rb7804ae  
    2424export PATH="/bin:/usr/bin:/sbin:/usr/sbin"
    2525
    26 ## Screen Dimensions
    27 # Find current screen size
    28 if [ -z "${COLUMNS}" ]; then
    29    COLUMNS=$(stty size)
    30    COLUMNS=${COLUMNS##* }
    31 fi
    32 
    33 # When using remote connections, such as a serial port, stty size returns 0
    34 if [ "${COLUMNS}" = "0" ]; then
    35    COLUMNS=80
    36 fi
    37 
    38 ## Measurements for positioning result messages
    39 COL=$((${COLUMNS} - 8))
    40 WCOL=$((${COL} - 2))
    41 
    42 ## Set Cursor Position Commands, used via echo
    43 SET_COL="\\033[${COL}G"      # at the $COL char
    44 SET_WCOL="\\033[${WCOL}G"    # at the $WCOL char
    45 CURS_UP="\\033[1A\\033[0G"   # Up one line, at the 0'th char
    46 CURS_ZERO="\\033[0G"
    47 
    4826## Set color commands, used via echo
    4927# Please consult `man console_codes for more information
     
    6745FAILURE_PREFIX="${FAILURE}*****${NORMAL}"
    6846WARNING_PREFIX="${WARNING} *** ${NORMAL}"
     47SKIP_PREFIX="${INFO}  S  ${NORMAL}"
    6948
    7049SUCCESS_SUFFIX="${BRACKET}[${SUCCESS}  OK  ${BRACKET}]${NORMAL}"
    7150FAILURE_SUFFIX="${BRACKET}[${FAILURE} FAIL ${BRACKET}]${NORMAL}"
    7251WARNING_SUFFIX="${BRACKET}[${WARNING} WARN ${BRACKET}]${NORMAL}"
     52SKIP_SUFFIX="${BRACKET}[${INFO} SKIP ${BRACKET}]${NORMAL}"
    7353
    7454BOOTLOG=/run/bootlog
     
    7757# Set any user specified environment variables e.g. HEADLESS
    7858[ -r /etc/sysconfig/rc.site ]  && . /etc/sysconfig/rc.site
     59
     60## Screen Dimensions
     61# Find current screen size
     62if [ -z "${COLUMNS}" ]; then
     63   COLUMNS=$(stty size)
     64   COLUMNS=${COLUMNS##* }
     65fi
     66
     67# When using remote connections, such as a serial port, stty size returns 0
     68if [ "${COLUMNS}" = "0" ]; then
     69   COLUMNS=80
     70fi
     71
     72## Measurements for positioning result messages
     73COL=$((${COLUMNS} - 8))
     74WCOL=$((${COL} - 2))
     75
     76## Set Cursor Position Commands, used via echo
     77SET_COL="\\033[${COL}G"      # at the $COL char
     78SET_WCOL="\\033[${WCOL}G"    # at the $WCOL char
     79CURS_UP="\\033[1A\\033[0G"   # Up one line, at the 0'th char
     80CURS_ZERO="\\033[0G"
    7981
    8082################################################################################
     
    646648}
    647649
     650log_skip_msg()
     651{
     652    /bin/echo -n -e "${BMPREFIX}${@}"
     653    /bin/echo -e "${CURS_ZERO}${SKIP_PREFIX}${SET_COL}${SKIP_SUFFIX}"
     654
     655    # Strip non-printable characters from log file
     656    logmessage=`echo "${@}" | sed 's/\\\033[^a-zA-Z]*.//g'`
     657    /bin/echo "SKIP" >> ${BOOTLOG}
     658   
     659    return 0
     660}
     661
    648662################################################################################
    649663# log_info_msg()                                                               #
Note: See TracChangeset for help on using the changeset viewer.