On 2022-05-06 12:00 -04, Nick Holland <n...@holland-consulting.net> wrote:
> here's a weird one.
>
> HP T430 Thin Client, reloaded with OpenBSD.
> In it's intended use, it runs Linux in BIOS boot mode.  OpenBSD's
> installer will boot that way, but the kernel is unable to see the
> 16g storage device.  In UEFI boot mode, OpenBSD works well,
> including running X.  This machine has ONLY HDMI and DisplayPort
> video connections (one each).  There's no com port on the box for
> an alternative view of what is going on.
>
> The problem comes when I put them to work without a monitor.
>
> The machine will boot fine, run fine...but sysupgrade fails to upgrade
> the system.  It downloads the intended files, it reboots, and a few
> moments later, it's back up and running -- the old kernel. Plug an
> HDMI monitor in, run sysupgrade again, and it sees the upgrade marker
> and does the upgrade.  Textbook Heisenbug :-/
>
> For giggles, I did a sysupgrade -k (keep the files), let it reboot,
> in the root directory was bsd.upgrade as expected.  I copied

Not realy, -k keeps stuff in /home/_sysupgrade. bsd.upgrade gets deleted
by the installer.

My guess is bsd.rd panics when there is not monitor plugged in.
You could plug in a monitor to see why it panics, oh wait... :P

> bsd.upgrade to /bsd, forcing it one way or another to run
> bsd.upgrade ... and the result was a hung system.  Never came back
> after the reboot, no idea why.  When I moved it to be near an HDMI
> monitor, it promptly booted, complained about permissions on
> bsd.upgrade, but upgraded perfectly (but I am not sure which of
> the two copies of the kernel it used).
>
> What can I do to help provide info to determine what is going on
> here?

I can't debug this, but I can tell you a bit about the interaction
between sysupgrade(8), the bootloader and the installer in bsd.rd.

>From there you can figure out how for you got.

sysupgrade downloads the sets into /home/_sysupgrade and verifies them.
Then it creates /auto_upgrade.conf and installs /home/_sysupgrade/bsd.rd
as /bsd.upgrade. so bsd.upgrade is a bsd.rd, there is nothing special
about it. /bsd.upgrade is installed with mode 0700.
Then it execs reboot.

The bootloader checks if there is an executable(!) /bsd.upgrade
available, if so it does a chmod u-x /bsd.upgrade and boots it.
If not it consults /etc/boot.conf and boots /bsd or whatever
/etc/boot.conf says.

The installer then checks if this is an unattended upgrade by checking
if bsd.upgrade and auto_upgrade.conf are present. If so it runs an
unattended upgrade. Very early in that process, after checking the disks
and mounting all partitions, the installer delets bsd.upgrade and
auto_upgrade.conf.

So, if you end up with a /bsd.upgrade on the running system that is
still mode 0700, your bootloader is on the fritz.

If you have a /bsd.upgrade that's 0600 your bootloader found the kernel
and tried to boot it, but the installer didn't get very far.

If there is no /bsd.upgrade after a reboot and no email to root the
installer got rebooted by a watchdog process, otherwise you got an email
to root detailing the upgrade process.

-- 
I'm not entirely sure you are real.

Reply via email to