David Cantrell wrote:
> Lastly, Phil suggested this line for rc.S:
>
> [ -z "`egrep 'console=tty[a-z]' /proc/cmdline`" ] && fsckopt="${fsckopt} -C"
>
> I was going to add that to have the support for disabling the e2fsck progress
> bar if you are using a serial console. But, I need to know if /proc/cmdline
> reports all boot parameters, or just ones manually typed in. If a user
> doesn't specify the console setting, it will default to using ttya. But if
> that doesn't show in /proc/cmdline, we'll need to come up with another test.
If the default is the result of a hard coded device number in the kernel,
then it won't show up. However, if the default is the result of a SILO
parameter, then it does seem to be showing up. SILO (and LILO) apparently
only pass parameters to the kernel by appending the manually entered ones
to the default ones, and passing that as one boot parameter string to the
kernel. What I see when I boot from SILO with:
console=ttya root=/dev/sda1 ro
as my manually entered boot parameters, is:
root@darkstar:~# cat /proc/cmdline
rw ramdisk_size=5120k console=ttya console=ttya root=/dev/sda1 ro
root@darkstar:~#
Note that "console=ttya" is there twice, once from the default string, and
once from my manually entered string. The "rw ramdisk_size=5120k" had to
come from the default since I did not enter those.
One of my Intel based machines gets all of this from LILO:
root@pollux:/root 136> cat /proc/cmdline
auto BOOT_IMAGE=linux ro root=302 ide0=dma ide0=ata66 console=tty0
root@pollux:/root 137>
and in this case only the "ide0=dma ide0=ata66 console=tty0" part is in the
append string in lilo.conf. Apparently things work with later parameters
overriding/overwriting the settings of earlier parameters during the parsing.
NOTE: because the default "console=ttya" will appear in the parameter string
even if a manually entered "console=tty0" overrides it, the test I gave will
still assume that console=tty[a-z] was specified because technically the
test is "was it ever specified, even if overridden" because of the way the
parameters are collected and parsed.
Another possible way to test this could be as follows:
[ -z "`ls -l /proc/$$/fd/1 | fgrep /dev/ttyS`" ] && fsckopt="${fsckopt} -C"
I get the following:
root@darkstar:~# ls -l /proc/$$/fd/1 | fgrep /dev/ttyS
lrwx------ 1 root root 64 Dec 17 16:57 /proc/72/fd/1 -> /dev/ttyS0
root@darkstar:~#
-- ----------------------------------------------------------------- | Phil Howard - KA9WGN | Dallas | http://linuxhomepage.com/ | | phil-nospam@ipal.net | Texas, USA | http://phil.ipal.org/ | -----------------------------------------------------------------
This archive was generated by hypermail 2b30 : Thu Sep 19 2002 - 11:00:02 PDT