|
OpenBSD General Other questions regarding OpenBSD which do not fit in any of the categories below. |
|
Thread Tools | Display Modes |
|
|||
How Do You Pass Information To OpenBSD From The Boot Loader?
Esteemed Colleagues:
I have an OpenBSD question that i cannot find answered in the online documentation, so I sought an OpenBSD forum, and this is the only one I found. I hope one of you can answer my question. I do not use OpenBSD for serious work, because it does not support ZFS, but I still hope you can answer my question, because it has been giving me no rest. How do I pass information from the Grub bootloader to my OpenBSD system? The context of my question is that I want to boot OpenBSD in such a way that the xenodm display manager will mirror my two displays, whereas on other occasions I want xenodm not to mirror my displays. Yes, I know that after I log it, I can invoke "xrandr" with the appropriate arguments either to mirror or unmirror my displays; but if I mirror my displays, it is because I want my students to see what is happening from the very beginning. The context of my question is, of course, irrelevant, but I thought you might want to know it. I have two different Grub menu items for booting FreeBSD. One of them does "set kFreeBSD.mdisplay=1" before booting, the other one does not. Then, once the system is running, the display manager, in the appropriate Xsetup* script, examines the output of "kenv mdisplay", which tells the display manager whether or not to mirror the displays with xrandr. But OpenBSD does not have a "kenv" command, so I cannot use that strategy on OpenBSD. I also have three different Linux distributions on my laptop (LinuxMint, OpenSuSE, and a Red Hat clone). When I boot Linux, I can add "mdisplay" to the kernel arguments, in the "linux" line that specifies the kernel and its arguments. Then, once the system is running, the display manager, in the appropriate Xsetup* script, examines the contents of "/proc/cmdline", and, if it contains "mdisplay", uses "xrandr" to mirror the displays. But OpenBSD dropped the /proc filesystem several years ago (parenthetical question: aren't later releases supposed to be better than earlier releases, and not inferior to them?), and, even when it had a /proc filesystem, never supported "/proc/cmdline". The funny thing is that Grub does pass arguments to the kernel -- it says "kopenbsd /bsd -r sd0a" -- but I cannot find, anywhere in the documentation, a technique for a user-level program to access those arguments. Thank you in advance for any and all replies. jay at m5 dot chicago dot il dot us |
|
|||
Quote:
https://man.openbsd.org/boot.conf.8#set https://man.openbsd.org/dmesg
__________________
Signature: Furthermore, I consider that systemd must be destroyed. Based on Latin oratorical phrase Last edited by e1-531g; 1st August 2020 at 11:20 AM. Reason: add second link |
|
||||
Quote:
EDIT: to set your monitors up as desired perhaps add a scripted mechanism to ~/.xsession.
__________________
Are you infected with Wetiko? |
|
|||
Quote:
Here's how I, for now, solved my problem, but it is inelegant: I copied /bsd to /bsd_m and edited the latter file with emacs, changing the place where "uname" finds the name of the OS, from "OpenBSD" to "OpemBSD". I have two grub menuitems for booting OpenBSD, one that boots /bsd and one that boots /bsd_m and is otherwise identical. The "xenodm" command, in the appropriate XSetup_* file, checks whether the output of "uname -s" is equal to "OpemBSD" and if it is (i.e., if the bootloader booted /bsd_m rather than /bsd), it tells xrandr to mirror the two displays. This is a highly undesirable solution -- one has to have a separate copy of the operating system for every variation of the boot options one might want to pass! -- and I welcome a better solution if anyone reading this can come up with one. jay at m5 dot chicago dot il dot us |
|
||||
Thank you for the correction; my knowledge was based on Grub v1.
OpenBSD's second stage bootloader can pass a string to the OpenBSD kernel, see the set option "howto" in the boot(8) man page. But looking through kernel source code, this string appears (to me) to be a way to indicate only the various boot options -a -c -d and -s. |
|
|||
I chainloaded OpenBSD bootloader from Grub somehow in the past, but I can't provide details how I done this.
__________________
Signature: Furthermore, I consider that systemd must be destroyed. Based on Latin oratorical phrase |
|
||||
I use this to chainload OpenBSD's EFI loader from GRUB v2:
Code:
menuentry 'OpenBSD' { search --fs-uuid --set=root $uuid chainloader /EFI/BOOT/BOOTX64.EFI }
__________________
Are you infected with Wetiko? |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Loader, MBR and the boot process | Jago | FreeBSD Installation and Upgrading | 1 | 22nd January 2010 04:52 AM |
How to boot from a CD with the FreeBSD BTX Loader? | Turquoise88 | FreeBSD General | 6 | 25th August 2009 04:16 PM |
How to disable FreeBSD boot loader? | Turquoise88 | FreeBSD General | 2 | 17th July 2009 03:11 PM |
Deleted my /boot/loader | enpey | FreeBSD General | 16 | 10th June 2008 10:02 PM |
How to modify the boot loader? | Sunsawe | FreeBSD General | 5 | 29th May 2008 05:13 AM |