tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: GPT attributes in dkwedge [PATCH]



    Date:        Sat, 16 Sep 2023 05:01:00 +0000
    From:        Emmanuel Dreyfus <manu%netbsd.org@localhost>
    Message-ID:  <ZQU2jKYAWyzHCOpG%homeworld.netbsd.org@localhost>

  | Initial proposal was to aad access to the bootme flag in dkwedge, 
  | which has been considered bad design, and I agreed with that. 

Yes, but that's not what was really wrong with the proposal.

  | The patch moves the GPT parser out of dkwedge so that it can
  | be used by other kernel componentx.

That part of it is fine.

  | dkwedge use it to do the
  | job it was doing before, and raiddframe use it to solve a 
  | raidframe-specific issue.
  |
  | Hence this is already "handled some other way" as once proposed.

No it isn't, I have looked at the latest patch now, and it contains:

Index: sys/dev/raidframe/rf_netbsdkintf.c
===================================================================
RCS file: /cvsroot/src/sys/dev/raidframe/rf_netbsdkintf.c,v
retrieving revision 1.412
diff -U4 -r1.412 rf_netbsdkintf.c
--- sys/dev/raidframe/rf_netbsdkintf.c	15 Jun 2023 09:15:54 -0000	1.412
+++ sys/dev/raidframe/rf_netbsdkintf.c	14 Sep 2023 06:31:23 -0000
[... some deleted]
+static int
+rf_gptroot_cb(struct gpt_ent *ent, int partnum, void *data)
+{
+	struct rf_gptroot_ctx *ctx = data;
+	static const struct uuid ent_type_ffs = GPT_ENT_TYPE_NETBSD_FFS;
+	struct uuid ptype_guid;
+
+	if (le64toh(ent->ent_attr) & GPT_ENT_ATTR_BOOTME) {
[... more deleted]

That is what you MUST NOT do, BOOTME has nothing whatever to do
with what is root.   That's the part that must be done some other way.

(The bit where the flag was copied into the wedge info was just a
layer violation, and easy to avoid, as your patch showed, that was
never the real issue.)

Fortunately, it seems (as demonstrated by later discussion) that the
"other way" already exists, and none of this is needed at all.

kre



Home | Main Index | Thread Index | Old Index