# booting headless with serial console

## Christian99

I have a apu3c4. This device is headless, i.E. no graphical output, only a serial console.

The serial console is working, when booting from boot isos dd'ed to an usb stick (tried arch and gentoo isos).

Problem is only, when I install gentoo to harddisk and try to boot from there:

Bootloader is grub2, the output appears on serial console, I can select the menu entry, then the messages Loading kernel/Loading initrd appear, and then nothing more.

of course kernel parameter console=ttyS0,115200 is passed to booting kernel.

Now I'm a little bit stuck, not sure where the problem is. I would gues, that my kernel is missing some driver for the serial terminal, though I'm not sure.

a little bit info:

dmesg | grep -i tty

```
[    3.486466] Serial: 8250/16550 driver, 4 ports, IRQ sharing enabled

[    3.512320] serial8250: ttyS0 at I/O 0x3f8 (irq = 4, base_baud = 115200) is a 16550A

[    3.539646] serial8250: ttyS1 at I/O 0x2f8 (irq = 3, base_baud = 115200) is a 16550A

[    3.567032] serial8250: ttyS2 at I/O 0x3e8 (irq = 4, base_baud = 115200) is a 16550A

[    3.594437] serial8250: ttyS3 at I/O 0x2e8 (irq = 3, base_baud = 115200) is a 16550A
```

(hopefully) relevant parts from kernel config

```
#

# Serial drivers

#

CONFIG_SERIAL_EARLYCON=y

CONFIG_SERIAL_8250=y

# CONFIG_SERIAL_8250_DEPRECATED_OPTIONS is not set

CONFIG_SERIAL_8250_PNP=y

CONFIG_SERIAL_8250_FINTEK=y

CONFIG_SERIAL_8250_CONSOLE=y

CONFIG_SERIAL_8250_DMA=y

CONFIG_SERIAL_8250_PCI=y

CONFIG_SERIAL_8250_EXAR=m

CONFIG_SERIAL_8250_CS=m

CONFIG_SERIAL_8250_MEN_MCB=m

CONFIG_SERIAL_8250_NR_UARTS=48

CONFIG_SERIAL_8250_RUNTIME_UARTS=32

CONFIG_SERIAL_8250_EXTENDED=y

CONFIG_SERIAL_8250_MANY_PORTS=y

CONFIG_SERIAL_8250_SHARE_IRQ=y

# CONFIG_SERIAL_8250_DETECT_IRQ is not set

CONFIG_SERIAL_8250_RSA=y

CONFIG_SERIAL_8250_DW=m

CONFIG_SERIAL_8250_RT288X=y

CONFIG_SERIAL_8250_LPSS=m

CONFIG_SERIAL_8250_MID=m

CONFIG_SERIAL_8250_MOXA=m
```

question is now: Where is the actual problem? Am I right, that I'm just missing a few kernel options, or is the problem rooted somewhere else? What can I do to find out more?

Thx in advance,

Christian

----------

## bbgermany

Hi,

please have a look here: https://wiki.archlinux.org/index.php/working_with_the_serial_console

You should add 115200n8 instead of only 115200 and you should make grub aware of the serial console in /etc/default/grub as well.

Do you use systemd or openrc? Make sure there is a getty listening on ttyS0 after booting.

greets, bb

----------

## freke

I like those APUs for my small servers  :Smile: 

I have:

/etc/default/grub *Quote:*   

> # Copyright 1999-2015 Gentoo Foundation
> 
> # Distributed under the terms of the GNU General Public License v2
> 
> #
> ...

 

/etc/inittab *Quote:*   

> ...
> 
> # SERIAL CONSOLES
> 
> s0:12345:respawn:/sbin/agetty -L 115200 ttyS0 vt100
> ...

 

My dmesg http://bpaste.net/show/a48e065d03f9 (mine is apu2c4 though)

----------

## Christian99

grub is aware of serial console and i'm getting the output, only kernel output is not arriving

when booting from usb stick, console=ttyS0,115200 was enough, the n8 wasn't needed, but I will try adding it.

----------

## Christian99

Just adding n8 didn't help. It seems, that it's not just missing console output, it seems that it's not even booting.

I have set it up, so that it should connect to my network via dhcp at boot automatically, but I don't see anything at my dhcp server.

I will try compiling kernel with genkernel, and see if this helps

----------

## freke

If you edited the /etc/default/grub to add the console-line - you did run grub-mkconfig again afterwards ofcourse?

I can try pasting my 4.17.19-config from my apu2c4 when I get home from work.

[EDIT]

.config

 *Quote:*   

> lamp ~ # lspci -nnk
> 
> 00:00.0 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Device [1022:1566]
> 
>         Subsystem: Advanced Micro Devices, Inc. [AMD] Device [1022:1566]
> ...

 

----------

## Kalin

 *freke wrote:*   

> 00:18.0 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Device [1022:1580]
> 
> 00:18.1 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Device [1022:1581]
> 
> 00:18.2 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Device [1022:1582]
> ...

 

Any idea what those devices are? The additional serial ports?

I am testing now APU4B4 at the moment and was wondering if I need some additional CONFIG.

----------

## NeddySeagoon

Christian99,

You will need to edit /etc/inittab

```
# SERIAL CONSOLES

#s0:12345:respawn:/sbin/agetty -L 115200 ttyS0 vt100

#s1:12345:respawn:/sbin/agetty -L 115200 ttyS1 vt100
```

You don't get agetty started on serial ports by default.

-- edit --

```

0:18.0 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Device [1022:1580]

00:18.1 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Device [1022:1581]

00:18.2 Host bridge [0600]: Advanced Micro Devices, Inc. [AMD] Device [1022:1582]
```

Are all processor bits and pieces. I would not expect serial ports to be the PCI bus. They will be outputs of the South Bridge.

----------

