Console Redirection After Boot
eclark
eclark at alabanza.com
Wed Nov 1 08:37:01 CST 2006
Heres one! How do you stop console re-redirection from happeing _during_ boot?
I have in the past needed to grab the boot sequence from a serial console,
but once the linux kernel kicks on, I completely loose serial console. Is
there any way to force serial console redirection in the kernel, so I can log
boot sequences? It gets a bit old having to continuously reboot to stare at
scrolling messages when you are trying to do kernel testing.
On Wednesday 01 November 2006 08:36 am, Gary Rogers wrote:
> Here's the script I use to get the console re-directed to the DRAC4
> in my x850's (RHEL4). You'll need the OpenManage tools for it to
> work, and I'd suggest that you set your grub.conf your self. You
> really need to look out for the DRAC virtual CD-ROM as well, as this
> script WILL hang the system if you don't have the ide-scsi lines in
> grub.conf so that it's safe to disconnect the virtual CD-ROM.
>
> Works pretty well though, especially when ssh-ing to the DRAC and
> connecting to com1.
>
> #!/bin/bash
>
> set_securetty() {
> cd /etc
> backup_file securetty
> echo "ttyS0" >> /etc/securetty
> }
>
> set_inittab() {
> cd /etc
> backup_file inittab
> echo "co:2345:respawn:/sbin/agetty -h -L 57600 ttyS0 vt100"
>
> >> /etc/inittab
>
> }
>
> set_grub() {
> cat /boot/grub/grub.conf | perl -e '{ $value = join
> "",<STDIN>; $value =~ s/splashimage=\(hd0,0\)\/boot\/grub\/
> splash.xpm.gz/#splashimage=\(hd0,0\)\/boot\/grub\/splash.xpm.gz
> \nserial --unit=0 --speed=57600\nterminal --timeout=5 console serial/
> g; $value =~ s/root=LABEL=\//root=LABEL=\/ console=tty0
> console=ttyS0,57600/g; print $value }' > /tmp/grub.conf
> cd /boot/grub
> backup_file grub.conf
> mv /tmp/grub.conf /boot/grub.conf
> }
>
> set_drac() {
> racadm getconfig -f /root/raccfg.bak
> cat << EOF > /root/drac.conf
> [cfgSerial]
> cfgSerialBaudRate=115200
> cfgSerialConsoleEnable=1
> cfgSerialConsoleQuitKey=,./
> cfgSerialTelnetEnable=1
>
> [cfgRacTuning]
> cfgRacTuneHostCom2BaudRate=57600
>
> [cfgRacVirtual]
> cfgVirMediaDisable=1
> EOF
>
> racadm config -f /root/drac.conf
> racadm racreset
> }
>
> set_inittab
> set_securetty
> set_grub
> set_drac
>
> On Nov 1, 2006, at 4:39 AM, Jerry Yu wrote:
> > I believe Brian's question is on 'bios redirect after boot' as in
> > 'os boot'. Dell PE series have BIOS redirect builtin and you can
> > enable it from BIOS to select serial port (ttyS0 or ttyS1), baud
> > rate (115200 or 57600 or 9600), and whether to have 'bios redirect
> > after boot'. I always have to turn off 'bios redirect after boot',
> > since it interferes with the agetty/mgetty listening on the same
> > serial port (CentOS 4 or RHAS 4).
> >
> >
> > On 11/1/06, Gordon Henderson < gordon at drogon.net> wrote:
> >
> > On Tue, 31 Oct 2006, Brian A. Seklecki wrote:
> > > All:
> > >
> > > What's the deal with this feature? Was it intended to be used
> >
> > for any
> >
> > > relatively modern OS?
> > >
> > > It seems to work with DOS and Memtest86+, and perhaps then even
> >
> > some of
> >
> > > the bootable FreeDOS based utils available from Dell.
> > >
> > > But forget about using it for anything that "does not use the
> >
> > BIOS for
> >
> > > console I/O."
> > >
> > > All the Dell Linux docs I find suggest not using it; use the DRAC
> > > VGA->VNC feature instead, but Dell really bungled that with the new
> > > DRAC5 and the ActiveX dependency (imagine that, an embedded Linux
> >
> > device
> >
> > > that serves an ActiveX applet -- the irony is painful)
> >
> > I can't answer your question about using BIOS for console IO, so
> > this may
> > not help, but I do use "console over serial" in many (remote) Linux
> > installations I have (None Dell, but I see no reason why it won't
> > work in
> > a Dell). You can make lilo use the serial line (and I'm sure grub
> > too),
> > and it's a compile & command-line feature for the linux kernel (but
> > I'd be
> > surprised it if wasn't included in the standard Dell/RH kernels,
> > and you
> > just needed to activate it somehow - eg. in the grub config file)
> >
> > In lilo.conf it's as simple as putting:
> >
> > serial=0,57600n8
> >
> > in it somewhere, and to make linux use it, you need something like:
> >
> > append="console=ttyS0,57600n8"
> >
> > in the same file. I'm sure grub does it in a similar fashion, but I
> > don't
> > use grub so can't comment there. I do it this way on another
> > vendors mobos
> > which have a BIOS over serial switch, so if required I can connect
> > to a
> > servers serial line (cisco terminal concentrator thingy) power
> > cycle it,
> > and from then on, do bios "stuff", then boot lilo and do lilo
> > poking, then
> > into linux (with extra command-line "stuff", if required, and it
> > all "just
> > works".
> >
> > There is also a comple-time version of memtest to make it work over a
> > serial-line too (rather than rely on the console redirection, I guess)
> > I've used this too (but also have the non-serial line version of
> > memtest86+ installed too!)
> >
> > Gordon
> >
> > _______________________________________________
> > Linux-PowerEdge mailing list
> > Linux-PowerEdge at dell.com
> > http://lists.us.dell.com/mailman/listinfo/linux-poweredge
> > Please read the FAQ at http://lists.us.dell.com/faq
> >
> >
> > _______________________________________________
> > Linux-PowerEdge mailing list
> > Linux-PowerEdge at dell.com
> > http://lists.us.dell.com/mailman/listinfo/linux-poweredge
> > Please read the FAQ at http://lists.us.dell.com/faq
>
> --------------------
> Gary Rogers
> Sr. Application Administrator
> University of Northern Iowa
> gary.rogers at uni.edu
> "Nothing but turtles all the way down."
> http://en.wikipedia.org/wiki/Turtles_all_the_way_down
More information about the Linux-PowerEdge
mailing list