"No boot partition" for BOOTBOOT on a FAT32 image

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
DanB91
Posts: 8
Joined: Thu Dec 12, 2019 7:07 am

"No boot partition" for BOOTBOOT on a FAT32 image

Post by DanB91 »

Hi,

I am trying to get my FAT32 image to run using BOOTBOOT and I am running into a "No boot partition" error (image attached). Looking at the docs, it says if you are using FAT32, this means that the partition may be "inconsistent". Not knowing exactly what that meant, I looked through bootboot.asm and found the possible place of failure (image attached). It looks like it's looking for 0xAA55 and then the string 'INITRD' 8 bytes later. Looking at a hexdump, I do not see that pattern anywhere in my FAT32 image file. I do have my INITRD file in /BOOTBOOT/INITRD in the image. 2 questions:

1) What do I have to do to get the pattern (0x55 0xAA ?? ?? 'INITRD') it is looking for?
2) I'd like to know where in the image it's searching and it looks like it starts at address 0xC8000, but I don't know what this maps to. What is the significance of this address? It's not referenced anywhere else.

Thanks!
no partition found
no partition found
possible place of failure
possible place of failure
LtG
Member
Member
Posts: 384
Joined: Thu Aug 13, 2015 4:57 pm

Re: "No boot partition" for BOOTBOOT on a FAT32 image

Post by LtG »

I don't know BOOTBOOT, quick search found this:
https://gitlab.com/bztsrc/bootboot

Where did you find BOOTBOOT? Did you read the instructions? The above link talks about ELF64 or PE32+ executable inside an initrd (initial ram disk). So maybe read that and follow the instructions.

Seems to bzt's handiwork.

There was also this:
https://gitlab.com/bztsrc/bootboot/blob ... 1st_ed.pdf

Though didn't read that, disagreed with first few paragraphs, so stopped reading..

Out of curiosity, you could use the common tools (grub for instance) which have good instructions in the osdev wiki, or you can venture out on your own, but that usually means you need to figure stuff out on your own. So how did you decide to use BOOTBOOT, and not find the instructions for it?
Octocontrabass
Member
Member
Posts: 6282
Joined: Mon Mar 25, 2013 7:01 pm

Re: "No boot partition" for BOOTBOOT on a FAT32 image

Post by Octocontrabass »

DanB91 wrote:I am trying to get my FAT32 image to run using BOOTBOOT and I am running into a "No boot partition" error (image attached).
Is your image partitioned with GPT?
DanB91 wrote:1) What do I have to do to get the pattern (0x55 0xAA ?? ?? 'INITRD') it is looking for?
Put your initrd in an option ROM.
DanB91 wrote:2) I'd like to know where in the image it's searching and it looks like it starts at address 0xC8000, but I don't know what this maps to. What is the significance of this address? It's not referenced anywhere else.
That's where option ROMs are located.

I think you're looking at the code for loading from an option ROM and not the code for loading from disk.
User avatar
bzt
Member
Member
Posts: 1584
Joined: Thu Oct 13, 2016 4:55 pm
Contact:

Re: "No boot partition" for BOOTBOOT on a FAT32 image

Post by bzt »

Hi,

Thanks for checking out my boot loader!

About your issue, @Octocontrabass is perfectly right in everything. You are looking at the code which locates the initrd in a ROM image. The disk storage code starts at line 1030.

The error message you're getting means one of these:
1. you probably have a valid GPT, otherwise the message would be "no gpt found", line 1041
2. in the GPT there's no partition with bootable flag set (EFI_PART_USED_BY_OS, attrib bit 2). This is optional to let you choose a partition explicitly, line 1063
3. if there's no partition flagged, then there's no partition with ESP UUID either (most likely this is your problem), line 1072
4. if partition found, it does not contain a FAT file system (the code explicitly checks for "FAT16" and "FAT32" magic bytes in the BPB), line 1108
5. the FAT partition does not contain a directory named "BOOTBOOT" in it's root directory, line 1203

Please note that due to licensing issues, the loader only uses 8+3 MSDOS file names, so if you have only LFN entry for the BOOTBOOT directory, it won't be able to find it (some fs creators are only saving the LFN entry to avoid these licensing issues).

It is not the case here, but be aware that there's an unresolved issue with some compressed initrd in the BIOS implementation, not all images are handled properly (I didn't had the time to debug this yet but I'm on it. With the RPi and EFI versions all compressed images work without a problem, but for the BIOS version there's a 50%-50% chance that it can't be uncompressed. If you want to use the BIOS version, I'd recommend uncompressed initrd images only for the time being).

Cheers,
bzt
Octocontrabass
Member
Member
Posts: 6282
Joined: Mon Mar 25, 2013 7:01 pm

Re: "No boot partition" for BOOTBOOT on a FAT32 image

Post by Octocontrabass »

bzt wrote:1. you probably have a valid GPT, otherwise the message would be "no gpt found", line 1041
No such error message exists. If no GPT is found, the error message will be "No boot partition".
bzt wrote:2. in the GPT there's no partition with bootable flag set (EFI_PART_USED_BY_OS, attrib bit 2). This is optional to let you choose a partition explicitly, line 1063
3. if there's no partition flagged, then there's no partition with ESP UUID either (most likely this is your problem), line 1072
4. if partition found, it does not contain a FAT file system (the code explicitly checks for "FAT16" and "FAT32" magic bytes in the BPB), line 1108
5. the FAT partition does not contain a directory named "BOOTBOOT" in it's root directory, line 1203
If any of these things are the problem, the error message will be "Initrd not found".
User avatar
bzt
Member
Member
Posts: 1584
Joined: Thu Oct 13, 2016 4:55 pm
Contact:

Re: "No boot partition" for BOOTBOOT on a FAT32 image

Post by bzt »

Octocontrabass wrote:...
No such error message exists. If no GPT is found, the error message will be "No boot partition".

...
If any of these things are the problem, the error message will be "Initrd not found".
Eh, my mistake, you're right. It was long time ago when I wrote this code, it had evolved a lot since, and I haven't touched it for years because it just worked for me :-) Probably I should revise the messages and replace them with more specific texts. Good point!

@DanB91: stay tuned, soon you'll now exactly what's missing in your configuration.

EDIT: fixed. Now if there's no GPT, "no GPT found" is the message. If there's no FAT partition with ESP UUID or EFI_USED_BY_OS bit and a BOOTBOOT directory in the root dir, then the message is "no boot partition". If initrd is not found in that directory, then the message is "Initrd not found".

The "no boot partition" message can't be more specific, because it is perfectly valid to have 3 FAT partitions, all with EFI_USED_BY_OS flag, but only the last having a BOOTBOOT directory. (It would be better if GPT had a unique bootable flag like MBR's 0x80 which can be set on only one partition at a time, but it has not.)

EDIT2: gzip in BIOS version fixed too. All compressed images that were reported broken are now booting successfully.

Cheers,
bzt
DanB91
Posts: 8
Joined: Thu Dec 12, 2019 7:07 am

Re: "No boot partition" for BOOTBOOT on a FAT32 image

Post by DanB91 »

bzt wrote:
Octocontrabass wrote:...
No such error message exists. If no GPT is found, the error message will be "No boot partition".

...
If any of these things are the problem, the error message will be "Initrd not found".
Eh, my mistake, you're right. It was long time ago when I wrote this code, it had evolved a lot since, and I haven't touched it for years because it just worked for me :-) Probably I should revise the messages and replace them with more specific texts. Good point!

@DanB91: stay tuned, soon you'll now exactly what's missing in your configuration.

EDIT: fixed. Now if there's no GPT, "no GPT found" is the message. If there's no FAT partition with ESP UUID or EFI_USED_BY_OS bit and a BOOTBOOT directory in the root dir, then the message is "no boot partition". If initrd is not found in that directory, then the message is "Initrd not found".

The "no boot partition" message can't be more specific, because it is perfectly valid to have 3 FAT partitions, all with EFI_USED_BY_OS flag, but only the last having a BOOTBOOT directory. (It would be better if GPT had a unique bootable flag like MBR's 0x80 which can be set on only one partition at a time, but it has not.)

EDIT2: gzip in BIOS version fixed too. All compressed images that were reported broken are now booting successfully.

Cheers,
bzt
Ah, I completely missed the part in the docs that says I need a GPT partition. I didn't have that in my image. Thank you very much! I will try it out.
Post Reply