Serial console on buster images

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Serial console on buster images

Rainer Dorsch-2
Hi,

can anybody tell if the buster armhf images automatically add a serial console
(e.g. for the cubox-i) or if that is a manual step?

If manual, I assume I have to take the SD card after the installation and

in /etc/systemd/system/getty.target.wants
# ln -s /lib/systemd/system/getty@.service [hidden email]

Is that correct?

I addition I assume I need to add

# cd <mount point of sdcard>
# echo 'setenv bootargs ${bootargs} console=ttymxc0,115200' > etc/flash-kernel/
ubootenv.d/ttymxc0

But how do I run flash-kernel on a x86 system, which has mounted the card? Is
there a better way to add the bootargs?

Thanks
Rainer

--
Rainer Dorsch
http://bokomoko.de/


Reply | Threaded
Open this post in threaded view
|

Re: Serial console on buster images

wookey-4
On 2019-07-28 17:41 +0200, Rainer Dorsch wrote:
> Hi,
>
> can anybody tell if the buster armhf images automatically add a serial console
> (e.g. for the cubox-i) or if that is a manual step?

Are you talking about whilst running the installer, or for normal
booting after the installer has run?

For the installer - it will now try to run on all the consoles the
kernel has declared 'enabled' by default. Ideally that will be both
the serial console and a frame buffer console displayed on any
connected screen, but there are few guarantees as it depends on the
combination of the firmware (uboot or UEFI and the DTB) and the kernel
and what they discover/enable by default.

At the end of the install any discovered serial consoles will be added
to the init/systemd config so you _should_ get a serial console on
boot if the install process discovered, or manually configured, one.

You can find out what the kernel does by default with
cat /proc/consoles
(anything marked with 'E' in the brackets is enabled):
tty0                 -WU (EC p  )    4:2   (on this machine)

If your ttymxc0 is being found and enabled by the kernel, but not set up by the
installer, then that's a bug and we should work out why not.

> If manual, I assume I have to take the SD card after the installation and
>
> in /etc/systemd/system/getty.target.wants
> # ln -s /lib/systemd/system/getty@.service [hidden email]
>
> Is that correct?

Sorry, I've not yet groked systemd so I have no idea how that works.
 
> I addition I assume I need to add
>
> # cd <mount point of sdcard>
> # echo 'setenv bootargs ${bootargs} console=ttymxc0,115200' > etc/flash-kernel/
> ubootenv.d/ttymxc0
>
> But how do I run flash-kernel on a x86 system, which has mounted the card? Is
> there a better way to add the bootargs?

With uboot, I'm not sure there is any substitue from actually running
on the machine and setting the bootargs there using whatever mechanism
is supplied to stop the bootloader in uboot so you can fiddle. But
someone else may know better.

With grub and UEFI you cn edit the grub config to set the kernel boot args.

Wookey
--
Principal hats:  Linaro, Debian, Wookware, ARM
http://wookware.org/

signature.asc (849 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Serial console on buster images

Rainer Dorsch-2
Hi Wookey,

many thanks for your quick and detailed response.

Am Sonntag, 28. Juli 2019, 18:11:34 CEST schrieb Wookey:
> If your ttymxc0 is being found and enabled by the kernel, but not set up by
> the installer, then that's a bug and we should work out why not.

It seems that this is the scenario. I could install over the serial console w/
o any issues, but after the reboot, I do not see a serial console anymore.

Since I cannot access the running machine, I cannot read /proc

I try to get openssh installed and then the device booted again. Maybe I get
network access.

If you have any other idea, please let me know.

Rainer


--
Rainer Dorsch
http://bokomoko.de/


Reply | Threaded
Open this post in threaded view
|

Re: Serial console on buster images

Rainer Dorsch-2
Hi Wookey,

I understood the behavior now better: everything works as you described:

root@home-buster:~# cat /proc/consoles
ttymxc0              -W- (EC p  )  207:16
root@home-buster:~#

The issue I saw and misinterpreted was that the Cubox-i did not reboot after
the installer finished. After power-cycling it manually, everything worked fine.

I just did an install cycle to confirm the behavior.

Thanks
Rainer

Am Sonntag, 28. Juli 2019, 20:45:23 CEST schrieb Rainer Dorsch:

> Hi Wookey,
>
> many thanks for your quick and detailed response.
>
> Am Sonntag, 28. Juli 2019, 18:11:34 CEST schrieb Wookey:
> > If your ttymxc0 is being found and enabled by the kernel, but not set up
> > by
> > the installer, then that's a bug and we should work out why not.
>
> It seems that this is the scenario. I could install over the serial console
> w/ o any issues, but after the reboot, I do not see a serial console
> anymore.
>
> Since I cannot access the running machine, I cannot read /proc
>
> I try to get openssh installed and then the device booted again. Maybe I get
> network access.
>
> If you have any other idea, please let me know.
>
> Rainer


--
Rainer Dorsch
http://bokomoko.de/