turing-machines / BMC-Firmware

Turing-pi BMC firmware
GNU General Public License v2.0
215 stars 26 forks source link

Rename ttyS* devices to correspond to node numbers #181

Closed irdc closed 3 months ago

irdc commented 5 months ago

Currently, the ttyS* devices don't correspond to the node they're connected to, e.g. /dev/ttyS4 corresponds to node 3. This is not necessary: this is a purpose-built system, and the fact that the BMC's SOC calls a certain UART something doesn't mean that the BMC firmware has to do the same. Renaming them would make things easier on users, who won't have to remember which device corresponds to which node.

I'd like to propose the following mapping:

MPC-GH commented 5 months ago

I think this was asked for before and wasn't accepted as a breaking change.

Could I make an alternative suggestion that an alias is put in along the lines of /dev/ttyNode1 though ttyNode4 or similar as an alternative way of sidestepping the ttySx not being Node X issue.

srcshelton commented 5 months ago

I'd support @irdc's proposal - even accepting that this is a breaking change, if we make it now in the early days of the product then it can be adapted to and we all move on.

The longer the (apparently) random mapping of TTY to node persists, the less possible it will be to fix without the degree of breakage becoming untenable.

I've got a script which maps nodes to ports, and I suspect many others will have followed the same approach - I'd gladly retire this if the port mappings were made human-readable.

Just imagine that there's a hypothetical future Turing Pi board which accepts even more nodes - would it make sense for the non-obvious ordering currently present to persist for all future products (for reasons of consistency) - or would it be best to nip this in the bud for now and the future at this point in time?

CFSworks commented 5 months ago

See also #8

soxrok2212 commented 5 months ago

I agree with @srcshelton. Best to make the change early.

svenrademakers commented 5 months ago

It's been a while since #8. A lot of breakage happened going into v2.0. lets update the tty's.

taxilian commented 4 months ago

Agreed that it can cause some confusion, but I think anyone who is using the TTYs is going to be savvy enough to update things with the change -- and I seriously can't imagine how anyone would not prefer to have them defined in a simple, sane way. I have to look up the mapping every time I use them which is tedious