Skip to content

apm821xx: drop redundant ttyS0 askfirst inittab override - #26071

Merged
openwrt-bot merged 1 commit into
openwrt:masterfrom
huangya90:apm821xx-drop-inittab-override
Oct 21, 2026
Merged

openwrt-bot merged 1 commit into
openwrt:masterfrom
huangya90:apm821xx-drop-inittab-override

Conversation

@huangya90

Copy link
Copy Markdown
Contributor

The apm821xx target overrides /etc/inittab only to add a
ttyS0::askfirst entry on top of the stock ::askconsole entry. On
these boards /dev/console is ttyS0 and the kernel command line carries
no console= parameter, so procd's dedup guard in askfirst() never
fires ("console" never equals "ttyS0") and two /sbin/askfirst
instances end up watching the same serial port.

While both are idle they consume typed characters without echoing them,
and once both have spawned a shell the input is split between the two
readers, garbling or dropping roughly half of the typed characters and
making the serial console unusable. U-Boot and the vendor firmware are
unaffected.

No other target combines ::askconsole with an askfirst entry on the
same serial port; they either use ::askconsole alone or list specific
ttys without it.

Since the overlay minus the offending line would be byte-identical to
package/base-files/files/etc/inittab, the whole overlay file is
deleted instead of keeping a redundant copy that shadows the stock
inittab and would mask future upstream changes to it. The stock
three-line inittab applies and exactly one console reader remains.

Testing: verified on a WNDR4700 — with only this change (and the
unmodified 8250 driver) a 30-character test with 1.5 s spacing arrives
30/30 with per-character echo and a single login shell.

Signed-off-by: Shuangfeng He [email protected]

@openwrt openwrt Bot added the target/apm821xx pull request/issue for apm821xx target label Oct 21, 2026
The target-specific /etc/inittab overlay adds
"ttyS0::askfirst:/usr/libexec/login.sh" on top of the stock
"::askconsole" entry.  On these boards /dev/console is ttyS0, and
since the kernel command line carries no console= parameter,
procd's dedup guard in askfirst() (which only skips the entry when
the resolved console name matches the askfirst id) does not
trigger: "console" never equals "ttyS0".  Two /sbin/askfirst
instances therefore watch the same port.

While both are idle they consume typed characters without echoing
them, and once both have spawned a shell the input is split
between the two readers, garbling or dropping about half of the
typed characters and making the serial console unusable.  U-Boot
and the vendor firmware are unaffected.

No other target combines ::askconsole with an askfirst entry on
the same serial port; they either use ::askconsole alone or list
specific ttys without it.

With the offending line removed the overlay would be
byte-identical to package/base-files/files/etc/inittab, so delete
the whole file instead of keeping a redundant copy that shadows
the stock inittab and would mask future upstream changes to it.
The stock three-line inittab applies and exactly one console
reader remains.

Verified on a WNDR4700: with only this change (and the unmodified
8250 driver) a 30-character test with 1.5 s spacing arrives 30/30
with per-character echo and a single login shell.

Signed-off-by: Shuangfeng He <[email protected]>
Link: openwrt#26071
Signed-off-by: Christian Marangi <[email protected]>
@Ansuel
Ansuel force-pushed the apm821xx-drop-inittab-override branch from 624cc08 to d118dcd Compare October 21, 2026 16:46
@openwrt-bot
openwrt-bot merged commit d118dcd into openwrt:master Oct 21, 2026
Vladdrako pushed a commit to Vladdrako/openwrt that referenced this pull request Oct 22, 2026
The target-specific /etc/inittab overlay adds
"ttyS0::askfirst:/usr/libexec/login.sh" on top of the stock
"::askconsole" entry.  On these boards /dev/console is ttyS0, and
since the kernel command line carries no console= parameter,
procd's dedup guard in askfirst() (which only skips the entry when
the resolved console name matches the askfirst id) does not
trigger: "console" never equals "ttyS0".  Two /sbin/askfirst
instances therefore watch the same port.

While both are idle they consume typed characters without echoing
them, and once both have spawned a shell the input is split
between the two readers, garbling or dropping about half of the
typed characters and making the serial console unusable.  U-Boot
and the vendor firmware are unaffected.

No other target combines ::askconsole with an askfirst entry on
the same serial port; they either use ::askconsole alone or list
specific ttys without it.

With the offending line removed the overlay would be
byte-identical to package/base-files/files/etc/inittab, so delete
the whole file instead of keeping a redundant copy that shadows
the stock inittab and would mask future upstream changes to it.
The stock three-line inittab applies and exactly one console
reader remains.

Verified on a WNDR4700: with only this change (and the unmodified
8250 driver) a 30-character test with 1.5 s spacing arrives 30/30
with per-character echo and a single login shell.

Signed-off-by: Shuangfeng He <[email protected]>
Link: openwrt#26071
Signed-off-by: Christian Marangi <[email protected]>
BlizzardWyvern pushed a commit to BlizzardWyvern/openwrt that referenced this pull request Nov 8, 2026
The target-specific /etc/inittab overlay adds
"ttyS0::askfirst:/usr/libexec/login.sh" on top of the stock
"::askconsole" entry.  On these boards /dev/console is ttyS0, and
since the kernel command line carries no console= parameter,
procd's dedup guard in askfirst() (which only skips the entry when
the resolved console name matches the askfirst id) does not
trigger: "console" never equals "ttyS0".  Two /sbin/askfirst
instances therefore watch the same port.

While both are idle they consume typed characters without echoing
them, and once both have spawned a shell the input is split
between the two readers, garbling or dropping about half of the
typed characters and making the serial console unusable.  U-Boot
and the vendor firmware are unaffected.

No other target combines ::askconsole with an askfirst entry on
the same serial port; they either use ::askconsole alone or list
specific ttys without it.

With the offending line removed the overlay would be
byte-identical to package/base-files/files/etc/inittab, so delete
the whole file instead of keeping a redundant copy that shadows
the stock inittab and would mask future upstream changes to it.
The stock three-line inittab applies and exactly one console
reader remains.

Verified on a WNDR4700: with only this change (and the unmodified
8250 driver) a 30-character test with 1.5 s spacing arrives 30/30
with per-character echo and a single login shell.

Signed-off-by: Shuangfeng He <[email protected]>
Link: openwrt#26071
Signed-off-by: Christian Marangi <[email protected]>
yveming pushed a commit to yveming/openwrt-pon that referenced this pull request Nov 11, 2026
The target-specific /etc/inittab overlay adds
"ttyS0::askfirst:/usr/libexec/login.sh" on top of the stock
"::askconsole" entry.  On these boards /dev/console is ttyS0, and
since the kernel command line carries no console= parameter,
procd's dedup guard in askfirst() (which only skips the entry when
the resolved console name matches the askfirst id) does not
trigger: "console" never equals "ttyS0".  Two /sbin/askfirst
instances therefore watch the same port.

While both are idle they consume typed characters without echoing
them, and once both have spawned a shell the input is split
between the two readers, garbling or dropping about half of the
typed characters and making the serial console unusable.  U-Boot
and the vendor firmware are unaffected.

No other target combines ::askconsole with an askfirst entry on
the same serial port; they either use ::askconsole alone or list
specific ttys without it.

With the offending line removed the overlay would be
byte-identical to package/base-files/files/etc/inittab, so delete
the whole file instead of keeping a redundant copy that shadows
the stock inittab and would mask future upstream changes to it.
The stock three-line inittab applies and exactly one console
reader remains.

Verified on a WNDR4700: with only this change (and the unmodified
8250 driver) a 30-character test with 1.5 s spacing arrives 30/30
with per-character echo and a single login shell.

Signed-off-by: Shuangfeng He <[email protected]>
Link: openwrt/openwrt#26071
Signed-off-by: Christian Marangi <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

target/apm821xx pull request/issue for apm821xx target

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants