Changeset View
Standalone View
usr.bin/mkimg/gpt.c
| Show First 20 Lines • Show All 202 Lines • ▼ Show 20 Lines | TAILQ_FOREACH(part, &partlist, link) { | ||||
| le64enc(&ent->ent_lba_end, part->block + part->size - 1); | le64enc(&ent->ent_lba_end, part->block + part->size - 1); | ||||
| if (part->label != NULL) { | if (part->label != NULL) { | ||||
| idx = 0; | idx = 0; | ||||
| while ((c = part->label[idx]) != '\0') { | while ((c = part->label[idx]) != '\0') { | ||||
| le16enc(ent->ent_name + idx, c); | le16enc(ent->ent_name + idx, c); | ||||
| idx++; | idx++; | ||||
| } | } | ||||
| } | } | ||||
| if (part->index + 1 == active_partition) { | |||||
imp: One final nit... For GPT this is FreeBSD specific. The GPT standard just sets these bits aside… | |||||
sobomaxAuthorUnsubmitted Done Inline ActionsHmm, yet Windows at least sets those bits when installing itself: $ sudo parted /dev/nvme0n1 print Number Start End Size File system Name Flags sobomax: Hmm, yet Windows at least sets those bits when installing itself:
$ sudo parted /dev/nvme0n1… | |||||
impUnsubmitted Not Done Inline ActionsAre you sure? They aren't in the GPT/UEFI standard. 'boot' flag for parted has the value of '1' and is generated within parted. while the bootme flag for FreeBSD has a value of (1ULL << 59) and is definitely outside of the standard flags. imp: Are you sure? They aren't in the GPT/UEFI standard.
'boot' flag for parted has the value of… | |||||
| le64enc(&ent->ent_attr, GPT_ENT_ATTR_BOOTME); | |||||
| } | |||||
| } | } | ||||
| return (tbl); | return (tbl); | ||||
| } | } | ||||
| static int | static int | ||||
| gpt_write_hdr(struct gpt_hdr *hdr, uint64_t self, uint64_t alt, uint64_t tbl) | gpt_write_hdr(struct gpt_hdr *hdr, uint64_t self, uint64_t alt, uint64_t tbl) | ||||
| { | { | ||||
| uint32_t crc; | uint32_t crc; | ||||
| ▲ Show 20 Lines • Show All 78 Lines • Show Last 20 Lines | |||||
One final nit... For GPT this is FreeBSD specific. The GPT standard just sets these bits aside for the OS to do what it wants... Linux, windows and MacOS all ignore it.
A small comment to this effect would be good.