tech-kern archive

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

GPT attributes in dkwedgeq



Hello

Context: if a RAIDframe set contains a GPT, it does not honour the
bootme atrtribute when loking for the root partition. The current 
behavior hardcodes the use of the first partition.

Fixing this requires rf_buildroothack() to know about the bootme
GPT attribute, but that information is not available from struct 
dkwedge_info.  I see the following ways to address the problem:

1) Read the GPT again in rf_buildroothack() and walk it looking
for the bootme attribute. This involves duplicating a lot of
code from sys/dev/dkwedge/dkwedge_gpt.c. I gave it a try and it
works, but I am not happy with doing the job twice, both in 
source code and at runtime.

2) Make sys/dev/dkwedge/dkwedge_gpt.c record the bootme flag
when it walks the GPT. The problem is where can we store it?

2a) We could create an enha&nced struct dkwedge_info2, it could
have an flags field, or we could even an a union field for the
underlying partition entry (MBR, BSD label, GPT...). But since
struct dkwedge_info is known to userland, that would not be
an easy change.

2b) struct dkwedge_softc is private, we could add a field here
without being intrusive, it would just need accessor functions:
int dkwedge_set_flags(struct disk *pdk, int partnum, int flags);
int dkwedge_get_flags(struct disk *pdk, int partnum, int *flags);

3) Another idea?

I would favor solution 2b. For now it would just be a flags field
with just the bootme flag, but since struct dkwedge_softc is private, 
we can easily  change that to something more complicated later, if 
needed.

Opinions?

-- 
Emmanuel Dreyfus
manu%netbsd.org@localhost


Home | Main Index | Thread Index | Old Index