[prev in list] [next in list] [prev in thread] [next in thread] 

List:       busybox
Subject:    in initrd "exec sh  /dev/console 2>&1" does not respond to keyboard
From:       David Mathog <mathog () caltech ! edu>
Date:       2019-02-27 18:58:26
Message-ID: c15e0398236a0b3018f602cbbdc178b3 () saf ! bio ! caltech ! edu
[Download RAW message or body]

First time here, greetings all.

For many years I used a part of SystemImager called "BOEL" to run a 
small initrd.img
which was in turn used to clone machines over the network.  It was 32 
bit 2.6.x kernel, and wrapped around busybox.  Lately I have been trying 
to get a 64bit version of this, or something like it working.  
Unfortunately starting with this:

   systemimager-x86_64boot-standard-4.0.2-1.noarch.rpm

from here:

   
https://sourceforge.net/projects/systemimager/files/systemimager/4.0.2/

When a script does "shellout" (which is a function defined during init) 
there was no response to the keyboard.  This is that function:

shellout() {
     COUNT="$RETRY"
     logmsg "Killing off running processes."
     kill -9 $TMPFS_WATCHER_PID  >/dev/null 2>/dev/null
     killall -9 udp-receiver rsync  >/dev/null 2>/dev/null
     write_variables
     cat /etc/issue
     if [ ! -z $USELOGGER ] ;
         then cat /etc/issue | logger
     fi
     if [ ! -z $MONITOR_SERVER ]; then
     	logmsg "Installation failed!! Stopping report task."
         stop_report_task -1
     fi
     exec sh > /dev/console 2>&1
}

I think only the exec line is relevant here.


So I rebuilt boel (64 bit) from the ground up using binaries from Centos 
7,
a freshly compiled kernel 3.10.108 and current version of busybox (both 
64 bit).  This variant uses mdev to populate /dev.  All of this stuff 
seems to work fine in chroot under Centos 7.  However, when busybox runs 
in the initrd.img the same problem is seen - shellout() does not respond 
to the keyboard.

Not having any terminal control, or any place to write temporary 
results, all I have been able to do is watch messages scroll by on the 
screen.  It does look like /dev
is populated with a bunch of tty and other stuff.  (/dev/sd* does not 
appear, but that is probably because a particular driver needs to be 
loaded.)

Note that

echo "test1" >/dev/console 2>&1
echo "test2" >/dev/console 2>&1
echo "sleep 5"; sleep 5

emits only "sleep 5", so it doesn't look like busybox can write to 
/dev/console.
However if "ls -al /dev/console" is placed in a script that file exists.

Anybody know what this might be???  It seems to be either a 64bit issue, 
or more likely, something about 3.x.x linux kernels that is tripping up 
the exec sh.  There is no "console" related kernel parameter passed when 
the system boots.  There is
also no "exec" as a separate binary or link to busybox, but I assume it 
is built in.

Thank you,

David Mathog
mathog@caltech.edu
Manager, Sequence Analysis Facility, Biology Division, Caltech
_______________________________________________
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic