aboutsummaryrefslogtreecommitdiff
path: root/package/base-files/files/lib/preinit/99_10_failsafe_login
Commit message (Collapse)AuthorAge
* failsafe: run on all consoles listed in /proc/cmdlineMark Mentovai2022-06-19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On x86, when both CONFIG_GRUB_CONSOLE and CONFIG_GRUB_SERIAL are set (as they are by default), the kernel command line will have two console= entries, such as console=tty0 console=ttyS0,115200n8 Failsafe was only running a shell on the first defined console, the VGA console. This is a problem for devices like apu2, where there is only a serial console and it appears on ttyS0. Moreover, the console prompt to enter failsafe during boot was delivered to, and its input read from, the last console= on the kernel command line. So while the failsafe shell was on the first defined console, only the last defined console could be used to enter failsafe during boot. In contrast, the x86 bootloader (GRUB) operates on both the serial console and the VGA console by virtue of "terminal_{input,output} console serial". GRUB also provided an alternate means to enter failsafe from either console. The presence of two console= kernel command line parameters causes kernel messages to be delivered to both. Under normal operation (not failsafe), procd runs login in accordance with inittab, which on x86 specifies ttyS0, hvc0, and tty1, allowing login through any of serial, hypervisor, or VGA console. Thus, serial access was consistently available on x86 devices with serial consoles under normal operation, except for shell access in failsafe mode (without editing the kernel command line). By presenting the failsafe prompt, reading failsafe prompt input, and running failsafe shells on all consoles listed in /proc/cmdline, failsafe mode will work correctly on devices with a serial console (like apu2), and the same image without any need for reconfiguration can be shared by devices with the more traditional (for x86) VGA console. This improvement should benefit any system with multiple console= arguments, including x86 and bcm27xx (Raspberry Pi). Signed-off-by: Mark Mentovai <mark at moxienet.com>
* treewide: drop shebang from non-executable lib filesAdrian Schmutzler2021-01-29
| | | | | | | | | | | | This drops the shebang from another bunch of files in various /lib folders, as these are sourced and the shebang is useless. Fix execute bit in one case, too. This should cover almost all trivial cases now, i.e. where /lib is actually used for library files. Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
* dropbear: move failsafe code out of base-filesKyle Copperfield2020-01-15
| | | | | | | | | | | | The sender domain has a DMARC Reject/Quarantine policy which disallows sending mailing list messages using the original "From" header. To mitigate this problem, the original message has been wrapped automatically by the mailing list software. Failsafe code of dropbear should be in the dropbear package not the base-files package. Signed-off-by: Kyle Copperfield <kmcopper@danwin1210.me>
* base-files: add support for staged sysupgrades from failsafe modeMatthias Schiffer2017-05-29
| | | | Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
* base-files: fix some failsafe issuesJohn Crispin2016-05-23
| | | | | | * if the shell was closed booting continued Signed-off-by: John Crispin <john@phrozen.org>
* Disable telnet in favor of passwordless SSHSteven Barth2015-09-07
| | | | | | | | | | This enables passworldless login for root via SSH whenever no root password is set (e.g. after reset, flashing without keeping config or in failsafe) and removes telnet support alltogether. Signed-off-by: Steven Barth <steven@midlink.org> SVN-Revision: 46809
* base-files: fix whitespacesLuka Perkov2013-12-09
| | | | | | Signed-off-by: Luka Perkov <luka@openwrt.org> SVN-Revision: 39006
* add preinit modularization work by Daniel Dickinson (cshore)Felix Fietkau2010-01-25
SVN-Revision: 19331