# Hardcoding serial line



## minimike (Dec 13, 2010)

Hi

I have set up a multiboot environment on one Zpool like Solaris using Grub2. It works 
Each System is stored in one ZFS Subvolume. Grub2 is installed manually in the Top of the Pool.


```
insmod serial
serial --speed=9600 --unit=0 --word=8 --parity=no --stop=1
terminal_output serial
terminal_input serial

# Timeout for menu
set timeout=5

# Set default boot entry as Entry 0
set default=0

        menuentry "FreeBSD 8.1 RELEASE AMD64 on pool/freebsd81" {
          kfreebsd /freebsd81@/boot/kernel/kernel
          kfreebsd_module_elf /freebsd81@/boot/kernel/opensolaris.ko
          kfreebsd_module_elf /freebsd81@/boot/kernel/zfs.ko
          kfreebsd_module_elf /freebsd81@/boot/kernel/smbus.ko
          kfreebsd_module_elf /freebsd81@/boot/kernel/ipmi.ko
          kfreebsd_module /freebsd8@/boot/zfs/zpool.cache type=/boot/zfs/zpool.cache
          set kFreeBSD.vfs.root.mountfrom=zfs:pool/freebsd81
}

        menuentry "FreeBSD 8.2 BETA AMD64 on pool/freebsd82" {
          kfreebsd /freebsd82@/boot/kernel/kernel
          kfreebsd_module_elf /freebsd82@/boot/kernel/opensolaris.ko
          kfreebsd_module_elf /freebsd82@/boot/kernel/zfs.ko
          kfreebsd_module_elf /freebsd82@/boot/kernel/smbus.ko
          kfreebsd_module_elf /freebsd82@/boot/kernel/ipmi.ko
          kfreebsd_module /freebsd82@/boot/zfs/zpool.cache type=/boot/zfs/zpool.cache
          set kFreeBSD.vfs.root.mountfrom=zfs:pool/freebsd82
}
 
       menuentry "Debian KfreeBSD Rescue AMD64 on pool/debian" {
          kfreebsd /debian@/boot/kfreebsd-8.1-1-amd64.gz
          kfreebsd_module_elf /debian@/lib/modules/8.1-1-amd64/opensolaris.ko
          kfreebsd_module_elf /debian@/lib/modules/8.1-1-amd64/zfs.ko
          kfreebsd_module_elf /debian@/lib/modules/8.1-1-amd64/smbus.ko
          kfreebsd_module_elf /debian@/lib/modules/8.1-1-amd64/ipmi.ko
          kfreebsd_module /debian@/boot/zfs/zpool.cache type=/boot/zfs/zpool.cache
          set kFreeBSD.vfs.root.mountfrom=zfs:pool/debian
}
```

My Problem is, without the FreeBSD Bootloader doesn't start the console on serial line on Boot. Are they options to compile it hardcoded like in the Kernel? Because kernel -h doesn't works too.


----------



## aragon (Dec 13, 2010)

Have you read loader(8) and loader.conf(5)?

Also, you might consider setting up boot.config(5) and simply chainloading to your FreeBSD partition.


----------



## SirDice (Dec 14, 2010)

Handbook: 26.6 Setting Up the Serial Console


----------



## minimike (Dec 14, 2010)

I start FreeBSD with GRUB2 instead Loader. Thats why I am asking. There is only one Partition with ZFS for all systems. 

best regards
Darko


----------



## nox@ (Aug 31, 2012)

Hi!

I found this old thread while googling for a different problem but I think I know the solution in case it still helps:  Try adding this to the grub2 entry:

```
kfreebsd_loadenv /boot/device.hints
```
Or in your case:

```
kfreebsd_loadenv /freebsd8@/boot/device.hints
```

And pass -h to the kernel so it switches to the serial console:

```
kfreebsd /freebsd81@/boot/kernel/kernel -h
```
And/or pass console vars to the kernel:

```
set kFreeBSD.console=comconsole
```
And should you want a different speed than 9600bps:

```
set kFreeBSD.comconsole_speed=115200
```
HTH, 
Juergen

PS: I didn't actually test this so there _may_ be more needed to get it working...


----------

