# booting from CD/DVD with serial console & boot2 stage



## john_doe (Apr 18, 2010)

I can boot with serial console by using

```
console="vidconsole,comconsole" # loader
boot_multicons=YES # kernel
```
The thing is I need access to machine via serial line more early, at boot(8) stage, so that I can choose another loader(8) in case borked one recorded. I've tried hitting keys and placing -D into /boot.config but none seems to work. Is it unsupported by *cdboot*?


----------



## fbsd1 (Apr 20, 2010)

You need to provide a greater level of descriptive details about 
what your trying to do.
What does "in case borked one recorded" mean?
Did you create your own customized bootable cd?
Are you trying to use the disc1.iso burned to cd for
serial console access?

Details , details, it's all in the details.

Provide details and you have much better chance of getting a helpful reply.


----------



## john_doe (Apr 29, 2010)

Yeah, I'm making customized bootable CD mostly for rescue situations that's in sync with my current system (9.0-CURRENT amd64). This BootCD sometimes used on several other machines that don't have any display and need a serial console. The contents for CD are generated by script based mostly on live system (via nullfs) and `make distribution -C/usr/src'. This is another reason why I don't want to touch loader.conf. The iso-file is created by
`$ cd /path/to/iso_build`
`$ mkisofs -o ../bootcd.iso -quiet -R -iso-level 3 -m .svn -no-emul-boot -b boot/cdboot .`

Sometimes broken loader may be recorded from /boot due to unlucky update and I need a way to choose another one (e.g. loader.old) at the 2nd stage of boot. Besides, I like to have control over boot process as early as possible. The only thing I don't like is *cdboot* unlike *boot2* and *gptboot* seems like doesn't support /boot.config nor interrupting boot. And searching for "serial/sio" only proves my point

```
$ ls -fl /boot/{cd,}boot
-r--r--r-- 1 root wheel 1201 2010-04-29 06:51 /boot/cdboot
-r--r--r-- 1 root wheel 8192 2010-04-29 06:51 /boot/boot

$ fgrep -c -ir -eserial -esio /sys/boot/i386/{cdboot,boot2}
/sys/boot/i386/cdboot/Makefile:0
/sys/boot/i386/cdboot/cdboot.s:2
/sys/boot/i386/boot2/boot1.S:1
/sys/boot/i386/boot2/sio.S:29
/sys/boot/i386/boot2/lib.h:5
/sys/boot/i386/boot2/Makefile:6
/sys/boot/i386/boot2/boot2.c:17

$ fgrep -ir -eserial -esio /sys/boot/i386/cdboot
/sys/boot/i386/cdboot/cdboot.s:#    without specific prior written permission.
/sys/boot/i386/cdboot/cdboot.s:                                               #  no version
```
This sucks. One have to be extra careful when creating rescue CD because you don't have same control over boot process as you have when booting from HDD.

This thread is about whether I'm overlooking smth and *cdboot* does support serial console and /boot.config or there is a way to swap loader other than during boot(8). If so then I'd like to know.


----------

