Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add sdcard image with EFI partition #63

Closed
wants to merge 1 commit into from

Conversation

amazingfate
Copy link
Contributor

We can flash this image to sdcard or emmc so that we can install system on itself later.

@mariobalanica
Copy link
Collaborator

Can you explain a bit why/if this is necessary?
Even though the current image is not conformant due to lack of GPT backup at the end (done on purpose to avoid overwriting NVRAM), I was still able to partition it just fine in Windows, and Linux can deal with this too.

I'd prefer continuing to have a single image per board in the releases and leaving the partitioning up to the user. Predefined 300 MB ESP can be either too small or just wasted space, depending on each one's use case. Multiple images are also going to confuse some folks.

@amazingfate amazingfate marked this pull request as draft July 29, 2023 14:38
@amazingfate
Copy link
Contributor Author

The 300MB EFI partition is not necessary. But I want to create a partition to protect the uefi firmware so that installer will not overwrite the firmware. The current efi firmware has a 8MB partition, but that size is not enough to cover all the firmware.

@mariobalanica
Copy link
Collaborator

I don't see why it would overwrite the firmware. The entire image ends at offset 0x7EFFFF (8323071), while the 8 MB partition ends at 0x8FFE00 (9436672).
This partition covers the ITB image entirely (0x100000 - 0x7EFFFF). The two IDBLoader images (at 0x8000 and 0x88000) do indeed precede it, but I do not expect them to be overwritten.

Has this happened to you?

@amazingfate
Copy link
Contributor Author

I earsed my tf card and flashed the current spi nor image to it. I can see a 8MB partiton with name uboot from command gdisk -l /dev/mmcblk1, but I can't see this partition in calamares installer or gparted. Gparted asks me to create a new partition table.
Here is the iso I test: https://github.com/amazingfate/rk3588-live-iso/releases/download/20230728-0505/debian-bookworm-live-arm64.hybrid.iso

@amazingfate
Copy link
Contributor Author

misc/rk3588_spi_nor_gpt.img is really a black box shit. Without it I always get [Bds] Unable to boot! and then reboot.

@amazingfate
Copy link
Contributor Author

I can't see the 8MB partition because I'm using dd to flash the image to sd card. If I flash the image by balenaEtcher on windows I can boot see the partition.

@derzahla
Copy link

derzahla commented Aug 14, 2023

@amazingfate This makes perfect sense to me and would really nice in fact. Ive spent many hours trying to boot this from sdcard that the author indicates can be done and that instructions are provided on the install page but then the only instructions say just 'flash it' but not how. dd, the gold standard for writing images to stuff yields a unbootable and unpartitioned disk from linux/opi5+ so Im left to guess and guess . balena etcher on linux yields the same and i dont have windows to try it on.

@amazingfate
Copy link
Contributor Author

@amazingfate This makes perfect sense to me and would really nice in fact. I dont know why the author sees no value in this PR. Ive wasted too many hours dicking around with this hybrid mbr POS that the author says can be flashed to an sdcard and that instructions are provided on the install page but then there arent any instructions at all. dd, the gold standard for writing images to stuff yields garbage so Im left to guess and guess . balena etcher on linux yields the same and i dont have window to try it on. Now i have to wake up for work in 3 hours F#&*HK!!

This PR is not perfect. It doesn't have EFI var support so you can't store anything. You can try the latest nightly build which has a 8MB partition.

@nicolho
Copy link

nicolho commented Aug 14, 2023

Don't lose hope, I can report success ! I had planned for a few days to try WoR on my Orange PI 5+, and I was lucky enough to test this today for my first try, with the latest nightly build.
I didn't want to mess with rkdevtool and my current SPI Nor flash content, so I just flashed it to an sdcard with balenaEtcher (which creates all the needed partitions). The card booted properly, and then (almost) right away to an usb3 stick prepared with "Windows on Raspberry imager".

I say almost right away, because first, I only had to find which of my usb3 hubs would let my "Windows install" usb stick be detected. I had the best result with one connected to the USB-C port. (after that, I mostly had problems to complete the Windows setup, I had to to reflash the sitck, and tried different things to get rid of some blocking "oobe" stuff...until it worked)

It took me the whole day to complete the Windows install, but as I'm writing these words, I finally reached the WoA desktop (with keyboard, mouse and unstable usb ethernet) at last. Anyway, the UEFI part worked like a breath, so many thanks to @mariobalanica (and @amazingfate for this thread). Keep up the good work Mario !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants