diff options
author | Allan Jude <allanjude@FreeBSD.org> | 2018-06-17 03:18:56 +0000 |
---|---|---|
committer | Allan Jude <allanjude@FreeBSD.org> | 2018-06-17 03:18:56 +0000 |
commit | 6fee3bb8e1fae97ef0addd36ff08f604fae3fcb6 (patch) | |
tree | 2e93fcc337b811e408165b978b91be77cdf717f4 /stand/i386 | |
parent | 68e520fea44bd3223e16a13161c3f0636d868d7d (diff) | |
download | src-6fee3bb8e1fae97ef0addd36ff08f604fae3fcb6.tar.gz src-6fee3bb8e1fae97ef0addd36ff08f604fae3fcb6.zip |
gptboot, zfsboot, gptzfsboot: Enable the video and serial consoles early
Normally the serial console is not enabled until /boot.config is read and
we know how the serial console should be configured. Initialize the
consoles early in 'dual' mode (serial & keyboard) with a default serial
rate of 115200. Then serial is re-initialized once the disk is decrypted
and the /boot.config file can be read.
This allows the GELIBoot passphrase to be provided via the serial console.
PR: 221526
Requested by: many
Reviewed by: imp
Sponsored by: Klara Systems
Differential Revision: https://reviews.freebsd.org/D15862
Notes
Notes:
svn path=/head/; revision=335276
Diffstat (limited to 'stand/i386')
-rw-r--r-- | stand/i386/gptboot/gptboot.c | 10 | ||||
-rw-r--r-- | stand/i386/zfsboot/zfsboot.c | 10 |
2 files changed, 20 insertions, 0 deletions
diff --git a/stand/i386/gptboot/gptboot.c b/stand/i386/gptboot/gptboot.c index 9c2d9d160535..0140aad2643b 100644 --- a/stand/i386/gptboot/gptboot.c +++ b/stand/i386/gptboot/gptboot.c @@ -285,6 +285,16 @@ main(void) bootinfo.bi_memsizes_valid++; bootinfo.bi_bios_dev = dsk.drive; + /* + * Initialize the serial console early with a modern default of 115200. + * Later, we'll read PATH_DOTCONFIG and reconfigure serial according + * to the configuration provided. + */ + opts = OPT_SET(RBX_DUAL); + ioctrl = (IO_SERIAL|IO_KEYBOARD); + if (sio_init(115200) != 0) + ioctrl &= ~IO_SERIAL; + #ifdef LOADER_GELI_SUPPORT geli_init(); #endif diff --git a/stand/i386/zfsboot/zfsboot.c b/stand/i386/zfsboot/zfsboot.c index 8f67121e6ce2..c47b95762250 100644 --- a/stand/i386/zfsboot/zfsboot.c +++ b/stand/i386/zfsboot/zfsboot.c @@ -693,6 +693,16 @@ main(void) } setheap(heap_next, heap_end); + /* + * Initialize the serial console early with a modern default of 115200. + * Later, we'll read PATH_DOTCONFIG and reconfigure serial according + * to the configuration provided. + */ + opts = OPT_SET(RBX_DUAL); + ioctrl = (IO_SERIAL|IO_KEYBOARD); + if (sio_init(115200) != 0) + ioctrl &= ~IO_SERIAL; + dsk = malloc(sizeof(struct dsk)); dsk->drive = *(uint8_t *)PTOV(ARGS); dsk->type = dsk->drive & DRV_HARD ? TYPE_AD : TYPE_FD; |