Changeset 3051 in MondoRescue for branches/3.0/mindi/rootfs/etc/init.d/rcS


Ignore:
Timestamp:
Oct 19, 2012, 3:16:17 AM (12 years ago)
Author:
Bruno Cornec
Message:
  • Fix #649 by adding serial port detection in GetShell function which was harcoding the tty to use (Matthew Ross). Also update mindi's doc.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3.0/mindi/rootfs/etc/init.d/rcS

    r3035 r3051  
    5353    mount / -o rw,remount > /dev/null 2> /dev/null
    5454    LogIt "Launching Shell"
    55     setsid sh -c 'exec sh </dev/tty1 >/dev/tty1 2>&1'
     55    for i in `cat /proc/cmdline`; do
     56        echo $i | grep -qi console= && console=`echo $i | cut -d= -f2`
     57        echo $i | grep -qi serial= && serial=`echo $i | cut -d= -f2`
     58    done
     59    LogIt "Launching Shell"
     60    if [[ $serial != "" && -e $serial ]]; then
     61        setsid sh -c "exec sh <$serial >$serial 2>&1"
     62    elif [[ $console != "" && -e $console ]]; then
     63        setsid sh -c "exec sh <$console >$console 2>&1"
     64    else
     65        setsid sh -c "exec sh </dev/tty1 >/dev/tty1 2>&1"
     66    fi
    5667}
    5768
Note: See TracChangeset for help on using the changeset viewer.