vmware / photon-os-installer

Photon OS Installer
Other
12 stars 18 forks source link

photon-os-installer boot on usb-c hub environments #14

Closed dcasota closed 8 months ago

dcasota commented 1 year ago

Is your feature request related to a problem? Please describe.

Hi @gpiyush-dev, The latest release with multiple partitions support is great. * congrats !

In https://github.com/vmware/photon/issues/1300#issuecomment-1319864452, see the Photon OS aarch64 on RPI4 scenario with usb-c hub attached mmc sdcards. Actually, photon-os-installer boots from the usb-c adapter plugged-in mmc sdcard, but doesn't do anything with that one or any additional mmc sdcard as they are not recognized during Photon OS aarch64 minimal setup boot.

Describe the solution you'd like

Detect usb-c hub attached medias (mmc, usb)

Describe alternatives you've considered

Provisioning Photon OS on RPI4 works with directly attached usb media.

Additional context

No response

dcasota commented 1 year ago

Here a photon-os-installer update using the 5.0 early beta iso bits, on baremetal x86_64 laptop, in addition to J)K) in https://github.com/vmware/photon/issues/1385.

I've tried two tecniques: 1) Rufus provisioned media of Photon OS 5.0 early iso bits 2) Ventoy configured media with Photon OS 5.0 early beta iso bits on it.

1) With a Rufus provisioned media, booting from mmc sd card / usb media stops after the initial Photon OS screen with "error: bad shim signature". Same result without/with usb-c hub environment.

2) With a Ventoy configured media, Photon-os-installer successfully boots from the usb-c adapter plugged-in media (mmc sdcard or usb media) and installs Photon OS on another plugged-in mmc sd card / usb media. But then, booting from that mmc sd card / usb media stops after the initial Photon OS screen with "error: bad shim signature".

dcasota commented 1 year ago

Here a finding.

On a baremetal x86_64 laptop with secure boot enabled, a Ventoy usb media boots a slipstreamed photon-4.0-5347f73fc.iso in Ventoy' grub2 mode. The Photon-os-installer starts from the usb-c adapter plugged-in media (usb). It installs Photon OS on another plugged-in mmc sd card. The installation remains quite while on partitioning. During this phase I've switched the screen (alt-F2) and displayed dmesg output. There is a flood of messages "usb2-port4: Cannot enable. Maybe the USB cable is bad?"

usb2-port4

Nevertheless, the partitioning succeeds and the installation successfully finishes. Now, this works with 1x usb media and 1 mmc card on the plugged-in usb-c adapter hub. With a 2nd mmc card, the partitioning takes longer and the installation often fails. Tested with different mmc cards. These "usb2-port4" messages aren't good.

As expected for now, booting from the prepared mmc media stops after the initial Photon OS screen with "error: bad shim signature".

YustasSwamp commented 1 year ago

Hi @dcasota , The USB cable error message can be result of bad cable), usb hub or usb port. To get more kernel debug messages you can try booting with cmdline parameter dyndbg="file drivers/usb/core/hub.c +p"

I didn't get the signature issue details and why it is expected.

BTW, there 2 additional options how you can install Photon OS on mmc card. In both cases you can run photon installer without booting installer ISO. You can use Photon box or even photon docker image for the next 2 options:

  1. run photon installer directly as a python app and to specify external mmc card as a target disk.
  2. run photon installer directly as a python app and use loopback attached raw file. Later this file can be flashed to mmc card.
dcasota commented 1 year ago

Hi @YustasSwamp,

Thank you for the suggestions.

usb-c scenarios with secure boot + usb media, mmc, [fill-in], still is developer space. Unfortunately, I'm not skilled enough for kernel debug tasks.

To use the Ventoy boot tool as previously assumed alternative for the missing shim signature enhancement does not fit. This is the message for the moment.

In addition, Ventoys' grub2 mode - which uses his own shim signature - is based on grub2.04 and cmdline parameter dyndbg isn't supported.

Here's the GUI trace:

  1. Ventoy with the photon-4.0-5347f73fc.iso boots from the selected usb hard drive (uefi) media.
    ph4_ventoy1

  2. Ventoy boot screen lists all isos on the media. Select photon-4.0-5347f73fc.iso .
    ph4_ventoy2

  3. Select grub2 mode
    ph4_ventoy3

  4. In grub2 mode, add cmdline parameter dyndbg="file drivers/usb/core/hub.c +p"
    ph4_ventoy4

  5. The cmdline parameter isn't supported. This isn't depicted, but systemd.debug-shell=1 isn't recognized in Ventoys' grub2 mode as well. ph4_ventoy5

As described, in grub2 mode (without cmdline parameter dyndbg), the photon-4.0-5347f73fc.iso successfully installs e.g. on a mmc card. The usb-c adapter hub is a relatively new ISY adapter IAD-1025 USB-C 6-in-1 hub. The only finding was the time amount during partitioning and the dmesg entries "usb2-port4: Cannot enable. Maybe the USB cable is bad?".

Of course, Secure Boot, with Ventoy normal mode or without Ventoy, uses Photon OS installer grub' version, but as any shim signature is missing, Secure Boot fails. Hence, the parameter dyndbg doesn't help.

The "expectation" refers to https://communities.vmware.com/t5/Photon-OS-Discussions/How-to-install-and-configure-Wi-Fi-drivers-in-Photon-OS/m-p/2934678/highlight/true#M342 and means no time frame.

No doubt, the 2 additional options will help in a future Secure Boot constellation.

I hope the pictures and description help. -Daniel

dcasota commented 1 year ago

fyi re-tested the issue constellation with latest slipstreamed Ph5.0 bits, but no progress yet.

  1. student lab 1x ISY adapter IAD-1025 USB-C 6-in-1 hub 1x Usb media kingston traveler 64GB 1x Raspberry Pi 4B (8GB Ram) with 32GB sdcard IMG_1692

  2. RPi4 boot from usb media (kingston traveler), provisioned with photon-minimal-5.0-dde71ec57.aarch64.iso IMG_1689

  3. Photon-os-installer starts but fails because it does NOT detect the usb media (kingston traveler, see above), plugged-in on a usb-c hub. The RPi4 (firmware) sdcard is detected only. IMG_1690

dcasota commented 8 months ago

usb-c hub attached medias (mmc, usb) remained unsupported