Find the answer to your Linux question:
Results 1 to 2 of 2
Hi, I have a target board having linux(Not GUI), which boots up and doesn't give me a bash prompt. So to get a bash terminal, I always need to telnet ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Feb 2011
    Posts
    1

    How to start the terminal from rc.sysinit scripts


    Hi,

    I have a target board having linux(Not GUI), which boots up and doesn't give me a bash prompt. So to get a bash terminal, I always need to telnet to it. (It is starting a telnet server during bootup) Please let me know how to get the terminal in the same window where it boots. In otherwords, once the rc.sysinit completes, I need to have a bash terminal there.

    The target board is connected to an other machine through serial port. I boot up the target board by giving the boot command through minicom.

    Thanks

  2. #2
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Posts
    11,655
    Assuming it has an RS-232 port that you want to use as a console, then in the startup script you need to enable the port for console operations. A lot of these boards that run Linux are hardwired to use a specific serial port for console operations. For example on my Debian ARM board, the linuxrc script looks like this:
    Code:
    #!/bin/sh
    # Copyright (c) 2007, Technologic Systems.
    # Copyright (c) 2010, Application Frameworks and Systems, Inc.
    # All rights reserved.
    #
    # Checks for nfsboot file. If found, links /mnt/root to nfs share.
    # If no nfsboot found, links /mnt/root to sdcard partition #4.
    # symlink to /linuxrc and run "save" to use
    
    export PATH=/bin:/sbin:/lbin:/mnt/root/bin:/mnt/root/sbin:/mnt/root/usr/bin:/mnt/root/usr/sbin:/mnt/root/usr/local/bin:/mnt/root/usr/local/sbin
    export LD_LIBRARY_PATH=/lib:/usr/lib
    export CONSOLE=/dev/ttyAM1
    
    mount -t proc none /proc
    mount -t sysfs none /sys
    mount -t tmpfs none /dev
    mdev -s
    mkdir /dev/pts /dev/shm
    mount -t devpts none /dev/pts
    mount -t tmpfs none /dev/shm
    
    setconsole $CONSOLE
    stty -F $CONSOLE ospeed 115200 > /dev/null 2>&1
    hostname ts7000
    .
    .
    .
    So, I can have my laptop/workstation connected to the appropriate serial port on the target board, and as soon as it gets into the startup script, the console is redirected to the correct port and I can use it to see the rest of the boot process and use it to login and build/run stuff directly on the board.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •