Boot loader/kernel error

Devin Teske dteske at
Sat Oct 9 18:59:20 UTC 2010

On Oct 9, 2010, at 10:58 AM, Dan Nelson wrote:

> In the last episode (Oct 08), Hac Phan said:
>> I'm having trouble with a machine that was recently rebooted and will no
>> longer boot correctly.
>> The boot process hangs with the following screen:
>> Loading /boot/defaults/loader.conf
>> -
>> The cursor does not move and no other text is displayed. After about 10
>> minutes, the boot finishes (without the splash screen) and displays the
>> login prompt.  I tried to login but it timed out after 300 seconds.
> That behaviour is consistent with having a serial console setup in
> /boot/loader.conf .  As soon as the loader sees "console=comconsole", it
> will switch its output and the kernel's output to com1.  If com1 doesn't
> exist, it will take a long time to boot.  When the kernel finally finishes,
> init still start a getty on the physical console, which is when you see the
> login prompt.  If you can boot your fixit CD and get the root filessytem
> mountd read/write, try commenting out that comconsole line.
> Most bad loader.conf problems can be fixed by hitting space just before the
> loader starts up the kernel and unsetting the bad variable, but "comconsole"
> is one of the commands that it runs immediately, and I don't think you can
> stop the loader from parsing loader.conf.

In `/boot/loader.rc', I'm reviewing the ANS FICL (that's `Forth Inspired Command Language') and I see that it does indeed parse `/boot/loader.con' before throwing up the menu (once the menu is up, then you can escape to the loader prompt by selecting the appropriate numeric option -- in the new loader, the old loader you simply had to press space-bar during the count-down to boot).

The bread-crumbs in `/boot/loader.rc' lead us off to `/boot/loader.4th' if you want to know precisely how `/boot/loader.conf' is read into the environment (note: real work for `comconsole=blah' is done in `/boot/support.4th' in the chain: include_conf_files -> load_conf -> process_conf -> process_assignment -> set_environment_variable; and the last part of that chain reveals that the internal FICL word `set' is used to set an environment variable, so comconsole should be visible at the interactive prompt via the `show' keyword).

So, in reality, one ought to be able to do the following to deconfigure the comconsole setting...

1. Boot up the machine
2. Interrupt the boot loader (older FreeBSD, hit space, newer menu-based loader, choose the menu option to escape to the loader prompt)
3. Enter: show
4. Verify that comconsole is set (because loader.rc shows us `/boot/loader.conf' is loaded before the menu is thrown up)
5. Enter: unset comconsole
6. Enter: show
7. Verify that comconsole is no longer set
8. Enter: boot
NOTE: If you prefer to boot into single-user mode, enter instead: boot -s
NOTE: Boot should no longer be dumping to serial and instead you should see a normal boot process on the console.
9. Login and change /boot/loader.conf to remove comconsole=...

NOTE: I do realize that in /boot/loader.4th, the FICL native `boot' keyword has been overridden, but it doesn't appear that anything is munged in the environment prior to execution of the loaded kernel, so the kernel should inherit the environment variables just as they appear when `show' is executed at the loader prompt.

(full sig at bottom)

> -- 
> 	Dan Nelson
> 	dnelson at
> _______________________________________________
> freebsd-questions at mailing list
> To unsubscribe, send any mail to "freebsd-questions-unsubscribe at"

Devin Teske

Business Solutions Consultant II
510-735-5650 Mobile
510-621-2038 Office
510-621-2020 Office Fax
909-477-4578 Home/Fax
devin.teske at

This message  contains confidential  and proprietary  information
of the sender,  and is intended only for the person(s) to whom it
is addressed. Any use, distribution, copying or disclosure by any
other person  is strictly prohibited.  If you have  received this
message in error,  please notify  the e-mail sender  immediately,
and delete the original message without making a copy.


More information about the freebsd-questions mailing list