NetBSD-Bugs archive

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

install/55380: sysinst/Makefile.inc has confusing MBR and GPT defaults



>Number:         55380
>Category:       install
>Synopsis:       sysinst/Makefile.inc has confusing MBR and GPT defaults
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    install-manager
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Fri Jun 12 18:25:00 +0000 2020
>Originator:     Izumi Tsutsui
>Release:        NetBSD 9.0
>Organization:
>Environment:
System: all
Architecture: all
Machine: all
>Description:
MBR and GPT supports are enabled by "NO_MBR" and "NO_GPT" macro
in src/usr.sbin/sysinst/arch/*/Makefile.

However there is inconsistency the default values:
---
.if ${NO_GPT:Uno} != "yes"
CPPFLAGS+=	-DHAVE_GPT
GPT_DIR=${.CURDIR}/../../../../sbin/gpt
SRCS+=	gpt.c gpt_uuid.c
CPPFLAGS.gpt_uuid.c+=	-I${GPT_DIR}
CPPFLAGS.gpt.c+=	-I${GPT_DIR}
.endif
.if ${NO_MBR:Uyes} != "yes"
CPPFLAGS+=	-DHAVE_MBR
SRCS+=	mbr.c
.endif
---

For MBR, "NO_MBR=yes" is default, so ports which require MBR
should set "NO_MBR=no" in MD Makefiles.

For GPT, NO_GPT=no is default, so ports which "do not" require GPT
should set "NO_MBR=yes" in MD Makefiles.

On most ports don't define "NO_GPT=yes" in MD Makefiles
so unnecessary GPT support is pulled into sysinst on many ports.

>How-To-Repeat:
Code inspection.

>Fix:
For GPT, it's better to use positive "HAVE_GPT=yes" macro
and make its default to "no"?

For MBR, it's much easier to check "LABELUSESMBR" macro in
<machine/disklabel.h>?

No idea about "NO_CLONE" macro (I don't know what it means).

---
Izumi Tsutsui



Home | Main Index | Thread Index | Old Index