Project

General

Profile

Feature #23147

Avatar?id=14398&size=50x50

Auto enable serial mode if installed via serial option

Added by Kris Moore over 4 years ago. Updated about 4 years ago.

Status:
Resolved
Priority:
Important
Assignee:
Alexander Motin
Category:
OS
Target version:
Estimated time:
Severity:
New
Reason for Closing:
Reason for Blocked:
Needs QA:
Yes
Needs Doc:
Yes
Needs Merging:
Yes
Needs Automation:
No
Support Suite Ticket:
n/a
Hardware Configuration:

Description

For hardware without vga and only ipmi serial we need to also enable serial mode on the installed system if it was installed with serial mode enabled.


Related issues

Is duplicate of FreeNAS - Bug #23418: libreadline.so.6 not found errors during installClosed: Duplicate2017-04-17

Associated revisions

Revision 25f3d140 (diff)
Added by Alexander Motin over 4 years ago

Refactor /etc/ttys to make serial console work if enabled from loader. Remove /dev/sercons hack and replace it with modern onifconsole option, resyncing with modern FreeBSD. Ticket: #23147

Revision 37cfaab9 (diff)
Added by Alexander Motin over 4 years ago

Forcefully enable TTY on configured UART port in case it is different from console port. It may happen since we can not enable/change serial console port without reboot. Ticket: #23147

Revision 8c7160c0 (diff)
Added by Kris Moore over 4 years ago

Add grub.serialmode=YES when booted installer via serial mode Ticket: #23147

Revision 9d27d8eb (diff)
Added by Kris Moore over 4 years ago

When installed with using the "Serial Mode" enabled option at GRUB boot-menu we need to also enable serial mode for the first boot. This will allow hardware platforms with NO VGA to be installed and then get to the netcli via serial IPMI Ticket: #23147

Revision 4d76afec (diff)
Added by Kris Moore over 4 years ago

Add grub.serialspeed and grub.serialport, both defaulting to AUTO on the installation media Ticket: #23147

Revision cce43579 (diff)
Added by Kris Moore over 4 years ago

When the user has set grub.serialport / grub.serialspeed we will also save these values to the installed system for first-boot serial functionality Ticket: #23147

Revision 6bff7e54 (diff)
Added by Alexander Motin over 4 years ago

Instead of own grub.serialmode variable, use existing FreeBSD one. Ticket: #23147

Revision 47c58504 (diff)
Added by Alexander Motin over 4 years ago

Instead of own grub.serialmode variable, use existing FreeBSD one. Ticket: #23147

Revision 8875cea6 (diff)
Added by Alexander Motin over 4 years ago

Parse kenv hw.uart.console instead of own grub.serial* variables. Ticket: #23147

Revision 6d75d721 (diff)
Added by Alexander Motin over 4 years ago

Set hw.uart.console instead of own grub.serial* variables. This variable really configure serial console with these parameters, while previous ones could leave us with black screen during install. Ticket: #23147

Revision 1ea4bf69 (diff)
Added by Kris Moore over 4 years ago

Fix an issue saving grub serial settings, don't need to do it per-disk, instead break out into its own function Thanks Mav! Ticket: #23147

Revision 229b2647 (diff)
Added by Alexander Motin over 4 years ago

Run ldconfig before running sqlite3. Ticket: #23147

Revision cac1a59d (diff)
Added by Alexander Motin over 4 years ago

Fix hex digits parsing in serial port address. Ticket: #23147

Revision 76afa346 (diff)
Added by Alexander Motin over 4 years ago

Add missing quotes for adv_serialport. This field is declared varchar, and we want numeric port number to be stored there in hex. Without quotes sqlite converts it to decimal. Ticket: #23147

History

#1 Avatar?id=14398&size=24x24 Updated by Kris Moore over 4 years ago

  • Status changed from Unscreened to Screened

#2 Avatar?id=14398&size=24x24 Updated by Kris Moore over 4 years ago

  • Assignee changed from Kris Moore to Alexander Motin

Sasha - I did the installer glue so it should add -Dh to kernel at boot after install. Are there any other bits left or can we move this to build testing?

#3 Updated by Alexander Motin over 4 years ago

I think there can be problem with serial port and speed at stage of getty start. As I see, schema default is COM2 at 9600, that hardly match, at least for the Celestica. With my /etc/ttys modifications serial console on COM1 should work if enabled in GRUB, but I'm afraid it will stop after GRUB config regenerated next time.

#4 Avatar?id=14398&size=24x24 Updated by Kris Moore over 4 years ago

What options do you need me to enable via GRUB? Do we need to put something into the installer to prompt for enabling serial mode and prompt for the COM/SPEED from the user?

#5 Updated by Alexander Motin over 4 years ago

As soon as installer itself supposed to work via serial console (hopefully guessed correctly), it would be fine to just read present values and store them into database. But I am not sure GRUB in installer has any special knowledge for it, so may be the result would be the same if we just set default port/speed in database to COM1/115200. Since we never ever enabled serial console default before now, I don't think it should break anything, but it should be enough for the Puma.

#6 Avatar?id=14398&size=24x24 Updated by Kris Moore over 4 years ago

  • Status changed from Screened to 19
  • Assignee changed from Alexander Motin to Joe Maloney

This should be complete now. By editing the grub menu option to boot with serial mode enabled, you can change the grub.serialspeed to 115200 and grub.serialport to COM1. These values should get saved to the database after install. Joe, is there a way to confirm this works? Perhaps a job for bhyve?

#7 Updated by Sean Fagan over 4 years ago

Is running sqlite the best way to do that? No wrapper command exists?

#8 Avatar?id=14398&size=24x24 Updated by Kris Moore over 4 years ago

AFAIK this hasn't made it into the 'midctl' command (yet). But if I'm wrong, I'll be more than happy to adjust it.

#9 Updated by Alexander Motin over 4 years ago

Sorry, Kris, I was not proposing to invent local variables, since those would to nothing for this specific session. I've made few changes that should better integrate all this magic with real FreeBSD serial console. I haven't fully tested this yet, so will see what next build tell us.

#10 Updated by William Grzybowski over 4 years ago

  • Is duplicate of Bug #23418: libreadline.so.6 not found errors during install added

#11 Updated by Joe Maloney over 4 years ago

I did get a chance to confirm the serial mode works with bhyve.

bhyve -c 2 -m 4G -w -H \
-s 0,hostbridge \
-s 3,ahci-cd,/root/FreeNAS-9.10-MASTER-201704191129-cac1a59.iso \
-s 4,ahci-hd,/root/guest.img \
-s 5,virtio-net,tap0 \
-s 29,fbuf,tcp=0.0.0.0:5900,w=800,h=600,wait \
-s 30,xhci,tablet \
-s 31,lpc -l com1,stdio \
-l bootrom,/usr/local/share/uefi-firmware/BHYVE_UEFI.fd \
vm0

I am also having Bonnie order a few serial cables to test with real hardware as well.

#12 Avatar?id=14398&size=24x24 Updated by Kris Moore over 4 years ago

  • Target version changed from 9.10.3 to 11.0

#13 Avatar?id=14398&size=24x24 Updated by Kris Moore over 4 years ago

  • Status changed from 19 to Resolved
  • Assignee changed from Joe Maloney to Alexander Motin

Looks like this one is resolved, marking it as so.

#15 Updated by Vaibhav Chauhan about 4 years ago

  • Target version changed from 11.0 to 11.0-RC

Also available in: Atom PDF