Building HAOS image with Serial Port Support

Hello all,

I have been trying to install Home Assistant OS on my APU.3C4-based PC (PC Engines apu3c4 product file). Note the board has no graphics card port. I managed to write the downloaded 8.4 release image to its disk. I would like to use its serial port so I can control the machine from my laptop, but I am not getting anything on the port that is connected to my laptop running Debian GNU/Linux (the stable Bullseye release). Because of that, I don’t know what is going on when I boot from SSD that has the image written over it.

How do I make HAOS to give something on the serial port? I believe I should change the kernel arguments to include console=ttyS0,115200n8 as that has worked for other OSes I installed on the machine. However, I do not know how to do that with the officially released 8.4 image.

What I attempted is to build a generic_x86_64 HAOS image by cloning https://github.com/home-assistant/operating-system/, checking out the 8.4 tag, then modifying ./buildroot-external/board/pc/generic-x86-64/cmdline.txt to read console=ttyS0,115200n8, and finally running sudo scripts/enter.sh make generic_x86_64. Unfortunately, this results in the following error:

...
1bdfc9a49750: Pull complete
b6227924db50: Pull complete
Digest: sha256:f8c65c9a3ecaa40c8f6e90e67c23c79c4dd6a2bee646a8c7c71bf9e49bea4eae
Status: Downloaded newer image for docker:20.10-dind
Waiting for Docker daemon...
Loading containers...
Loaded image: ghcr.io/home-assistant/amd64-hassio-audio:2022.05.0
open /var/lib/docker/tmp/docker-import-1908728770/repositories: no such file or directory
make[1]: *** [package/pkg-generic.mk:375: /build/output/build/hassio-1.0.0/.stamp_images_installed] Error 1
make[1]: Leaving directory '/build/buildroot'
make: *** [Makefile:39: generic_x86_64] Error 2

What do I do to resolve this image build issue, or more generally - how to get the serial port working for HAOS?

Hi @mdimjasevic ,

can’t help you with the error directly. But I want to do the same. I think we have to add serial console support in kernel as well:

I’ve changed the kernel config: buildroot-external/board/pc/generic-x86-64/kernel.config

...
CONFIG_USB_SERIAL_CONSOLE=y
CONFIG_SERIAL_CONSOLE=y
...

Then I’ve run scripts/enter.sh make generic_x86_64-config and afterwards scripts/enter.sh make generic_x86_64. Now it’s compiling for an hour already.

This didn’t work for me. I think there has to be modified more for the apu.

Hi all:

I had the same problem (my system is Debian 11 64bit in Virtual Box).

Reference: Getting Started with Home Assistant Operating System Development | Home Assistant Developer Docs, to Build ova.

do: “sudo scripts/enter.sh make O=output_ova ova” failed, console information:

...
>>> hassio 1.0.0 Installing to images directory
/build/buildroot-external/package/hassio/create-data-partition.sh "/build/output_ova/build/hassio-1.0.0" "/build/output_ova/images"
mke2fs 1.46.2 (28-Feb-2021)
Discarding device blocks: done                            
Creating filesystem with 327680 4k blocks and 81920 inodes
Filesystem UUID: 95dc98f4-8d50-4c0d-9a58-b951714cb293
Superblock backups stored on blocks: 
	32768, 98304, 163840, 229376, 294912

Allocating group tables: done                            
Writing inode tables: done                            
Creating journal (8192 blocks): done
Writing superblocks and filesystem accounting information: done 

Waiting for Docker daemon...
Loading container images...
open /var/lib/docker/tmp/docker-import-4197484281/repositories: no such file or directory
make[1]: *** [package/pkg-generic.mk:374: /build/output_ova/build/hassio-1.0.0/.stamp_images_installed] Error 1
make[1]: Leaving directory '/build/buildroot'
make: *** [Makefile:39: ova] Error 2
root@e2b39a9adc85:/build# 

view "/build/buildroot-external/package/hassio/dind-import-containers.sh"

...
# Make sure to order images by size (largest first)
# It seems docker load requires space during operation
# shellcheck disable=SC2045
for image in $(ls -S /build/images/*.tar); do
	docker load --input "${image}"
done
...

then check directory “/build/images/*.tar”, tar files exists.

I have no idea about this program, Hope for help.