Changeset 7930

Show
Ignore:
Timestamp:
02/22/07 15:41:03 (2 years ago)
Author:
dnicholson
Message:

POSIX shells don't trap on ERR

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/bootscripts/ChangeLog

    r7929 r7930  
     12007-02-22      Dan Nicholson   <dnicholson@linuxfromscratch.org> 
     2        * lfs/init.d/console: POSIX says that shells only need to trap on 
     3          signals. Trapping on ERR isn't always supported. Conditionals have 
     4          been added to set the $failed variable in spots that seemed 
     5          appropriate for checking errors. 
     6 
    172007-02-22      Dan Nicholson   <dnicholson@linuxfromscratch.org> 
    28        * lfs/init.d/functions: Use arithmetic expansion and string length, 
  • trunk/bootscripts/lfs/init.d/console

    r7928 r7930  
    3030 
    3131failed=0 
    32 trap failed=1 ERR 
    3332 
    3433case "${1}" in 
     
    6463                do 
    6564                        openvt -f -w -c ${TTY#tty} -- \ 
    66                                 /bin/sh -c "${MODE_COMMAND}" 
     65                                /bin/sh -c "${MODE_COMMAND}" || failed=1 
    6766                done 
    6867 
    6968                # Set the font (if not already set above) and the keymap 
    70                 is_true "${USE_FB}" ||  [ -z "${FONT}" ] || setfont $FONT 
    71                 [ -z "${KEYMAP}" ] || loadkeys ${KEYMAP} &>/dev/null 
     69                is_true "${USE_FB}" || [ -z "${FONT}" ] || 
     70                        setfont $FONT || 
     71                        failed=1 
     72                [ -z "${KEYMAP}" ] || 
     73                        loadkeys ${KEYMAP} &>/dev/null || 
     74                        failed=1 
    7275                [ -z "${KEYMAP_CORRECTIONS}" ] || 
    73                         loadkeys ${KEYMAP_CORRECTIONS} &>/dev/null 
     76                        loadkeys ${KEYMAP_CORRECTIONS} &>/dev/null || 
     77                        failed=1 
    7478 
    7579                # Linux kernel generates wrong bytes when composing 
     
    8387                [ -n "$BROKEN_COMPOSE" ] || BROKEN_COMPOSE="$UNICODE" 
    8488                ! is_true "$BROKEN_COMPOSE" || 
    85                         echo "" | loadkeys -c &>/dev/null 
     89                        echo "" | loadkeys -c &>/dev/null || 
     90                        failed=1 
    8691                 
    8792                # Convert the keymap from $LEGACY_CHARSET to UTF-8 
    8893                [ -z "$LEGACY_CHARSET" ] || 
    89                         dumpkeys -c "$LEGACY_CHARSET" | loadkeys -u &>/dev/null 
     94                        dumpkeys -c "$LEGACY_CHARSET" | 
     95                        loadkeys -u &>/dev/null || 
     96                        failed=1 
    9097 
    9198                # If any of the commands above failed, the trap at the