Changeset 2888


Ignore:
Timestamp:
Oct 11, 2011, 6:56:35 PM (8 years ago)
Author:
bruno
Message:
  • Try to Fix #499 by changing init in order to never exit, and rebooting using sysrq in /proc (not portable). Maybe should move to using a real init, and a separated rcS script.
  • Fixes the shell msg error by using setsid as per Busybox FAQ
Location:
branches/2.2.9
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2.9/mindi-busybox/.config

    r2831 r2888  
    11#
    22# Automatically generated make config: don't edit
    3 # Busybox version: 1.18.3-rPBREV
    4 # Sat Jun 11 21:02:21 2011
     3# Busybox version: 1.18.5-rPBREV
     4# Mon Oct 10 13:13:24 2011
    55#
    66CONFIG_HAVE_DOT_CONFIG=y
     
    582582CONFIG_SWAPONOFF=y
    583583CONFIG_FEATURE_SWAPON_PRI=y
    584 # CONFIG_SWITCH_ROOT is not set
     584CONFIG_SWITCH_ROOT=y
    585585CONFIG_UMOUNT=y
    586586CONFIG_FEATURE_UMOUNT_ALL=y
     
    691691# CONFIG_RUNLEVEL is not set
    692692# CONFIG_RX is not set
    693 # CONFIG_SETSID is not set
     693CONFIG_SETSID=y
    694694CONFIG_STRINGS=y
    695695# CONFIG_TASKSET is not set
  • branches/2.2.9/mindi/rootfs/sbin/init

    r2885 r2888  
    99CaughtSoftReset() {
    1010    trap SIGTERM
    11     reboot -f
     11    # Now kill all processes
     12    kill -TERM -1
     13    sync
     14    sleep 1
     15    kill -KILL -1
     16    sync
     17    # Try to umount what we can again
     18    umount -a -d -r 2> /dev/null
     19    # now reboot hard
     20    # This doesn't work nor does reboot
     21    # ctrlaltdel hard &
     22    # reboot -f
     23    echo s > /proc/sysrq-trigger
     24    echo u > /proc/sysrq-trigger
     25    echo b > /proc/sysrq-trigger
     26    # That script should never end
     27    while [ "1" == "1" ]; do
     28        sleep 10
     29    done
    1230}
    1331
     
    4765
    4866
     67GetShell() {
     68    echo -en "Type 'exit' to reboot the PC\n"
     69    umount -d /mnt/cdrom 2> /dev/null
     70    mount / -o rw,remount > /dev/null 2> /dev/null
     71    LogIt "Launching Shell"
     72    setsid sh -c 'exec sh </dev/tty1 >/dev/tty1 2>&1'
     73}
     74
    4975
    5076Die() {
    5177    LogIt "Fatal error! $1" 1
    52     exit 1
    53 }
    54 
     78    GetShell
     79}
    5580
    5681
     
    698723ExtractDataDisksAndLoadModules() {
    699724    LogIt "Installing additional tools ..." 1
     725    # BCO: test return value
    700726    install-additional-tools
    701727    # Keep the kernel silent again
     
    717743MINDI_REV=PBREV
    718744trap CaughtSoftReset SIGTERM
     745trap GetShell SIGINTR
    719746LOGFILE=/var/log/mondorestore.log
    720747PATH=/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/mondo:/usr/games
     
    963990    sleep 1
    964991else
    965     echo -en "Type 'exit' to reboot the PC\n"
    966     umount -d /mnt/cdrom 2> /dev/null
    967     mount / -o rw,remount > /dev/null 2> /dev/null
    968     LogIt "Launching Shell"
    969     sh
     992    GetShell
    970993fi
    971994CaughtSoftReset
    972 # reboot
  • branches/2.2.9/mindi/rootfs/sbin/install-additional-tools

    r2878 r2888  
    44#
    55########################################################################
    6 
    7 
    8 Die() {
    9     echo "Fatal error! $1" >> /dev/stderr
    10     exit 1
    11 }
    12 
    136
    147
Note: See TracChangeset for help on using the changeset viewer.