Re: boot drive hide and seek on new notebook

2020-04-29 Thread Stuart Henderson
On 2020-04-29, f.holop  wrote:
> f.holop - Wed, 29 April 2020 at 14:57:46
>> i'll try to make a similar test with some linux live distro to see
>> if i get similar results.
>
> I have tested MX linux install ISO that also doubles as a Live distro.
>
> In the end it's apples and oranges because I use the openbsd USB key to
> boot the system from the internal drive ("boot hd1a:bsd"),
> while the Live Linux boots from the USB key and runs from RAM (so more
> like a beefed up "boot hd0a:bsd.rd")...
>
> Nevertheless linux detects the nvme drive in all cases (entering
> BIOS/not entering BIOS).

Of course, because by that point it's running its own nvme driver
in the kernel, not relying on bios/uefi.

> This inspired me to let the openbsd USB key boot up all the way when the
> internal drive was not detected in the first stage boot.  The internal
> drive was right there in `dmesg`, `sysctl hw`, `disklabel`, etc.  I
> could mount it while running off of the USB key.

That's totally expected. As with Linux, by that point it's running
its own nvme driver in the kernel.

> "Elemental."  With all these reboots I have worked out how this sorry
> excuse for a BIOS's boot order mechanism works, and it's horrible:

sounds pretty standard tbh :)




Re: boot drive hide and seek on new notebook

2020-04-29 Thread f.holop
f.holop - Wed, 29 April 2020 at 14:57:46
> i'll try to make a similar test with some linux live distro to see
> if i get similar results.

I have tested MX linux install ISO that also doubles as a Live distro.

In the end it's apples and oranges because I use the openbsd USB key to
boot the system from the internal drive ("boot hd1a:bsd"),
while the Live Linux boots from the USB key and runs from RAM (so more
like a beefed up "boot hd0a:bsd.rd")...

Nevertheless linux detects the nvme drive in all cases (entering
BIOS/not entering BIOS).


This inspired me to let the openbsd USB key boot up all the way when the
internal drive was not detected in the first stage boot.  The internal
drive was right there in `dmesg`, `sysctl hw`, `disklabel`, etc.  I
could mount it while running off of the USB key.

I think this makes the case less clear cut... Who knows what the BIOS
is doing with/without entering, but the kernel has no difficulties
seeing the drive in either case, just like linux.


Astute readers will notice that there is discrepancy in my story:

I said I can't change the boot order without entering the BIOS, but
entering the BIOS makes the internal disk show up. How could I have
this then:

probing: pc0 mem[636k 1928M 14304M]
disk: hd0


"Elemental."  With all these reboots I have worked out how this sorry
excuse for a BIOS's boot order mechanism works, and it's horrible:

It is not possible to select a generic slot like "USB media" or such.
Only when the device is bootable and is recognized by the BIOS, only
then does it show up in the dropdown and can be put in the first boot
slot.  Even then, it is remembered between reboots only until it's not
removed from the port.

It is between these types of reboots (not entering the BIOS, but the USB
key is still "remembered") that the system is booting from USB (without
entering the BIOS), however the internal drive does not show up in first
stage boot.

I wonder how many of the newer ASUS notebooks behave like this and if
this is the future, or just some frankenstein experiment...

When clearing the secure boot keys disappears from the BIOS menus,
I guess it's game over.

-f
-- 



Re: boot drive hide and seek on new notebook

2020-04-29 Thread f.holop
Stuart Henderson - Wed, 29 April 2020 at 12:24:50
> The boot loader only has access to what bios/uefi makes available,
> it looks like it isn't setting up your nvme device if you boot from USB
> unless you go through that menu. There isn't much OpenBSD can do about this.

i'll try to make a similar test with some linux live distro to see
if i get similar results.

-f
-- 



Re: boot drive hide and seek on new notebook

2020-04-29 Thread Stuart Henderson
On 2020-04-28, f.holop  wrote:
> hi,
>
> i am trying to run openbsd on a very new notebook and it kind of works.
>
> i have taken away some space from win10 and created a partition, and the
> installation went well.  atm i dont want to create a boot menu, so i
> just insert a usb key with openbsd installed on it, and i select the
> kernel from the internal drive.  however...  this is a normal boot:
>
>
> probing: pc0 mem[636k 1928M 14304M]
> disk: hd0
>>> OpenBSD/amd64 BOOTX64 3.50
> boot> machine diskinfo
> DiskBlkSiz  IoAlign SizeFlags   Checksum
> hd0 512 0   3919MB  0x2 0xa3b9b69  Removable
>
>
> the internal nvme disk is nowhere to be seen.
> but i have just installed openbsd on it...
>
> another boot, this time i enter the BIOS, and it has a menu to select
> the boot device manually, so i select the USB key:
>
>
> probing: pc0 mem[636k 1928M 14304M]
> disk: hd0 hd1
>>> OpenBSD/amd64 BOOTX64 3.50
> boot> machine diskinfo
> DiskBlkSiz  IoAlign SizeFlags   Checksum
> hd0 512 0   3919MB  0x2 0xa3b9b69  Removable
> hd1 512 4   953GB   0x2 0x122409ee
> boot> b hd1a:/bsd
> ...
>
> and success.  but unless i enter the bios, the internal drive is not in
> that list.  i think the installation process went well because i also
> had to enter the BIOS to select the usb key to boot from.

The boot loader only has access to what bios/uefi makes available,
it looks like it isn't setting up your nvme device if you boot from USB
unless you go through that menu. There isn't much OpenBSD can do about this.




Re: boot drive hide and seek on new notebook

2020-04-29 Thread Strahil Nikolov
On April 29, 2020 12:06:02 PM GMT+03:00, "f.holop"  wrote:
>Chris Bennett - Tue, 28 April 2020 at 23:03:32
>> Some BIOS's require you to select legacy boot and legacy boot before
>> UEFI in order to boot off of a USB. Also might need to turn off boot
>> security option, too.
>> 
>> A lot of BIOS's suck nowadays. Who woulda thought that examining the
>> BIOS would become a purchasing decision?
>
>couple of points i did not go into (but i plan to make a longer
>writeup):
>
>1. legacy boot is NOT an option in this BIOS. the ASUS knowledge
>base site says this option was removed for any Coffee Lake or later
>CPU,
>so it's not coming back. For me this is an issue only because my old
>notebook cannot boot UEFI, and this new one cannot boot legacy :D
>so i cannot share the usb key between them.
>
>2. secure boot MUST be disabled.  no way to boot a usb key otherwise
>without mucking with platform keys or such.  In this particular (full
>GUI) BIOS with a "dumb mode" and an "advanced mode", there is no
>"disable secure boot" option and the installed secure keys must be
>NUKED
>for secure boot to be disabled.
>
>I agree that BIOS is very important, but it's impossible to use it as a
>purchasing decision.  It is never indicated in the tech specs, and i
>havent bought a notebook in a shop where i MIGHT be allowed to enter
>the
>bios in more than a decade.  Even then, an update might change anything
>in a flash of an eye.
>
>
>Besides sharing information in my email I was kind of asking if maybe
>the boot program needs some changes to be able to detect the boot drive
>even without entering the BIOS (which seems to initialize something
>that
>makes the detection work as it is).
>
>To reiterate: if the boot order is changed in BIOS and saved, at
>startup
>the USB key boots up, but sees only itself.  If I enter the BIOS and
>use
>the boot order menu there to select the usb key, it boots up and sees
>the internal drive as well.
>
>-f

Have you tried  to edit the windows boot loader and somehow boot the openBSD?

I have done that approach  ages  ago where grub was on second disk and I made 
windows boot loader (legacy mode)  to boot from the next disk and then grub 
kicked in.

Of course , you can try the opposite  - somehow openBSD to boot the windows :)

Best Regards,
Strahil Nikolov



Re: boot drive hide and seek on new notebook

2020-04-29 Thread f.holop
Chris Bennett - Tue, 28 April 2020 at 23:03:32
> Some BIOS's require you to select legacy boot and legacy boot before
> UEFI in order to boot off of a USB. Also might need to turn off boot
> security option, too.
> 
> A lot of BIOS's suck nowadays. Who woulda thought that examining the
> BIOS would become a purchasing decision?

couple of points i did not go into (but i plan to make a longer
writeup):

1. legacy boot is NOT an option in this BIOS. the ASUS knowledge
base site says this option was removed for any Coffee Lake or later CPU,
so it's not coming back. For me this is an issue only because my old
notebook cannot boot UEFI, and this new one cannot boot legacy :D
so i cannot share the usb key between them.

2. secure boot MUST be disabled.  no way to boot a usb key otherwise
without mucking with platform keys or such.  In this particular (full
GUI) BIOS with a "dumb mode" and an "advanced mode", there is no
"disable secure boot" option and the installed secure keys must be NUKED
for secure boot to be disabled.

I agree that BIOS is very important, but it's impossible to use it as a
purchasing decision.  It is never indicated in the tech specs, and i
havent bought a notebook in a shop where i MIGHT be allowed to enter the
bios in more than a decade.  Even then, an update might change anything
in a flash of an eye.


Besides sharing information in my email I was kind of asking if maybe
the boot program needs some changes to be able to detect the boot drive
even without entering the BIOS (which seems to initialize something that
makes the detection work as it is).

To reiterate: if the boot order is changed in BIOS and saved, at startup
the USB key boots up, but sees only itself.  If I enter the BIOS and use
the boot order menu there to select the usb key, it boots up and sees
the internal drive as well.

-f
-- 



Re: boot drive hide and seek on new notebook

2020-04-28 Thread Chris Bennett
Some BIOS's require you to select legacy boot and legacy boot before
UEFI in order to boot off of a USB. Also might need to turn off boot
security option, too.

A lot of BIOS's suck nowadays. Who woulda thought that examining the
BIOS would become a purchasing decision?

A future BIOS update might make things better, or impossible.
Good news is that you got it to work.

Chris Bennett




boot drive hide and seek on new notebook

2020-04-28 Thread f.holop
hi,

i am trying to run openbsd on a very new notebook and it kind of works.

i have taken away some space from win10 and created a partition, and the
installation went well.  atm i dont want to create a boot menu, so i
just insert a usb key with openbsd installed on it, and i select the
kernel from the internal drive.  however...  this is a normal boot:


probing: pc0 mem[636k 1928M 14304M]
disk: hd0
>> OpenBSD/amd64 BOOTX64 3.50
boot> machine diskinfo
DiskBlkSiz  IoAlign SizeFlags   Checksum
hd0 512 0   3919MB  0x2 0xa3b9b69  Removable


the internal nvme disk is nowhere to be seen.
but i have just installed openbsd on it...

another boot, this time i enter the BIOS, and it has a menu to select
the boot device manually, so i select the USB key:


probing: pc0 mem[636k 1928M 14304M]
disk: hd0 hd1
>> OpenBSD/amd64 BOOTX64 3.50
boot> machine diskinfo
DiskBlkSiz  IoAlign SizeFlags   Checksum
hd0 512 0   3919MB  0x2 0xa3b9b69  Removable
hd1 512 4   953GB   0x2 0x122409ee
boot> b hd1a:/bsd
...

and success.  but unless i enter the bios, the internal drive is not in
that list.  i think the installation process went well because i also
had to enter the BIOS to select the usb key to boot from.


here i would like to say, that amazingly, most stuff worked when i
booted up openbsd on this ASUS ROG Zephyrus gaming machine (despite
the sea of "unknown" devices ;).

here is a dmesg:


OpenBSD 6.7-beta (GENERIC.MP) #157: Sat Apr 25 15:58:34 MDT 2020
dera...@amd64.openbsd.org:/usr/src/sys/arch/amd64/compile/GENERIC.MP
real mem = 17005793280 (16217MB)
avail mem = 16477765632 (15714MB)
mpath0 at root
scsibus0 at mpath0: 256 targets
mainbus0 at root
bios0 at mainbus0: SMBIOS rev. 3.2 @ 0x7a9e9000 (37 entries)
bios0: vendor American Megatrends Inc. version "GX531GW.306" date 06/28/2019
bios0: ASUSTeK COMPUTER INC. Zephyrus S GX531GW_GX531GW
acpi0 at bios0: ACPI 6.1
acpi0: sleep states S0 S3 S4 S5
acpi0: tables DSDT FACP APIC FPDT FIDT MCFG ECDT SSDT SSDT MSDM SSDT SSDT HPET 
UEFI LPIT SSDT SSDT DBGP DBG2 SSDT DMAR SSDT SSDT TPM2 BGRT SSDT WSMT
acpi0: wakeup devices PEG0(S4) PEGP(S4) PEG1(S4) PEGP(S4) PEG2(S4) PEGP(S4) 
XHC_(S3) XDCI(S4) HDAS(S4) AWAC(S4)
acpitimer0 at acpi0: 3579545 Hz, 24 bits
acpimadt0 at acpi0 addr 0xfee0: PC-AT compat
cpu0 at mainbus0: apid 0 (boot processor)
cpu0: Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz, 2096.70 MHz, 06-9e-0a
cpu0: 
FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE,SSE3,PCLMUL,DTES64,MWAIT,DS-CPL,VMX,EST,TM2,SSSE3,SDBG,FMA3,CX16,xTPR,PDCM,PCID,SSE4.1,SSE4.2,x2APIC,MOVBE,POPCNT,DEADLINE,AES,XSAVE,AVX,F16C,RDRAND,NXE,PAGE1GB,RDTSCP,LONG,LAHF,ABM,3DNOWP,PERF,ITSC,FSGSBASE,TSC_ADJUST,SGX,BMI1,AVX2,SMEP,BMI2,ERMS,INVPCID,MPX,RDSEED,ADX,SMAP,CLFLUSHOPT,PT,MD_CLEAR,TSXFA,IBRS,IBPB,STIBP,L1DF,SSBD,SENSOR,ARAT,XSAVEOPT,XSAVEC,XGETBV1,XSAVES,MELTDOWN
cpu0: 256KB 64b/line 8-way L2 cache
cpu0: smt 0, core 0, package 0
mtrr: Pentium Pro MTRR support, 10 var ranges, 88 fixed ranges
cpu0: apic clock running at 24MHz
cpu0: mwait min=64, max=64, C-substates=0.2.1.2.4.1.1.1, IBE
cpu1 at mainbus0: apid 2 (application processor)
cpu1: Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz, 2095.13 MHz, 06-9e-0a
cpu1: 
FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE,SSE3,PCLMUL,DTES64,MWAIT,DS-CPL,VMX,EST,TM2,SSSE3,SDBG,FMA3,CX16,xTPR,PDCM,PCID,SSE4.1,SSE4.2,x2APIC,MOVBE,POPCNT,DEADLINE,AES,XSAVE,AVX,F16C,RDRAND,NXE,PAGE1GB,RDTSCP,LONG,LAHF,ABM,3DNOWP,PERF,ITSC,FSGSBASE,TSC_ADJUST,SGX,BMI1,AVX2,SMEP,BMI2,ERMS,INVPCID,MPX,RDSEED,ADX,SMAP,CLFLUSHOPT,PT,MD_CLEAR,TSXFA,IBRS,IBPB,STIBP,L1DF,SSBD,SENSOR,ARAT,XSAVEOPT,XSAVEC,XGETBV1,XSAVES,MELTDOWN
cpu1: 256KB 64b/line 8-way L2 cache
cpu1: smt 0, core 1, package 0
cpu2 at mainbus0: apid 4 (application processor)
cpu2: Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz, 2095.13 MHz, 06-9e-0a
cpu2: 
FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE,SSE3,PCLMUL,DTES64,MWAIT,DS-CPL,VMX,EST,TM2,SSSE3,SDBG,FMA3,CX16,xTPR,PDCM,PCID,SSE4.1,SSE4.2,x2APIC,MOVBE,POPCNT,DEADLINE,AES,XSAVE,AVX,F16C,RDRAND,NXE,PAGE1GB,RDTSCP,LONG,LAHF,ABM,3DNOWP,PERF,ITSC,FSGSBASE,TSC_ADJUST,SGX,BMI1,AVX2,SMEP,BMI2,ERMS,INVPCID,MPX,RDSEED,ADX,SMAP,CLFLUSHOPT,PT,MD_CLEAR,TSXFA,IBRS,IBPB,STIBP,L1DF,SSBD,SENSOR,ARAT,XSAVEOPT,XSAVEC,XGETBV1,XSAVES,MELTDOWN
cpu2: 256KB 64b/line 8-way L2 cache
cpu2: smt 0, core 2, package 0
cpu3 at mainbus0: apid 6 (application processor)
cpu3: Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz, 2095.13 MHz, 06-9e-0a
cpu3: